turbot/terraform_gcp_compliance

Query: iam_organization_use_default_service_role

Usage

powerpipe query terraform_gcp_compliance.query.iam_organization_use_default_service_role

Steampipe Tables

SQL

select
address as resource,
case
when ((attributes_std ->> 'members') like any (array ['%@developer.gserviceaccount.com', '%@appspot.gserviceaccount.com']) or (attributes_std ->> 'member') like '%@developer.gserviceaccount.com' or (attributes_std ->> 'member') like '%@appspot.gserviceaccount.com') then 'alarm'
else 'ok'
end status,
split_part(address, '.', 2) || case
when ((attributes_std ->> 'members') like any (array ['%@developer.gserviceaccount.com', '%@appspot.gserviceaccount.com']) or (attributes_std ->> 'member') like '%@developer.gserviceaccount.com' or (attributes_std ->> 'member') like '%@appspot.gserviceaccount.com') then ' uses default service account role'
else ' does not use default service account role'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type in ('google_organization_iam_member', 'google_organization_iam_binding');

Controls

The query is being used by the following controls: