Repository navigation
🛡️ Fix security, delivery, failover, and detection bugs from code audit - #523
Merged
Merged
Conversation
Security - Redact request URLs from transport, Slack, and Discord errors so bot tokens and webhook secrets never reach logs. - Escape Matrix HTML bodies, Telegram Markdown fields, and disable Discord mentions so workload logs cannot inject markup or ping channels. - Reject proxy, TLS trust, CA bundle, pprof, diagnostics, and audit log path overrides in KwatchConfig resources. - Redact env values and ConfigMap data in recorded change history. Delivery and lifecycle - Cap provider Retry-After waits at one minute. - Restore leader readiness after a transient persistence write failure. - Fix optional component backoff reset and cap. - Keep never-announced incidents unannounced across restarts. - Only promote updates to creates after a suppressed delivery or a resolve, not after a restart. - Count notifications dropped after delivery stops. - Stop standby replicas waiting for a controller that never ran. - Start and drain delivery in kwatch replay. - Allow the default 30s pprof CPU profile. Detection - Apply scoped or multi-field silences only at delivery time. - Report pods rejected at admission. - Alert on Job backoff only after the limit is exceeded. - Keep Deployment rollout conditions inside the sustain window. - Only name a node or owner as root cause when it is unhealthy. - Keep global image-pull incidents open until they recover cluster-wide. - Resolve only the PVC status reason on healthy PVCs. - Give each control-plane probe its own timeout. Deployment - Grant configmap list, update, and delete for incident shards.
Providers - Paging providers (iLert, Squadcast, GoAlert, Splunk On-Call, SIGNL4, Alerta, Sensu, incident.io, Datadog, New Relic) keep one alert per incident and resolve it on recovery; notices deduplicate at low severity. - Issue trackers (GitHub, Gitea, GitLab, Jira, ClickUp) file one issue per incident, comment on updates, and close or comment on recovery; the mapping persists across restarts. - Escape Slack mrkdwn and neutralize broadcast mentions in Mattermost and Rocket.Chat. - Escape GitLab project paths and warn that LINE Notify is discontinued. Failover and persistence - Release the Lease only after delivery drains and final state is written; fence persistence before cancelling on leadership loss. - Scope state ConfigMaps to the installation's Lease name with a legacy read fallback; grant namespace-local configmap get. - Persist container, node, and image on incidents (additive fields). Detection and correlation - Drop announcements older than the last announced revision. - Keep webhook and custom-resource incidents of different kinds apart. - Resolve owner-level kubelet incidents only when no replica still fails. - Resolve node resource and filesystem levels when they clear. - Detect restarts without a prior observation and respect node silences when seeding. - Watch only the storage version of each CRD and keep dynamic graph edges across hourly rebuilds.
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.
Summary
Fixes found in a code-only audit of the repository. Two commits:
Security
KwatchConfig.Providers
Retry-Afterwaits at one minute.Failover and persistence
kwatch-*, with legacy read fallback).Detection
Upgrade notes
/api/v2/generic/incoming; not verified against a live GoAlert server.Testing
make verifypasses (build, vet, lint, race tests with coverage, line check, architecture, test layout, catalogs, docs).