Skip to content

SAP-C03 · Domain 2: Security, Compliance, and Governance · 25% of the exam

Task 2.1: Design identity security architectures.

Who may do what: federation with IAM Identity Center, SAML, OIDC and SCIM, application sign-in and authorization, least privilege with roles, boundaries, session policies and ABAC, data perimeters and external access checks, and workload identities outside AWS.

Study it

  • Federation, application sign-in and least privilege: Identity Center, Cognito, roles, boundaries and ABAC

    Partly covered by: Shared Responsibility & IAM

  • Data perimeters, external access checks and workload identities outside AWS

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the AWS documentation page that proves it.

Question 1 · choose 1

A company manages its workforce in an external identity provider that supports SAML 2.0 and SCIM. Employees need access to 200 accounts in AWS Organizations. When HR adds a user to a group or removes a user, the change must reach AWS without manual work, and access must be granted by group and account. The company does not want IAM users. Which solution has the LEAST operational overhead?

  1. ACreate a SAML identity provider and federated IAM roles in each of the 200 accounts, and map the identity provider's groups to the roles
  2. BConnect the identity provider to AWS Directory Service AD Connector and grant access to the directory groups with IAM policies in each account
  3. CUse the external provider as the IAM Identity Center identity source with SCIM provisioning, and assign permission sets to groups per account
  4. DCreate an Amazon Cognito identity pool federated with the provider and give employees temporary credentials for each account through it
Show the answer and why
  • ACreate a SAML identity provider and federated IAM roles in each of the 200 accounts, and map the identity provider's groups to the roles

    Incorrect

    IAM SAML federation works, but the provider and roles must be created and kept current in every account, which is far more work than one central configuration.

  • BConnect the identity provider to AWS Directory Service AD Connector and grant access to the directory groups with IAM policies in each account

    Incorrect

    AD Connector is a directory gateway that redirects requests to an on-premises Microsoft Active Directory. It does not connect a SAML and SCIM identity provider, and per-account IAM policies would still need to be maintained.

  • CUse the external provider as the IAM Identity Center identity source with SCIM provisioning, and assign permission sets to groups per account

    Correct

    IAM Identity Center can use an external identity provider as its identity source and synchronize users and groups automatically over SCIM. Permission sets assigned to groups give access to many accounts from one place.

  • DCreate an Amazon Cognito identity pool federated with the provider and give employees temporary credentials for each account through it

    Incorrect

    Cognito identity pools give the users of your own applications temporary credentials. Workforce access to AWS accounts is what IAM Identity Center is for.

"Changes flow in automatically" points to SCIM provisioning, and "many accounts by group" points to IAM Identity Center permission sets.

Question 2 · choose 1

A company with 80 accounts in AWS Organizations must find every S3 bucket, IAM role, KMS key and Lambda function whose resource-based policy grants access to principals outside the organization. New policies that do so must be reported continuously to a security account. Which solution meets these requirements with the LEAST effort?

  1. ADeploy the AWS Config managed rule that checks for public read access on S3 buckets to every account with a conformance pack
  2. BRun Amazon Macie in every account and review its bucket inventory for buckets shared with other accounts
  3. CUse the AWS Trusted Advisor security checks from the management account to list resources shared outside the organization
  4. DCreate an organization-wide IAM Access Analyzer external access analyzer in a delegated administrator account
Show the answer and why
  • ADeploy the AWS Config managed rule that checks for public read access on S3 buckets to every account with a conformance pack

    Incorrect

    That rule looks only at public read access on S3 buckets. It does not evaluate IAM role trust policies, key policies or Lambda function policies, or access granted to specific external accounts.

  • BRun Amazon Macie in every account and review its bucket inventory for buckets shared with other accounts

    Incorrect

    Macie discovers sensitive data in S3. It does not analyze IAM roles, KMS keys or Lambda functions for external access.

  • CUse the AWS Trusted Advisor security checks from the management account to list resources shared outside the organization

    Incorrect

    Trusted Advisor runs a fixed set of best-practice checks. It does not analyze the resource policies of these resource types against an organization boundary.

  • DCreate an organization-wide IAM Access Analyzer external access analyzer in a delegated administrator account

    Correct

    An external access analyzer with the organization as its zone of trust flags any supported resource that grants access to a principal outside the organization, and it reanalyzes when policies change.

