forked from matteocorti/check_ssl_cert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_ssl_cert.1
299 lines (295 loc) · 8.19 KB
/
check_ssl_cert.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
.\" Process this file with
.\" groff -man -Tascii check_ssl_cert.1
.\"
.TH "check_ssl_cert" 1 "December, 2020" "1.128.0" "USER COMMANDS"
.SH NAME
check_ssl_cert \- checks the validity of X.509 certificates
.SH SYNOPSIS
.BR "check_ssl_cert " "-H host [OPTIONS]"
.SH DESCRIPTION
.B check_ssl_cert
A Nagios plugin to check an X.509 certificate:
- checks if the server is running and delivers a valid certificate
- checks if the CA matches a given pattern
- checks the validity
.SH ARGUMENTS
.TP
.BR "-H,--host" " host"
server
.SH OPTIONS
.TP
.BR "-A,--noauth"
ignore authority warnings (expiration only)
.TP
.BR " --altnames"
matches the pattern specified in -n with alternate names too
.TP
.BR "-C,--clientcert" " path"
use client certificate to authenticate
.TP
.BR " --clientpass" " phrase"
set passphrase for client certificate.
.TP
.BR "-c,--critical" " days"
minimum number of days a certificate has to be valid to issue a critical status
.TP
.BR " --curl-bin" " path"
path of the curl binary to be used
.TP
.BR " --curl-user-agent" " string"
user agent that curl shall use to obtain the issuer cert
.TP
.BR " --custom-http-header" " string"
custom HTTP header sent when getting the cert
.TP
.BR " --dane"
verifies there are valid TLSA records for the returned certificate, requires OpenSSL 1.1.0 or later
.TP
.BR " --dane 211"
verify that a valid DANE-TA(2) SPKI(1) SHA2-256(1) TLSA record exists
.TP
.BR " --dane 301"
verify that a valid DANE-EE(3) Cert(0) SHA2-256(1) TLSA record exists
.TP
.BR " --dane 302"
verify that a valid DANE-EE(3) Cert(0) SHA2-512(2) TLSA record exists
.TP
.BR " --dane 311"
verify that a valid DANE-EE(3) SPKI(1) SHA2-256(1) TLSA record exists
.TP
.BR "-d,--debug"
produces debugging output
.TP
.BR " --dig-bin" " path"
path of the dig binary to be used
.TP
.BR " --ecdsa"
signature algorithm selection: force ECDSA certificate
.TP
.BR " --element" " number"
checks N cert element from the begining of the chain
.TP
.BR "-e,--email" " address"
pattern to match the email address contained in the certificate
.TP
.BR "-f,--file" " file"
local file path (works with -H localhost only) with -f you can not only pass a x509 certificate file but also a certificate revocation list (CRL) to check the validity period
.TP
.BR " --file-bin" " path"
path of the file binary to be used
.TP
.BR " --fingerprint" " SHA1"
pattern to match the SHA1-Fingerprint
.TP
.BR " --force-perl-date"
force the usage of Perl for date computations
.TP
.BR " --format" " FORMAT"
custom output format (e.g. "%SHORTNAME% OK %CN% from '%CA_ISSUER_MATCHED%'")
.TP
.BR "-h,--help,-?"
this help message
.TP
.BR " --http-use-get"
use GET instead of HEAD (default) for the HTTP related checks
.TP
.BR " --ignore-exp"
ignore expiration date
.TP
.BR " --ignore-ocsp"
do not check revocation with OCSP
.TP
.BR " --ignore-ocsp-timeout"
ignore OCSP result when timeout occurs while checking
.TP
.BR " --ignore-sig-alg"
do not check if the certificate was signed with SHA1 or MD5
.TP
.BR " --ignore-ssl-labs-cache"
Forces a new check by SSL Labs (see -L)
.TP
.BR " --issuer-cert-cache" " dir"
directory where to store issuer certificates cache
.TP
.BR "-i,--issuer" " issuer"
pattern to match the issuer of the certificate
.TP
.BR "-K,--clientkey" " path"
use client certificate key to authenticate
.TP
.BR "-L,--check-ssl-labs grade"
SSL Labs assestment (please check https://www.ssllabs.com/about/terms.html). Critical if the grade is lower than specified.
.TP
.BR " --check-ssl-labs-warn grade"
SSL Labs grade on which to warn
.TP
.BR " --long-output" " list"
append the specified comma separated (no spaces) list of attributes to the plugin output on additional lines.
Valid attributes are: enddate, startdate, subject, issuer, modulus, serial, hash, email, ocsp_uri and fingerprint. 'all' will include all the available attributes.
.TP
.BR "-n,--cn" " name"
pattern to match the CN of the certificate (can be specified multiple times)
.TP
.BR " --no-proxy"
ignores the http_proxy and https_proxy environment variables
.TP
.BR " --no-ssl2"
disable SSL version 2
.TP
.BR " --no-ssl3"
disable SSL version 3
.TP
.BR " --no-tls1"
disable TLS version 1
.TP
.BR " --no-tls1_1"
disable TLS version 1.1
.TP
.BR " --no-tls1_3"
disable TLS version 1.3
.TP
.BR " --no-tls1_2"
disable TLS version 1.2
.TP
.BR " --not-issued-by" " issuer"
check that the issuer of the certificate does not match the given pattern
.TP
.BR " --not-valid-longer-than" " days"
critical if the certificate validity is longer than the specified period
.TP
.BR "-N,--host-cn"
match CN with the host name
.TP
.BR " --ocsp-critical" " hours"
minimum number of hours an OCSP response has to be valid to issue a critical status
.TP
.BR " --ocsp-warning" " hours"
minimum number of hours an OCSP response has to be valid to issue a warning status
.TP
.BR "-o,--org" " org"
pattern to match the organization of the certificate
.TP
.BR " --openssl" " path"
path of the openssl binary to be used
.TP
.BR "-p,--port" " port"
TCP port
.TP
.BR "-P,--protocol" " protocol"
use the specific protocol: ftp, ftps, http, https (default), h2 (http/2), imap, imaps, irc, ircs, ldap, ldaps, mysql, pop3, pop3s, postgres, sieve, smtp, smtps, xmpp, xmpp-server.
.br
These protocols switch to TLS using StartTLS: ftp, imap, irc, ldap, mysql, pop3, smtp.
.TP
.BR " --proxy" " proxy"
sets http_proxy
.TP
.BR " --require-no-ssl2"
critical if SSL version 2 is offered
.TP
.BR " --require-no-ssl3"
critical if SSL version 3 is offered
.TP
.BR " --require-no-tls1"
critical if TLS 1 is offered
.TP
.BR " --require-no-tls1_1"
critical if TLS 1.1 is offered
.TP
.BR "-s,--selfsigned"
allows self-signed certificates
.TP
.BR " --serial serialnum"
pattern to match the serial number
.TP
.BR "--skip-element" " number"
skip checks on N cert element from the begining of the chain
.TP
.BR " --sni name"
sets the TLS SNI (Server Name Indication) extension in the ClientHello message to 'name'
.TP
.BR " --ssl2"
force SSL version 2
.TP
.BR " --ssl3"
force SSL version 3
.TP
.BR " --require-ocsp-stapling"
require OCSP stapling
.TP
.BR " --require-san"
require the presence of a Subject Alternative Name extension
.TP
.BR "-r,--rootcert" " cert"
root certificate or directory to be used for certificate validation (passed to openssl's -CAfile or -CApath)
.TP
.BR " --rootcert-dir" " dir"
root directory to be used for certificate validation (passed to openssl's -CApath)
overrides option -r,--rootcert
.TP
.BR " --rootcert-file" " cert"
root certificate to be used for certificate validation (passed to openssl's -CAfile)
overrides option -r,--rootcert
.TP
.BR " --rsa"
signature algorithm selection: force RSA certificate
.TP
.BR " --temp" " dir"
directory where to store the temporary files
.TP
.BR " --terse"
terse output (also see --verbose)
.TP
.BR "-t,--timeout"
seconds timeout after the specified time (defaults to 120 seconds)
.TP
.BR " --tls1"
force TLS version 1
.TP
.BR " --tls1_1"
force TLS version 1.1
.TP
.BR " --tls1_2"
force TLS version 1.2
.TP
.BR " --tls1_3"
force TLS version 1.3
.TP
.BR "-v,--verbose"
verbose output (also see --terse)
.TP
.BR "-V,--version"
version
.TP
.BR "-w,--warning" " days"
minimum number of days a certificate has to be valid to issue a warning status
.TP
.BR " --xmpphost" " name"
specifies the host for the "to" attribute of the stream element
.TP
.BR "-4"
forces IPv4
.TP
.BR "-6"
forces IPv6
.SH DEPRECATED OPTIONS
.TP
.BR "-d,--days" " days"
minimum number of days a certificate has to be valid (see --critical and --warning)
.TP
.BR " --ocsp"
check revocation via OCSP
.TP
.BR "-S,--ssl" " version"
force SSL version (2,3) (see: --ssl2 or --ssl3)
.SH MULTIPLE CERTIFICATES
If the host has multiple certificates and the installed openssl version supports the -servername option it is possible to specify the TLS SNI (Server Name Idetificator) with the -N (or --host-cn) option.
.SH "SEE ALSO"
x509(1), openssl(1), expect(1), timeout(1)
.SH "EXIT STATUS"
check_ssl_cert returns a zero exist status if it finds no errors, 1 for warnings, 2 for a critical errors and 3 for unknown problems
.SH BUGS
Please report bugs to:
https://github.com/matteocorti/check_ssl_cert/issues
.SH AUTHOR
Matteo Corti (matteo (at) corti.li )
See the AUTHORS file for the complete list of contributors