2024-04-11 14:23:07 +00:00
|
|
|
id: nacl-open-inbound
|
|
|
|
info:
|
|
|
|
name: Open Inbound NACL Traffic
|
|
|
|
author: princechaddha
|
|
|
|
severity: medium
|
|
|
|
description: |
|
|
|
|
Checks for Amazon VPC Network ACLs with inbound rules allowing traffic from all IPs across all ports, increasing the risk of unauthorized access.
|
|
|
|
impact: |
|
|
|
|
Allows unrestricted access to resources within the subnet, potentially exposing sensitive data or services to unauthorized users.
|
|
|
|
remediation: |
|
|
|
|
Restrict Network ACL inbound rules to only allow necessary IP ranges and ports as per the Principle of Least Privilege.
|
|
|
|
reference:
|
|
|
|
- https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html
|
2024-06-07 10:04:29 +00:00
|
|
|
metadata:
|
|
|
|
max-request: 2
|
2024-04-11 14:23:07 +00:00
|
|
|
tags: cloud,devops,aws,amazon,vpc,aws-cloud-config
|
|
|
|
variables:
|
|
|
|
region: "us-east-1"
|
|
|
|
|
|
|
|
flow: |
|
|
|
|
code(1)
|
2024-04-29 09:35:31 +00:00
|
|
|
for(let NACLIDs of iterate(template.nacls)){
|
2024-04-11 14:23:07 +00:00
|
|
|
set("naclid", NACLIDs)
|
|
|
|
code(2)
|
|
|
|
}
|
|
|
|
|
|
|
|
self-contained: true
|
|
|
|
code:
|
|
|
|
- engine:
|
|
|
|
- sh
|
|
|
|
- bash
|
|
|
|
source: |
|
|
|
|
aws ec2 describe-network-acls --region $region --query 'NetworkAcls[*].NetworkAclId' --output json
|
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: json
|
|
|
|
name: nacls
|
|
|
|
internal: true
|
|
|
|
json:
|
|
|
|
- '.[]'
|
|
|
|
|
|
|
|
- engine:
|
|
|
|
- sh
|
|
|
|
- bash
|
|
|
|
source: |
|
|
|
|
aws ec2 describe-network-acls --region $region --network-acl-ids $naclid --query 'NetworkAcls[*].Entries[?(RuleAction==`allow`) && (Egress==`false`)] | []'
|
|
|
|
|
|
|
|
matchers-condition: and
|
|
|
|
matchers:
|
|
|
|
- type: word
|
|
|
|
words:
|
|
|
|
- "allow"
|
|
|
|
condition: and
|
|
|
|
|
|
|
|
- type: word
|
|
|
|
words:
|
|
|
|
- "PortRange"
|
|
|
|
negative: true
|
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: dsl
|
|
|
|
dsl:
|
|
|
|
- '"Access to the VPC subnets associated with your NACL " + naclid + " is not restricted."'
|
2024-06-08 16:02:17 +00:00
|
|
|
# digest: 4a0a0047304502210090f1a4c3cf579052839a7c17926792dc80956b0a3ef6716f594d5dd3539e0e3f02205c9073431d5ad40af0eeb8a4ee457808e7ecac97f253ab129e5f27b78e4e9377:922c64590222798bb761d5b6d8e72950
|