hkb-forward-iam-high-risk
Fires on: IAM users, access keys and login profiles, and removing or editing an hkb boundary (the calls the boundaries deny).
Run the common pre-checks first.
Symptoms
An email from hkb security alert: SECURITY EVENT aws.iam <call> in account <member>. One of: an IAM user, access key or login profile was created or changed, a permissions boundary was removed from a role, or an hkb-*-boundary policy was edited or deleted.
Pre-checks
- Did the call succeed? The rule matches attempts too. Read the event's
errorCode:AccessDeniedmeans a boundary or an SCP stopped it, and the alert shows the guardrail working. - Who made it:
userIdentity.arn. SCP-04 denies creating users, access keys and login profiles to everything but the Control Tower and StackSets execution roles, and the hkb boundaries deny removing or editing a boundary. A successful call points at one of those exempt roles.
Resolution
- Denied: find out why the caller tried. A pipeline role trying is a template bug; fix the template in a PR.
- Succeeded: delete the user, key or login profile, or put the boundary back. HKB has no IAM users anywhere, so any user is unwanted. In a member account the fix goes through the pipeline (a template change) or, for a role the pipeline doesn't own, a task-scoped root session.
Post-checks
aws iam get-account-summary --profile ro-<account> shows Users 0, and the control tests' boundary checks pass for that account.
Rollback
Nothing to roll back: the fix removes something that shouldn't exist.
Alert details
| Property | Value |
|---|---|
| Runs in | every member account, both Regions, 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-events.yaml, resource IamRule |
The event pattern, as deployed:
EventPattern:
source: [aws.iam]
detail-type: [AWS API Call via CloudTrail]
detail:
eventSource: [iam.amazonaws.com]
"$or":
- eventName: [CreateUser, CreateAccessKey, CreateLoginProfile, UpdateLoginProfile, DeleteRolePermissionsBoundary]
- eventName: [CreatePolicyVersion, DeletePolicy, DeletePolicyVersion, SetDefaultPolicyVersion]
requestParameters:
policyArn:
- wildcard: "*:policy/hkb-*-boundary"
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-events.yaml- Linked from
- Runbooks, Member account security events
- Plain markdown
- /wiki/runbooks/members/hkb-forward-iam-high-risk/index.md