INF-14Recommended
Start every account from one baseline
Create every new account from code with the same baseline. That means an audit log, a budget, blocked public storage, default encryption and the allowed regions.
How to do it
Keep the baseline as one module that runs when an account is created. AWS Control Tower, a landing zone or your own account factory can run it. Send the audit log to a separate log account that the other accounts cannot delete from. Add the budget and the guardrails from the same module.
Examples
Terraform example
resource "aws_s3_account_public_access_block" "baseline" {
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
resource "aws_ebs_encryption_by_default" "baseline" {
enabled = true
}
resource "aws_cloudtrail" "baseline" {
name = "account-audit"
s3_bucket_name = "example-shop-audit-logs"
is_multi_region_trail = true
enable_log_file_validation = true
}
How to check
For every account in the organization, a script confirms the audit trail is on, a budget exists and account-level public access is blocked. It also confirms default disk encryption is on and a call in a region outside the list ends in AccessDenied.
Sources
Related rules
- INF-53 Give every account a budget with alerts in Infrastructure and environments
- INF-40 Block dangerous actions for the whole organization in Infrastructure and environments
- INF-59 Block sharing outside the organization in Infrastructure and environments
- INF-15 Turn on threat detection in every account in Infrastructure and environments
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/environments/account-baseline">Agent Wranglers infrastructure and environments playbook</a>. In code you write, add a comment next to it with the same link.