turbot/terraform_gcp_compliance

Query: iam_service_account_gcp_managed_key

Usage

powerpipe query terraform_gcp_compliance.query.iam_service_account_gcp_managed_key

Steampipe Tables

SQL

select
address as resource,
case
when name in (
select
split_part((attributes_std ->> 'service_account_id'), '.', 2)
from
terraform_resource
where
type = 'google_service_account_key'
) then 'alarm'
else 'ok'
end status,
split_part(address, '.', 2) || case
when name in (
select
split_part((attributes_std ->> 'service_account_id'), '.', 2)
from
terraform_resource
where
type = 'google_service_account_key'
) then ' has user-managed keys'
else ' does not have user-managed keys'
end || '.' reason,
path || ':' || start_line
from
terraform_resource
where
type = 'google_service_account';

Controls

The query is being used by the following controls: