Agent Wranglers

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

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.