turbot/aws_compliance

Query: ecs_task_definition_no_root_user

Usage

powerpipe query aws_compliance.query.ecs_task_definition_no_root_user

Steampipe Tables

SQL

with root_user_task_definition as (
select
distinct task_definition_arn as arn
from
aws_ecs_task_definition,
jsonb_array_elements(container_definitions) as c
where
c ->> 'User' = 'root'
)
select
a.task_definition_arn as resource,
case
when b.arn is not null then 'alarm'
else 'ok'
end as status,
case
when b.arn is not null then a.title || ' have root user.'
else a.title || ' does not have root user.'
end as reason
, region, account_id
from
aws_ecs_task_definition as a
left join root_user_task_definition as b on a.task_definition_arn = b.arn;

Controls

The query is being used by the following controls: