-
Notifications
You must be signed in to change notification settings - Fork 58
Add TLS support to the docker container command line #107
base: master
Are you sure you want to change the base?
Changes from 7 commits
12002aa
baa4fec
7f167da
bfbd781
8fa7138
5c97265
1e799ed
0cc1670
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,13 @@ | |
| def diag_print(test, rule_id): | ||
| print 'Running test %s from rule file %s' % (test.test_title, rule_id) | ||
|
|
||
| def build_journal(journal_file, ruledir, ruledir_recurse, tablename, destaddr, headers): | ||
| def build_journal(journal_file, ruledir, ruledir_recurse, tablename, destaddr, headers, protocol, port): | ||
| util.instantiate_database(journal_file) | ||
| rulesets = util.get_rulesets(ruledir, ruledir_recurse) | ||
| for rule in rulesets: | ||
| for test in rule.tests: | ||
| runner = testrunner.TestRunner() | ||
| runner.run_test_build_journal(test.ruleset_meta['name'], test, journal_file, tablename, destaddr, diag_print, headers) | ||
| runner.run_test_build_journal(test.ruleset_meta['name'], test, journal_file, tablename, destaddr, diag_print, protocol, port, headers) | ||
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser(description='Build FTW Journal database') | ||
|
|
@@ -26,16 +26,24 @@ def main(): | |
| help='Destination host for the payloads') | ||
| parser.add_argument('--destaddr_as_host', action='store_true', | ||
| help='Use destination address as the Host header') | ||
| parser.add_argument('--protocol', default=None, | ||
| help='Specify protocol: http or https (default http)') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this true (default to http) or whatever is specified in the yaml files? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, we default the port to 80 in the YAML files.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, but if the yaml file uses something else it won't be. |
||
| parser.add_argument('--port', default=None, | ||
| help='Specify port number (default 80)') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this true (default to 80) or whatever is specified in the yaml files?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is true |
||
| args = parser.parse_args() | ||
| destaddr = args.destaddr | ||
| journal_file = args.journal | ||
| ruledir = args.ruledir | ||
| ruledir_recurse = args.ruledir_recurse | ||
| tablename = args.tablename | ||
| headers = {} | ||
| protocol = args.protocol | ||
| port = 0 | ||
| if args.port: | ||
| port = int(args.port) | ||
| if args.destaddr_as_host: | ||
| headers['Host'] = destaddr = args.destaddr | ||
| build_journal(journal_file, ruledir, ruledir_recurse, tablename, destaddr, headers) | ||
| build_journal(journal_file, ruledir, ruledir_recurse, tablename, destaddr, headers, protocol, port) | ||
|
|
||
| if __name__ == '__main__': | ||
| main() | ||
Uh oh!
There was an error while loading. Please reload this page.