nuclei-templates/cloud/aws/vpc/nat-gateway-usage.yaml

56 lines
1.6 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 iterate(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"'
# digest: 4b0a00483046022100f5f55c1da4e2aaca4b9547bf032c91c95a45a559e294e66e3a04343878e6416c022100919f04f7539cccd971883f2ac51a5a40f17c588dc2bb561902f5397715facf2a:922c64590222798bb761d5b6d8e72950