Ws security with mule

12
WS Security in Mule By Anirban Sen Chowdhary

Transcript of Ws security with mule

Page 1: Ws security with mule

WS Security in MuleBy Anirban Sen Chowdhary

Page 2: Ws security with mule

Web Services Security (WS-Security, WSS) is an extension to SOAP to apply security to Web services.If a web service is exposed to external world, the data it carries can comes under the threat to several potential security vulnerabilities.So, in order to protect our web service we require Web Services Security

Page 3: Ws security with mule

WS-Security describes 3 main mechanisms:• How to sign SOAP messages to assure integrity. Signed messages

also provide non-repudiation.• How to encrypt SOAP messages to assure confidentiality.• How to attach security tokens to ascertain the sender's identity.

Page 4: Ws security with mule

WS-Security incorporates security features in the header of a SOAP message.It works in application layer.

In this example we will be implementing a simple username and password in the WS Security format.

Page 5: Ws security with mule

So, we will expose a SOAP web service that will implement WS Security :-

Page 6: Ws security with mule

To expose a web service with security in Mule we need spring security in our flow :-<mule-ss:security-manager> <mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager" /> </mule-ss:security-manager> <spring:beans> <ss:authentication-manager alias="authenticationManager"> <ss:authentication-provider> <ss:user-service id="userService"> <ss:user name=“anirban" password=“password authorities="ROLE_ADMIN" /> </ss:user-service> </ss:authentication-provider> </ss:authentication-manager> </spring:beans>

<cxf:ws-security name="inboundSecurityConfig"><cxf:mule-security-manager /> <cxf:ws-config><cxf:property key="action" value="UsernameToken" /></cxf:ws-config></cxf:ws-security>

Page 7: Ws security with mule

.

And our Mule flow will be :-

<flow name="securedSoapService"><http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8090" path="designation" doc:name="HTTP"><cxf:jaxws-service serviceClass="com.getdesignation.test.services.schema.maindata.v1.GetDesignation"><cxf:ws-security ref="inboundSecurityConfig"/></cxf:jaxws-service></http:inbound-endpoint><component class="com.getdesignation.test.services.schema.maindata.v1.Impl.GetDesignationImpl" /></flow>

Page 8: Ws security with mule

Following will be our flow in graphical mode ready with security :-

Page 9: Ws security with mule

Now, we will be testing our secured web service in SOAPUI

You can see here, we are testing the service by giving username and password in the header section of SOAP request and I am getting the response back from the service

Page 10: Ws security with mule

So, you can see WS-Security offers confidentiality and integrity protection from the creation of the message to it's consumption. WS-Security offers more protection than HTTPS would, and SOAP offers a richer API than any other security .Thus we can say WS-Security has measures for authentication, integrity, confidentiality and non-repudiation  

Page 11: Ws security with mule

In my next slide I will bring some other techniques of implementing WS Security in Mule.Hope you have enjoyed this simpler version. 

Page 12: Ws security with mule

Thank You