Control: VPCs peering connection should not be allowed in cross account
Description
Ensure that all VPCs peering connection are not having cross account access.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.vpc_peering_connection_no_cross_account_access
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.vpc_peering_connection_no_cross_account_access --share
SQL
This control uses a named query:
select id as resource, case when status_code <> 'active' then 'alarm' when requester_owner_id <> accepter_owner_id then 'alarm' else 'ok' end as status, case when status_code <> 'active' then title || ' is not in active state.' when requester_owner_id <> accepter_owner_id then title || ' have cross account access.' else title || ' does not have cross account access.' end as reason , region, account_idfrom aws_vpc_peering_connection;