OCI IAM Policy Analysis
Tenable One Cloud Exposure gives you full visibility into OCI IAM policies and their statements. Every policy, statement, and granted permission is parsed and shown on resource and principal profiles, and you can query them in the Explorer.
OCI authorization is expressed through IAM policies. A policy is a named container in a compartment that holds statements, which grant groups permissions on resource families. Cloud Exposure models both levels:
- OCI Policy — The container, with its name, compartment, enabled state, the principals it references, and the statements it holds.
- OCI Policy Statement — An individual statement, parsed into type, principals, verb, resource type, scope, and the permissions it grants.
Both are synced from OCI, analyzed into relationships, and available in the Explorer. To connect a tenancy, see Connect an OCI Tenancy.
Anatomy of a Statement
Each policy statement is made up of the following parts:
- Statement type — Allow, Admit, Define, or Endorse. A malformed Allow statement keeps its type but has no parsed details.
- Principal type and principal — The subject of the grant. Supported forms are Any User, Any Group, Group, Dynamic Resource Group, Service, and Resource. A principal can belong to the same tenancy or to another onboarded tenancy. See Cross-Tenancy Policies.
- Verb — inspect, read, use, or manage. A higher verb includes the lower ones.
- Resource type — The resource family that the actions apply to, for example keys, buckets, or instances.
- Scope — Written as in tenancy, in compartment id <ocid>, or a compartment name path. For Allow and Admit statements, Tenable expands the scope to the scope compartment, its child compartments at any depth, and the matching resources in them. For Endorse statements, the scope is the endorsed tenancy only, with no child compartments or resources.
- Actions — The concrete permissions that the statement grants, for example TAG_DEFAULT_INSPECT and TAG_NAMESPACE_READ, derived from the verb, resource type, and scope. Statements written with an explicit list of actions in braces show no verb or resource type.
- Conditions — The where conditions of the statement. Tenable parses them and takes them into account when it analyzes the statement.
Granted Permissions
Tenable resolves each statement to the concrete permissions it grants. For example, this statement:
Allow group 'mydomain'/'demo-user-group' to inspect tag-defaults in compartment comp-demo
is parsed as follows:
| Field | Value |
|---|---|
| Statement type | Allow |
| Principal type | Group |
| Principal | mydomain/demo-user-group |
| Verb | Inspect |
| Resource type | tag-defaults |
| Scope | Compartment comp-demo and the compartments beneath it |
| Granted permissions | TAG_DEFAULT_INSPECT and TAG_NAMESPACE_READ |
How Each Statement Type Is Analyzed
- Allow and Admit statements are resolved into concrete actions, principals, and resources.
- Endorse statements are resolved into actions and principals, and link to the endorsed tenancy as their scope. They have no resource or transitive principal links. See Cross-Tenancy Policies.
- A statement on a resource type that Tenable does not recognize does not link to any resources.
Cross-Tenancy Policies
OCI lets one tenancy grant access to another. Tenable follows both sides of that relationship:
- An Admit ... of tenancy X statement resolves its principals into the other onboarded tenancy, so you can see who in tenancy X receives the permission and which resources it reaches.
- An Endorse ... in tenancy Y statement links to tenancy Y as its scope and to its principals. It does not link to resources or transitive principals. If tenancy Y is not onboarded, the statement has no scope link. This reduces the noise caused by over-permissive Endorse statements, which do not grant any permissions without an Admit statement.
Both tenancies must be onboarded and active in the same Tenable organization. Only Allow, Admit, and Endorse statements are analyzed. To list cross-tenancy grants, see Build a Query.
View OCI Policies and Statements
You can find OCI policies and their statements in the following places:
- Resource profile > Explore > Resource Policies — Policies that apply to the resource.
- Compartment profile > Explore > Resource Policies — Policies that apply to any resources in the compartment or in its child compartments.
- Principal profile > Explore > Principal Policies — Policies that grant the principal permissions. Available on users, groups, dynamic groups, and services.
- Policy profile > Statements — The parsed statement list. You can expand each statement to see its principals and actions.
- Inventory — OCI Policy Statement is a resource type in the IAM category. See Supported Resources.
- Explorer — Policies and statements are searchable and filterable, with relations to principals, resources, and scope compartments. See Query OCI Policies in the Explorer.
To view the OCI policies that apply to a resource:
- Click Explore > Inventory.
- Search for the OCI resource and then click to open its profile page.
- In the left-hand menu, under Explore, click Resource Policies. For a user, group, dynamic group, or service, click Principal Policies to see the policies that grant it permissions.
Query OCI Policies in the Explorer
A policy statement has the following relationships:
| Statement To | Label | Reverse Label |
|---|---|---|
| Policy | contained in | contains |
| Direct principals | directly assigned to | directly assigned |
| All principals, including transitive principals (for example, users in a group) | assigned to | assigned |
| Scope compartment | scoped to | scopes |
| Resources | grants access to | access granted by |
A policy relates to its statements, and similarly to its principals and resources.
Build a Query
To list every statement with who receives the permission and which resources it reaches:
- In the Cloud Exposure Console, go to Explore > Explorer.
- Select FIND and choose OCI Policy Statement.
- (Optional) Click + next to the FIND row and add a filter, for example Statement Type is Allow, or Verb is Manage.
- Click + and add a Join. Choose the relation assigned to, and then the type OCI Principal. To see only the principals named in the statement, use directly assigned to instead.
- Add a second Join with the relation grants access to and the type OCI Resource.
The results table shows the principal, the statement, and the resource side by side. Each row is one statement, one principal that receives it, and one resource it applies to.
To list cross-tenancy grants, build the same query and set the filter to Statement Type is Admit. Each row shows the Admit statement, the principal in the other tenancy, and the resources it can reach.
More Query Examples
| Question | How to Build It |
|---|---|
| Who can manage a specific resource? | FIND OCI Policy Statement with Verb is Manage. JOIN grants access to OCI Resource and filter the resource by name. JOIN assigned to OCI Principal to see who receives the permission. |
| Which principals are named directly in a statement, not reached through a group? | FIND OCI Policy Statement. JOIN directly assigned to OCI Principal. |
| What statements does a policy hold? | FIND OCI Policy Statement. JOIN contained in OCI Policy and filter the policy by name. |
| Which tenancies admit principals from other tenancies? | FIND OCI Policy Statement with Statement Type is Admit. JOIN assigned to OCI Principal. JOIN belongs to OCI Compartment on the principal to see where the principal comes from. |
To be alerted on a result, select Add > Custom Policy in the Explorer and build the policy from your query, using filters instead of joins. See Build Custom Policies.
Build Custom Policies
You can codify your own authorization rules on these queries, for example:
- Any User is granted Manage on keys in the tenancy.
- A service is granted permissions beyond what you expect.
Custom policies built on these queries open findings when Tenable detects unwanted or unneeded permissions on a resource, tailored to your environment. For more information, see Create a Custom Policy from Query.
Example: Cross-Tenancy Manage Access from Compartment X to Compartment Y
This policy finds Admit statements that give Manage permissions to principals in compartment X, in another tenancy, over resources in compartment Y.
To create the policy:
- In the Explorer, select Add > Custom Policy.
- Enter a name, for example OCI Cross Tenant with Manage. Optionally, add a description, a severity, and remediation steps.
- Select FIND and choose OCI Policy Statement. Under the AND, add the filters Statement Type is Admit and Verb is Manage.
- Under the AND, add the relation assigned to OCI Principal. Nested under it, add the relation belongs to OCI Compartment and set Self to compartment X.
- Under the same AND, add the relation grants access to OCI Resource. Nested under it, add the relation belongs to OCI Compartment and set Self to compartment Y.
- Click Save.
The query returns only Admit statements that give Manage to principals in X over resources in Y. To cover more than one compartment on either side, select several compartments in the Self filter.