AWS policy evaluation logic
As builders in the IT industry, we have all encountered situations where we are denied to perform an action on a given resource. When the company adopts a complicated and constrained permissions mechanism, identifying the root issue of a deny message requires a lot of debugging and a comprehensive understanding of the policy evaluation logic.?
In this article, I am explaining the policy evaluation logic in the AWS Cloud.
First, let’s define the technical concepts we will use in this article:
In the next section, we will describe the AWS policy evaluation logic:?
If an SCP is present:
----If an Allow effect is present:
--------Move to the next step
----Else: Final decision is a deny
Else: Move to the next step
If a resource based policy is associated with the destination resource:
----If an Allow effect is present:
--------Return the final decision: Allow
----Else: Move to the next step
Else: Move to the next step:
领英推荐
If the principal uses an identity based policy:
----If an Allow effect is present:
--------Move to the next step
----Else: return final decision: Implicit deny
Else: return final decision: Implicit deny
If the principal has an associated permission boundaries:
----If an Allow effect is present:
--------Move to the next step
----Else: return final decision: Implicit Deny
Else: Move to the next step:
If the principal is a session principal:
----If a session policy is present:
--------If an allow effect is present:
------------Return final decision: Allow
--------Else: Return final decision: implicit deny
----Else:
--------If this is a role session:
------------Return final decision: Allow
--------Else: Return final decision: implicit deny
Else: Return final decision: Allow:
In conclusion, as we have seen, there is no one place to define permissions, when you have defined an “allow” effect in your associated policy documents but still facing a deny error message, you need to detect at which stage in the evaluation logic the allowance is overwritten with an implicit deny and fix it as convenient.?
Finally, to best understand the whole flow and make it easier, I highly recommend drawing it yourself and get the logic behind prioritizing a step over another.
--
Hamza EL RHAZI
Solutions Architect