hkb-forward-site-cutoff-errors
Fires on: The site cutoff function failing.
Run the common pre-checks first.
Symptoms
An email from hkb security alert for the CloudWatch alarm hkb-site-cutoff-errors going to ALARM in Prod. The hkb-site-cutoff function returned an error, so the cost cutoff may have failed. The site may keep serving past its CloudFront budget.
Pre-checks
- Read the function's log group,
/aws/lambda/hkb-site-cutoff, as HKB-ReadOnly (ro-hkb-prod) for the error and its stack trace. - Check whether the distribution is still enabled:
aws cloudfront get-distribution --profile ro-hkb-prod --id <id>.Enabled: falsemeans a retry worked, and the cutoff runbook applies instead. - Read the month's CloudFront usage in Cost Explorer (
ro-hkb-master) to judge how urgent the stop is.
Resolution
- Spend is still climbing: take the site off by hand first. A
SiteOnlinepull request to false disables the distribution through the pipeline. Kyle runs that step. - Then fix the function: correct the cause in
baseline/hkb-baseline-site-cutoff.yaml(a permission, the distribution ID, a code error) and deploy it through the pipeline. - Prove the fix: manual step H-12.7,
site-cutoff.sh test, publishes to the cutoff topic on the budget's path. The function should disable the distribution and the cutoff alert should follow. Restore with H-12.6.
Post-checks
The alarm returns to OK, the function's last run in the log group shows no error, and the cutoff alert arrived after the test. The live check passes once the site is back on.
Rollback
Revert the function's PR and deploy again. Leave the site off until the cutoff works.
Alert details
| Property | Value |
|---|---|
| Runs in | Prod, us-east-1, forwarded to the hkb-security-events bus in Security |
From hkb security alert: SECURITY EVENT <src> <what> in account <account>, <region>, at <time> by <who>. |
|
| Source | baseline/hkb-baseline-site-cutoff.yaml, resource CutoffErrorsForwardRule |
The event pattern, as deployed:
EventPattern:
source: [aws.cloudwatch]
detail-type: [CloudWatch Alarm State Change]
detail:
alarmName: [hkb-site-cutoff-errors]
state:
value: [ALARM]
Page information
- Owner
- Detection and Response
- Status
- current Current: generated from the templates and records in the repository at this build.
- Generated from
site/content/runbooks.md,baseline/hkb-baseline-site-cutoff.yaml- Linked from
- Runbooks, Member account security events
- Plain markdown
- /wiki/runbooks/members/hkb-forward-site-cutoff-errors/index.md