From b009c713213b875feeb2132a613aa258cd75822b Mon Sep 17 00:00:00 2001 From: Julien Vehent Date: Sat, 11 Oct 2014 20:52:18 -0400 Subject: [PATCH] add operator flag to analyze.py --- analyze.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/analyze.py b/analyze.py index 991354b..3acc4b6 100755 --- a/analyze.py +++ b/analyze.py @@ -307,6 +307,8 @@ def process_results(data, level=None, do_json=False): json_output['compliance'] = False if json_output['level'] == json_output['target_level']: json_output['compliance'] = True + if operator: + json_output['operator'] = operator else: print(results['target'] + " has " + evaluate_all(results) + " ssl/tls") except TypeError, e: @@ -411,6 +413,8 @@ def main(): help='path to openssl binary, if you don\'t like the default') parser.add_argument('-j', dest='json', action='store_true', help='output results in json format') + parser.add_argument('--ops', dest='operator', + help='optional name of the operator\'s team added into the JSON output (for database insertion)') args = parser.parse_args() if args.debug: @@ -418,6 +422,11 @@ def main(): else: logging.basicConfig(stream=sys.stderr, level=logging.INFO) + global operator + operator='' + if args.operator: + operator=args.operator + build_ciphers_lists(args.openssl) if args.target: