Azure API App的IP地址以及如何限制IP

编程入门 行业动态 更新时间:2024-10-26 16:22:29
本文介绍了Azure API App的IP地址以及如何限制IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

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

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

解决方案

Azure Web应用程序可以使用一系列ip地址-基本上,您的网站托管在vnet托管的Web场中由Microsoft.Microsoft确实会发布地址,但它们也可能会更改.找到了链接在此处从azure网站发现传出IP地址,它说您现在可以直接从门户页面获取此信息./p>

对于另一个问题,如果您想保护您的服务或应用程序,以便只能从特定的地址或范围内调用它们,则可以继续使用azure的Web应用程序,并在web.config中使用IPFilters,或者使用App Service环境(您自己的vnet上的私有Web服务器场)并设置网络安全组以控制流量;或托管在VM中,如果需要,您可以在其中组合IP过滤器,nsgs和Windows防火墙!

基于Java的应用程序(Tomcat)的IP过滤:请参见服务器故障答案

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

< security><!-拒绝所有人->< ipSecurity allowUnlisted ="false"><!-清除"将删除所有上游限制-><清除/><<!-允许回送地址->< add ipAddress ="127.0.0.1" allowed ="true"/><!-允许网络83.116.119.0到83.116.119.255->< add ipAddress ="83.116.119.0" subnetMask ="255.255.255.0" allowed ="true"/></ipSecurity></security>

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 ( 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

本文发布于:2023-08-01 16:36:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1269904.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:地址   API   Azure   IP   App

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!