Courseiva
Data ProtectionmediumMultiple SelectObjective-mapped

Restrict KMS Key to VPC

A company is using AWS KMS to encrypt data in Amazon S3. They need to ensure that the KMS key can only be used from within a specific VPC. Which TWO actions should be taken?

Quick Answer

The correct answer is to modify the KMS key policy to include a condition on `kms:SourceVpc` and to create a VPC endpoint for KMS. This works because the key policy condition restricts the cryptographic operation to requests originating from the specified VPC, while the VPC endpoint ensures that all KMS traffic stays within the AWS network and never traverses the public internet. On the AWS Certified Security Specialty SCS-C02 exam, this scenario tests your understanding of the difference between resource-based policies (key policies) and identity-based policies (IAM), as well as the specific condition keys available for KMS. A common trap is to assume an S3 bucket policy or a VPC endpoint for S3 can restrict KMS usage—they cannot, because KMS calls are separate from S3 data plane calls. Remember the mnemonic: "Key policy, not bucket policy, for KMS VPC lockery."

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Create a VPC endpoint for AWS KMS.

A VPC endpoint for AWS KMS allows KMS API calls to be routed through the VPC, ensuring traffic does not traverse the public internet. Option E is correct because you can modify the KMS key policy to include a condition using the kms:SourceVpc key, which restricts use of the KMS key to requests originating from the specified VPC. Option B is incorrect because IAM policies cannot directly restrict based on VPC for KMS; such restrictions must be in the key policy. Option C is incorrect because a VPC endpoint for Amazon S3 does not restrict KMS calls. Option D is incorrect because S3 bucket policies control access to S3 objects, not KMS key usage.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create a VPC endpoint for AWS KMS.

    Why this is correct

    Enables private connectivity to KMS from the VPC.

  • Attach an IAM policy to the role that denies kms:Decrypt unless the request comes from the VPC.

    Why it's wrong here

    IAM policies cannot enforce VPC restrictions for KMS; key policy can.

  • Create a VPC endpoint for Amazon S3.

    Why it's wrong here

    S3 endpoint does not restrict KMS calls.

  • Add a bucket policy condition to restrict access to the VPC.

    Why it's wrong here

    Bucket policy controls S3 access, not KMS key usage.

  • Modify the KMS key policy to include a condition on kms:SourceVpc.

    Why this is correct

    This restricts use of the key to requests originating from the specified VPC.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 376 original SCS-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on SCS-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company is using AWS KMS to encrypt sensitive data in Amazon DynamoDB. The security team wants to ensure that the KMS key can only be used from within the company's VPC and not from the internet. The VPC has an interface VPC endpoint for KMS. What should the security team do to enforce this restriction?

easy
  • A.Make the KMS key Regional and disable cross-Region access
  • B.Use security group rules to restrict access to the KMS endpoint
  • C.Create an S3 bucket policy that restricts access to the KMS key
  • D.Attach a VPC endpoint policy that denies access from outside the VPC

Why D: Attaching a VPC endpoint policy to the KMS interface VPC endpoint can deny requests that originate from outside the VPC, ensuring that the KMS key is only used from within the VPC. Option A is wrong because making the KMS key regional does not restrict network access; it only limits the key to a single region. Option B is wrong because security group rules apply to network traffic at the instance level, not to KMS API operations; they cannot restrict access to the KMS endpoint itself. Option C is wrong because an S3 bucket policy is used to control access to S3 resources, not KMS keys. Therefore, D is the correct answer.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SCS-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SCS-C02 exam.