pap - Configure public access prevention

Synopsis

gsutil pap set (enforced|inherited) gs://<bucket_name>...
gsutil pap get gs://<bucket_name>...

Description

The pap command is used to retrieve or configure the public access prevention setting of Cloud Storage buckets. This command has two sub-commands: get and set.

Get

The pap get command returns public access prevention values for the specified Cloud Storage buckets.

Get Examples

Check if redbucket and bluebucket are using public access prevention:

gsutil pap get gs://redbucket gs://bluebucket

Set

The pap set command configures public access prevention for Cloud Storage buckets. If you set a bucket to be inherited, it uses public access prevention only if the bucket is subject to the public access prevention organization policy constraint.

Set Examples

Configure redbucket and bluebucket to use public access prevention:

gsutil pap set enforced gs://redbucket gs://bluebucket