コード例 #1
0
ファイル: connection_limits.py プロジェクト: 3pings/aci
    def __init__(self):
        '''
        Constructor
        '''
        DMObject.__init__(self,
                          ifc_key='ConnectionSettings',
                          asa_key='set connection')
        conn_ifc_asa_keys = [  # IFC Key                    ASA Key                               Default
            #connection limits
            ("conn_max", "set connection conn-max", '0'),
            ("conn_max_embryonic", "set connection embryonic-conn-max", '0'),
            ("per_client_max", "set connection per-client-max", '0'),
            ("per_client_max_embryonic",
             "set connection per-client-embryonic-max", '0'),
            ("random_seq_num", "set connection random-sequence-number",
             'enable')
        ]
        conn_timeout_ifc_asa_keys = [  # IFC Key                    ASA Key                               Default
            #connection timeouts
            ("timeout_embryonic", "set connection timeout embryonic", '0:0:30'
             ),
            ("timeout_half_closed", "set connection timeout half-closed",
             '0:10:0')
        ]

        for (ifc, asa, dflt) in conn_ifc_asa_keys:
            self.register_child(ConnObj(ifc, asa, dflt))
        for (ifc, asa, dflt) in conn_timeout_ifc_asa_keys:
            self.register_child(ConnTimeoutObj(ifc, asa, dflt))
        self.register_child(ConnTimeoutIdle())
        self.register_child(ConnTimeoutDcd())
コード例 #2
0
 def __init__(self, instance):
     DMObject.__init__(self, ifc_key=instance)
     self.defaults = {
         'protocol': {'name_number': 'ip'},
         'source_address': {'any': 'any'},
         'destination_address': {'any': 'any'}
     }
コード例 #3
0
 def __init__(self):
     DMObject.__init__(self, FailoverConfig.__name__)
     ifc_asa_keys = (
         ("lan_unit", "failover lan unit"),
         ("key_secret", "failover key"),
         ("key_in_hex", "failover key hex"),
         ("interface_policy", "failover interface-policy"),
     )
     for ifc, asa in ifc_asa_keys:
         self.register_child(SimpleType(ifc, asa, response_parser=failover_response_parser))
     self.register_child(
         DMBoolean(
             "http_replication",
             "failover replication http",
             on_value="enable",
             response_parser=failover_response_parser,
         )
     )
     self.register_child(DMList("mgmt_standby_ip", MgmtStandbyIP, asa_key="ip address"))
     self.register_child(DMList("failover_lan_interface", FailoverLANInterface, asa_key="failover lan interface"))
     self.register_child(DMList("failover_link_interface", FailoverLinkInterface, asa_key="failover link"))
     self.register_child(DMList("failover_ip", FailoverIP, asa_key="failover interface ip"))
     self.register_child(DMList("polltime", FailoverPolltime, asa_key="failover polltime"))
     self.response_parser = failover_response_parser
     self.register_child(
         DMBoolean(
             ifc_key="failover", asa_key="failover", on_value="enable", response_parser=failover_response_parser
         )
     )
コード例 #4
0
    def __init__(self):
        '''
        Constructor
        '''
        DMObject.__init__(self, ifc_key = 'ConnectionSettings', asa_key = 'set connection')
        conn_ifc_asa_keys = [# IFC Key                    ASA Key                               Default
                        #connection limits
                        ("conn_max",                  "set connection conn-max",                 '0'),
                        ("conn_max_embryonic",        "set connection embryonic-conn-max",       '0'),
                        ("per_client_max",            "set connection per-client-max",           '0'),
                        ("per_client_max_embryonic",  "set connection per-client-embryonic-max", '0'),
                        ("random_seq_num",            "set connection random-sequence-number",   'enable')
                        ]
        conn_timeout_ifc_asa_keys = [# IFC Key                    ASA Key                               Default
                        #connection timeouts
                        ("timeout_embryonic",         "set connection timeout embryonic",         '0:0:30'),
                        ("timeout_half_closed",       "set connection timeout half-closed",       '0:10:0')

        ]

        for (ifc, asa, dflt) in conn_ifc_asa_keys:
            self.register_child(ConnObj(ifc, asa, dflt))
        for (ifc, asa, dflt) in conn_timeout_ifc_asa_keys:
            self.register_child(ConnTimeoutObj(ifc, asa, dflt))
        self.register_child(ConnTimeoutIdle())
        self.register_child(ConnTimeoutDcd())
コード例 #5
0
ファイル: failover.py プロジェクト: 3pings/aci
 def __init__(self):
     DMObject.__init__(self, FailoverConfig.__name__)
     ifc_asa_keys = (("lan_unit", "failover lan unit"),
                     ("key_secret", "failover key"), ("key_in_hex",
                                                      "failover key hex"),
                     ("interface_policy", "failover interface-policy"))
     for ifc, asa in ifc_asa_keys:
         self.register_child(
             SimpleType(ifc, asa, response_parser=failover_response_parser))
     self.register_child(
         DMBoolean('http_replication',
                   'failover replication http',
                   on_value="enable",
                   response_parser=failover_response_parser))
     self.register_child(
         DMList('mgmt_standby_ip', MgmtStandbyIP, asa_key='ip address'))
     self.register_child(
         DMList('failover_lan_interface',
                FailoverLANInterface,
                asa_key='failover lan interface'))
     self.register_child(
         DMList('failover_link_interface',
                FailoverLinkInterface,
                asa_key='failover link'))
     self.register_child(
         DMList('failover_ip', FailoverIP, asa_key='failover interface ip'))
     self.register_child(
         DMList('polltime', FailoverPolltime, asa_key='failover polltime'))
     self.response_parser = failover_response_parser
     self.register_child(
         DMBoolean(ifc_key="failover",
                   asa_key="failover",
                   on_value="enable",
                   response_parser=failover_response_parser))
コード例 #6
0
ファイル: dns.py プロジェクト: 3pings/aci
    def populate_model(self, delta_ifc_key, delta_ifc_cfg_value):
        'Override the default implementation because the IFC model does not directly map to self.children of DNSServer'
        DMObject.populate_model(self, delta_ifc_key, delta_ifc_cfg_value)

        'Let DNSServer share the configuration with this translator'
        dns_server = self.children.values()[1]
        dns_server.populate_model(delta_ifc_key, delta_ifc_cfg_value)
コード例 #7
0
    def __init__(self):
        '''
        Constructor
        '''

        DMObject.__init__(self, ScanningThreatDetection.__name__)

        self.register_child(
            SimpleScanning('scanning_threat', self.THREAT_DETECTION_SCANNING))
        self.register_child(
            SimpleShun('shun_status', self.THREAT_DETECTION_SCANNING_SHUN))
        rate_translator = DMList('ScanningThreatRate',
                                 ScanningThreatRate,
                                 asa_key=self.THREAT_DETECTION_SCANNING_RATE)
        self.register_child(rate_translator)
        rate_translator = DMList('ScanningThreatShunExceptIP',
                                 ShunExceptIP,
                                 asa_key=self.THREAT_DETECTION_SCANNING_SHUN +
                                 " except ip-address")
        self.register_child(rate_translator)
        rate_translator = DMList('ScanningThreatShunExceptObject',
                                 ShunExceptObject,
                                 asa_key=self.THREAT_DETECTION_SCANNING_SHUN +
                                 " except object-group")
        self.register_child(rate_translator)

        self.register_child(
            ShunDuration('ScanningThreatShunDuration',
                         self.THREAT_DETECTION_SCANNING_SHUN + " duration"))
コード例 #8
0
ファイル: ntp.py プロジェクト: AlexFengCisco/ACI_REST_Project
 def __init__(self):
     DMObject.__init__(self, NTP.__name__)
     self.register_child(DMList("NTPServer", NTPObj, asa_key="ntp server"))
     self.register_child(DMList(name="NTPTrustedKey", child_class=NTPTrustedKey, asa_key="ntp trusted-key"))
     self.register_child(DMBoolean(ifc_key="NTPAuthenticate", asa_key="ntp authenticate", on_value="enable"))
     self.register_child(
         DMList(name="NTPAuthenticationKey", child_class=NTPAuthenticationKey, asa_key="ntp authentication-key")
     )
コード例 #9
0
 def __init__(self):
     ''' Initialize '''
     DMObject.__init__(self, ifc_key = 'NetFlowSettings', asa_key='flow-export')
     self.mode_command = None
     self.register_child(ExportEventType('ExportAllEvent', 'flow-export event-type all destination'))
     self.register_child(ExportEventType('ExportCreationEvent', 'flow-export event-type flow-create destination'))
     self.register_child(ExportEventType('ExportDenyEvent', 'flow-export event-type flow-denied destination'))
     self.myconfig = None
コード例 #10
0
 def __init__(self):
     '''
     Constructor
     '''
     
     DMObject.__init__(self, ifc_key = 'InspectionSettings', asa_key = 'inspect')
     self.mode_command = None
     
     for ifc, cli_prefix, is_default in InspectionSubCommands.ifc_asa_keys:
         self.register_child(DMBoolean(ifc, cli_prefix, on_value="enable"))
コード例 #11
0
ファイル: basic_threat_detect.py プロジェクト: 3pings/aci
    def __init__(self):
        '''
        Constructor
        '''
        DMObject.__init__(self, BasicThreatDetection.__name__)
        self.audit = False
        self.register_child(SimpleBasicThreat("basic_threat", 'threat-detection basic-threat', on_value="enable",
             response_parser=cli_interaction.ignore_warning_response_parser))

        for rate_type in self.RATE_OPTIONS:
            self.register_child(BasicThreatRateList('BasicThreatDetectionRate' + self.to_camel_case(rate_type), BasicThreatRate, asa_key='threat-detection rate ' + rate_type, rate_type = rate_type))
コード例 #12
0
    def __init__(self):
        '''
        Constructor
        '''

        DMObject.__init__(self,
                          ifc_key='InspectionSettings',
                          asa_key='inspect')
        self.mode_command = None

        for ifc, cli_prefix, is_default in InspectionSubCommands.ifc_asa_keys:
            self.register_child(DMBoolean(ifc, cli_prefix, on_value="enable"))
コード例 #13
0
ファイル: access_rule.py プロジェクト: 3pings/aci
 def __init__(self, instance):
     DMObject.__init__(self, ifc_key=instance)
     self.defaults = {
         'protocol': {
             'name_number': 'ip'
         },
         'source_address': {
             'any': 'any'
         },
         'destination_address': {
             'any': 'any'
         }
     }
コード例 #14
0
 def __init__(self):
     '''
     Constructor
     '''
     self.interface = None
     DMObject.__init__(self, TemplateAndCollectors.__name__)
    
     self.response_parser = self.ignore_msg_response_parser
     
     self.register_child(DMList('NetFlowCollectors', NetFlowCollectors, asa_key='flow-export destination'))
     self.register_child(TemplateTimeout("template_timeout_rate", self.FLOW_EXPORT_TIMEOUT_RATE))
     self.register_child(DelayFlowCreate("delay_flow_create", self.FLOW_EXPORT_DELAY_CREATE))
     self.register_child(ActiveRefresh("active_refresh_interval", self.FLOW_EXPORT_REFRESH_RATE))
