CCSP Cloud Platform and Infrastructure Security Practice Question
A cloud security team is using AWS Lambda functions to process sensitive data. The functions are triggered by Amazon S3 events and write to an Amazon DynamoDB table. The team wants to ensure that the Lambda functions have only the permissions they need and that any compromised function cannot access other AWS resources. Which of the following is the MOST effective approach?
⚠ Common exam trap
The trap here is thinking that a single role with broad permissions or resource-based policies are sufficient, when in fact per-function roles with least privilege are needed to contain a compromised function.
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 separate IAM role for each Lambda function with permissions scoped to only the specific S3 bucket and DynamoDB table it needs.
The most effective approach is to create a separate IAM role for each Lambda function with permissions scoped to only the resources that function needs. This enforces least privilege and ensures that a compromised function cannot access other AWS resources. Other options either grant excessive permissions, use insecure credential storage, or are overly permissive.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Attach a resource-based policy to the DynamoDB table that allows all Lambda functions in the account to write to it.
Why it's wrong here
A resource-based policy that allows all Lambda functions in the account is overly permissive. It does not restrict access to only the intended functions and violates least privilege. A compromised function could still write to the table, and the policy does not limit access to other resources. This approach does not provide the required isolation.
- ✓
Create a separate IAM role for each Lambda function with permissions scoped to only the specific S3 bucket and DynamoDB table it needs.
Why this is correct
Using a distinct IAM role per function with narrowly scoped permissions ensures that each function can only access its required resources. If one function is compromised, the attacker cannot use its role to access other resources. This is the most effective way to enforce least privilege and limit lateral movement.
- ✗
Use AWS Lambda environment variables to store IAM credentials and rotate them regularly.
Why it's wrong here
Storing long-term IAM credentials in environment variables is insecure because they can be exposed in logs or through misconfiguration. Lambda functions should use IAM roles for temporary credentials. Rotating credentials does not provide the fine-grained, per-function isolation that separate roles offer.
- ✗
Create a single IAM role with broad permissions to all necessary services and assign it to all Lambda functions.
Why it's wrong here
A single role with broad permissions violates the principle of least privilege. If one function is compromised, the attacker could use the role to access all resources the role permits, including those not needed by that function. This increases the blast radius and is not an effective isolation strategy.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
This CCSP question is part of Courseiva's 934-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official ISC2 exam blueprint
This CCSP practice question is part of Courseiva's free ISC2 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 CCSP exam.