Skip to main content

More Info:

Ensure that no network security groups allow unrestricted inbound access on TCP port 445 (Common Internet File System – CIFS).

Risk Level

High

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
  • FedRAMP
  • GDPR
  • 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

Using Console

To remediate the “Unrestricted CIFS Access” misconfiguration in Azure, you can follow these steps:
  1. Login to the Azure portal (https://portal.azure.com/).
  2. Navigate to the storage account that has the misconfiguration.
  3. Click on the “Firewalls and virtual networks” tab from the left-hand menu.
  4. Under the “Allow access from” section, select “Selected networks”.
  5. In the “Selected networks” section, click on the “Add existing virtual network” button.
  6. Select the virtual network that is associated with the resource that needs access to the storage account.
  7. Click on the “Add” button.
  8. Under the “Allow trusted Microsoft services” section, select “Yes”.
  9. Click on the “Save” button to apply the changes.
By following these steps, you have restricted the access to the storage account to only the selected virtual network and allowed trusted Microsoft services to access it. This should remediate the “Unrestricted CIFS Access” misconfiguration.

To remediate unrestricted CIFS access in Azure using Azure CLI, follow these steps:
  1. Open the Azure CLI and connect to your Azure account.
  2. Identify the storage account that has unrestricted CIFS access. You can do this by running the following command:
    This command will list all the storage accounts that have their default network access set to “Allow”.
  3. Once you have identified the storage account, you can update its network access rules to restrict CIFS access. You can do this by running the following command:
    Replace <storage-account-name> with the name of the storage account that you want to update and <resource-group-name> with the name of the resource group that the storage account belongs to.
  4. After running the above command, you can verify that the update was successful by running the following command:
    This command will return the default network access rule for the storage account. It should now be set to “Deny”.
By following these steps, you have successfully remediated unrestricted CIFS access in Azure using Azure CLI.
To remediate unrestricted CIFS access in AZURE using python, follow the below steps:
  1. Import the necessary libraries:
  1. Set the subscription ID, resource group name, and storage account name:
  1. Create a credential object to authenticate the programmatic access:
  1. Create a storage management client object:
  1. Get the storage account properties:
  1. Check if CIFS access is allowed:
  1. If CIFS access is allowed, update the network rules to deny CIFS access:
These steps will remediate unrestricted CIFS access in Azure using Python.
Changing or removing a security_rule is in-place and does not force replacement of the azurerm_network_security_group itself, but it will immediately alter live traffic filtering once applied.Verification: terraform plan should show the existing rule that allowed Tcp on port 445 from * / 0.0.0.0/0 being removed or modified, and the new/updated security_rule blocks as additions/changes on the azurerm_network_security_group resource.