Cloud concept · Updated

Least privilege - Least privilege means granting each identity or workload only the access required for its approved tasks, limited to the necessary resources, conditions, and duration.

In short

Least privilege reduces the damage that compromised credentials, software defects, and operational mistakes can cause. In cloud environments, it applies to identity permissions, workload roles, administrative access, network connectivity, and organizational guardrails, and requires ongoing review as requirements change.

Cloud Concepts Hub →

7 key aspects of Least privilege

Least privilege combines narrowly scoped permissions, limited access duration, layered controls, escalation safeguards, and continuous validation.

01
Task-scoped permissions

Grant only the actions and resources required for a defined responsibility. Separate deployment, runtime, investigation, and recovery roles so that one compromise does not expose every operational capability.

02
Limited duration and controlled delegation

Prefer temporary workload and user credentials, with session duration matched to the task. Treat presigned URLs and other bearer capabilities as sensitive delegated access, and restrict both their scope and lifetime.

03
Effective-access evaluation

Review identity policies, resource policies, trust relationships, session restrictions, and organizational controls together. Account for explicit denies and principal-specific resource-policy behavior rather than judging access from a single attached policy.

04
Layered access restrictions

Constrain identity permissions, network reachability, application authorization, and operating-system privileges independently. A network connection, CORS rule, or WAF rule does not establish that an operation is authorized.

05
Guardrails against privilege escalation

Use permissions boundaries and organization policies to constrain delegated administration. Restrict capabilities such as passing roles, editing policies, and modifying trust relationships because these can enable indirect escalation.

06
Prepared privileged access

Provision and test restricted incident-response and break-glass access before it is needed. Protect root and administrative access with strong authentication, auditability, and controlled elevation instead of routine unrestricted use.

07
Continuous review and refinement

Compare granted permissions with intended responsibilities, observed activity, and access-analysis findings. Remove unused or unintended access while testing infrequent but necessary operations to avoid breaking recovery procedures.

Cloud services for Least privilege

IAM defines narrowly scoped roles and policies, and STS turns those roles into temporary sessions rather than permanent credentials. AWS Organizations adds central guardrails that constrain supported access even when member-account administrators manage local permissions. IAM Access Analyzer helps teams discover unintended sharing, unused access, and policy issues so they can refine those permissions. Systems Manager provides controlled administrative access to managed compute, while Verified Access narrows access to supported applications using identity and device context. Together, these services support permission scope, access duration, administrative control, and ongoing review; none replaces application authorization, appropriate network restrictions, or tested incident-response procedures.

AWS OrganizationsAWS Organizations

AWS Organizations provides centrally managed permission guardrails through service control policies and resource control policies. These policies constrain supported access without granting permissions and must be designed with their documented scope and exceptions in mind.

AWS Systems ManagerAWS Systems Manager

Systems Manager Session Manager supports controlled administrative sessions without requiring inbound SSH or RDP access. Least privilege depends on restricting session initiators, target nodes, session documents, and the permissions assigned to managed nodes.

Least privilege exam questions

Real practice exam questions on Least privilege, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIB-C01 (beta)

An insurer runs an AI claims-processing application on Amazon EC2. Operations staff normally have no permission to change production resources. During an approved incident, one engineer must view health metrics and reboot two designated inference instances for up to 90 minutes. The engineer must not change instance configurations, access claims datasets, or retain production-change access after the incident window. Which access arrangement should the governance lead approve?

Show answerCORRECT ANSWER

Grant an approval-controlled IAM role session lasting no more than 90 minutes, with only the required metric-viewing permissions and reboot permission for the two designated instances. Require a new approval for any subsequent elevated session.

This arrangement limits the permitted actions, target resources, and access duration to the approved incident requirements. Requiring fresh approval prevents the engineer from simply obtaining another elevated session after the window ends.

MLA-C02 (beta)

A company shares proprietary model artifacts with external evaluators through Amazon S3 presigned download URLs. A signing application uses an IAM role that allows s3:GetObject only on objects under s3://evaluation-artifacts/approved/. The application currently generates URLs with a 1-hour expiration, and its configuration cannot be changed during the current release.

A security requirement states that each URL must work for the first 10 minutes after signing and must be rejected afterward, regardless of its configured expiration. The restriction must apply automatically to all presigned downloads under approved/ without affecting requests that use an Authorization header. The signing credentials remain valid for longer than 1 hour, and no other policies restrict these downloads.

Which bucket policy change meets these requirements?

Show answerCORRECT ANSWER

Add a Deny statement for Principal * and s3:GetObject on arn:aws:s3:::evaluation-artifacts/approved/*, with StringEquals requiring s3:authType to be REST-QUERY-STRING and NumericGreaterThan requiring s3:signatureAge to be 600000.

S3 measures s3:signatureAge in milliseconds, so 600000 represents 10 minutes. The explicit Deny overrides the signing role's Allow for older presigned requests. The authentication-type condition limits the restriction to query-string authentication, leaving Authorization-header requests unaffected. Younger URLs remain authorized by the existing role policy.

SAP-C03

A company uses AWS CloudFormation to deploy an EC2-based payment-processing application and its instance role. An existing AWS Systems Manager Parameter Store hierarchy contains three SecureString parameters:

• /payments/prod/runtime/vendor-token
• /payments/prod/runtime/database-password
• /payments/prod/runtime/admin-password

The application needs the first two parameters. The third parameter is reserved for a separate administrative service. All three parameters must remain at their current paths. The application’s parameter-loading code can be changed to use different Parameter Store retrieval APIs.

A security review requires that compromised application credentials cannot retrieve the administrative parameter, even if an attacker changes the API requests. The instance role currently has no Parameter Store permissions. Decryption permissions are already configured, and no other policies grant the role access to parameters.

Which change should a solutions architect make to the CloudFormation template and application?

Show answerCORRECT ANSWER

Allow ssm:GetParameters on only the complete ARNs of the vendor-token and database-password parameters, without granting other Parameter Store read actions. Configure the application to request those two parameters explicitly with decryption enabled.

GetParameters supports resource-level permissions for individual parameters. Restricting the action to the two required parameter ARNs lets the application retrieve its credentials without authorizing access to the administrative parameter. An attacker cannot expand that access merely by changing the requested names or choosing another retrieval API.

Practice Least privilege in a full exam

Questions on Least privilege in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Least privilege

5 min read

Least privilege is an authorization design principle: an identity should be able to perform its intended work without receiving unrelated capabilities. Effective access is constrained by actions, resources, conditions, and time. For example, an application that reads invoices should receive permission to read objects under the required storage prefix, not permission to delete objects, modify bucket policies, or access every bucket. Authentication establishes who is requesting access; authorization determines whether that identity may perform a particular operation.

Start with documented access requirements and separate responsibilities into distinct roles. Scope permissions to supported resource identifiers and use conditions where they meaningfully restrict access, such as approved organization membership, resource tags, or a required network endpoint. Some API actions do not support resource-level permissions and therefore require a wildcard resource. In those cases, restrict the action set and use supported conditions rather than assuming that every wildcard is avoidable. Test both required operations and operations that must be denied.

Cloud permissions must be evaluated across all applicable policy types, not just the policy attached to a user or role. In AWS, identity policies, resource policies, role trust policies, permissions boundaries, session policies, and organization policies can influence the result. Explicit denies in applicable policies override allows. Permissions boundaries and session policies limit permissions rather than independently granting them. However, resource-based grants can behave differently depending on whether they target a user, role, or role session, so policy evaluation is not always a simple intersection of every policy. Investigating unintended access requires examining the actual principal, request context, and grant path.

Prefer temporary credentials over embedded long-lived access keys. AWS STS issues credentials for an assumed role, with permissions constrained by the role and any applicable session policy. A short session lifetime reduces the exposure window but does not make an overprivileged role safe. Amazon S3 presigned URLs delegate a particular signed request, such as downloading a specific object, and should use an appropriately limited signer and expiration. They are bearer capabilities: anyone possessing a valid URL can use it. A URL signed with temporary credentials cannot remain valid beyond those credentials, and applicable policy changes can also prevent access.

Compute workloads should obtain credentials through dedicated workload identities. An EC2 instance profile supplies a role to an instance; a Lambda execution role authorizes function code; a service role allows an AWS service to act on a customer's behalf. These mechanisms are not interchangeable, and each needs an appropriately restricted trust policy and permissions policy. For example, deployment permissions should be separate from runtime permissions. Restrict iam:PassRole to approved roles and intended services so that a developer cannot attach a more powerful role to a workload and indirectly escalate privileges.

Administrative access needs both identity and network controls. AWS Systems Manager Session Manager can provide role-controlled access without opening inbound SSH or RDP ports, but requires suitable instance permissions and connectivity to the service. Limit who can start sessions, which managed nodes they can target, and which session documents they can use. Configure logging where supported; SSH and port-forwarding sessions do not provide the same command visibility as standard shell sessions. EC2 Instance Connect provides temporary SSH-key delivery, but does not eliminate the need to restrict SSH reachability, operating-system users, and host-level privileges.

Apply least privilege to network paths as well as API calls. Permit only the necessary source, destination, protocol, and port combinations, and review unnecessary ingress and egress. VPC Network Access Analyzer can identify network paths that violate defined access requirements. AWS Verified Access can enforce identity- and device-context policies for supported applications without broadly exposing the surrounding network. Evaluate network exposure alongside Amazon Inspector workload findings, while recognizing that reachability, vulnerability assessment, and application authorization answer different questions.

At the network edge, restrict direct origin access and validate requests at the appropriate layer. CloudFront origin access control can authorize access to a private S3 origin; configured headers and origin checks can support other origin-protection designs. AWS WAF rules help filter malicious requests, including patterns associated with OWASP Top 10 threats, but are not a substitute for application authorization. S3 CORS controls browser cross-origin behavior and does not grant object permissions or protect an otherwise public bucket. AWS IoT policies should limit devices to required operations and topic resources. Shield Advanced provides DDoS protections and response capabilities, not identity authorization.

Use organization-level controls to prevent local administrators from exceeding centrally defined limits. AWS Organizations service control policies constrain supported permissions for principals in member accounts, while resource control policies constrain access to supported resources. Neither policy type independently grants access. Understand their coverage and exceptions rather than treating them as universal controls. AI services opt-out policies address the use of content for AI service improvement, and declarative policies govern supported service configurations; these are distinct from IAM permission grants.

Prepare incident access before an incident occurs. Provision and test narrowly scoped response roles for evidence collection, containment, and recovery, separating disruptive actions from routine investigation. Avoid permanent administrator access merely to make response easier. Time-bounded elevation, protected approval paths, and audited break-glass procedures preserve response speed while limiting blast radius. Protect root access with appropriate MFA and tightly controlled recovery processes. Where centralized root access is enabled for AWS member accounts, remove unnecessary member-account root credentials and use supported, task-scoped privileged root sessions instead of retaining standing root access.

Least privilege is an iterative process, not a one-time policy-writing exercise. IAM Access Analyzer can identify external access, analyze supported internal access, detect unused access, validate policies, and generate policy suggestions from supported activity. An external-access finding describes a policy-enabled access path, not proof that someone used it. Review findings against intended sharing and remediate unnecessary grants. Activity-derived policies are useful starting points, but observation windows may miss rare maintenance and recovery operations. Combine analysis, access logs, owner review, and regression tests. The trade-off is additional policy maintenance and occasional access failures; manage this through reusable role patterns and controlled escalation rather than broad permanent permissions.

Learn Least privilege in lessons

15 short lessons on Least privilege in 11 certification courses.

and 9 more lessons

Open the lessons