Chapter 2

Security

AWS Certified Developer – Associate (DVA-C03) Study GuideDomain 2 · 26% of the examBased on the official DVA-C03 exam objectives

Security is the second-largest domain on the DVA-C03 exam at 26% of the scored content. It tests whether you can build applications that authenticate users correctly, authorize access with least privilege, protect data with the right encryption and secrets tooling, and keep traffic off the public internet. DVA-C03 also reorganizes this domain: the older encryption and sensitive-data tasks are merged into a single task, and a new task - Task 2.3 - covers securing applications that integrate AI services such as Amazon Bedrock. That AI security material is covered in section 2.4 and is genuinely new, so give it more study time than its size suggests.

Everything in this chapter follows one principle you will see repeated in exam questions: grant the minimum access needed, for the minimum time needed, and protect data at every layer - in transit, at rest, and in your logs.

2.1 IAM for developers

AWS Identity and Access Management (IAM) is the foundation of every security question on this exam. As a developer you rarely administer IAM for a whole organization, but you constantly write policies, create roles for your code, and debug access-denied errors. The exam expects you to do all three fluently.

Principals, policies, and roles

A principal is the entity making a request: an IAM user, an IAM role session, a federated user, or an AWS service.

Requests are evaluated against policies, which are JSON documents containing statements with an effect (Allow or Deny), actions, resources, and optional conditions.

The policy types you must be able to distinguish are:

Policy typeIdentity-based policyResource-based policy
Permissions boundarySession policyService control policy (SCP)
Resource control policy (RCP)Attached toA user, group, or role
A resource (S3 bucket, KMS key, SQS queue, Lambda function)A user or rolePassed when assuming a role or federating
An AWS Organizations accountAn AWS Organizations accountPurpose
Grants permissions to that identityGrants access to named principals; can grant cross-account access without a roleSets the maximum permissions the identity can ever have; grants nothing by itself
Narrows the permissions of that session onlySets the maximum permissions available in the account; grants nothingSets the maximum permissions on resources in the account

Two facts are tested relentlessly. First, boundaries and SCPs never grant permissions - they only cap them. A role with an administrator identity policy but a restrictive permissions boundary has only the boundary's permissions. Second, resource-based policies are the only way to grant cross-account access to a principal directly; an identity policy in account A cannot grant a user in account B anything unless the resource in account

B also trusts that principal (or the user assumes a role in account B).

How a request is evaluated

When a request arrives, IAM evaluates it in a defined order. You do not need to memorize the full flowchart, but you do need the decision logic:

1. Explicit Deny wins over everything. If any applicable policy contains a Deny for the action and resource, the request is denied, no matter what else allows it.

2. Organization SCPs and RCPs are evaluated next; if they do not allow the action, the request stops there.

3. Resource-based policies on the target resource are evaluated; for same-account access, an allow in a resource-based policy can be sufficient on its own.

4. A permissions boundary, if present, must allow the action.

5. A session policy, if present, must allow the action.

6. Finally, an identity-based policy must allow the action (for same-account resource-based access, step 3 may already have allowed it).

The practical debugging sequence mirrors this: when code gets an AccessDenied error, look first for an explicit deny, then check whether the identity policy actually allows the action on that exact resource ARN, and only then suspect boundaries or SCPs.

Exam tip
Definition

IAM policy evaluation. The process AWS uses to decide whether a request is allowed: every applicable policy

(SCPs, RCPs, resource-based policies, permissions boundaries, session policies, and identity policies) is evaluated together, an explicit Deny in any of them overrides every Allow, and the request succeeds only if the combined result allows it. It matters to developers because most AccessDenied errors are evaluation outcomes - a cap or a deny somewhere in the chain - not missing permissions in the one policy you are looking at.

Roles and least privilege

Long-lived IAM users with embedded access keys are an anti-pattern the exam wants you to eliminate.

If a question says a user has an Allow policy but is still denied, the expected answer is almost always an explicit

Deny somewhere, a permissions boundary, or an SCP. IAM is eventually consistent - changes take a short time to replicate - but a lasting denial comes from policy evaluation, not propagation.

Applications running on AWS should use IAM roles:

DynamoDB, SQS, or S3. Attach the policy to the role, never embed credentials in function code or environment variables.

task execution role, which the ECS agent uses to pull images and write logs. Confusing these two roles is a classic exam trap: if the container starts but the application cannot call DynamoDB, the task role is wrong; if the container never starts, check the execution role.

service. Prefer IMDSv2 (token-based) and note that applications retrieve temporary credentials automatically through the SDK.

Least privilege tooling the exam expects you to know:

