turbot/steampipe-mod-aws-compliance

Query: vpc_vpn_connection_logging_enabled

Usage

powerpipe query aws_compliance.query.vpc_vpn_connection_logging_enabled

Steampipe Tables

SQL

with tunnel_logging as (
select
distinct arn,
count(*)
from
aws_vpc_vpn_connection,
jsonb_array_elements(options -> 'TunnelOptions') as t
where
(t -> 'LogOptions' -> 'CloudWatchLogOptions' ->> 'LogEnabled')::bool
group by arn
)
select
a.arn as resource,
case
when b.count >= 1 then 'ok'
else 'alarm'
end as status,
case
when b.count = 1 then a.title || ' has logging enabled for one tunnel.'
when b.count = 2 then a.title || ' has logging enabled for both tunnels.'
else a.title || ' has logging disabled for both tunnels.'
end as reason
, region, account_id
from
aws_vpc_vpn_connection as a
left join tunnel_logging as b on a.arn = b.arn;

Controls

The query is being used by the following controls: