maec_to_stix.indicator_extractor.config_parser Module

class maec_to_stix.indicator_extractor.config_parser.ConfigParser(config_directory=None)

Bases: object

Used to parse the JSON indicator extraction configuration files.


the parsed dictionary representation of the main configuration file.


the list of supported Actions (names).


a dictionary of supported Objects and their properties.

Parameters:config_directory – the path to the directory where the configuration files can be found.
static flatten_dict(d, parent_key='', sep='/')

Flatten a nested dictionary into one with a single set of key/value pairs.

  • d – an input dictionary to flatten.
  • parent_key – the parent_key, for use in building the root key name when handling nested dictionaries.
  • sep – the separator to use between the concatenated keys in the root key.

The flattened representation of the input dictionary.


Parse the JSON configuration structure and build the appropriate data structures.


Print the current set of configuration parameters to stdout.


This method prints detailed information about the parsed Indicator extraction configuration, including:

  1. The general Indicator extraction parameters (from config/extractor_config.json)
  2. The supported Actions (derived from all of the parsed JSON configuration files)
  3. The supported Objects and their properties (derived from all of the parsed JSON configuration files)
  4. The contra-indicators and modifiers to use in candidate Object filtering