Skip to main content

More Info:

Ensure that no network security groups allow unrestricted inbound access on TCP port 80.

Risk Level

Critical

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • HITRUST CSF
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

The remediation steps for Unrestricted HTTP Access in AZURE are:
  1. Login to the AZURE portal (https://portal.azure.com/)
  2. Navigate to the Virtual Machine that has unrestricted HTTP access.
  3. Click on the “Networking” tab on the left-hand side of the Virtual Machine page.
  4. Under the “Inbound port rules” section, click on “Add inbound port rule”.
  5. In the “Add inbound security rule” page, provide the following details:
    • Name: A name for the new rule
    • Priority: A number that specifies the priority of the rule. A lower number indicates a higher priority.
    • Protocol: Select “TCP” from the dropdown.
    • Port range: Specify the port range that you want to restrict. For example, if you want to restrict port 80, enter “80” in both the “Start port” and “End port” fields.
    • Action: Select “Deny” from the dropdown.
    • Source: Select “Any” from the dropdown.
    • Destination: Select “Any” from the dropdown.
  6. Click on “Add” to create the new rule.
  7. Repeat steps 4-6 for all the ports that you want to restrict.
  8. Once all the necessary rules have been created, click on “Save” to apply the changes.
After completing these steps, the unrestricted HTTP access should be remediated for the Virtual Machine in AZURE.

To remediate unrestricted HTTP access in AZURE using AZURE CLI, follow the below steps:
  1. Login to Azure CLI using the command “az login”. Enter your Azure credentials when prompted.
  2. Run the command “az network nsg list” to list all the network security groups (NSGs) in your subscription.
  3. Identify the NSG that is associated with the virtual machine or the subnet that has unrestricted HTTP access.
  4. Run the command az network nsg rule list --nsg-name <NSG-Name> to list all the rules in the NSG.
  5. Identify the rule that allows unrestricted HTTP access.
  6. Run the command “az network nsg rule delete —nsg-name <NSG-Name> —name <Rule-Name>” to delete the rule that allows unrestricted HTTP access.
  7. Confirm the deletion by running the command az network nsg rule list --nsg-name <NSG-Name> again and verifying that the rule is no longer present.
  8. Repeat the above steps for all the NSGs that have unrestricted HTTP access.
  9. Once all the rules have been deleted, the unrestricted HTTP access issue should be resolved.
Note: It is recommended to restrict access to HTTP and allow access only through HTTPS to ensure secure communication.
To remediate unrestricted HTTP access in Azure using Python, you can use the Azure Python SDK to create a Network Security Group (NSG) and apply it to the virtual network. The NSG will contain a rule that blocks all inbound traffic on port 80.Here are the step-by-step instructions:
  1. Install the Azure Python SDK using pip:
  1. Import the necessary modules:
  1. Create a Service Principal for authentication:
Replace <client_id>, <client_secret>, and <tenant_id> with your Azure AD credentials.
  1. Create an instance of the NetworkManagementClient:
Replace <subscription_id>, <resource_group_name>, and <location> with your Azure subscription ID, resource group name, and location.
  1. Create a Network Security Group:
Replace <nsg_name> with a name for your Network Security Group.
  1. Create a Security Rule to block inbound traffic on port 80:
Replace <rule_name> with a name for your Security Rule.
  1. Apply the Network Security Group to your virtual network:
Replace <vnet_name> with the name of your virtual network.That’s it! The Network Security Group will now block all inbound traffic on port 80, remedying the unrestricted HTTP access misconfiguration.
Changing an azurerm_network_security_rule like this does not force replacement of the NSG itself; the rule is updated in place, but traffic behavior changes immediately after apply, which may impact existing HTTP clients not in TRUSTED_CIDR_BLOCK.For verification, terraform plan should show the existing port 80 rule either being destroyed and replaced, or updated so that source_address_prefix/source_address_prefixes is no longer "*" or "0.0.0.0/0" for inbound TCP on port 80.