turbot/azure_compliance

Query: container_instance_container_group_secured_environment_variable

Usage

powerpipe query azure_compliance.query.container_instance_container_group_secured_environment_variable

SQL

with not_secured_environment_variable_container_group as (
select
id
from
azure_container_group,
jsonb_array_elements(containers) as c,
jsonb_array_elements(c -> 'properties' -> 'environmentVariables') as v
where
v ->'value' is not null
)
select
cg.id as resource,
case
when g.id is not null then 'alarm'
else 'ok'
end as status,
case
when g.id is not null then cg.name || ' have unsecured environment variable.'
else cg.name || ' have secured environment variable.'
end as reason
, cg.resource_group as resource_group
, sub.display_name as subscription
from
azure_container_group as cg
left join not_secured_environment_variable_container_group as g on g.id = cg.id,
azure_subscription as sub
where
sub.subscription_id = cg.subscription_id;

Controls

The query is being used by the following controls: