Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mozilla report conflicts with JSON reporting #543

Closed
dcarley opened this issue Dec 1, 2021 · 1 comment
Closed

Mozilla report conflicts with JSON reporting #543

dcarley opened this issue Dec 1, 2021 · 1 comment
Projects

Comments

@dcarley
Copy link

dcarley commented Dec 1, 2021

Describe the bug
We call SSLyze from some integration tests, parse the JSON report, and make assertions on about protocols/ciphers that we expect to see. The new --mozilla-config functionality conflicts with our use in two ways:

  1. the plaintext output to STDOUT means that json_out=- doesn't produce valid JSON
  2. the exit code of 1, when the Mozilla check is not compliant, is hard to distinguish from other errors

I considered raising these as separate issues but I think it's possible to solve them both at the same time by including the Mozilla report in the JSON output and not changing the exit code when not compliant, so that you can perform your own assertions on the output.

To Reproduce

Parsing the output with jq results in an error when it gets to the Mozilla banner:

$ docker run --rm nablac0d3/sslyze:5.0.0 --json_out=- google.com | jq .sslyze_version ; echo $?
"5.0.0"
parse error: Invalid numeric literal at line 10090, column 12
4

Scanning a server with a self-signed certificate produces a non-zero exit code:

$ docker run --rm nablac0d3/sslyze:5.0.0 --json_out=- 10.108.40.189 >/dev/null; echo $?
1

Expected behavior

These both resulted in zero exit codes in the previously published version:

$ docker run --rm nablac0d3/sslyze:sha-7e16dc0 --json_out=- google.com | jq .sslyze_version ; echo $?
"4.1.0"
0
$ docker run --rm nablac0d3/sslyze:sha-7e16dc0 --json_out=- 10.108.40.189 >/dev/null; echo $?
0

Additional context
The utility is great and so is the new Mozilla functionality. Thanks!

@nabla-c0d3 nabla-c0d3 added this to To do in 5.0.1 Dec 11, 2021
@nabla-c0d3 nabla-c0d3 moved this from To do to Done in 5.0.1 Dec 11, 2021
@nabla-c0d3
Copy link
Owner

This was fixed in v5.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
5.0.1
Done
Development

No branches or pull requests

2 participants