コード例 #15
0
ファイル: netflow_objects.py プロジェクト: 3pings/aci
 def __init__(self):
     ''' Initialize '''
     DMObject.__init__(self,
                       ifc_key='NetFlowSettings',
                       asa_key='flow-export')
     self.mode_command = None
     self.register_child(
         ExportEventType('ExportAllEvent',
                         'flow-export event-type all destination'))
     self.register_child(
         ExportEventType('ExportCreationEvent',
                         'flow-export event-type flow-create destination'))
     self.register_child(
         ExportEventType('ExportDenyEvent',
                         'flow-export event-type flow-denied destination'))
     self.myconfig = None
コード例 #16
0
    def __init__(self):
        '''
        Constructor
        '''


        DMObject.__init__(self, ScanningThreatDetection.__name__)

        self.register_child(SimpleScanning('scanning_threat', self.THREAT_DETECTION_SCANNING))
        self.register_child(SimpleShun('shun_status', self.THREAT_DETECTION_SCANNING_SHUN))
        rate_translator = DMList('ScanningThreatRate', ScanningThreatRate, asa_key=self.THREAT_DETECTION_SCANNING_RATE)
        self.register_child(rate_translator)
        rate_translator = DMList('ScanningThreatShunExceptIP', ShunExceptIP, asa_key=self.THREAT_DETECTION_SCANNING_SHUN + " except ip-address")
        self.register_child(rate_translator)
        rate_translator = DMList('ScanningThreatShunExceptObject', ShunExceptObject, asa_key=self.THREAT_DETECTION_SCANNING_SHUN + " except object-group")
        self.register_child(rate_translator)

        self.register_child(ShunDuration('ScanningThreatShunDuration', self.THREAT_DETECTION_SCANNING_SHUN + " duration"))
コード例 #17
0
    def __init__(self):
        '''
        Constructor
        '''
        DMObject.__init__(self, AdvancedThreatDetection.__name__)

        self.has_device = False
        translator = SimpleAccessList("access_list", self.THREAT_DETECTION_STATISTICS_ACCESS_LIST, on_value="enable",
                            response_parser=cli_interaction.ignore_warning_response_parser)
        self.register_child(translator)

        for opt in ['host', 'port', 'protocol']:
            translator = NumberOfRateOption('AdvancedThreatDetection' + opt.title(), self.THREAT_DETECTION_STATISTICS + ' ' + opt)
            self.register_child(translator)

        translator = TcpIntercept('AdvancedThreatDetectionTcpIntercept', self.THREAT_DETECTION_STATISTICS_TCP_INTERCEPT)
        self.register_child(translator)

        translator = SimpleStatistics("statistics", self.THREAT_DETECTION_STATISTICS, on_value="enable",
                            response_parser=cli_interaction.ignore_warning_response_parser)
        self.register_child(translator)
コード例 #18
0
ファイル: logging.py プロジェクト: 3pings/aci
    def __init__(self):
        DMObject.__init__(self, LoggingConfig.__name__)

        ifc_asa_keys = (("facility", "logging facility"), ("buffered_level",
                                                           "logging buffered"),
                        ("buffer_size", "logging buffer-size"),
                        ("flash_maximum_allocation",
                         "logging flash-maximum-allocation"),
                        ("flash_minimum_free", "logging flash-minimum-free"))
        for (ifc, asa) in ifc_asa_keys:
            self.register_child(
                SimpleType(ifc,
                           asa,
                           is_removable=True,
                           response_parser=cli_interaction.
                           ignore_warning_response_parser))

        self.register_child(LoggingTrap())
        ifc_asa_keys_boolean_type = (("enable_logging", "logging enable"),
                                     ("standby", "logging standby"),
                                     ("flash_bufferwrap",
                                      "logging flash-bufferwrap"),
                                     ("permit_hostdown",
                                      "logging permit-hostdown"))
        for (ifc, asa) in ifc_asa_keys_boolean_type:
            self.register_child(
                DMBoolean(ifc,
                          asa,
                          on_value="enable",
                          response_parser=cli_interaction.
                          ignore_warning_response_parser))

        self.register_child(
            DMList('logging_host', LoggingHost, asa_key='logging host'))
        self.register_child(
            DMList('logging_message',
                   LoggingMessage,
                   asa_key='logging message'))
        self.response_parser = cli_interaction.ignore_warning_response_parser
