2
0
mirror of https://github.com/mozilla/cipherscan.git synced 2024-11-22 14:23:41 +01:00

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

View File

@ -307,6 +307,8 @@ def process_results(data, level=None, do_json=False):
json_output['compliance'] = False json_output['compliance'] = False
if json_output['level'] == json_output['target_level']: if json_output['level'] == json_output['target_level']:
json_output['compliance'] = True json_output['compliance'] = True
if operator:
json_output['operator'] = operator
else: else:
print(results['target'] + " has " + evaluate_all(results) + " ssl/tls") print(results['target'] + " has " + evaluate_all(results) + " ssl/tls")
except TypeError, e: except TypeError, e:
@ -411,6 +413,8 @@ def main():
help='path to openssl binary, if you don\'t like the default') help='path to openssl binary, if you don\'t like the default')
parser.add_argument('-j', dest='json', action='store_true', parser.add_argument('-j', dest='json', action='store_true',
help='output results in json format') 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() args = parser.parse_args()
if args.debug: if args.debug:
@ -418,6 +422,11 @@ def main():
else: else:
logging.basicConfig(stream=sys.stderr, level=logging.INFO) logging.basicConfig(stream=sys.stderr, level=logging.INFO)
global operator
operator=''
if args.operator:
operator=args.operator
build_ciphers_lists(args.openssl) build_ciphers_lists(args.openssl)
if args.target: if args.target: