01 Run projects list command (Windows/macOS/Linux) with custom output filters to list the ID of each project available in your Google Cloud Platform (GCP) account:
gcloud projects list
--format="value(projectId)"
02 The command output should return the requested GCP project identifiers (IDs):
cc-project5-123123
cc-ai-project-123123
03 Run storage buckets list command (Windows/macOS/Linux) with custom output filters to describe the identifier (name) of each storage bucket created for the specified GCP project:
gcloud storage buckets list
--project cc-project5-123123
--format="value(name)"
04 The command output should return the requested bucket names:
cc-webdata-bucket
cc-dataproc-bucket
cc-cloud-ai-bucket
05 Run storage buckets describe command (Windows/macOS/Linux) with the name of the Cloud Storage bucket that you want to examine as the identifier parameter and custom output filters to determine the Public Access Prevention feature status available at the bucket level:
gcloud storage buckets describe gs://cc-webdata-bucket
--format="value(public_access_prevention)"
06 The command output should return the requested feature status:
If the
storage buckets describe command output does not return
enforced, Public Access Prevention is not enabled for the selected Google Cloud Storage bucket.
07 If your storage bucket is contained within an organization, you can check the Public Access Prevention feature status by using the organization policy constraint named storage.publicAccessPrevention. Run organizations list command (Windows/macOS/Linux) with custom output filters to list the ID of each organization available within your Google Cloud account:
gcloud organizations list
--format="value(name)"
08 The command output should return the requested organization identifiers (IDs):
112233441122
123412341234
09 Run resource-manager org-policies describe command (Windows/macOS/Linux) with the ID of the GCP organization that contains your bucket as the identifier parameter, to describe the enforcement configuration of the Enforce Public Access Prevention constraint policy, available for the selected organization:
gcloud beta resource-manager org-policies describe constraints/storage.publicAccessPrevention
--effective
--organization=112233441122
--format="default(booleanPolicy)"
10 The command request should return the requested enforcement configuration information:
If the
resource-manager org-policies describe command output returns an empty object for the
booleanPolicy configuration attribute, as shown in the example above, the
Enforce Public Access Prevention constraint policy is not enforced for the selected Google Cloud organization. Therefore, Public Access Prevention is not enabled for your Cloud Storage bucket.
11 Repeat steps no. 5 - 10 for each storage bucket created for the selected GCP project.
12 Repeat steps no. 3 – 11 for each GCP project available within your Google Cloud account.