Skip to content

Files

Latest commit

 

History

History
35 lines (26 loc) · 744 Bytes

google-storage-no-public-access.md

File metadata and controls

35 lines (26 loc) · 744 Bytes

Pattern: Enabled public access for Google Cloud Storage bucket

Issue: -

Description

Using allUsers or allAuthenticatedUsers as members in an IAM member/binding causes data to be exposed outside of the organisation.

Resolution: Restrict public access to the bucket.

Examples

Example of incorrect code:

resource "google_storage_bucket_iam_binding" "binding" {
	bucket = google_storage_bucket.default.name
	role = "roles/storage.admin"
	members = [
		"allAuthenticatedUsers",
	]
}

Example of correct code:

resource "google_storage_bucket_iam_binding" "binding" {
	bucket = google_storage_bucket.default.name
	role = "roles/storage.admin"
	members = [
		"user:jane@example.com",
	]
}