turbot/gcp_insights

Query: iam_roles_for_iam_service_account

Usage

powerpipe query gcp_insights.query.iam_roles_for_iam_service_account

Steampipe Tables

SQL

select
b ->> 'role' as role_id
from
gcp_iam_policy,
jsonb_array_elements(bindings) as b,
jsonb_array_elements_text(b -> 'members') as m,
split_part(m,'serviceAccount:',2) as member_name
where
m like 'serviceAccount:%'
and member_name = split_part($1, '/', 1);