# HKB-RootUnlock

Task-scoped root sessions for member accounts (audit, S3 and SQS policy unlock)

- **Session:** 1 hours. **Accounts:** [Management](/architecture/management/).
- **AWS managed policies:** `IAMAuditRootUserCredentials`, `S3UnlockBucketPolicy`, `SQSUnlockQueuePolicy`.
- **Inline policy:** 5 actions across 2 services (organizations, sts).
- **Source:** `bootstrap/hkb-bootstrap-identity.yaml`, resource `RootUnlockSet`.

## Policy

```yaml
InlinePolicy:
  Version: "2012-10-17"
  Statement:
    - Sid: TaskScopedRootSessions
      Effect: Allow
      Action: sts:AssumeRoot
      Resource: "*"
      Condition:
        StringEquals:
          sts:TaskPolicyArn:
            - arn:aws:iam::aws:policy/root-task/IAMAuditRootUserCredentials
            - arn:aws:iam::aws:policy/root-task/S3UnlockBucketPolicy
            - arn:aws:iam::aws:policy/root-task/SQSUnlockQueuePolicy
    - Sid: FindMemberAccounts
      Effect: Allow
      Action:
        - organizations:DescribeAccount
        - organizations:DescribeOrganization
        - organizations:ListAccounts
        - organizations:ListAccountsForParent
      Resource: "*"
```
