Repository navigation
Conversation
check_http did not verify the target certificate. This matches monitoring-plugins check_http and remains the default, so checks for self-signed and private-CA targets keep working. Add --verify-cert to verify the certificate chain and hostname against the system roots. Add --ca-cert to verify against a PEM file instead, which also enables --verify-cert. Checks that send credentials with -a, -k, or -P can now authenticate the peer. Explain the default and the difference from the -C expiry check in the help text and the generated docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
check_httpdid not verify the target TLS certificate. This matches monitoring-pluginscheck_httpand remains the default for compatibility, so checks against self-signed or private-CA targets keep working.When a check sends credentials with
-a,-k, or-P, an unverified peer can receive them and can return a forged result. This is the risk described in security audit finding F-03.Change
--verify-certto verify the certificate chain and hostname against the system roots.--ca-cert=<file>to verify against a PEM CA file. It replaces the system roots and also enables--verify-cert, matchingcheck_curlfrom monitoring-plugins.-Cstill checks expiry and optional names. It now verifies the chain and hostname when verification is enabled.UNKNOWNinstead of silently skipping verification.-Cin the help text and the generated docs.Behavior
--verify-cert--ca-cert FILE-Calone--check-cn/--check-san-C --verify-certExisting checks are unchanged unless one of the new flags is used.
Testing
TestHTTPSPeerVerificationcovers the default,--verify-cert,--ca-cert, certificate mode, and a missing CA file.make fmtmake golangci(linux, darwin, freebsd, windows)make testgo test -race -short ./pkg/check_httpmake docs