# GCP - Post Eksploatacija Skladišta

{{#include ../../../banners/hacktricks-training.md}}

## Cloud Storage

Za više informacija o Cloud Storage, proverite ovu stranicu:

{{#ref}}
../gcp-services/gcp-storage-enum.md
{{#endref}}

### Dati Javni Pristup

Moguće je dati spoljnim korisnicima (prijavljenim u GCP ili ne) pristup sadržaju kanti. Međutim, po defaultu, kanta će imati onemogućenu opciju da javno izloži kantu:
```bash
# Disable public prevention
gcloud storage buckets update gs://BUCKET_NAME --no-public-access-prevention

# Make all objects in a bucket public
gcloud storage buckets add-iam-policy-binding gs://BUCKET_NAME --member=allUsers --role=roles/storage.objectViewer
## I don't think you can make specific objects public just with IAM

# Make a bucket or object public (via ACL)
gcloud storage buckets update gs://BUCKET_NAME --add-acl-grant=entity=AllUsers,role=READER
gcloud storage objects update gs://BUCKET_NAME/OBJECT_NAME --add-acl-grant=entity=AllUsers,role=READER
```
Ako pokušate da dodelite **ACL-ove kontejneru sa onemogućenim ACL-ovima**, naići ćete na ovu grešku: `ERROR: HTTPError 400: Cannot use ACL API to update bucket policy when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access`

Da biste pristupili otvorenim kontejnerima putem pregledača, pristupite URL-u `https://<bucket_name>.storage.googleapis.com/` ili `https://<bucket_name>.storage.googleapis.com/<object_name>`

{{#include ../../../banners/hacktricks-training.md}}
