Skip to content

Commit 640444e

Browse files
committed
feat: --rating-only flag to only test checks required for rating
1 parent 932c91f commit 640444e

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

doc/testssl.1.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ The same can be achieved by setting the environment variable `WARNINGS`.
156156

157157
`--add-ca <CAfile>` enables you to add your own CA(s) in PEM format for trust chain checks. `CAfile` can be a directory containing files with a \.pem extension, a single file or multiple files as a comma separated list of root CAs. Internally they will be added during runtime to all CA stores. This is (only) useful for internal hosts whose certificates are issued by internal CAs. Alternatively ADDTL_CA_FILES is the environment variable for this.
158158

159+
`--rating-only` makes testssl.sh do the bare minimum to allow rating to succeed. See RATING for more
159160

160161
### SINGLE CHECK OPTIONS
161162

@@ -448,7 +449,7 @@ set_grade_warning "Documentation is always right"
448449

449450
#### Implementing a new check which contains grade caps
450451

451-
When implementing a new check (be it vulnerability or not) that sets grade caps, the `set_rating_state()` has to be updated (i.e. the `$do_mycheck` variable-name has to be added to the loop, and `$nr_enabled` if-statement has to be incremented)
452+
When implementing a new check (be it vulnerability or not) that sets grade caps, the `set_rating_state()` has to be updated (i.e. the `$do_mycheck` variable-name has to be added to the loop, and `$nr_enabled` if-statement has to be incremented), and the `--rating-only` switch statement needs to have `$do_mycheck=true` added
452453

453454
The `set_rating_state()` automatically disables rating, if all the required checks are *not* enabled.
454455
This is to prevent giving out a misleading or wrong grade.

testssl.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21598,6 +21598,7 @@ tuning / connect options (most also can be preset via environment variables):
2159821598
--mtls <CLIENT CERT file> path to <CLIENT CERT> file in PEM format containing unencrypted certificate key (beta)
2159921599
--basicauth <user:pass> provide HTTP basic auth information
2160021600
--reqheader <header> add custom http request headers
21601+
--rating-only test only the checks required for rating
2160121602

2160221603
output options (can also be preset via environment variables):
2160321604
--quiet don't output the banner. By doing this you acknowledge usage terms normally appearing in the banner
@@ -21610,7 +21611,7 @@ output options (can also be preset via environment variables):
2161021611
--color <0|1|2|3> 0: no escape or other codes, 1: b/w escape codes, 2: color (default), 3: extra color (color all ciphers)
2161121612
--colorblind swap green and blue in the output
2161221613
--debug <0-6> 1: screen output normal but keeps debug output in /tmp/. 2-6: see "grep -A 5 '^DEBUG=' testssl.sh"
21613-
--disable-rating Explicitly disables the rating output
21614+
--disable-rating explicitly disables the rating output
2161421615

2161521616
file output options (can also be preset via environment variables)
2161621617
--log, --logging logs stdout to '\${NODE}-p\${port}\${YYYYMMDD-HHMM}.log' in current working directory (cwd)
@@ -25147,6 +25148,31 @@ parse_cmd_line() {
2514725148
[[ $? -eq 0 ]] && shift
2514825149
REQHEADERS+=("$REQHEADER")
2514925150
;;
25151+
--rating[-_]only)
25152+
# Do only the bare minimum for rating to be successfully done
25153+
# See set_rating_state() for required variables
25154+
do_protocols=true
25155+
do_cipherlists=true
25156+
do_fs=true
25157+
do_server_defaults=true
25158+
do_header=true
25159+
do_heartbleed=true
25160+
do_ccs_injection=true
25161+
do_ticketbleed=true
25162+
do_robot=true
25163+
do_renego=true
25164+
do_crime=true
25165+
do_ssl_poodle=true
25166+
do_tls_fallback_scsv=true
25167+
do_drown=true
25168+
do_beast=true
25169+
do_rc4=true
25170+
do_logjam=true
25171+
do_allciphers=true
25172+
25173+
# Force vuln. checks to be shown under the same header
25174+
VULN_THRESHLD=-1
25175+
;;
2515025176
(--) shift
2515125177
break
2515225178
;;

0 commit comments

Comments
 (0)