AWS Cloud Practitioner (CLF-C02) · 30% practice allocation

AWS CLF-C02: Security and Compliance Practice Questions

5 free sample questions from the Security and Compliance domain, with answers and explanations. The full CLF-C02 bank has 250 questions across 4 domains. Questions are scenario-based and written from the official AWS exam guide.

1.

A company has a web application that is being targeted by SQL injection attacks and cross-site scripting (XSS) attempts. The security team wants to inspect and filter HTTP/HTTPS traffic at the application layer before it reaches the backend servers. Which AWS service should they implement?

  • A. AWS WAF✓ Correct
  • B. AWS Shield Advanced
  • C. VPC Network ACLs
  • D. Amazon GuardDuty
Explanation

Correct: 'AWS WAF' (Web Application Firewall) is designed to filter HTTP/HTTPS web traffic at the application layer (Layer 7). It provides managed rule groups specifically for SQL injection, XSS, and other OWASP Top 10 vulnerabilities. | Wrong: 'AWS Shield Advanced' protects against volumetric DDoS attacks at Layers 3 and 4; it does not inspect application-layer traffic for SQL injection or XSS patterns. | Wrong: 'Amazon GuardDuty' analyzes VPC Flow Logs, DNS logs, and CloudTrail for threat intelligence; it does not intercept or filter web traffic. | Wrong: 'VPC Network ACLs' operate at Layer 3/4 and can only filter by IP address, protocol, and port — they cannot inspect HTTP request payloads for injection attacks.

2.

A company needs to store database credentials, API keys, and other application secrets. They require automatic rotation of these secrets on a defined schedule and the ability to audit every time a secret is retrieved. Which service is purpose-built for this use case?

  • A. AWS KMS with automatic key rotation
  • B. AWS Systems Manager Parameter Store (Standard tier)
  • C. Amazon S3 with server-side encryption and bucket policies
  • D. AWS Secrets Manager✓ Correct
Explanation

AWS Secrets Manager is purpose-built for storing, retrieving, and automatically rotating secrets such as database credentials, OAuth tokens, and API keys. It integrates natively with RDS, Redshift, and DocumentDB for zero-downtime rotation and logs all access via CloudTrail. Systems Manager Parameter Store (Standard tier) can store secrets as SecureString parameters but does not provide built-in automatic rotation—that capability requires custom Lambda functions. AWS KMS rotates the underlying Customer Master Key material annually but does not store or rotate application-level secrets. Amazon S3 with encryption is suitable for object storage, not secrets management with automatic rotation.

3.

A new cloud administrator needs temporary access to an AWS account to perform a one-time database migration. The company's security policy requires that no long-term credentials be issued for this task. Which IAM feature best satisfies this requirement?

  • A. Create an IAM user with an access key and delete it after the migration
  • B. Share the root account credentials with the administrator for the duration of the task
  • C. Create an IAM role with the required permissions and have the administrator assume it✓ Correct
  • D. Add the administrator to an IAM group that has full database permissions
Explanation

IAM roles issue temporary security credentials (via AWS STS) that automatically expire, making them ideal for granting temporary access without long-term credentials. Creating an IAM user with an access key generates long-term credentials, which violates the policy even if deleted afterward. Sharing root credentials is a critical security anti-pattern and violates AWS best practices. Adding the user to an IAM group still requires creating a permanent IAM user with long-term credentials.

4.

A solutions architect is deploying a three-tier application in a VPC. They need to apply stateful firewall rules to control traffic to and from individual EC2 instances, and also apply stateless subnet-level traffic controls as an additional layer of defense. Which combination of services satisfies BOTH requirements?

  • A. Security groups for stateful instance-level control; Network ACLs for stateless subnet-level control✓ Correct
  • B. Network ACLs for stateful instance-level control; Security groups for stateless subnet-level control
  • C. AWS WAF for stateful instance-level control; AWS Shield for stateless subnet-level control
  • D. VPC Flow Logs for stateful instance-level control; Route tables for stateless subnet-level control
Explanation

Correct: 'Security groups for stateful instance-level control; Network ACLs for stateless subnet-level control' — security groups are stateful (return traffic is automatically allowed) and applied at the instance/ENI level. Network ACLs are stateless (return traffic must be explicitly allowed) and applied at the subnet level, providing an additional defense layer. | Wrong: The second option reverses the properties — Network ACLs are stateless and apply to subnets, not instances; security groups are stateful and apply to instances, not subnets. | Wrong: AWS WAF and AWS Shield are perimeter services for web traffic and DDoS protection respectively; they are not replacements for VPC-level security controls. | Wrong: VPC Flow Logs capture network traffic metadata for analysis but do not control or filter traffic. Route tables handle routing, not security filtering.

5.

A company wants to enforce a policy that prevents all member accounts in their AWS Organization from creating unencrypted Amazon S3 buckets. The policy must apply automatically to all current and future member accounts without requiring changes to individual account IAM policies. Which AWS feature should the security team use?

  • A. Create an AWS IAM policy in the management account and share it with all member accounts using AWS Resource Access Manager
  • B. Enable AWS Config with the 's3-bucket-server-side-encryption-enabled' managed rule in each account
  • C. Apply an IAM permission boundary to every IAM user in each member account
  • D. Attach a Service Control Policy (SCP) to the root of the AWS Organization✓ Correct
Explanation

SCPs attached to the root of an AWS Organization apply to every member account automatically, including accounts added in the future, and can deny actions such as creating unencrypted S3 buckets. IAM permission boundaries limit maximum permissions for individual principals but must be applied manually to each user/role and do not enforce organization-wide guardrails. AWS Config can detect and flag non-compliant buckets but is a detective control, not a preventive one—it cannot stop an account from creating an unencrypted bucket. IAM policies cannot be shared across accounts via RAM and have no authority over other accounts' principals.

Test yourself across every CLF-C02 domain

The free CLF-C02 practice test mixes about 20 questions weighted like the exam. The full 250-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

Security and Compliance study guide (CLF-C02) →

Other CLF-C02 domains

← All AWS Cloud Practitioner study resources