DVA-C02 practice question · Security
A company wants its Lambda functions to accept only deployment packages that its approved CI/CD pipeline has signed.
A company wants its Lambda functions to accept only deployment packages that its approved CI/CD pipeline has signed. Any other package must be rejected at deployment time, even if the principal deploying it has IAM permission to update the function code. Which configuration meets this requirement?
- AAttach a code signing configuration that lists the pipeline's AWS Signer signing profile and sets the untrusted-artifact policy to Enforce
- BAttach a code signing configuration that lists the pipeline's AWS Signer signing profile and keeps the untrusted-artifact policy at its default
- CCreate an EventBridge rule on CloudTrail UpdateFunctionCode events that alerts when a principal other than the pipeline role deploys code
- DRequire deployments to come from an S3 bucket with versioning and Object Lock enabled that only the pipeline role can write to
Show the answer and explanation
Correct answer: A) Attach a code signing configuration that lists the pipeline's AWS Signer signing profile and sets the untrusted-artifact policy to Enforce
To make Lambda reject untrusted code at deployment, use a code signing configuration that lists trusted AWS Signer signing profiles and sets UntrustedArtifactOnDeployment to Enforce. The default Warn setting only logs the failure and still deploys the package.
Why each option is right or wrong
- A) Correct. When a function has a code signing configuration, Lambda checks every new deployment against the allowed AWS Signer signing profiles. With UntrustedArtifactOnDeployment set to Enforce, Lambda blocks packages that fail the signature checks, whatever IAM permissions the deploying principal has.
- B) Incorrect. The default UntrustedArtifactOnDeployment action is Warn. Lambda still deploys the package and only emits a SignatureValidationErrors metric and a CloudTrail entry, so untrusted code isn't rejected.
- C) Incorrect. This only detects a deployment after it happens. It doesn't check the package's signature and doesn't stop an untrusted package from being deployed.
- D) Incorrect. This protects stored artifacts, but Lambda doesn't verify where the code came from. A principal with update permissions could still upload a .zip file directly or point to another bucket.
- Exam domain
- Security · 26% of DVA-C02
- Question type
- Multiple choice (one answer)
Related DVA-C02 questions
- A company's compliance requirement states that CloudTrail logs must not be deletable or modifiable by any user…Security
- A Lambda function's resource-based policy allows the s3.amazonaws.com service principal to invoke the function in…Security
- A mobile application authenticates users via a third-party OpenID Connect provider directly (not through Cognito user…Security
- A company wants Cognito to support a custom, non-password authentication flow, such as a one-time code sent via a…Security
All 67 free DVA-C02 questions by domain · 15 sample questions on one page
Practise the full DVA-C02 exam
This question is one of a small free sample from the CertRidge DVA-C02 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.
Original question written from the official exam guide. Not affiliated with AWS; never copied from the real exam.
Worth reading: DVA-C02 cheat sheet, Lambda, DynamoDB, API Gateway, IAM and Cognito, messaging, CI/CD and X-Ray in tables, plus what DVA-C03 changes.