# hkb-forward-root-signin

Fires on: Any root user console sign-in, successful or not.

Run the [common pre-checks](/wiki/runbooks/#common-pre-checks) first.

## Symptoms
An email from `hkb security alert`: `SECURITY EVENT aws.signin ConsoleLogin in account <member>`. A root sign-in was attempted in a member account.

## Pre-checks
1. Member accounts have no root password (centralized root access), so a console sign-in can't succeed without a password recovery first, and recovery goes to the account's root email address. Even then SCP-09 denies every root action except task-scoped sessions started from the management account.
2. Read the event in the member account: `aws cloudtrail lookup-events --profile ro-<account> --region <region> --lookup-attributes AttributeKey=EventName,AttributeValue=ConsoleLogin`.

## Resolution
- **Result `Failure`:** someone has the account's root email address. Check the root email inbox for recovery messages; nothing else can be done on the account side.
- **Result `Success`:** the root password was recovered, though SCP-09 still blocks what the session can do. From the management account, run the root audit task as HKB-RootUnlock to see which credentials exist. Deleting them is the break-glass runbook (D56), which HKB-RootUnlock deliberately can't run. Read the account's CloudTrail for root events since.

## Post-checks
The root audit task shows no password, no access keys and no MFA device on the member account.

## Rollback
Nothing to roll back: deleting a recovered root password returns the account to its normal state.

## Alert details

| Property | Value |
| --- | --- |
| Runs in | every member account, both Regions, forwarded to the `hkb-security-events` bus in Security |
| Email | From `hkb security alert`: `SECURITY EVENT <src> <what> in account <account>, <region>, at <time> by <who>.` |
| Source | `baseline/hkb-baseline-events.yaml`, resource `RootSignInRule` |

The event pattern, as deployed:

```yaml
EventPattern:
  source: [aws.signin]
  detail-type: [AWS Console Sign In via CloudTrail]
  detail:
    userIdentity:
      type: [Root]
```
