10.1.5. Module: options

Set of dictionaries defining configuration options for THAT.

The dictionaries are established as collections.OrderedDict so that the options are parsed in order.

Each option defined in each dictionary will look in the configuration file for the option key under the provided section. If not found or the value found is not valid, the user will be prompted to provide the value.

Option Dictionaries used by THAT:

  • BASE: Options in this dictionary are always searched for/asked.
  • ANALYZE: Options in this dictionary are only searched for/asked if the user answered yes to ‘analyze_data’.
  • TANIUM: Options in this dictionary are only searched for/asked if the user answered yes to ‘get_tanium_data’.
  • PLUGINS: Options in this dictionary are searched for/asked for every single plugin that matches tanium_hat.constants.PLUGINS_MATCH

Arguments for options:

  • section:
    • string, required
    • section name in configuration file to look for this option
  • entry:
    • string, required
    • key name under section configuration file to look for this option
  • prompt:
    • string, required
    • prompt to use when asking the user
    • only used if value not found / not valid in configuration file
  • default:
    • string, optional, default: “”
    • default value to use when asking the user (will show as [<ENTER> for default: {}])
  • force_abs:
    • False or str, optional, default: False
    • if str, if value supplied is not absolute, prepend value with str
  • empty_ok:
    • bool, optional, default: False
    • value supplied is allowed to be empty
  • is_template:
    • bool, optional, default: False
    • value supplied contains template variables in the form of {key}
    • using an invalid key will cause an error which will print out all valid keys that can be used
  • is_bool:
    • bool, optional, default: False
    • value supplied be forced from lowercase string into a python bool
    • True values: [‘yes’, ‘y’, ‘ye’, ‘true’, ‘1’, 1, True]
    • False values: [‘no’, ‘n’, ‘false’, ‘0’, 0, False]
    • re-asks if any other value supplied
  • is_int:
    • bool, optional, default: False
    • value supplied be forced into a python int
    • re-asks if unable to force into python int
  • is_crypt:
    • bool, optional, default: False
    • value supplied should be treated as a possibly ciphered value
    • use TOOL_PATH/crypt_value to produce a ciphered value for storing in the configuration file
    • ciphered values are obfuscated using a base64 encoded vignere cipher
    • ciphered values begin and end with ”::” in order to indicate it is a ciphered value
    • ciphered values are NOT real security
    • ciphered values can prevent casual disk/shoulder surfing from seeing/remembering a value
tanium_hat.options.ANALYZE = OrderedDict([(u'layouts_path', {u'prompt': u'Path to directory containing layout and pptx files', u'default': u'layouts', u'section': u'tanium_hat', u'force_abs': u'{TOOL_PATH}', u'is_template': True, u'entry': u'layouts_path'}), (u'layout_file', {u'prompt': u'Filename to use as the python layout definitions file', u'default': u'layout_tanium.py', u'section': u'tanium_hat', u'force_abs': u'{layouts_path}', u'is_template': True, u'entry': u'layout_file'}), (u'pptx_output_file', {u'prompt': u'Filename to use when saving the PPTX file', u'default': u'{now}-{customer_name} Hygiene Assessment.pptx', u'section': u'tanium_hat', u'force_abs': u'{data_path}', u'is_template': True, u'entry': u'pptx_output_file'})])

Analyze data specific Configuration Options.

tanium_hat.options.BASE = OrderedDict([(u'customer_name', {u'entry': u'customer_name', u'section': u'tanium_hat', u'prompt': u'Customer name', u'is_template': True}), (u'contact_name', {u'entry': u'contact_name', u'section': u'tanium_hat', u'prompt': u'Contact name', u'is_template': True}), (u'data_path', {u'prompt': u'Path to directory to store output files in', u'default': u'data', u'section': u'tanium_hat', u'force_abs': u'{TOOL_PATH}', u'is_template': True, u'entry': u'data_path'}), (u'http_proxy', {u'entry': u'http_proxy', u'section': u'tanium_hat', u'prompt': u'HTTP Proxy for internet requests', u'empty_ok': True}), (u'https_proxy', {u'entry': u'https_proxy', u'section': u'tanium_hat', u'prompt': u'HTTPS Proxy for internet requests', u'empty_ok': True}), (u'get_tanium_data', {u'default': u'yes', u'entry': u'get_tanium_data', u'section': u'tanium_hat', u'is_bool': True, u'prompt': u"Get Data From Tanium Server (Build new CSV's in data directory)"}), (u'enable_all_plugins', {u'default': u'no', u'entry': u'enable_all_plugins', u'section': u'plugins', u'is_bool': True, u'prompt': u'Enable all plugins (do not prompt for each one)'}), (u'get_internet_data', {u'default': u'yes', u'entry': u'get_internet_data', u'section': u'tanium_hat', u'is_bool': True, u'prompt': u'Get Data From Internet (Build new internet_data.csv in data directory)'}), (u'analyze_data', {u'default': u'yes', u'entry': u'analyze_data', u'section': u'tanium_hat', u'is_bool': True, u'prompt': u"Analyze CSV files in data directory (Generate's PPTX file)"})])

Base Configuration Options.

tanium_hat.options.PLUGINS = OrderedDict([(u'enabled', {u'default': u'yes', u'entry': u'enable_{plugin_name}', u'section': u'plugins', u'is_bool': True, u'prompt': u"Enable plugin '{plugin_name}'"})])

Plugin specific Configuration Options.

tanium_hat.options.TANIUM = OrderedDict([(u'question_percent', {u'default': 90, u'entry': u'question_percent', u'section': u'tanium_console', u'is_int': True, u'prompt': u'Consider questions asked by this tool to be complete at this percent of answers returned'}), (u'host', {u'entry': u'host', u'section': u'tanium_console', u'prompt': u'Tanium Server Address/IP'}), (u'port', {u'default': 443, u'entry': u'port', u'section': u'tanium_console', u'is_int': True, u'prompt': u'Tanium Console Port Number'}), (u'username', {u'entry': u'username', u'section': u'tanium_console', u'prompt': u'Tanium Console Username', u'is_crypt': True}), (u'password', {u'entry': u'password', u'section': u'tanium_console', u'prompt': u'Tanium Console Password', u'is_crypt': True})])

Get Tanium Data specific Configuration Options.