More Info:
Buckets must not be publicly accessible. Open buckets are a primary vector for cloud data breaches. Access must be strictly governed via robust Identity and Access Management (IAM) policiesRisk Level
CriticalAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Startup Security Baseline
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS AWS
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- FedRAMP
- GDPR
- HIPAA
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Cyber Security Framework
- Reserve Bank of India (RBI) Master Direction – Information Technology Framework
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are concise, step‑by‑step instructions to find and fix public OCI Object Storage buckets using the OCI Console.
Following these steps in the OCI Console will remove public access and keep OCI Object Storage buckets monitored for future misconfigurations.
1. Identify Public Buckets
A. Using Cloud Guard (recommended for “monitoring”)
- In the OCI Console, open the navigation menu (≡).
- Go to Security → Cloud Guard.
- Select your Compartment and Target where Object Storage is used.
- Go to Detections → Problems.
- Filter:
- Resource Type =
Object Storage Bucket - (Optional) Risk Level =
HighorCritical
- Resource Type =
- Look for problems with descriptions like “Bucket is publicly accessible” or similar.
B. Directly from Object Storage
- Open the navigation menu (≡).
- Go to Storage → Buckets (Object Storage).
- Select the Compartment.
- Review each bucket:
- The Access Type column will show
Publicfor public buckets.
- The Access Type column will show
2. Remove Public Access from a Bucket
Perform this for each bucket that should not be public.- In the Console, go to Storage → Buckets.
- Choose the correct Compartment.
- Click the bucket name that is public.
- On the bucket detail page, click Edit (upper left).
- Find the Public access type / Access Type setting:
- If set to
Public, change it to:Private(recommended)- or a more restricted option like
No public accessif shown.
- If set to
- Click Save changes.
3. Check and Remove Public Policies / Grants
Even if “Public” is disabled at the bucket setting, IAM policies or users might still expose data.A. Bucket Public Access via “Bucket Policy” or Grants
- Still on the bucket’s page, review:
- Permissions / Access or Bucket Policy section.
- Remove any access entries that:
- Grant access to
Any user,ObjectRead,ObjectReadWithoutList, or similar public roles.
- Grant access to
- Save changes.
B. IAM Policies at Tenancy/Compartment Level
- Navigation menu (≡) → Identity & Security → Policies.
- For each policy in the relevant compartment/tenancy:
- Look for statements granting object storage access to
any-userorall-users, e.g.:allow any-user to read objects in compartment ...
- Look for statements granting object storage access to
- Edit or remove those policies, and replace them with least-privilege policies that grant access only to:
- Specific groups
- Specific dynamic groups
- Specific compartments
4. Disable/Review Pre-Authenticated Requests (PARs)
- On the bucket page, open the Pre-Authenticated Requests tab.
- Check for PARs that:
- Have No expiration or a very long expiry
- Provide read or write access broadly.
- For any PAR not strictly needed:
- Click the PAR → Revoke.
- For necessary PARs:
- Ensure they:
- Have minimal privileges.
- Have a short, appropriate expiration.
- Ensure they:
5. Set Up Ongoing Monitoring & Alerts
To continuously monitor for new public buckets:-
Cloud Guard:
- Ensure Cloud Guard is Enabled at tenancy or root compartment.
- Confirm the Detector Recipes include:
- Object Storage configuration detectors (public bucket detection).
- Enable Responder Recipes if you want automatic or guided remediation.
-
Notifications / Alarms (Optional):
- Use Cloud Guard → Notifications or create OCI Events + Notifications to alert when:
- A bucket’s access settings change.
- New Cloud Guard problems appear for Object Storage.
- Use Cloud Guard → Notifications or create OCI Events + Notifications to alert when:
Following these steps in the OCI Console will remove public access and keep OCI Object Storage buckets monitored for future misconfigurations.
Using CLI
Using CLI
Below are concise, step‑by‑step instructions to detect and remediate public OCI Object Storage buckets using OCI CLI.Assumptions:
Optionally, filter to only buckets that are public:Take note of:
Verify:You should see:
Get policy statements:Look for rules like:
If output is empty, all buckets in that compartment are no longer publicly accessible.
If you share an example bucket’s
- You have OCI CLI installed and configured (
oci setup configdone). - You know the compartment OCID where your monitoring buckets live.
- Replace placeholders like
<compartment_ocid>and<bucket_name>with real values.
1. Identify Public Buckets
Public buckets havepublicAccessType set to ObjectRead or NoList (any non-NoPublicAccess).List all buckets in a compartment and show their access type:namenamespacefor each public bucket.
2. Remediate a Single Public Bucket (Lock Down Access)
For each bucket you identified, setpublic-access-type to NoPublicAccess.access = NoPublicAccess.3. Bulk Remediate All Public Buckets in a Compartment
Use a small shell loop (Linux/macOS, withjq):4. Ensure No Public Access via IAM Policies (Optional but Recommended)
Even if bucketpublic-access-type is private, IAM policies can expose data if misconfigured.List policies in the compartment:Allow any-user to read objects in tenancyAllow any-user to read objects in compartment <name>
oci iam policy update to remove/limit any-user access. (Policy text must be updated as a whole, so usually easier via Console.)5. Validate No Buckets are Public
Re-run:If you share an example bucket’s
oci os bucket get output (sanitized), I can give an exact oci command tailored to that bucket.Using Python
Using Python
Below is a minimal, concrete way to detect and remediate publicly accessible OCI Object Storage buckets using Python and the OCI SDK.
1. Prerequisites
- Install the OCI Python SDK:
- Configure OCI CLI/SDK credentials (e.g.
~/.oci/config):
2. What “public” means in OCI Object Storage
A bucket is public if:- Its
public_access_typeis:ObjectReadorObjectReadWithoutList
- Or IAM policies allow
ANY-USERorANONYMOUS-USERto access it. - Or there are Pre-Authenticated Requests (PARs) that expose objects.
- Finds buckets with public access type
- Sets them to private (
NoPublicAccess) - Optionally deletes PARs for those buckets
3. Python script: Monitor & Remediate Public Buckets
4. How to use this for “monitoring”
- Run this script periodically (e.g., via cron, Jenkins, or OCI DevOps).
- Keep
DRY_RUN = Truein a monitoring job to only report. - Use
DRY_RUN = Falsein a remediation job to auto-fix.
ANY-USER or ANONYMOUS-USER. That part requires parsing identity_client.list_policies(...) and adjusting policy statements, which is usually done manually or via Terraform.Using Terraform
Using Terraform
public_access_type from a public value (e.g. ObjectRead, NoList) to "NoPublicAccess" is an in‑place update and does not force replacement of the bucket.For verification, terraform plan should show an in-place update on oci_objectstorage_bucket.PRIVATE_BUCKET with public_access_type changing to NoPublicAccess and no resource replacements.
