turbot/oci_compliance

Query: identity_default_tag

Usage

powerpipe query oci_compliance.query.identity_default_tag

SQL

with default_tag_count as (
select
count(compartment_id),
compartment_id
from
oci_identity_tag_default
where
lifecycle_state = 'ACTIVE'
and value = '${iam.principal.name}'
group by
compartment_id
)
select
t.tenant_id as resource,
case
when d.compartment_id is null then 'alarm'
else 'ok'
end as status,
case
when d.compartment_id is null then 'Default tag criteria does not meet as per CIS recommendation.'
else 'Default tag criteria meets as CIS per recommendation.'
end as reason,
t.tenant_name as tenant
from
oci_identity_tenancy t
left join default_tag_count d on t.tenant_id = d.compartment_id;

Controls

The query is being used by the following controls: