Infrastructure protection
Protect the edge from volumetric and application-layer attacks, keep hosts patched by rebuild rather than by hand, and monitor the network for what gets through.
DDoS protection
| Layer | Service | What it does |
|---|---|---|
| 3/4 | AWS Shield Standard | Automatic protection against common network and transport attacks — SYN floods, DNS floods, UDP reflection |
| 3/4 | AWS Shield Standard + CloudFront | Edge distribution absorbs volume before it reaches the origin |
| 7 | AWS WAF | Rate limiting and pattern-based blocking at the application layer |
| All | Shield Advanced | DDoS Response Team, enhanced reporting, cost protection during an attack |
Shield Advanced is appropriate where the workload has a high-value public surface and the cost of absorbing an attack is material. Shield Standard is automatic and covers the common cases.
Web application firewall
A WAF Web ACL is attached to every public entry point: CloudFront, ALB, API Gateway, AppSync.
Rule order
1. Allow-list known integration IP ranges (where required)
2. Block IPs on the threat list
3. AWS Managed Rules — baseline
4. AWS Managed Rules — known bad inputs
5. AWS Managed Rules — SQL injection
6. Rate-based rule per IP
7. Custom rules for application-specific abuse
8. Default action: allow (with logging)
Order matters. A rate limit placed after a block rule never sees the blocked traffic; an allow-list placed after a block rule can be unreachable.
Managed rule groups
| Group | Protects against |
|---|---|
AWSManagedRulesCommonRuleSet | OWASP Top 10 baseline |
AWSManagedRulesKnownBadInputsRuleSet | Exploit payload patterns |
AWSManagedRulesSQLiRuleSet | SQL injection |
AWSManagedRulesLinuxRuleSet / WindowsRuleSet | OS-specific exploits |
AWSManagedRulesBotControlRuleSet | Automated abuse |
Managed rules are not a complete configuration. They are the baseline; custom rules address the application's own abuse patterns.
Rate limiting
{
"Name": "RateLimitPerIp",
"Priority": 10,
"Action": { "Block": {} },
"Statement": {
"RateBasedStatement": {
"Limit": 2000,
"AggregateKeyType": "IP"
}
},
"VisibilityConfig": {
"SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true,
"MetricName": "RateLimitPerIp"
}
}
Set the limit above the busiest legitimate client, not at a round number. A limit that blocks real users is an outage with a security label.
Logging
WAF logs go to CloudWatch Logs, S3 or Firehose. Logs are essential: without them a blocked request cannot be distinguished from a request that never arrived.
Patch management
| Workload | Mechanism | Cadence |
|---|---|---|
| EC2 | Rebuild AMI, instance refresh | Monthly; immediately for critical |
| Containers | Rebuild base image, redeploy | Weekly; immediately for critical |
| Lambda | Runtime and dependency upgrade | Per support window |
| Managed services | AWS-managed | Monitored via AWS Health |
| Instances managed by SSM | Patch baseline and maintenance window | Monthly |
Patching by replacement is preferred: a rebuilt instance is known-good, whereas a patched instance has a history. Where in-place patching is unavoidable — long-lived stateful hosts — Systems Manager Patch Manager applies baselines on a schedule and reports compliance.
Patch compliance
- Patch baseline per environment and OS family.
- Maintenance window with a defined concurrency.
- Compliance report reviewed weekly.
- Non-compliant instances above the threshold raise an alarm.
- Emergency patch path: rebuild, publish, deploy through the normal pipeline.
Host hardening
| Control | Implementation |
|---|---|
| Minimal image | No compilers, package managers or debug tools in the runtime image |
| Non-root process | Application runs as an unprivileged user |
| Read-only filesystem | Where the application does not need to write locally |
| IMDSv2 required | Enforced by SCP |
| No SSH from the internet | Session Manager for administrative access |
| Host firewall | Security groups as the primary control; local firewall as defence in depth |
| Audit logging | CloudWatch agent + OS audit rules, shipped centrally |
| Disk encryption | EBS encryption by default |
Network inspection
| Control | Where | Purpose |
|---|---|---|
| Security groups | Every ENI | Instance-level allow rules |
| NACLs | Subnet | Subnet-level allow/deny, including explicit deny |
| AWS Network Firewall | VPC perimeter | Stateful inspection, domain filtering, IDS/IPS |
| VPC Flow Logs | Every VPC | Visibility into accepted and rejected traffic |
| Route 53 Resolver DNS Firewall | DNS layer | Block resolution of known-malicious domains |
| Firewall Manager | Organisation | Apply policy centrally, including accounts created later |
Monitoring
| Signal | Alarm |
|---|---|
| WAF blocked requests spike | Investigate source and pattern |
| Shield detected attack | Notify security; check origin health |
| Unusual egress volume | Possible exfiltration |
| Rejected flows from internal hosts | Possible lateral movement |
| Patch compliance below threshold | Remediate |
| Public security group opened | Immediate review |