2015-03-19 47 views
0

我是wso2 esb中的新成员。 我正在尝试做一个安全的代理来保护一个不安全的Web服务。 我按照不同的教程,我做了以下配置我的代理:WSO2 ESB安全代理:发送到后端的请求已签署

`<proxy xmlns="http://ws.apache.org/ns/synapse" 
    name="ProxyStockeSecure" 
    transports="https,http,local" 
    statistics="disable" 
    trace="disable" 
    startOnLoad="true"><target inSequence="LogAndRemoveHeader" outSequence="LogSeqResponse"> 
    <endpoint> 
    <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> 
    </endpoint></target><publishWSDL uri="http://localhost:9000/services/SimpleStockQuoteService?wsdl"/><enableSec/><policy key="sec_policy"/><description/></proxy> 

的LogAndRemoveHeader序列消除安全页眉和登录流程。

<sequence xmlns="http://ws.apache.org/ns/synapse" name="LogAndRemoveHeader"><log level="full"></log><header xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" name="wsse:Security" scope="default" action="remove"></header><log level="full"></log></sequence> 

当我向安全代理发送一个签名的请求时,我可以看到代理验证了它(感谢rampart)。 但是,当我查看后端服务器上的日志时,发现Security标头仍然存在,而我在“LogAndRemoveHeader”序列中删除它。

在WSO2服务器,我可以看到,安全是正确删除:

TID: [0] [ESB] [2015-03-19 01:20:31,508] INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: /services/ProxyStockeSecure, WSAction: urn:getSimpleQuote, SOAPAction: urn:getSimpleQuote, MessageID: urn:uuid:7d951378-9a98-4b60-bcba-cded778ee977, Direction: request, Envelope: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://services.samples"><soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Id-1150340834"> 
    <ser:getSimpleQuote> 
    <!--Optional:--> 
    <ser:symbol>1</ser:symbol> 
    </ser:getSimpleQuote></soap:Body></soap:Envelope> 

但是,在后端服务器上,该安全头又回来了,我觉得WSO2已经重新签署请求。事实上,DigestValue或SignatureValue与原始请求不同...

回答

0

使用send mediator将您的请求发送到LogAndRemoveHeader序列中的后端服务。以下是示例发送中介代码。

<send> 
    <endpoint> 
    <address uri="http://localhost:9000/services/SimpleStockQuoteService"></address> 
    </endpoint> 
</send> 
+0

感谢您的回复。但是发送到后端静止图像的请求包含安全性标头。你有另一个想法吗? – Shod 2015-03-19 10:53:38