| name | cis-azure-foundations-7.4 |
| description | Ensure HTTP(S) access from the Internet is evaluated and restricted |
| category | cis-azure-foundations |
| version | 5.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","networking","nsg"] |
| cis_id | 7.4 |
| cis_benchmark | CIS Microsoft Azure Foundations Benchmark v5.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | ["cis-azure-foundations-7.1","cis-azure-foundations-7.2","cis-azure-foundations-7.3","cis-azure-foundations-7.11"] |
| prerequisites | [] |
| severity_boost | {} |
Ensure HTTP(S) access from the Internet is evaluated and restricted
Description
Network security groups should be periodically evaluated for port misconfigurations. Where HTTP(S) is not explicitly required and narrowly configured for resources attached to a network security group, Internet-level access to Azure resources should be restricted or eliminated.
Rationale
The potential security problem with using HTTP(S) over the Internet is that attackers can use various brute force techniques to gain access to Azure resources. Once the attackers gain access, they can use the resource as a launch point for compromising other resources within the Azure tenant.
Impact
None documented. Restricting HTTP(S) access from the Internet is a security best practice with no negative functional impact when properly configured.
Audit Procedure
Using Azure Portal
- Go to
Network security groups.
- Click the name of a network security group.
- Under
Settings, click Inbound security rules.
- Ensure that no inbound security rule exists that matches the following:
- Port:
80, 443, or range including 80 or 443
- Protocol:
TCP or Any
- Source:
0.0.0.0/0, Internet, or Any
- Action:
Allow
- Repeat steps 1-4 for each network security group.
Using Azure Resource Graph
- Go to
Resource Graph Explorer.
- Click
New query.
- Paste the following into the query window:
resources | where type =~ "microsoft.network/networksecuritygroups" | project id, name, securityRule = properties.securityRules | mv-expand securityRule | extend access = securityRule.properties.access, direction = securityRule.properties.direction, protocol = securityRule.properties.protocol, destinationPort = case(isempty(securityRule.properties.destinationPortRange), securityRule.properties.destinationPortRanges, securityRule.properties.destinationPortRange), sourceAddress = case(isempty(securityRule.properties.sourceAddressPrefix), securityRule.properties.sourceAddressPrefixes, securityRule.properties.sourceAddressPrefix) | where access =~ "Allow" and direction =~ "Inbound" and protocol in~ ("tcp", "*") | mv-expand destinationPort | mv-expand sourceAddress | extend destinationPortMin = toint(split(destinationPort, "-")[0]), destinationPortMax = toint(split(destinationPort, "-")[-1]) | where (destinationPortMin <= 80 and destinationPortMax >= 80) or (destinationPortMin <= 443 and destinationPortMax >= 443) or destinationPort == "" | where sourceAddress in~ ("*", "0.0.0.0", "internet", "any") or sourceAddress endswith "/0"