"Shared outside the organization" is the job of an organization-level IAM Access Analyzer: the organization is the zone of trust and anything beyond it becomes a finding.

Question 3 · choose 1

A consumer mobile app signs customers in with the company's own OpenID Connect (OIDC) provider. A new feature must let the app upload videos straight to an S3 bucket and write a metadata item for each video to an existing DynamoDB table whose partition key is the customer's Amazon Cognito identity ID, with no traffic passing through company servers. Each customer may touch only their own S3 prefix and their own items, the app must not contain long-term access keys, and the team does not want to build or run a service that hands out access. Which solution meets these requirements?

  1. ASend the OIDC token to AWS STS AssumeRoleWithWebIdentity for a role whose policy scopes access with the provider's subject claim
  2. BAdd the OIDC provider to a Cognito identity pool whose role scopes S3 and DynamoDB access with the caller's identity ID
  3. CAdd an API Gateway and Lambda endpoint that checks the customer and returns a presigned URL for each upload and writes the metadata item
  4. DHave the app call S3 and DynamoDB directly with the ID token that the OIDC provider issues at sign-in
Show the answer and why
  • ASend the OIDC token to AWS STS AssumeRoleWithWebIdentity for a role whose policy scopes access with the provider's subject claim

    Incorrect

    OIDC federation does exchange the token for temporary credentials, but the policy variables would carry the provider's own user ID. The Cognito identity ID in the table's partition key is not that value, so the dynamodb:LeadingKeys condition could never match a customer's items.

  • BAdd the OIDC provider to a Cognito identity pool whose role scopes S3 and DynamoDB access with the caller's identity ID

    Correct

    The identity pool exchanges the provider's ID token for temporary AWS credentials. Its role policy can use the cognito-identity.amazonaws.com:sub variable, which holds the identity ID, in S3 resource paths and in the dynamodb:LeadingKeys condition, so each customer reaches only their own prefix and partition, with no server in the path.

  • CAdd an API Gateway and Lambda endpoint that checks the customer and returns a presigned URL for each upload and writes the metadata item

    Incorrect

    Presigned URLs give time-limited access to S3 objects without putting keys in the app, but they cover only S3. The metadata writes would pass through company code, and the team would build and run the service that hands out access.

  • DHave the app call S3 and DynamoDB directly with the ID token that the OIDC provider issues at sign-in

    Incorrect

    Requests to AWS services must be signed with AWS credentials. A provider's token is not one; it has to be exchanged for temporary AWS security credentials first.

The decisive constraints are direct access to two AWS services, per-customer isolation keyed on the Cognito identity ID, and no access-issuing service to run. Presigned URLs solve the S3 half but need a backend and do not cover DynamoDB, and a provider token alone is not an AWS credential. Direct OIDC federation yields credentials, but its policy variables identify the user by the provider's ID, not by the identity ID that partitions the table. A Cognito identity pool turns the OIDC token into temporary credentials, and policy variables on the identity ID confine each customer to their own prefix and items.

Question 4 · choose 1

A billing portal signs customers in with its own session system and keeps PDF invoices in a private S3 bucket that has S3 Block Public Access turned on. Customers download about 2,000 invoices a month. Each download link must open only the one invoice it was made for and must stop working after 5 minutes. Compliance forbids storing or caching invoice files anywhere outside the bucket, and the team wants to add as little new infrastructure as possible. Which solution meets these requirements?

  1. AHave the portal's backend role create an S3 presigned GET URL for the requested invoice that expires after 5 minutes
  2. BPut a CloudFront distribution with origin access control in front of the bucket and issue CloudFront signed URLs valid for 5 minutes
  3. CAllow s3:GetObject in the bucket policy only for requests whose aws:Referer header is the portal's domain
  4. DCall GetFederationToken with a session policy for the one invoice and return the temporary credentials to the customer's browser
