|
| 1 | +export default { |
| 2 | + id: 'aws-cis-1.5.0-5.1', |
| 3 | + title: 'AWS CIS 5.1 Ensure no Network ACLs allow ingress from 0.0.0.0/0 to remote server administration ports', |
| 4 | + |
| 5 | + description: 'The Network Access Control List (NACL) function provide stateless filtering of ingress and egress network traffic to AWS resources. It is recommended that no NACL allows unrestricted ingress access to remote server administration ports, such as SSH to port 22 and RDP to port 3389.', |
| 6 | + |
| 7 | + audit: `**From Console:** |
| 8 | + Perform the following to determine if the account is configured as prescribed: |
| 9 | + |
| 10 | + 1. Login to the AWS Management Console at https://console.aws.amazon.com/vpc/home |
| 11 | + 2. In the left pane, click *Network ACLs* |
| 12 | + 3. For each network ACL, perform the following: |
| 13 | + - Select the network ACL |
| 14 | + - Click the *Inbound Rules* tab |
| 15 | + - Ensure no rule exists that has a port range that includes port *22*, *3389*, or other remote server administration ports for your environment and has a *Source* of *0.0.0.0/0* and shows *ALLOW* |
| 16 | + |
| 17 | + **Note:** A Port value of *ALL* or a port range such as *0-1024* are inclusive of port *22*, *3389*, and other remote server administration ports`, |
| 18 | + |
| 19 | + rationale: 'Public access to remote server administration ports, such as 22 and 3389, increases resource attack surface and unnecessarily raises the risk of resource compromise.', |
| 20 | + |
| 21 | + remediation: `**From Console:** |
| 22 | + Perform the following: |
| 23 | + |
| 24 | + 1. Login to the AWS Management Console at https://console.aws.amazon.com/vpc/home |
| 25 | + 2. In the left pane, click *Network ACLs* |
| 26 | + 3. For each network ACL to remediate, perform the following: |
| 27 | + - Select the network ACL |
| 28 | + - Click the *Inbound Rules* tab |
| 29 | + - Click *Edit inbound rules* |
| 30 | + - Either A) update the Source field to a range other than 0.0.0.0/0, or, B) Click *Delete* to remove the offending inbound rule |
| 31 | + - Click *Save*`, |
| 32 | + |
| 33 | + references: [ |
| 34 | + 'https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html', |
| 35 | + 'https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Security.html#VPC_Security_Comparison', |
| 36 | + ], |
| 37 | + gql: `{ |
| 38 | + queryawsNetworkAcl { |
| 39 | + id |
| 40 | + arn |
| 41 | + accountId |
| 42 | + __typename |
| 43 | + inboundRules { |
| 44 | + source |
| 45 | + fromPort |
| 46 | + toPort |
| 47 | + allowOrDeny |
| 48 | + } |
| 49 | + } |
| 50 | + }`, |
| 51 | + resource: 'queryawsNetworkAcl[*]', |
| 52 | + severity: 'high', |
| 53 | + conditions: { |
| 54 | + not: { |
| 55 | + path: '@.inboundRules', |
| 56 | + array_any: { |
| 57 | + and: [ |
| 58 | + { |
| 59 | + path: '[*].source', |
| 60 | + in: ['0.0.0.0/0', '::/0'], |
| 61 | + }, |
| 62 | + { |
| 63 | + path: '[*].allowOrDeny', |
| 64 | + equal: 'allow', |
| 65 | + }, |
| 66 | + { |
| 67 | + or: [ |
| 68 | + { |
| 69 | + and: [ |
| 70 | + { |
| 71 | + path: '[*].fromPort', |
| 72 | + equal: null, |
| 73 | + }, |
| 74 | + { |
| 75 | + path: '[*].toPort', |
| 76 | + equal: null, |
| 77 | + }, |
| 78 | + ], |
| 79 | + }, |
| 80 | + { |
| 81 | + or: [ |
| 82 | + { |
| 83 | + and: [ |
| 84 | + { |
| 85 | + path: '[*].fromPort', |
| 86 | + lessThanInclusive: 22, |
| 87 | + }, |
| 88 | + { |
| 89 | + path: '[*].toPort', |
| 90 | + greaterThanInclusive: 22, |
| 91 | + }, |
| 92 | + ], |
| 93 | + }, |
| 94 | + { |
| 95 | + and: [ |
| 96 | + { |
| 97 | + path: '[*].fromPort', |
| 98 | + lessThanInclusive: 3389, |
| 99 | + }, |
| 100 | + { |
| 101 | + path: '[*].toPort', |
| 102 | + greaterThanInclusive: 3389, |
| 103 | + }, |
| 104 | + ], |
| 105 | + }, |
| 106 | + ] |
| 107 | + }, |
| 108 | + ], |
| 109 | + }, |
| 110 | + ], |
| 111 | + }, |
| 112 | + }, |
| 113 | + }, |
| 114 | +} |
0 commit comments