Anypoint企业安全IP过滤器

时间:2015-02-10 11:42:11

标签: mule mule-studio mule-component

您好我正在与Mule Anypoint Studio合作,我正在尝试实施IP列表,但我的程序允许来自所有IP的每个请求,并且它仅适用于每个浏览器一个请求。它是如何工作我没有想法。请详细说明工作情况。请不要分享Mule文档链接,因为他们没有提供太多信息。



<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:filters="http://www.mulesoft.org/schema/mule/filters" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/filters http://www.mulesoft.org/schema/mule/filters/current/mule-filters.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
    
    <filters:config name="Filters" doc:name="Filters"/>
    
    <flow name="mule-security-ipFlow1" doc:name="mule-security-ipFlow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="196.111.1.1" port="8081" doc:name="HTTP" path="ip"/>
        <filters:filter-by-ip config-ref="Filters" regex="196.16.4.1,196.17.7.13" doc:name="Filters"/>
        <set-payload value="#['Data Mast']" doc:name="Set Payload"/>
        <logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
    </flow>
    
</mule>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:0)

这里有两种情况,我们可以指定正则表达式来允许某些ip范围请求,或者我们可以指定单个ip地址作为部分正则表达式attaribute值。

<filters:filter-by-ip config-ref="Filters" regex="${fms.iprange}" doc:name="verify-ip-address" />

如果我们想要允许逗号分隔的ip地址,最好编写自定义过滤器并执行所需的逻辑。

答案 1 :(得分:0)

根据您打算如何部署流程,您的另一个选择是使用api-kit将IP白名单(或黑名单)作为策略应用于您的流:

enter image description here