panos_util/objects.py
def create_from_element(e: Element) -> VulnerabilityProfileRule:
        """Create VulnerabilityProfileRule from XML element."""
        name = e.get("name")

        vendor_ids = []
        for vendor_id in e.findall(".//vendor-id/member"):
            vendor_ids.append(vendor_id.text)

        severities = []
        for severity in e.findall(".//severity/member"):
            severities.append(severity.text)

        cve_ids = []
        for cve in e.findall(".//cve/member"):
            cve_ids.append(cve.text)

        action = None
        if e.find(".//action/") is not None:
            action = e.find(".//action/").tag

        threat_name = strip_empty(e.findtext(".//threat-name"))
        host = strip_empty(e.findtext(".//host"))
        category = strip_empty(e.findtext(".//category"))
        packet_capture = strip_empty(e.findtext(".//packet-capture"))

        return VulnerabilityProfileRule(
            name,
            vendor_ids,
            cve_ids,
            severities,
            action,
            threat_name,
            host,
            category,
            packet_capture,
        )
Create VulnerabilityProfileRule from XML element.
Create VulnerabilityProfileRule from XML element.
Create VulnerabilityProfileRule from XML element .
def create_from_element(e: Element) -> VulnerabilityProfileRule:
        name = e.get("name")
        vendor_ids = []
        for vendor_id in e.findall(".//vendor-id/member"):
            vendor_ids.append(vendor_id.text)
        severities = []
        for severity in e.findall(".//severity/member"):
            severities.append(severity.text)
        cve_ids = []
        for cve in e.findall(".//cve/member"):
            cve_ids.append(cve.text)
        action = None
        if e.find(".//action/") is not None:
            action = e.find(".//action/").tag
        threat_name = strip_empty(e.findtext(".//threat-name"))
        host = strip_empty(e.findtext(".//host"))
        category = strip_empty(e.findtext(".//category"))
        packet_capture = strip_empty(e.findtext(".//packet-capture"))
        return VulnerabilityProfileRule(
            name,
            vendor_ids,
            cve_ids,
            severities,
            action,
            threat_name,
            host,
            category,
            packet_capture,
        )
def create_from_element ( e : Element ) -> VulnerabilityProfileRule : name = e . get ( "name" ) vendor_ids = [ ] for vendor_id in e . findall ( ".//vendor-id/member" ) : vendor_ids . append ( vendor_id . text ) severities = [ ] for severity in e . findall ( ".//severity/member" ) : severities . append ( severity . text ) cve_ids = [ ] for cve in e . findall ( ".//cve/member" ) : cve_ids . append ( cve . text ) action = None if e . find ( ".//action/" ) is not None : action = e . find ( ".//action/" ) . tag threat_name = strip_empty ( e . findtext ( ".//threat-name" ) ) host = strip_empty ( e . findtext ( ".//host" ) ) category = strip_empty ( e . findtext ( ".//category" ) ) packet_capture = strip_empty ( e . findtext ( ".//packet-capture" ) ) return VulnerabilityProfileRule ( name , vendor_ids , cve_ids , severities , action , threat_name , host , category , packet_capture , )
Create VulnerabilityProfileRule from XML element.
Create VulnerabilityProfileRule from XML element .
"""Create VulnerabilityProfileRule from XML element."""
e
Element