Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/incidents/cx_role_reads_wait_then_finish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# cx. `cx_role_reads_wait_then_finish`

**What happened:** An alert route sent an AWS WAF signature-drift alarm (a Count rule counting a crawler's requests that got past a Block rule) to the team's terraform repository. The account's role stack predated the WAF reads the role template has, so the alarm's evidence (sampled requests, the web ACL's logs) was refused. The planner then asked CloudWatch for the alarm's own metric, `AWS/WAFV2`, and CoderHelm refused it itself ("isn't a namespace Coderhelm reads") although the role allows `cloudwatch:GetMetricData` on every namespace. It read the counts through New Relic instead, five lookups, yet the decision was labelled "Not checked against the data (no lookups were made)" because only data-source lookups were counted. The run ended `needs_outside_change` with "Needed from you: Nothing" and asked a person to run an Athena query: the only missing read was the install's setup item, so nothing was left for any person, and nothing would ever take the run up again once the role could read.

**The guarantee:** Any CloudWatch namespace may be read: the team's role is the boundary, the common namespaces (`AWS/WAFV2` with WebACL, Rule, Region and its request counts among them) are hints in the tool description, a CloudFront web ACL's WAF metrics are read in us-east-1, and a refusal from AWS comes back as the install's setup item "AWS role reads", never as a refusal of ours. A WAF rule's matches are read without Athena: `waf_sampled_requests` (WAF's sampled requests) and `waf_log_objects` (the log objects straight from the `aws-waf-logs-*` bucket, bounded, grouped in the process by JA4, user agent, accept language, path and cookie presence), and the alarm's own evidence reads the log objects before it tries Athena. Every lookup the planner makes counts, so "no lookups were made" appears only when none were. A run whose plan changes no code ends `needs_outside_change` only when a person has an item; with none, a run the role was refused reads waits (`awaiting_setup`), raises the one install item, re-checks the role every 15 minutes and then daily (and at once when another run reads again), and starts again from its ticket once the role reads, to read the data and open its pull request. Any other run with nothing for a person plans again.
1 change: 1 addition & 0 deletions services/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions services/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ serde_yaml = "0.9"
# e2e: JUnit XML test reports
quick-xml = "0.37"
aws-sdk-s3 = { version = "1", default-features = false, features = ["default-https-client", "rt-tokio", "sigv4a", "http-1x"] }
# waf_logs: a web ACL's log objects (gzip JSON lines) read straight from its bucket
flate2 = "1"
lopdf = { version = "0.46", default-features = false }
yaml-rust2 = "0.10"

Expand Down
4 changes: 4 additions & 0 deletions services/common/src/agent_policy/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ pub const BUILTIN: &[(&str, Risk)] = &[
("aws_identity", Risk::Read),
("aws_bucket_settings", Risk::Read),
("aws_kms_key", Risk::Read),
("waf_sampled_requests", Risk::Read),
("waf_log_objects", Risk::Read),
("newrelic_accounts", Risk::Read),
("newrelic_nrql", Risk::Read),
("newrelic_entities", Risk::Read),
Expand Down Expand Up @@ -366,6 +368,8 @@ const DATA_SOURCE_TOOLS: &[(&str, &str)] = &[
("aws_identity", "aws"),
("aws_bucket_settings", "aws"),
("aws_kms_key", "aws"),
("waf_sampled_requests", "aws"),
("waf_log_objects", "aws"),
("newrelic_", "newrelic"),
("confluence_", "confluence"),
("metrics_", "cloudwatch"),
Expand Down
Loading
Loading