コード例 #19
0
ファイル: netflow_objects.py プロジェクト: 3pings/aci
    def __init__(self):
        '''
        Constructor
        '''
        self.interface = None
        DMObject.__init__(self, TemplateAndCollectors.__name__)

        self.response_parser = self.ignore_msg_response_parser

        self.register_child(
            DMList('NetFlowCollectors',
                   NetFlowCollectors,
                   asa_key='flow-export destination'))
        self.register_child(
            TemplateTimeout("template_timeout_rate",
                            self.FLOW_EXPORT_TIMEOUT_RATE))
        self.register_child(
            DelayFlowCreate("delay_flow_create",
                            self.FLOW_EXPORT_DELAY_CREATE))
        self.register_child(
            ActiveRefresh("active_refresh_interval",
                          self.FLOW_EXPORT_REFRESH_RATE))
コード例 #20
0
ファイル: netflow_objects.py プロジェクト: 3pings/aci
 def __init__(self):
     ''' Initialize '''
     DMObject.__init__(self, 'NetFlowObjects')
     self.register_child(TemplateAndCollectors())
コード例 #21
0
 def __init__(self):
     DMObject.__init__(self, NATRuleDeployment.__name__)
     self.xlate_clis = []
コード例 #22
0
ファイル: access_rule.py プロジェクト: 3pings/aci
 def __init__(self):
     DMObject.__init__(self, AccessListDeployment.__name__)
     self.acl_changed = False
コード例 #23
0
 def __init__(self, instance):
     DMObject.__init__(self, ifc_key=instance)
コード例 #24
0
 def __init__(self):
     DMObject.__init__(self, 'ExtStaticRoute')
     self.register_child(RouteList("route", "external"))
     self.register_child(RouteList("ipv6 route", "external"))
コード例 #25
0
ファイル: cluster.py プロジェクト: 3pings/aci
 def __init__(self):
     DMObject.__init__(self, ClusterConfig.__name__)
     self.register_child(ClusterRole())
     self.register_child(DMList('pool_config', PoolConfig, asa_key='ip local pool'))
     self.register_child(BootstrapConfig())
     self.register_child(ClusterMtu())
コード例 #26
0
 def __init__(self):
     ''' Initialize '''
     DMObject.__init__(self, 'NetFlowObjects')
     self.register_child(TemplateAndCollectors())
コード例 #27
0
ファイル: cluster.py プロジェクト: 3pings/aci
 def __init__(self):
     DMObject.__init__(self, 'cluster_role')
コード例 #28
0
 def __init__(self):
     DMObject.__init__(self, AccessListDeployment.__name__)
     self.acl_changed = False
コード例 #29
0
ファイル: nat_rule.py プロジェクト: 3pings/aci
 def __init__(self, instance):
     DMObject.__init__(self, ifc_key=instance)
コード例 #30
0
ファイル: nat_rule.py プロジェクト: 3pings/aci
 def __init__(self):
     DMObject.__init__(self, NATRuleDeployment.__name__)
     self.xlate_clis = []
コード例 #31
0
 def __init__(self):
     DMObject.__init__(self, 'ExtStaticRoute')
     self.register_child(RouteList("route", "external"))
     self.register_child(RouteList("ipv6 route", "external"))
コード例 #32
0
 def __init__(self):
     DMObject.__init__(self, SmartCallHome.__name__)
     self.register_child(
         DMBoolean(ifc_key='anonymous_reporting',
                   asa_key=ANONYMOUS_REPORTING_CLI,
                   on_value='enable'))
コード例 #33
0
ファイル: dns.py プロジェクト: 3pings/aci
 def __init__(self):
     DMObject.__init__(self, DNS.__name__)
     self.register_child(DNSDomainLookup())
     self.register_child(DNSServer())