DVA-C03 · 26% of the exam
Security practice questions
10 free Security questions for the AWS Certified Developer – Associate (DVA-C03) exam, each with the correct answer and an explanation for every option.
What this domain covers
Authentication, authorization and encryption from the application side, and a new DVA-C03 task on the security risks of AI services: who can call a model, how data reaches it privately, what gets filtered and what ends up in the logs.
- Exam weight
- 26%
- On a real exam
- ≈ 17 questions
- In our bank
- 191 questions
Topics that come up most
- IAM roles for Lambda, ECS and EC2, and assuming roles with STS
- Cognito user pools vs identity pools
- Presigned URLs for S3 and CloudFront signed URLs
- KMS envelope encryption and Secrets Manager
- Bedrock access with IAM and VPC endpoints
- Bedrock Guardrails, agent permissions and masking sensitive data in logs
How to study it
Know which credential each compute service uses by default, and never pick an answer that embeds long-lived keys in code. For AI questions, look for the IAM, network, filter or logging control, not a model choice.
Sample Security questions
Try each one before opening the answer. Original questions written to the official exam objectives.
Question 1
In Secrets Manager, what do the AWSCURRENT and AWSPREVIOUS staging labels represent during a secret rotation?
- AAWSCURRENT marks the version an application should currently retrieve and use; AWSPREVIOUS marks the prior version, kept briefly to support rollback or in-flight processes still using the old credential during rotation
- BThey have no functional meaning and are purely decorative labels
- CAWSPREVIOUS always represents a newer version than AWSCURRENT
- DThese labels only apply to secrets that are never rotated
Show answer and explanation
Answer: A) AWSCURRENT marks the version an application should currently retrieve and use; AWSPREVIOUS marks the prior version, kept briefly to support rollback or in-flight processes still using the old credential during rotation
- ADuring rotation, Secrets Manager creates a new secret version and moves the AWSCURRENT label to it once rotation completes successfully, while the previous version (still valid briefly, depending on the rotation strategy) keeps the AWSPREVIOUS label — giving a short grace period rather than an instantaneous hard cutover that could break in-flight operations.
- BThese labels have real functional meaning — applications retrieving "the current secret" specifically fetch the version labeled AWSCURRENT, and Secrets Manager's own rotation logic relies on them.
- CThis reverses their actual meaning — AWSCURRENT is the active, latest version; AWSPREVIOUS is the older one being phased out.
- DThese staging labels are specifically meaningful in the context of rotation — a secret that's never rotated typically only ever has the single AWSCURRENT version with no AWSPREVIOUS to speak of.
Question 2
A developer replicates an AWS Secrets Manager secret from us-east-1 to eu-west-1. The primary secret is encrypted with a customer managed KMS key in us-east-1. Which statement about encryption of the replica secret is correct?
- AThe replica is encrypted with a KMS key in eu-west-1: one the developer specifies, or that Region's aws/secretsmanager key if none is given.
- BThe replica must use the primary secret's key ARN, because Secrets Manager calls KMS in us-east-1 to decrypt the replica's value.
- CReplication fails unless the primary secret is first re-encrypted with aws/secretsmanager, because replicas can't use customer managed keys.
- DThe developer must create a multi-Region replica of the primary key in eu-west-1, because replicas can only use a related multi-Region key.
Show answer and explanation
Answer: A) The replica is encrypted with a KMS key in eu-west-1: one the developer specifies, or that Region's aws/secretsmanager key if none is given.
Each replica secret is encrypted with a KMS key in the replica's own Region. You can specify a key there, and if you don't, Secrets Manager uses the aws/secretsmanager AWS managed key.
- ACorrect. The encryption key for a replica is optional and must be in the replica Region. If ReplicaRegionType omits KmsKeyId, Secrets Manager uses the AWS managed key aws/secretsmanager.
- BIncorrect. A replica is encrypted with a KMS key in its own Region. The docs say the selected key must be in the replica Region, not the primary Region.
- CIncorrect. Secrets Manager replicates secrets that are encrypted with customer managed keys. You can also choose a customer managed key in the replica Region to encrypt the replica.
- DIncorrect. A multi-Region key isn't required. Any suitable KMS key in the replica Region can be specified, and if none is given, aws/secretsmanager is used.
Question 3
A company wants an internal API Gateway REST API to be reachable only from within their VPC, not from the public internet at all, with access further restricted to specific VPC endpoints. How is this achieved?
- AConfigure the API as a Private API type, associated with specific VPC endpoints, and use a resource policy restricting access to those endpoint(s)
- BA standard public REST API with no additional configuration
- CEnabling S3 Transfer Acceleration on the API
- DThis isn't possible; API Gateway APIs are always publicly reachable
Show answer and explanation
Answer: A) Configure the API as a Private API type, associated with specific VPC endpoints, and use a resource policy restricting access to those endpoint(s)
- AA Private API is only reachable through an interface VPC endpoint for API Gateway, and a resource policy can further restrict which specific VPC endpoint(s) are allowed to invoke it — together fully removing public internet reachability while scoping access to approved private network paths.
- BA default public REST API is reachable over the internet, the opposite of the private-only requirement described — the Private API type with VPC endpoint association is what's needed.
- CTransfer Acceleration is an S3 feature for speeding up transfers; it has no relationship to restricting an API Gateway API to private VPC-only access.
- DPrivate APIs are an explicitly supported API Gateway endpoint type for exactly this VPC-only access model — this option is factually incorrect.
Question 4
An EC2 instance profile role has an identity-based policy that allows kms:Decrypt on a specific customer managed KMS key in the same account. The key was created with a custom key policy. That policy grants access only to a key administrator role: it doesn't name the instance role, and it has no statement that allows the account principal (arn:aws:iam::<account-id>:root). What happens when an application on the instance reads an S3 object encrypted with this key?
- AThe request is denied, because the key policy neither names the role nor allows the account principal, so the role's IAM policy has no effect on this key
- BThe request is allowed, because within one account an Allow in the identity-based policy is sufficient even when the resource-based policy is silent
- CThe request is allowed, because S3 calls KMS with its own service permissions, so the role's access to the KMS key is not evaluated
- DThe request is denied, because key policies cannot give IAM roles cryptographic permissions and only KMS grants can authorize Decrypt
Show answer and explanation
Answer: A) The request is denied, because the key policy neither names the role nor allows the account principal, so the role's IAM policy has no effect on this key
A KMS key policy is the primary access control for the key. An IAM policy can grant use of the key only if the key policy delegates to IAM by allowing the account principal. Here the key policy neither names the role nor enables IAM, so the decrypt request is denied.
- ACorrect. Unlike most resource policies, a KMS key policy doesn't automatically give permission to the account or its identities. IAM policies can grant access to a key only when the key policy delegates to IAM through a statement that allows the account principal. Without that statement, an IAM Allow is ineffective. The fix is to add the role to the key policy or add the account-principal statement.
- BIncorrect. The same-account union rule doesn't override KMS's own requirement. KMS key policies must explicitly allow access, either directly or by delegating to IAM through the account principal, and this key policy does neither.
- CIncorrect. When S3 decrypts an SSE-KMS object, it calls KMS on behalf of the requester. The requesting principal still needs permission to use the key, and that permission is evaluated against the key policy.
- DIncorrect. Key policies can name IAM roles directly as key users with kms:Decrypt, as the console's default key users statement does. Grants are one option, not the only way to authorize cryptographic operations.
Question 5
An application in private subnets of a company's VPC must call a third-party SaaS vendor's API. The vendor offers its API as an endpoint service powered by AWS PrivateLink and has granted the company access. The traffic must not traverse the public internet. What should the developer create in the company's VPC?
- AAn interface VPC endpoint in the application subnets that connects to the vendor's endpoint service
- BA gateway VPC endpoint with a route table entry that targets the vendor's endpoint service
- CA VPC peering connection to the vendor's VPC with routes to the vendor's API load balancer
- DA NAT gateway in a public subnet with a route from the application subnets to the vendor's API
Show answer and explanation
Answer: A) An interface VPC endpoint in the application subnets that connects to the vendor's endpoint service
To consume a provider's PrivateLink endpoint service, create an interface VPC endpoint in your VPC. Gateway endpoints only support S3 and DynamoDB, and neither VPC peering nor NAT is how you use a PrivateLink service.
- ACorrect. With PrivateLink, the service provider creates an endpoint service and grants consumers access. The consumer then creates an interface VPC endpoint, which places endpoint network interfaces in its subnets and connects them privately to the endpoint service.
- BIncorrect. Gateway endpoints are available only for Amazon S3 and DynamoDB, and they don't use AWS PrivateLink. They can't connect to a third-party endpoint service.
- CIncorrect. VPC peering connects two entire VPCs, requires non-overlapping CIDR ranges, and the vendor must accept it. It isn't how consumers reach a PrivateLink endpoint service, which is designed to expose only the service through an interface endpoint.
- DIncorrect. A NAT gateway sends traffic out through an internet gateway to the vendor's public endpoint. It doesn't use the vendor's PrivateLink service, so it doesn't meet the private-connectivity requirement.
Question 6
A multi-tenant service encrypts every tenant's documents with one symmetric customer managed KMS key. Worker tasks all assume one shared role and pass a session tag tenant=<id>. Each Encrypt call includes the encryption context {"tenant": "<id>"}. Security requires that a worker session can decrypt only its own tenant's data, without creating a key, a role or a policy statement per tenant. Which control meets this requirement?
- ACreate a grant per tenant with an EncryptionContextEquals constraint, and give each worker its tenant's grant token
- BRely on the encryption context itself, because KMS rejects a Decrypt call whose context belongs to a different tenant
- CAllow kms:Decrypt only when kms:EncryptionContext:tenant equals ${aws:PrincipalTag/tenant}
- DAdd a kms:ViaService condition for the service's endpoint so that only the service can decrypt
Show answer and explanation
Answer: C) Allow kms:Decrypt only when kms:EncryptionContext:tenant equals ${aws:PrincipalTag/tenant}
Combine encryption context condition keys with session tag policy variables for per-tenant KMS authorization on a shared key.
- AIncorrect. This needs a grant per tenant. Because every worker uses the same role, each grant applies to all workers, so it doesn't isolate tenants.
- BIncorrect. The context must match the one used at encryption, but any caller can supply the right tenant's context. It provides integrity, not access control.
- CCorrect. The condition compares the context in each Decrypt request with the session's tenant tag. One policy statement then limits every session to its own tenant's data.
- DIncorrect. kms:ViaService limits which AWS service can make the call on a principal's behalf. It doesn't separate tenants that share one role.
Question 7
A team is replacing its custom login form, which collects user passwords and forwards them to its backend, with Amazon Cognito user pool managed login pages (formerly the hosted UI). What security benefit does this change provide?
- AUsers type credentials on pages served from the user pool domain, and the app receives an authorization code or tokens
- BCognito places its session cookie on the application's own domain, which shields the app's pages from cross-site scripting
- CThe backend can trust tokens from the managed login domain without verifying their RS256 signatures on each request
- DUsers can change their MFA preferences and profile attributes on the managed login pages, so the app no longer handles them
Show answer and explanation
Answer: A) Users type credentials on pages served from the user pool domain, and the app receives an authorization code or tokens
With Cognito managed login (or the classic hosted UI), users enter credentials on Cognito-hosted pages and the app receives only a code or tokens, never the raw password. The app still has to verify tokens and build its own profile management, and Cognito's cookies are scoped to the user pool domain.
- ACorrect. Managed login pages on the user pool domain handle sign-in. After authentication, Cognito redirects to the app's callback URL with an authorization code or tokens, so the app's own code no longer collects or forwards raw passwords.
- BIncorrect. Cookies set by managed login (such as the cognito session cookie and the XSRF-TOKEN cookie) are scoped only to the user pool endpoints, not to the app's domain. They don't protect the application's pages from XSS.
- CIncorrect. User pool tokens are signed with RS256, and the application or API still needs to decode and verify them. Using managed login doesn't remove the need for token validation.
- DIncorrect. Managed login supports completing sign-in with MFA, but it doesn't support self-service profile management such as attribute changes or setting MFA preferences. The app still has to implement those features.
Question 8
Which statement correctly describes the difference between the enhanced (simplified) flow and the basic (classic) flow in an Amazon Cognito identity pool?
- AEnhanced calls GetId, then GetCredentialsForIdentity, and the identity pool picks the IAM role. Basic calls GetId, GetOpenIdToken and STS AssumeRoleWithWebIdentity, and the app picks the role.
- BEnhanced skips GetId and passes the provider token straight to GetCredentialsForIdentity. Basic must call GetId first to get an identity ID before it can request credentials.
- CBasic lets the identity pool choose the role through role mappings. Enhanced requires the app to call STS AssumeRoleWithWebIdentity itself with a role ARN it selects.
- DEnhanced accepts only Amazon Cognito user pool tokens for authenticated users. Basic is required for unauthenticated guest identities and for SAML or social providers.
Show answer and explanation
Answer: A) Enhanced calls GetId, then GetCredentialsForIdentity, and the identity pool picks the IAM role. Basic calls GetId, GetOpenIdToken and STS AssumeRoleWithWebIdentity, and the app picks the role.
Both flows start with GetId. The enhanced flow then calls GetCredentialsForIdentity and lets the identity pool choose the role. The basic flow adds GetOpenIdToken and STS AssumeRoleWithWebIdentity, and the client has to choose the role. AWS recommends not turning on the basic flow for new identity pools.
- ACorrect. Both flows start with GetId. In the enhanced flow, GetCredentialsForIdentity returns AWS credentials and the identity pool configuration (default role, RBAC or ABAC) chooses the role. In the basic flow, the app exchanges a Cognito OpenID token with AWS STS and has to contain its own role-selection logic.
- BIncorrect. The enhanced flow also calls GetId first. It then passes the returned identity ID and the same proof of authentication to GetCredentialsForIdentity.
- CIncorrect. This reverses the two flows. The basic flow isn't supported in identity pools that have role mappings, and it is the basic flow that calls AssumeRoleWithWebIdentity. The enhanced flow lets the identity pool choose the role.
- DIncorrect. Neither flow is tied to a particular provider type or to guest access. Both start with GetId, which supports unauthenticated identities and tokens from user pools, OIDC, SAML and social providers.
Question 9
A company creates an Amazon S3 interface VPC endpoint (AWS PrivateLink) so that applications in a VPC can reach S3 privately. The company wants requests sent through this endpoint to reach only one specific bucket, even if a caller's IAM permissions allow access to other buckets. What should a developer configure?
- AAn endpoint policy on the interface endpoint that allows S3 actions only on the bucket's ARN and its objects
- BA security group on the endpoint's network interfaces that allows HTTPS only for that bucket
- CA network ACL on the endpoint's subnets that denies traffic bound for other buckets
- DPrivate DNS on the endpoint so that only that bucket's hostname resolves to private IPs
Show answer and explanation
Answer: A) An endpoint policy on the interface endpoint that allows S3 actions only on the bucket's ARN and its objects
Use a VPC endpoint policy to restrict which S3 resources can be reached through an endpoint, for example by allowing only a single bucket's ARN. Security groups, network ACLs and DNS settings work at the network layer and can't filter requests by bucket.
- ACorrect. An endpoint policy is a resource-based policy attached to the VPC endpoint. It controls which principals, actions and resources can be used through that endpoint. AWS documents an example S3 endpoint policy that limits access to a single bucket's ARN. The endpoint policy works together with IAM and bucket policies rather than replacing them.
- BIncorrect. Security groups filter traffic by protocol, port and IP address or source. They can't tell which bucket an S3 request is for, so they can't limit the endpoint to one bucket.
- CIncorrect. Network ACLs are stateless filters based on IP address and port at the subnet level. Every bucket is reached through the same endpoint network interfaces, so a NACL can't tell one bucket from another.
- DIncorrect. Private DNS makes the Regional S3 DNS names resolve to the endpoint's private IP addresses so clients don't need endpoint-specific names. It controls how traffic is routed, not which buckets can be accessed, and it can't be limited to one bucket.
Question 10
A development team needs X.509 certificates for mutual TLS between internal microservices. The certificates must be trusted only inside the company's own environment, not by public browsers. The team does not want to build or maintain on-premises certificate authority infrastructure. Which AWS service meets these requirements?
- AAWS Private Certificate Authority (AWS Private CA), used to create a managed private root and subordinate CA hierarchy
- BAWS Certificate Manager public certificates, requested with DNS validation for each internal service hostname
- CAWS KMS asymmetric keys, used by custom application code that signs certificate requests for each service
- DIAM server certificates, uploaded to IAM and referenced by each microservice for mutual TLS
Show answer and explanation
Answer: A) AWS Private Certificate Authority (AWS Private CA), used to create a managed private root and subordinate CA hierarchy
AWS Private CA (formerly ACM Private CA) provides a managed private CA hierarchy. It issues certificates that are trusted only internally, such as for mTLS, without on-premises CA infrastructure.
- ACorrect. AWS Private CA lets you create private CA hierarchies (root and subordinate CAs) without the cost of running an on-premises CA. Its certificates are trusted only where you distribute the private root, and it supports use cases such as TLS channels and authenticating API endpoints.
- BIncorrect. Public ACM certificates chain to a publicly trusted CA and require domain validation. They do not meet the requirement for certificates that are trusted only internally.
- CIncorrect. KMS can store signing keys, but the team would have to build and operate the CA logic themselves, including issuance, revocation, and the hierarchy. The requirements rule that out.
- DIncorrect. IAM can only store certificates that were obtained elsewhere. It does not issue certificates or act as a certificate authority.
Security: FAQs
How much of the DVA-C03 exam is Security?
Security is 26% of the DVA-C03 exam by the official exam guide's weighting, which on a 65-question form works out to roughly 17 questions. The real exam's exact split varies by form.
What does the Security domain cover?
Authentication, authorization and encryption from the application side, and a new DVA-C03 task on the security risks of AI services: who can call a model, how data reaches it privately, what gets filtered and what ends up in the logs.
How should I study Security for DVA-C03?
Know which credential each compute service uses by default, and never pick an answer that embeds long-lived keys in code. For AI questions, look for the IAM, network, filter or logging control, not a model choice.
Where can I practise more Security questions?
This page has 10 free Security questions with answers. CertRidge's DVA-C03 question bank has 191 questions in this domain. Every practice exam result breaks your score down by domain, and Review Mode re-drills the questions you missed.
Get Security exam-ready
The full DVA-C03 bank has 191 Security questions. Timed practice exams match the real exam's length and domain weights, every result shows your score per domain, and Review Mode re-drills the questions you missed.
Not affiliated with AWS; questions are original and never copied from the real exam.