Identity and access
Sign people in through one identity provider, give every role the least it needs, and keep no long-lived keys. Log every call in a trail nobody can change.
- Required 7
- Recommended 4
Most cloud breaches start with a leaked key or an account with too much power. These rules decide who and what can change the infrastructure, and record every change they make. Keys inside the app and database users are covered in Give each key the least power and the app database role.
Required
Sign people in through single sign-on
INF-16Give people cloud access only through the company identity provider, with two-factor login. Create no separate cloud user with a password for a person.
Keep no long-lived access keys
INF-17Use short-lived credentials for every person, pipeline and service. Delete every static access key, and alert when a new one appears.
Give every role the least it needs
INF-18Write every role's permissions in code, limited to named actions on named resources. Never grant every action on every resource, except to the break-glass role.
Lock the root account away
INF-20Protect every cloud root or owner account with a hardware key or passkey, give it no access keys, and alert on every sign-in.
Block sharing outside the organization
INF-59Block public sharing of disk snapshots and machine images in every region you use. Run an external access analyzer over the whole organization, and close each finding within 7 days.
Name the caller in every trust you give a vendor or a service
INF-70Bind every role an outside vendor may assume to a value unique to your account at that vendor, such as the external ID on AWS. Every resource policy that lets a cloud service in names your account or resource as the source.
Keep one audit trail for the whole organization that no account can change
INF-85Record every management call in every account and region in one organization-wide audit trail. Store it in a separate log account under a write-once lock, and alert within 15 minutes when anyone stops or changes it.
Recommended
Separate the roles for plan and apply
INF-19Give pull requests a read-only role that can only plan. Give the write role only to the main branch in a protected environment. Give the app its own runtime role.
Keep tested break-glass accounts
INF-21Keep two emergency admin accounts that work when single sign-on is down. Store their factors offline, alert on every use, and test them twice a year.
Grant admin access for hours only
INF-22Give nobody standing admin rights in production, in the cloud, the databases, the admin tool or the code host. Grant them only on request, with a reason and a second person's approval, for 8 hours at most.
Turn on threat detection in every account
INF-15Turn on the cloud's managed threat detection in every account and region you use. Send high and critical findings to the on-call team within 15 minutes.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/infrastructure/identity-and-access">Agent Wranglers infrastructure and environments playbook</a>. In code you write, add a comment next to it with the same link.