mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-01 06:19:44 +01:00
Added complete json/csv output for rating
This commit is contained in:
parent
f647ae8264
commit
0d9ca76f37
15
testssl.sh
15
testssl.sh
@ -20820,6 +20820,14 @@ run_rating() {
|
||||
pr_bold " Cipher Strength"; out " (weighted) "; outln "0 (0)"
|
||||
pr_bold " Final Score "; outln "0"
|
||||
pr_bold " Overall Grade "; prln_svrty_critical "$GRADE_CAP"
|
||||
|
||||
fileout "protocol_support_score" "INFO" "0"
|
||||
fileout "protocol_support_score_weighted" "INFO" "0"
|
||||
fileout "key_exchange_score" "INFO" "0"
|
||||
fileout "key_exchange_score_weighted" "INFO" "0"
|
||||
fileout "cipher_strength_score" "INFO" "0"
|
||||
fileout "cipher_strength_score_weighted" "INFO" "0"
|
||||
fileout "final_score" "INFO" "0"
|
||||
fileout "grade" "CRITICAL" "$GRADE_CAP"
|
||||
else
|
||||
## Category 1
|
||||
@ -20855,6 +20863,8 @@ run_rating() {
|
||||
let c1_wscore=$c1_score*30/100 # Gets the weighted score for category (30%)
|
||||
|
||||
pr_bold " Protocol Support "; out "(weighted) "; outln "$c1_score ($c1_wscore)"
|
||||
fileout "protocol_support_score" "INFO" "$c1_score"
|
||||
fileout "protocol_support_score_weighted" "INFO" "$c1_wscore"
|
||||
|
||||
## Category 2
|
||||
if [[ $KEY_EXCH_SCORE -le 40 ]]; then
|
||||
@ -20867,6 +20877,8 @@ run_rating() {
|
||||
let c2_wscore=$c2_score*30/100
|
||||
|
||||
pr_bold " Key Exchange "; out " (weighted) "; outln "$c2_score ($c2_wscore)"
|
||||
fileout "key_exchange_score" "INFO" "$c2_score"
|
||||
fileout "key_exchange_score_weighted" "INFO" "$c2_wscore"
|
||||
|
||||
|
||||
## Category 3
|
||||
@ -20899,11 +20911,14 @@ run_rating() {
|
||||
let c3_wscore=$c3_score*40/100 # Gets the weighted score for category (40%)
|
||||
|
||||
pr_bold " Cipher Strength "; out " (weighted) "; outln "$c3_score ($c3_wscore)"
|
||||
fileout "cipher_strength_score" "INFO" "$c3_score"
|
||||
fileout "cipher_strength_score_weighted" "INFO" "$c3_wscore"
|
||||
|
||||
## Calculate final score and grade
|
||||
let final_score=$c1_wscore+$c2_wscore+$c3_wscore
|
||||
|
||||
pr_bold " Final Score "; outln $final_score
|
||||
fileout "final_score" "INFO" "$final_score"
|
||||
|
||||
# Calculate the pre-cap grade
|
||||
if [[ $final_score -ge 80 ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user