SaveMyCert
Log in
5 of 5 free questions left today·for 10 a day
SOA-C03 · Domain 4

Security and Compliance practice questions

Security and Compliance is worth 16% of the SOA-C03 exam — the lightest of the 5 domains. IAM policy management and access auditing, multi-account security strategies, and protecting data and infrastructure. 6 fully worked examples are further down this page, answers included.

Exam weight
16%
the lightest of the 5 domains
Questions
84
across 2 topics
Free, no account
5/day
a free account allows 10 a day
Explanations
Every option
right and wrong

Build a practice session

5 free questions left today.

Domains

How many?

5 free questions left today.

Mode

Ready when you are

10 fresh questions drawn across 1 of 5 domains, in Learn mode.

Review what you missed

Every question you answer incorrectly, and every question you flag while practising, is saved here automatically. Finish a session and you can come back to re-drill just those.

6 sample Security and Compliance questions, fully explained

Questions from the SOA-C03 bank mapped to domain 4, with the answer key and the reasoning behind every option. None of them repeat the examples on the main SOA-C03 practice page.

Question 1Security and Compliance

During a credential review, a CloudOps engineer finds that an application on an EC2 instance reads an IAM user's access key ID and secret access key from a configuration file to call Amazon S3. The security team wants no long-term credentials on the instance and no change to how the AWS SDK is configured in the code. What should the engineer do?

Choose one.

  • a
    Store the access keys in Secrets Manager with rotation enabled and have the application fetch them at startup.

    The keys are still long-term IAM user credentials, and the application now needs code to fetch them from Secrets Manager, which breaks the no-code-change constraint.

  • b
    Encrypt the configuration file with a KMS key and grant the instance permission to decrypt it at startup.

    Encryption protects the file at rest, but the application still decrypts and uses the same long-term keys, and it needs new decryption code.

  • c
    Attach an IAM role through an instance profile, then delete the file and the IAM user's access keys. Correct

    The SDK's default credential provider chain picks up the role's temporary, automatically rotated credentials from the instance metadata service, so no long-term keys remain and the code is unchanged.

  • d
    Move the access keys into environment variables that the instance's user data script exports at boot.

    The SDK would read them without a code change, but they are still long-term keys, and user data is readable by anyone who can view the instance attributes.

The concept

Workloads on EC2 should get credentials from an IAM role delivered through an instance profile, not from long-term access keys stored on the instance.

Why that’s the answer

An instance profile makes the role's temporary credentials available through the instance metadata service, and every AWS SDK's default credential provider chain finds them without code changes. Deleting the IAM user's keys removes the long-term secret entirely. Secrets Manager and KMS protect the keys but keep them long-term and need code changes; environment variables via user data keep long-term keys in a readable place.

How to reason it out
  1. Identify the risk: long-term IAM user keys on the instance.
  2. Prefer temporary credentials from an IAM role for any AWS-hosted workload.
  3. For EC2, attach the role through an instance profile; the SDK finds it automatically.
  4. Remove the file and delete the user's access keys.

Exam tip: Workloads on EC2 use an instance profile role, never stored access keys.

IAM, AWS Organizations, and Compliance Tools for CloudOps (SOA-C03) — the lesson that teaches this.

Question 2Security and Compliance

An IAM role in account A must upload objects directly to an S3 bucket owned by account B while keeping its own identity, without assuming a role in account B. The role's identity-based policy allows s3:PutObject on arn:aws:s3:::reports-b/*, the bucket uses SSE-S3 and has S3 Block Public Access turned on. Every upload fails with AccessDenied. What is the MOST likely cause?

