Description
Use temporary credentials from a least-privilege role for automation. Check the AWS account root user separately and remove any root access keys.
Potential impact
An exposed account root key can affect data, resources and security settings across the account. An exposed IAM user key grants the access that user's policies allow.
Remediation
- For a planned change, move each workload to the role and test it. Deactivate the old key, verify the workloads still run, then delete it.
- If an account root key is exposed, revoke it promptly and review account activity. Keep MFA enabled for root sign-in. Enabling MFA leaves existing access keys active.
Examples
UserName: Root selects an existing IAM user named Root. Check its policies to see what its key can do.
Before
yaml
Resources:
CFNKeys:
Type: AWS::IAM::AccessKey
Properties:
UserName: Root
Omitting Status creates an active key.
After
yaml
Resources:
CFNKeys:
Type: AWS::IAM::AccessKey
Properties:
UserName: Root
Status: Inactive
Status: Inactive stops this key from authenticating AWS requests.