Last updated: May 2026
SCS-C03 — AWS Certified Security – Specialty
Test your knowledge with official exam-style questions
Questions and options are shuffled each attempt
▶AWS Certified Security – Specialty — Practice Set 1: All Questions & Explanations
Full question text, answer options, and explanations for this practice set — a spoiler-free alternative is the interactive quiz above for scored, shuffled practice.
. A security engineer discovers that an IAM access key belonging to an EC2 instance role was exposed in a public GitHub repository three hours ago. AWS CloudTrail logs show the key was used to list Amazon S3 buckets and download several objects from a sensitive data bucket. The instance still needs to access the S3 bucket to continue normal operations. Which sequence of actions should the security engineer take FIRST to contain the incident with MINIMAL disruption to production?
- A. Immediately delete the IAM role, create a new role with the same permissions, and attach it to the EC2 instance
- B. Rotate the exposed access key by disabling it in IAM, create a new key, update the application, and then investigate the CloudTrail logs
- C. Revoke all active sessions for the IAM role using an inline deny policy on the role, then investigate the full extent of the breach using CloudTrail and restore normal permissions after remediation(correct)
- D. Terminate the EC2 instance immediately and launch a new instance with a new IAM role after forensic analysis is complete
Explanation: Adding an inline deny policy (AWSRevokeOlderSessions or an explicit Deny with a condition on token issue time) to the IAM role immediately revokes all active sessions and stops ongoing unauthorized access without disrupting the EC2 instance itself, which retains its role attachment and will receive new credentials via IMDSv2 once the deny policy is removed or scoped. After containment, the security team can investigate the breach scope from CloudTrail. Option A deletes the role, which would break the instance and all dependent services. Option B rotates the static key but for an IAM role (not a user key), the right action is session revocation; also, disabling a key does not stop active sessions using temporary credentials already issued. Option D terminates the instance, causing production disruption and potentially destroying forensic evidence on the instance.
. A security engineer is responding to an Amazon GuardDuty finding of type UnauthorizedAccess:EC2/SSHBruteForce on a production EC2 instance. The instance is a web server in a public subnet with port 22 open to 0.0.0.0/0 in the security group. The attack is ongoing with 10,000 SSH attempts per minute. The engineer must stop the attack immediately and preserve the instance for forensic analysis. Which actions should the engineer take? (Choose TWO.)
- A. Create a new security group with no inbound rules and replace the current security group on the EC2 instance, or modify the current security group to remove the port 22 rule from 0.0.0.0/0(correct)
- B. Terminate the EC2 instance to stop the attack and launch a new instance from the latest AMI to restore service
- C. Take an Amazon EBS snapshot of the EC2 instance's root and data volumes to preserve forensic evidence before any further changes(correct)
- D. Enable AWS Shield Advanced on the EC2 instance to automatically mitigate SSH brute force attacks at the network layer
- E. Use Amazon Inspector to scan the EC2 instance for vulnerabilities that may have been exploited during the SSH brute force attack
Explanation: Removing the 0.0.0.0/0 SSH rule or replacing the security group with one that has no inbound rules immediately stops the brute force attack at the network layer without terminating the instance — this contains the threat. Taking an EBS snapshot preserves the forensic state of the instance (OS logs, auth logs, any planted malware) before any additional changes are made, satisfying incident response best practices. Terminating the instance (option B) destroys forensic evidence and causes production disruption, which violates the 'preserve for forensic analysis' requirement. AWS Shield Advanced (option D) protects against volumetric DDoS attacks, not application-layer SSH brute force — it cannot block SSH connection attempts. Amazon Inspector (option E) scans for vulnerabilities but does not stop active attacks and should be performed after containment, not during.
. A security engineer receives a GuardDuty finding indicating that an EC2 instance has communicated with a known cryptocurrency mining pool command-and-control server (finding type: CryptoCurrency:EC2/BitcoinTool.B!DNS). The instance is part of a production auto-scaling group serving customer traffic. The engineer needs to isolate the compromised instance and restore clean capacity as quickly as possible. Which sequence of steps is MOST appropriate?
- A. Immediately terminate the compromised instance so the auto-scaling group replaces it with a clean instance, then review CloudTrail logs for the root cause
- B. Detach the compromised instance from the auto-scaling group to prevent its replacement, apply a quarantine security group that blocks all traffic, take an EBS snapshot for forensics, and then launch a replacement instance manually from the last known-good AMI
- C. Suspend the auto-scaling group, apply an IAM policy to deny all actions on the compromised instance, and open a support case with AWS to investigate the mining activity
- D. Place the compromised instance in standby within the auto-scaling group (which triggers a replacement launch), capture a memory dump using Amazon Systems Manager Run Command before the instance is terminated, then analyze the snapshot(correct)
Explanation: Placing the instance in standby status within the auto-scaling group triggers the ASG to launch a replacement instance immediately, restoring customer capacity without the operator needing to manually launch an instance. The standby state keeps the compromised instance running (not terminated) so a memory dump via SSM Run Command can capture in-memory malware artifacts. After forensic capture, the instance can be terminated. Immediately terminating (option A) destroys forensic evidence. Detaching from the ASG and manually launching a replacement (option B) is functionally correct for containment and forensics but requires more manual steps; standby mode (option D) is more operationally efficient. Suspending the entire ASG (option C) impacts all capacity, not just the compromised instance.
. A security operations team wants to automate incident response for specific Amazon GuardDuty findings to reduce mean time to respond. When GuardDuty generates an EC2-related finding of severity 7.0 or higher, the team wants to: (1) automatically isolate the EC2 instance by replacing its security group, (2) notify the on-call security engineer via PagerDuty, and (3) create a ticket in the ticketing system via a webhook. The solution must be serverless and require no infrastructure management. Which architecture MOST effectively implements this automated response?
- A. Configure Amazon GuardDuty to send findings to Amazon CloudWatch Events, create a CloudWatch Events rule filtering for EC2 findings with severity ≥ 7.0, and trigger an AWS Lambda function that executes all three response actions
- B. Configure Amazon GuardDuty to publish findings to an Amazon SNS topic, subscribe an AWS Lambda function to the SNS topic, and have the Lambda function filter for severity ≥ 7.0 and execute all three response actions
- C. Enable AWS Security Hub to aggregate GuardDuty findings, configure Security Hub custom actions to trigger an AWS Lambda function for EC2 findings, and use the Lambda function to isolate the instance and send notifications
- D. Create an Amazon EventBridge rule that matches GuardDuty findings with severity ≥ 7.0 and EC2 resource type, configure the rule target as an AWS Step Functions state machine that orchestrates EC2 isolation via AWS SDK calls, PagerDuty API call, and ticketing system webhook in parallel steps(correct)
Explanation: Amazon EventBridge (formerly CloudWatch Events) is the native routing layer for GuardDuty findings, and Step Functions is the best choice for orchestrating multi-step automated response with error handling and retry logic. The state machine can execute EC2 isolation, PagerDuty notification, and ticketing webhook in parallel, reducing total response time. Step Functions provides visibility into each step's execution, retries on failure, and audit history — important for security workflows. EventBridge with a single Lambda function (option A) can work but a monolithic Lambda handling all three actions has no built-in step-level error handling or retry granularity. SNS with Lambda (option B) requires the Lambda to re-filter by severity since SNS cannot filter on nested JSON fields like severity scores (SNS filter policies have limited support for numeric comparisons on nested attributes). Security Hub custom actions (option C) require a human to manually trigger the action from the console — not automated.
. A security engineer needs to ensure that all AWS API calls across a multi-account AWS Organization are logged and cannot be disabled or deleted by any individual account administrator. The logs must be stored in a central security account for 3 years. Which configuration MOST effectively meets these requirements?
- A. Enable AWS CloudTrail in each account individually with log delivery to an Amazon S3 bucket in each account, and use AWS Config to alert if CloudTrail is disabled in any account
- B. Create an AWS Organizations CloudTrail trail at the organization level, configure it to deliver logs to a centralized Amazon S3 bucket in a dedicated security account, apply an S3 bucket policy that denies all actions except CloudTrail s3:PutObject from member accounts, and enable S3 Object Lock with compliance mode for 3-year retention(correct)
- C. Use AWS Security Hub to aggregate security findings across all accounts and configure Security Hub to retain findings for 3 years in the central security account
- D. Enable AWS Config in each account to record all configuration changes, and deliver Config snapshots to a central S3 bucket in the security account as the API activity audit trail
Explanation: An AWS Organizations CloudTrail trail is the purpose-built mechanism for organization-wide CloudTrail coverage: it automatically covers all current and future member accounts without per-account configuration. Delivering to a central security account S3 bucket with a bucket policy that denies all non-CloudTrail writes ensures member account administrators cannot tamper with logs. S3 Object Lock in compliance mode prevents log deletion even by the security account's root user for the retention period. Per-account CloudTrail with Config alerts (option A) has a gap window between when CloudTrail is disabled and when Config detects it — and individual account administrators can disable both CloudTrail and Config. AWS Security Hub (option C) aggregates security findings, not raw API call logs — it is not a replacement for CloudTrail. AWS Config (option D) records resource configuration changes, not all API calls — many security-relevant API calls do not change resource configuration and would not be captured.
. A security engineer needs to detect and alert when any IAM user or role in the AWS account performs a console login without multi-factor authentication (MFA), or when root account activity is detected at any time. The solution must alert the security team within 2 minutes. Which implementation MOST efficiently meets these requirements?
- A. Enable Amazon GuardDuty and configure it to detect IAM findings including root account activity; use GuardDuty's built-in alerting for non-MFA logins
- B. Create Amazon CloudWatch Logs metric filters on the CloudTrail log group: one filter matching ConsoleLogin events where MFAUsed is false, and another matching events where userIdentity.type is Root; create CloudWatch Alarms for each metric and configure SNS notifications to the security team(correct)
- C. Create an AWS Config rule for iam-user-mfa-enabled that checks MFA status on all IAM users and alerts the security team when the rule evaluates to non-compliant
- D. Enable AWS Security Hub with the AWS Foundational Security Best Practices standard, which automatically detects non-MFA logins and root account usage and sends findings to the security team
Explanation: CloudWatch Logs metric filters on CloudTrail log groups provide real-time event pattern matching with sub-minute detection: the filter for ConsoleLogin events with MFAUsed=false triggers a CloudWatch Alarm with an SNS notification to the security team in near real-time, well within the 2-minute requirement. A similar filter for Root userIdentity.type captures root account usage. This is the AWS-recommended approach documented in the CIS AWS Foundations Benchmark. Amazon GuardDuty (option A) detects IAMUser/Root finding types but does not have a dedicated non-MFA login detection finding — GuardDuty focuses on behavioral anomalies and threat intelligence, not policy compliance events. AWS Config iam-user-mfa-enabled (option C) evaluates MFA configuration on user accounts, not individual login events — it would alert that a user's MFA setting is disabled, not that a specific login occurred without MFA. Security Hub (option D) aggregates findings and runs periodic checks but is not a real-time event detection mechanism within 2 minutes.
. A security engineer is investigating a potential data exfiltration incident. AWS GuardDuty generated a finding of type Exfiltration:S3/AnomalousBehavior indicating unusual S3 data access from an EC2 instance. The engineer needs to determine exactly which S3 objects were accessed, when, and the size of data transferred over the past 30 days. CloudTrail is enabled and S3 data events are configured. Which approach MOST efficiently investigates the scope of access?
- A. Review Amazon VPC Flow Logs for the EC2 instance to identify all outbound connections and calculate the volume of data transferred to external IP addresses
- B. Query the AWS CloudTrail S3 data events using Amazon Athena against the CloudTrail S3 bucket, filtering for GetObject and ListBucket events where the source IP matches the EC2 instance's IP address over the 30-day window(correct)
- C. Review the Amazon S3 server access logs for the affected buckets to identify all object-level requests from the EC2 instance's IP address over the 30-day period
- D. Use Amazon Macie to scan the S3 buckets involved and generate a report of all objects that match sensitive data patterns to determine which sensitive objects may have been exfiltrated
Explanation: AWS CloudTrail S3 data events record individual GetObject, PutObject, DeleteObject, and ListBucket API calls with full request metadata including requester identity, source IP, object key, and response metadata. Querying via Amazon Athena provides SQL-based analysis across 30 days of events efficiently with filtering on the EC2 instance IP. This gives the engineer the exact list of objects accessed, timestamps, and bytes transferred per request. VPC Flow Logs (option A) provide network metadata (IP, bytes, ports) but cannot identify which specific S3 objects were accessed — they show connections to S3 endpoints but not object-level detail. S3 server access logs (option C) are similar in content to CloudTrail data events but are not enabled by default, may have delivery delays, and are less queryable at scale than Athena-on-CloudTrail. Amazon Macie (option D) classifies sensitive data content but does not provide historical access logs for the investigation.
. A company needs to implement a centralized security monitoring solution for 150 AWS accounts. The solution must aggregate all Amazon GuardDuty findings, AWS Security Hub findings, and AWS Config compliance results in a single pane of glass in a designated security account. New accounts joining the organization must be automatically enrolled. The security team requires that member account administrators cannot disable the security services. Which architecture MOST effectively meets all requirements?
- A. Configure AWS Security Hub and Amazon GuardDuty as delegated administrators in the security account via AWS Organizations, enable auto-enable for all new member accounts, use Service Control Policies to prevent member accounts from disabling GuardDuty or Security Hub, and use AWS Config aggregator in the security account to collect Config results(correct)
- B. Deploy AWS Lambda functions in each member account to push GuardDuty findings, Security Hub findings, and Config results to a central Amazon S3 bucket in the security account via cross-account IAM roles
- C. Configure Amazon EventBridge event bus in each member account to forward GuardDuty and Security Hub events to the security account's event bus, and use AWS Config organizational rules to aggregate compliance results
- D. Enable AWS CloudTrail at the organization level and use Amazon Athena queries against the central CloudTrail bucket to derive security findings, compliance status, and configuration issues across all 150 accounts
Explanation: Using AWS Organizations delegated administrator for both GuardDuty and Security Hub is the native AWS multi-account security architecture: the security account automatically receives all findings from all member accounts, and the auto-enable feature ensures new accounts are enrolled without manual action. Service Control Policies (SCPs) at the Organizations level prevent member account administrators from calling guardduty:DisableOrganizationAdminAccount or securityhub:DisableOrganizationAdminAccount — enforcing centralized visibility. AWS Config aggregator collects Config rule compliance results from all accounts. Lambda-based forwarding (option B) requires deploying and maintaining Lambda functions in 150 accounts — high operational overhead and not native. EventBridge cross-account bus forwarding (option C) requires event bus resource policies in all 150 accounts and does not have an auto-enable mechanism for new accounts. CloudTrail analysis via Athena (option D) requires deriving security findings from API logs — this is not a replacement for purpose-built security services.
. A security engineer needs to protect a public-facing web application from OWASP Top 10 vulnerabilities including SQL injection, XSS, and request forgery. The application is deployed behind an Amazon CloudFront distribution that serves traffic from an Application Load Balancer origin. The company needs managed rule updates without manual rule maintenance. Which configuration provides MOST comprehensive protection with LEAST operational overhead?
- A. Associate AWS WAF with the Application Load Balancer and create custom WAF rules using regular expression patterns to match SQL injection and XSS patterns in request bodies
- B. Associate AWS WAF with the Amazon CloudFront distribution, add the AWS Managed Rules Common Rule Set (CRS) and the AWS Managed Rules Known Bad Inputs rule group, and enable automatic rule updates through Managed Rule Group subscriptions(correct)
- C. Enable Amazon GuardDuty to detect web application attack patterns and configure automatic IP blocking by integrating GuardDuty findings with AWS WAF IP sets via AWS Lambda
- D. Configure AWS Shield Advanced on the CloudFront distribution which includes integrated AWS WAF with OWASP Top 10 protections
Explanation: Associating AWS WAF with the CloudFront distribution (at the edge, closest to the attacker) with the AWS Managed Rules Common Rule Set provides pre-built, continuously updated protections for OWASP Top 10 threats including SQL injection, XSS, and HTTP protocol violations — with no manual rule maintenance required as AWS updates these rules automatically. Attaching WAF at the ALB origin means attacks must traverse CloudFront before being blocked at the ALB, providing less edge protection. Custom regex-based WAF rules (option A) require significant security expertise to write, test, and maintain — high operational overhead. GuardDuty (option C) detects threats after they've reached the application and performs behavioral analysis, not real-time web request inspection. AWS Shield Advanced (option D) includes enhanced DDoS protection and AWS WAF cost waiver, but does not automatically configure OWASP WAF rules — those must still be configured manually.
. A security engineer is designing the network security posture for a three-tier application in a VPC. The web tier is in a public subnet, the application tier is in a private subnet, and the database tier is in an isolated subnet with no route to the internet. A recent penetration test found that the security group on the database tier was incorrectly configured to allow inbound connections from 0.0.0.0/0 on port 3306 due to a developer error. The engineer wants to implement a defense-in-depth control that would block such a misconfiguration even if it occurs again, without impacting legitimate application-tier-to-database traffic. Which control MOST effectively prevents internet access to the database tier as a backstop?
- A. Configure an AWS Config rule with auto-remediation that checks for security group rules allowing 0.0.0.0/0 on port 3306 and automatically removes such rules within 5 minutes
- B. Configure network ACLs on the database subnet to DENY inbound traffic from 0.0.0.0/0 on all ports except specific CIDR ranges used by the application tier, providing a stateless backstop independent of security group configuration(correct)
- C. Enable Amazon Inspector to continuously assess the database EC2 instances for security group misconfigurations and generate findings when open inbound rules are detected
- D. Use AWS Firewall Manager to apply a mandatory security group policy to the database subnet that cannot be overridden by developers, enforcing only application tier CIDR access
Explanation: Network ACLs are stateless, subnet-level controls that operate independently of security groups. Configuring the database subnet's NACL to deny all inbound traffic except from the application tier CIDR creates a defense-in-depth layer: even if a developer misconfigures the security group to allow 0.0.0.0/0, the NACL DENY rule at the subnet level blocks the traffic before it reaches the instance. NACLs also block traffic from the internet because the database subnet has no route to the internet gateway, so this is a belt-and-suspenders control. AWS Config auto-remediation (option A) has a detection-to-remediation lag during which the misconfiguration exists and traffic could flow. Amazon Inspector (option C) generates findings but does not block traffic — it is a detective control, not a preventive one. AWS Firewall Manager security group policies (option D) are valid centralized controls but enforce security group configurations rather than providing an independent network-layer backstop.
. A security engineer needs to ensure that EC2 instances in a production environment never have direct internet access, that all SSH access is performed through a controlled channel without maintaining long-lived bastion hosts, and that all session activity is audited and recorded. The instances are in private subnets with no internet gateway. Which solution MOST securely meets all requirements?
- A. Deploy a dedicated bastion host EC2 instance in a public subnet, restrict SSH access to the bastion from the corporate IP range, enable CloudTrail logging for all EC2 API calls, and require all administrators to SSH through the bastion to reach private instances
- B. Use AWS Systems Manager Session Manager to access EC2 instances without any open inbound ports or SSH keys, configure session logging to Amazon S3 and Amazon CloudWatch Logs, and use IAM policies to restrict which users can start sessions(correct)
- C. Create an AWS Client VPN endpoint in the VPC that requires certificate-based authentication, allow VPN-connected clients to SSH directly to private instance IPs, and enable VPC Flow Logs for session activity auditing
- D. Require all access to production EC2 instances to go through AWS Systems Manager Run Command for administrative tasks, disable SSH on all instances entirely, and use Run Command output logging to CloudTrail
Explanation: AWS Systems Manager Session Manager provides browser-based or CLI shell access to EC2 instances without requiring open inbound ports (no SSH port 22 needed), without SSH keys to manage, and with session activity (every command and response) logged to S3 and CloudWatch Logs. IAM policies control who can initiate sessions. The instances communicate with SSM via the SSM agent over HTTPS outbound, so private subnets with SSM VPC endpoints or NAT for the SSM endpoints work without internet gateways. A bastion host (option A) requires maintaining the bastion EC2 instance, managing SSH keys, and still requires port 22 open — a larger attack surface. Client VPN (option C) enables SSH access which requires managing SSH keys and open port 22; VPC Flow Logs capture IP metadata but not session content for auditing. Run Command (option D) is for running scripts non-interactively, not for interactive administrative shell sessions.
. A security engineer is evaluating the security posture of an Amazon EKS cluster running production microservices. A penetration test found that a compromised container was able to access the EC2 instance metadata service (IMDSv1) from within the container, retrieve the node's IAM role credentials, and use those credentials to access other AWS services. The cluster's node group uses EC2 instances with broad IAM permissions. Which combination of controls MOST effectively mitigates this attack path? (Choose TWO.)
- A. Configure EC2 instance metadata service to require IMDSv2 (hop limit = 1) on all EKS node group instances, which prevents containers from reaching IMDS because the default hop limit for IMDSv2 requires a PUT request with TTL=1 that container network namespaces cannot initiate(correct)
- B. Enable Amazon EKS Pod Identity or IAM Roles for Service Accounts (IRSA) and assign pod-specific IAM roles with least-privilege permissions to each microservice, replacing the broad node IAM role permissions(correct)
- C. Deploy Amazon GuardDuty with EKS Runtime Monitoring to detect when containers attempt to access the IMDS endpoint and automatically terminate the offending pod
- D. Move all EKS workloads to AWS Fargate, which does not have access to EC2 instance metadata service and provides task-level IAM role isolation
- E. Apply a Kubernetes NetworkPolicy that blocks egress traffic from all pods to 169.254.169.254/32 to prevent containers from reaching the IMDS endpoint
Explanation: IMDSv2 with hop limit of 1 (option A) prevents containers from accessing IMDS because IMDSv2 requires a PUT request to get a session token, and the TTL=1 in the PUT request means the packet cannot traverse the additional network hop (from the container network namespace through the host network namespace to IMDS) — the TTL expires before reaching 169.254.169.254 from within a container. IRSA/Pod Identity (option B) assigns fine-grained IAM roles directly to pods using OIDC federation, so even if a container obtained node role credentials, those credentials have minimal permissions, and each pod only has the specific permissions it needs. These two controls address the attack path at different layers. GuardDuty (option C) is detective — it detects after the attack occurs but does not prevent credential theft. Moving to Fargate (option D) eliminates the problem but is a major architectural change and may not be feasible for all workloads. NetworkPolicy (option E) requires a CNI plugin that supports NetworkPolicy (e.g., Calico, not the default VPC CNI for IMDS blocking) and can be bypassed by privileged containers.
. A security engineer needs to ensure that all Amazon EC2 instances launched in an AWS account have encrypted EBS volumes, specific required tags (CostCenter, Environment, Owner), and do not use the default VPC. The controls must be preventive — non-compliant instances must not be launchable. Which approach MOST effectively prevents launch of non-compliant instances?
- A. Create AWS Config rules for encrypted-volumes, required-tags, and default-vpc-check, and configure auto-remediation to terminate non-compliant instances after they are launched
- B. Use AWS Service Control Policies to deny ec2:RunInstances when the request does not include a condition ensuring EBS encryption, required tags, and non-default VPC — enforced at the AWS Organizations level(correct)
- C. Configure AWS CloudFormation StackSets to deploy EC2 instances only through approved CloudFormation templates that enforce encryption, tagging, and VPC selection, and use IAM permissions to restrict direct EC2 RunInstances API calls
- D. Enable Amazon Inspector to scan all newly launched EC2 instances for compliance with encryption and tagging requirements, and terminate non-compliant instances via an EventBridge rule within 5 minutes
Explanation: Service Control Policies (SCPs) applied at the AWS Organizations level are preventive controls that evaluate before IAM permissions — they prevent the ec2:RunInstances API call from succeeding if the request lacks encryption specifications, required tags, or uses the default VPC subnet. This stops non-compliant instances from ever being launched. SCPs cannot be bypassed by account-level IAM policies. AWS Config auto-remediation (option A) is a detective-then-corrective approach with a gap window — the instance launches, runs for several minutes, and is then terminated; during that window it could be exploited or generate costs. CloudFormation StackSets (option C) enforces via approved templates but requires also restricting direct API access via IAM, which is more complex to maintain comprehensively. Amazon Inspector (option D) is a vulnerability scanner, not a compliance enforcement tool, and the 5-minute detection-to-termination gap still allows a non-compliant instance to run.
. A security engineer is reviewing IAM policies in an AWS account. An S3 bucket policy must grant read access to objects in the bucket to all IAM users in the same AWS account, but must explicitly deny access to a specific IAM user named 'restricted-analyst' regardless of any other permissions that user might have. Which bucket policy configuration CORRECTLY implements this?
- A. Create a bucket policy with an Allow statement for Principal '*' with condition aws:PrincipalAccount matching the account ID, and a separate Deny statement for Principal arn:aws:iam::ACCOUNT_ID:user/restricted-analyst(correct)
- B. Create a bucket policy with an Allow statement for the specific IAM ARN of every user in the account except restricted-analyst, listing all permitted user ARNs explicitly
- C. Create an IAM user policy that grants s3:GetObject to all objects in the bucket, and attach an IAM Deny policy to the restricted-analyst user blocking all S3 access
- D. Enable AWS IAM Identity Center and configure permission sets that grant bucket access to all users except restricted-analyst through group membership exclusion
Explanation: An explicit Deny in IAM always overrides any Allow — attaching a Deny statement for the restricted-analyst IAM ARN in the bucket policy ensures that user cannot access the bucket regardless of any other Allow policies (including account-wide policies or the general Allow in the same bucket policy). The Allow for Principal '*' with aws:PrincipalAccount ensures only principals from the same account get access. Listing all permitted user ARNs explicitly (option B) is operationally impractical and breaks whenever new users are added. An IAM user-level Deny policy (option C) works but applies to all S3 resources, not specifically to this bucket — over-broad. IAM Identity Center permission sets (option D) manage SSO access, not native IAM user access, and 'exclusion from a group' is not a direct IAM concept.
. A security engineer is designing cross-account access for a centralized logging account. An application in Account A (production) needs to write CloudTrail logs to an S3 bucket in Account B (security/logging). The solution must follow least-privilege: only CloudTrail in Account A should be able to write to the bucket, no human user should have direct write access, and the security account team must be able to read the logs. Which IAM configuration CORRECTLY achieves this?
- A. Create an IAM role in Account B that Account A's administrators can assume, granting s3:PutObject to the logging bucket, and use that role in the CloudTrail configuration
- B. Configure the S3 bucket policy in Account B to allow s3:PutObject from the CloudTrail service principal (cloudtrail.amazonaws.com) with a condition that limits writes to the specific Account A's CloudTrail ARN using aws:SourceArn, and grant security team members in Account B IAM read permissions to the bucket(correct)
- C. Enable S3 Cross-Region Replication from a bucket in Account A to the logging bucket in Account B, so CloudTrail writes to Account A's bucket and the logs are automatically replicated
- D. Create an IAM user in Account B with s3:PutObject permissions and provide the access keys to Account A's CloudTrail configuration for cross-account log delivery
Explanation: CloudTrail uses a service-linked role and calls the S3 API using the cloudtrail.amazonaws.com service principal. The S3 bucket policy in Account B grants s3:PutObject to the cloudtrail.amazonaws.com service principal with an aws:SourceArn condition scoped to Account A's specific CloudTrail ARN — this ensures only CloudTrail from Account A (not any other account or any human) can write to the bucket. Security team members in Account B receive read permissions via their IAM policies. An IAM role that Account A's administrators can assume (option A) grants human administrators write access, violating the no-human-write requirement. S3 Cross-Region Replication (option C) adds unnecessary complexity and still requires Account A's bucket to be properly secured. Creating an IAM user with access keys (option D) gives human-manageable credentials with write access — a security anti-pattern and violates least-privilege.
. A security engineer is implementing attribute-based access control (ABAC) for an organization with 500 developers across 15 teams. Each developer needs access to AWS resources (EC2, S3, RDS) tagged with their specific team name. Creating team-specific IAM roles would require 15 roles with near-identical policies. The engineer wants to use a single IAM role that scales to new teams without policy changes. Which IAM implementation MOST efficiently achieves this?
- A. Create 15 IAM groups, one per team, attach resource-specific policies to each group, and add developers to their team's group to inherit the appropriate permissions
- B. Create a single IAM role with a policy that uses the aws:ResourceTag condition key, where the condition requires the resource's Team tag value to match the aws:PrincipalTag/Team tag value of the calling principal — configure team-specific tag values in IAM Identity Center or as session tags when developers assume the role(correct)
- C. Create 15 IAM policies with resource ARN conditions scoped to each team's resources, attach all 15 policies to a single IAM role, and use the role for all developers across all teams
- D. Use AWS Organizations Service Control Policies to restrict each team's developers to only access resources in their team's designated AWS account, creating per-team accounts
Explanation: ABAC with principal tags and resource tags is the purpose-built IAM scaling mechanism: a single IAM policy with condition `aws:ResourceTag/Team StringEquals aws:PrincipalTag/Team` allows a developer to access only resources tagged with a Team value matching their own principal tag — when a new team is added, no policy change is needed, just a new tag value. This scales infinitely without policy proliferation. IAM groups with per-team policies (option A) require creating and maintaining 15+ policies and group memberships — it works but does not scale without policy changes per new team. Attaching all 15 policies to one role (option C) would grant every developer access to all team resources — a security failure. Per-team AWS accounts via SCPs (option D) is a valid isolation model but is a much heavier architectural change and does not use ABAC as described.
. A security engineer is reviewing IAM permissions for a Lambda function that processes customer orders. The function requires access to a specific Amazon SQS queue to receive orders and a specific Amazon DynamoDB table to write order records. During a security review, the engineer discovers the function's execution role has the managed policy AdministratorAccess attached. The engineer must remediate this to follow least privilege without breaking the function. Which remediation approach MOST effectively achieves least privilege?
- A. Replace AdministratorAccess with the AWS managed policy AWSLambdaBasicExecutionRole and AmazonSQSReadOnlyAccess, which limits Lambda to read-only SQS access
- B. Create a custom IAM policy granting only sqs:ReceiveMessage, sqs:DeleteMessage, and sqs:GetQueueAttributes on the specific SQS queue ARN, and dynamodb:PutItem and dynamodb:GetItem on the specific DynamoDB table ARN — replace AdministratorAccess with this custom policy
- C. Use IAM Access Analyzer to generate a policy based on the Lambda function's recent CloudTrail activity, review the generated policy for accuracy, and replace AdministratorAccess with the generated least-privilege policy(correct)
- D. Add an explicit Deny statement to the Lambda role's policy that denies all actions except the required SQS and DynamoDB actions, rather than removing AdministratorAccess
Explanation: IAM Access Analyzer policy generation uses CloudTrail activity to identify exactly which API calls the Lambda function has made historically and generates a least-privilege policy containing only those actions on those specific resources. This approach is accurate (based on actual usage, not guesses), comprehensive (catches any additional permissions the function uses that the engineer may not know about), and verifiable before deployment. A manually crafted custom policy (option B) is correct in principle but risks omitting permissions the function needs that aren't obvious from the description — CloudTrail-based generation is more reliable. AWSLambdaBasicExecutionRole with AmazonSQSReadOnlyAccess (option A) does not include DynamoDB write permissions or SQS message deletion, breaking the function. Adding an explicit Deny while keeping AdministratorAccess attached (option D) is not best practice — the Allow from AdministratorAccess remains in the policy, increasing the blast radius if the Deny is ever incorrectly modified.
. A security engineer needs to ensure that all objects uploaded to a specific Amazon S3 bucket are encrypted at rest using server-side encryption with AWS KMS Customer Managed Keys (SSE-KMS). The solution must prevent any unencrypted uploads and ensure only the designated CMK is used. Which configuration MOST effectively enforces this requirement?
- A. Enable default S3 bucket encryption with the designated AWS KMS CMK, which automatically encrypts all objects uploaded without an encryption header
- B. Enable default S3 bucket encryption with the designated KMS CMK and add a bucket policy with a Deny statement for s3:PutObject requests where the aws:SecureTransport condition is false or where the request does not specify the designated CMK in the x-amz-server-side-encryption-aws-kms-key-id header(correct)
- C. Enable Amazon Macie on the S3 bucket to detect any unencrypted objects and trigger a Lambda function to re-encrypt them with the designated CMK
- D. Create an IAM policy for all IAM users granting s3:PutObject only when the x-amz-server-side-encryption-aws-kms-key-id condition matches the designated CMK ARN
Explanation: Default bucket encryption applies the designated CMK automatically, but an application can still explicitly override it by specifying a different key or no key. Adding a bucket policy Deny statement that blocks s3:PutObject unless the request specifies the exact designated CMK ARN ensures that even if an application explicitly tries to use a different key or no encryption, the upload is rejected. The two controls together (default encryption for convenience + bucket policy Deny for enforcement) provide comprehensive protection. Default encryption alone (option A) applies the CMK when no encryption header is specified but does not block requests that explicitly override the key. Amazon Macie (option C) detects unencrypted objects after they are already stored — a corrective detective control, not a preventive one. IAM policy conditions (option D) apply only to IAM principals accessing the bucket from within the account, not to all principals or cross-account access, and do not cover service-role uploads.
. A security engineer at a healthcare company needs to discover and classify sensitive PHI (Protected Health Information) stored across hundreds of Amazon S3 buckets in a multi-account AWS environment. The company needs a risk report identifying which buckets contain PHI, the types of PHI found (names, SSNs, medical record numbers), and the buckets' exposure risk based on their access controls. Which AWS service combination MOST directly addresses these requirements?
- A. Use Amazon Macie with multi-account support through AWS Organizations to discover and classify sensitive data across all S3 buckets, generating findings for PHI based on managed data identifiers for health information, and review the Macie S3 inventory for bucket access control posture(correct)
- B. Use Amazon Inspector to scan all S3 buckets for sensitive content and vulnerability exposure, and AWS Security Hub to aggregate the findings into a compliance report
- C. Deploy an AWS Lambda function that downloads and scans each S3 object using Amazon Comprehend Medical to identify PHI entities, storing results in Amazon DynamoDB for reporting
- D. Enable AWS Config with the s3-bucket-public-read-prohibited and s3-bucket-public-write-prohibited rules to identify at-risk buckets, and use Amazon GuardDuty to detect unauthorized access to S3 buckets containing PHI
Explanation: Amazon Macie is purpose-built for S3 data classification and PHI discovery: its managed data identifiers include pre-built patterns for healthcare data (medical record numbers, health insurance IDs, SSNs, names in medical context) and it integrates with AWS Organizations for multi-account deployment. Macie also provides an S3 bucket inventory showing encryption, access control, and public exposure status, directly answering the exposure risk requirement. Amazon Inspector (option B) assesses software vulnerabilities and network exposure on EC2 instances and containers — it does not scan S3 object content for sensitive data classification. Custom Lambda with Comprehend Medical (option C) is technically possible but requires significant development, operational overhead, cost management for scanning hundreds of buckets, and no native PHI classification patterns. AWS Config rules (option D) identify misconfigured bucket policies but do not scan bucket contents for PHI.
. A security engineer is designing an encryption architecture for a multi-tenant SaaS application on AWS. Each tenant's data must be encrypted with a tenant-specific encryption key so that a compromise of one tenant's key does not expose other tenants' data. The application has 10,000 tenants and the number is growing. Key management must be operationally scalable with centralized audit logging of all key usage. Which encryption architecture MOST effectively meets these requirements?
- A. Create 10,000 AWS KMS Customer Managed Keys, one per tenant, and use the appropriate tenant CMK for each tenant's data encryption and decryption operations — with CloudTrail logging all AWS KMS API calls for audit
- B. Use a single AWS KMS CMK for all tenants and implement tenant isolation through IAM policies that restrict which application components can use the key for which tenants' data
- C. Use AWS KMS with envelope encryption: generate a unique data encryption key (DEK) per tenant using the AWS KMS GenerateDataKey API with a single CMK, encrypt each tenant's data with their DEK, and store the encrypted DEK alongside the encrypted data — use tenant-specific encryption contexts to enable per-tenant KMS CloudTrail audit trails(correct)
- D. Deploy AWS CloudHSM with a dedicated HSM cluster per tenant to provide hardware-level key isolation, and use the CloudHSM client library in the application to perform encryption and decryption operations
Explanation: Envelope encryption with GenerateDataKey and tenant-specific encryption contexts is the scalable, operationally practical architecture for 10,000+ tenants: one CMK is used for all tenants but each tenant gets a unique DEK (generated per-tenant or per-object), which encrypts their data. The encryption context (e.g., tenantId) is logged in CloudTrail for every KMS API call, providing per-tenant audit trails without separate CMKs. If one tenant's DEK is compromised, other tenants' data remains secure since each DEK is unique. Creating 10,000 CMKs (option A) is possible but AWS KMS has a default limit of 100,000 CMKs per Region, and managing 10,000 growing CMKs with individual key policies is operationally complex; also, the encryption context approach in option C achieves equivalent per-tenant isolation. A single CMK with no per-tenant DEK differentiation (option B) means a CMK compromise exposes all tenant data — no isolation. CloudHSM per-tenant clusters (option D) is extremely expensive and operationally heavy for 10,000 tenants.
. A security engineer needs to securely provide a database password, an API key, and an SSL certificate private key to an Amazon EC2 application. The credentials must be rotated automatically every 30 days, and the application must always use the current credential without code changes or redeployment. Access to the credentials must be logged for compliance. Which solution MOST effectively meets all requirements?
- A. Store the credentials as Amazon EC2 user data (encrypted at rest by the EC2 service) and configure a CloudWatch Events rule to rotate the credentials by launching a new instance with updated user data every 30 days
- B. Store the database password and API key in AWS Secrets Manager with rotation enabled using AWS Lambda rotation functions, store the SSL private key in AWS Certificate Manager, and configure the application to retrieve secrets at startup using the Secrets Manager API with an instance role that grants secretsmanager:GetSecretValue(correct)
- C. Store all credentials in AWS Systems Manager Parameter Store as SecureString parameters using a KMS CMK, enable automatic rotation using a custom Lambda function triggered by CloudWatch Events every 30 days, and retrieve parameters at startup using the SSM GetParameter API
- D. Bake the credentials into an encrypted AMI at build time and rebuild the AMI with new credentials every 30 days, using a deployment pipeline to update the auto-scaling group with the new AMI
Explanation: AWS Secrets Manager is purpose-built for credential management with native automatic rotation: it supports built-in Lambda rotation functions for common databases (RDS, Redshift, DocumentDB) and custom functions for APIs, automatically rotating on a schedule without application changes. The application retrieves the current secret value at runtime via the Secrets Manager API — after rotation, the next retrieval returns the new value automatically. AWS Certificate Manager manages SSL/TLS certificates including auto-renewal. Secrets Manager logs all GetSecretValue API calls to CloudTrail for compliance. Systems Manager Parameter Store with custom Lambda rotation (option C) is a valid approach but requires implementing rotation logic manually and lacks native database rotation support. EC2 user data (option A) is not designed for secrets — user data is not encrypted at the EC2 API level and is accessible to any process on the instance. Baking secrets into AMIs (option D) is a severe security anti-pattern — credentials are stored in AMI snapshots, which are hard to properly restrict.
. A security engineer at a company using AWS Organizations needs to ensure that no AWS account in the organization can ever disable Amazon GuardDuty or create public S3 buckets. These restrictions must apply even to account root users. Which control MOST effectively enforces these restrictions?
- A. Create IAM permission boundaries on all IAM users and roles in every account that deny guardduty:DeleteDetector and s3:PutBucketPublicAccessBlock actions
- B. Apply Service Control Policies (SCPs) to the root of the AWS Organization or relevant OUs that contain explicit Deny statements for guardduty:DeleteDetector, guardduty:DisassociateFromMasterAccount, and s3:PutBucketAcl with AllUsers/AuthenticatedUsers grants(correct)
- C. Enable AWS Config rules in all accounts that detect when GuardDuty is disabled or S3 buckets become public, and trigger automatic remediation via Lambda functions to re-enable GuardDuty and block public access
- D. Use AWS CloudFormation StackSets to deploy a GuardDuty enablement stack and S3 Block Public Access configuration in all accounts, with drift detection to identify unauthorized changes
Explanation: Service Control Policies are the only IAM mechanism that restricts even account root users — they are organization-level controls applied before any IAM evaluation. An SCP with explicit Deny statements for the relevant GuardDuty and S3 APIs prevents any principal, including root, from disabling GuardDuty or making S3 buckets public. IAM permission boundaries (option A) apply to IAM users and roles but do not restrict root users — root is explicitly excluded from IAM boundary enforcement. AWS Config auto-remediation (option C) is a reactive detective control with a time gap — GuardDuty could be disabled for several minutes before remediation. CloudFormation StackSets with drift detection (option D) detects configuration drift after the fact but cannot prevent the initial unauthorized action.
. A security engineer needs to continuously assess the security posture of 50 AWS accounts against the AWS CIS Foundations Benchmark and PCI DSS requirements. The solution must provide a compliance score, identify failed controls, and prioritize remediation by severity. New accounts must be automatically included in assessments. Which service MOST directly meets these requirements?
- A. Enable Amazon Inspector in all 50 accounts to continuously scan EC2 instances and Lambda functions for vulnerabilities and compliance deviations against CIS benchmarks
- B. Enable AWS Security Hub with the CIS AWS Foundations Benchmark standard and the PCI DSS standard enabled, designate a delegated administrator account via AWS Organizations, enable auto-enable for new member accounts, and review the Security Hub compliance score and findings dashboard(correct)
- C. Deploy the AWS Config Conformance Pack for CIS and PCI DSS rules across all 50 accounts using AWS Organizations CloudFormation StackSets, and aggregate Config compliance results in a Config aggregator in the master account
- D. Enable AWS Trusted Advisor in all 50 accounts at the Business or Enterprise support tier to access security checks aligned with CIS and PCI DSS requirements, and use the Trusted Advisor organizational view for consolidated reporting
Explanation: AWS Security Hub is the purpose-built service for multi-account security posture management: it maps findings to CIS Foundations Benchmark and PCI DSS controls, provides a normalized compliance score per standard and per account, prioritizes by severity, and integrates with AWS Organizations for automatic enrollment of new accounts. The delegated administrator model aggregates all findings in a single account. Amazon Inspector (option A) focuses on EC2/Lambda/ECR vulnerability assessments — it is not a CIS Benchmark or PCI DSS compliance assessment framework. AWS Config Conformance Packs (option C) provide granular rule-level compliance data and are a valid approach, but Security Hub aggregates at a higher level with severity scoring and compliance dashboard tailored to the stated requirements. AWS Trusted Advisor (option D) provides some security best practice checks but is not a comprehensive CIS or PCI DSS compliance assessment framework.
. A security engineer is implementing a patch management strategy for 2,000 Amazon EC2 instances across 10 AWS accounts. The organization requires that critical security patches be applied within 72 hours of release, that patches be tested in a non-production environment before production deployment, and that a compliance report showing patched and unpatched instances be available for audit. Which solution MOST effectively meets all requirements with LEAST operational overhead?
- A. Use AWS Systems Manager Patch Manager with patch baselines configured to classify critical patches, define maintenance windows for non-production (applied first) and production (applied 48 hours later), use patch groups to target instances, and use Systems Manager Compliance view and AWS Security Hub integration for audit reporting(correct)
- B. Deploy a third-party patch management solution on EC2 instances using AWS Marketplace, integrate it with AWS Systems Manager Run Command to execute patch operations, and generate reports using Amazon QuickSight connected to patch data in Amazon S3
- C. Create AWS Lambda functions triggered by Amazon EventBridge rules every 24 hours that use the SSM Run Command to execute yum update --security or apt-get upgrade commands on all EC2 instances, and log results to Amazon CloudWatch Logs
- D. Use AWS Config to detect EC2 instances that have not been patched within 72 hours using custom Config rules, and trigger a Systems Manager Automation document for auto-remediation patching
Explanation: AWS Systems Manager Patch Manager with patch baselines, maintenance windows, and patch groups provides the complete native patching solution: patch baselines define severity classifications (critical, important) and approval rules; maintenance windows enforce the staged deployment (non-production first, production 48 hours later); patch groups tag instances for targeted patching; and SSM Compliance provides built-in reporting of patched/compliant and non-compliant instances across all accounts. The 72-hour requirement is met by configuring the non-production maintenance window within 24 hours of patch release. Third-party patching (option B) adds external dependencies, cost, and operational overhead beyond the native AWS solution. Lambda with yum/apt commands (option C) applies all updates indiscriminately without classification or staged deployment — not suitable for controlled critical patch management. AWS Config rules for detection with auto-remediation (option D) is a reactive approach that detects non-compliance after the 72-hour window has potentially been exceeded.
. A security engineer is designing a secure CI/CD pipeline for a financial services company on AWS. The pipeline must ensure that no infrastructure change can be deployed to production unless it has passed automated security scanning, received approval from two senior engineers, and that all deployment activity is immutably logged. The pipeline uses AWS CodePipeline and deploys infrastructure via AWS CloudFormation. Which security controls MOST comprehensively enforce these requirements?
- A. Integrate AWS CodeGuru Security in the CodePipeline build stage to scan Infrastructure as Code templates, configure a CodePipeline manual approval action requiring two approvers before the production deploy stage, and enable AWS CloudTrail with S3 Object Lock to capture all CodePipeline and CloudFormation API calls immutably(correct)
- B. Use AWS Config to scan CloudFormation templates for compliance before deployment, configure CodePipeline with a single approver manual approval gate, and use Amazon CloudWatch Logs for immutable deployment logging
- C. Run AWS Security Hub checks against the production environment after CloudFormation deployment to detect any security violations, configure rollback triggers in CloudFormation to revert non-compliant deployments, and use CloudTrail for audit logging
- D. Integrate cfn-nag (CloudFormation security linter) in the build stage, use AWS CodePipeline with a manual approval action configured for a single approver email notification, and store CodePipeline execution history in Amazon DynamoDB for audit
Explanation: AWS CodeGuru Security provides automated security scanning of IaC templates and code in the pipeline build stage — catching security issues before deployment. CodePipeline's native manual approval action supports multiple approver notifications and requires approval from configured approvers before proceeding; two separate manual approval actions (or configuring both approvers on one action) enforces the two-engineer requirement. AWS CloudTrail with S3 Object Lock (compliance mode) provides tamper-proof, immutable logging of all CodePipeline stage transitions, approvals, and CloudFormation stack operations. AWS Config (option B) evaluates resource configurations after deployment and provides only a single approver gate. Security Hub post-deployment checks (option C) detect issues after the change is already deployed to production — too late for the requirement to prevent non-compliant deployments. cfn-nag (option D) is a useful linter but single-approver and DynamoDB storage (not Object Lock) does not provide immutable logging.