Beispiel #1
0
 def _init_Rapid7(self, config):
     self.AUTH_URL = ConnectorUtil.get_config_setting(
         self._logger, config, "Rapid7", "rapid7.auth_url")
     self.USERNAME = ConnectorUtil.get_config_setting(
         self._logger, config, "Rapid7", "rapid7.username")
     self.PASSWORD = ConnectorUtil.get_config_setting(
         self._logger, config, "Rapid7", "rapid7.password")
Beispiel #2
0
 def _init_passivetotal(self, config):
     self.URL = ConnectorUtil.get_config_setting(self._logger, config,
                                                 "PassiveTotal", "pt.url")
     self.KEY = ConnectorUtil.get_config_setting(self._logger, config,
                                                 "PassiveTotal", "pt.key")
     self.TOKEN = ConnectorUtil.get_config_setting(self._logger, config,
                                                   "PassiveTotal",
                                                   "pt.token")
Beispiel #3
0
 def _init_vt(self, config):
     self.URL = ConnectorUtil.get_config_setting(self._logger, config,
                                                 "VirusTotal",
                                                 "virustotal.url")
     self.PRIVATE_APIKEY = ConnectorUtil.get_config_setting(
         self._logger, config, "VirusTotal", "virustotal.apikey")
     self.PUBLIC_APIKEY = ConnectorUtil.get_config_setting(
         self._logger, config, "VirusTotal", "virustotal.public_apikey")
Beispiel #4
0
 def _init_umbrella(self, config):
     """
     Obtain the configuration data
     """
     self.URL = ConnectorUtil.get_config_setting(self._logger, config,
                                                 "Cisco", "umbrella.url",
                                                 'str', self.URL)
     self.TOKEN = ConnectorUtil.get_config_setting(self._logger, config,
                                                   "Cisco", "umbrella.key")
Beispiel #5
0
 def _init_splunk_connection(self, config):
     self.HOST = ConnectorUtil.get_config_setting(self._logger, config,
                                                  'Splunk', 'splunk.host')
     self.PORT = ConnectorUtil.get_config_setting(self._logger, config,
                                                  'Splunk', 'splunk.port')
     self.USERNAME = ConnectorUtil.get_config_setting(
         self._logger, config, 'Splunk', 'splunk.username')
     self.PASSWORD = ConnectorUtil.get_config_setting(
         self._logger, config, 'Splunk', 'splunk.password')
Beispiel #6
0
 def _init_facebook(self, config):
     self.BASE_URL = ConnectorUtil.get_config_setting(
         self._logger, config, "Facebook", "fb.url")
     self.KEY = ConnectorUtil.get_config_setting(self._logger, config,
                                                 "Facebook", "fb.app_id")
     self.TOKEN = ConnectorUtil.get_config_setting(self._logger, config,
                                                   "Facebook",
                                                   "fb.app_secret")
     self.VERSION = ConnectorUtil.get_config_setting(
         self._logger, config, "Facebook", "fb.graph_version")
Beispiel #7
0
 def _init_azure(self, config):
     self.TENANT_ID = ConnectorUtil.get_config_setting(
         self._logger, config, "Azure", "az.tenant_id")
     self.CLIENT_ID = ConnectorUtil.get_config_setting(
         self._logger, config, "Azure", "az.client_id")
     self.KEY = ConnectorUtil.get_config_setting(self._logger, config,
                                                 "Azure", "az.sp_password")
     self.SUBSCRIPTION_ID = ConnectorUtil.get_config_setting(
         self._logger, config, "Azure", "az.subscription_id")
     self.FILE_PATH = ConnectorUtil.get_config_setting(
         self._logger, config, "Azure", "az.file_path")
Beispiel #8
0
 def _init_ultra_connection(self, config):
     self.USERNAME = ConnectorUtil.get_config_setting(
         self._logger, config, "UltraDNS", "ultra.username")
     self.PASSWORD = ConnectorUtil.get_config_setting(
         self._logger, config, "UltraDNS", "ultra.password")
     self.LOGIN = ConnectorUtil.get_config_setting(self._logger, config,
                                                   "UltraDNS",
                                                   "ultra.login_url")
     self.ZONES = ConnectorUtil.get_config_setting(self._logger, config,
                                                   "UltraDNS",
                                                   "ultra.zones_listing")
     self.ZONEINFO = ConnectorUtil.get_config_setting(
         self._logger, config, "UltraDNS", "ultra.zones_dns")
Beispiel #9
0
 def __init_iblox_connection(self, config):
     self.HOST = ConnectorUtil.get_config_setting(
         self._logger, config, "Infoblox", "infoblox.HOST"
     )
     self.UNAME = ConnectorUtil.get_config_setting(
         self._logger, config, "Infoblox", "infoblox.username"
     )
     self.PASSWD = ConnectorUtil.get_config_setting(
         self._logger, config, "Infoblox", "infoblox.passwd"
     )
     self.VERSION = ConnectorUtil.get_config_setting(
         self._logger, config, "Infoblox", "infoblox.version"
     )
Beispiel #10
0
 def _init_splunk_hec_connection(self, config):
     """
     Initialize the class members
     """
     self.HOST = ConnectorUtil.get_config_setting(self._logger, config,
                                                  "SplunkHEC",
                                                  "splunk.host")
     self.PORT = ConnectorUtil.get_config_setting(self._logger, config,
                                                  "SplunkHEC",
                                                  "splunk.port")
     self.ACCESS_TOKEN = ConnectorUtil.get_config_setting(
         self._logger, config, "SplunkHEC", "splunk.access_token")
     self.HOSTNAME = ConnectorUtil.get_config_setting(
         self._logger, config, "SplunkHEC", "splunk.hostname")
     self.INDEX = ConnectorUtil.get_config_setting(self._logger, config,
                                                   "SplunkHEC",
                                                   "splunk.index")
     self.URL = "https://" + self.HOST + ":" + self.PORT + "/services/collector/"
     self.HEADERS = {"Authorization": "Splunk {}".format(self.ACCESS_TOKEN)}
Beispiel #11
0
 def _init_splunk_connection(self, config):
     """
     Initialize defaults
     """
     self.HOST = ConnectorUtil.get_config_setting(
         self._logger, config, "Splunk", "splunk.host"
     )
     self.PORT = ConnectorUtil.get_config_setting(
         self._logger, config, "Splunk", "splunk.port"
     )
     self.USERNAME = ConnectorUtil.get_config_setting(
         self._logger, config, "Splunk", "splunk.username"
     )
     self.PASSWORD = ConnectorUtil.get_config_setting(
         self._logger, config, "Splunk", "splunk.password"
     )
     self.APP = ConnectorUtil.get_config_setting(
         self._logger, config, "Splunk", "splunk.app"
     )
Beispiel #12
0
    def _init_mongo_connection(self, config):
        """Obtains all the parameters from the config file"""
        protocol = ConnectorUtil.get_config_setting(self._logger, config,
                                                    "MongoDB",
                                                    "mongo.protocol")
        endpoint = ConnectorUtil.get_config_setting(self._logger, config,
                                                    "MongoDB", "mongo.host")
        path = ConnectorUtil.get_config_setting(self._logger, config,
                                                "MongoDB", "mongo.path")
        username = ConnectorUtil.get_config_setting(self._logger, config,
                                                    "MongoDB",
                                                    "mongo.username")
        password = ConnectorUtil.get_config_setting(self._logger, config,
                                                    "MongoDB",
                                                    "mongo.password")
        cacert = ConnectorUtil.get_config_setting(self._logger, config,
                                                  "MongoDB", "mongo.ca_cert")

        if username != "" and password != "":
            connection_string = (protocol + username + ":" + password + "@" +
                                 endpoint + path)
        else:
            connection_string = protocol + endpoint + path

        if cacert != "":
            client = MongoClient(connection_string, tls=True, tlsCAFile=cacert)
        else:
            client = MongoClient(connection_string)

        self.m_connection = client[path[1:]]
    def _init_mongo_connection(self, config):
        protocol = ConnectorUtil.get_config_setting(self._logger, config,
                                                    "RemoteMongoDB",
                                                    "mongo.protocol")
        endpoint = ConnectorUtil.get_config_setting(self._logger, config,
                                                    "RemoteMongoDB",
                                                    "mongo.host")
        path = ConnectorUtil.get_config_setting(self._logger, config,
                                                "RemoteMongoDB", "mongo.path")
        username = ConnectorUtil.get_config_setting(self._logger, config,
                                                    "RemoteMongoDB",
                                                    "mongo.username")
        password = ConnectorUtil.get_config_setting(self._logger, config,
                                                    "RemoteMongoDB",
                                                    "mongo.password")
        cacert = ConnectorUtil.get_config_setting(self._logger, config,
                                                  "RemoteMongoDB",
                                                  "mongo.ca_cert")

        if username != "" and password != "":
            connection_string = protocol + username + ":" + password + "@" + endpoint + path
        else:
            connection_string = protocol + endpoint + path

        if cacert != "":
            client = MongoClient(connection_string,
                                 ssl=True,
                                 ssl_ca_certs=cacert)
        else:
            client = MongoClient(connection_string)

        self.m_connection = client[path[1:]]