π Azure Network Security Group allows unrestricted HTTP(S) access from the Internet π’
- Contextual name: π Security Group allows unrestricted HTTP(S) access from the Internet π’
- ID:
/ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet
- Located in: π Azure Virtual Network
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Cloud Conformity
- Internal
dec-x-f4cc003a
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-f4cc003a | 1 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Network security groups should be periodically evaluated for port misconfigurations. Where certain ports and protocols may be exposed to the Internet, they should be evaluated for necessity and restricted wherever they are not explicitly required and narrowly configured.
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.
Auditβ
From Azure Portalβ
- Open the
Networking
blade for the specific Virtual machine in Azure portal.- Verify that the
INBOUND PORT RULES
does not have a rule for UDP such as:
- port =
80
/443
,- protocol =
TCP
,- Source =
Any
ORInternet
From Azure CLIβ
List Network security groups with corresponding non-default Security rules:
az network nsg list --query [*].[name,securityRules]
Ensure that none of the NSGs have security rule as below:
... see more
Remediationβ
Remediationβ
From Azure Portalβ
- Go to
Virtual machines
.- For each VM, open the
Networking
blade.- Click on
Inbound port rules
.- Delete the rule with:
- Port = 80/443 OR [port range containing 80/443].
- Protocol = TCP OR Any.
- Source = Any (*) OR IP Addresses(0.0.0.0/0) OR Service Tag(Internet).
- Action = Allow.
From Azure CLIβ
Run below command to list network security groups:
az network nsg list --subscription <subscription-id> --output table
- For each network security group, run below command to list the rules associated with the specified port:
az network nsg rule list --resource-group <resource-group> --nsg-name <nsg-name> --query "[?destinationPortRange=='80 or 443']"
- Run the below command to delete the rule with:
- Port = 80/443 OR [port range containing 80/443]
- Protocol = TCP OR "*"
- Source = Any (*) OR IP Addresses(0.0.0.0/0) OR Service Tag(Internet)
- Action = Allow
az network nsg rule delete --resource-group <resource-group> --nsg-name <nsg-name> --name <rule-name>
... [see more](remediation.md)