Curated

Security 1 (2.1–2.2)

0 votes

Questions57

  1. Question 1

    Security

    A company uses an external workforce identity provider and wants employees to access multiple AWS accounts through AWS IAM Identity Center with their existing sign-in credentials. Which integration provides federated authentication?

    Show the answer

    Correct answerD. SAML 2.0 federation with the external identity provider

    AWhy not this: IAM access keys support programmatic requests, not workforce federation using existing identity provider credentials.

    BWhy not this: Permission sets define account permissions but do not establish authentication with an external identity provider.

    CWhy not this: SCIM synchronizes users and groups; it does not authenticate employees for federated sign-in.

    DWhy this is right: SAML 2.0 lets IAM Identity Center trust authentication performed by the external identity provider.

    SAML 2.0 federation allows IAM Identity Center to rely on the external identity provider for employee authentication. SCIM provisions users and groups but does not perform federated sign-in.

    Open this question
  2. Question 2

    Security

    A mobile application authenticates users with an existing external OpenID Connect provider. Which service should exchange their identity tokens for temporary AWS credentials so the application can access Amazon S3 directly?

    Show the answer

    Correct answerB. An Amazon Cognito identity pool

    AWhy not this: An IAM access key is a credential, not a service that exchanges external identity tokens.

    BWhy this is right: An identity pool accepts supported external identity tokens and obtains temporary AWS credentials for users.

    CWhy not this: A user pool provides application authentication and tokens, not the requested exchange for AWS credentials.

    DWhy not this: A presigned URL authorizes a specific request; it does not exchange identity tokens for AWS credentials.

    An Amazon Cognito identity pool federates external identities and provides temporary AWS credentials associated with IAM roles. A user pool provides application sign-in and tokens, rather than directly issuing AWS credentials.

    Open this question
  3. Question 3

    Security

    A deployment platform issues OIDC tokens from one issuer for many repositories, branches, and audiences. An IAM role must accept only tokens for AWS STS from one repository's production branch, without stored AWS credentials; which trust configuration meets these requirements?

    Show the answer

    Correct answerC. Trust the OIDC provider for AssumeRoleWithWebIdentity and require exact audience and subject claim matches.

    AWhy not this: An audience restriction alone does not distinguish repositories or branches that use the same audience.

    BWhy not this: A subject restriction alone does not enforce the required token audience.

    CWhy this is right: The federated principal and action enable token exchange; audience and subject restrictions enforce all stated token boundaries.

    DWhy not this: AssumeRole requires AWS-authenticated requests; an external ID does not validate an OIDC token's claims.

    Web identity federation avoids stored AWS credentials. Exact audience and subject conditions restrict tokens to the intended recipient and repository branch. Checking only the audience leaves other repositories and branches using that audience eligible.

    Open this question
  4. Question 4

    Security

    An enterprise desktop application receives a signed SAML assertion from the corporate identity provider that authorizes two IAM roles. The application has no AWS credentials and must obtain temporary credentials for one authorized role; what should it do?

    Show the answer

    Correct answerB. Call AssumeRoleWithSAML with the assertion, selected role ARN, and SAML provider ARN.

    AWhy not this: AssumeRoleWithWebIdentity accepts web identity tokens, not SAML assertions.

    BWhy this is right: AssumeRoleWithSAML accepts the assertion, role ARN, and SAML provider ARN without preexisting AWS credentials.

    CWhy not this: GetSessionToken requires AWS credentials and does not exchange SAML assertions for role credentials.

    DWhy not this: AssumeRole requires AWS credentials to authenticate the request; an external ID is not a federation token.

    AssumeRoleWithSAML exchanges a valid SAML assertion for temporary credentials for a selected authorized role, using the IAM SAML provider ARN. AssumeRole requires AWS-authenticated requests; its external ID parameter does not accept a SAML assertion as authentication.

    Open this question
  5. Question 5

    Security

    A development database uses an unencrypted Amazon RDS DB instance. The team can accept downtime and must move its existing data to an encrypted DB instance. Which approach should it use?

    Show the answer

    Correct answerA. Copy a DB snapshot with encryption enabled, then restore it.

    AWhy this is right: RDS supports encrypting a snapshot copy and restoring that copy to an encrypted DB instance.

    BWhy not this: TLS protects data in transit but leaves the existing database storage unencrypted.

    CWhy not this: RDS does not support directly enabling storage encryption on an existing unencrypted DB instance.

    DWhy not this: Credential rotation changes authentication secrets, not the encryption of database storage.

    An encrypted copy of an unencrypted DB snapshot can be restored as an encrypted RDS DB instance. Storage encryption cannot be enabled directly on an existing unencrypted DB instance; TLS protects connections rather than stored data.

    Open this question
  6. Question 6

    Security

    An S3 bucket contains objects encrypted with SSE-S3. A developer changes its default encryption to SSE-KMS, but an audit requires existing objects to use the specified KMS key too. What should the developer do?

    Show the answer

    Correct answerC. Use S3 Batch Operations to copy existing objects with the required encryption.

    AWhy not this: KMS key rotation changes key material used for future encryption operations; it does not convert SSE-S3 objects to SSE-KMS.

    BWhy not this: S3 Bucket Keys reduce SSE-KMS request costs; enabling them does not convert existing SSE-S3 objects.

    CWhy this is right: Copying existing objects with the specified SSE-KMS settings encrypts the resulting objects with the required KMS key.

    DWhy not this: Upload requirements can control future writes but do not change the encryption of existing objects.

    Changing S3 default encryption does not re-encrypt existing objects. S3 Batch Operations can copy existing objects with the required SSE-KMS settings; a policy governing new uploads does not modify stored objects.

    Open this question
  7. Question 7

    Security

    Which protection does Amazon EBS encryption provide?

    Show the answer

    Correct answerD. Encryption of stored volume data and its snapshots

    AWhy not this: Public endpoint TLS must be configured separately; EBS encryption does not secure those connections.

    BWhy not this: Field masking changes what applications reveal; EBS encryption does not identify or redact sensitive fields.

    CWhy not this: Database credential rotation is a secrets-management function, not a function of EBS encryption.

    DWhy this is right: Data on encrypted EBS volumes and snapshots created from them is encrypted at rest.

    Amazon EBS encryption protects data stored on encrypted volumes and snapshots created from those volumes. TLS protects network connections rather than providing EBS storage encryption.

    Open this question
  8. Question 8

    Security

    An Application Load Balancer accepts HTTPS requests and forwards them to an HTTP target group on EC2 instances. Security requires encryption on both network segments. What should the developer change?

    Show the answer

    Correct answerA. Use an HTTPS target group with TLS configured on the instances.

    AWhy this is right: HTTPS targets establish a separate encrypted connection between the load balancer and each target.

    BWhy not this: EBS encryption protects stored volume data, not traffic between the load balancer and the instances.

    CWhy not this: The listener certificate secures the client-facing connection, which already uses HTTPS.

    DWhy not this: Secrets Manager protects credentials but does not encrypt the application's backend network connection.

    An HTTPS target group encrypts traffic from the load balancer to the targets, provided the targets support TLS. Changing the listener certificate affects the client-facing connection, not the backend protocol.

    Open this question
  9. Question 9

    Security

    An SDK application on EC2 uses the default credential provider chain but authenticates as an old IAM user whose keys remain in environment variables. An attached instance profile has the required permissions; which change enables automatically refreshed role credentials without storing keys?

    Show the answer

    Correct answerA. Remove the environment keys and retain the default credential provider chain

    AWhy this is right: Removing the overriding credentials lets the default chain obtain and refresh the instance profile's credentials.

    BWhy not this: Copied temporary credentials expire; static environment values do not provide the provider's automatic refresh behavior.

    CWhy not this: A service endpoint is a service URL, not a role selector or credential provider.

    DWhy not this: A shared credentials file still stores user keys and can take precedence over instance profile credentials.

    Environment credentials take precedence over EC2 instance profile credentials. Removing the old keys allows the default chain to obtain and refresh role credentials automatically; copying temporary credentials into environment variables does not provide automatic refresh.

    Open this question
  10. Question 10

    Security

    Which additional credential must accompany an access key ID and secret access key when using temporary AWS security credentials?

    Show the answer

    Correct answerC. A session token

    AWhy not this: An external ID can be required when assuming a role, but it is not part of the resulting credentials.

    BWhy not this: An MFA device serial number identifies a device and is not included as a temporary credential.

    CWhy this is right: The session token is the third component required when using temporary security credentials.

    DWhy not this: A role ARN identifies a role; it is not a component of temporary security credentials.

    Temporary AWS credentials consist of an access key ID, secret access key, and session token. A role ARN identifies a role but is not part of the credential set used to authenticate service requests.

    Open this question
  11. Question 11

    Security

    Developers must start only EC2 instances whose Project tag matches their own IAM principal's Project tag. Which policy condition provides this control without listing each developer or instance?

    Show the answer

    Correct answerD. Match aws:ResourceTag/Project to aws:PrincipalTag/Project

    AWhy not this: A principal ARN identifies the caller, so matching it to an instance ARN does not establish project membership.

    BWhy not this: RequestedRegion identifies the request's AWS Region, not the instance's project.

    CWhy not this: SourceAccount helps restrict service-to-service requests and does not compare project membership.

    DWhy this is right: Comparing these tag values restricts access to instances assigned to the principal's project.

    Comparing resource and principal Project tags implements attribute-based access control and scales without individual ARN lists. Checking the source account does not distinguish projects within the same account.

    Open this question
  12. Question 12

    Security

    Which control requires an IAM user to provide an additional authentication factor when signing in with a password?

    Show the answer

    Correct answerC. Multi-factor authentication

    AWhy not this: A trust policy identifies principals allowed to assume a role, not additional factors for an IAM user's sign-in.

    BWhy not this: A permissions boundary limits available permissions rather than adding an authentication factor.

    CWhy this is right: MFA adds another authentication factor, such as possession of a registered security key.

    DWhy not this: An access key pair supports programmatic access rather than adding a factor to password-based sign-in.

    Multi-factor authentication requires an additional authentication factor beyond the password. A permissions boundary limits the permissions an identity can receive; it does not add a sign-in factor.

    Open this question
  13. Question 13

    Security

    For one DynamoDB table, a role policy allows GetItem, PutItem, Query, and DeleteItem; its permissions boundary allows GetItem, PutItem, Query, and Scan. A session policy allows GetItem, PutItem, Query, and UpdateItem; with no other applicable policies, which actions can the session perform? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. dynamodb:PutItemC. dynamodb:GetItemD. dynamodb:Query

    AWhy this is right: PutItem is allowed by the role policy and falls within both the boundary and the session policy.

    BWhy not this: UpdateItem appears in the session policy, which cannot grant permissions absent from the role policy.

    CWhy this is right: GetItem is allowed by the role policy and falls within both the boundary and the session policy.

    DWhy this is right: Query is allowed by the role policy and falls within both the boundary and the session policy.

    EWhy not this: Scan appears in the boundary, but the boundary grants no permissions and the other policies do not allow it.

    FWhy not this: DeleteItem is allowed by the role policy but is outside both the boundary and the session policy.

    GetItem, PutItem, and Query are allowed by the role policy, permissions boundary, and session policy. Effective permissions are their intersection; an action allowed by only one policy does not become available to the session.

    Open this question
  14. Question 14

    Security

    An application uploads confidential files to Amazon S3. Policy requires file contents to be encrypted before they leave the application, and Amazon S3 must not receive plaintext file contents. Which approach meets the requirement?

    Show the answer

    Correct answerD. Encrypt files in the application before uploading them.

    AWhy not this: SSE-C supplies a customer key to S3, but S3 performs the file encryption.

    BWhy not this: HTTPS protects transport, and SSE-S3 protects storage; S3 still processes plaintext file contents.

    CWhy not this: SSE-KMS encrypts data within S3, rather than before it leaves the application.

    DWhy this is right: Client-side encryption ensures that only encrypted file contents are sent to S3.

    Client-side encryption encrypts file contents before the application sends them to S3. SSE-C lets the client supply a key, but S3 still receives the file contents and performs the encryption on the server side.

    Open this question
  15. Question 15

    Security

    A CloudFront distribution uses an Application Load Balancer in eu-west-1 as its HTTPS origin. The developer must use ACM-issued certificates for both HTTPS endpoints. Where should the certificates be requested?

    Show the answer

    Correct answerC. Request the viewer certificate in us-east-1 and the origin certificate in eu-west-1.

    AWhy not this: The load balancer can use its regional certificate, but CloudFront requires its viewer certificate in us-east-1.

    BWhy not this: This reverses the requirements: CloudFront needs us-east-1, and the load balancer needs eu-west-1.

    CWhy this is right: CloudFront uses ACM certificates from us-east-1; the load balancer uses a certificate from its own Region.

    DWhy not this: CloudFront can use its viewer certificate, but the load balancer needs a certificate in eu-west-1.

    CloudFront requires its ACM viewer certificate in us-east-1. An Application Load Balancer requires its certificate in the load balancer's Region, so placing both certificates in either Region does not satisfy both requirements.

    Open this question
  16. Question 16

    Security

    An Application Load Balancer uses a third-party certificate imported into ACM. The certificate is approaching expiration. What should the developer do to preserve the existing certificate ARN and listener association?

    Show the answer

    Correct answerD. Reimport the renewed certificate under the existing ARN.

    AWhy not this: A new certificate request creates a new ARN and does not replace the existing listener association.

    BWhy not this: ACM managed renewal is not available for imported certificates.

    CWhy not this: Storing a certificate in Secrets Manager does not update the certificate that the load balancer uses.

    DWhy this is right: Reimporting replaces the certificate material while preserving the ARN and associated AWS resources.

    Reimporting a renewed certificate under the existing ACM ARN preserves its associations. ACM does not provide managed renewal for imported certificates; requesting a new certificate creates a different ARN.

    Open this question
  17. Question 17

    Security

    An internal Application Load Balancer serves company-managed clients that trust a company AWS Private CA hierarchy. Policy requires certificates from that hierarchy and ACM-managed renewal without a custom renewal workflow. Which approach meets these requirements?

    Show the answer

    Correct answerD. Request a private certificate through ACM using the company CA and attach to the load balancer.

    AWhy not this: Importing a directly issued certificate does not make it eligible for ACM-managed renewal.

    BWhy not this: A public certificate does not satisfy the requirement to use the company's private CA hierarchy.

    CWhy not this: A self-signed certificate does not chain to the company CA and is not eligible for ACM-managed renewal.

    DWhy this is right: ACM can manage renewal for an ACM-requested private certificate associated with the load balancer.

    An ACM-requested private certificate issued by the company CA and associated with the load balancer is eligible for ACM-managed renewal. A certificate issued directly through AWS Private CA and then imported into ACM does not receive ACM-managed renewal.

    Open this question
  18. Question 18

    Security

    Which methods can validate domain ownership when requesting a public certificate through AWS Certificate Manager? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. Approve the ACM domain validation email.B. Create the ACM-provided DNS validation record.

    AWhy this is right: Approval through ACM's domain validation email demonstrates control of an authorized domain email address.

    BWhy this is right: Publishing the ACM-provided DNS record demonstrates control over the domain's DNS.

    CWhy not this: ACM does not validate domain ownership by reading credentials from Secrets Manager.

    DWhy not this: An SSH public key is not an ACM public certificate domain-validation method.

    EWhy not this: Certificate tags organize resources but do not prove domain ownership.

    ACM supports DNS and email validation for public certificates (and HTTP validation for certificates used only with CloudFront). Certificate tags supply metadata, not evidence of control over a domain.

    Open this question
  19. Question 19

    Security

    A developer has separate AWS CLI profiles for development and production accounts. How should the developer run a single CLI operation with production credentials without changing the default profile?

    Show the answer

    Correct answerC. Specify the production profile with the profile parameter.

    AWhy not this: An output format controls response presentation, not authentication.

    BWhy not this: A Region selects a service location, not an account's credentials.

    CWhy this is right: The profile parameter selects the named profile for that operation without changing the default profile.

    DWhy not this: An endpoint URL identifies a service endpoint; an account ID does not select credentials.

    The profile parameter selects a named profile's credentials and configuration for that CLI operation. Selecting a Region changes where a request is sent, not the identity making it.

    Open this question
  20. Question 20

    Security

    An application running in Amazon ECS needs to call DynamoDB through an AWS SDK without stored access keys. Which configuration provides credentials specifically to the application containers?

    Show the answer

    Correct answerB. Assign an IAM task role in the task definition.

    AWhy not this: A table resource policy can authorize access but does not supply credentials to the application.

    BWhy this is right: A task role supplies temporary credentials to containers for application calls to AWS services.

    CWhy not this: The task execution role supports the ECS agent's work; its credentials are not supplied to application containers.

    DWhy not this: The ECS service-linked role lets ECS manage supporting resources, not provide application credentials.

    An ECS task role supplies temporary credentials that application containers can use through an AWS SDK. The task execution role supports ECS operations such as pulling images and publishing logs, rather than application API calls.

    Open this question
  21. Question 21

    Security

    Which local file conventionally stores access key credentials shared by the AWS CLI and AWS SDKs?

    Show the answer

    Correct answerC. ~/.aws/credentials

    AWhy not this: The CLI alias file defines command aliases rather than credential profiles.

    BWhy not this: The models directory holds custom service models rather than credentials.

    CWhy this is right: The shared credentials file is the conventional location for profile-based access key credentials.

    DWhy not this: The config file primarily holds AWS configuration; it is not the conventional shared credentials file.

    The shared credentials file, normally ~/.aws/credentials, stores access key credentials in profiles. The ~/.aws/config file primarily stores configuration such as Regions, output formats, and role settings, although it can also contain credentials.

    Open this question
  22. Question 22

    Security

    A web application must let a customer upload one file to a designated key in a private S3 bucket for ten minutes without receiving AWS credentials. What should the backend provide?

    Show the answer

    Correct answerD. A presigned PUT URL for the designated object key.

    AWhy not this: A GET signature authorizes downloading the object, not uploading it.

    BWhy not this: A browser timeout does not authorize access to a private S3 object.

    CWhy not this: Public write permission does not provide a customer-specific, ten-minute upload authorization.

    DWhy this is right: A PUT signature grants time-limited upload access to the designated key without exposing AWS credentials.

    A presigned PUT URL authorizes an upload to the specified object key for a limited time without giving the customer AWS credentials. A presigned GET URL authorizes retrieval, not upload.

    Open this question
  23. Question 23

    Security

    A client starts downloading a large S3 object one minute before its presigned URL expires; the transfer continues past expiration. After the connection drops, what happens if the client retries with that URL?

    Show the answer

    Correct answerA. The retry fails because S3 checks expiration on the new request.

    AWhy this is right: A retry creates a new HTTP request, so S3 rejects the expired URL.

    BWhy not this: Starting a download does not extend the URL's validity for subsequent requests.

    CWhy not this: Expiration does not terminate a download that is already in progress.

    DWhy not this: A byte-range request is a new request and must satisfy the URL's expiration check.

    S3 checks a presigned URL's expiration when each HTTP request starts. A download already in progress can continue after expiration, but a new request, including a range request to resume it, fails after expiration.

    Open this question
  24. Question 24

    Security

    An application stores files in Amazon S3. Compliance requires two independent layers of server-side encryption, with AWS KMS integration and no application-side cryptography. Which encryption option should the developer select?

    Show the answer

    Correct answerB. Dual-layer server-side encryption with AWS KMS keys

    AWhy not this: An S3 Bucket Key reduces KMS request traffic, not the number of encryption layers.

    BWhy this is right: DSSE-KMS provides two independent server-side encryption layers with AWS KMS integration.

    CWhy not this: This includes application-side encryption and does not provide two server-side layers.

    DWhy not this: SSE-S3 key rotation does not provide two independent encryption layers.

    DSSE-KMS applies two independent layers of server-side encryption to S3 objects. An S3 Bucket Key reduces AWS KMS request traffic for SSE-KMS; it does not add an independent encryption layer.

    Open this question
  25. Question 25

    Security

    An application must encrypt a 20 MB file locally while protecting its encryption key with a symmetric KMS key. Which approach should the developer use?

    Show the answer

    Correct answerD. Use GenerateDataKey, encrypt locally, and retain the encrypted data key

    AWhy not this: The symmetric KMS Encrypt operation accepts at most 4,096 bytes of plaintext per request.

    BWhy not this: A KMS key ARN identifies a key; it is not cryptographic key material.

    CWhy not this: The ciphertext output is a wrapped key, which must be decrypted before it can be used for local encryption.

    DWhy this is right: GenerateDataKey supplies a usable plaintext key and a protected copy for later decryption.

    GenerateDataKey returns a plaintext data key for local encryption and an encrypted copy to store with the ciphertext; remove the plaintext key from memory after use. Direct symmetric KMS Encrypt requests accept at most 4,096 bytes, not a 20 MB file.

    Open this question
  26. Question 26

    Security

    Which Amazon S3 encryption option uses keys managed entirely by Amazon S3, without requiring an application to supply encryption keys?

    Show the answer

    Correct answerB. Server-side encryption with S3-managed keys

    AWhy not this: Client-side encryption requires the application to encrypt data using a data key.

    BWhy this is right: SSE-S3 leaves encryption-key management to Amazon S3.

    CWhy not this: Local client-side encryption requires the application to manage and use encryption keys.

    DWhy not this: Customer-provided key encryption requires the client to supply the encryption key.

    SSE-S3 uses encryption keys managed by Amazon S3. Server-side encryption with customer-provided keys instead requires the client to provide the encryption key with applicable requests.

    Open this question
  27. Question 27

    Security

    An S3 bucket must store new objects using SSE-KMS and allow a role in another AWS account to decrypt them directly. The bucket policy already permits that role to read objects. Which encryption configuration supports this requirement?

    Show the answer

    Correct answerB. Use a customer managed KMS key and authorize the external role in its key policy

    AWhy not this: A bucket policy cannot grant cross-account use of the AWS managed aws/s3 key.

    BWhy this is right: A customer managed key can authorize cross-account use; the caller also needs appropriate IAM permissions.

    CWhy not this: The AWS managed aws/s3 key is not configurable for cross-account sharing through a customer-created grant.

    DWhy not this: Restricting key use to the owner's account leaves the external role unable to decrypt objects.

    Cross-account access to SSE-KMS objects requires a customer managed KMS key whose policy permits the external account or role, plus appropriate caller IAM permissions. The AWS managed aws/s3 key cannot be configured for cross-account sharing.

    Open this question
  28. Question 28

    Security

    An application uploads objects to Amazon S3 without performing local encryption. The security team requires server-side encryption with a customer managed KMS key and an audit trail of KMS key usage. Which option should the developer configure?

    Show the answer

    Correct answerB. SSE-KMS

    AWhy not this: HTTPS protects data in transit but does not select the object's at-rest encryption key.

    BWhy this is right: SSE-KMS supports customer managed KMS keys and CloudTrail records of KMS API usage.

    CWhy not this: Client-side encryption requires encryption before upload rather than server-side processing.

    DWhy not this: SSE-S3 uses S3-managed keys, not a customer managed KMS key.

    SSE-KMS lets S3 encrypt objects using a customer managed KMS key, with KMS API activity recorded in AWS CloudTrail. SSE-S3 uses S3-managed keys rather than the specified customer managed KMS key.

    Open this question
  29. Question 29

    Security

    A custom client signs a DynamoDB request with valid credentials and the correct Region, service, and timestamp. A proxy then reformats the JSON body without changing its meaning, and DynamoDB returns SignatureDoesNotMatch; what should the developer change?

    Show the answer

    Correct answerA. Prevent body changes after request signing

    AWhy this is right: The transmitted payload must match the payload used to calculate the signature.

    BWhy not this: Permissions affect authorization after authentication; they do not repair a signature invalidated by payload changes.

    CWhy not this: DynamoDB API requests use AWS request authentication, not an identity provider token substituted for the signature.

    DWhy not this: The credentials are valid, and a longer session does not correct a changed payload hash.

    Signature Version 4 binds the request to its payload hash, so even semantically equivalent JSON changes invalidate the signature. Broader IAM permissions cannot fix a mismatch between the signed bytes and the transmitted bytes.

    Open this question
  30. Question 30

    Security

    An application generates an S3 presigned GET URL valid for 60 minutes using role credentials that expire in 40 minutes. A bucket policy denies requests when s3:signatureAge exceeds 900,000 milliseconds; assuming no other restrictions, how long after signing can a new download begin?

    Show the answer

    Correct answerA. Up to 15 minutes

    AWhy this is right: 900,000 milliseconds equals 15 minutes, making the bucket policy the earliest applicable limit.

    BWhy not this: Credential expiration would limit access at 40 minutes, but the signature-age restriction takes effect sooner.

    CWhy not this: The signature-age limit is measured from signing; it is not added to the requested URL lifetime.

    DWhy not this: The requested URL lifetime cannot override an earlier bucket policy restriction or credential expiration.

    The signature-age policy limits new requests to 15 minutes after signing, earlier than either credential expiration or URL expiration. The credentials' remaining 40-minute lifetime does not override the bucket policy's explicit deny.

    Open this question
  31. Question 31

    Security

    An application has valid AWS credentials and must call DynamoDB. The developer wants to avoid implementing request-signing logic; which approach should the developer use?

    Show the answer

    Correct answerC. Use an AWS SDK client configured with the credentials

    AWhy not this: The secret access key is used locally to derive a signature, not sent to DynamoDB in a header.

    BWhy not this: A resource policy defines permissions; it does not supply credentials or sign an HTTP request.

    CWhy this is right: AWS SDK clients automatically sign requests using the credentials supplied through their credential configuration.

    DWhy not this: A role ARN identifies a role but is not a credential or bearer token.

    AWS SDK clients sign service requests using the configured credentials. HTTPS protects transport but does not replace request authentication, and the secret access key must not be transmitted as an authentication header.

    Open this question
  32. Question 32

    Security

    Which CloudFront mechanism embeds authorization in a link to provide time-limited access to one private file?

    Show the answer

    Correct answerA. CloudFront signed URL

    AWhy this is right: A signed URL embeds authorization information in a link and can restrict when the file is accessible.

    BWhy not this: A response headers policy changes response headers rather than authorizing access through a link.

    CWhy not this: Signed cookies carry authorization in cookies, not in the file's link.

    DWhy not this: Origin access control secures requests from CloudFront to an origin, not viewer authorization in a link.

    A CloudFront signed URL carries authorization and expiration information in the link. Signed cookies provide authorization through cookies rather than embedding it in the URL.

    Open this question
  33. Question 33

    Security

    An application must migrate KMS ciphertext to a different symmetric KMS key without exposing plaintext to application code, while preserving its encryption context. The role has kms:ReEncryptFrom on the source and kms:ReEncryptTo on the destination. What should the developer do?

    Show the answer

    Correct answerB. Call ReEncrypt with the destination key and matching source and destination contexts.

    AWhy not this: An alias change affects future key selection but does not change the key protecting existing ciphertext.

    BWhy this is right: ReEncrypt keeps plaintext inside KMS and supports the stated source and destination permissions and encryption contexts.

    CWhy not this: Decrypt returns plaintext to the caller and requires kms:Decrypt, which the stated permissions do not provide.

    DWhy not this: GenerateDataKey creates a new data key; it does not migrate existing KMS ciphertext.

    ReEncrypt changes the protecting KMS key within AWS KMS without returning plaintext to the application. Supplying the original context for both source and destination preserves it. Decrypt followed by Encrypt exposes plaintext and requires different permissions.

    Open this question
  34. Question 34

    Security

    Which operations apply to an asymmetric KMS key pair configured for encryption and decryption? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersB. Encrypt data with the public key.D. Decrypt data with the private key.

    AWhy not this: Private-key encryption is not a supported encryption operation; digital signing is a distinct operation.

    BWhy this is right: The public key encrypts data that only the corresponding private key can decrypt.

    CWhy not this: The public key cannot decrypt ciphertext produced for this asymmetric encryption key pair.

    DWhy this is right: The private key decrypts ciphertext encrypted with the corresponding public key.

    For an asymmetric encryption key pair, the public key encrypts and the private key decrypts. Treating private-key encryption as the reverse operation confuses encryption with digital signing, which uses a signing key and a different operation.

    Open this question
  35. Question 35

    Security

    A developer generates an RSA SSH key pair locally for a Linux EC2 development instance. Which material should the developer import into Amazon EC2 before selecting the key pair at launch?

    Show the answer

    Correct answerD. The public SSH key

    AWhy not this: The private key remains with the developer and is not the material imported through EC2 key pair import.

    BWhy not this: An X.509 certificate is not the public SSH key expected by EC2 key pair import.

    CWhy not this: A KMS key ARN identifies a KMS resource, not an SSH public key usable for instance login.

    DWhy this is right: EC2 imports the public key so the instance can authenticate a client holding the matching private key.

    Amazon EC2 imports the public SSH key, which is made available to the instance for login authentication. The developer retains the private key locally to prove possession; importing it would expose the secret rather than configure the required public key.

    Open this question
  36. Question 36

    Security

    A development server needs a TLS certificate trusted by clients that already trust the company's AWS Private CA. Its private key must be generated on the server and never leave it. What should the developer do?

    Show the answer

    Correct answerB. Generate a local key and CSR, then have AWS Private CA sign the CSR.

    AWhy not this: Exporting an ACM-generated private key does not satisfy the requirement to generate and retain the key only on the server.

    BWhy this is right: A CSR contains the public key and identifying information, allowing the CA to issue a certificate without receiving the private key.

    CWhy not this: A self-signed certificate does not chain to the company's trusted private CA.

    DWhy not this: An ACM-issued certificate uses a different private key; copying the certificate chain does not provide a matching local key.

    A locally generated private key stays on the server while AWS Private CA signs the certificate signing request (CSR), producing a certificate under the trusted hierarchy. An ACM-issued private certificate does not use the server's locally generated private key.

    Open this question
  37. Question 37

    Security

    A developer enables automatic rotation on a symmetric customer managed KMS key. An application must continue decrypting ciphertext created before rotation. What should the developer do?

    Show the answer

    Correct answerB. Continue using the same KMS key for decryption.

    AWhy not this: Automatic rotation retains the material needed to decrypt existing ciphertext, so rewriting it is unnecessary.

    BWhy this is right: The KMS key keeps its identity and uses the appropriate retained key material to decrypt older ciphertext.

    CWhy not this: Rotation does not prevent decryption of older ciphertext, so disabling it is unnecessary.

    DWhy not this: KMS retains previous key material internally; the developer does not export it to Secrets Manager.

    Automatic rotation retains previous key material, allowing the same KMS key to decrypt older ciphertext. Re-encrypting existing ciphertext is not required merely because automatic rotation changes the material used for new encryption.

    Open this question
  38. Question 38

    Security

    A custom client receives InvalidSignatureException ('Signature expired') from DynamoDB despite using valid credentials and the correct signing Region. Its system clock is 20 minutes slow; what should the developer do?

    Show the answer

    Correct answerC. Synchronize the client's system clock.

    AWhy not this: Authorization permissions do not correct an expired request timestamp.

    BWhy not this: Replacing valid access keys does not correct the timestamp used to sign requests.

    CWhy this is right: An accurate clock lets the client generate request timestamps within the accepted time window.

    DWhy not this: Credential lifetime and the acceptable timestamp window for individual requests are separate.

    AWS rejects signed requests whose timestamp is outside the allowed window (about 15 minutes from the service's time), so a clock 20 minutes off produces a "Signature expired" error. Increasing the role session duration changes credential lifetime, not the acceptable age of a signed request.

    Open this question
  39. Question 39

    Security

    An S3 bucket policy directly grants a same-account assumed-role session ARN GetObject and DeleteObject; its permissions boundary allows only ListBucket, and its identity policy explicitly denies DeleteObject. With no other restrictions, which granted actions can the session perform?

    Show the answer

    Correct answerD. GetObject only

    AWhy not this: A direct session grant does not override an applicable explicit deny of DeleteObject.

    BWhy not this: The boundary's implicit deny does not block a same-account resource grant made directly to the role session.

    CWhy not this: DeleteObject is explicitly denied, while GetObject is permitted by the direct session grant.

    DWhy this is right: The session grant permits GetObject despite the boundary's omission, while the explicit deny blocks DeleteObject.

    A same-account resource policy grant directly to a role session is not limited by an implicit deny in its permissions boundary. GetObject is therefore allowed, but the explicit identity-policy deny still blocks DeleteObject.

    Open this question
  40. Question 40

    Security

    An S3 bucket must invoke a Lambda function only for events from that bucket in the expected account. Which function-policy configuration meets this requirement?

    Show the answer

    Correct answerA. Grant the S3 service permission conditioned on source ARN and source account.

    AWhy this is right: The service principal permits S3 invocation, while source conditions restrict the originating bucket and account.

    BWhy not this: The invoking principal is the S3 service, not the bucket owner's root principal.

    CWhy not this: S3 invokes the function; allowing the Lambda service does not authorize S3 event delivery.

    DWhy not this: Execution-role permissions govern the function's outbound access, not incoming invocation authorization.

    The function's resource-based policy should allow s3.amazonaws.com to invoke it, restricted by AWS:SourceArn and AWS:SourceAccount. The execution role controls what the function can do after invocation, not which S3 bucket may invoke it.

    Open this question
  41. Question 41

    Security

    A role in account A has an identity policy allowing GetObject on an unencrypted S3 object in account B, but the bucket policy grants no cross-account access. With no explicit denies or other restrictions, which change enables access?

    Show the answer

    Correct answerC. Allow the role in the bucket policy.

    AWhy not this: A permissions boundary limits identity permissions; it does not grant access from the bucket owner's account.

    BWhy not this: A session policy limits session permissions; it cannot supply the bucket owner's authorization.

    CWhy this is right: The bucket owner's resource-based grant supplies the missing cross-account authorization.

    DWhy not this: A role trust policy controls role assumption, not access to objects owned by another account.

    Cross-account S3 access requires permission from both the principal's account and the resource owner's account. A bucket policy granting the role access supplies the missing resource-side permission; a role trust policy instead controls who can assume the role.

    Open this question
  42. Question 42

    Security

    Which credential component identifies the AWS access key used to sign an API request?

    Show the answer

    Correct answerC. Access key ID

    AWhy not this: A session token accompanies temporary credentials but is not the access key identifier.

    BWhy not this: The secret access key is used to calculate the signature, not identify the access key in the request.

    CWhy this is right: The access key ID identifies the access key whose secret is used to calculate the request signature.

    DWhy not this: A console password authenticates console sign-in, not signed AWS API requests.

    The access key ID identifies the access key used for a signed request. The secret access key is used to calculate the signature and is not sent as the key identifier.

    Open this question
  43. Question 43

    Security

    What can a developer generate locally to enable HTTPS on a development server without obtaining a certificate from a certificate authority?

    Show the answer

    Correct answerC. A self-signed certificate

    AWhy not this: A certificate signing request must be signed to produce a usable certificate.

    BWhy not this: A symmetric KMS key cannot serve as a TLS server certificate.

    CWhy this is right: A self-signed certificate provides a server certificate without requiring a certificate authority.

    DWhy not this: An SSH key pair supports SSH authentication, not the certificate required for HTTPS.

    A self-signed certificate can enable HTTPS without a certificate authority, although clients must explicitly trust it. A certificate signing request requests a certificate; it is not itself a certificate.

    Open this question
  44. Question 44

    Security

    An application's CloudWatch Logs contain email addresses. Support engineers must see masked values, while authorized investigators must be able to view the original values. What should the developer configure?

    Show the answer

    Correct answerA. A data protection policy with restricted logs:Unmask permission

    AWhy this is right: Data protection policies mask sensitive values, and logs:Unmask controls who can reveal them.

    BWhy not this: Encryption at rest does not provide field-level masking for users who can read the logs.

    CWhy not this: Retention policies expire events by age, not by sensitive content or reader permissions.

    DWhy not this: Subscription filters forward matching events; they do not delete or mask the source events.

    A CloudWatch Logs data protection policy can mask detected sensitive data, while logs:Unmask controls access to original values. KMS encryption protects stored logs but does not selectively mask email addresses for readers.

    Open this question
  45. Question 45

    Security

    An application must remove names and postal addresses from English customer messages before storing them for analytics. Which approach should the developer use?

    Show the answer

    Correct answerB. Use Amazon Comprehend DetectPiiEntities and redact the returned spans.

    AWhy not this: SecureString protects stored parameter values but does not identify or remove PII in messages.

    BWhy this is right: PII entity detection returns locations of sensitive text that the application can redact.

    CWhy not this: Sentiment detection identifies emotional tone, not names or postal addresses.

    DWhy not this: Encryption does not remove PII; authorized analytics processing would still receive the sensitive content.

    DetectPiiEntities identifies PII and returns offsets that the application can use to redact sensitive text before storage. Encrypting messages protects confidentiality but does not remove PII from the content used for analytics.

    Open this question
  46. Question 46

    Security

    Which AWS service discovers sensitive data, such as personally identifiable information, in Amazon S3 objects?

    Show the answer

    Correct answerC. Amazon Macie

    AWhy not this: Secrets Manager manages stored secrets rather than discovering sensitive content in S3 objects.

    BWhy not this: Key Management Service manages cryptographic keys rather than identifying sensitive object contents.

    CWhy this is right: Macie analyzes S3 objects to discover sensitive data, including PII.

    DWhy not this: Certificate Manager provisions and manages TLS certificates rather than classifying stored data.

    Amazon Macie discovers sensitive data in S3 objects using managed and custom data identifiers. Secrets Manager stores and manages secrets; it does not scan S3 objects to discover PII.

    Open this question
  47. Question 47

    Security

    A pipeline uses the Amazon EC2 CreateKeyPair API to generate development SSH keys and retains only the returned key pair ID. Developers need the private key later, but pipeline logs must not contain it. What should the developer change?

    Show the answer

    Correct answerC. Capture KeyMaterial and securely store it in AWS Secrets Manager.

    AWhy not this: A fingerprint identifies a key; it cannot reconstruct its private material.

    BWhy not this: DescribeKeyPairs returns key pair metadata, not the private key generated during creation.

    CWhy this is right: Capturing KeyMaterial at creation preserves the private key without placing it in pipeline logs.

    DWhy not this: EBS encryption protects volume data; it does not preserve the private key returned by CreateKeyPair.

    CreateKeyPair returns the private key in KeyMaterial only when the key pair is created, so the pipeline must securely capture it then. DescribeKeyPairs returns metadata, not a recoverable copy of the private key.

    Open this question
  48. Question 48

    Security

    A monitoring provider assumes customer roles from a shared AWS account. A customer needs to prevent another customer from tricking the provider into assuming its role; what should the customer require?

    Show the answer

    Correct answerB. A customer-specific external ID

    AWhy not this: A principal tag can support access control but does not provide the provider's customer-specific assumption safeguard.

    BWhy this is right: A unique external ID lets the trust policy bind the provider's role-assumption request to the intended customer.

    CWhy not this: A source IP restriction identifies a network origin, not which customer authorized the shared provider's request.

    DWhy not this: A role session name supports attribution but is not the intended confused deputy protection.

    A unique external ID checked by the role's trust policy mitigates the cross-account confused deputy problem. A role session name identifies a session but is not the intended control for binding a provider's request to a customer.

    Open this question
  49. Question 49

    Security

    Which AssumeRole parameter supplies a session identifier that appears in the assumed-role session ARN recorded in AWS CloudTrail?

    Show the answer

    Correct answerD. RoleSessionName

    AWhy not this: ExternalId supplies a value for trust-policy validation rather than naming the session.

    BWhy not this: DurationSeconds specifies how long the requested credentials should remain valid.

    CWhy not this: PolicyArns specifies managed session policies that restrict the session's permissions.

    DWhy this is right: RoleSessionName supplies the session identifier included in the assumed-role session ARN.

    RoleSessionName identifies the assumed-role session and forms part of its ARN, supporting attribution in CloudTrail. ExternalId is used for trust-policy checks, not as the session identifier in the ARN.

    Open this question
  50. Question 50

    Security

    An application's IAM role must list object keys in one S3 bucket but must not read object contents. Which permission should its identity-based policy allow?

    Show the answer

    Correct answerC. s3:ListBucket on the bucket ARN

    AWhy not this: ListBucket requires a bucket resource; object ARNs do not match its resource type.

    BWhy not this: GetObject reads object contents and requires an object resource, not the bucket ARN.

    CWhy this is right: ListBucket permits listing object keys and uses the bucket ARN as its resource.

    DWhy not this: GetObject on object ARNs permits reading contents rather than listing keys.

    s3:ListBucket authorizes listing object keys and applies to the bucket ARN. s3:GetObject authorizes reading object contents and applies to object ARNs, so it does not meet the requirement.

    Open this question