Azure API App的IP地址以及如何限制IP [英] IP address of Azure API App and how to restrict IPs

查看:56
本文介绍了Azure API App的IP地址以及如何限制IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经部署了用Java Servlet编写的API App.

我想知道的是,我的API应用程序的IP地址以及允许仅来自一个或两个IP地址的请求的方式,这意味着我想限制除这些IP地址之外的所有IP.

一旦我在一个区域中部署了多个APP,似乎就可以共享IP地址.

无论如何,请给我一些建议:)

解决方案

Azure Web应用程序可以使用一系列ip地址-基本上,您的网站托管在vnet托管的Web场中由Microsoft.Microsoft确实会发布地址,但它们也可能会更改.找到了链接服务器故障答案

web.config(基于.net的应用程序)中的IP过滤:请参见

I have deployed API App written in Java Servlet.

What I want to know is, that IP address of my API App and the way to allow requests from only one or two IP addresses meaning I want to restrict every IPs except for those.

seems like IP addresses are shared once i deploy several APPs in one region.

anyway please give me some advice : )

解决方案

There is a range of ip addresses that can be used by azure web apps - basically you are having your site hosted in a web farm that is on a vnet managed by Microsoft. Microsoft do publish the addresses but they are also subject to change. Found the link discovering outgoing ip addresses from azure web sites here and it says you can now get this information directly from your portal pages.

For the other question, if you want to protect your services or apps so they can only be called from specific up addresses or ranges, you can continue to use web apps in azure and use IPFilters in the web.config, or use App Service Environments (a private web server farm on your own vnet) and setup network security groups to control traffic; or host in a VM where you can combine ip filters, nsgs and Windows firewall if you want!

IP Filtering for Java based apps (Tomcat): see server fault answer

IP filtering in web.config (.net based apps): see this page

<security>
    <!-- deny everybody -->
   <ipSecurity allowUnlisted="false">
        <!-- "clear" removes all upstream restrictions -->
       <clear/>
       <<!-- permit the loopback address  -->
       <add ipAddress="127.0.0.1" allowed="true"/>
        <!--permit network 83.116.119.0 to 83.116.119.255-->
       <add ipAddress="83.116.119.0" subnetMask="255.255.255.0" allowed="true"/>
   </ipSecurity>
</security>

这篇关于Azure API App的IP地址以及如何限制IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