Data Security and Governance · Topic 2 of 7

IAM Authorization and Access Control

Apply authorization with IAM identity and resource policies, least privilege, tags, bucket policies, access points, Redshift grants and workgroups.

  • 5 min
In a nutshell
  • Explicit deny wins over every allow.
  • Cross account access needs permission on both sides: the resource policy and the caller's identity policy.
  • Bucket actions use the bucket ARN. Object actions use the object ARN with /*.

What it is

Authorization decides what an authenticated identity may do. After the role is proven, policies determine which actions on which resources are allowed.

For data engineers the goal is least privilege: every job, user and service gets only the permissions it needs, on only the resources it needs.

Requestprincipal, action, resourceevaluated byPoliciesidentity, resource, SCP, boundarydecisionAllow or denyexplicit deny wins

How it works

Policy types

Policy typeAttached toPurpose
Identity basedUser, group or roleGrants actions on resources to that identity
Resource basedThe resource, such as an S3 bucket, KMS key or Lambda functionGrants access to named principals, including other accounts
Permissions boundaryA user or roleSets the maximum permissions the identity can have
Service control policy (SCP)AWS Organizations account or OUSets guardrails on what accounts can do
Session policyAssumed role sessionNarrows permissions for that session

An explicit deny always wins. Without a deny, a request is allowed if some policy allows it and no boundary or SCP blocks it.

Within one account, an identity policy or a resource policy that allows is enough. Across accounts, both sides must allow.

Reading a policy

A policy is JSON with statements that list an effect, actions, resources and optional conditions.

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": ["s3:GetObject", "s3:ListBucket"],
    "Resource": [
      "arn:aws:s3:::my-lake",
      "arn:aws:s3:::my-lake/curated/*"
    ]
  }]
}

Bucket level actions such as s3:ListBucket apply to the bucket ARN (Amazon Resource Name), while object actions such as s3:GetObject apply to the object ARN with /*. Mixing them up is a classic cause of access denied errors.

Least privilege in practice

Give a Glue job role read access to its source prefix and write access to its target prefix, not to every bucket. Prefer AWS managed policies for quick starts and customer managed policies for tight control. Use IAM Access Analyzer to find unused permissions and resources shared outside the account.

Conditions narrow access further, for example by source VPC endpoint, by requiring TLS with aws:SecureTransport, or by tag.

Role based and attribute based access

Role based access control (RBAC) gives permissions through roles for job functions, such as analyst or engineer. Attribute based access control (ABAC) uses tags on principals and resources, so a policy says "access resources whose tag matches the user's tag".

ABAC scales well because new resources only need the right tag, not a new policy. Lake Formation tags apply the same idea to catalog resources.

S3 access controls

ControlUse
Bucket policyResource policy for the whole bucket, including cross account access
S3 Access PointsA named endpoint with its own policy, for each application or team
Block Public AccessPrevents public exposure at account or bucket level
S3 Object OwnershipDisables ACLs (access control lists) so the bucket owner controls all objects
Presigned URLsTime limited access to one object

Modern designs avoid ACLs and rely on policies.

Database and service level authorization

Redshift uses SQL GRANT and REVOKE on schemas and tables, roles, and optionally row level security policies. Athena access depends on IAM permissions for Athena, the Glue Data Catalog and S3, and workgroups can restrict who runs queries and where results go. DynamoDB supports fine grained access using condition keys such as the leading key, which restricts a user to items with their own key.

GRANT SELECT ON TABLE sales.orders TO ROLE analyst;

Cross account access

To share a bucket with another account, add a bucket policy that names the principal, or use an access point. For catalog and table sharing at scale, Lake Formation provides cross account grants. Use ExternalId when a third party assumes a role in your account, which guards against the confused deputy problem.

Auditing permissions

IAM Access Analyzer reports external access and policy problems. IAM policy simulator tests what a policy allows. CloudTrail records which calls were made, and "last accessed" information shows which permissions are unused, so you can remove them.

What to remember for the exam

  • Explicit deny wins over every allow.
  • Cross account access needs permission on both sides: the resource policy and the caller's identity policy.
  • Bucket actions use the bucket ARN. Object actions use the object ARN with /*.
  • SCPs and permissions boundaries limit permissions but never grant them.
  • ABAC uses tags to scale access control.
  • S3 Access Points give each application its own policy on a shared bucket.
  • Redshift uses GRANT and REVOKE, roles and row level security policies.
  • IAM Access Analyzer finds external access and unused permissions.
Exam tip

For "grant least privilege to a Glue job", name the exact S3 prefixes and the specific secret ARN, not a wildcard on all resources.

Common mistakes

Using s3:* on *. This breaks least privilege and often appears as the wrong answer.

Mixing up bucket and object ARNs. s3:ListBucket needs the bucket ARN, and s3:GetObject needs the object ARN.

Expecting an SCP to grant access. It only limits what accounts in the organization can do.

Forgetting the KMS key policy. A role can have S3 access and still fail if the key policy blocks decryption.

Watch out

A bucket policy with a principal of * and no condition makes the bucket public, so always pair it with conditions and keep Block Public Access on.

Check yourself

  • What happens when one policy allows and another explicitly denies?

    The explicit deny wins.

  • Which ARN does s3:GetObject apply to?

    The object ARN, such as arn:aws:s3:::my-lake/curated/*.

  • What can an SCP do?

    Limit what accounts can do, but never grant permissions by itself.

Topic 2 of 7 in Data Security and Governance

Test yourself on Data Security and Governance

The full AWS DEA-C01 question bank has 845 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by AWS. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.