AWS Security Services

AWS-SECURITY-SERVICES

Threat detection, data protection, and infrastructure security on AWS — Shield, WAF, GuardDuty, Inspector, Macie, KMS, CloudHSM, Secrets Manager, and Security Hub.

awssecuritykmswafguarddutyshieldsecrets-managerencryption

Overview

AWS security services fall into three broad categories: threat detection and response, data protection and encryption, and infrastructure and application protection. No single service covers all of these concerns — a complete security posture requires composing them deliberately.

The AWS shared responsibility model defines the split: AWS secures the physical infrastructure (hardware, facilities, networking fabric, hypervisors). You secure everything running on that infrastructure — your operating systems, applications, data, network access controls, and identity configuration. The services described here are the tools AWS provides for your side of that boundary.


Infrastructure and Application Protection

AWS Shield

Shield Standard is automatic DDoS protection applied to every AWS account at no extra cost. There is nothing to enable — it is always active. Shield Standard defends against Layer 3 and Layer 4 volumetric attacks:

Standard protection is most effective when your application uses CloudFront, Route 53, and ALB — AWS applies additional scrubbing infrastructure at the edge for these services.

Shield Advanced is a paid service ($3,000/month per organization, regardless of account count, with a 12-month commitment). It provides substantially stronger protection for applications with strict uptime requirements:

FeatureDetails
Protected resource typesEC2 Elastic IPs, ALB, NLB, Classic ELB, CloudFront, Global Accelerator, Route 53
Layer 7 protectionAutomatic application-layer attack detection and mitigation via WAF integration
Near real-time visibilityCloudWatch metrics for attack volume and source characteristics during an event
DDoS Response Team (DRT)24/7 access to AWS specialists during active attacks — custom mitigations, escalation support
Cost protectionAWS credits bill charges (EC2, data transfer) caused by scaling events triggered by a DDoS attack
WAF creditsShield Advanced includes WAF usage credits for protected resources

Shield Advanced protection must be explicitly enabled on each resource. It is the right choice for applications that cannot tolerate downtime and face active or persistent DDoS threats.


AWS WAF

AWS WAF is a Layer 7 Web Application Firewall that inspects HTTP and HTTPS requests and allows or blocks them based on configurable rules. Unlike Shield, which operates at the network and transport layers, WAF understands the content of web requests — URI paths, query strings, HTTP headers, cookies, and request bodies.

Attachment points — WAF WebACLs can be attached to:

WebACL Structure

A WebACL is the top-level WAF object. It contains an ordered list of rules and a default action (Allow or Block) that applies to requests that match no rules.

Each rule has a statement (what to match) and an action (what to do):

ActionEffect
AllowPass the request to the origin
BlockReturn 403 Forbidden, or a custom HTTP response
CountIncrement a metric but take no blocking action — used for observing rule impact before enabling
CAPTCHARequire the user to solve a CAPTCHA challenge
ChallengeIssue a silent JavaScript browser challenge to detect bots

Rules are evaluated in priority order. The first rule that matches determines the outcome.

Rule Types

AWS Managed Rule Groups are pre-built rule sets maintained by AWS:

Managed GroupProtects Against
Core Rule Set (CRS)OWASP Top 10: SQL injection, XSS, path traversal, log4j, local/remote file inclusion
Known Bad InputsPatterns associated with known vulnerabilities and exploit frameworks
SQL DatabaseSQL injection in query strings, URI, cookies, and request bodies
Linux OSLinux-specific command injection patterns
Amazon IP Reputation ListKnown malicious IPs: Tor exit nodes, botnets, scanners
Bot ControlClassifies traffic by bot type; distinguishes Googlebot from malicious scrapers

Rate-based rules count requests from a single IP within a 5-minute sliding window. When the threshold is exceeded, WAF blocks that IP for the remainder of the window. Effective against credential stuffing, brute-force login attempts, and scraping.

Custom rules match on any combination of request attributes:

Count mode is the correct way to evaluate new rules in production. Run the rule in Count mode first, observe the CloudWatch metrics and WAF logs to identify false positives, then switch to Block. Never enable a new managed rule group in Block mode without first observing its behavior.


Threat Detection and Response

Amazon GuardDuty

GuardDuty is an intelligent threat detection service that continuously analyzes AWS data sources using machine learning, behavioral baselines, and threat intelligence feeds. It requires no agents for most findings and no configuration of log forwarding — it consumes data sources directly through the AWS service plane.

Data sources analyzed:

SourceWhat GuardDuty Sees
VPC Flow LogsNetwork connections, port scans, unusual destination IPs and ports
CloudTrail management eventsAPI calls — unusual IAM activity, privilege escalation, API calls from unexpected IPs
CloudTrail S3 data eventsUnusual S3 access patterns, bulk downloads, access from anonymous principals
DNS query logsQueries to known command-and-control domains, DNS tunneling
EKS audit logsKubernetes control plane activity, container escape attempts, privilege abuse
Lambda network activityFunctions calling suspicious IPs or known-malicious domains
RDS login activityBrute-force attempts, logins from unexpected sources
EBS volume dataMalware signatures and known threat indicators in volume contents
EC2/ECS/EKS runtime monitoringProcess execution, file access, network connections at the OS level (agent required)

GuardDuty generates findings with a severity rating (Low, Medium, High) and a structured finding type. Examples:

GuardDuty detects — it does not block. Findings are published to Security Hub and EventBridge for automated or manual response.

In multi-account organizations, GuardDuty is enabled in a delegated administrator account that aggregates findings from all member accounts. Members cannot disable GuardDuty once enrolled by the administrator.


Amazon Inspector

Inspector is an automated vulnerability assessment service that continuously scans workloads for software vulnerabilities and unintended network exposure.

Scan targets:

TargetScanning MethodWhat Is Assessed
EC2 instancesSSM Agent (agentless option via hybrid scanning also available)OS package CVEs, application library CVEs, network reachability (open ports exposed to internet)
Lambda functionsAgentlessCVEs in open-source dependencies in function packages and layers
ECR container imagesAgentless — scans on push and re-scans when new CVEs are publishedOS package CVEs, application library CVEs

Inspector findings include the CVE identifier, CVSS score, affected package and version, the fixed-in version (what to upgrade to), and a network reachability assessment showing whether the vulnerability is reachable from the internet.

Inspector continuously rescans. When a new CVE is published that affects a package already inventoried in your environment, Inspector generates a new finding without you triggering a scan. Findings route to Security Hub and EventBridge for integration with patching workflows.


Amazon Macie

Macie uses machine learning to discover, classify, and protect sensitive data stored in Amazon S3. It answers the question: “do I have sensitive data in S3, where exactly is it, and is it adequately protected?”

What Macie detects:

Macie generates two types of findings:

Finding TypeMeaning
Sensitive data discovery findingSensitive data was detected in a specific S3 object at a specific location
Policy findingA bucket-level configuration issue: bucket is publicly accessible, replication is disabled, encryption is not enforced

Macie provides a full S3 inventory with security posture metadata — which buckets are public, which are unencrypted, which have replication configured. This is the audit evidence needed for GDPR data mapping, HIPAA covered data inventory, and PCI DSS cardholder data environment scoping.


Centralized Governance

AWS Security Hub

Security Hub is the centralized aggregation and normalization layer for security findings across AWS. Instead of checking GuardDuty, Inspector, Macie, Config, IAM Access Analyzer, and third-party tools separately, Security Hub pulls findings from all sources into a single normalized format: the AWS Security Finding Format (ASFF).

Key capabilities:

Security Hub does not detect threats itself — it is a data aggregator and compliance scoring engine. Its value is providing a single place to see everything and a consistent framework for measuring posture.


Data Protection and Encryption

AWS KMS

AWS Key Management Service manages the cryptographic keys that protect data at rest across virtually every AWS service. S3 server-side encryption, EBS volume encryption, RDS encryption, Secrets Manager, Systems Manager Parameter Store — all are backed by KMS.

Key types:

Key TypeManaged ByRotationCostUse Cases
AWS managed keysAWSAutomatic, annualNo direct chargeDefault encryption when you enable encryption on S3, EBS, RDS without specifying a key. Key IDs like aws/s3, aws/ebs.
Customer managed keys (CMK)YouOptional automatic (annual) or manual~$1/month/keyCustom access control, cross-account encryption, key policy granularity, auditing individual key usage
Imported key materialYouManual re-import required~$1/month/keyRegulatory requirements to use key material generated outside AWS; you retain the ability to delete key material immediately

