BrainyBeeBrainyBee
ExploreBlogStart Studying
HomeAWS Certified DevOps Engineer - Professional (DOP-C02)Designing Policies for Least Privilege Access
Study Guide880 words

Designing Policies for Least Privilege Access

Designing policies to enforce least privilege access

Designing Policies for Least Privilege Access

This guide covers the core strategies for implementing the principle of least privilege (PoLP) within a multi-account AWS environment. It focuses on the intersection of Service Control Policies (SCPs), IAM Policies, and Permission Boundaries to create a robust security posture.

Learning Objectives

By the end of this guide, you should be able to:

  • Explain the evaluation logic between SCPs, IAM policies, and Permission Boundaries.
  • Design Service Control Policies (SCPs) to act as organizational guardrails.
  • Differentiate between Role-Based Access Control (RBAC) and Attribute-Based Access Control (ABAC).
  • Implement Permission Boundaries to delegate IAM administration safely.

Key Terms & Glossary

  • Least Privilege: The practice of limiting access rights for users to the bare minimum permissions they need to perform their work.
  • Service Control Policy (SCP): A type of organization policy used to manage permissions in your organization, acting as a filter for what actions are possible.
  • Permission Boundary: A managed policy used to set the maximum permissions that an identity-based policy can grant to an IAM entity.
  • Principal: An entity in AWS that can perform actions and access resources (e.g., a User or Role).
  • Implicit Deny: The default state where every request is denied unless an explicit Allow is present.
  • Explicit Deny: A policy statement that specifically denies an action; it always overrides any Allow.

The "Big Idea"

In a modern DevOps environment, security cannot be managed manually at the user level. Instead, security is implemented as Defense in Depth. Think of it as a series of filters: SCPs define the "maximum possible" permissions for an account, Permission Boundaries define the "maximum allowed" for a specific role, and IAM Policies grant the "actual" permissions. Access is only granted where all these layers overlap.

Policy Evaluation & Logic Box

Rule TypeLogic Description
The Golden RuleExplicit Deny > Explicit Allow > Implicit Deny
SCP LogicSCPs do not grant permissions. They only filter what can be granted by IAM.
Organization HierarchyPermissions are filtered from the Root →\rightarrow→ OU →\rightarrow→ Account.
Net Permission FormulaAllowed=(Identity Policy∩Permission Boundary∩SCP)∪Resource PolicyAllowed = (Identity\ Policy \cap Permission\ Boundary \cap SCP) \cup Resource\ PolicyAllowed=(Identity Policy∩Permission Boundary∩SCP)∪Resource Policy

Hierarchical Outline

  1. Organizational Guardrails (SCPs)
    • Whitelist Approach: Deny all, then explicitly allow specific services.
    • Blacklist Approach: Allow all, then explicitly deny sensitive actions (e.g., StopLogging).
  2. Identity-Based Controls
    • RBAC: Access based on job function (e.g., "Developer" role).
    • ABAC: Access based on tags (e.g., "Access if Principal.Project == Resource.Project").
  3. Delegation Controls
    • Permission Boundaries: Prevent "privilege escalation" when developers create their own roles.
  4. Resource-Based Policies
    • Attached directly to resources (S3 buckets, KMS keys).
    • Can allow cross-account access.

Visual Anchors

Policy Evaluation Flow

Loading Diagram...
Figure 1 — Mermaid diagram

Permission Intersection

Compiling TikZ diagram…
⏳
Running TeX engine…
This may take a few seconds
Figure 2 — TikZ diagram

Definition-Example Pairs

  • Service Control Policy (SCP)
    • Definition: A policy that sets the maximum available permissions for all accounts in an OU.
    • Example: A policy that prevents any account in the "Production" OU from deleting S3 buckets, regardless of what the Admin user within that account tries to do.
  • Attribute-Based Access Control (ABAC)
    • Definition: Defining permissions based on attributes (tags) rather than static roles.
    • Example: A developer can only start/stop EC2 instances where the tag Environment matches their own user tag Team.

Worked Examples

Example 1: Preventing Shadow IT with SCPs

