Skip to content

Instantly share code, notes, and snippets.

@spasam
Last active November 6, 2023 04:45
Show Gist options
  • Save spasam/608457e6d0677061302a00ef08945383 to your computer and use it in GitHub Desktop.
Save spasam/608457e6d0677061302a00ef08945383 to your computer and use it in GitHub Desktop.
Secure your AWS accounts by disallowing creation of access keys for the root user, which will allow unrestricted access to all resources in the account
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "GRRESTRICTROOTUSERACCESSKEYS",
"Effect": "Deny",
"Action": "iam:CreateAccessKey",
"Resource": [
"*"
],
"Condition": {
"StringLike": {
"aws:PrincipalArn": [
"arn:aws:iam::*:root"
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment