add operator flag to analyze.py

This commit is contained in:
Julien Vehent 2014-10-11 20:52:18 -04:00
parent cdd34fce03
commit b009c71321
1 changed files with 9 additions and 0 deletions

View File

@ -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: