Security Baseline
AWS architecture template · SAA-C03: WAF + KMS + Secrets Manager + CloudTrail → S3 + CloudWatch + SNS
Security Baseline is a free AWS architecture template built with CloudTrail, CloudWatch, IAM, KMS, S3, Secrets Manager, SNS and WAF. Open it in TheArchitect to edit the diagram, estimate monthly cost, and export the CloudFormation or Terraform that deploys it.
AWS services in this template
- CloudTrail
- CloudWatch
- IAM
- KMS
- S3
- Secrets Manager
- SNS
- WAF
Deployment notes
Needs input
- The S3 audit bucket requires a bucket policy granting cloudtrail.amazonaws.com write access before the trail can deliver logs.
Generated CloudFormation — 8 resources
| Logical ID | Resource type |
|---|---|
| WAFwaf | AWS::WAFv2::WebACL |
| KMSkms | AWS::KMS::Key |
| SecretsManagersecretsmanager | AWS::SecretsManager::Secret |
| TrailRoleiam | AWS::IAM::Role |
| CloudTrailcloudtrail | AWS::CloudTrail::Trail |
| AuditLogBuckets3 | AWS::S3::Bucket |
| CloudWatchcloudwatch | AWS::CloudWatch::Alarm |
| SecurityAlertssns | AWS::SNS::Topic |
View the full CloudFormation template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Generated by TheArchitect — https://www.thecloudarchitect.dev",
"Metadata": {
"TheArchitect": {
"Edges": [
{
"From": "TrailRoleiam",
"To": "CloudTrailcloudtrail",
"Label": "role"
},
{
"From": "KMSkms",
"To": "CloudTrailcloudtrail",
"Label": "encrypt"
},
{
"From": "CloudTrailcloudtrail",
"To": "AuditLogBuckets3",
"Label": "logs"
},
{
"From": "CloudWatchcloudwatch",
"To": "SecurityAlertssns",
"Label": "alarm"
},
{
"From": "SecretsManagersecretsmanager",
"To": "KMSkms",
"Label": "encrypt"
}
]
}
},
"Resources": {
"WAFwaf": {
"Type": "AWS::WAFv2::WebACL",
"Properties": {
"Name": "saa-security-web-acl",
"Scope": "REGIONAL",
"DefaultAction": {
"Allow": {}
},
"VisibilityConfig": {
"CloudWatchMetricsEnabled": true,
"MetricName": "SaaSecurityWebACL",
"SampledRequestsEnabled": true
},
"Description": "Regional WAF protecting API endpoints."
}
},
"KMSkms": {
"Type": "AWS::KMS::Key",
"Properties": {
"Description": "Customer-managed key for data and log encryption.",
"KeySpec": "SYMMETRIC_DEFAULT",
"KeyUsage": "ENCRYPT_DECRYPT",
"EnableKeyRotation": true,
"Enabled": true,
"MultiRegion": false
}
},
"SecretsManagersecretsmanager": {
"Type": "AWS::SecretsManager::Secret",
"Properties": {
"Name": "saa/security/db-credentials",
"Description": "Database credentials — auto-rotated and KMS-encrypted.",
"KmsKeyId": "alias/saa-security-key",
"GenerateSecretString": {
"PasswordLength": 32,
"ExcludeCharacters": "\"@/"
}
}
},
"TrailRoleiam": {
"Type": "AWS::IAM::Role",
"Properties": {
"RoleName": "saa-security-trail-role",
"Description": "CloudTrail service role for CloudWatch Logs delivery."
}
},
"CloudTrailcloudtrail": {
"Type": "AWS::CloudTrail::Trail",
"DependsOn": [
"TrailRoleiam"
],
"Properties": {
"TrailName": "saa-security-trail",
"S3BucketName": "saa-security-cloudtrail-logs",
"IsLogging": true,
"IsMultiRegionTrail": true,
"EnableLogFileValidation": true,
"IncludeGlobalServiceEvents": true
}
},
"AuditLogBuckets3": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "saa-security-cloudtrail-logs",
"VersioningConfiguration": {
"Status": "Enabled"
},
"OwnershipControls": {
"Rules": [
{
"ObjectOwnership": "BucketOwnerEnforced"
}
]
},
"BucketEncryption": {
"ServerSideEncryptionConfiguration": [
{
"ServerSideEncryptionByDefault": {
"SSEAlgorithm": "AES256"
}
}
]
},
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": true,
"BlockPublicPolicy": true,
"IgnorePublicAcls": true,
"RestrictPublicBuckets": true
},
"Tags": [
{
"Key": "Name",
"Value": "saa-security-cloudtrail-logs"
}
]
}
},
"CloudWatchcloudwatch": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmName": "saa-security-unauthorized-api",
"AlarmDescription": "Alert on unauthorized API calls detected by CloudTrail.",
"Namespace": "CloudTrailMetrics",
"MetricName": "UnauthorizedAttemptCount",
"Statistic": "Sum",
"Period": 300,
"EvaluationPeriods": 1,
"Threshold": 1,
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"TreatMissingData": "notBreaching"
}
},
"SecurityAlertssns": {
"Type": "AWS::SNS::Topic",
"Properties": {
"TopicName": "saa-security-alerts",
"DisplayName": "Security alerts"
}
}
}
}Generated by TheArchitect from the diagram above. Review values such as names, CIDR ranges and instance sizes before deploying to your account.
Related templates
- CloudTrail AuditSAA-C03: CloudTrail multi-region logging → S3 + KMS + CloudWatch + SNS alerts
- Secrets Rotation & Compliance AuditZero hardcoded credentials: EC2 fetches DB credentials from Secrets Manager with automatic 30-day rotation. CloudTrail captures every API call to an immutable S3 audit bucket.
- FIFO Payments LedgerExactly-once payment processing with FIFO SQS deduplication, conditional DynamoDB writes for idempotency, CMK encryption, and a DLQ alert path.