turbot/steampipe-mod-aws-compliance

Control: Both VPN tunnels provided by AWS Site-to-Site VPN should be in UP status

Description

Redundant Site-to-Site VPN tunnels can be implemented to achieve resilience requirements.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.vpc_vpn_tunnel_up

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.vpc_vpn_tunnel_up --share

SQL

This control uses a named query:

with filter_data as (
select
arn,
count(t ->> 'Status')
from
aws_vpc_vpn_connection,
jsonb_array_elements(vgw_telemetry) as t
where t ->> 'Status' = 'UP'
group by arn
)
select
a.arn as resource,
case
when b.count is null or b.count < 2 then 'alarm'
else 'ok'
end as status,
case
when b.count is null then a.title || ' has both tunnels offline.'
when b.count = 1 then a.title || ' has one tunnel offline.'
else a.title || ' has both tunnels online.'
end as reason
, region, account_id
from
aws_vpc_vpn_connection as a
left join filter_data as b on a.arn = b.arn;

Tags