Can you establish a Remote Desktop session to a VM that allows the inbound traffic but denies the outbound traffic?

David Oslander 20 Reputation points
2024-10-15T00:18:24.9666667+00:00

Hello, I'm trying to determine what will happen in this Azure Network Security Group (NSG) scenario.

If there are two VMs in the same virtual network named VM1 and VM2, and you want to initiate a Remote Desktop session from VM1 to VM2. And there is an NSG associated with the NIC of VM2 that has a custom rule that Denies outbound TCP 3389 to VirtualNetwork. What will happen when you try to establish a Remote Desktop session from VM1 to VM2?

It seems to me that the default NSG inbound rules would allow TCP 3389 inbound to VM2 since the VMs are in the same virtual network. Ordinarily, when inbound traffic is allowed over a port, it's not necessary to specify an outbound security rule to respond to traffic over the port. But in this case, we have a custom outbound rule that Denies traffic (assume it has a higher priority than the default rules). So does that mean that the session cannot be established? Or is the oubound response allowed because communication was initatied externally? Thank you.

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.
Windows for business | Windows Client for IT Pros | User experience | Remote desktop services and terminal services
{count} votes

Answer accepted by question author
  1. Anonymous
    2024-10-17T05:01:40.41+00:00

    Hi @DavidO-0335

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    To Answer your question,

    Can you establish a Remote Desktop session from VM1 to VM2, would you agree that the answer is No?

    To answer your question: Yes, we can establish an RDP session from VM1 to VM2, unless and until there is a deny all outbound rule configured with high priority on NSG of VM1.

    As you said previously, you have configured a deny outbound rule with high priority on NSG of VM2, so we cannot do the RDP session from V2 to VM1.

    Kindly let us know if the above helps or you need further assistance on this issue.

    If this answers your query, do click **Accept Answer** and **Yes** for was this answer helpful. And, if you have any further query do let us know.

    Thanks,

    Sai Prasanna.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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