# hkb-alert-identity-center-change

Fires on: Identity Center permission set and assignment changes.

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

## Symptoms
An email from `hkb master alert`: `Identity Center <call>` with the caller's ARN. A permission set, its policies or an account assignment changed.

## Pre-checks
1. Permission sets and assignments come only from the `hkb-bootstrap-identity` stack. A change through CloudFormation is expected when that stack was updated by a reviewed change set.
2. Compare the stack with the repository: the control tests' INV-11 reports a difference, and `aws sso-admin list-account-assignments` as HKB-ReadOnly shows who holds what.

## Resolution
- **Matches a reviewed update to `hkb-bootstrap-identity`:** nothing to do.
- **Doesn't match:** an assignment made outside the stack grants access nobody reviewed. Delete it, then update the stack from the repository so every permission set matches its template.

## Post-checks
INV-11 shows no difference for `hkb-bootstrap-identity`, and `hkb-admins` holds only the permission sets the template assigns.

## Rollback
A stack update from the repository.

## Alert details

| Property | Value |
| --- | --- |
| Runs in | the management account, us-east-1 |
| Email | From `hkb master alert`: `Identity Center <what> at <time> by <who>.` |
| Source | `security/hkb-security-master-alerts.yaml`, resource `IdentityCenterRule` |

The event pattern, as deployed:

```yaml
EventPattern:
  detail-type: [AWS API Call via CloudTrail]
  detail:
    eventSource: [sso.amazonaws.com]
    eventName:
      - CreatePermissionSet
      - UpdatePermissionSet
      - DeletePermissionSet
      - AttachManagedPolicyToPermissionSet
      - DetachManagedPolicyFromPermissionSet
      - AttachCustomerManagedPolicyReferenceToPermissionSet
      - DetachCustomerManagedPolicyReferenceFromPermissionSet
      - PutInlinePolicyToPermissionSet
      - DeleteInlinePolicyFromPermissionSet
      - PutPermissionsBoundaryToPermissionSet
      - DeletePermissionsBoundaryFromPermissionSet
      - CreateAccountAssignment
      - DeleteAccountAssignment
```
