Skip to content

Commit

Permalink
Merge pull request #3 from dnmvisser/dv_rename_opt
Browse files Browse the repository at this point in the history
rename option from skip-ids to ignore-ids
  • Loading branch information
dnmvisser authored Mar 27, 2020
2 parents 57ff0d7 + 1fd93eb commit a9edfd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ git clone https://github.com/drwetter/testssl.sh.git /opt/testssl

```
usage: nagios-testssl.py [-h] --uri URI --testssl TESTSSL
[--ignore-ids IGNORE_IDS]
[--critical {LOW,MEDIUM,HIGH,CRITICAL}]
[--warning {LOW,MEDIUM,HIGH,CRITICAL}]
Expand All @@ -32,12 +33,13 @@ optional arguments:
--uri URI host|host:port|URL|URL:port.Port 443 is default, URL
can only contain HTTPS protocol
--testssl TESTSSL Path to the testssl.sh script
--ignore-ids IGNORE_IDS
Comma separated list of test IDs to ignore
--critical {LOW,MEDIUM,HIGH,CRITICAL}
Findings of this severity level trigger a CRITICAL
--warning {LOW,MEDIUM,HIGH,CRITICAL}
Findings of this severity level trigger a WARNING
```

# Examples

Checking a URI with default severity levels:
Expand All @@ -50,10 +52,10 @@ HIGH: secure_client_renego (VULNERABLE, DoS threat)
HIGH: BREACH (potentially VULNERABLE, uses gzip HTTP compression - only supplied '/' tested)
```

The same URI, but skipping specific test IDs:
The same URI, but ignoring two tests:
```
vagrant@buster:~$ ./nagios-testssl.py --testssl /opt/testssl/testssl.sh \
--uri https://www.geant.org --skip-ids BREACH,secure_client_renego
--uri https://www.geant.org --ignore-ids BREACH,secure_client_renego
OK: No issues found for https://www.geant.org with severity HIGH or higher.
```

Expand Down
8 changes: 4 additions & 4 deletions nagios-testssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def nagios_exit(message, code):
parser.add_argument('--uri', help='host|host:port|URL|URL:port.'
'Port 443 is default, URL can only contain HTTPS protocol', required=True)
parser.add_argument('--testssl', help='Path to the testssl.sh script', required=True)
parser.add_argument('--skip-ids', help='Comma separated list of IDs to skip from the result', default='')
parser.add_argument('--ignore-ids', help='Comma separated list of test IDs to ignore', default='')
parser.add_argument('--critical', help='Findings of this severity level trigger a CRITICAL',
choices=severities.keys(), default='CRITICAL')
parser.add_argument('--warning', help='Findings of this severity level trigger a WARNING',
Expand All @@ -43,7 +43,7 @@ def nagios_exit(message, code):
testssl = args.testssl
critical = args.critical
warning = args.warning
skip_ids = args.skip_ids.split(',')
ignore_ids = args.ignore_ids.split(',')
# trailing_args = args.trailing_args
# pprint(args)

Expand Down Expand Up @@ -89,8 +89,8 @@ def nagios_exit(message, code):
# Filter out only supported severity levels
r = [x for x in r if x['severity'] in severities.keys()]

# Filter out skip_ids
r = [x for x in r if x['id'] not in skip_ids]
# Filter out ignore_ids
r = [x for x in r if x['id'] not in ignore_ids]

# Add integer severity level
for item in r:
Expand Down

0 comments on commit a9edfd7

Please sign in to comment.