Repository navigation
Read WAF data without Athena and wait for the AWS role's reads instead of asking a person - #776
Merged
Merged
Conversation
…d of asking a person - CloudWatch metrics: any namespace is read; the team's role is the boundary. The namespace list is now hints only (AWS/WAFV2 with WebACL, Rule, Region and its request counts added). CloudFront web ACL WAF metrics read in us-east-1; an AWS access refusal is the install's "AWS role reads" item, recorded for the account. - New agent tools waf_sampled_requests and waf_log_objects: a rule's sampled requests, and its matches read straight from the web ACL's aws-waf-logs-* objects (bounded, grouped in process by JA4, user agent, accept language, path, cookie presence). The alarm evidence reads the log objects before trying Athena. - Every planner lookup counts (monitoring tools included), 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 nothing for a person and role reads refused this run, it ends awaiting_setup, re-checks the role every 15 minutes then daily (and when another run reads again), and starts again from its ticket once the role reads. Otherwise it plans again. - Incident case cx replays the run.
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
An AWS WAF signature-drift alarm run ended
needs_outside_changewith "Needed from you: Nothing", a cause labelled "Not checked against the data (no lookups were made)" after five lookups, and a request that a person run an Athena query. Four causes, each closed at the root:AWS/WAFV2itself ("isn't a namespace Coderhelm reads") although the team's role allowscloudwatch:GetMetricDataon everything.Changes
common::live::metrics: any namespace is read (CloudWatch's own syntax checked; window, query and dimension caps kept). The list is nowNAMESPACE_HINTSfor the tool description, withAWS/WAFV2(WebACL, Rule, Region; CountedRequests, BlockedRequests, AllowedRequests) and other common namespaces added. A CloudFront web ACL's WAF metrics, like CloudFront's, are read in us-east-1; an optionalregionnames another. An AWS access refusal isStepError::role_refused: the install's "AWS role reads" item in one line, recorded for the account, never a refusal of ours.common::waf_logs(new): reads a web ACL's log objects straight from itsaws-waf-logs-*bucket (hour prefixes newest first, at most 48 objects, 64 MiB compressed and 512 MiB uncompressed, 24 hours) and groups the rule's matches in process by JA4, user agent, Accept-Language, path and cookie presence, with JA4 prefixes, countries, labels, actions and matches per hour. No client address, cookie or other header value, or query string is kept.common::alarm_evidence: split into reusable reads; the alarm's evidence reads the log objects before it tries Athena (Athena stays optional). New agent toolswaf_sampled_requestsandwaf_log_objectsinops_tools, registered as reads; their refusals are recorded as the install item.plan.rs/fix_location::lookups_made: the monitoring tools' lookups count, so "no lookups were made" appears only when none were.common::role_wait(new) andworker::passes::role_wait(new):finish_without_codeendsneeds_outside_changeonly when the final person check leaves an item. With none and role reads refused during this run, the run endsawaiting_setup(new status) with a paragraph saying what it waits for, re-checks the role every 15 minutes for two days, then with the daily role check, and at once when another run reads again. When the reads work, it starts again from its ticket (same sender, so the alarm's evidence is read again) to make the change and open the pull request. With nothing for a person and nothing to wait for, the plan is made again.awaiting_setupis in the run status list, blocks a duplicate trigger, and shows in the chat's waiting group. New worker messagerole_reads_wait.cx_role_reads_wait_then_finish(doc and test) replays the run's shapes with invented names.Deferred: the dashboard (separate repository) shows
awaiting_setupby its raw name until it gets a label.Verification
cargo fmt --check,rustfmt --checkon the incident file,cargo clippy --all-targets -- -D warnings: clean.cargo test(workspace): common 2799, gateway 1083, worker 2250 and the rest pass.AWS/WAFV2; once the reads work it reads the logs and routes to a code plan.