Scenario: You want to ensure that developers in a specific OU only use us-east-1 and us-west-2 to control costs.

Solution (SCP):

json
{ "Version": "2012-10-17", "Statement": [ { "Sid": "DenyAllOutsideRequestedRegions", "Effect": "Deny", "NotAction": ["iam:*", "organizations:*", "route53:*", "cloudfront:*"], "Resource": "*", "Condition": { "StringNotEquals": {"aws:RequestedRegion": ["us-east-1", "us-west-2"]} } } ] }

Note: Global services like IAM must be excluded from the regional deny.

Example 2: Using Permission Boundaries

Scenario: You allow a Junior Admin to create IAM Roles for Lambda functions, but you want to ensure they cannot create a Role with AdministratorAccess.

Solution:

  1. Create a "Boundary Policy" that only allows S3 and CloudWatch Logs.
  2. In the Junior Admin's IAM policy, use a condition that requires the PermissionsBoundary parameter to be attached to any CreateRole call.

Checkpoint Questions

  1. If an SCP allows s3:* but an IAM Policy has no statement regarding S3, is access granted? (Answer: No, it is an implicit deny).
  2. Which policy type takes precedence: an IAM Explicit Deny or an SCP Explicit Allow? (Answer: IAM Explicit Deny; any Deny always wins).
  3. Does an SCP affect the Management Account of an organization? (Answer: No, SCPs do not restrict the management account principal).

Muddy Points & Cross-Refs

  • SCPs vs. IAM: A common confusion is thinking SCPs grant access. They do not. Even if an SCP says Allow *, the user still needs an IAM policy to do anything.
  • Resource-Based Policies: These are unique because they can grant access even if an IAM Policy doesn't (as long as no Deny exists). However, they cannot bypass an SCP deny.
  • Cross-Ref: For further reading on account automation, see "AWS Control Tower and Guardrails."

Comparison Tables

FeatureIAM PolicyService Control Policy (SCP)Permission Boundary
ScopeIndividual User/RoleEntire Account or OUIndividual User/Role
Can Grant Access?YesNo (Only filters)No (Only filters)
Affects Root User?NoYesNo
Best ForDay-to-day permissionsSecurity guardrailsDelegated administration
All AWS Certified DevOps Engineer - Professional (DOP-C02) Study Resources

Related Notes

  • Mastering AWS Alerting and Automated Remediation1,050 words
  • Study Guide: Analyzing Failed Deployments in AWS940 words
  • Incident Analysis: Troubleshooting Failed Processes in AWS1,050 words
  • Mastering AWS Monitoring & Security Analytics: Logs, Metrics, and Findings1,050 words
  • AWS Log Analysis: Athena, CloudWatch Insights, and OpenSearch920 words
  • Analyzing Real-Time Log Streams with Amazon Kinesis Data Streams985 words
  • CloudWatch Anomaly Detection Alarms: Professional Study Guide820 words
  • AWS Application Storage Patterns: EBS, EFS, and S31,054 words
  • Lab: Automating Security Controls and Data Protection with AWS Secrets Manager and Config942 words
  • Master Study Guide: Automating Security Controls & Data Protection (AWS DOP-C02)1,184 words
  • Mastering AWS CloudFormation StackSets: Multi-Account & Multi-Region Orchestration895 words
  • Mastering System Configuration Changes in AWS945 words

Ready to study AWS Certified DevOps Engineer - Professional (DOP-C02)?

Practice tests, flashcards, and all study notes — free, no sign-up.

Start Studying

Ready to study AWS Certified DevOps Engineer - Professional (DOP-C02)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free
AWS Certified DevOps Engineer - Professional (DOP-C02) ResourcesExplore All HivesBlogHome

© 2026 BrainyBee. Free AI-powered exam prep.

Loading Diagram...
Flowchart, top to bottom. Request Start connects to Explicit Deny?. B connects to DENY Access (Yes). B connects to SCP Allows? (No). D connects to C (No). D connects to Boundary Allows? (Yes). E connects to C (No). E connects to IAM Policy Allows? (Yes). F connects to Resource Policy Allows? (No). 3 more statements.