Unexpected Network Traffic Reaching VM Despite NSG Configuration in Azure

nma 5 Reputation points
2025-02-12T20:30:27.2933333+00:00

We are experiencing an issue where network traffic is reaching our Virtual Machine, even though our Network Security Group (NSG) is configured to block this traffic. For example, traffic on port 80 is being logged by UFW on the VM, despite the NSG rules explicitly denying this port.
Configuration Details:

  • NSG rules are set to deny all incoming traffic on port 80.
  • UFW on the VM confirms that traffic on port 80 is being blocked, but it still shows incoming packets. Issue:
    • We observe incoming traffic on port 80 in the VM logs.
    • This occurs even when the NSG configurations should be blocking it.
    • This raises questions about the efficiency of the NSG

--Why is traffic reaching the VM despite the NSG rules?

Azure Traffic Manager
Azure Traffic Manager
An Azure service that is used to route incoming network traffic for high performance and availability.
132 questions
Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
725 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,648 questions
Microsoft Defender for Cloud
Microsoft Defender for Cloud
An Azure service that provides threat protection for workloads running in Azure, on-premises, and in other clouds. Previously known as Azure Security Center and Azure Defender.
1,497 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. KapilAnanth-MSFT 48,761 Reputation points Microsoft Employee
    2025-02-19T13:14:43.2533333+00:00

    @******@vneuron.com ,

    Greetings.

    I see Vallepu Venkateswarlu has explained that virtual machines in the same subnet can communicate based on a default NSG rule allowing intra-subnet traffic.

    This is because the default rule of AllowVNetInBound takes precedence over DenyAllInbound and hence the Intra-Subnet traffic is allowed.

    I also see you mentioned "successful attempts to bypass the NSG from malicious IPs"

    • Can you please share the list of source IP(s)
    • Is this being simulated by you?
    • Or some random IP(s) you are considering to be malicious?

    Next Steps:

    • You mentioned UFW is logging traffic on Port 80
    • Can you please share what are the source IPs here? Are they from

    If they are from Private IPs,

    If they are from 168.63.129.16 (Wireserver) IP,

    • Then I would recommend you let it be
    • As certain health checks from platform are done from 168.63.129.16

    If they are from Public IP,

    • Ideally, this should not be happening with default NSG rules.
    • Can you confirm if this VM is behind an Azure Load Balancer or not?
    • Can you run the IP flow verify or NSG diagnostics with source IP as the packet logged by UFW (This is important to identify which rule is allowing the packets, please do not test with a random public IP)

    Cheers,

    Kapil

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.