Skip to main content

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) policies

Risk Level

Critical

Address

Compliance, Security

Compliance 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

Using Console

Below are concise, step‑by‑step instructions to find and fix public OCI Object Storage buckets using the OCI Console.

1. Identify Public Buckets

  1. In the OCI Console, open the navigation menu (≡).
  2. Go to Security → Cloud Guard.
  3. Select your Compartment and Target where Object Storage is used.
  4. Go to Detections → Problems.
  5. Filter:
    • Resource Type = Object Storage Bucket
    • (Optional) Risk Level = High or Critical
  6. Look for problems with descriptions like “Bucket is publicly accessible” or similar.
These are the buckets you need to remediate.

B. Directly from Object Storage

  1. Open the navigation menu (≡).
  2. Go to Storage → Buckets (Object Storage).
  3. Select the Compartment.
  4. Review each bucket:
    • The Access Type column will show Public for public buckets.

2. Remove Public Access from a Bucket

Perform this for each bucket that should not be public.
  1. In the Console, go to Storage → Buckets.
  2. Choose the correct Compartment.
  3. Click the bucket name that is public.
  4. On the bucket detail page, click Edit (upper left).
  5. 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 access if shown.
  6. 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

  1. Still on the bucket’s page, review:
    • Permissions / Access or Bucket Policy section.
  2. Remove any access entries that:
    • Grant access to Any user, ObjectRead, ObjectReadWithoutList, or similar public roles.
  3. Save changes.

B. IAM Policies at Tenancy/Compartment Level

  1. Navigation menu (≡) → Identity & Security → Policies.
  2. For each policy in the relevant compartment/tenancy:
    • Look for statements granting object storage access to any-user or all-users, e.g.:
      • allow any-user to read objects in compartment ...
  3. 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)

  1. On the bucket page, open the Pre-Authenticated Requests tab.
  2. Check for PARs that:
    • Have No expiration or a very long expiry
    • Provide read or write access broadly.
  3. For any PAR not strictly needed:
    • Click the PAR → Revoke.
  4. For necessary PARs:
    • Ensure they:
      • Have minimal privileges.
      • Have a short, appropriate expiration.

5. Set Up Ongoing Monitoring & Alerts

To continuously monitor for new public buckets:
  1. 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.
  2. 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.

Following these steps in the OCI Console will remove public access and keep OCI Object Storage buckets monitored for future misconfigurations.
Below are concise, step‑by‑step instructions to detect and remediate public OCI Object Storage buckets using OCI CLI.Assumptions:
  • You have OCI CLI installed and configured (oci setup config done).
  • 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 have publicAccessType set to ObjectRead or NoList (any non-NoPublicAccess).List all buckets in a compartment and show their access type:
Optionally, filter to only buckets that are public:
Take note of:
  • name
  • namespace for each public bucket.

2. Remediate a Single Public Bucket (Lock Down Access)

For each bucket you identified, set public-access-type to NoPublicAccess.
Verify:
You should see: access = NoPublicAccess.

3. Bulk Remediate All Public Buckets in a Compartment

Use a small shell loop (Linux/macOS, with jq):

Even if bucket public-access-type is private, IAM policies can expose data if misconfigured.List policies in the compartment:
Get policy statements:
Look for rules like:
  • Allow any-user to read objects in tenancy
  • Allow any-user to read objects in compartment <name>
If you find such statements, edit policies via Console or 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 output is empty, all buckets in that compartment are no longer publicly accessible.
If you share an example bucket’s oci os bucket get output (sanitized), I can give an exact oci command tailored to that bucket.
Below is a minimal, concrete way to detect and remediate publicly accessible OCI Object Storage buckets using Python and the OCI SDK.

1. Prerequisites

  1. Install the OCI Python SDK:
  1. Configure OCI CLI/SDK credentials (e.g. ~/.oci/config):

2. What “public” means in OCI Object Storage

A bucket is public if:
  1. Its public_access_type is:
    • ObjectRead or
    • ObjectReadWithoutList
  2. Or IAM policies allow ANY-USER or ANONYMOUS-USER to access it.
  3. Or there are Pre-Authenticated Requests (PARs) that expose objects.
Below is Python code that:
  • 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 = True in a monitoring job to only report.
  • Use DRY_RUN = False in a remediation job to auto-fix.
For stricter security, additionally review and clean up IAM policies that grant object/bucket access to 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.
Changing 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.