Choose one.

  • a
    The role in account A also needs sts:AssumeRole permission on a role in account B before it can upload.

    No role in account B is assumed in this design. Direct cross-account access with the caller's own identity uses the bucket policy, not role assumption.

  • b
    S3 Block Public Access on the bucket rejects requests that come from principals in other AWS accounts.

    Block Public Access blocks public grants (for example Principal "*" without restricting conditions). A bucket policy that names a specific role in another account is not public, so it is not blocked.

  • c
    The identity-based policy also needs s3:PutObjectAcl so that ownership of uploads passes to account B.

    With the default Object Ownership setting (bucket owner enforced) ACLs are disabled and the bucket owner owns every object, so no ACL permission is needed for the upload to succeed.

  • d
    The bucket policy in account B has no statement that grants the account A role s3:PutObject. Correct

    Across accounts both sides must allow: the identity policy in account A and the resource-based bucket policy in account B. The missing bucket-policy grant explains the AccessDenied.

The concept

Within one account, an allow from either the identity-based or the resource-based policy is enough. Across accounts, both the caller's identity policy and the target resource's policy must allow the request.

Why that’s the answer

The identity policy in account A already allows s3:PutObject, so the gap is on account B's side: the bucket policy must name the role (or account A) as a principal. Role assumption is an alternative design, not a requirement. Block Public Access does not affect a policy that grants a specific external principal, and with ACLs disabled by default there is no object-ownership step.

How to reason it out
  1. Note that the caller keeps its own identity, so this is resource-policy based cross-account access.
  2. Remember that cross-account requests need an allow in both accounts.
  3. Confirm account A's side already allows the action.
  4. Conclude the bucket policy in account B is missing the grant.

Exam tip: Cross-account access needs two allows: the caller's identity policy and the resource's policy.

IAM, AWS Organizations, and Compliance Tools for CloudOps (SOA-C03) — the lesson that teaches this.

Question 3Security and Compliance

A company keeps shared deployment artifacts in an S3 bucket. Principals in the company's AWS Organizations organization must be able to read them, including principals in accounts created next year, and nobody outside the organization may read them. Which bucket policy statement meets this with the LEAST ongoing maintenance?

Choose one.

  • a
    Allow s3:GetObject to Principal "*" with a StringEquals condition on aws:PrincipalOrgID set to the organization ID Correct

    aws:PrincipalOrgID is compared with the organization of the calling principal's account, so present and future member accounts are admitted and outsiders are not, with no policy edits.

  • b
    Allow s3:GetObject to Principal "*" with a StringEquals condition on aws:SourceOrgID set to the organization ID

    aws:SourceOrgID describes the resource on whose behalf an AWS service principal acts (a confused-deputy guard). It is not set for requests made directly by IAM principals, so readers would be denied.

  • c
    Allow s3:GetObject to a Principal list of the current member account IDs, updated whenever an account joins

    This works today but needs a policy change for each new account, which is the ongoing maintenance the requirement rules out.

  • d
    Allow s3:GetObject to Principal "*" with a StringEquals condition on aws:PrincipalAccount set to the management account

    aws:PrincipalAccount matches a single account ID, so only principals in the management account could read the objects.

The concept

The aws:PrincipalOrgID global condition key lets a resource-based policy grant access to every principal whose account belongs to a given AWS Organizations organization.

Why that’s the answer

Pairing Principal "*" with aws:PrincipalOrgID restricts the grant to the organization and automatically covers accounts that join later. aws:SourceOrgID looks similar but applies to AWS service principals acting on behalf of a resource; aws:PrincipalAccount matches one account; an explicit account list needs editing for every new account.

How to reason it out
  1. Translate the requirement: any principal in the organization, now or later.
  2. Pick the key that tests the calling principal's organization: aws:PrincipalOrgID.
  3. Discard aws:SourceOrgID, which is for service principals, and aws:PrincipalAccount, which is one account.
  4. Discard account lists because they need maintenance on every account change.

Exam tip: Org-wide resource sharing: Principal "*" plus aws:PrincipalOrgID.

IAM, AWS Organizations, and Compliance Tools for CloudOps (SOA-C03) — the lesson that teaches this.

Question 4Security and Compliance

A compliance rule says IAM users may call AWS APIs only while connected to the corporate office. Office traffic reaches the AWS public endpoints over the internet through NAT addresses in 203.0.113.0/24, while office workstations use 10.20.0.0/16 internally. Which condition block should a CloudOps engineer place in a Deny statement so that requests from anywhere else are refused?

Choose one.

  • a
    "NotIpAddress": { "aws:SourceIp": "203.0.113.0/24" } Correct

    aws:SourceIp holds the public address AWS sees, which is the office NAT range, and NotIpAddress makes the Deny match every request that does not come from it.

  • b
    "NotIpAddress": { "aws:VpcSourceIp": "203.0.113.0/24" }

    aws:VpcSourceIp exists only on requests made through a VPC endpoint. For these public-endpoint calls the key is missing, and a negated operator such as NotIpAddress on a missing key evaluates to true, so the Deny would refuse every request, including the office's.

  • c
    "NotIpAddress": { "aws:SourceIp": "10.20.0.0/16" }

    AWS never sees the internal workstation addresses; it sees the NAT addresses. This Deny would block the office itself.

  • d
    "IpAddress": { "aws:SourceIp": "203.0.113.0/24" }

    With IpAddress the Deny matches requests from the office, which inverts the rule: office calls are refused and everyone else is not.

The concept

aws:SourceIp contains the public IP address AWS receives the request from. To restrict callers to a network, a Deny uses NotIpAddress with that network's public range.

Why that’s the answer

Requests reach public AWS endpoints from the office's NAT addresses, so the Deny must test aws:SourceIp against 203.0.113.0/24 with NotIpAddress. Internal RFC 1918 addresses are never visible to AWS, aws:VpcSourceIp is populated only for VPC endpoint traffic, and IpAddress would invert the logic.

How to reason it out
  1. Work out which address AWS sees: the office's public NAT range.
  2. Choose the key that carries it for public-endpoint traffic: aws:SourceIp.
  3. In a Deny, use the negated operator NotIpAddress so everything outside the range is refused.
  4. Check the CIDR is the public one, not the internal one.

Exam tip: IP restriction = Deny with NotIpAddress on aws:SourceIp using the public range AWS actually sees.

IAM, AWS Organizations, and Compliance Tools for CloudOps (SOA-C03) — the lesson that teaches this.

Question 5Security and Compliance

A platform team lets application developers create IAM roles for their workloads. Security requires that no developer-created role can exceed an approved set of permissions, even if a developer attaches AdministratorAccess to it, and that developers cannot remove that cap afterwards. Which approach meets the requirement?

Choose one.

  • a
    Attach the approved permission set to the developers' own role so that roles they create inherit it as their ceiling.

    Permissions are not inherited by roles a principal creates. Each new role gets exactly the policies attached to it, so this caps the developers but not their roles.

  • b
    Run IAM Access Analyzer policy validation on each new role and alert the security team when it grants too much.

    Policy validation is a review and detection aid. It does not stop a role from holding broad permissions in the meantime, so it is not a cap.

  • c
    Condition the developers' iam:CreateRole permission on a required permissions boundary and deny boundary changes. Correct

    The iam:PermissionsBoundary condition forces every new role to carry the approved boundary, which limits it to the intersection with its policies; denying DeleteRolePermissionsBoundary and changes to the boundary policy stops developers removing it.

  • d
    Condition the developers' iam:CreateRole permission on a required session policy and deny policy detachment.

    Session policies are passed at AssumeRole time by the caller, not fixed on the role at creation, so they cannot be required through CreateRole and do not cap the role.

The concept

A permissions boundary sets the maximum permissions an IAM role or user can have; the effective permissions are the intersection of its identity policies and the boundary, and the boundary grants nothing.

Why that’s the answer

Safe delegation needs two pieces: developers may create roles only when the request attaches the approved boundary (iam:PermissionsBoundary condition on iam:CreateRole and the policy-attachment actions), and they are denied the actions that would remove or edit it. Inheriting permissions does not exist, session policies are chosen per session by the caller, and Access Analyzer validation only reports.

