Security Services#

AWS provides a deep security services portfolio — from encryption key management to threat detection. This section covers the services you need to protect production workloads.


AWS KMS (Key Management Service)#

Centrally managed encryption keys for data at rest and in transit.

ConceptDescription
CMK (Customer Master Key)The root key — never leaves KMS hardware
Data keyGenerated by KMS, used to encrypt your data (envelope encryption)
Key policyIAM-like policy attached to the key (who can use/manage it)
Key rotationAutomatic annual rotation (AWS-managed keys) or manual
Key aliasHuman-readable name (alias/my-app-key)

Envelope Encryption Pattern#

1. App calls KMS → GenerateDataKey → plaintext data key + encrypted data key
2. App encrypts data with plaintext data key
3. App stores encrypted data + encrypted data key together
4. App discards plaintext data key from memory
5. To decrypt: send encrypted data key to KMS → get plaintext data key → decrypt data

Services That Integrate with KMS#

S3 (SSE-KMS), EBS, RDS, DynamoDB, Secrets Manager, SQS, SNS, CloudWatch Logs, ECS, Lambda environment variables.


AWS WAF (Web Application Firewall)#

Protects CloudFront, ALB, API Gateway, and AppSync from common web exploits.

Rule TypeWhat It Blocks
AWS Managed RulesOWASP Top 10, known bad inputs, bot traffic
Rate-based rulesDDoS, brute force (e.g., >2000 requests per 5 min from one IP)
IP set rulesBlock/allow specific IPs or CIDR ranges
Geo-match rulesBlock/allow by country
Regex pattern rulesCustom patterns in headers, body, URI
SQL injection rules' OR 1=1, union-based injection patterns
XSS rules<script> tags, event handlers in input

AWS Shield#

Shield StandardShield Advanced
CostFree~$3,000/month
ProtectionL3/L4 DDoS (SYN flood, UDP reflection)L3/L4/L7 + dedicated DDoS response team
ResponseAutomatic24/7 DDoS Response Team (DRT)
Cost protectionNoYes (DDoS scaling cost credits)

Amazon GuardDuty#

Threat detection service — analyses CloudTrail, VPC Flow Logs, and DNS logs to find suspicious activity.

Finding TypeExample
ReconPort scan from known malicious IP
Credential compromiseAPI calls from unusual location or impossible travel
Crypto miningEC2 instance communicating with Bitcoin mining pool
Data exfiltrationUnusual S3 bucket access patterns
Privilege escalationIAM user creating admin policies

No agents, no infrastructure to manage. Enable it per account/region and it starts analysing immediately.


AWS Security Hub#

Aggregates findings from GuardDuty, Inspector, Macie, Config, Firewall Manager, and third-party tools into a single dashboard.

Compliance Standards#

StandardWhat It Checks
AWS Foundational Security Best Practices200+ checks across all services
CIS AWS Foundations Benchmark50+ controls (IAM, logging, networking)
PCI DSSPayment card industry requirements
NIST 800-53US government security controls

Amazon Inspector#

Automated vulnerability scanning:

TargetWhat It Scans
EC2 instancesOS packages (CVEs), network reachability
ECR container imagesOS packages and application dependencies
Lambda functionsApplication dependencies

Findings include CVE ID, severity (CVSS), affected package, and remediation guidance.


Amazon Macie#

Discovers and protects sensitive data in S3:

  • Scans S3 buckets for PII (names, addresses, credit cards, SSNs)
  • Identifies buckets with public access, no encryption, or overly permissive policies
  • Generates findings for compliance (GDPR, HIPAA)

AWS Config#

Continuously evaluates resource configurations against rules:

Config Rule: "All S3 buckets must have encryption enabled"
→ Evaluates every bucket
→ Flags non-compliant resources
→ Optional: auto-remediation via SSM Automation

Common Config Rules#

RuleChecks
s3-bucket-server-side-encryption-enabledEncryption on all buckets
rds-storage-encryptedRDS encryption enabled
restricted-sshNo 0.0.0.0/0 on port 22 in security groups
iam-root-access-key-checkNo access keys on root account
cloudtrail-enabledCloudTrail active in all regions

Security Architecture Pattern#

Internet → CloudFront + WAF → ALB → Security Groups → ECS/EC2
                                          ↓
                                    KMS (encryption at rest)
                                    Secrets Manager (credentials)
                                    GuardDuty (threat detection)
                                    Config (compliance)
                                    Security Hub (aggregation)
                                    CloudTrail (audit log)

Key Takeaways#

  • KMS for encryption key management. Use envelope encryption — never encrypt data with the master key directly.
  • WAF on CloudFront/ALB for L7 protection (OWASP rules, rate limiting, geo-blocking). Shield for DDoS.
  • GuardDuty for threat detection — enable it in every account, zero infrastructure.
  • Security Hub aggregates findings from all security services into one dashboard.
  • Inspector for vulnerability scanning (EC2, ECR, Lambda). Macie for PII discovery in S3.
  • AWS Config for continuous compliance — detect and auto-remediate configuration drift.