Study guide

4.2 Threat Containment & Network Quarantine Techniques

AWS Certified Security – Specialty SCS-C03

Track your progress as you read

Finished sections get a check mark.

1 Chapter 0: Getting Started with the SCS-C03 Exam

0.1 SCS-C03 Exam Format, Domains & Study Strategy

2 Chapter 1: Security Monitoring, Alerting & Threat Detection Services

1.1 Workload Monitoring & Health Check Strategies 1.2 Amazon GuardDuty Architecture & Finding Types 1.3 AWS Security Hub & Automated Conformance Assessment 1.4 Amazon Macie & Automated Data Classification

3 Chapter 2: Enterprise Logging Architecture & Analysis

2.1 Multi-Account CloudTrail & Organization Trails 2.2 Amazon Security Lake & OCSF Log Normalization 2.3 Network Telemetry: VPC Flow Logs & Route 53 Resolver Logs 2.4 Troubleshooting Security Telemetry & Log Ingestion 2.5 Analyzing, Normalizing & Correlating Security Logs

4 Chapter 3: Incident Readiness, Response Planning & Automated Runbooks

3.1 Incident Response Planning & Blast Radius Mitigation 3.2 Testing & Validating Incident Response Plans 3.3 Automated Incident Remediation with EventBridge & Step Functions 3.4 Systems Manager OpsCenter & Incident Manager Runbooks

5 Chapter 4: Digital Forensics, Evidence Preservation & Root Cause Analysis

4.1 Forensic Artifact Capture & Chain of Custody 4.2 Threat Containment & Network Quarantine Techniques 4.3 Correlating Events & Root Cause Analysis with Amazon Detective

6 Chapter 5: Edge Protection, WAF & DDoS Mitigation

5.1 CloudFront Security Headers & Origin Access Control 5.2 AWS WAF Architecture & Advanced Rule Sets 5.3 AWS Shield Advanced & DDoS Defense Architectures 5.4 Edge Integrations: Managed Rule Groups, OCSF Ingestion, IoT Policies & CORS

7 Chapter 6: Compute Workload Hardening, Vulnerability Management & GenAI Security

6.1 Golden AMIs & Container Image Hardening Pipelines 6.2 Amazon Inspector Vulnerability Management & Patch Automation 6.3 Generative AI Security: Amazon Bedrock Guardrails & Model Protection 6.4 Instance Profiles, Service Roles & Execution Roles for Compute 6.5 Secure Administrative Access: Session Manager & EC2 Instance Connect

8 Chapter 7: Network Security, Segmentation, Private Connectivity & Encryption in Transit

7.1 Layered Traffic Filtering: SGs, NACLs & AWS Network Firewall 7.2 Hybrid Connectivity Security: VPN, Direct Connect & MACsec 7.3 Zero-Trust Access & Network Access Analysis 7.4 Enforcing Encryption in Transit: ELB Security Policies, TLS & HTTPS-Only Access 7.5 Private Access: VPC Endpoints, PrivateLink, Client VPN & Verified Access 7.6 Inter-Resource Encryption in Transit: Nitro, EMR, EKS & SageMaker AI

9 Chapter 8: Enterprise Authentication, Federation & Directory Services

8.1 AWS IAM Identity Center & Enterprise IdP Integration 8.2 Amazon Cognito User Pools & Identity Pools 8.3 AWS Security Token Service (STS) & Temporary Credential Workflows 8.4 Troubleshooting Identity & Authentication Failures

10 Chapter 9: Advanced Authorization Architecture & Policy Evaluation

9.1 Complete AWS Policy Evaluation Logic & Decision Flow 9.2 Permission Boundaries & Safe Admin Delegation 9.3 Attribute-Based Access Control (ABAC) with IAM Tags

11 Chapter 10: Least Privilege, Policy Validation & External Access Auditing

10.1 IAM Roles Anywhere & Amazon Verified Permissions 10.2 Auditing External & Unused Access with IAM Access Analyzer 10.3 Analyzing Authorization Failures & Policy Simulation

12 Chapter 11: Cryptographic Services: KMS Architecture & Key Governance

11.1 AWS KMS Architecture, Key Policies & Key Types 11.2 KMS Grants, Encryption Context & Multi-Region Keys 11.3 Imported Key Material (BYOK) & CloudHSM Key Stores

13 Chapter 12: Secrets Management, Sensitive Data Masking & PKI

12.1 AWS Secrets Manager & Systems Manager Parameter Store 12.2 Sensitive Data Masking in Telemetry & Messaging 12.3 AWS Certificate Manager (ACM) & Private CA Architecture

14 Chapter 13: Storage Encryption, Integrity, Lifecycle & Backup Protection

13.1 S3 Encryption Modes & S3 Bucket Keys 13.2 Data Integrity Protection: Object Lock, Vault Lock & Code Signing 13.3 Secure Data Lifecycle, Cross-Account Replication & Backup Vault Lock 13.4 Lifecycle, Backup & Secure Replication Beyond S3: EFS, FSx, DLM, DataSync & Air-Gapped Vaults

15 Chapter 14: Multi-Account Architecture, Organizations & Control Tower Governance

14.1 AWS Organizations Structure, Hierarchy & Resource Control 14.2 AWS Control Tower Landing Zone & Guardrail Framework 14.3 Delegated Administrator Architecture & Root User Governance 14.4 Centralized Resource Sharing with RAM & Service Catalog

16 Chapter 15: Compliance Automation, Infrastructure as Code Security & Auditing

15.1 Infrastructure as Code Security & Multi-Account Deployment 15.2 AWS Config, Conformance Packs & Automated Remediation 15.3 Audit Evidence Collection & Well-Architected Security Reviews

4.2 Threat Containment & Network Quarantine Techniques

Key Takeaways Explain This Topic AI

Security group changes do not cut tracked connections, so quarantine an ENI by replacing all its groups with an allow-all group (making flows untracked) and then with a zero-rule isolation group; add a NACL deny for an instant, tracking-independent cutoff.

Stateless Network Access Control Lists (NACLs) provide immediate subnet-level isolation by placing a top-priority rule (Rule #1) explicitly denying all inbound and outbound traffic.

Revoking an IAM user or role's active STS temporary sessions requires applying an inline policy with an explicit Deny paired with the aws:TokenIssueTime condition, as deleting access keys only invalidates long-term credentials.

In Amazon EKS, compromised worker nodes must be cordoned rather than drained immediately, as draining evicts and destroys running container filesystems and volatile forensic memory.

AWS Backup Vault Lock in Compliance mode prevents unauthorized deletion, early expiration, or modification of recovery points, providing an immutable foundation for clean workload restoration.

Last updated: September 2026

4.2 Threat Containment & Network Quarantine Techniques

When a security incident is detected in an AWS environment, incident responders face an immediate operational dilemma: how to halt active malicious activity—such as data exfiltration, lateral movement, or ransomware encryption—without destroying volatile evidence or alerting the adversary to ongoing remediation. Containment is the bridge between detection and eradication. If executed clumsily, containment attempts can inadvertently alert an adversary (prompting them to execute destructive wiper malware) or destroy transient forensic data stored in RAM and network socket tables.

AWS provides granular control across network boundaries, identity planes, container runtimes, and immutable backup systems. Mastering these containment mechanisms is essential for any cloud security specialist.

Network Containment: Security Group Quarantine vs. Additive Traps

In Amazon EC2, virtual firewalls operate primarily at two layers: Security Groups (which act at the Elastic Network Interface / hypervisor layer) and Network Access Control Lists (NACLs) (which act at the subnet boundary).

Loading diagram...

Stateful Connection Tracking and Rule Swapping Mechanics

Security Groups are stateful . They utilize hypervisor connection tracking (conntrack) tables to automatically permit return traffic regardless of inbound or outbound rules. Understanding how security group rule changes interact with established connections is a frequent specialty exam focal point:

Tracked connections survive rule changes : If you delete or narrow an allow rule, or swap the security groups on an ENI, established tracked connections are not interrupted; they continue until they time out. An attacker's existing reverse shell or C2 session can therefore survive a naive quarantine.

Untracked flows are cut immediately : A flow is untracked when all traffic (0.0.0.0/0 or ::/0) is allowed in both directions and it is not an automatically tracked connection. Removing the rule that allows an untracked flow stops it at once. AWS isolation guidance uses this: first attach a security group that allows all inbound and outbound traffic (making existing flows untracked), then replace it with the isolation security group that has zero inbound and zero outbound rules .

Instant, tracking-independent cutoff : Add a deny to the subnet NACL, which is stateless and evaluates every packet.

Warning

The Additive Security Group Trap : Security Groups can only define Allow rules; they cannot define Deny rules. Multiple security groups attached to a single network interface are evaluated with logical OR (additive permissive evaluation). If an instance has Web-SG (allowing TCP ports 80/443 inbound and all outbound) and a responder attaches Quarantine-SG (with zero rules) without detaching Web-SG , the instance remains 100% accessible! To achieve network quarantine, responders must replace all existing security groups with the Quarantine Security Group.

Designing the Quarantine Security Group

A robust quarantine security group architecture accommodates operational realities:

Total Isolation Quarantine SG : Contains zero ingress and zero egress rules. Used when no remote interaction with the guest OS is required, or when volatile artifacts will be acquired via out-of-band methods (e.g., EBS snapshots and hypervisor-level metadata).

Forensic Acquisition Quarantine SG : In scenarios where responders must acquire RAM using AWS Systems Manager Run Command, the quarantine SG must allow outbound HTTPS traffic (TCP port 443) strictly to the private IP CIDR ranges of the VPC Interface Endpoints for Systems Manager ( ssm , ssmmessages , and ec2messages ) and the S3 Gateway Endpoint. Zero inbound rules and zero internet egress rules are permitted.

Bastion Access Quarantine SG : Contains zero outbound rules, but contains a single inbound rule allowing SSH (port 22) or RDP (port 3389) exclusively from a hardened, isolated forensic analysis bastion host located in a private management subnet.

Stateless NACL Drop Rules & Subnet-Level Blast Radius

While Security Groups operate at the individual network interface level, Network Access Control Lists (NACLs) operate at the subnet boundary. NACLs are stateless , meaning inbound and outbound traffic must be explicitly permitted in both directions.

Ascending Numerical Evaluation Rule

NACLs process rules in ascending numerical order (e.g., 1 to 32766), stopping at the first rule that matches the packet headers (source IP, destination IP, protocol, port). At the end of every NACL sits an unmodifiable default rule ( * ) that denies all unmatched traffic. NACL Inbound Rules Evaluation:

  • Rule 1: DENY TCP 0.0.0.0/0:ANY -> Matches packet? YES -> DROP IMMEDIATELY (Evaluation terminates)
  • Rule 100: ALLOW TCP 0.0.0.0/0:443 -> Never reached
  • Rule *: DENY ALL 0.0.0.0/0:ALL -> Default catch-all
  • Strategic Use Cases for NACLs During Containment

Subnet-Level Quarantine : If an entire subnet is suspected of widespread worm propagation or automated lateral movement, editing each instance's security groups individually takes too long. Inserting Rule 1: DENY ALL 0.0.0.0/0 on both inbound and outbound NACL rules instantly severs all network traffic entering or leaving the entire subnet within milliseconds.

Blocking Command-and-Control (C2) IP Ranges : When threat intelligence or GuardDuty identifies a specific external adversary IP or CIDR block (e.g., 203.0.113.50/32 ), responders can insert a top-priority rule: Rule 10: DENY ALL 203.0.113.50/32 . This blocks communication to and from the adversary across the entire subnet without interrupting legitimate application traffic.

Preserving Volatile Sockets vs. Dropping Packets : Because NACL drops occur at the subnet router boundary, the guest OS TCP stack remains alive. The OS does not send TCP RST packets unless the application times out, preserving connection state tables inside guest memory for forensic inspection.

Preserving Volatile Network States Before Containment

Before executing network isolation that clears connection tracking tables, responders should preserve active network connection telemetry if operational runbooks allow. Once network isolation is applied, active sockets transition to CLOSE_WAIT or TIME_WAIT and eventually disappear from kernel tables.

Volatile Network Artifacts Checklist

Active Listening Ports and Sockets : ss -tulpn or netstat -tulpn (identifying rogue daemons and reverse shells).

Active Established TCP Sessions : ss -tapn (identifying external remote IP addresses, ephemeral ports, and associated Process IDs [PIDs]).

Kernel Connection Tracking Table : conntrack -L (inspecting active NAT and tracked connection states).

Routing and ARP Cache Tables : ip route show and ip neigh show (identifying local network reconnaissance and spoofed gateways).

VPC Traffic Mirroring for Out-of-Band Capture

If an instance is actively communicating with an unknown external entity and responders need to inspect raw packet payloads without altering the host:

Configure VPC Traffic Mirroring on the compromised instance's ENI.

Define a Traffic Mirror Filter capturing all inbound and outbound protocols.

Define a Traffic Mirror Target pointing to an Elastic Network Interface or Network Load Balancer attached to an out-of-band monitoring instance running Zeek, Suricata, or Wireshark.

VPC Traffic Mirroring copies raw Layer 2 through Layer 7 packets directly at the Nitro hypervisor level, invisible to any rootkit or malware running inside the guest operating system.

Invalidating Active IAM Credentials & STS Temporary Sessions

When credentials are leaked or an identity is compromised, revoking access requires understanding the fundamental difference between long-term IAM user credentials and temporary AWS Security Token Service (STS) credentials .

Loading diagram...

The Long-Term vs. Short-Term Credential Trap

If an IAM user's secret access key is exposed in a public Git repository, an incident responder might immediately deactivate or delete the access key using iam:UpdateAccessKey --status Inactive .

Caution

The STS Session Persistence Trap : Deactivating or deleting an IAM access key only blocks future requests that authenticate directly with that long-term key. If the adversary already used that access key to call sts:GetSessionToken or sts:AssumeRole , the resulting temporary credentials ( ASIA... ) remain fully active and functional until their configured session duration expires (up to 36 hours for GetSessionToken or GetFederationToken sessions, or up to 12 hours for assumed roles)! Deleting the IAM user or access key does NOT revoke previously minted STS temporary tokens.

The aws:TokenIssueTime Revocation Mechanism

To immediately invalidate active temporary credentials issued by AWS STS, security teams must attach an inline policy to the compromised IAM role or user containing an explicit Deny paired with the aws:TokenIssueTime condition key.

Temporary credentials issued by STS include a cryptographic timestamp indicating when the token was generated ( TokenIssueTime ). An IAM policy condition checking DateLessThan against aws:TokenIssueTime forces the IAM evaluation engine to reject any request signed by a token minted prior to the specified cutoff time: {

  • "Version": "2012-10-17",
  • "Statement": [
  • {
  • "Sid": "RevokeAllTemporarySessionsBeforeRevocationTime",
  • "Effect": "Deny",
  • "Action": "*",
  • "Resource": "*",
  • "Condition": {
  • "DateLessThan": {
  • "aws:TokenIssueTime": "2026-09-29T15:30:00Z"
  • }
  • }
  • }
  • ]
  • }
  • Why This Works

Under the AWS Policy Evaluation Logic:

Explicit Deny overrides all Allow permissions.

Any API call presented with a temporary token issued before 2026-09-29T15:30:00Z evaluates the condition as True , triggering the explicit Deny and returning an AccessDenied error.

Legitimate services or users can subsequently re-authenticate or re-assume the role; tokens issued after the revocation timestamp will evaluate the condition as False , bypassing the Deny and restoring normal access.

Exam Tip : In the IAM Management Console, clicking the "Revoke active sessions" button on an IAM role automatically attaches an inline policy named AWSRevokeOlderSessions that implements this exact aws:TokenIssueTime pattern, using a timestamp about 30 seconds in the future to allow for propagation. For an IAM user, attach an equivalent deny policy yourself.

Container Incident Isolation in Amazon EKS

When a container running inside Amazon Elastic Kubernetes Service (Amazon EKS) is compromised (e.g., via a remote code execution vulnerability or a compromised container registry image), containment requires isolating the workload at both the Kubernetes control plane and the AWS network layers.

Loading diagram...

Node Cordoning vs. Pod Eviction / Draining

When a container escape or malicious pod is identified on an EKS worker node, administrators must avoid reflexive eviction:

Command Operational Action Forensic Consequence

kubectl cordon <node> Marks the worker node as Unschedulable . Existing running pods remain untouched; no new pods can be placed on the node. Recommended for forensics. Preserves running container namespaces, volatile memory, and local ephemeral filesystems for analysis.

kubectl drain <node> Evicts all running pods from the node, terminating container processes and rescheduling them on other worker nodes. Forensic Anti-Pattern. Evicting a pod issues a SIGTERM / SIGKILL to container processes, immediately deleting container memory and wiping ephemeral writeable container layers ( overlay2 ).

kubectl delete pod <pod> Deletes the pod object immediately. Wipes container runtime state; if managed by a Deployment, a new identical (potentially vulnerable) pod immediately launches.

Isolating Pods with Kubernetes NetworkPolicies

If the EKS cluster uses a CNI plugin supporting Kubernetes NetworkPolicies (such as Calico, Cilium, or the Amazon VPC CNI with Network Policy support enabled), responders apply an explicit default-deny NetworkPolicy matching the labels of the compromised pod: apiVersion: networking.k8s.io/v1

kind: NetworkPolicy

metadata:

  • name: quarantine-compromised-workload
  • namespace: payment-processing

spec:

podSelector:

matchLabels:

app: invoice-generator

policyTypes:

  • Ingress
  • Egress

By specifying policyTypes: ["Ingress", "Egress"] without providing any ingress or egress rule blocks, the NetworkPolicy drops 100% of network traffic into and out of matching pods while leaving the container processes running in memory for live forensic triage.

Security Groups for Pods (Amazon VPC CNI)

In enterprise EKS environments utilizing Security Groups for Pods , individual Kubernetes pods receive dedicated Elastic Network Interfaces (branch ENIs). In this architecture, responders can modify the pod's underlying security group directly via the AWS EC2 API, attaching an isolated Quarantine Security Group without modifying Kubernetes cluster manifests.

Eradication & Clean Restoration via AWS Backup

Once an incident is contained and forensic artifacts are secured, the Eradication and Recovery phase begins. In modern cloud architecture, trying to manually locate and remove rootkits, backdoors, or malicious cron jobs from a compromised operating system is considered an anti-pattern.

The "Cattle, Not Pets" Eradication Principle

Terminate Compromised Compute : Never sanitize an EC2 instance in production. Once evidence is captured, terminate the instance ( ec2:TerminateInstances ).

Redeploy from Golden AMIs : Launch clean, verified instances from immutable Golden AMIs or container base images created via hardened CI/CD pipelines (e.g., EC2 Image Builder).

Rotate All Underlying Secrets : Before launching replacement workloads, rotate all database credentials, API tokens, and private keys stored in AWS Secrets Manager and AWS KMS .

Restoring Data from Immutable Backups: AWS Backup Vault Lock

For persistent data stores, relational databases (Amazon RDS), and file systems (Amazon EFS), recovery must draw from verified, uncorrupted backup points.

However, sophisticated adversaries (such as ransomware operators) frequently target backup repositories before executing their primary payload, attempting to delete recovery points to prevent organizational recovery.

Loading diagram...

AWS Backup Vault Lock protects recovery points against unauthorized deletion and retention changes:

Governance Mode : Allows privileged IAM principals with dedicated permissions to delete recovery points or shorten retention windows. Suitable for testing.

Compliance Mode : Enforces strict, irreversible WORM storage. Once the configurable grace period (a cooling-off window of at least 3 days, or 72 hours) expires, no entity—including the AWS account root user or AWS Support—can delete backups or reduce retention periods until the recovery points naturally expire.

Cross-account copies and logically air-gapped vaults : Copy recovery points to a dedicated Backup account. AWS Backup's logically air-gapped vault goes further: it is always locked in compliance mode, stores backups in an AWS Backup service-owned account, is encrypted with an AWS owned key by default (or a customer managed key), and can be shared through AWS RAM or recovered through multi-party approval, so you can restore even if the owning account is compromised.

Loading diagram... Layered Threat Containment Architecture across Network, Identity, and Container Planes