Envelope encryption is how KMS handles encryption of large data without ever exposing the CMK:

  1. Your application (or an AWS service) calls KMS GenerateDataKey — KMS returns a plaintext data key and an encrypted copy of that same key.
  2. The plaintext data key encrypts the data locally. The plaintext key is immediately discarded from memory.
  3. The encrypted data key is stored alongside the ciphertext — typically as metadata.
  4. To decrypt: send the encrypted data key to KMS Decrypt. KMS uses the CMK to decrypt it and returns the plaintext data key. Use the plaintext key to decrypt the data locally.

The CMK never leaves KMS. It is used only to encrypt and decrypt other keys, never data directly. This architecture means decryption requires both the ciphertext and a valid KMS call — an attacker with access only to the encrypted data cannot decrypt it without KMS access.

Key policies are the primary access control mechanism for CMKs. Unlike IAM policies (which control what a principal can do), key policies are resource-based policies on the key itself. A CMK without a key policy granting access to an IAM principal is inaccessible to that principal even if they have kms:* in their IAM policy. The default key policy grants the account root full access, which allows IAM policies to then further delegate access.

Every KMS API call — Encrypt, Decrypt, GenerateDataKey, ScheduleKeyDeletion — is logged in CloudTrail with the caller identity, the key used, and the timestamp. This is the cryptographic audit trail for compliance purposes.

Multi-region keys replicate a CMK to multiple AWS regions. The key material is synchronized — data encrypted in us-east-1 can be decrypted in eu-west-1 without re-encryption. Required for active-active multi-region applications and DR scenarios where the disaster recovery region must be able to decrypt data independently.


AWS CloudHSM

CloudHSM provides dedicated, single-tenant Hardware Security Module appliances — physical cryptographic devices in AWS data centers that you provision for your exclusive use. Unlike KMS (where AWS manages the underlying hardware and has access to it), CloudHSM gives you full control of the HSM. AWS cannot access your keys.

AspectKMSCloudHSM
TenancyMulti-tenant (keys isolated logically by IAM)Single-tenant — dedicated physical hardware
AWS access to keysAWS manages HSM hardware but cannot access key materialAWS has no access to key material; you manage HSM users and partitions
FIPS 140-2 levelLevel 2Level 3
Management overheadFully managed serviceYou administer HSM cluster, users, and high availability
Integration with KMSStandard KMSCustom Key Store — KMS API calls use your CloudHSM as the key store
Primary use casesGeneral-purpose encryption for most workloadsRegulatory requirements mandating customer-controlled HSMs, SSL/TLS offloading to HSM, Oracle TDE, strict FIPS Level 3 compliance

CloudHSM clusters run inside your VPC. For high availability, deploy a minimum of two HSMs across two Availability Zones — the CloudHSM client library synchronizes key material automatically across all cluster members.

The Custom Key Store integration allows KMS to use your CloudHSM cluster as the backing store for CMKs. Applications call the standard KMS API — the cryptographic operations execute inside your CloudHSM hardware. You get the KMS API and AWS service integrations combined with FIPS Level 3 hardware control.


AWS Secrets Manager

Secrets Manager stores and manages sensitive values — database passwords, API keys, OAuth tokens, TLS certificates — and can rotate them automatically without application code changes.

Rotation is Secrets Manager’s key differentiator. When automatic rotation is enabled:

  1. Secrets Manager calls a Lambda rotation function on the configured schedule.
  2. The Lambda function creates a new credential, updates the target resource (e.g., the RDS user password), and writes the new secret value to Secrets Manager.
  3. Applications always call the Secrets Manager API to retrieve the current value — the rotation is transparent. Credentials in code or configuration files are eliminated.

AWS provides pre-built rotation Lambda functions for RDS (MySQL, PostgreSQL, Oracle, SQL Server, MariaDB), Redshift, and DocumentDB. Custom Lambda rotation functions handle any other credential type.

Application access pattern: the application calls GetSecretValue at runtime. The AWS SDK caches the secret value and refreshes it periodically (or immediately when a rotation-related exception is received from the database). No restart required when a secret rotates.

Cross-account sharing: resource-based policies on secrets grant access to IAM principals in other accounts. A central secrets account can hold all credentials; application accounts in the organization retrieve them at runtime.

SSM Parameter Store vs Secrets Manager

AspectSecrets ManagerSSM Parameter Store
Automatic rotationYes — native rotation via LambdaNo built-in rotation
Cost~$0.40/secret/month + API callsStandard tier: free (up to 10,000 parameters); Advanced: ~$0.05/parameter/month
Maximum value size64 KBStandard: 4 KB; Advanced: 8 KB
Cross-account accessYes — resource-based policiesNo direct cross-account support
EncryptionAlways KMS-encryptedSecureString type uses KMS; String and StringList are plaintext
Path hierarchyFlat naming (no enforced hierarchy)Hierarchical paths: /prod/app/db/password — IAM can grant access to entire path prefixes
Primary fitDatabase credentials, API keys, anything that rotatesConfiguration values, feature flags, non-secret parameters alongside secrets

AWS Certificate Manager

ACM provisions, manages, and automatically renews TLS/SSL certificates for use with AWS services. Public certificates for ALB, CloudFront, API Gateway, and Elastic Beanstalk are free — ACM charges nothing for certificate issuance or renewal.

The private key for ACM-managed certificates is never exportable. The key material exists only within AWS infrastructure. You cannot download it or use the certificate outside of AWS services.

Automatic renewal: ACM begins the renewal process approximately 60 days before expiry. For DNS-validated certificates, renewal is fully automatic — no manual action required, no risk of expiry incidents if you use ACM consistently.

Validation methods:

MethodHow It Works
DNS validationAdd a CNAME record to your domain’s DNS. Route 53 can add it automatically. Recommended — renewal is automatic because the CNAME persists.
Email validationAWS sends validation emails to domain contact addresses. Requires human action. Not recommended for automated environments.

ACM Private CA: Issue private TLS certificates for internal resources — internal microservice mTLS, internal API endpoints, VPN clients, internal load balancers — using your own private Certificate Authority hierarchy within ACM. Private CA certificates are not trusted by browsers but are trusted by systems you configure to trust your CA.


Automated Threat Response Flow

GuardDuty
Security Hub
HIGH severity finding generated
UnauthorizedAccess:IAMUser/TorIPCaller — unusual API call from Tor exit node
Finding forwarded in ASFF format
Security Hub publishes all findings to EventBridge automatically
Rule matches: HIGH severity finding
EventBridge rule filters on detail.severity >= 7 and starts workflow
Step 1: Isolate EC2 instance
Lambda modifies security group — replaces all inbound/outbound rules with deny-all
Step 2: Snapshot EBS volumes
Lambda calls CreateSnapshot on all attached EBS volumes for forensic preservation
Step 3: Notify security team via SNS
Email and SMS with finding details, affected instance ID, and timeline
Step 4: Create incident ticket via Lambda
Lambda calls Jira or ServiceNow API to open incident with finding payload

Security Service Summary

Threat or ConcernPrimary ServiceSupporting Services
L3/L4 DDoS — volumetric attacksShield Standard (automatic)CloudFront, Route 53
L3/L4/L7 DDoS — advanced, persistentShield AdvancedWAF, CloudFront, DRT
Web application exploits — OWASP Top 10WAF (Core Rule Set)CloudFront, ALB, API Gateway
Bot traffic and scrapingWAF Bot ControlCloudFront
Rate limiting — brute force, floodingWAF rate-based rulesALB, API Gateway
Threat detection — cloud environmentGuardDutySecurity Hub, EventBridge
Software vulnerabilities — CVE scanningInspectorSecurity Hub, SSM Patch Manager
Sensitive data in S3MacieSecurity Hub, EventBridge
Centralized findings aggregationSecurity HubAll detection services
Compliance posture scoringSecurity Hub (security standards)Config, IAM Access Analyzer
Automated incident responseEventBridge + Step Functions / LambdaGuardDuty, Security Hub
Encryption key managementKMSAll services with encryption at rest
FIPS 140-2 Level 3, dedicated HSMCloudHSMKMS (Custom Key Store)
Secret storage and automatic rotationSecrets ManagerKMS, Lambda, RDS
Configuration parameters and non-secret valuesSSM Parameter StoreKMS (SecureString)
TLS certificate lifecycleACMALB, CloudFront, API Gateway
Internal / private TLS certificatesACM Private CAInternal services, microservice mTLS

References