turbot/terraform_gcp_compliance

Query: iam_service_account_no_admin_priviledge

Usage

powerpipe query terraform_gcp_compliance.query.iam_service_account_no_admin_priviledge

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std ->> 'member') like '%.iam.gserviceaccount.com$'
and (attributes_std ->> 'role') like any (
array [ 'roles/Admin',
'roles/admin',
'roles/owner',
'roles/editor' ]
) then 'alarm'
else 'ok'
end status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'member') like '%.iam.gserviceaccount.com$'
and (attributes_std ->> 'role') like any (
array [ 'roles/Admin',
'roles/admin',
'roles/owner',
'roles/editor' ]
) then ' has admin privileges'
else ' does not have admin privileges'
end || '.' reason,
path || ':' || start_line
from
terraform_resource
where
type = 'google_project_iam_member';

Controls

The query is being used by the following controls: