Skip to content

Security Services

First PublishedLast UpdatedByAtif Alam

IAM controls who can do what. The services on this page protect what’s running — application firewalls, DDoS protection, threat detection, encryption key management, and vulnerability scanning. Together they form defense in depth.

Internet ──► Shield (DDoS) ──► WAF (app firewall) ──► CloudFront / ALB ──► Your App
GuardDuty (threat detection) ◄── CloudTrail, VPC Flow Logs, DNS │
Inspector (vulnerability scan) ◄── EC2, ECR images │
Security Hub (central dashboard) ◄── all findings │
KMS (encryption keys) ◄── encrypt data at rest and in transit │

VPC Flow Logs feed both operational RCA and GuardDuty-style analysis. For enabling logs, querying ACCEPT vs REJECT, and correlating with security groups and NACLs, see VPC Flow Logs and Network RCA.

WAF inspects HTTP/HTTPS requests and blocks malicious traffic before it reaches your application.

WAF attaches to:

  • CloudFront distributions
  • ALB (Application Load Balancer)
  • API Gateway (REST and HTTP APIs)
  • AppSync (GraphQL APIs)
Request ──► WAF evaluates rules ──► Allow / Block / Count / CAPTCHA
Block → 403 Forbidden

A Web ACL is a set of rules evaluated in order:

Rule TypeWhat It DoesExample
AWS Managed RulesPre-built rules maintained by AWSSQL injection protection, XSS, known bad inputs
Rate-basedBlock IPs exceeding a request thresholdBlock IP if > 2,000 requests in 5 minutes
IP setAllow/block specific IP rangesAllow only office IPs, block known bad actors
Geo matchBlock/allow by countryBlock requests from countries you don’t serve
Custom rulesMatch on headers, body, query strings, URIBlock if User-Agent contains “bot”
Rule GroupProtects Against
AWSManagedRulesCommonRuleSetOWASP Top 10: SQLi, XSS, path traversal, etc.
AWSManagedRulesSQLiRuleSetSQL injection
AWSManagedRulesKnownBadInputsRuleSetLog4j, Spring exploits, etc.
AWSManagedRulesAmazonIpReputationListKnown malicious IPs
AWSManagedRulesBotControlRuleSetBot detection and management
Terminal window
# Create a Web ACL with managed rules
aws wafv2 create-web-acl \
--name my-web-acl \
--scope REGIONAL \
--default-action '{"Allow":{}}' \
--rules '[
{
"Name": "AWS-CommonRuleSet",
"Priority": 1,
"Statement": {
"ManagedRuleGroupStatement": {
"VendorName": "AWS",
"Name": "AWSManagedRulesCommonRuleSet"
}
},
"OverrideAction": {"None":{}},
"VisibilityConfig": {
"SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true,
"MetricName": "CommonRuleSet"
}
},
{
"Name": "RateLimit",
"Priority": 2,
"Statement": {
"RateBasedStatement": {
"Limit": 2000,
"AggregateKeyType": "IP"
}
},
"Action": {"Block":{}},
"VisibilityConfig": {
"SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true,
"MetricName": "RateLimit"
}
}
]'

Best practice: Start with managed rules in Count mode (logs but doesn’t block), review the logs, then switch to Block mode.

Shield protects against Distributed Denial of Service attacks.

FeatureShield StandardShield Advanced
CostFree (automatic)$3,000/month + data transfer
ProtectionLayer 3/4 (network/transport)Layer 3/4/7 (including application layer)
ResourcesAll AWS resourcesCloudFront, ALB, NLB, Elastic IP, Global Accelerator
Response teamNoneAWS Shield Response Team (SRT) — 24/7
Cost protectionNoneRefund for scaling costs caused by DDoS
VisibilityBasicReal-time attack dashboards, detailed metrics

Shield Standard is always on — you’re already protected against common volumetric attacks (SYN floods, UDP reflection).

Shield Advanced is for high-value applications where DDoS could cause significant business impact or where you need the AWS response team and cost protection.

GuardDuty uses machine learning and threat intelligence to detect suspicious activity in your account — without deploying any agents.

SourceWhat It Finds
CloudTrail eventsUnusual API calls, credential compromise, privilege escalation
VPC Flow LogsPort scanning, data exfiltration, communication with known malicious IPs
DNS logsDNS queries to command-and-control servers, crypto-mining domains
S3 data eventsUnusual access patterns, public bucket access from unexpected IPs
EKS audit logsSuspicious Kubernetes API calls, container escapes
Lambda network activityUnusual outbound connections from Lambda functions
FindingSeverityWhat It Means
UnauthorizedAccess:EC2/SSHBruteForceMediumSomeone is brute-forcing SSH on an instance
Recon:EC2/PortProbeUnprotectedPortLowAn external IP is scanning open ports
CryptoCurrency:EC2/BitcoinTool.B!DNSHighAn instance is communicating with a Bitcoin mining pool
Exfiltration:S3/ObjectRead.UnusualHighUnusual volume of S3 reads (possible data theft)
UnauthorizedAccess:IAMUser/InstanceCredentialExfiltrationHighEC2 instance credentials used from outside AWS
Terminal window
# Enable (one command)
aws guardduty create-detector --enable
# List findings
aws guardduty list-findings --detector-id abc123

