insalata.scanner.modules package

Submodules

insalata.scanner.modules.CaseStudyInterfaceConfiguration module

insalata.scanner.modules.L3toL2Network module

insalata.scanner.modules.L3toL2Network.scan(graph, connectionInfo, logger, thread)

We convert every Layer3Network to a Layer2Network with the same name. This is necessary as we are currently not able to detect layer two networks in physical environments

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Configuration of this collector -> Login information
  • logger (logging:Logger) – The logger this collector shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.NmapService module

insalata.scanner.modules.NmapService.getAddressNode(network, address)

Get the Layer3Address node of a host that has the igven address.

Parameters:
  • network (Layer3Network) – Hostnames the host could have -> Nmap scan
  • address (str) – Address to find
Returns:

Layer3Address node or None

Return type:

Layer3Address

insalata.scanner.modules.NmapService.scan(graph, connectionInfo, logger, thread)

Get all services using a nmap scan. Scanning is executed on the host given in the configuration. Therefore, Nmap must be installed on the scanning device.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
  • hosts List of network components we shall use to run Nmap. The collector
    connects to the network components in the list using ssh and runs athe Nmap scan. We will not use ssh for ‘localhost’. The used config parser generates a list if the elements are separated by a comma: localhost, myServer as an example
  • control_networks (Optional) Json-Array of Layer three Networks we do NOT want to scan using Nmap
  • options (Optional) Additional Options we want to use for the Nmap scan
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.SSHKeyDnsmasqScriptScan module

insalata.scanner.modules.SSHKeyDnsmasqScriptScan.scan(graph, connectionInfo, logger, thread)

Get DNS information. Information is stord in networks. This scanner uses SSH.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.SSHKeyScriptDHCPScan module

insalata.scanner.modules.SSHKeyScriptDHCPScan.scan(graph, connectionInfo, logger, thread)

Get DHCP information from each Host by using SSH and login with key.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.SSHKeyScriptInterfaceConfigurationScan module

insalata.scanner.modules.SSHKeyScriptInterfaceConfigurationScan.scan(graph, connectionInfo, logger, thread)

Get Interface configuration from hosts over ssh. -> MTU, Rate, Ips This method uses prepacked scripts on templates (read_InterfaceInformation).

We will not add the loopback interface or interfaces with the mac 00:00:00:00:00:00 to the graph.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Configuration of this collector -> Login information
  • logger (logging:Logger) – The logger this collector shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.SSHKeyScriptRoutingScan module

insalata.scanner.modules.SSHKeyScriptRoutingScan.scan(graph, connectionInfo, logger, thread)

Get all routes from software routers in the network. Method uses SSH over keys and a host Script on the template to get the routes.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.SnmpInterfaceCollector module

insalata.scanner.modules.SnmpInterfaceCollector.scan(graph, connectionInfo, logger, thread)

Collect interface information using SNMP.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
  • user Username used for the SNMP login on the remote devices
  • passwordMD5 MD5 SNMP authentication password
  • passwordDES DES SNMP encryption password
  • port (Optional) Port the module shall use for the SNMP connection. Default is 161
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.SnmpRoutingCollector module

insalata.scanner.modules.SnmpRoutingCollector.scan(graph, connectionInfo, logger, thread)

Collect routing information using SNMP.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
  • user Username used for the SNMP login on the remote devices
  • passwordMD5 MD5 SNMP authentication password
  • passwordDES DES SNMP encryption password
  • port (Optional) Port the module shall use for the SNMP connection. Default is 161
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.TcpdumpHostCollector module

insalata.scanner.modules.TcpdumpHostCollector.scan(graph, connectionInfo, logger, thread)

Detect network components using tcpdump. We will only add addresses as Hosts to the the Graph, if there is no Layer3Address with the same ID!

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
  • monitoringServer The network component we want to start tcpdump on.
    If the device is localhost, no ssh connection is used. If the monitoring server != localhost, we will establish an ssh connection
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.XenHardwareScan module

insalata.scanner.modules.XenHardwareScan.scan(graph, connectionInfo, logger, thread)

Get hardware information for each host in a Xen Environment. Method collects hardware data from XenServer. Updates will be stored in existing hosts.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
  • xenuri The URI opf the Xen server
  • xenuser The username we use to connect to the Management API of the Xen server
  • xenpw Password used for the connection
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.XenHostScan module

insalata.scanner.modules.XenHostScan.scan(graph, connectionInfo, logger, thread)

Get all VMs that exist on a xen server.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
  • xenuri The URI opf the Xen server
  • xenuser The username we use to connect to the Management API of the Xen server
  • xenpw Password used for the connection
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.XenInterfaceScan module

insalata.scanner.modules.XenInterfaceScan.getInterfaceRecord(networkRecords, mac)

Get the interface record of xen by it’s mac.

Arguments:
interfaces – Interfaces on xen server. mac – Mac of the interface.
Returns:
network object on success else None.
insalata.scanner.modules.XenInterfaceScan.getNetwork(networks, name)

Get the network with a specific name. This method does not create a network if no network exists with the given name.

Arguments:
networks – Network objects for searching. name – Name the network shall have.
Returns:
network object on success else None.
insalata.scanner.modules.XenInterfaceScan.scan(graph, connectionInfo, logger, thread)

