More Info:
Ensure that no network security groups allow unrestricted inbound access on TCP and UDP port 53Risk Level
HighAddress
SecurityCompliance 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)
- FedRAMP
- GDPR
- HIPAA
- 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 CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Cyber Security Framework
- Reserve Bank of India (RBI) Master Direction – Information Technology Framework
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the unrestricted DNS access issue in Azure, please follow the below steps:Step 1: Login to the Azure portal (https://portal.azure.com/) using your credentials.Step 2: In the left-hand side menu, click on the “Networking” option.Step 3: Under the “Networking” menu, click on the “DNS zones” option.Step 4: Select the DNS zone that you want to restrict access to.Step 5: Under the “Settings” menu, click on the “Access control (IAM)” option.Step 6: Click on the “Add” button to add a new role assignment.Step 7: In the “Add role assignment” window, select the “Contributor” role from the “Role” dropdown menu.Step 8: In the “Assign access to” section, select “User, group, or service principal” from the dropdown menu.Step 9: In the “Select” field, enter the name of the user, group, or service principal that you want to restrict access to.Step 10: Click on the “Save” button to save the changes.By following the above steps, you can restrict access to the DNS zone and remediate the unrestricted DNS access issue in Azure.
Using CLI
Using CLI
To remediate Unrestricted DNS Access in AZURE using AZURE CLI, follow these steps:
- Open the AZURE CLI and login to your AZURE account.
- Run the following command to list all the virtual networks in your subscription:
- Identify the virtual network that has unrestricted DNS access.
- Run the following command to update the virtual network and restrict DNS access:
Replace
<virtual_network_name>with the name of the virtual network that has unrestricted DNS access and<resource_group_name>with the name of the resource group that contains the virtual network. - After running the command, verify that the DNS servers are restricted by running the following command:
This command should return an empty array, which means that DNS access is restricted.
Using Python
Using Python
To remediate unrestricted DNS access in Azure using Python, you can use the Azure SDK for Python. Here are the steps:Replace the Replace Replace This code loops through all the records in the zone and removes any A or AAAA records that allow unrestricted access.This code updates the DNS zone with the changes made in step 6.That’s it! This code should remediate unrestricted DNS access in Azure using Python.
- Install the Azure SDK for Python using pip:
- Import the necessary modules:
- Authenticate using Service Principal credentials:
<client-id>, <client-secret>, and <tenant-id> with your own values.- Create a DNS management client:
<subscription-id> with your own subscription ID.- Get the DNS zone that needs to be remediated:
<zone-name> and <resource-group-name> with your own values.- Remove any records that allow unrestricted access:
- Update the DNS zone:
Using Terraform
Using Terraform
azurerm_network_security_group, but it can immediately impact DNS reachability for affected clients once applied.Verification: terraform plan should show removal or modification of any existing inbound Allow rules on TCP/UDP port 53 that have source_address_prefix = "*" / "0.0.0.0/0" or similar, and the creation of the restricted or deny rules above with the desired CIDR ranges.
