title | platform |
---|---|
About the google_storage_bucket_iam_binding Resource |
gcp |
Use the google_storage_bucket_iam_binding
InSpec audit resource to test properties of a single GCP storage bucket IAM binding.
A google_storage_bucket_iam_binding
resource block declares the tests for a single GCP storage bucket IAM binding by bucket name and role.
describe google_storage_bucket_iam_binding(bucket: 'bucket-buvsjjcndqz', role: 'roles/storage.objectViewer') do
it { should exist }
end
The following examples show how to use this InSpec audit resource.
describe google_storage_bucket_iam_binding(bucket: 'bucket-buvsjjcndqz', role: 'roles/storage.admin') do
it { should exist }
end
describe google_storage_bucket_iam_binding(bucket: 'bucket-buvsjjcndqz', role: 'roles/storage.admin') do
its('members') {should include 'user:someuser@domain.com' }
its('members') {should include 'serviceAccount:someserviceaccount@domain.com' }
end
members
Ensure the Google Cloud Storage API is enabled.