54
Security Patterns with WSO2 ESB Hasini Gunasinghe Software Engineer-WSO2

Security patterns with wso2 esb

  • Upload
    hasinig

  • View
    1.120

  • Download
    3

Embed Size (px)

DESCRIPTION

Security is a key aspect of any successful enterprise SOA solution. The Enterprise Service Bus is usually the entry point to an enterprise SOA solution. It is also the central place through which the incoming and outgoing messages flow, thus making it the most relevant location to enforce security measures of the solution. This presentation which was used in a webinar, goes through the recurring problems and requirements in the space of identity, security and access control of a SOA solution along with the security patterns that can be applied to overcome them using the WSO2 ESB as a security gateway. Use cases are taken from a Healthcare SOA solution to illustrate these challenges and the corresponding solution patterns that can be designed to overcome them.

Citation preview

Page 1: Security patterns with wso2 esb

Security Patterns with WSO2 ESB

Hasini GunasingheSoftware Engineer-WSO2

Page 2: Security patterns with wso2 esb

Outline

Security requirements of a SOA solution in healthcare domain.

Security patterns to accomplish them.

Implementing patterns with WSO2 ESB.

Page 3: Security patterns with wso2 esb

Example

Ceycare

Systems

Channelling consultation

Hospital Services

Medical Laboratory Services

Collaboration with medical research

institutes

Patients’ data

Medical Test

resultsMedical

statistics

Physicians’ data

Page 4: Security patterns with wso2 esb

Example

Why SOA?

Expose legacy sytem components as services.

Loose coupling Interoperability Flexibility Business process composition.

Page 5: Security patterns with wso2 esb

Example

Why security in SOA?

Business assets exposed to outside as services to be discovered.

Should facilitates interoperability, flexibility.

Page 6: Security patterns with wso2 esb

Security Requirements

Identification and authentication Authorization Intergrity Privacy Security auditing Survivability Non-repudiation

Source: Security in SOA-Based

Healthcare System

Page 7: Security patterns with wso2 esb

Identification & authentication

Requirement:

Services need to identify and verify the claimed identity of internal users of the organization.

Page 8: Security patterns with wso2 esb

Identification & authentication

Pattern:

Authentication Patterns:

Direct Authentication- Authenticating users with credentials stored

internally.

- Credentials can be :- Username/password- Username token- X.509 certificates

Page 9: Security patterns with wso2 esb

Direct Authentication

Patient’s Records:Name:Age:Histroy:

Secured Proxy

Ceycarecredential store

Credential

1

2

3

Page 10: Security patterns with wso2 esb

Identification & authentication

Requirement:

Services need to identify and verify the claimed identity of external users – from partner organizations.

Page 11: Security patterns with wso2 esb

Identification & authentication

Pattern:

Authentication Patterns:

Brokered Authentication Authenticating users outside the organization boundary. Ceycare trusts a token issued by a trusted party in

partner organization. Brokered authentication based on WS-Trust with SAML.

Page 12: Security patterns with wso2 esb

Brokered Authentication

Scenario 1: Authentication accross organizational boundries

Secure Token

Service of CeyMed

CeyMed

CeyCare

CeyMedcredential store

Patient’s Records:Name:Age:Histroy:

Secured Proxy

1

23

4

Page 13: Security patterns with wso2 esb

Identification & authentication

Requirement:

Facilitate communication between clients and services which talk in different authentication mechanisms.

Page 14: Security patterns with wso2 esb

Identification & authentication

Pattern:

Resource Access Patterns:

Protocol Transition ESB authenticates clients with the auth mechanism

that they understand – eg: UT

Transform credentials in the form that service understands - eg: Basic Auth

Page 15: Security patterns with wso2 esb

Protocol Transition

Patient’s Records:Name:Age:Histroy:

Ceycarecredential store

Username Token

2

3

BasicAuth

Header

1

Page 16: Security patterns with wso2 esb

Identification & authentication

Requirements:

- Avoid user credentials to be passed to backend service.

- Avoid user bypassing security processing.

Page 17: Security patterns with wso2 esb

Identification & authentication

Pattern:

Resource Access Patterns: Trusted sub system pattern

User authenticates to ESB with his/her credentials. BE service trusts ESB. ESB accesses BE service on behalf of authenticated

user.

Page 18: Security patterns with wso2 esb

Trusted sub system pattern

Patient’s Records:Name:Age:Histroy:

Secured Proxy

Ceycarecredential store

UserCredenti

al

12

3

ESBCredenti

al

Page 19: Security patterns with wso2 esb

Authorization

Requirement:

Control access based on privileges of the users.

Eg: Users in role: ‘Physician’ can update patients’ records while users in role: ‘Lab technologist’ can only view records

Page 20: Security patterns with wso2 esb

Authorization

Pattern:

Authorization patterns Role based access control:

Assign users to roles. Grant privileges to roles. This is a coarse grained authorization

model.

Page 21: Security patterns with wso2 esb

Authorization

Requirement:

Control access based on user’s claims, in a fine grained manner.

Eg:Heart patients data could only be accessed by Physicians with job title: “Cardiologists”

Page 22: Security patterns with wso2 esb

Authorization

Pattern:

Authorization patterns Claim based authorization :

Provides fine grained authorization. Policy based access control with XACML

– provides flexibilty.

Page 23: Security patterns with wso2 esb

Claim based authorizationAuthorization based on claims carried in SAML token.

SAML Toke

n

Heart Patient’s Records:Name:Age:Histroy:

Secured Proxy

Entitlement Mediator (2) XACML

Authorization request

(3) Authorization decision

[PEP]

PAP, PDP, PIP

1

(4) Allow/deny access

Page 24: Security patterns with wso2 esb

Authorization

Requirement:

Delegating access:Eg:Application in a phisician’s mobile device needs to retrieve channelling appointments from his account in Ceycare System.

Page 25: Security patterns with wso2 esb

Authorization

Pattern:

Authorization patterns Constrained delegation using OAuth:

1. Mobile app authenticates to authorization server.2. Mobile app requests authorization from resource

owner.3. Resource owner authenticates to authorization server.4. Resource owner grants permissions to the application

to access resource on behalf of him. 5. Application obtains access token from access grant.6. Resource server (ESB) validates access token.7. Allow/Deny access to BE resource.

Page 26: Security patterns with wso2 esb

Constrained access delegation

Chanelling appointmentsName:Time:Hospital:

OAuthMediato

r

(3) Authorization grant

(4) Access Token

5

(7) Allow/deny access

1

2

Authorizationrequest

Authorizationgrant

Access request+ Access Token

(6) Validate Access Token

Page 27: Security patterns with wso2 esb

Intergrity & Privacy

Requirements:

Protect sensitive personal data during transmission from : tampering unauthorized access

Non-repudiation - A patient’s account should show who has updated his/her medical records.

Page 28: Security patterns with wso2 esb

Intergrity & Privacy

Patterns:

Message protection patterns: Data origin authentication and

intergrity - digital signatures. Data confidentiality - digital

encyption.

Page 29: Security patterns with wso2 esb

Message protection patternExample Configuration:

Page 30: Security patterns with wso2 esb

Message protection patternExample Configuration:

Page 31: Security patterns with wso2 esb

Intergrity & Privacy

Requirement:

Avoid exposing sensitive data through exceptions. Legacy application code might throw

exceptions containing sensitive information. Need to filter those expections when system

is exposed to external parties.

Page 32: Security patterns with wso2 esb

Intergrity & Privacy

Pattern:

Boundry defense pattern Exception shielding:

- Sanitize unsafe exception data by replacing it with non-harmful exception message.

- Enrich mediator of ESB.

Page 33: Security patterns with wso2 esb

Exception Shielding

Example un-safe message:

Page 34: Security patterns with wso2 esb

Exception Shielding

Example Configuration:

Page 35: Security patterns with wso2 esb

Security Auditing

Requirement:

Log security incidents to trace system abuse:- Failed login attempts - Unauthorized access attempts to

services

Page 36: Security patterns with wso2 esb

Security Auditing

Pattern:

Boundry defense pattern: Audit Intercepter

All messages flow through the a gateway of the system. (ESB)

Necessary auditing is done by the logging at the gateway. (Log mediators of ESB)

Page 37: Security patterns with wso2 esb

Audit Intercepter

Example Configuration:

Page 38: Security patterns with wso2 esb

Survivability

Requirement:

Prevent denial of service attacks caused by replaying valid messages.

Page 39: Security patterns with wso2 esb

Survivability

Pattern:

Boundray defense pattern Replay mitigation:- Apply throttling rules at the entry

point (ESB).- Validate message freshness by WS-

Security mechanisms (Timestamp).

Page 40: Security patterns with wso2 esb

Replay mitigation

Applying throttling rules in ESB:

Control access at three different levels through throttling:1. Global2. Service3. Operation

Page 41: Security patterns with wso2 esb

Replay mitigation

Throttling at global level:

Page 42: Security patterns with wso2 esb

Replay mitigation

Throttling at service level:

Page 43: Security patterns with wso2 esb

Replay mitigation

Configuring throttling in ESB:

Page 44: Security patterns with wso2 esb

Replay mitigation

Example Time Stamp in WS-Security Header:

Page 45: Security patterns with wso2 esb

Survivability

Requriement:

Mitigate damages to the system from messages with malicious content :- SQL injection - X-Doc attacks

Page 46: Security patterns with wso2 esb

Survivability

Pattern:

Boundray defense pattern Message validation :- XML Schema validation.- Regular expression validation to

avoid SQL injections contained in strings.

- Validation & Filter mediators of ESB.

Page 47: Security patterns with wso2 esb

Message Screening/Validation

Examlpe SQL Injection attack:

Query:SELECT * FROM p r e s c r i p t i o n s WHERE pat i ent ID = ' + $pat i ent ID +' ;

If $pat i ent ID = 3 5 2 1 ' ; DROP TABLE p a t i e n t s ;

Resulting query causing SQL injection:SELECT FROM p r e s c r i p t i o n s WHERE pat i ent ID = ' 3 5 2 1 ' ;DROP TABLE p a t i e n t s ;

Source: Security in SOA-Based Healthcare System

Page 48: Security patterns with wso2 esb

Message Screening/Validation

Example Configuration:

Page 49: Security patterns with wso2 esb

Today we discussed ...

Security requierments related to a healthcare SOA solution.

Security patterns used to accomplish them.

How WSO2 ESB fits in the security patterns.

Page 50: Security patterns with wso2 esb

References:

WSO2 Security & Identity Gateway solution white paper:http://wso2.com/casestudies/wso2-security-and-identity-gateway-solution/

Security in SOA based healthcare

systems:By Richard Sassoon

Page 51: Security patterns with wso2 esb

Q & A

Page 52: Security patterns with wso2 esb

https://ail.google.com/mail/u/0/?ui=2&ik=ad9ae58f41&view=att&th=1331a70983344a32&attid=0.1&disp=thd&realattid=f_gtxto6mk0&zw

Selected Customers

Page 53: Security patterns with wso2 esb

WSO2 engagement model• QuickStart• Development

Support• Development

Services• Production

Support• Turnkey Solutions• WSO2 Mobile Services Solution

• WSO2 FIX Gateway Solution

• WSO2 SAP Gateway Solution

Page 54: Security patterns with wso2 esb

Thank you...!!!

Contact us: [email protected]