fix(rating): explicit enable rating if required vuln-checks are enabled #2669
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your changes
Please refer to an issue here or describe the change thoroughly in your PR.
What is your pull request about?
If it's a code change please check the boxes which are applicable
help()
Fixes #2665 - by explicitly enabling rating if all required vulnerability checks are enabled
do_rating
is false by default, but is set to true withset_scanning_defaults()
which is run when no parameters are passed (or when--full
(maybe a few other options as well) is passed)When
do_rating=true
(i.e. whenset_scanning_defaults()
is called) theset_rating_state()
function is never ran.(see https://github.com/testssl/testssl.sh/blob/3.2/testssl.sh#L24260-L24266)
So...
set_rating_state()
is only run whendo_rating=false
; which means we have to setdo_rating=true
inside the function if all required vuln-checks are enabled.I did leave the
do_rating=false
return in there, as it provides valuable readability. Let me know if you want that out there; I can easily inverse the logic :-)So this fix will leave cases where no arguments are passed (or
--full
, ...) with no changes; but correctly fix cases where one would pass all required parameters (as in the referenced issue)