Repository navigation
fix(infra)!: enforce alert channel bindings and rollout stability - #859
Merged
Merged
Conversation
Remediate POAM-2026-230 across Cloud Monitoring alert policies and the compliance-bridge notifier, fold in adopter-facing Findings A and B from the 35-message Pub/Sub read-back, and record the 67-second live delivery-log corroboration on POAM-2026-231: - Rename lula_alert_notification_channels and lula_alert_owner to target-wide alert_notification_channels and alert_owner_label, resolve bound channels at plan time via data.google_monitoring_notification_channel.bound, and enforce lifecycle preconditions on all 9 google_monitoring_alert_policy resources (including synthetic alert_pipeline_heartbeat). - Add PubSubNotifier (CAGE reference-architecture terminal sink), refuse unset/console/mock/incomplete notifier configs at Terraform plan time and compliance-bridge startup (NotifierConfigError), record alerted and remediation_sent strictly from observed destination acknowledgement (bool), and emit periodic non-paging SLA heartbeats. - Fix Finding A (REDUCE_SUM/REDUCE_MAX pod-series aggregation and alert_strategy.auto_close = 1800s so ReplicaSet rotation never leaves per-pod incidents open for 7 days) and Finding B (max by (job, namespace) (up == 0), [10m] absent_over_time lookback, and duration = 600s on prometheus_metrics_scrape_liveness so 6-7m single-replica rolling deploys do not page). - Add pure-stdlib scripts/verify_alert_delivery.py and scheduled keyless-WIF workflow .github/workflows/alert-delivery-check.yml (cage-alert-verifier GSA) for independent destination-delivery verification. - Correct Terraform alert documentation strings and compliance/lula/lula-validation-ir6.yaml, and update POAM-2026-230 and POAM-2026-231 in docs/POAM.md. BREAKING CHANGE: lula_alert_notification_channels (list(string)) and lula_alert_owner are replaced by alert_notification_channels (list(object)) and alert_owner_label; enforcing postures require compliance_alert_channel (pubsub, slack, webhook, or pagerduty) at plan time and pod startup; and notifier send_critical_alert() / send_remediation_followup() return bool (AL-01).
Make the POAM-2026-230 plan-time and startup error messages and AL-01 breaking-change entry self-explanatory for adopters:
- Consolidate all 9 AlertPolicy precondition messages onto local.alert_channels_error_message in alert_routing.tf, covering migration from lula_alert_notification_channels, Pub/Sub channel creation, re-enabling disabled channels, and passing -var='alert_notification_channels=[]' during terraform destroy when a channel was deleted out-of-band.
- Add concrete terraform.auto.tfvars guidance to kubernetes_deployment.compliance_bridge's precondition and validate_notifier_config().
- Expand AL-01 in docs/BREAKING_CHANGES.md with exact Terraform diagnostics ('Value for undeclared variable' and 'Cannot find notification channel') and a before/after terraform.auto.tfvars migration snippet.
lahlfors
force-pushed
the
fix/alert-routing-and-rollout
branch
from
November 22, 2026 22:25
2460103 to
5f469f1
Compare
- Add google_pubsub_topic_iam_member.compliance_bridge_alert_publisher to module.compliance_bridge depends_on so Terraform creates the roles/pubsub.publisher binding before rolling out compliance-bridge. - Link tracked terraform.auto.tfvars.example instead of gitignored infra/targets/gcp-gke/terraform.auto.tfvars in docs/BREAKING_CHANGES.md so clean-checkout Gate G9 passes in CI.
Collaborator
Author
Pre-merge required-check verification
9 required check(s), verified against 60 check-run(s) and 0 commit status(es) on this SHA. Result: every required check passed on this exact SHA. |
lahlfors
added a commit
that referenced
this pull request
Nov 23, 2026
Close POAM-2026-230 (2026-11-23) following live rollout and two-envelope + keyless-WIF verification across #859 (fc0152a), #860 (e382278), #861 (6f63b58), and #862 (5fa4180): - Enforcing-posture plan-time NotificationChannel resolution (var.alert_notification_channels + data.google_monitoring_notification_channel.bound preconditions across 9/9 policies) and pod-startup NotifierConfigError validation (PubSubNotifier observed boolean delivery) - Folded Finding A (REDUCE_SUM/REDUCE_MAX + auto_close = 1800s; verified live via gateway_canary_pod_health incident 0.ofbqxms0ka30 auto-closing in 124s) and Finding B ([10m]/600s operational scrape-liveness tolerance; 0 false alerts during fc0152a rolling deploy vs. 24 across 6 prior deploys) - Criterion 5 citation sweep (#862) + v4.1.0 GitHub release-body erratum (2026-11-22) - Independent keyless-WIF failure surfacing (run 45086730009) followed by back-to-back green runs on main (run 45093811570 incident 0.ofcas2dn1itq and run 45094311801 incident 0.ofcawbsajse8, 37 operational messages preserved, 0 Terraform drift)
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
Implements POAM-2026-230 (plan-time & runtime Cloud Monitoring channel validity,
compliance-bridgenotifier startup validity + observed delivery, synthetic heartbeat destination observation, and an independent scheduled CI verification workflow), folds in adopter-facing Findings A & B discovered during the 35-messagecage-stagingPub/Sub read-back, and records the 67-second live delivery-log corroboration on POAM-2026-231:POAM-2026-230Property 3):docs/POAM.mdthat because CAGE is a reference architecture rather than a deployed production service, GCP Cloud Pub/Sub (topics/cage-staging-alerts->subscriptions/cage-staging-alerts-verify) is the verified terminal destination by design; personal email, SMS, and commercial paging fan-out are out of scope rather than permanently unmet work.POAM-2026-230Property 1 /AL-01):lula_alert_notification_channels(list(string)) andlula_alert_ownerto target-widealert_notification_channels(list(object({ display_name, type, labels, name }))) andalert_owner_labelacrossinfra/targets/gcp-gke/.data.google_monitoring_notification_channel.boundininfra/targets/gcp-gke/alert_routing.tfand enforceslifecycle { precondition { condition = local.alert_channels_valid } }directly on all 9google_monitoring_alert_policyresources (including the new syntheticalert_pipeline_heartbeatpolicy), withexpect_failuresruns inlula_cron.tftest.hclfor empty channel list, disabled channel (enabled = false), and mismatched channel ID.compliance-bridgeNotifier Startup Validity,PubSubNotifier, & Observed Delivery (POAM-2026-230Property 1b & 2):PubSubNotifier(ALERT_CHANNEL=pubsub,COMPLIANCE_ALERT_PUBSUB_TOPIC=projects/<project>/topics/<topic>), allowspubsub.googleapis.comegress, and grants topic-scopedroles/pubsub.publishertocage-compliance-bridge.kubernetes_deployment.compliance_bridgeprecondition) and pod startup (validate_notifier_config()inlifespan()+create_notifier()raisingNotifierConfigErrorwith zero silent fallback toConsoleNotifier).boolfromsend_critical_alert()andsend_remediation_followup()(ConsoleNotifierreturnsFalse), recordsalerted/remediation_sentstrictly from observed destination acknowledgement (delivered is True), and emits periodic non-paging SLA heartbeats (ALERT_HEARTBEAT_INTERVAL_SECONDS).POAM-2026-230Findings A & B):cross_series_reducer = "REDUCE_SUM"("REDUCE_MAX"onuptime) onlula_audit_pod_restartandgateway_canary_pod_healthplusalert_strategy { auto_close = "1800s" }across all 9 policies so ReplicaSet rotation never holds per-pod incidents open for GCP's 7-day default (3/35queued messages).prometheus_metrics_scrape_livenessto aggregateupacross replicas viamax by (job, namespace) (up{...}) == 0, widensabsent_over_timefrom[5m]to[10m], and setsduration = "600s"(10m> 6-7m single-replica turnover; accounted for24/35=69%of queued messages across 6 rolling deploys).POAM-2026-230Properties 2, 3, 4):scripts/verify_alert_delivery.pyand scheduled keyless OIDC workflow.github/workflows/alert-delivery-check.yml(google_service_account.alert_verifierininfra/targets/gcp-gke/wif.tf) to assert runtime channel-set equality across all>= 9cluster policies, trip & resetcustom.googleapis.com/cage/alert_heartbeat_probe, and observe both Cloud Monitoring andcompliance-bridgeheartbeats on the terminal Pub/Sub subscription while returning all operational alerts untouched (modifyAckDeadline=0).POAM-2026-23167-Second Corroboration:documentationstrings (lula_alerting.tf,metrics_alerting.tf) andcompliance/lula/lula-validation-ir6.yamlL21 & L46.cage-stagingPub/Sub read-back inPOAM-2026-230(leavingPOAM-2026-230Open pending merge,cage-stagingrollout + live heartbeat verification, andv4.1.0GitHub release-body edit) and records inPOAM-2026-231thatcage-staging-alerts-pubsubbound at2026-11-19T16:07:46Z— 67 seconds beforePOAM-2026-238's16:08:53Z-16:09:00Ztotalexecute_tradewedge (seq=2187..2191) — with0notifications emitted bygateway_sustained_refusal_ratio.BREAKING CHANGE:
lula_alert_notification_channels(list(string)) andlula_alert_ownerare replaced byalert_notification_channels(list(object)) andalert_owner_label; enforcing postures requirecompliance_alert_channel(pubsub,slack,webhook, orpagerduty) at plan time and pod startup; and notifiersend_critical_alert()/send_remediation_followup()returnbool(AL-01indocs/BREAKING_CHANGES.md).Verification
terraform fmt -check -recursive infra/— passedterraform -chdir=infra/targets/gcp-gke test -var-file=staging.tfvars -var-file=tests/fixtures/image_digests.tfvars— 156 passed, 0 failed (including13/13runs intests/lula_cron.tftest.hcl)terraform -chdir=infra/modules/compliance_bridge test— 14 passed, 0 failedterraform -chdir=infra/modules/app_secrets test— 5 passed, 0 faileduv run pytest tests/ -m "local or unit" -n auto --dist loadscope --no-cov -p no:langsmith -p no:langsmith_plugin --tb=short— 12,442 passed, 98 skipped, 0 faileduv run bandit -r src/ scripts/ -c pyproject.toml -ll -ii— 0 High / 0 Medium issues (159,813LOC scanned acrosssrc/andscripts/)