AWS Security Specialty (SCS-C02/SCS-C03 — Pass 750/1000)
Deep-dive security flashcards for AWS SCS-C02/SCS-C03 covering end-to-end IAM policy evaluation logic, Permissions Boundaries, Confused Deputy protection, Data Perimeters, KMS Key Policies/Grants/Envelope Encryption, CloudHSM, Network Firewall, WAF/Shield Advanced, IMDSv2, GuardDuty, Security Hub, Macie, and forensic incident response.
- Category
- Enterprise Networking, Linux & Advanced AWS Certifications — Cisco CCNA (200-301 v1.1) & CCNP ENCOR (350-401), Red Hat RHCSA (EX200) & LFCS/LPIC-1, and AWS Solutions Architect Pro (SAP-C02) & Security Specialty (SCS-C02/C03)
- Level
- advanced
- Languages
- en → en
- Cards
- 32
- Markdown
- AWS Security Specialty (SCS-C02/SCS-C03 — Pass 750/1000) (.md)
Flashcards (32)
| # | Front (Term / Question) | Back (Definition / Answer) | Example | Multiple-Choice Options |
|---|---|---|---|---|
| 1 | If an IAM user's long-term access key is compromised AND the attacker has already assumed an IAM role via STS, how do you revoke both immediately? | Deactivate the user's access key AND attach an `AWSRevokeOlderSessions` explicit Deny policy checking `aws:TokenIssueTime` to the role. | Simply disabling an IAM user's access key or removing a role trust policy does NOT invalidate temporary STS session tokens that have already been issued! | |
| 2 | How do you prevent AWS Lambda function environment variables containing sensitive API keys from being viewed in plaintext by developers with console read access? | Encrypt them client-side with a KMS CMK using Encryption Helpers and restrict `kms:Decrypt` exclusively to the Lambda execution role. | The default Lambda KMS key encrypts environment variables at rest, but automatically decrypts them in the Lambda console for anyone with `lambda:GetFunctionConfiguration` unless you encrypt in transit/client-side. | |
| 3 | Which telemetry sources does Amazon GuardDuty analyze out-of-the-box without requiring you to manually enable VPC Flow Logs or CloudTrail? | GuardDuty directly ingests VPC Flow Logs, Route 53 DNS query logs, and CloudTrail management events from internal AWS streams. | Optional GuardDuty protection plans extend detection to S3 Data Events, EKS Audit Logs, RDS Login Activity, Lambda Network Logs, and agentless EBS Malware Protection scans. | |
| 4 | Why might VPC Flow Logs fail to show the original client IP address or DNS query domain name during a security investigation, and how do you fix it? | Default v2 Flow Logs omit inner headers and DNS; enable Custom v5 VPC Flow Logs (`pkt-srcaddr`/`pkt-dstaddr`) plus Route 53 Query Logging. | When traffic passes through an AWS Network Load Balancer or Transit Gateway, adding `pkt-srcaddr` and `pkt-dstaddr` fields reveals the true originating IP rather than the intermediate ENI IP. | |
| 5 | How do Amazon S3 Object Lock `Governance` mode and `Compliance` mode differ for WORM (Write-Once-Read-Many) regulatory storage? | Governance mode allows bypass via `s3:BypassGovernanceRetention`, whereas Compliance mode cannot be shortened or deleted even by root. | S3 Object Lock requires S3 Versioning to be enabled; a Legal Hold can also be placed independently of retention periods until explicitly removed by an authorized user. | |
| 6 | How do Amazon GuardDuty, AWS Security Hub, and Amazon Detective complement each other in a Cloud SOC workflow? | GuardDuty detects threats, Security Hub aggregates ASFF findings and runs CSPM checks, and Detective builds behavior graphs for RCA. | When GuardDuty triggers an EventBridge rule via Security Hub, security engineers pivot into Amazon Detective to visualize every API call, IP connection, and role assumption over 12 months. | |
| 7 | How do you prevent compromised EC2 instances in a private subnet with no Internet Gateway from exfiltrating data via DNS tunneling? | Deploy Route 53 Resolver DNS Firewall with a walled-garden allowlist of approved domains and a default Block action for all other domains. | Even when a VPC has no IGW or NAT Gateway, the built-in Route 53 Resolver (`VPC+2`) can still resolve external public DNS records unless restricted by DNS Firewall. | |
| 8 | How does AWS CloudTrail Log File Integrity Validation prove forensically whether an attacker modified or deleted a log file in S3 after delivery? | CloudTrail writes hourly digest files containing SHA-256 log hashes, chained together and digitally signed with a private RSA key. | Forensic investigators run `aws cloudtrail validate-logs --trail-arn <arn> --start-time <time>` to verify the cryptographic hash chain and detect any altered or deleted logs. | |
| 9 | Why can you not install a public SSL/TLS certificate issued by AWS Certificate Manager (ACM) directly onto an Amazon EC2 instance's Nginx web server? | Public ACM certificates do not allow private key export; terminate TLS on an ALB, CloudFront, or API Gateway (or use AWS Private CA). | For mutual TLS (mTLS) or direct installation on EC2 instances and on-premises servers, AWS Private CA issues private certificates whose private keys can be exported. | |
| 10 | How does EC2 Instance Metadata Service Version 2 (IMDSv2) defend against Server-Side Request Forgery (SSRF) credential theft? | IMDSv2 requires a session-oriented HTTP `PUT` request with a TTL header to obtain a secret token, blocking simple SSRF `GET` requests. | Enforce IMDSv2 across your Organization using an SCP checking `ec2:MetadataHttpTokens: required` and set `HttpPutResponseHopLimit=1` so containers cannot hop to the host metadata. | |
| 11 | Under the AWS Shared Responsibility Model, how do patch management and encryption responsibilities differ between Amazon EC2, Amazon RDS, and Amazon S3? | Customers patch the guest OS on EC2, AWS patches the OS/DB on RDS, and AWS manages all infrastructure on S3 while customers set encryption. | In all three services, the customer remains 100% responsible for IAM policies, data classification, client-side/server-side encryption toggles, and network access rules. | |
| 12 | How do AWS Managed Keys (`aws/*`) and Customer Managed Keys (CMKs) in AWS KMS differ regarding Key Policies, rotation, and cross-account sharing? | AWS Managed Keys rotate yearly with fixed policies and no cross-account sharing, while CMKs support custom policies and cross-account use. | Unlike S3 bucket policies, every KMS key MUST have a KMS Key Policy; IAM identity policies cannot grant access to a KMS key unless the Key Policy includes the default root statement. | |
| 13 | How does Amazon Inspector v2 scan EC2 instances, Amazon ECR container images, and AWS Lambda functions for software vulnerabilities? | Inspector v2 uses the SSM Agent (or agentless EBS snapshots) for EC2, scans ECR images on push/CVE updates, and scans Lambda code. | Inspector v2 calculates a contextual risk score by combining the CVE CVSS base score with real-time VPC network reachability (such as open Internet paths). | |
| 14 | How do Amazon Cognito User Pools and Cognito Identity Pools (Federated Identities) differ in authentication vs. AWS authorization? | User Pools authenticate users and issue OIDC JWTs, while Identity Pools exchange IdP tokens for temporary AWS STS credentials via IAM roles. | Use Cognito User Pools to back an API Gateway authorizer or ALB, and pair it with an Identity Pool when mobile or browser clients need direct scoped access to S3 or DynamoDB. | |
| 15 | How does Amazon Macie discover sensitive data such as credit card numbers, SSNs, or custom employee IDs stored across thousands of S3 buckets? | Macie uses Managed Data Identifiers (ML/patterns) and Custom Data Identifiers (regex and keywords) to classify sensitive S3 objects. | Macie generates `Policy:IAMUser/S3BucketPublic` and sensitive-data findings that publish automatically to EventBridge and AWS Security Hub. | |
| 16 | What is the Cross-Service Confused Deputy problem in AWS, and which two IAM condition keys prevent it in resource-based and role trust policies? | It occurs when an attacker tricks an AWS service into accessing your resources; prevent it using `aws:SourceArn` and `aws:SourceAccount`. | When granting `cloudtrail.amazonaws.com` permission to write to an S3 bucket, constraining `aws:SourceArn` to your exact Organization Trail ARN stops other customers from writing to your bucket. | |
| 17 | When should you use AWS KMS Grants instead of modifying a KMS Key Policy, and what does the `kms:GrantIsForAWSResource` condition key enforce? | Use KMS Grants for temporary programmatic delegation; `kms:GrantIsForAWSResource: true` restricts grant creation to integrated AWS services. | Services like Amazon EBS and RDS create KMS Grants automatically to encrypt/decrypt volumes without bloating the 32 KB KMS Key Policy document. | |
| 18 | Which three global IAM condition keys form the foundation of an AWS Data Perimeter across Identity, Resource, and Network boundaries? | `aws:PrincipalOrgID` (trusted identities), `aws:ResourceOrgID` (trusted resources), and `aws:SourceVpce`/`aws:SourceVpc` (trusted networks). | When blocking direct internet access to S3 via `aws:SourceVpce`, include an exception for `aws:ViaAWSService: true` so AWS services like Athena or CloudFormation can still act on your behalf. | |
| 19 | How does AWS Firewall Manager enforce baseline network security across hundreds of accounts in an AWS Organization? | Firewall Manager centrally deploys WAF ACLs, Shield Advanced, Security Groups, Network Firewalls, and DNS Firewall across accounts. | Even if a local account administrator tries to delete a Firewall Manager-managed WAF rule or open port 0.0.0.0/0 on a Security Group, Firewall Manager automatically remediates it. | |
| 20 | How does IAM evaluation differ for a Resource-Based Policy (like an S3 Bucket Policy) within the SAME account vs. ACROSS two different AWS accounts? | Same-account resource `Allow` grants access alone, whereas cross-account access requires an `Allow` in BOTH resource and identity policies. | An exception within the same account is that an explicit `Deny` in an identity policy, an SCP, or a missing permission in a Permissions Boundary still blocks the resource policy Allow. | |
| 21 | What is the correct forensic incident response sequence when an Amazon EC2 instance in an Auto Scaling Group is suspected of active compromise? | Place the instance in Standby/detach it, enable termination protection, swap its SG to block all traffic, capture RAM, and snapshot EBS. | Never reboot or terminate a compromised EC2 instance first, because stopping it destroys volatile RAM artifacts (active network sockets, injected processes, and encryption keys). | |
| 22 | When does an enterprise security requirement mandate AWS CloudHSM instead of standard AWS KMS Customer Managed Keys? | Use CloudHSM when regulations mandate single-tenant FIPS 140-3 Level 3 dedicated hardware, customer-only control, or PKCS#11/JCE offloading. | If an organization wants KMS API integration across AWS services while storing keys inside its own CloudHSM cluster, it configures an AWS KMS Custom Key Store. | |
| 23 | How do AWS KMS Multi-Region Keys and KMS Keys with Imported Key Material (`EXTERNAL` origin) differ in availability and revocation? | Multi-Region keys replicate key material across Regions, while Imported Key Material allows immediate on-demand key deletion. | Standard AWS-generated KMS keys enforce a mandatory 7-to-30-day waiting period before deletion, whereas imported key material can be deleted instantly during a compliance emergency. | |
| 24 | How does AWS Network Firewall inspect encrypted outbound HTTPS traffic from private subnets to enforce domain allowlists? | It inspects the TLS Server Name Indication (SNI) header in plaintext or performs full TLS decryption using an outbound proxy CA certificate. | AWS Network Firewall supports stateful Suricata IPS rule groups and must be deployed in a dedicated firewall subnet routed between the NAT Gateway and Internet Gateway. | |
| 25 | What is the exact evaluation order AWS IAM uses when determining whether a request is allowed or denied? | Explicit Deny overrides all; then SCPs/RCPs, Resource-based policies, Permissions Boundaries, Session Policies, and Identity-based policies. | If any applicable policy contains an explicit `Deny`, evaluation stops immediately and the request is rejected; if no explicit `Allow` exists, it ends in an implicit deny. | |
| 26 | How does AWS KMS Envelope Encryption encrypt a 50 GB file when the KMS `Encrypt` API only accepts payloads up to 4 KB? | Call `kms:GenerateDataKey` for a plaintext/encrypted DEK pair, encrypt the file locally with the plaintext DEK, and wipe the plaintext DEK. | To decrypt the 50 GB file later, the application sends the stored encrypted DEK to `kms:Decrypt`, uses the returned plaintext DEK in memory, and immediately discards it. | |
| 27 | How do AWS WAF, AWS Shield Standard, and AWS Shield Advanced work together to mitigate Layer 3/4 and Layer 7 DDoS attacks? | Shield Standard protects L3/L4 free, WAF blocks L7 floods/SQLi/XSS, and Shield Advanced adds 24/7 SRT, L7 mitigation, and cost protection. | An AWS WAF Rate-Based Rule automatically blocks any client IP address (or `X-Forwarded-For` header) that exceeds a configured request threshold within a 5-minute window. | |
| 28 | How do you safely allow developers to create new IAM roles for their Lambda functions without letting them escalate their own privileges to Administrator? | Grant `iam:CreateRole` with a condition requiring `iam:PermissionsBoundary` set to a boundary policy that caps maximum role permissions. | An IAM Permissions Boundary does not grant any permissions itself; the effective permission of the created role is the intersection of its identity policy and its boundary policy. | |
| 29 | How do VPC Security Groups and Network ACLs (NACLs) differ in statefulness, rule types, evaluation order, and attachment level? | Security Groups are stateful, allow-only, and attach to ENIs; NACLs are stateless, allow/deny, and evaluate in number order at subnets. | To block a single malicious IP address immediately from reaching an ALB, add an explicit Deny rule in the public subnet's NACL, since Security Groups cannot deny IPs. | |
| 30 | How do you capture full raw packet payloads (PCAP) from an Amazon EC2 instance for deep-packet inspection in an IDS tool like Zeek or Suricata? | Configure VPC Traffic Mirroring on the source Nitro ENI with a mirror filter to send VXLAN packets (UDP 4789) to a target ENI or NLB. | Unlike VPC Flow Logs (which capture metadata summaries only), VPC Traffic Mirroring clones actual network packets at the Nitro hypervisor level so the guest OS cannot tamper with capture. | |
| 31 | What are the security advantages of AWS Systems Manager Session Manager over traditional SSH Bastion Hosts? | Session Manager requires no inbound ports (no TCP 22), no public IPs, and no SSH keys, while logging all shell commands to S3/CloudWatch. | The SSM Agent on the EC2 instance initiates an outbound TLS 443 connection to the SSM VPC Endpoint (`ssm`, `ssmmessages`, `ec2messages`), controlled by IAM policies and MFA. | |
| 32 | How do AWS Secrets Manager and AWS Systems Manager Parameter Store differ for managing database credentials? | Secrets Manager provides automated Lambda rotation and cross-account sharing, while Parameter Store offers free Standard parameters. | When rotating an Amazon RDS password without application downtime, Secrets Manager uses the alternating-users strategy (cloning user A and user B) so active connections never fail. |