its unused access findings flag roles, users, and permissions that have not been used. External access findings show which of your resources are accessible from outside your account or organization.

before you deploy.

let you narrow a statement without creating more policies.

AWS STS and temporary credentials

The AWS Security Token Service (STS) issues short-lived credentials: an access key ID, a secret access key, and a session token. Every role assumption and every federated sign-in produces temporary credentials. Key operations and limits:

STS operationAssumeRoleAssumeRoleWithSA ML
AssumeRoleWith- WebIdentityGetSessionTokenGetFederationToken
Used forCode or users taking a role (same or cross-account)SAML 2.0 federation
OIDC federation (mobile/web apps, EKS IRSA)IAM users, often with MFAProxy applications brokering access
Session durationDefault 1 hour; maximum 12 hours (43,200 seconds)Default 1 hour; maximum 12 hours
Default 1 hour; maximum 12 hoursUp to 36 hours (129,600 seconds) for IAM user credentialsUp to 36 hours

Details that appear in questions:

revoked individually before expiry (you can deny sessions created before a point in time using the

aws:TokenIssueTime condition on the role's trust or attached policies).

asks for.

the other account; a principal in the trusted account needs an identity policy allowing sts:AssumeRole on that role's ARN. Both sides are required.

Common trap: A trust policy alone does not grant anyone access. It only says who may assume the role. The caller's own account must also allow the sts:AssumeRole call.

Core concept

Permissions boundaries, SCPs, RCPs, and session policies only ever narrow access - they grant nothing by themselves. A principal's effective permissions are the intersection of every applicable cap and an Allow in an identity-based or resource-based policy, so a generous identity policy cannot rescue a request that a boundary or SCP does not allow. Students commonly treat these layers as alternatives ("the policy allows it, so the boundary doesn't matter"), but evaluation requires all of them to permit the action.

2.2 Amazon Cognito and API authorization

User pools vs identity pools

Amazon Cognito has two components with confusingly similar names and completely different jobs. Getting this distinction right is worth several questions by itself.

JobActs as
ReturnsAccepts sign-in fromIAM involved?
Cognito user poolAuthentication - who the user isA user directory and OIDC/SAML identity provider
JSON Web Tokens (ID token, access token, refresh token)Its own users, plus federated SAML/OIDC providers and social providers (Google, Apple, Facebook, Amazon)No AWS credentials are issued
Cognito identity poolAuthorization - what AWS resources the user can accessA credential broker (federated identities)
Temporary AWS credentials via STSUser pools, social providers, SAML/OIDC providers, developer-authenticated identitiesMaps identities to IAM roles (authenticated role, unauthenticated/guest role)
Cognito user poolCognito identity pool
Typical useSign-up/sign-in for web and mobile apps; securingGranting a signed-in user's app direct, scoped
API Gateway and ALB endpointsaccess to S3, DynamoDB, AppSync

A standard exam architecture uses both: the app authenticates against a user pool, sends the resulting ID token to the identity pool, and receives temporary credentials scoped to an IAM role - for example, permissions to read only the user's own prefix in an S3 bucket, enforced with a policy variable such as

${cognito-identity.amazonaws.com:sub}.

User pool facts to know precisely:

token carries scopes and is used to authorize calls to APIs and to the user pool itself; the refresh token obtains new ID and access tokens without a new sign-in.

from 1 hour to 10 years (default 30 days).

token can drive authorization logic in your API.

challenges, pre token generation (to add claims), post authentication logging, and custom messages for verification codes.

compromised-credential checks are part of Cognito's advanced security features.

implicit grants, plus logout.

Exam tip

Questions asking how an application gets AWS credentials for a signed-in user always resolve to the identity pool. Questions asking how an API verifies who the caller is resolve to the user pool (or another JWT issuer).

Definition

Cognito user pool vs identity pool. A user pool is a user directory that authenticates users and issues JSON

Web Tokens (ID token, access token, refresh token); an identity pool (federated identities) exchanges an authenticated identity - from a user pool or another provider - for temporary AWS credentials tied to an IAM role. The distinction matters because the two solve different problems: sign-in and token validation belong to the user pool, while giving the app scoped AWS permissions belongs to the identity pool.

Authorizing API Gateway APIs

REST APIs in Amazon API Gateway support several authorization mechanisms, and the exam tests whether you can pick the right one for a stated caller type.

Mecha- nismIAM author- ationCognito author- erLambda author- er
Resource policyCallerAWS principals (services, roles, federated users)App users
AnySource-based controlHow it worksRequests are signed with Signature Version 4 using the caller's credentials
API Gateway validates the user pool JWT itselfYour function inspects a token (TOKEN type) or the full request (REQUEST type) and returns an IAM policy documentAllow/deny by source IP, VPC, or VPC endpointChoose when
Internal/service-to-service APIs; callers already have AWS identitiesYour users live in a Cognito user pool and token validation is all you needCustom identity providers, third-party OAuth, or authorization logic based on headers/path/claimsRestricting an API to a VPC endpoint or allowlisted IPs, regardless of auth method

Numbered walkthrough - how a Lambda authorizer request flows:

1. The client calls the API with a token (typically in the Authorization header).

2. API Gateway invokes your authorizer function with the token (TOKEN type) or the full request context

(REQUEST type).

3. Your function validates the token - signature, issuer, expiry, claims - and builds an IAM policy document allowing or denying API methods.

4. API Gateway evaluates the returned policy and either forwards the request to the integration or returns

401/403.

5. Results are cached by token (default TTL 300 seconds, configurable up to 3,600) so the function is not invoked on every call. A consequence: a revoked token may still work until the cache entry expires.

Key traps and details:

authorized; a policy that allows only one method will deny others even with a valid token. Returning a policy covering the whole API stage (execute-api:/stage/*/*) is the usual pattern when caching is enabled.

the Cognito-specific authorizer type or IAM in exactly the same way as REST APIs - when a question specifies HTTP API plus a user pool, "JWT authorizer" is the expected term.

mechanism and should never be the answer to "how do you secure this API."

question requires certificate-based client identity.

Core concept

A Lambda authorizer does not run on every request. API Gateway caches the policy it returns, keyed by the caller's token (default TTL 300 seconds), and reuses that cached decision for subsequent calls with the same token. Students often assume revoking a token or tightening the authorizer takes effect immediately; in reality, a previously allowed token can keep working until its cache entry expires, which is a deliberate performance trade-off you must design around.

Check yourself

1. Your mobile app signs users in with a Cognito user pool and then needs to let each signed-in user upload files only to their own prefix in an S3 bucket. What additional component do you configure, and what does it hand back to the app?

2. A Lambda authorizer protects a REST API with the default cache TTL. A user's access is revoked, yet their API calls keep succeeding for a few more minutes. Why?

Answers: 1. A Cognito identity pool - it exchanges the user pool token for temporary AWS credentials tied to an IAM role whose policy is scoped to the user's own prefix. 2. Authorizer results are cached by token (default

300 seconds), so the previously returned Allow policy is reused until the cache entry expires.

2.3 Encryption and sensitive data

In DVA-C03, encryption and sensitive-data protection are one merged task. The exam expects you to choose the right key type, the right store for each kind of secret, and the right S3 encryption option - and to explain the trade-offs when a question imposes a constraint such as "the compliance team must be able to audit every key use" or "rotate this credential automatically."

AWS KMS and envelope encryption

AWS Key Management Service (KMS) creates and controls encryption keys. The data keys and key material concepts are heavily tested.

Key ownership types:

Key typeAWS owned keyCreated byAWS, inside a serviceManaged by
AWS entirely; you never see itKey policy controlNone visible to youCost notesNo charge; used by services across accounts
Key typeAWS managed keyCustomer managed key (CMK)
Created byAWS, in your account (e.g. aws/s3, aws/lambda)You, in your accountManaged by
AWS rotates automatically (yearly); you cannot change the key policy or disable itYou control the policy, rotation, grants, aliases, deletionKey policy controlViewable, not editable
Full control via key policyCost notesNo monthly key fee; per-request charges applyMonthly fee per key plus per-request charges

Non-negotiable KMS facts:

which is what makes IAM policies able to delegate key permissions. If a key policy does not enable IAM delegation and grants no one access, the key becomes unmanageable.

and a key policy that does not deny it. Cross-account use always requires the key policy in the key's account to allow the external principal.

delegate limited key use to a grantee principal for a bounded set of operations; grants can be retired or revoked and are how services act on your behalf without key policy edits.

deletion can be cancelled. The safer alternative for "stop using this key now" scenarios is disabling the key, which takes effect immediately and is reversible.

material, so data encrypted in one Region can be decrypted in another without re-encryption - the exam frames this around disaster recovery and global applications.

eu-west-1 cannot be used in us-east-1.

Envelope encryption is the pattern behind almost every encryption question. KMS itself only encrypts small amounts of data directly (the Encrypt API accepts at most 4 KB of plaintext), so services encrypt bulk data as follows:

1. The application or service calls GenerateDataKey, naming a KMS key.

2. KMS returns a plaintext data key and the same data key encrypted under the KMS key.

3. The application encrypts its data locally with the plaintext data key (for example, AES-256-GCM), then

Automatic key rotation is available for customer managed symmetric keys: when enabled, KMS rotates the backing key material on a schedule you set - 365 days by default, configurable from 90 to 2,560 days - and on demand. Old material is kept to decrypt older ciphertext, and rotation never changes the key ID or ARN.

Asymmetric and HMAC keys cannot be rotated automatically; AWS managed keys rotate annually.

discards the plaintext key from memory.

4. The encrypted data key is stored alongside the ciphertext.

5. To decrypt, the application sends the encrypted data key to KMS (Decrypt), receives the plaintext data key, and decrypts the data locally.

Data itself never passes through KMS. This is why KMS request quotas are rarely the bottleneck in a well-designed system, and why caching a data key briefly (as the AWS Encryption SDK does with its cryptographic materials cache) reduces KMS calls - at the cost of reusing a key for more than one object. One encryption-context detail worth knowing: the encryption context is a set of key-value pairs cryptographically bound to the ciphertext and written to CloudTrail logs, making it the standard way to add audit context to KMS calls.

Exam tip

"Audit every use of the key" or "control access independently of the bucket policy" always points to a customer managed key, because only CMKs give you an editable key policy and per-key CloudTrail events under your control. "No key management overhead" points to AWS managed keys.

Definition

Envelope encryption. Encrypting data with a data key, then encrypting that data key under a KMS key and storing the encrypted data key alongside the ciphertext. It matters because KMS encrypts at most 4 KB of plaintext directly, so envelope encryption is how applications and services protect data of any size while keeping key use centralized, auditable, and controllable in KMS.

TLS and data in transit

deploys them to integrated services such as Elastic Load Balancers, CloudFront, and API Gateway custom

=> deny.

question demanding "TLS 1.3 only" or "disable TLS 1.0" is answered by selecting a newer security policy, not by code changes.

domains. ACM public certificates issued since June 2025 are exportable (private key included, passphrase-protected); earlier ones are not. Private CA offers more flexibility, at higher cost.

Definition

Signature Version 4 (SigV4). The signing protocol AWS uses to authenticate API requests: the caller signs the request with its secret access key (and includes the session token when using temporary credentials), proving who is calling and that the request was not altered in transit. It matters to developers because IAM authorization in API Gateway and every SDK call to an AWS service rely on correctly signed requests; an unsigned or badly signed request is rejected before authorization is even evaluated.

S3 encryption options

Since January 2023, S3 automatically applies SSE-S3 to new objects by default. The four options differ in who holds the keys and what you can audit:

Op- tionSSE- S3SSE- KMSDS- SE- KMS
SSE- CKey held byS3 (AWS owned/managed internally)KMS, in your account
KMSYou (customer-provided)What you controlNothing about the key
Key policy, rotation, grants; CloudTrail audit of key useTwo layers of encryption with two keysEverything, including key storage and rotationNotes
AES-256; default; zero configurationAdds KMS request cost and quota considerations; use S3 Bucket Keys to cut KMS requests substantiallyFor workloads whose compliance regime explicitly requires dual-layer encryptionYou send the key with every request over HTTPS; S3 never stores the key; rarely the right answer unless the scenario forbids AWS-held keys

The deciding qualifiers in exam stems are auditability (choose SSE-KMS with a CMK), mandated dual-layer encryption (DSSE-KMS), and "the customer must retain exclusive control of keys and AWS must never store them" (SSE-C). Related controls that appear alongside: default encryption on the bucket (applies when the uploader specifies none), Block Public Access (account- and bucket-level), and Object Lock for retention/WORM requirements.

Exam tip

Exam tip. If a scenario uses SSE-KMS and then complains about KMS request costs or throttling at scale, the expected fix is S3 Bucket Keys: they let S3 work from a bucket-level key for short periods instead of calling KMS for every single object.

Secrets Manager vs Parameter Store

Both services store configuration and secrets, and the merged DVA-C03 task tests the boundary between them directly.

Built forAutomatic rotation
EncryptionParameter/secr et sizeCost
Cross-account sharingVersioningAWS Secrets Manager
Secrets: database credentials, API keys, OAuth tokensYes - built-in, via Lambda; managed rotation for RDS, Aurora, Redshift, DocumentDB and other supported servicesKMS (AWS managed key or your CMK)
Secret values up to 64 KBPer secret per month plus API callsResource policies on secrets
Staging labels (AWSCURRENT, AWSPENDING, AWSPREVIOUS)SSM Parameter StoreConfiguration values and, with SecureString, secrets
No built-in rotationSecureString parameters use KMS (AWS managed key or your CMK)Standard tier: 4 KB max; Advanced tier: 8 KB max
Standard tier free; Advanced tier charged per parameterAdvanced-tier parameters can be shared via AWS RAMNumeric versions with labels

How Secrets Manager rotation works, step by step:

1. On the schedule you configure - as often as every four hours, expressed as a rate() or cron() expression with an optional window duration - Secrets Manager invokes the rotation Lambda function.

2. createSecret: the function generates a new credential and stores it as a new version labelled

AWSPENDING.

3. setSecret: the function updates the target system (for example, the database user password or the third-party service).

4. testSecret: the function verifies the pending credential actually works.

5. finishSecret: the AWSCURRENT label moves to the new version; the old version becomes AWSPREVIOUS.

Applications that read the secret normally - without naming a version - always get AWSCURRENT, so they pick up rotated credentials automatically on their next retrieval. Because rotation can happen while old credentials are cached, applications should retrieve secrets at runtime (with short-lived caching, for example the Secrets

Manager client-side caching libraries or the Lambda parameters-and-secrets extension) and retry on authentication failures rather than loading a password once at deploy time.

Choose Parameter Store when the value is configuration (feature settings, AMI IDs, environment URLs), when you need a free tier hierarchy of values organized by path (/prod/app/db-host), or when other SSM features

(parameter policies for expiration and change notification, advanced tier only) matter. Choose Secrets Manager the moment a question mentions rotating a credential, generating a random password, or managing a database or third-party API credential lifecycle.

Common trap: Parameter Store SecureString values are encrypted, so "the value must be encrypted at rest" is not a reason to pick Secrets Manager. Rotation and credential lifecycle management are.

Core concept

Rotating a KMS key does not re-encrypt data that already exists. Rotation changes the key material used for new encryptions; KMS retains the old material so previously produced ciphertext still decrypts. Students often assume turning on rotation re-protects everything under the new material - if a scenario genuinely requires old data under a new key, the data itself must be re-encrypted (for example, by copying the S3 objects), because enabling rotation alone leaves existing ciphertext untouched.

Check yourself

1. A compliance rule says AWS must never hold or store the encryption keys; the customer supplies the key with every request. Which S3 encryption option fits?

2. A database password must rotate automatically every 30 days, and the application must pick up the new password without a redeploy. Which service stores it, and which version does a normal read return after rotation?

Answers: 1. SSE-C - the customer provides the key on each request over HTTPS and S3 never stores it. 2. AWS

Secrets Manager - reads that do not name a version return the one labelled AWSCURRENT, which rotation moves to the new credential.

2.4 AI security - the new Task 2.3

DVA-C03 adds a dedicated AI security task to Domain 2. It covers five skill areas: access management for AI services, data privacy controls, content filtering and prompt-injection protection, securing AI agent interactions, and keeping sensitive content out of monitoring logs. It does not cover designing prompts, designing retrieval

(RAG) architectures, choosing models, or AI governance frameworks - those are explicitly out of scope, so if a question drifts toward them, it is testing something else.

Access management for AI services

Calling Amazon Bedrock is an IAM-governed API call like any other, and the exam expects standard IAM discipline applied to it:

bedrock:InvokeModelWithResponseStream (the Converse API is authorized through the same invoke

actions). Scope the Resource element to the specific foundation model or inference profile ARNs your application needs. Allowing bedrock:InvokeModel on * is the AI equivalent of s3:* on * and will be the wrong answer whenever least privilege is the qualifier.

from embedded user keys.

while production roles permit only the approved models in the production account. SCPs can deny Bedrock actions entirely in accounts that should not use AI services.

guardrail identifier, which turns "the team configured a guardrail" into "no caller can bypass it."

Data privacy controls

Amazon Bedrock's data protection model, as documented by AWS, is the single most testable fact set in this task:

providers, and are not used to improve models for other customers. Model providers have no access to your prompts or completions.

Bedrock assets that are stored, such as model customization jobs and their training data.

control APIs, so a Lambda function or container in a private subnet can invoke models without traffic crossing the public internet. Combine the endpoint with an endpoint policy and aws:SourceVpce conditions in identity or resource policies to require that calls come through your endpoint.

data-residency decision: if a scenario requires prompts to stay in one Region, the answer involves disabling cross-Region inference or pinning an inference profile that stays in-Region - not "Bedrock always keeps data in-Region," which is not guaranteed once cross-Region inference is enabled.

opt-out policies let administrators opt accounts out centrally. This is the mechanism behind "opt out of

CloudTrail records Bedrock control-plane and invocation activity, so "who invoked which model" is auditable - but note the logging caveat under "Keeping sensitive content out of logs" later in this section:

CloudTrail records that a call happened, not the prompt content.

training/improvement" answers for services such as Amazon Q Developer. For Bedrock itself, the no-training guarantee above applies regardless - knowing which statement belongs to which service is exactly what the exam probes.

Exam tip

If a question asks how to stop prompts from training a Bedrock base model, the honest answer the exam wants is that Bedrock does not train on customer inputs or outputs in the first place. If it asks about keeping

Bedrock traffic off the internet, the answer is a PrivateLink interface endpoint for Bedrock. Keep the two facts separate; the distractors deliberately swap them.

Amazon Bedrock Guardrails: content filtering and prompt-injection protection

Guardrails are Bedrock's configurable safeguard layer, evaluated on both the input prompt and the model response when you attach a guardrail (by ID and version) to an invocation, or applied to arbitrary text through the standalone ApplyGuardrail API - useful for screening content that never reaches a model, such as user-generated text from another source.

A guardrail combines up to six policy types:

PolicyContent filters
Denied topicsWord filters
Sensitive information filtersContextual grounding checks
Automated reasoning checksWhat it does
Detect harmful content in the categories Hate, Insults, Sexual, Violence, Misconduct, and Prompt Attack, each with a configurable filter strength (None, Low, Medium, High) for input and outputBlocks requests and responses about topics you define in natural language, with example phrases
Blocks exact words and phrases, including a managed profanity listDetect PII (names, emails, phone numbers, SSNs, card numbers, AWS keys, and many more built-in types) and custom patterns you define with regular expressions; each type is set to Block or Mask (anonymize, replacing the value with a tag such as [EMAIL])
Score whether a response is grounded in provided source material and relevant to the query, above thresholds you setValidate responses against logical rules you provide

Operational details the exam can test:

user input; its output strength is set to None because there is nothing to detect in the model's own output.

This asymmetry is a favourite distractor.

continue without the model ever seeing the real value. Masking on input means the model processes only the placeholder.

reference a specific version, so a policy change does not silently alter production behaviour.

well-secured application uses both, and can use IAM to require that invocations carry the approved guardrail.

Definition

Amazon Bedrock Guardrails. A configurable safeguard layer attached to model invocations (or applied on its own through the ApplyGuardrail API) that evaluates both the input prompt and the model response against content filters, denied topics, word filters, sensitive-information filters, and grounding checks. It matters to developers because it is the control that blocks or masks harmful content, PII, and prompt attacks - IAM decides who may invoke the model, but only the guardrail inspects what the model is asked and what it answers.

Securing AI agent interactions

Agents act: they call tools, query databases, and trigger workflows, so a compromised or manipulated agent can do real damage with real credentials. DVA-C03 expects you to apply least privilege to agents using Amazon

Bedrock AgentCore, the managed runtime and tooling layer for agents.

AgentCore building blocks with a security job:

ComponentAgentCore Identity
AgentCore GatewayPolicy in AgentCore
AgentCore RuntimeSecurity role
Authenticates inbound callers (who may invoke the agent) using your identity provider, and manages outbound credentials - OAuth tokens and API keys held in a vault - so the agent can act on behalf of a specific user without credentials in its code or environmentTurns APIs, Lambda functions, and other targets into agent tools (exposed over MCP) and is the enforcement point where each tool call is authorized
Fine-grained authorization rules, written in natural language and converted to Cedar policies, that the Gateway evaluates on every tool call - down to tool, operation, and parameter level (for example, "refunds may not exceed $500")Executes agent code with session isolation: each session runs in its own dedicated microVM with separate CPU, memory, and filesystem, and the environment is stopped and sanitized when the session ends

Principles to state in an answer:

parameters should be bounded by policy at the Gateway, not by hoping the model behaves. Per-user identity should propagate through the call chain (AgentCore Identity brokers token exchange) so downstream services see the real user, not a shared super-powered service identity.

AgentCore Runtime's per-session microVMs provide this below the application layer - the exam answer when a scenario involves multi-tenant agents leaking context between users.

person. AgentCore Gateway supports elicitation - the tool pauses mid-execution and requests user input or approval (for example through a form or a URL-based approval/consent flow) before proceeding. Design pattern for questions: read-only actions proceed automatically; writes, payments, deletions, and anything above a policy threshold require elicitation and approval first, and the approval is recorded for audit.

returned to the model are untrusted content that can carry indirect prompt injections.

Exam tip

Exam tip. When a scenario describes one user's agent session leaking another user's data or context, reach for

AgentCore Runtime session isolation - each session runs in its own dedicated microVM. Save the Gateway and

Policy in AgentCore answers for questions about what the agent is allowed to do, such as capping a refund amount.

Keeping sensitive content out of logs

A model application can leak data through its observability pipeline even when everything else is locked down.

Task 2.3 tests whether you know where prompts travel once you log them:

or both) for debugging or audit, it can capture the full request and response payloads - meaning complete prompts and completions, including whatever PII your users pasted in. Treat the destination bucket or log group as sensitive data: encrypt it, restrict its policy, and set retention deliberately. Never enable full payload logging in production "just in case."

data, tokens, and secrets to CloudWatch Logs. Log metadata instead: token counts, latency, model ID, guardrail outcomes, and a correlation ID.

stored text carries placeholders rather than values.

identifiers for common PII types) in log groups at ingestion - a useful safety net when you cannot guarantee every developer's logging discipline.

second copy of your users' conversations.

Common trap: "Enable model invocation logging to improve security" is only half right - it improves auditability while creating a sensitive-data store. The complete answer pairs enabling it with encrypting and restricting the destination, or keeps content logging off and relies on metadata-level logging.

Core concept

Guardrails and IAM solve different problems, and neither is a substitute for the other. IAM controls who can invoke which model; Guardrails inspect the content of prompts and responses. Students routinely pick one when the scenario needs both: a caller fully authorized by IAM can still submit a prompt injection, and a perfectly configured guardrail does nothing to stop an unauthorized caller who invokes the model without it.

2.5 Secure network access: VPC endpoints and PrivateLink

Applications in private subnets still need to reach AWS services. VPC endpoints keep that traffic on the AWS network instead of hair-pinning through a NAT gateway and the public internet.

ServicesImplemen- tation
CostDNSPolicy
Gateway endpointAmazon S3 and DynamoDB onlyA route table entry pointing at a prefix list
No hourly or data chargePublic service DNS names resolve to the endpointEndpoint policy controls which buckets/tables and principals
Interface endpoint (PrivateLink)Most other services: KMS, Secrets Manager, STS, CloudWatch Logs, Bedrock, ECR, and many moreElastic network interfaces with private IPs in your subnets, one per AZ you enable
Hourly charge per AZ plus per-GB data processingPrivate DNS (on by default for AWS services) makes the service's public hostname resolve to the endpoint's private IPsEndpoint policy controls permitted actions on the service

Exam-relevant behaviour:

policy and the caller's IAM permissions. A deny or missing allow in either blocks the call.

at all - "the Lambda function in a private subnet cannot reach Secrets Manager" resolves to an interface endpoint for Secrets Manager, a NAT gateway, or moving the function, and the most secure/least exposure qualifier picks the endpoint.

arrive through your endpoint - the standard pattern for "only allow KMS decrypt calls from inside the VPC."

give you private-only buckets reachable from on-premises through the same endpoint model when extended with PrivateLink patterns.

services), which is how Bedrock and third-party SaaS integrations stay off the internet.

Exam tip

Gateway endpoints exist for exactly two services: S3 and DynamoDB. Any question attaching a gateway endpoint to another service contains its own wrong answer. Conversely, "the endpoint created ENIs in the subnets" tells you it was an interface endpoint even if the stem never names the type.

Definition

PrivateLink interface endpoint. A VPC endpoint built from elastic network interfaces with private IP addresses in your subnets, giving resources in the VPC private connectivity to an AWS service over the AWS network instead of the public internet. It matters because most services beyond S3 and DynamoDB - KMS,

Secrets Manager, STS, Bedrock - are reached privately this way, with an endpoint policy controlling what may be done through it and private DNS making the service's normal hostname resolve to those private IPs.

Check yourself

1. A Lambda function in a private subnet with no NAT gateway cannot reach Secrets Manager. What do you create, and what appears in your subnets when you do?

2. A KMS key policy must permit decrypt calls only when they arrive from inside the VPC through its endpoint.

Which condition key enforces this?

Answers: 1. An interface VPC endpoint (PrivateLink) for Secrets Manager - creating it places elastic network interfaces with private IPs in the subnets you enable. 2. aws:SourceVpce, set to the endpoint's ID.

End-of-Chapter Test

1. A Lambda function must write orders to a DynamoDB table in the same account. Which approach follows least privilege?

  1. Create an IAM user for the application, generate access keys, and store them in the function's environment variables
  2. Attach a policy allowing dynamodb:PutItem on the table's ARN to the function's execution role
  3. Attach the AmazonDynamoDBFullAccess managed policy to the function's execution role
  4. Give the function a policy allowing all DynamoDB actions on all resources

2. Which Cognito component returns temporary AWS credentials that let a signed-in user's mobile app upload a photo directly to S3?

  1. User pool
  2. Hosted UI
  3. Identity pool
  4. User pool Lambda trigger

3. An application must rotate a third-party API key automatically every 30 days and notify the application of each change with minimal custom lifecycle code. Which service should store the key?

  1. Parameter Store Standard tier, as a SecureString
  2. AWS Secrets Manager with automatic rotation
  3. AWS KMS
  4. An encrypted environment variable in the Lambda function

4. Compliance requires that every use of the encryption key protecting an S3 bucket be auditable and that the security team - not the storage team - control who can use the key. Which S3 encryption option meets these requirements?

  1. SSE-S3
  2. SSE-C
  3. SSE-KMS with an AWS managed key
  4. SSE-KMS with a customer managed key

5. A developer configures a Bedrock guardrail. Prompt Attack filtering is set to HIGH for input and the console will not let them raise its output strength. Why?

  1. Prompt Attack filtering requires a paid guardrail tier for output
  2. Prompt attacks exist only in input; the output strength for Prompt Attack is fixed to None
  3. The guardrail draft must be published before output filtering can be enabled
  4. Prompt Attack filtering conflicts with content filters on output

6. A finance team will paste account data into a Bedrock-powered assistant and requires that prompts never leave the VPC and never be used to train a model. Which combination addresses both requirements?

  1. Enable model invocation logging and apply an SCP denying Bedrock in other Regions
  2. Use a PrivateLink interface endpoint for Bedrock; no additional control is needed for training, because Bedrock does not use customer inputs or outputs to train base models
  3. Attach a guardrail with PII masking and use public Bedrock endpoints with TLS
  4. Store prompts in an encrypted S3 bucket and invoke Bedrock over the internet

7. An AI agent built on Bedrock AgentCore can issue refunds through a payment tool. A policy must prevent any single refund above $500 and require human approval for refunds above $100. Where should these controls be enforced?

  1. In the agent's system instructions
  2. In AgentCore Gateway, using Policy in AgentCore rules evaluated on every tool call, with Gateway elicitation pausing execution for approval
  3. In the payment API's IAM user policy
  4. In a Lambda authorizer on API Gateway in front of the agent

8. A private-subnet ECS task fails to retrieve a secret from Secrets Manager but can reach DynamoDB. There is no NAT gateway. What is the most likely missing component?

  1. A gateway VPC endpoint for Secrets Manager
  2. An interface VPC endpoint for Secrets Manager
  3. A gateway VPC endpoint for DynamoDB
  4. An internet gateway attached to the VPC

Answer key

1. B — The execution role supplies temporary credentials with no stored keys, and the policy is scoped to the single action and table the function needs. C works but grants far more than needed, A embeds long-lived credentials, and D is the opposite of least privilege.

2. C — Identity pools exchange an authenticated identity for STS temporary credentials tied to an IAM role. User pools only authenticate and issue JWTs; they never issue AWS credentials.

3. B — Secrets Manager is the only option with built-in scheduled rotation (driven by a Lambda function) and version staging. Parameter Store has no native rotation, KMS manages encryption keys rather than application secrets, and an environment variable requires manual redeployment.

4. D — A customer managed key has an editable key policy the security team controls, and its use is logged to CloudTrail under your account's control. SSE-S3 offers no key control, SSE-C keys are never visible to CloudTrail key-use auditing in KMS, and the policy on an AWS managed key cannot be edited.

5. B — Prompt injection and jailbreaks are properties of the request sent to the model, so Guardrails evaluates Prompt Attack on input only and fixes output strength to None. It is not a tiering, versioning, or filter-conflict limitation.

6. B — A PrivateLink interface endpoint keeps invocation traffic on private network paths, and AWS documents that Bedrock does not train base models on customer inputs or outputs, so no opt-out action is required for that requirement. Logging (A) increases data exposure, (C) leaves traffic on public endpoints, and (D) addresses storage rather than either stated requirement.

7. B — AgentCore Gateway is the enforcement point for tool calls, Policy in AgentCore evaluates fine-grained rules (including parameter limits) on each call, and elicitation provides the pause-for-approval flow. Instructions to the model (A) are not enforcement, and (C) and (D) sit outside the agent's tool-call path.

8. B — Secrets Manager is reached through interface endpoints (PrivateLink); gateway endpoints exist only for S3 and DynamoDB - which also explains why DynamoDB already works (C describes what is presumably present, not what is missing). An internet gateway (D) would expose the subnet rather than fix private access.

Want the full AWS Developer – Associate (DVA-C03) package?

This guide is free to read. Get the downloadable PDF guidebook plus the full DVA-C03 practice exam with 3 months of online access.

Get DVA-C03 Full Access — $10