如何检查Azure网络安全组出站IP是否允许?

问题描述:

关于Azure网络安全组,我几乎没有问题。
当前,我正在使用Azure App Services发布网站,并在Azure,App Services,NSG控制的网络端(如入站和出站安全性及其他方面)发布我的网站。

I have few problems regarding Azure Network Security Group. Currently I'm using Azure App Services to publish my website and in Azure, App Services, Network Side Controlled By NSG such as inbound and outbound security and other things.

我正在使用sagepay付款网关,他们要求我执行以下步骤以成功完成sagepay集成。

I'm working with sagepay payment gateway.they asked me to do following steps in order to success my sagepay integration.


Please ensure that all of the following IP addresses are allowed
within your Server or Firewall:

For outbound traffic to our gateway:

195.170.169.9 – live.sagepay.com
195.170.169.8 – test.sagepay.com

For inbound traffic you only need to whitelist IPs if you are
The IPs from which we call back are:

195.170.169.14
195.170.169.18
195.170.169.15

The Subnet mask used by Sage Pay is 255.255.255.000

Please ensure that your firewalls allow outbound Port 443 (HTTPS
only!) and inbound Ports 443 (and optionally 80 HTTP) access in
order to communicate with our servers (on Simulator/Test/Live).


在我的网络组中,

我刚刚将入站规则添加到端口80,443和白名单IP-195.170.169.0/24
,并且对我的出站规则也做了同样的事情。

I just added Inbound rule to port 80,443 and whitelist IPs - 195.170.169.0/24 and did same thing to my outbound rule also.

但是我应该如何检查这些事情是否正常?
,因为我的网站仍然无法从sagepay方面获得响应(根据sagepay支持团队的说法,通知UR​​L也是正确的)

but how do i suppoed to check these things are working or not? because still my web site cannot get respond from sagepay side(notification URL is also correct according to sagepay support team)

这是评论中您后续问题的答案。

Here's the answer for your follow up question in the comments.

<system.webServer>
    <security>
       <!-- this line denies everybody, except those listed below -->            
       <ipSecurity allowUnlisted="false">
           <!-- remove all upstream restrictions -->    
           <clear/>
           <!-- allow this network -->          
           <add ipAddress="195.170.169.0" subnetMask="255.255.255.0" allowed="true" />
       </ipSecurity>
    </security>
...
</system.webServer>

预期结果(当来自允许网络之外的公共IP地址时):

Expected result (when coming from a public IP address outside the allowed network):

$ curl -i http://{sitename}.azurewebsites.net/

HTTP/1.1 403 Forbidden
Content-Length: 58
Content-Type: text/html
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
Date: Sat, 06 Aug 2016 19:46:04 GMT

You do not have permission to view this directory or page.