Repository navigation
fix: redact secret-bearing alert delivery errors - #83
Merged
Merged
Conversation
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
Failed alert notifications could persist credential-bearing target URLs in runtime errors and expose them through alert responses or delivery logs. Remove reqwest URLs before formatting new errors, sanitize historic runtime diagnostics on startup and when constructing responses, and bound diagnostic strings to 1,024 characters. The outward policy-error wrapper retains only sanitized details, including for Actix's Debug response logging.
Preserve PromQL instance and delivery labels verbatim, including labels named
error, so restoring an alert retains series identity and correctly supersedes queued notifications after resolution. Continue recursively sanitizing diagnostic containers, including ones containing objects or arrays namederror.Mask Alertmanager usernames alongside passwords, webhook URLs and header values. The target edit form requires both credentials to be re-entered to retain authentication. Storage serialization retains credentials required for delivery; malformed target deserialization errors no longer echo rejected values.
Startup cleanup is in memory only: existing stored alert objects are not rewritten until a normal save. Response shapes and RBAC stay unchanged. Related metrics/datasets/alerts integration should use
sanitize_runtime_fieldsat alert-response boundaries so metric label identity remains intact.Validation
P_BUILD_NO_UI=1 CARGO_BUILD_JOBS=4 cargo test --lib -- --test-threads=4.cargo clippy --all-targetspassed with existing warnings; none reference the changed files. Rust formatting andgit diff --checkpassed.This PR has: