Control: Ensure basic roles are not used at project level
Description
This control checks that basic roles are not used at the project level.
Usage
Run the control in your terminal:
powerpipe control run terraform_gcp_compliance.control.iam_project_use_basic_role
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_gcp_compliance.control.iam_project_use_basic_role --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std ->> 'role') like any (array ['roles/owner', 'roles/editor', 'roles/viewer']) then 'alarm' else 'ok' end status, split_part(address, '.', 2) || case when (attributes_std ->> 'role') like any (array ['roles/owner', 'roles/editor', 'roles/viewer']) then ' uses basic role' else ' does not use basic role' end || '.' reason , path || ':' || start_linefrom terraform_resourcewhere type in ('google_project_iam_member', 'google_project_iam_binding');