feat(cloudformation): Add DevOps Agent alarm investigations template - #38
Open
LorenzoBoccaccia wants to merge 1 commit into
Open
feat(cloudformation): Add DevOps Agent alarm investigations template#38LorenzoBoccaccia wants to merge 1 commit into
LorenzoBoccaccia wants to merge 1 commit into
Conversation
Add a CloudFormation addon that forwards a single CloudWatch alarm to a DevOps Agent generic (HMAC) webhook to open an investigation, plus a combined cloudformation/ README documenting it alongside the existing skill-policies template. The signing Lambda hardens the forwarding path: layered SSRF egress checks with connect-to-validated-IP pinning, HMAC-SHA256 request signing, alarm-ARN match to reject spoofed/mismatched events, retry-stable incidentId for dedup, staleness cutoff matching the retry window, and least-privilege IAM. Reserved concurrency and log retention are configurable; the webhook HMAC key is read from a Secrets Manager secret (SecretString or SecretBinary).
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.
Description
Add a CloudFormation addon that forwards a single CloudWatch alarm to a DevOps Agent generic (HMAC) webhook to open an investigation, plus a combined cloudformation/ README documenting it alongside the existing skill-policies template.
The signing Lambda hardens the forwarding path: layered SSRF egress checks with connect-to-validated-IP pinning, HMAC-SHA256 request signing, alarm-ARN match to reject spoofed/mismatched events, retry-stable incidentId for dedup, staleness cutoff matching the retry window, and least-privilege IAM. Reserved concurrency and log retention are configurable; the webhook HMAC key is read from a Secrets Manager secret (SecretString or SecretBinary).
Type of change
Testing
This change is a CloudFormation automation add-on (not a skill), so Agent Skill
Eval does not apply. It was validated at four levels — template, unit, live AWS,
and a real DevOps Agent webhook.
1. Template validation
aws cloudformation validate-template— passed (6 parameters recognized,CAPABILITY_IAM).2. Local unit / adversarial tests of the inline signing Lambda (python3.12, the
target runtime) — 24/24 passing, covering:
169.254.169.254(IMDS), CGNAT
100.64/10, TEST-NET/reserved, and IPv4-embedded-in-IPv6(
::ffff:, NAT6464:ff9b::, 6to4); allows public v4/v6.SecretBinary; rejectsempty / missing-field / non-string.
resources[0]rejected and logged.incidentId(event id, thenalarmArn+state-timestamp; neverwall-clock).
base64(HMAC-SHA256(key, "timestamp:payload")).JSON schema through the real
_post/ pinned-TLS connect.3. Live AWS deploy-and-teardown (throwaway dev account, all resources tagged,
fully torn down afterwards):
CREATE_COMPLETE(IAM role, inline-packaged Lambda, EventBridgerule, log group, conditional reserved concurrency).
Manager fetch → HMAC sign → SSRF resolve → TLS POST and handled the endpoint
response.
skipped: alarm ARN mismatch.DeletionPolicy: Deletebehavior; stack, log group, and secret removed.4. Real DevOps Agent webhook contract (manual) — posted one signed request to a
live generic (HMAC) webhook: HTTP 200, confirming the signing scheme
(
x-amzn-event-timestamp/x-amzn-event-signature) and the payload schema(
eventType/incidentId/action/priority/title/description/timestamp/data) are accepted as-is.License confirmation