Show the answer and why
  • AHave the portal's backend role create an S3 presigned GET URL for the requested invoice that expires after 5 minutes

    Correct

    A presigned URL grants time-limited access to one object without changing the bucket policy, and it uses the credentials of the principal that created it. The browser fetches the file straight from the bucket, so no new service and no copy outside S3 is involved.

  • BPut a CloudFront distribution with origin access control in front of the bucket and issue CloudFront signed URLs valid for 5 minutes

    Incorrect

    Signed URLs with an expiration time are the CloudFront way to serve private content, but they need a distribution and trusted key groups, and CloudFront adds objects to its edge caches when they are requested, which the compliance rule forbids.

  • CAllow s3:GetObject in the bucket policy only for requests whose aws:Referer header is the portal's domain

    Incorrect

    AWS warns that a referer header can be forged, and aws:Referer is not one of the condition keys that make a policy non-public, so Block Public Access rejects the policy. The access would not expire either.

  • DCall GetFederationToken with a session policy for the one invoice and return the temporary credentials to the customer's browser

    Incorrect

    GetFederationToken suits a proxy application that hands out scoped temporary credentials, but its sessions last at least 900 seconds (15 minutes), and it must be called with an IAM user's long-term credentials rather than the portal's role.

Expiring, per-object links to private S3 data can come from S3 presigned URLs or from CloudFront signed URLs. Here two more constraints decide it: nothing may be cached outside the bucket, and the team wants no new infrastructure, which rules out a CloudFront distribution and its edge caches. A Referer condition is neither secure nor allowed under Block Public Access, and federation tokens cannot be shorter than 15 minutes. A 5-minute presigned URL created by the portal's backend meets every constraint.

Question 5 · choose 1

A document-sharing application needs fine-grained authorization: which of its users can view, edit or share which documents. Rules change often, and the team wants them managed as policies outside the application code. Which service fits?

  1. AAWS WAF rules on the load balancer in front of the application
  2. BAmazon Verified Permissions policies for the application's resources
  3. CIAM policies with one IAM role per application user that the app assumes
  4. DAmazon Cognito user pool groups only
Show the answer and why
  • AAWS WAF rules on the load balancer in front of the application

    Incorrect

    WAF filters web requests; it does not decide who may edit a document.

  • BAmazon Verified Permissions policies for the application's resources

    Correct

    Verified Permissions is a fine-grained permissions management and authorization service for custom applications.

  • CIAM policies with one IAM role per application user that the app assumes

    Incorrect

    IAM controls access to AWS resources, not permissions inside a custom application for each end user.

  • DAmazon Cognito user pool groups only

    Incorrect

    Groups authenticate and group users but do not express per-document permissions.

Externalized, fine-grained application authorization is Amazon Verified Permissions.

Question 6 · choose 1

A research platform will host hundreds of projects. Each researcher signs in through the company's identity provider, which passes a project attribute. Researchers may only touch S3 objects, DynamoDB items and EC2 instances that belong to their own project, and new projects start every week. The security team wants least privilege without writing a new policy for each project. Which approach meets these requirements?

  1. ACreate one IAM role per project with policies that name that project's resources, and add a role whenever a project starts
  2. BAttach a permissions boundary to every researcher role that lists the ARNs of the resources of all current projects
  3. CPass the project as a session tag and use one role whose policy requires the principal and resource project tags to match
  4. DAdd a resource-based policy to every project resource that lists the researchers of that project by their user names
Show the answer and why
  • ACreate one IAM role per project with policies that name that project's resources, and add a role whenever a project starts

    Incorrect

    Role-based access works but needs a new role and policy for every project, which is exactly the per-project work the team wants to avoid.

  • BAttach a permissions boundary to every researcher role that lists the ARNs of the resources of all current projects

    Incorrect

    A boundary sets maximum permissions for a role. A shared boundary that lists every project's resources would allow access across projects and still need editing for each new project.

  • CPass the project as a session tag and use one role whose policy requires the principal and resource project tags to match

    Correct

    Attribute-based access control compares principal tags, which an identity provider can pass as session tags, with resource tags, so one policy covers new projects without changes.

  • DAdd a resource-based policy to every project resource that lists the researchers of that project by their user names

    Incorrect

    Many of these resources, such as EC2 instances, do not support resource-based policies, and maintaining lists of users on every resource does not scale.

Many projects, frequent change and one policy point to ABAC: tag the principal and the resource, and compare the two in the policy.

Question 7 · choose 1

