fix(audit): gate log-shipper config on cert and warn on TLS handshake failures#2681
Closed
danilrwx wants to merge 2 commits into
Closed
fix(audit): gate log-shipper config on cert and warn on TLS handshake failures#2681danilrwx wants to merge 2 commits into
danilrwx wants to merge 2 commits into
Conversation
The audit TLS certificate is generated asynchronously by a hook, but audit.isEnabled only checked ModuleConfig and enabled modules. During startup the ClusterLogDestination, cert secret and Deployment could render with empty CA/cert/key. Require the certificate to be present before rendering any audit resource. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
A hung vector reload after a CA rotation keeps the log-shipper agent retrying the audit sink with a stale CA, which surfaced only as a debug-level connection error indistinguishable from normal churn. Perform the handshake explicitly and log an actionable warning telling the operator to restart the log-shipper agent pods. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
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.
Description
Two robustness fixes for audit log delivery over the log-shipper.
Audit's log-shipper resources (
ClusterLogDestinationand theClusterLoggingConfigs) are no longer rendered until the audit TLS certificate has actually been generated. The certificate is produced asynchronously by a hook, so on startup these resources could be created with an empty CA/cert/key.When the audit receiver rejects a TLS connection, it now logs an actionable warning telling the operator to restart the log-shipper agent pods. Previously the handshake failure surfaced only at debug level, indistinguishable from normal connection churn.
Why do we need it, and what problem does it solve?
Audit events are delivered from the log-shipper agent to the audit receiver over a mutually-authenticated TLS socket. Two situations left audit silently broken:
Now the destination is only configured once its certificate is ready, and a persistent stream of warnings on the receiver points the operator straight at the fix (restart the log-shipper agents).
Task 67136162.
What is the expected result?
Checklist
Changelog entries