Detection rules › Panther

AWS Network ACL Restricts Outbound Traffic

Severity
low
Compliance
PCI 1.1.4, 1.3.2
Tags
AWS, PCI, Exfiltration:Exfiltration Over Web Service
Reference
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-recommended-nacl-rules.html
Source
github.com/panther-labs/panther-analysis

This policy validates that Network ACLs have some restrictions on outbound traffic.

MITRE ATT&CK coverage

TacticTechniques
ExfiltrationT1567 Exfiltration Over Web Service

Rule body yaml

AnalysisType: policy
Filename: aws_network_acl_restricts_outbound_traffic.py
PolicyID: "AWS.NetworkACL.RestrictsOutboundTraffic"
DisplayName: "AWS Network ACL Restricts Outbound Traffic"
Enabled: false
ResourceTypes:
  - AWS.EC2.NetworkACL
Tags:
  - AWS
  - PCI
  - Exfiltration:Exfiltration Over Web Service
Reports:
  PCI:
    - 1.1.4
    - 1.3.2
  MITRE ATT&CK:
    - TA0010:T1567
Severity: Low
Description: >
  This policy validates that Network ACLs have some restrictions on outbound traffic.
Runbook: >
  Add appropriate restrictions on outbound traffic.
Reference: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-recommended-nacl-rules.html
Tests:
  - Name: Network ACL Restricts Outbound Traffic
    ExpectedResult: true
    Resource:
      {
        "Associations":
          [
            {
              "NetworkAclAssociationId": "aclassoc-abc111222333",
              "NetworkAclId": "acl-def111222333",
              "SubnetId": "subnet-111222333444",
            },
          ],
        "Entries":
          [
            {
              "CidrBlock": "0.0.0.0/0",
              "Egress": true,
              "IcmpTypeCode": null,
              "Ipv6CidrBlock": null,
              "PortRange": { "From": 1024, "To": 65535 },
              "Protocol": "6",
              "RuleAction": "allow",
              "RuleNumber": 100,
            },
            {
              "CidrBlock": "0.0.0.0/0",
              "Egress": true,
              "IcmpTypeCode": null,
              "Ipv6CidrBlock": null,
              "PortRange": null,
              "Protocol": "-1",
              "RuleAction": "deny",
              "RuleNumber": 4200,
            },
            {
              "CidrBlock": "0.0.0.0/0",
              "Egress": false,
              "IcmpTypeCode": null,
              "Ipv6CidrBlock": null,
              "PortRange": { "From": 80, "To": 80 },
              "Protocol": "6",
              "RuleAction": "allow",
              "RuleNumber": 100,
            },
          ],
        "IsDefault": false,
        "NetworkAclId": "acl-abc111222333",
        "OwnerId": "123456789012",
        "Tags": { "environment": "pci" },
        "VpcId": "vpc-abc111222333",
      }
  - Name: Network ACL Does Not Restrict Outbound Traffic
    ExpectedResult: false
    Resource:
      {
        "Associations":
          [
            {
              "NetworkAclAssociationId": "aclassoc-abc111222333",
              "NetworkAclId": "acl-def111222333",
              "SubnetId": "subnet-111222333444",
            },
          ],
        "Entries":
          [
            {
              "CidrBlock": "0.0.0.0/0",
              "Egress": true,
              "IcmpTypeCode": null,
              "Ipv6CidrBlock": null,
              "PortRange": { "From": 1024, "To": 65535 },
              "Protocol": "6",
              "RuleAction": "allow",
              "RuleNumber": 100,
            },
            {
              "CidrBlock": "0.0.0.0/0",
              "Egress": true,
              "IcmpTypeCode": null,
              "Ipv6CidrBlock": null,
              "PortRange": null,
              "Protocol": "-1",
              "RuleAction": "deny",
              "RuleNumber": 4200,
            },
            {
              "CidrBlock": "0.0.0.0/0",
              "Egress": true,
              "IcmpTypeCode": null,
              "Ipv6CidrBlock": null,
              "PortRange": null,
              "Protocol": "6",
              "RuleAction": "allow",
              "RuleNumber": 100,
            },
          ],
        "IsDefault": false,
        "NetworkAclId": "acl-abc111222333",
        "OwnerId": "123456789012",
        "Tags": { "environment": "pci" },
        "VpcId": "vpc-abc111222333",
      }

Detection logic

Condition

 not not