A new video training site streams each lesson as HLS through CloudFront from a private S3 bucket. A lesson is a playlist plus hundreds of segment files that the player requests by the relative URLs written in the playlist. Only paying subscribers may play a course, access must lapse 12 hours after sign-in, and one credential per viewer session must cover every file of the courses the viewer bought. The team will not rewrite playlists or file URLs and does not want to write or run code at the edge. Which approach meets these requirements?

  1. AIssue a CloudFront signed URL that expires in 12 hours for every playlist and segment file the subscriber requests
  2. BUse origin access control so that only CloudFront can read the bucket, and keep the course paths hard to guess
  3. CSet CloudFront signed cookies with a custom policy for the purchased course paths after sign-in, valid for 12 hours
  4. DAttach a Lambda@Edge function that validates a session token cookie against the subscriber database on each viewer request
Show the answer and why
  • AIssue a CloudFront signed URL that expires in 12 hours for every playlist and segment file the subscriber requests

    Incorrect

    Signed URLs restrict access with an expiration time, which suits single files or clients without cookie support. Here every segment URL inside the playlists would have to change to carry a signature.

  • BUse origin access control so that only CloudFront can read the bucket, and keep the course paths hard to guess

    Incorrect

    Origin access control keeps viewers from reaching the bucket directly, but it does nothing to decide which viewers CloudFront serves, so anyone with a path could play a course.

  • CSet CloudFront signed cookies with a custom policy for the purchased course paths after sign-in, valid for 12 hours

    Correct

    Signed cookies suit access to many restricted files, such as all the files of an HLS video, when you do not want to change your current URLs. A custom policy can use wildcards in the resource path to cover a whole course and sets how long the cookie is valid.

  • DAttach a Lambda@Edge function that validates a session token cookie against the subscriber database on each viewer request

    Incorrect

    Lambda@Edge runs your functions to customize what CloudFront delivers, so it could check a session token without changing URLs. It is code at the edge that the team would write and run, which it refuses.

The constraints are many files per credential, unchanged URLs, a 12-hour limit and no edge code. Signed URLs need a signature in every file URL, origin access control protects only the origin, and Lambda@Edge is custom code. Signed cookies with a wildcard custom policy cover a course's files for the session without touching the playlists.

Question 8 · choose 1

A platform team runs one Amazon EKS cluster that 40 product teams share, one Kubernetes namespace per team. Each team's pods must read only the S3 objects tagged with that team's namespace name. The platform team wants a single IAM role and policy for all teams, so that onboarding a new team adds no IAM work, and pods must never use the node's instance role for this access. Which solution meets these requirements?

  1. AUse one role through EKS Pod Identity, allowing s3:GetObject when the object tag matches the kubernetes-namespace principal tag
  2. BCreate one IAM role for service accounts (IRSA) per namespace, each with a policy that names only its team's tagged objects
  3. CGrant the node instance role read access to the bucket and restrict each namespace with Kubernetes RBAC rules
  4. DStore one set of access keys per team in Kubernetes secrets and scope each key's IAM user policy to the team's tag
Show the answer and why
  • AUse one role through EKS Pod Identity, allowing s3:GetObject when the object tag matches the kubernetes-namespace principal tag

    Correct

    EKS Pod Identity attaches session tags such as kubernetes-namespace to each pod's temporary credentials, so one role whose policy compares the object tag with that principal tag gives each team only its own objects.

  • BCreate one IAM role for service accounts (IRSA) per namespace, each with a policy that names only its team's tagged objects

    Incorrect

    Per-namespace roles would isolate the teams, but every new team needs a new role and policy, which the platform team wants to avoid.

  • CGrant the node instance role read access to the bucket and restrict each namespace with Kubernetes RBAC rules

    Incorrect

    Pods would use the node's instance role, which is forbidden, and Kubernetes RBAC controls Kubernetes API access, not calls to Amazon S3.

  • DStore one set of access keys per team in Kubernetes secrets and scope each key's IAM user policy to the team's tag

    Incorrect

    Access keys of IAM users are long-term credentials, and a user per team is again IAM work for every new team.

Pod Identity session tags (cluster name, namespace, service account and more) enable ABAC: one role and one policy can work across many service accounts by matching resource tags to principal tags.

Practice domain 2 →Practice all domains →