56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
|
id: nat-gateway-use
|
||
|
info:
|
||
|
name: Managed NAT Gateway Usage
|
||
|
author: princechaddha
|
||
|
severity: medium
|
||
|
description: |
|
||
|
Ensure the use of Amazon Managed NAT Gateway for better availability and bandwidth in VPC networks instead of self-managed NAT instances.
|
||
|
impact: |
|
||
|
Using self-managed NAT instances can lead to single points of failure and potential bandwidth bottlenecks.
|
||
|
remediation: |
|
||
|
Replace NAT instances with Amazon Managed NAT Gateway to ensure high availability and scalability in your VPC network.
|
||
|
reference:
|
||
|
- https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html
|
||
|
tags: cloud,devops,aws,amazon,vpc,aws-cloud-config
|
||
|
|
||
|
variables:
|
||
|
region: "us-east-1"
|
||
|
|
||
|
flow: |
|
||
|
code(1)
|
||
|
for(let VPCIds of template.vpcid){
|
||
|
set("vpc", VPCIds)
|
||
|
code(2)
|
||
|
}
|
||
|
|
||
|
self-contained: true
|
||
|
code:
|
||
|
- engine:
|
||
|
- sh
|
||
|
- bash
|
||
|
source: |
|
||
|
aws ec2 describe-vpcs --region $region --query 'Vpcs[*].VpcId' --output json
|
||
|
|
||
|
extractors:
|
||
|
- type: json
|
||
|
name: vpcid
|
||
|
internal: true
|
||
|
json:
|
||
|
- '.[]'
|
||
|
|
||
|
- engine:
|
||
|
- sh
|
||
|
- bash
|
||
|
source: |
|
||
|
aws ec2 describe-nat-gateways --region $region --filter "Name=vpc-id,Values=$vpc" "Name=state,Values=available" --query 'NatGateways'
|
||
|
|
||
|
matchers:
|
||
|
- type: word
|
||
|
words:
|
||
|
- "[]"
|
||
|
|
||
|
extractors:
|
||
|
- type: dsl
|
||
|
dsl:
|
||
|
- 'vpc + " VPC is not using Managed NAT Gateways"'
|