Let me provide a comprehensive solution addressing all four aspects of your SOD challenge:
1. Role-Based Access Control Implementation:
Replace your overly permissive policy with granular, verb-specific policies:
GL_Creators Policy:
{
"statements": [
{
"allow group GL_Creators to use journals in compartment Finance where request.operation='CreateJournalEntry'"
},
{
"allow group GL_Creators to read journals in compartment Finance"
},
{
"deny group GL_Creators to manage journals in compartment Finance where request.operation='ApproveJournalEntry'"
}
]
}
GL_Approvers Policy:
{
"statements": [
{
"allow group GL_Approvers to manage journals in compartment Finance where request.operation='ApproveJournalEntry'"
},
{
"allow group GL_Approvers to read journals in compartment Finance"
},
{
"deny group GL_Approvers to use journals in compartment Finance where request.operation='CreateJournalEntry'"
}
]
}
2. Segregation of Duties Enforcement:
The key is using explicit DENY statements. OCI IAM evaluates policies in this order: Deny → Allow. Even if a user is accidentally added to both groups, the deny policy prevents them from performing the conflicting action. Additionally, implement these safeguards:
- Never assign users to both GL_Creators and GL_Approvers groups
- Use OCI audit logs to monitor for policy violations
- Implement periodic access reviews to verify group memberships
- Create an alert rule that triggers when a user is added to multiple conflicting groups
3. Policy Conditions:
Policy conditions use the ‘where’ clause to evaluate request context. Available conditions include:
- request.operation: The specific API operation being performed
- request.user.id: The OCID of the user making the request
- target.resource.id: The OCID of the resource being accessed
- request.networkSource.name: Network source of the request
For SOD enforcement, the critical condition is request.operation, which allows you to permit/deny specific actions. However, note that operation names must match the actual OCI API operations - you may need to work with your application team to identify the exact operation names used by your GL module.
4. Dynamic Group Membership:
OCI dynamic groups are for compute instances, not users. For user group assignment based on attributes, configure federation group mapping:
SAML Federation Setup:
- In your IdP, create groups matching your OCI groups (GL_Creators, GL_Approvers)
- Configure SAML assertion to include group membership attribute
- In OCI Identity Federation, map IdP groups to OCI IAM groups
- Users automatically inherit OCI group membership based on their IdP groups
Mapping Configuration:
{
"groupMappings": [
{"idpGroup": "Department-GL-Create", "ociGroup": "GL_Creators"},
{"idpGroup": "Department-GL-Approve", "ociGroup": "GL_Approvers"}
]
}
Critical Additional Controls:
IAM policies alone cannot fully enforce SOD for complex business workflows. You MUST implement application-level controls:
- Database-level enforcement: Store creator user ID with each journal entry
- Application logic: Check if approver.id == creator.id and reject if true
- Audit trail: Log all creation and approval actions with user IDs and timestamps
- Workflow engine: Implement multi-stage approval requiring different users at each stage
For audit compliance, document that your SOD control has two layers:
- IAM Policy Layer: Prevents users from having both create and approve permissions simultaneously
- Application Layer: Prevents the same user from approving entries they created, even if they later gain approval permissions
This defense-in-depth approach satisfies auditors and provides true SOD enforcement. Make sure your audit team understands that OCI IAM controls resource access, while business logic controls workflow-based SOD requirements.