Aidan Finn, IT Pro 2024年08月28日
Network Rules Versus Application Rules for Internal Traffic
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

文章讨论了在Azure Firewall中使用Network Rules或Application Rules处理内部流量的情况,包括规则类型、常见场景、出现的问题及解决方案等。

🎯Azure Firewall中有DNAT Rules、Application Rules和Network Rules三种规则类型。DNAT Rules控制来自互联网的流量,Application Rules控制流向HTTP、HTTPS或MSSQL的流量,Network Rules控制任意流向的流量。

📋文中提到一种内部客户端连接服务器的场景,客户端可能通过多种方式连接,连接需SSL认证,服务器通过Azure Firewall的路由连接到另一个虚拟网络/子网。

💡当客户端连接服务器出现问题时,经排查发现是Application Rule进行SNAT导致的。解决方法有修改NSG规则以继续使用Application Rules,或使用Network Rules,各有优缺点。

📖文章还提到了何时使用不同规则的建议,如DNAT Rules用于特定情况,Application Rules用于出站连接到互联网,Network Rules用于其他情况。

This post is about using either Network Rules or Application Rules in Azure Firewall for internal traffic. I’m going to discuss a common scenario, a “problem” that can occur, and how you can deal with that problem.

The Rules Types

There are three kinds of rules in Azure Firewall:

The Scenario

We have an internal client, which could be:

The client needs to connect to a server, with SSL authentication, to a server. The server is connected to another virtual network/subnet. The route to the server goes through the Azure Firewall. I’ll complicate things by saying that the server is a PaaS resource with a Private Endpoint – this doesn’t affect the core problem but it makes troubleshooting more difficult

NSG rules and firewall rules have been accounted for and created. The essential connection is either HTTPS or MSSQL and is implemented as an Application Rule.

The Problem

The client attempts a connection to the server. You end up with some type of application error stating that there was either a timeout or a problem with SSL/TLS authentication.

You begin to troubleshoot:

You try and discover two things:

So, something is going on with the Application Rules.

The Root Cause

In this case, the Application Rule is SNATing the connection. In other words, when the connection is relayed from the Azure Firewall instance to the server, the source IP is no longer that of the client; the source IP address is a compute instance in the AzureFirewallSubnet.

That is why:

Solutions

There are two solutions to the problem:

Using Application Rules

If you want to continue to use Application Rules then the fix is to modify the NSG rule. Change the source IP prefix(es) to be the AzureFirewallSubnet.

The downsides to this are:

Using Network Rules

My preference is to use Network Rules for all inbound and east-west traffic. Yes, we lose some of the “Layer-7” features but we still have core features, including IDPS in the Premium SKU.

Contrary to using Application Rules:

When To Use Application Rules?

In my sessions/classes, I teach:

This approach limits “weird sh*t” errors like what is described above and means that NSG rules are effectively clones of the Azure Firewall rules, with some additional stuff to control stuff inside of the Virtual Network/subnet.

The post Network Rules Versus Application Rules for Internal Traffic first appeared on Aidan Finn, IT Pro.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Azure Firewall Network Rules Application Rules 内部流量
相关文章