Courseiva

CCSP Cloud Application Security Practice Question

A company is implementing a serverless application using AWS Lambda. The function processes S3 events and writes to a DynamoDB table. Which of the following is the MOST secure way to grant the necessary permissions?

⚠ Common exam trap

ISC2 often tests the misconception that resource-based policies on the Lambda function can grant the function permissions to other services, when in fact they only control invocation permissions, not the function's outbound access to resources like S3 or DynamoDB.

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 custom IAM role with only the required actions on specific resources

AWS Lambda functions require an IAM role (execution role) to access other AWS services. By creating a custom IAM role with only the required actions (e.g., s3:GetObject for the specific S3 bucket and dynamodb:PutItem for the specific DynamoDB table), you adhere to the principle of least privilege, minimizing the attack surface and ensuring secure, auditable access.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Use resource-based policies on the Lambda function

    Why it's wrong here

    Resource-based policies on Lambda govern who may invoke the function, not what the function itself can call, so they cannot grant S3 or DynamoDB access. They are tempting because they are the correct mechanism when an external account must invoke your function.

  • ✗

    Attach a managed policy that grants full access to S3 and DynamoDB

    Why it's wrong here

    A managed full-access policy grants far more than the S3 read and DynamoDB write the function needs, violating least privilege. It is tempting because AWS managed policies are quick to attach, and would suit throwaway development accounts where broad access is acceptable.

  • ✗

    Use the root user credentials of the AWS account

    Why it's wrong here

    Root credentials carry unrestricted account-wide power and cannot be scoped to S3 events or a single DynamoDB table, so any compromise is catastrophic. It is tempting for initial bootstrapping, where root is genuinely required to create the first IAM user.

  • ✓

    Create a custom IAM role with only the required actions on specific resources

    Why this is correct

    A custom IAM role grants only the specific S3 read and DynamoDB write actions on named resource ARNs, enforcing least privilege. Lambda assumes this role at runtime, avoiding broad managed policies or long-lived access keys embedded in the function.

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

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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.