mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-11-22 10:31:41 +01:00
Recommendation output now respects level (#196)
This commit is contained in:
parent
e2fc60cbb4
commit
83f9e48271
@ -379,6 +379,12 @@ def output_recommendations(out: OutputBuffer, algs: Algorithms, algorithm_recomm
|
||||
ret = False
|
||||
return ret
|
||||
|
||||
level_to_output = {
|
||||
"informational": out.good,
|
||||
"warning": out.warn,
|
||||
"critical": out.fail
|
||||
}
|
||||
|
||||
with out:
|
||||
recommendations = get_algorithm_recommendations(algs, algorithm_recommendation_suppress_list, software, for_server=True)
|
||||
|
||||
@ -391,15 +397,15 @@ def output_recommendations(out: OutputBuffer, algs: Algorithms, algorithm_recomm
|
||||
|
||||
p = '' if out.batch else ' ' * (padlen - len(name))
|
||||
|
||||
fn = level_to_output[level]
|
||||
|
||||
if action == 'del':
|
||||
an, sg, fn = 'remove', '-', out.warn
|
||||
an, sg = 'remove', '-'
|
||||
ret = False
|
||||
if level == 'critical':
|
||||
fn = out.fail
|
||||
elif action == 'add':
|
||||
an, sg, fn = 'append', '+', out.good
|
||||
an, sg = 'append', '+'
|
||||
elif action == 'chg':
|
||||
an, sg, fn = 'change', '!', out.fail
|
||||
an, sg = 'change', '!'
|
||||
ret = False
|
||||
|
||||
if notes != '':
|
||||
|
Loading…
Reference in New Issue
Block a user