SpecialtySCS-C02Free

AWS Security Specialty (SCS-C02) Study Guide: Exam Notes

A free AWS Certified Security – Specialty study guide built from real exam-prep notes: GuardDuty, KMS, IAM conditions, VPC endpoints and incident response.

·· 13 min read
Written by an engineer who passed this exam: verify on Credly ↗

Exam domains (SCS-C02)

Threat Detection and Incident Response14%
Security Logging and Monitoring18%
Infrastructure Security20%
Identity and Access Management16%
Data Protection18%
Management and Security Governance14%

Weightings from the official AWS exam guide. Always check it for the current version.

These are the notes I used to pass the AWS Certified Security – Specialty exam, reorganised by exam domain and updated where AWS has changed things since. They focus on the details questions actually turn on, not on re-explaining every service.

How to use this guide: read a section, then reproduce it in a sandbox account. Most Security Specialty questions are easy if you’ve seen the behaviour once and hard if you’ve only read about it.

Threat detection and incident response

GuardDuty and Security Hub

  • GuardDuty supports a trusted IP list and a threat IP list (public IPs only). In a multi-account setup, only the administrator account can manage them.
  • GuardDuty only analyses DNS logs if your instances use the default Route 53 Resolver in the VPC. Custom DNS servers mean no DNS-based findings.
  • Suppressed findings are not sent to Security Hub, Detective or EventBridge.
  • GuardDuty sends findings to Security Hub, which normalises everything into the AWS Security Finding Format (ASFF) and supports cross-region aggregation.
  • Security Hub insights are saved groupings of related findings. Custom actions send selected findings to EventBridge, which is how you trigger automated remediation.

Containing a compromised EC2 instance

The order matters, and exam questions test it:

  1. Capture instance metadata (tags, IAM role, network configuration).
  2. Enable termination protection so evidence isn’t lost.
  3. Isolate the instance: replace its security group with one that allows no outbound traffic. Removing rules alone doesn’t drop tracked connections. To cut existing sessions, add a deny rule in the network ACL.
  4. Detach it from the Auto Scaling group (so it isn’t replaced and terminated) and deregister it from the load balancer.
  5. Snapshot the EBS volumes and tag them for the investigation.

You can investigate offline (stop the instance and analyse the snapshots) or online (capture memory with SSM Run Command and capture traffic with VPC Traffic Mirroring). The whole isolation flow can be automated with EventBridge and Lambda.

Compromised credentials

  • To invalidate temporary credentials already issued to a role, attach a policy that denies all actions when aws:TokenIssueTime is before the time of the incident (DateLessThan). The IAM console’s Revoke active sessions button does exactly this.
  • Review RDS audit logs to understand what data may have been accessed.
  • If an instance was launched from a pre-built AMI, the old public key can still be in authorized_keys alongside the new one you selected. Check it.

Recovering access to EC2

  • Linux: recover a lost key pair with Systems Manager, EC2 Instance Connect, the EC2 serial console, user data, or by swapping the root volume onto a helper instance.
  • Windows: use Systems Manager (AWSSupport-ResetAccess), EC2Rescue, or detach the root volume and use EC2Launch v2 to reset the password on next boot.
  • The EC2 serial console works on Nitro-based instances, allows one session at a time, and is useful for boot and network misconfigurations.

IAM Access Analyzer

  • Define a zone of trust (an account or your organisation). Any resource shared outside it becomes a finding.
  • Policy validation checks policies for errors and security warnings.
  • Policy generation uses up to 90 days of CloudTrail activity to build a least-privilege policy for a role.

DDoS testing

Only approved AWS DDoS test partners may simulate DDoS attacks, and only against resources protected by Shield Advanced (or edge-optimised API Gateway endpoints subscribed to it).

Security logging and monitoring

What VPC Flow Logs do not capture

This list comes up repeatedly:

Not logged Why it matters
Traffic to the Amazon DNS server (Route 53 Resolver) Use Resolver query logging instead
Windows license activation traffic
Instance metadata (169.254.169.254) IMDS abuse won’t show in flow logs
Amazon Time Sync Service (169.254.169.123)
DHCP traffic
Mirrored traffic
Traffic to the VPC router’s reserved IP
Traffic between a VPC endpoint ENI and a Network Load Balancer ENI
  • VPC Traffic Mirroring captures full packets from source ENIs to a target (ENI, NLB or Gateway Load Balancer endpoint) for deep inspection.
  • Network Access Analyzer uses network access scopes (JSON documents) to find unintended network paths, such as internet access to a database subnet.

DNS logging: two different features

Feature What it logs Destinations
Route 53 public DNS query logging Queries to your public hosted zones CloudWatch Logs only (log group in us-east-1)
Route 53 Resolver query logging All DNS queries from resources in a VPC, plus on-premises queries via Resolver endpoints CloudWatch Logs, S3 or Data Firehose

CloudTrail, CloudWatch and service-specific logs

  • Create an Athena table directly from the CloudTrail console to query trail logs with SQL.
  • CloudWatch Contributor Insights finds top talkers: noisy hosts, heaviest network users, URLs generating the most errors.
  • Amazon SES only sends management events to CloudTrail. SendEmail, SendRawEmail, SendTemplatedEmail and SendBulkTemplatedEmail are not in CloudTrail.
  • Redshift has three log types: the connection log (authentication and connections), the user log (changes to database users) and the user activity log (every query before it runs).
  • OpenSearch Service access can be restricted with resource-based (domain access), identity-based and IP-based policies, plus fine-grained access control inside the domain. For a VPC domain, a request is checked in order: network (VPC routing, security groups), then IAM and the domain access policy, then fine-grained access control. A network failure shows up as a timeout. A failed policy check shows up as access denied, which tells you where to look.

Infrastructure security

VPC endpoints

Gateway endpoint Interface endpoint (PrivateLink)
Services S3 and DynamoDB only Most AWS services, including S3 and DynamoDB
How it works Route table entries ENIs in your subnets
Security groups No Yes
Reachable from on-premises (VPN / Direct Connect) No Yes
Cost Free Hourly + per GB
  • Endpoint policies work on both types and control which principals and resources can be reached through the endpoint. They don’t replace the resource’s own policy (for example the S3 bucket policy). Both must allow the request.
  • Use aws:SourceVpce / aws:SourceVpc in bucket policies to force access through your endpoint. aws:VpcSourceIp matches the private IP of requests that come through a VPC endpoint.
  • CodeDeploy on EC2 in a private subnet needs two interface endpoints (codedeploy and codedeploy-commands-secure). Lambda and ECS deployments need only the first.
  • AWS PrivateLink exposes your own service to thousands of VPCs: a Network Load Balancer in the provider VPC, an interface endpoint in each consumer VPC.

Private access patterns

  • Session Manager in a private subnet (no internet): create interface endpoints for ssm and ssmmessages. Older SSM Agent versions also need ec2messages. Add kms if sessions are encrypted with KMS, logs and an S3 gateway endpoint if session logs go to CloudWatch or S3. Everything runs over HTTPS (443), so no inbound ports are opened on the instance.
  • Private REST APIs in API Gateway are only reachable through an execute-api interface endpoint. Control which VPCs or endpoints can call them with the API’s resource policy (aws:SourceVpc / aws:SourceVpce), on top of the endpoint policy.

Route 53 DNSSEC

  • You own the key-signing key (KSK), backed by an asymmetric customer managed KMS key (ECC_NIST_P256) in us-east-1. Route 53 manages the zone-signing key (ZSK).
  • Safe rollout: lower record TTLs and the SOA minimum first, enable signing, then add the DS record in the parent zone (at your registrar or parent hosted zone).
  • Alarm on the CloudWatch metrics DNSSECInternalFailure and DNSSECKeySigningKeysNeedingAction. Either one means DNSSEC validation can start failing for your domain.

Shield Advanced metrics

Shield Advanced publishes DDoSDetected plus attack volume metrics (DDoSAttackBitsPerSecond, DDoSAttackPacketsPerSecond, DDoSAttackRequestsPerSecond). Alarm on DDoSDetected to trigger your DDoS runbook.

Connectivity and network controls

  • Client VPN authentication options: Active Directory (AWS Managed AD or AD Connector, supports MFA), mutual certificate authentication (server certificate in ACM), and SAML / IAM Identity Center.
  • A Site-to-Site VPN tunnel tops out around 1.25 Gbps. To go faster, terminate multiple VPNs on a Transit Gateway with ECMP. Transit Gateway is also the answer for IP multicast.
  • Security groups can reference customer-managed prefix lists.
  • CloudFront to S3: use Origin Access Control (OAC). The legacy Origin Access Identity (OAI) does not support SSE-KMS encrypted objects.
  • Network Load Balancer client IP preservation is on by default for instance targets and for UDP / TCP_UDP. For IP targets with TCP or TLS it is off by default.
  • Use an ELBSecurityPolicy-FS-* TLS policy when you need forward secrecy.
  • API Gateway throttling limits apply per account and region, so one overloaded API can throttle the others.
  • AWS Artifact Reports gives you third-party audit reports (SOC, ISO, PCI). Artifact Agreements is where you accept agreements such as the HIPAA BAA.
  • CloudShell runs outside your VPC by default, but you can now create CloudShell VPC environments to reach private resources.

Identity and access management

Policy elements and condition keys worth memorising

  • NotAction with Allow grants everything except the listed actions. With Deny, it denies everything except them. It’s a classic trap.
  • aws:CalledVia matches requests that a service made on your behalf (Athena, CloudFormation, DynamoDB, KMS).
  • aws:TokenIssueTime revokes old sessions (see incident response above).
  • ec2:RoleDelivery checks which IMDS version delivered an instance’s role credentials. Use it to require IMDSv2-issued credentials in policies.
  • aws:userid restricts access to a specific role session, user or account.
  • sts:ExternalId in a trust policy protects against the confused deputy problem when third parties assume roles in your account.

IMDS hardening

  • Disable IMDS entirely with HttpEndpoint=disabled, or require IMDSv2 with HttpTokens=required.
  • The CloudWatch metric MetadataNoToken shows how many calls still use IMDSv1.
  • Register AMIs with --imds-support v2.0 so every instance launched from them requires IMDSv2.
  • How IMDSv2 works: the instance first gets a session token with PUT /latest/api/token (header X-aws-ec2-metadata-token-ttl-seconds, up to 6 hours), then sends it in the X-aws-ec2-metadata-token header on every metadata request. An SSRF bug that can only make GET requests can’t obtain the token.
  • Enforce IMDSv2 organisation-wide with an SCP: deny ec2:RunInstances unless ec2:MetadataHttpTokens equals required, and deny ec2:ModifyInstanceMetadataOptions to everyone except an admin role so nobody can switch it back.

Attribute-based access control (ABAC)

Grant access by matching tags instead of listing resources: compare the principal’s tag with the resource’s tag, for example aws:PrincipalTag/project equals aws:ResourceTag/project (or ec2:ResourceTag/...). New resources are covered automatically as long as they’re tagged, and aws:RequestTag / aws:TagKeys stop people from tagging their way into access.

STS

  • Session tokens come in v1 (global endpoint, valid only in regions enabled by default) and v2 (valid in all regions). If you see AWS was not able to validate the provided access credentials in an opt-in region, use a regional STS endpoint or configure the global endpoint to issue v2 tokens.

Cross-account S3

  • Prefer assuming a role in the bucket’s account over granting cross-account access to objects.
  • With S3 Object Ownership set to bucket owner enforced, ACLs are disabled and the bucket owner owns every object, which removes the old cross-account ACL headaches (x-amz-acl: bucket-owner-full-control).
  • If a bucket policy locks everyone out, the account’s root user can still delete the policy.

SAML 2.0 federation

  • Flow: the user authenticates with the identity provider, the IdP returns a SAML assertion, the client calls sts:AssumeRoleWithSAML, and STS returns temporary credentials (or a console sign-in URL).
  • Classic exam scenario: federation suddenly fails with InvalidIdentityToken or a “response signature invalid” error. The IdP’s metadata (usually its signing certificate) changed. Fix it by uploading the new metadata with aws iam update-saml-provider.

Identity federation and directories

  • In Cognito user pool groups, a user in several groups gets the IAM role of the group with the lowest precedence value. Groups can’t be nested.
  • A custom identity broker authenticates users itself, then calls STS to obtain credentials for the mapped role.
  • AWS Managed Microsoft AD runs across at least two AZs, supports one-way or two-way forest trusts with on-premises AD (a trust needs VPN or Direct Connect connectivity and is not replication), and can be shared across accounts for seamless domain join.
  • AD Connector is only a proxy to your on-premises AD: no caching, no trusts, no RDS for SQL Server, and it fails if the VPN or Direct Connect link goes down. It does support MFA through your RADIUS server.
  • Simple AD (Samba 4) doesn’t support MFA, trusts, RDS for SQL Server or IAM Identity Center, and is now closed to new customers.

Data protection

KMS: the domain that decides the exam

How KMS decides whether a request is allowed

  1. An explicit deny anywhere (SCP, resource control policy, VPC endpoint policy, key policy, IAM policy) ends the evaluation.
  2. SCPs (and RCPs) must allow the action for principals in member accounts.
  3. If the call comes through a VPC endpoint, its endpoint policy must allow it.
  4. The key policy must allow it, either directly or by delegating to IAM (the "AWS": "arn:aws:iam::<account>:root" statement). A grant can also allow it.
  5. If the key policy delegates to IAM, the caller’s IAM policy must allow it.
  6. Cross-account: the key policy in the key’s account and the IAM policy in the caller’s account must both allow the action.

Key deletion

  • Keys generated in KMS have no expiry. Deletion requires a 7–30 day waiting period, can be cancelled, and the key is unusable while pending.
  • Imported key material can have an expiry date. When it expires, KMS deletes the material but keeps the key metadata so you can re-import the same material.
  • AWS-managed and AWS-owned keys can’t be deleted.
  • To delete a multi-Region key, delete its replicas first.
  • Detect accidental deletions with EventBridge on DisableKey / ScheduleKeyDeletion and run the SSM automation AWSConfigRemediation-CancelKeyDeletion.

Grants and condition keys

  • Grants delegate key use without editing the key policy. They don’t expire on their own: retire or revoke them.
  • kms:GrantIsForAWSResource allows a principal to create grants only for AWS services (for example EBS or RDS) acting on their behalf.
  • kms:ViaService limits key use to requests coming through a specific service. kms:CallerAccount matches the calling account.
  • kms:KeyOrigin (for example EXTERNAL_KEY_STORE) restricts actions to keys from a given origin.
  • HMAC keys don’t support automatic rotation and can’t live in a custom key store.
  • Asymmetric keys (RSA, ECC) support Sign / Verify for digital signatures. The public key can be downloaded so others can verify without calling KMS.
  • Custom key stores: a CloudHSM key store keeps key material in your own CloudHSM cluster (still used through KMS APIs). An external key store (XKS) keeps it in an HSM outside AWS.
  • Imported key material follows a fixed flow: create a key with origin EXTERNAL, download the wrapping public key and import token, wrap your key material, then import it.

Envelope encryption and S3

  • KMS encrypts up to 4 KB directly. Anything larger uses envelope encryption: data is encrypted with a data key, and the data key is encrypted under the KMS key.
  • A multipart upload with SSE-KMS needs both kms:GenerateDataKey (to encrypt each part) and kms:Decrypt (S3 decrypts the data key to assemble the object).
  • An object encrypted with SSE-S3 that’s made public can be read anonymously. One encrypted with SSE-KMS can’t, because the caller also needs KMS permissions.

CloudHSM

  • Dedicated, tamper-resistant HSMs, used through the CloudHSM client software and SDKs, not the AWS APIs. Deploy clusters across multiple AZs.
  • To share a cluster with other accounts, share its subnets with AWS RAM. You can’t share the cluster itself.
  • Redshift can use CloudHSM for database encryption. Other CloudHSM use cases: Oracle TDE, SSL/TLS offload on web servers, and a Windows Server certificate authority’s private key.

S3 Glacier Vault Lock

Initiating a Vault Lock returns a lock ID and puts the policy in an in-progress state for 24 hours. Test it, then complete the lock with that ID before it expires, or it’s discarded. Once completed, the policy can never be changed or removed, even by root.

Encrypting databases

  • Aurora / RDS: you can’t encrypt an existing unencrypted cluster in place. Copy the snapshot with encryption enabled (or restore into an encrypted cluster), then cut over.
  • Redshift: you can enable KMS encryption on an existing cluster. Redshift migrates the data to a new encrypted cluster automatically.
  • DynamoDB: encryption at rest is always on and can’t be disabled. You can switch between AWS-owned, AWS-managed and customer-managed keys at any time.
  • Redshift IAM authentication: redshift:GetClusterCredentials issues temporary database credentials, and AutoCreate creates the database user on first login.

Secrets in infrastructure as code

Reference secrets from Secrets Manager or Parameter Store in CloudFormation with dynamic references, for example {{resolve:secretsmanager:MySecret:SecretString:password}}, so they never appear in templates.

Final exam tips

  • When two answers both “work”, pick the one that is least privilege, automated, and uses a managed service.
  • Watch for region scope: KMS keys, GuardDuty detectors and Security Hub are regional unless you aggregate.
  • “Revoke immediately” usually means a deny policy, not deleting the user.
  • If an answer requires disabling encryption or opening a security group “temporarily”, it’s almost always wrong.

Frequently asked questions

How hard is the AWS Security Specialty exam?

It is one of the harder AWS exams because questions hinge on precise service behaviour, such as which KMS permissions a multipart upload needs or which traffic VPC Flow Logs do not capture. Hands-on experience with IAM, KMS and VPC networking matters more than memorising service lists.

What should I study first for AWS Security Specialty?

Start with KMS (key types, key policies, grants, deletion and rotation), then IAM policy evaluation and condition keys, then VPC security (endpoints, NACLs vs security groups). Those three areas appear across almost every domain.

Do I need the Solutions Architect Associate before Security Specialty?

It is not required, but the Security Specialty assumes you already understand core AWS architecture. If you have not worked with VPCs, IAM and S3 in depth, the Solutions Architect – Associate is a good first step.

How long should I prepare for the Security Specialty?

With solid day-to-day AWS experience, most engineers need 6 to 10 weeks of focused study and labs. Without hands-on security work, plan for longer and spend most of the time in a sandbox account.

More study guides

Hussein Ayoub

Written by

Hussein Ayoub, Founder, Cloud Security & DevOps

Cloud security and DevOps engineer focused on AWS and Azure. AWS Certified Security – Specialty, DevOps Engineer – Professional and Solutions Architect – Professional, and an ISO/IEC 27001 Lead Auditor. Leads Pavora's security assessments, penetration tests, DevOps engagements and AWS training.

Want a structured path to this certification?

Our AWS training combines these notes with hands-on labs in real AWS accounts and direct feedback from a certified instructor. Book a free call to find the right track.