How to reason it out
  1. Recognise the need for a per-role ceiling that survives AdministratorAccess: a permissions boundary.
  2. Make the boundary mandatory with an iam:PermissionsBoundary condition on iam:CreateRole.
  3. Deny iam:DeleteRolePermissionsBoundary and edits to the boundary policy so the cap cannot be removed.
  4. Rule out detective checks and session policies, which do not fix a ceiling on the role.

Exam tip: Delegate role creation with a mandatory permissions boundary, and deny removing it.

IAM, AWS Organizations, and Compliance Tools for CloudOps (SOA-C03) — the lesson that teaches this.

Question 6Security and Compliance

An IAM user's identity-based policy allows s3:GetObject on every object in a bucket in the same account. The bucket policy contains a Deny for s3:GetObject on the finance/ prefix with Principal "*". What happens when the user requests finance/q3.csv?

Choose one.

  • a
    The request succeeds, because the user's identity-based allow is evaluated before the bucket policy is.

    IAM does not evaluate policy types in a precedence order where an earlier allow wins. All applicable policies are evaluated, and a matching Deny in any of them decides.

  • b
    The request succeeds, because a same-account allow from either policy type is enough to grant access.

    That rule describes how allows combine within one account. It does not let an allow override a matching Deny.

  • c
    The request succeeds unless the user's identity-based policy also contains a matching Deny for the prefix.

    The bucket policy's matching Deny already refuses the request. A Deny in any applicable policy decides, so it does not need to be repeated in the identity-based policy.

  • d
    The request fails, because the Deny in the bucket policy overrides the allow in the identity policy. Correct

    A matching Deny in any applicable policy, identity-based or resource-based, overrides every allow.

The concept

In IAM policy evaluation, a matching Deny in any applicable policy overrides every Allow.

Why that’s the answer

Evaluation gathers all applicable policies. If any statement denies the request, the result is deny, whatever the allows say. Same-account allows from either policy type combine, but that only matters when nothing denies.

How to reason it out
  1. Collect the applicable policies: the identity policy and the bucket policy.
  2. Check for a matching Deny: the bucket policy denies finance/.
  3. Apply the rule that a matching Deny overrides any Allow.

Exam tip: A matching Deny anywhere beats every Allow.

IAM, AWS Organizations, and Compliance Tools for CloudOps (SOA-C03) — the lesson that teaches this.

What SOA-C03 domain 4 tests, topic by topic

The official exam guide breaks Security and Compliance into 2 topics. The question bank follows the same split, so a weak topic shows up as a cluster of misses you can go back and read.

Published SOA-C03 practice questions per topic in Security and Compliance
TopicWhat it coversQuestions
Implement and manage security and compliance tools and policiesExam guide task 4.1. IAM features — password policies, MFA, roles, federated identity, resource policies, policy conditions; troubleshooting and auditing access with CloudTrail, IAM Access Analyzer, and the IAM policy simulator; secure multi-account strategies (AWS Organizations, service control policies, IAM Identity Center); remediating Trusted Advisor security checks; enforcing compliance requirements and continuous monitoring (Region and service selections, AWS Config conformance packs).42
Implement strategies to protect data and infrastructureExam guide task 4.2. Data classification schemes; encryption at rest (AWS KMS) and in transit (ACM); securely storing secrets with AWS services; configuring reports and remediating findings across Security Hub, GuardDuty, AWS Config, Inspector, and AWS Security Agent.42
Total84

Revise Security and Compliance before you drill it

Other SOA-C03 domains

Security and Compliance: your questions

Security and Compliance is domain 4 of the SOA-C03 exam guide and carries 16% of the scored content — the lightest of the 5 domains. On a 65-question paper that works out to roughly 10 questions, though AWS does not publish an exact per-domain count and individual exam forms vary.

Source

The domain weight and topic list on this page come from the official SOA-C03 exam guide.