01 Run iam compartment list command (Windows/macOS/Linux) with output query filters to list the ID of each compartment available in your Oracle Cloud Infrastructure (OCI) account:
oci iam compartment list
--all
--include-root
--query 'data[]."id"'
02 The command output should return the requested OCI compartment identifiers (OCIDs):
[
"ocid1.tenancy.oc1..aaaabbbbccccddddabcd1234abcd1234abcd1234abcd1234abcd1234abcd",
"ocid1.compartment.oc1..abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd"
]
03 Run os bucket list command (Windows/macOS/Linux) with the ID of the OCI compartment that you want to examine as the identifier parameter, the list the name of each Object Storage bucket available in the selected OCI compartment:
oci os bucket list
--compartment-id 'ocid1.tenancy.oc1..aaaabbbbccccddddabcd1234abcd1234abcd1234abcd1234abcd1234abcd'
--all
--query 'data[]."name"'
04 The command output should return the requested bucket names:
[
"cc-project5-data-bucket",
"cc-tenancy-logging-bucket",
"cc-cloud-artifacts-bucket"
]
05 Run os bucket get command (Windows/macOS/Linux) with the name of the Object Storage bucket that you want to examine as the identifier parameter and custom output filters to determine if the selected bucket is configured to allow public, anonymous access:
oci os bucket get
--bucket-name 'cc-project5-data-bucket'
--query 'data."public-access-type"'
06 The command output should return the public access type configured for the selected bucket. "ObjectRead" allows public access for the GetObject and HeadObject operations, "ObjectReadWithoutList" allows public access for the GetObject, HeadObject, and ListObjects operations, and "NoPublicAccess" blocks public access (allows only authenticated callers to access the bucket and its contents):
If the
os bucket get command output returns
"ObjectRead" or
"ObjectReadWithoutList", the selected OCI Object Storage bucket is publicly accessible. This configuration allows anonymous and unauthenticated users to access objects stored within the bucket.
07 Repeat steps no. 5 and 6 for each Object Storage bucket provisioned in the selected OCI compartment.
08 Repeat steps no. 3 – 7 for each OCI compartment available in your Oracle Cloud Infrastructure (OCI) account.