34 ‐ LEAST ACCESS POLICY - SanjeevOCI/Ocidocs GitHub Wiki
Least Access Policy in Oracle Cloud Infrastructure (OCI)
The Least Access Policy (also called Least Privilege Principle) in OCI means granting users and resources only the minimum permissions needed to perform their tasks—nothing more.
1. Why is Least Access Important?
✅ Security – Prevents unauthorized access and reduces the attack surface. ✅ Compliance – Helps meet regulatory requirements (e.g., GDPR, SOC 2). ✅ Minimizes Risk – Limits damage from accidental or malicious actions. ✅ Better Control – Ensures that each user/service has specific permissions.
2. How is Least Access Enforced in OCI?
OCI implements Least Access Policy through Identity and Access Management (IAM) and specific security controls.
A. OCI IAM Policies
IAM policies define who can access what in OCI. Use fine-grained access instead of broad permissions. 📌 Example: Broad Access (Not Recommended)
plaintext Copy Edit Allow group Admins to manage all-resources in tenancy 🚨 Issue: This gives full control over everything—violating least access.
📌 Example: Least Access Approach (Recommended)
plaintext Copy Edit Allow group DatabaseAdmins to manage databases in compartment DB-Compartment ✅ Only database admins can manage databases in a specific compartment, not the whole tenancy.
B. OCI Security Best Practices for Least Access
Use IAM Groups & Policies
Assign permissions to groups, not individual users. Follow role-based access control (RBAC). Apply Compartment-Level Restrictions
Create compartments for different teams/projects. Assign least privileges per compartment. Restrict Public Access
Avoid public access to Object Storage, Compute instances, and Load Balancers. Use private endpoints or Service Gateway. Use OCI Security Lists & Network Security Groups (NSG)
Restrict inbound and outbound network traffic. Define rules only for required ports and IP ranges. Enable MFA (Multi-Factor Authentication)
Enforce MFA for IAM users to enhance login security. Use OCI Policies for Temporary Access
Create policies with time-bound permissions for contractors/temporary users.
3. Example IAM Policy for Least Access in OCI
📌 Scenario: A developer needs read-only access to compute instances.
plaintext Copy Edit Allow group Developers to read instances in compartment Dev-Compartment ✅ This allows only viewing, not modifying instances.
Conclusion
The Least Access Policy in OCI ensures security by granting only necessary permissions to users and resources. Following IAM best practices, network security controls, and role-based access will help protect your OCI environment.