Limit the impact of stolen cloud credentials with resource boundaries
When cloud credentials are stolen, an attacker can send requests as the principal those credentials represent. To limit the impact, reduce the permissions attached to that identity and add separate boundaries on protected resources that deny unwanted actions, principals, or scopes. But a “resource policy” is not an upper bound in every cloud. AWS, Google Cloud, and Azure evaluate these controls differently, so verify which restrictions actually apply to each resource and principal.
Limit the impact of stolen cloud credentials with resource boundaries
When cloud credentials are stolen, an attacker can send requests as the principal those credentials represent. To limit the impact, reduce the permissions attached to that identity and add separate boundaries on protected resources that deny unwanted actions, principals, or scopes. But a “resource policy” is not an upper bound in every cloud. AWS, Google Cloud, and Azure evaluate these controls differently, so verify which restrictions actually apply to each resource and principal.
This article covers preventive design that limits what resources and actions a stolen credential can reach. It is not a procedure for recovering leaked keys or tokens; use Cloud IAM for the basic identity and permission model.
What is at risk when credentials are stolen?
An attacker with an API key, secret key, session token, or workload credential usually authenticates as the principal associated with it. The cloud service evaluates applicable identity policies as well as resource policies, organization policies, session restrictions, role scope, and conditions. A policy’s name alone does not reveal the final permissions. If one powerful role spans development and production accounts or many data stores, a single leaked credential can expose a broad area.
Here, blast radius means the resources and actions that a compromised principal can actually read, change, or delete. A resource-side boundary is a preventive layer that keeps a principal from reaching particular protected resources during normal operation. It does not replace prompt credential revocation or rotation after a suspected compromise, and it cannot undo data already read or exfiltrated.
Does a resource-side restriction always cap permissions?
No. The term “resource policy” means different things across providers and evaluation models. An allow policy attached to a resource may grant access, so it is not automatically a restriction. AWS explains that, within one account, a resource policy’s result can depend on whether it names an IAM user, role ARN, or role session. Some direct grants can bypass implicit denies from a permissions boundary or session policy. An applicable explicit deny takes precedence over allows, but adding another allow statement may not restrict access. Check the evaluation rules for the specific service. AWS IAM policy evaluation logic, AWS permissions boundaries
Google Cloud IAM deny policies attach to an organization, folder, or project and are inherited by descendant resources. They prevent specified principals from using specified permissions even if an allow policy grants them. However, only supported permissions can be denied, and blocking service agents by mistake can disrupt services. Check supported permissions and exceptions, then validate inheritance in a small test scope before applying a broad rule. Google Cloud IAM deny policies
Azure RBAC role assignments can be scoped to a management group, subscription, resource group, or individual resource. Narrowing the scope limits the resources affected by that assignment, but Azure RBAC adds together multiple assignments; a role inherited from a parent scope or another group is not automatically canceled. Role-assignment conditions can further filter some supported data actions by resource attributes, but conditions cannot explicitly deny access to a particular resource. Review other inherited and overlapping grants too. Azure RBAC scope, Azure ABAC conditions
| Provider | Example of a resource-side or hierarchy boundary | Important limitation |
|---|---|---|
| AWS | Explicit Deny in an S3 bucket policy; account SCP/RCP; principal permissions boundary | The principal type and policy combination matter. Direct grants may bypass some implicit boundary denies; use explicit restrictions and confirm service-specific evaluation. |
| Google Cloud | IAM deny policy at organization, folder, or project scope | It is inherited by descendants, but supported permissions and exceptions must be checked. |
| Azure | Narrow RBAC role scope; conditions on supported data actions | Assignments are additive. Conditions can narrow permission but are not a general explicit-deny policy. |
This table compares concepts; it does not imply that the three providers have equivalent features or support them for every service.
Example: a deployment key is exposed
Hypothetical example: Suppose a deployment key is stolen. Its principal needs write access to a development bucket but should never access the production customer-data bucket. If identity policies are broadly permissive, an attacker may reach production storage. On AWS, the organization could consider an explicit bucket-policy Deny for the deployment principal’s prohibited read or delete actions on the production bucket, while reserving permission to modify the boundary for a separate security role. On Google Cloud, an organization could design a higher-level deny policy that blocks selected high-risk permissions for the deployment principal in production projects. On Azure, the deployment role could be assigned only to the development resource group, after confirming that the principal has no separate Contributor assignment at subscription scope.
This scenario is hypothetical and does not claim to describe a tested account or security exercise. Blocking reads and deletes on a production bucket still leaves other risks if the attacker can alter development build artifacts, issue new credentials through another permission, or edit the policy itself. Review permissions for policy changes, credentials, encryption keys, backups, and audit logs as separate parts of the threat model.
How should you design the boundaries?
**Inventory risky principals and protected resources.** Record owners, usage, and revocation or rotation paths for human accounts, automation principals, role sessions, service accounts, and keys. Identify high-impact resources such as production data, encryption keys, backups, audit logs, and permission-management APIs.
**Narrow identity permissions first.** Give each principal only the required actions and resource scope; separate development from production. Restrict administrative permissions that could broaden access or issue replacement credentials.
**Explicitly deny prohibited operations on critical resources.** Where supported, block high-risk actions such as reading or deleting production data, changing key policies, or deleting backups at a resource or organization boundary. Broad wildcard denies can break legitimate services and recovery workflows, so constrain principals, actions, resources, and exceptions.
**Check inheritance and alternate paths.** Review other users, groups, roles, session policies, parent organization policies, cross-account resource policies, service accounts, and administrative roles that could reach the same resource. Removing one allow does not necessarily remove another access path.
**Test both allowed and denied requests.** With an approved test principal, verify that required work still succeeds and the prohibited operation is denied for the assumed compromised identity. Inspect denial logs and audit events to see which policy and scope applied; account for policy propagation delays.
**Separate control of the boundary.** Do not give the deployment credential the ability to remove or weaken its own guardrail. Manage boundary changes with separate approval, change records, alerts, and a recoverable process.
**Prepare incident response separately.** If exposure is suspected, follow the provider’s incident procedures to disable or revoke the credential, replace it, and investigate activity and data changes. A boundary limits future requests; it does not reverse a successful access.
What mistakes weaken the design?
One mistake is adding an Allow to a resource policy and assuming it caps access. How this combines with identity policies, boundaries, or sessions depends on provider and principal type. Another is assigning a role narrowly but leaving a broader inherited assignment in place. A third is protecting data while leaving the same credential able to change the policy, encryption key, backups, or audit logs. A fourth is using a broad deny that blocks automation or service agents. Review effective permissions, inheritance, exceptions, and audit records—not just the policy text.
Resource boundaries complement least privilege, separate operating accounts, short-lived credentials, strong authentication, logging, and backups; they do not replace them. Their purpose is to reduce the resources and actions reachable through one compromised credential and to verify that the limit survives the provider’s actual policy evaluation.
References
[AWS IAM: Policy evaluation logic](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic_policy-eval-denyallow.html)
[AWS IAM: Permissions boundaries](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html)
[Google Cloud IAM: Deny access to resources](https://docs.cloud.google.com/iam/docs/deny-access)
[Azure RBAC: Understand scope](https://learn.microsoft.com/en-us/azure/role-based-access-control/scope-overview)
[Azure RBAC: ABAC conditions overview](https://learn.microsoft.com/en-us/azure/role-based-access-control/conditions-overview)
Policy names and evaluation rules vary by service and may change. Before applying an authorization boundary or responding to an incident, check current documentation for the target service and your organization’s approved security procedures.