GuardDuty generates findings but doesn’t block anything automatically. Set up automated responses:

GuardDuty finding ──► EventBridge rule ──► Lambda ──► Auto-remediate
(quarantine instance,
revoke credentials,
notify Slack)

Security Hub aggregates security findings from multiple services into a single dashboard and checks compliance against standards.

GuardDuty findings ──►┐
Inspector findings ──►├──► Security Hub ──► Dashboard + compliance score
WAF logs ──►│
Firewall Manager ──►│
IAM Access Analyzer ──►│
Config rules ──►┘

Security Hub automatically checks your account against:

StandardWhat It Checks
AWS Foundational Security Best Practices200+ checks across all services
CIS AWS Foundations BenchmarkCenter for Internet Security recommendations
PCI DSSPayment Card Industry standards
NIST 800-53US federal security framework

Each check produces a finding with a severity and remediation guidance.

Terminal window
aws securityhub enable-security-hub \
--enable-default-standards

KMS manages encryption keys for data at rest and in transit across AWS services.

TypeWhat It IsUse Case
AWS managedCreated and managed by AWS for a specific serviceDefault encryption (S3, EBS, RDS) — simplest
Customer managedCreated and managed by youFine-grained access control, rotation policy, cross-account
Customer provided (SSE-C)You provide and manage keys outside AWSRegulatory requirements
Terminal window
# Create a customer managed key
aws kms create-key --description "My app encryption key"
# Encrypt data
aws kms encrypt --key-id alias/my-key --plaintext "sensitive data" --output text --query CiphertextBlob
# Decrypt
aws kms decrypt --ciphertext-blob fileb://encrypted.bin --output text --query Plaintext | base64 --decode

For large data, KMS uses envelope encryption:

  1. KMS generates a data key (plaintext + encrypted copy).
  2. Your app encrypts data with the plaintext data key.
  3. Store the encrypted data + encrypted data key together.
  4. To decrypt: send the encrypted data key to KMS → get plaintext key → decrypt data.

This way, KMS never sees your data — only the small data key.

ServiceWhat’s Encrypted
S3Objects (SSE-S3, SSE-KMS)
EBSVolumes and snapshots
RDSDatabase storage
Secrets ManagerAll secrets
Parameter StoreSecureString parameters
LambdaEnvironment variables
SQSMessages
CloudWatch LogsLog groups

Best practice: Enable default encryption on S3 buckets, EBS volumes, and RDS instances. Use customer managed keys when you need cross-account access or audit key usage.

Terminal window
# Enable automatic rotation (every year)
aws kms enable-key-rotation --key-id alias/my-key

KMS keeps old key material so previously encrypted data can still be decrypted. New data uses the new key material.

Inspector scans EC2 instances and container images for software vulnerabilities and network exposure.

TargetWhat It Finds
EC2 instancesOS vulnerabilities (CVEs), unintended network exposure
ECR container imagesPackage vulnerabilities in Docker images
Lambda functionsVulnerabilities in Lambda deployment packages
Terminal window
# Enable Inspector (automatic scanning)
aws inspector2 enable --resource-types EC2 ECR LAMBDA

Inspector continuously scans — no agents to install (uses SSM Agent for EC2). Findings include:

  • CVE ID and severity (Critical, High, Medium, Low)
  • Affected package and version
  • Fixed version (if available)
  • Remediation guidance
Title: CVE-2024-12345 in openssl 3.0.2
Severity: HIGH
Resource: i-abc123 (EC2)
Package: openssl 3.0.2-0ubuntu1
Fixed in: openssl 3.0.2-0ubuntu1.14
Recommendation: Update openssl to >= 3.0.2-0ubuntu1.14
LayerServiceProtects Against
EdgeShield + WAFDDoS, SQL injection, XSS, bots
NetworkSecurity groups, NACLs, VPCUnauthorized network access
IdentityIAM, MFAUnauthorized API access
DataKMS, Secrets ManagerData exposure (encryption at rest/transit)
DetectionGuardDutyActive threats, anomalous behavior
VulnerabilityInspectorKnown CVEs, misconfigurations
ComplianceSecurity HubDrift from security standards
AuditCloudTrailWho did what, when
  • WAF blocks malicious HTTP traffic (SQLi, XSS, bots, rate limiting). Start with AWS managed rules in Count mode, then switch to Block.
  • Shield Standard (free) protects against network-layer DDoS. Shield Advanced adds application-layer protection and the AWS response team.
  • GuardDuty detects threats using ML on CloudTrail, VPC Flow Logs, and DNS — enable it and set up EventBridge rules for automated response.
  • Security Hub aggregates findings from all security services into one dashboard with compliance scoring.
  • KMS manages encryption keys. Use customer managed keys for fine-grained control; enable default encryption on S3, EBS, and RDS.
  • Inspector continuously scans EC2, ECR images, and Lambda for known vulnerabilities.