Beispiel #1
0
    def __init__(self, device=None, *args, **kwargs):
        # Create a class logger
        self._logger = getlogger(__name__ + "." + self.__class__.__name__)

        self.parent = device

        self.service_objects = {}
        self.application_objects = {}
        self.application_container_objects = {}
Beispiel #2
0
    def __init__(self, device=None, *args, **kwargs):
        # Create a class logger
        self._logger = getlogger(__name__ + "." + self.__class__.__name__)

        self.parent = device

        self.service_objects = {}
        self.application_objects = {}
        self.application_container_objects = {}
Beispiel #3
0
    def __init__(self, device, prefix="", ignore_dup_errors=True):
        # Create a class logger
        self._logger = getlogger(__name__ + "." + self.__class__.__name__)
        self.device = device
        self.prefix = prefix
        self.ignore_dup_errors = ignore_dup_errors

        # Build the initial uid-message
        self._uidmessage = ET.fromstring("<uid-message>" +
                                         "<version>1.0</version>" +
                                         "<type>update</type>" + "<payload/>" +
                                         "</uid-message>")
        # Batch state
        self._batch = False
        self._batch_uidmessage = deepcopy(self._uidmessage)
Beispiel #4
0
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
"""Policies module contains policies and rules that exist in the 'Policies' tab in the firewall GUI"""

# import modules
from pandevice import getlogger
from pandevice.base import PanObject, Root, MEMBER, ENTRY
from pandevice.base import VarPath as Var
from pandevice.base import VersionedPanObject
from pandevice.base import VersionedParamPath

# import other parts of this pandevice package
import pandevice.errors as err

logger = getlogger(__name__)


class Rulebase(VersionedPanObject):
    """Rulebase for a Firewall

    Firewall only.  For Panorama, use :class:`pandevice.policies.PreRulebase` or
    :class:`pandevice.policies.PostRulebase`.

    """
    ROOT = Root.VSYS
    CHILDTYPES = (
        "policies.SecurityRule",
        "policies.NatRule",
    )
Beispiel #5
0
 def __init__(self, pandevice):
     # create a class logger
     self._logger = getlogger(__name__ + "." + self.__class__.__name__)
     self.pandevice = pandevice
     self.versions = {}
Beispiel #6
0
import logging
import xml.etree.ElementTree as ET
from copy import deepcopy

# import other parts of this pandevice package
import pandevice
from pandevice import getlogger, yesno
from pandevice import base, firewall, policies
import pandevice.errors as err
from pandevice.base import VarPath as Var
from pandevice.base import PanObject, Root, MEMBER, ENTRY
from pandevice.base import VersionedPanObject, VersionedParamPath

import pan.commit

logger = getlogger(__name__)


class DeviceGroup(VersionedPanObject):
    """Panorama Device-group

    This class and the :class:`pandevice.panorama.Panorama` classes are the only objects that can
    have a :class:`pandevice.firewall.Firewall` child object. In addition to a Firewall, a
    DeviceGroup can have the same children objects as a :class:`pandevice.firewall.Firewall`
    or :class:`pandevice.device.Vsys`.

    See also :ref:`classtree`

    Args:
        name (str): Name of the device-group
        tag (list): Tags as strings
Beispiel #7
0
 def __init__(self, pandevice):
     # create a class logger
     self._logger = getlogger(__name__ + "." + self.__class__.__name__)
     self.pandevice = pandevice
     self.versions = {}