host_manager

Author: Athanasios Gkaraliakos email: a.gkaraliakos@gmail.com email: athanasios.gkaraliakos@cern.ch The script is written on python >=2.6

class bin.host_manager.ManageHosts(parser)[source]

Class that reads the config files using python config parser module. It then creates an object(dict) and adds all the sections of the file as key and its options as value

config_integrity_check()[source]

This method add all the section loaded from config files to a list for better handling. Its main purpose is to check the ‘integrity’ of the config files in terms of specifying the right things of avoid logical errors.

Returns:void
host_file_mapping()[source]
The method create a text file in ‘dot’ language that can be used to with and ‘dot’ compiler to create a graph
of a host configuration file
Returns:void
parse_config_file(deploy=False, no_default_config=False, update_sets=False, allow=False, drop_all=False, generate_files=False, check_matches=False, update_list=None, exclude_list=None)[source]

This method is used to parse the config files. It checks if the hostname of the machine is defined in the list of hostnames that this configuration will be applied. Then it calls the ‘iptables_manager’ function from the iptables_manager script instructing which config files to load and provides all the other arguments.

Returns:Void
sections = []

This list holds all the allowed option you can define under a section on the config files

class bin.host_manager.ReadWriteConfigFiles[source]

Class that reads the config files using python config parser module. It then creates an object(dict) and adds all the sections of the file as key and its options as value

read_config_file(filepath)[source]

Reads all the files on the file path list and creates a unique object to be returned to the Managed Rules class

Parameters:filepath – List of config file paths to read
Returns:object of config parser to access the configuration
write_config_file(file_path)[source]

Method to write back the current config from memory to the files. (It is not in use for now)

Parameters:file_path – list of the files
Returns:void
bin.host_manager.main()[source]

Main function use to expose all the parameters to the command line and call parse_config_file function.

Returns:void