示例#1
0
def init_config():
    options.slack_token = get_config('slack_token', '<CHANGE ME>', options.configfile)
    options.name = get_config('name', 'mozdef', options.configfile)
    options.channels = get_config('channels', 'general', options.configfile).split(',')
    options.default_alert_channel = get_config('default_alert_channel', 'mozdef', options.configfile)

    # queue exchange name
    options.alert_exchange = get_config(
        'alertexchange',
        'alerts',
        options.configfile)

    # queue name
    options.queue_name = get_config(
        'alertqueuename',
        'alertBot',
        options.configfile)

    # queue topic
    options.alerttopic = get_config(
        'alerttopic',
        'mozdef.*',
        options.configfile)

    # how many messages to ask for at once
    options.prefetch = get_config('prefetch', 50, options.configfile)
    options.mq_alert_server = get_config('mqalertserver', 'localhost', options.configfile)
    options.mq_user = get_config('mquser', 'guest', options.configfile)
    options.mq_password = get_config('mqpassword', 'guest', options.configfile)
    options.mq_port = get_config('mqport', 5672, options.configfile)
    # mqack=True sets persistant delivery, False sets transient delivery
    options.mq_ack = get_config('mqack', True, options.configfile)
示例#2
0
def init_config():
    options.slack_token = get_config('slack_token', '<CHANGE ME>',
                                     options.configfile)
    options.name = get_config('name', 'mozdef', options.configfile)
    options.channels = get_config('channels', 'general',
                                  options.configfile).split(',')
    options.default_alert_channel = get_config('default_alert_channel',
                                               'mozdef', options.configfile)

    # queue exchange name
    options.alert_exchange = get_config('alertexchange', 'alerts',
                                        options.configfile)

    # queue name
    options.queue_name = get_config('alertqueuename', 'alertBot',
                                    options.configfile)

    # queue topic
    options.alerttopic = get_config('alerttopic', 'mozdef.*',
                                    options.configfile)

    # how many messages to ask for at once
    options.prefetch = get_config('prefetch', 50, options.configfile)
    options.mq_alert_server = get_config('mqalertserver', 'localhost',
                                         options.configfile)
    options.mq_user = get_config('mquser', 'guest', options.configfile)
    options.mq_password = get_config('mqpassword', 'guest', options.configfile)
    options.mq_port = get_config('mqport', 5672, options.configfile)
    # mqack=True sets persistant delivery, False sets transient delivery
    options.mq_ack = get_config('mqack', True, options.configfile)