Method reads interface information from a Xen server.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
  • xenuri The URI opf the Xen server
  • xenuser The username we use to connect to the Management API of the Xen server
  • xenpw Password used for the connection
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.XenNetworkScan module

insalata.scanner.modules.XenNetworkScan.scan(graph, connectionInfo, logger, thread)

Get networks on XenServer. Updates the networks list in data.

Necessary values in the configuration file of this collector module:
  • timeout Timeout this collector module shall use (Integer)
  • xenuri The URI opf the Xen server
  • xenuser The username we use to connect to the Management API of the Xen server
  • xenpw Password used for the connection
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.XmlScanner module

insalata.scanner.modules.XmlScanner.readDisks(graph, disksXml, host, logger, name, timeout, readElements)

Load all disks of a host. The disks will be added to the host.

Parameters:
  • graph – Data Interface object for this scanner
  • disksXml (list) – Part of the parsed XML containing the disks of the current host.
  • host (insalata.model.Host.Host) – The host that contains the read interfaces.
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.readFirewallRules(graph, rulesXml, host, logger, name, timeout, readElements)

Load all firewall rules of a host. The rules will be added to the host automatically.

Parameters:
  • graph – Data Interface object for this scanner
  • rulesXml (list) – Part of the parsed XML containing the firewall rules.
  • host (insalata.model.Host.Host) – The host that contains the read firewall rules.
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.readHosts(graph, hostsXml, logger, name, timeout, readElements)

Load hosts of the xml file into the graph.

Parameters:
  • graph – Data Interface object for this scanner
  • hostsXml (list) – Part of the parsed XML containing the hosts.
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.readInterfaces(graph, interfacesXml, host, logger, name, timeout, readElements)

Load all interfaces of a host. The interfaces will be added to the host.

Parameters:
  • graph – Data Interface object for this scanner
  • interfacesXml (list) – Part of the parsed XML containing the interfaces of the current host.
  • host (insalata.model.Host.Host) – The host that contains the read interfaces
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.readL2Networks(graph, l2networksXml, logger, name, timeout, readElements)

Load all Layer2Networks given in the XML.

Parameters:
  • graph – Data Interface object for this scanner
  • l2networksXml (list) – Part of the parsed XML containing the networks.
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.readL3Networks(graph, l3networksXml, logger, name, timeout, readElements)

Load all Layer3Networks given in the XML.

Parameters:
  • graph – Data Interface object for this scanner
  • l3networksXml (list) – Part of the parsed XML containing the networks.
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.readLayer3Addresses(graph, layer3AddressesXml, interface, logger, name, timeout, readElements)

Load all Layer3Addresses of a interface. The addresses will be added to the interface automatically.

Parameters:
  • graph – Data Interface object for this scanner
  • layer3AddressesXml (list) – Part of the parsed XML containing the Layer3Addresses of the interface.
  • interface – The interface containing the addresses
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.readLocations(graph, locationsXml, logger, name, timeout, readElements)

Load all Locations given in the XML.

Parameters:
  • graph – Data Interface object for this scanner
  • locationsXml (list) – Part of the parsed XML containing the locations.
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.readRoutes(graph, routingXml, host, logger, name, timeout, readElements)

Load all routes of a host. The routes will be added to the host automatically.

Parameters:
  • graph – Data Interface object for this scanner
  • routingXml (list) – Part of the parsed XML containing the routes.
  • host (insalata.model.Host.Host) – The host that contains the read routes.
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.readServices(graph, servicesXml, address, logger, name, timeout, readElements)

Load all services of a Layer3Address. The services willbe added automatically.

Parameters:
  • graph – Data Interface object for this scanner
  • servicesXml – Part of the parsed XML containing the services of this address.
  • address (insalata.model.Layer3Address.Layer3Address) – The Layer3Address the services are provided on
  • logger (seealso:: logging:Logger) – The logger this scanner shall use
  • name (str) – Name this collector module uses for verification
  • timeout (int) – Timeout of this collector module
  • readElements (set) – Set containing every read element from the XML -> Allows to delete not longer existing ones
insalata.scanner.modules.XmlScanner.scan(graph, connectionInfo, logger, thread)

Load the network topology given in an XML file into the graph. Timer is -1 => Objects will not be deleted. Therefore, the infrastructure in the XML file is laoded permanently until the XML is changed.

The module is able to detect changes in the XML file. Therefore, it is possible to modify the loaded information at runtime.

Necessary values in the configuration file of this collector module:
  • file Path to the XML file the collector module shall parse
Parameters:
  • graph (insalata.model.Graph.Graph) – Data interface object for this collector module
  • connectionInfo (dict) – Information needed to connect to xen server
  • logger (logging:Logger) – The logger this scanner shall use
  • thread (insalata.scanner.Worker.Worker) – Thread executing this collector

insalata.scanner.modules.ZabbixFirewallDump module

insalata.scanner.modules.base module

This file contains useful methods for all scanning modules.

insalata.scanner.modules.base.getAnsibleInfo(host)

Read information from Host using Ansible.

Keyword arguments: host – Host object to gather information from.

insalata.scanner.modules.base.getSSHConnection(host)

Open SSH Connection to this host.

Keyword arguments:
host – host for connection.
Return:
ssh Connection to host; Useable in SSHWrapper
insalata.scanner.modules.base.releaseSSHConnection(ssh)

Close SSH Connection to this host.

Keyword arguments:
ssh – Connection to close

Module contents