mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-11-22 02:21:40 +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
|
ret = False
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
level_to_output = {
|
||||||
|
"informational": out.good,
|
||||||
|
"warning": out.warn,
|
||||||
|
"critical": out.fail
|
||||||
|
}
|
||||||
|
|
||||||
with out:
|
with out:
|
||||||
recommendations = get_algorithm_recommendations(algs, algorithm_recommendation_suppress_list, software, for_server=True)
|
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))
|
p = '' if out.batch else ' ' * (padlen - len(name))
|
||||||
|
|
||||||
|
fn = level_to_output[level]
|
||||||
|
|
||||||
if action == 'del':
|
if action == 'del':
|
||||||
an, sg, fn = 'remove', '-', out.warn
|
an, sg = 'remove', '-'
|
||||||
ret = False
|
ret = False
|
||||||
if level == 'critical':
|
|
||||||
fn = out.fail
|
|
||||||
elif action == 'add':
|
elif action == 'add':
|
||||||
an, sg, fn = 'append', '+', out.good
|
an, sg = 'append', '+'
|
||||||
elif action == 'chg':
|
elif action == 'chg':
|
||||||
an, sg, fn = 'change', '!', out.fail
|
an, sg = 'change', '!'
|
||||||
ret = False
|
ret = False
|
||||||
|
|
||||||
if notes != '':
|
if notes != '':
|
||||||
|
Loading…
Reference in New Issue
Block a user