More Info:

Check your Microsoft Azure network security groups (NSGs) for inbound rules that allow unrestricted access (i.e. 0.0.0.0/0) on TCP port 22 and restrain access to only those IP addresses that require it in order to implement the principle of least privilege and reduce the possibility of a breach. TCP port 22 is used for secure remote login by connecting an SSH client application with an SSH server.

Risk Level

Critical

Address

Security

Compliance Standards

HITRUST, CISAZURE, CBP, SOC2, PCIDSS, ISO27001, HIPAA, GDPR, NISTCSF, FedRAMP

Triage and Remediation

Remediation

To remediate unrestricted SSH access in Azure, you can follow these steps:

  1. Log in to the Azure portal (https://portal.azure.com/).
  2. Navigate to the virtual machine that has unrestricted SSH access.
  3. Click on the “Networking” tab in the left-hand menu.
  4. Under “Inbound port rules,” click on “Add inbound port rule.”
  5. In the “Add inbound security rule” window, enter a name for the rule (e.g., “SSH access restricted”).
  6. Under “Destination port ranges,” enter “22” (or the port number that SSH is using).
  7. Under “Source,” select “IP Addresses.”
  8. Under “Source IP addresses,” enter the IP address or range that should have access to SSH (e.g., your own IP address or a specific subnet).
  9. Under “Action,” select “Allow.”
  10. Click “Add” to create the rule.
  11. Repeat steps 4-10 for any other virtual machines that have unrestricted SSH access.

By following these steps, you have now restricted SSH access to only the specified IP address or range, thereby reducing the risk of unauthorized access to your virtual machines.