secappdev-09-middleware and web services security...

65
Copyright © 2004-2005 Konstantin Beznosov Middleware and Web Services Security Mechanisms Secure Application Development Module 9 Konstantin Beznosov

Transcript of secappdev-09-middleware and web services security...

Page 1: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Copyright © 2004-2005 Konstantin Beznosov

Middleware and Web ServicesSecurity Mechanisms

Secure Application DevelopmentModule 9

Konstantin Beznosov

Page 2: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

2

Conventional Computer Security

ProtectionAuthorization Accountability Availability

Acc

ess

Con

trol

Dat

a Pr

otec

tion

Audit

Non-Repudiation

Serv

ice

Con

tinui

ty

Dis

aste

r R

ecov

ery

Assurance

Req

uire

men

ts A

ssur

ance

Dev

elop

men

t A

ssur

ance

Ope

ratio

nal A

ssur

ance

Des

ign

Ass

uran

ce

AuthenticationCryptography

Page 3: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

3

Outline

Middleware and Web services• What are middleware and Web services?• What’s special about middleware and Web

services security?

Security in middleware and Web services• What are common architectures for security

mechanisms in most middleware and Webservice technologies?

• What are the differences among securitymechanisms of COM+ and EJB?

Conclusions• Summary• Where to go from here?

Page 4: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Copyright © 2004-2005 Konstantin Beznosov

What is middleware?

It’s what’s betweentopware and underwear

Page 5: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

"Distributed Systems: Principles and Paradigms" by A. S. Tanenbaum, M. van Steen. Prentice Hall; (2002)

Distributed Application Built UsingDOS

Page 6: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Distributed Application Built Using NOS

"Distributed Systems: Principles and Paradigms" by A. S. Tanenbaum, M. van Steen. Prentice Hall; (2002)

Page 7: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Distributed Application Built Using Middleware

1.1

"Distributed Systems: Principles and Paradigms" by A. S. Tanenbaum, M. van Steen. Prentice Hall; (2002)

Page 8: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Software Support for DistributedApplications

System Description Main Goal

DOS Tightly-coupled operating system for multi-processors and homogeneous multicomputers

Hide and managehardware resources

NOS Loosely-coupled operating system forheterogeneous multicomputers (LAN and WAN)

Offer local services toremote clients

Middleware Additional layer atop of NOS implementinggeneral-purpose services

Providedistributiontransparency

Page 9: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Most Middleware UsesRemote Procedure Call (RPC)

"Distributed Systems: Principles and Paradigms" by A. S. Tanenbaum, M. van Steen. Prentice Hall; (2002)

Page 10: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

RPC Clients and Servers

"Distributed Systems: Principles and Paradigms" by A. S. Tanenbaum, M. van Steen. Prentice Hall; (2002)

Page 11: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Distributed Objects

Distributed Computing Environment (DCE)Remote Objects

Common Object Request BrokerArchitecture (CORBA)

Microsoft’s Distributed Component ObjectModel (DCOM) & COM+

Java Remote Method Invocation (RMI) Enterprise Java Beans (EJB) .NET Remoted Objects

Page 12: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Middleware Services

Communication facilities Naming Persistence Concurrency Distributed transactions Fault tolerance Security

Page 13: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Middleware Openness

"Distributed Systems: Principles and Paradigms" by A. S. Tanenbaum, M. van Steen. Prentice Hall; (2002)

Page 14: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Copyright © 2004-2005 Konstantin Beznosov

What’s Web Services?

Page 15: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

15

How do middleware and Webservices differ?

Webservices

middlewareFeatures/properties

yesmostlymostlyOS independent

yesyesyesinteroperability

nomostlyyesCompleteness andportability

nonoyesRPC

nonoyesClient server

MOMtraditional

Page 16: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

16

SOAPReceiver

SOAPSender

SOAPReceiver/Sender

TraderApplication

BrokerageApplication

AccountingApplication

Promise of Web Services

Interoperability across lines of business andenterprises

• Regardless of platform, programming language andoperating system

End-to-end exchange of data• Without custom integration

Loosely-coupled integration across applications• Using Simple Object Access Protocol (SOAP)

Page 17: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

17

Web Services Features

XML-based messaging interface to computingresources that is accessible via Internetstandard protocols

WS help intranet (business units) and extranet(business partners) applications to communicate

SOAP – format for WS communications• Defined in XML• Supports RPC as well as document exchange

• No predefined RPC semantics

• Stateless• Can be sent over various carriers: HTTP, FTP, SMTP,

… postal service

Page 18: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

18

<?xml version="1.0" ?><env:Envelope xmlns:env="http://www.w3.org/2002/06/soap-envelope">

<env:Header><n:alertcontrol xmlns:n="http://example.org/alertcontrol">

<n:priority>1</n:priority><n:expires>2001-06-22T14:00:00-05:00</n:expires>

</n:alertcontrol></env:Header><env:Body>

<m:alert xmlns:m="http://example.org/alert"><m:msg>Pick up Mary at school at 2pm</m:msg>

</m:alert></env:Body>

</env:Envelope>

SOAP Message Example

Page 19: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

19

Typical Web Service Environment

Page 20: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

20

EJB Container

PresentationTier

Web Server

Client Tier

Browser

ApplicationClient

Back-office

Tier

Databases

Mainframes

Component Tier

JSPs

Servlets

EJB

EJB

EJB

RMI-IIOP

HTML

SOAP

JDBC

JCA

RMI-IIOP

J2EE Web Service Systems

Page 21: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

21

Outline

Middleware and Web services• What are middleware and Web services?• What’s special about middleware and Web services

security?

Security in middleware and Web services• What are common architectures for security

mechanisms in most middleware and Web servicetechnologies?

• What are the differences among security mechanismsof COM+ and EJB?

Conclusions• Summary• Where to go from here?

Page 22: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

client-server paradigm & security

A B C

request

requestresponse

A B

request

response

Page 23: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

requirements due to distribution

centralized administration localized run-time decisions

Page 24: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

24

Online Course ApplicationInterface Course with methods postMaterials (Materials m, Module module) Materials getMaterials (Module module ) submitAssignment (Assignment a) Assignment getAssignment (Student student, int number ) postAssignmentInstructions (Instructions i, int number)

C1 C2 C3 C4 C5

Page 25: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

object paradigm & security (1/2)

objects• small amounts of data ==> large numbers

• R: Scale on large numbers of objects and methods

• diverse methods ==> complex semantics• R: Security administrators should not have to understand

semantics of methods

collections• R: Similar names or locations should NOT impose

membership in same collection(s).• R: For an object to be assigned to the same

collection, name similarity and/or co-location shouldnot be required.

Page 26: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

object paradigm & security (2/2)

many layers of indirection and late binding names

• multi-name, nameless and transient objects• R: Transient objects should be assigned to

security policies without human intervention.

• less rigid naming hierarchies• R: No assumptions that administrators know

a name of each object in the system.

Page 27: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

27

Outline

Middleware and Web services• What are middleware and Web services?• What’s special about middleware and Web services

security?

Security in middleware and Web services• What are common architectures for security

mechanisms in most middleware and Web servicetechnologies?

• What are the differences among security mechanismsof COM+ and EJB?

Conclusions• Summary• Where to go from here?

Page 28: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Middleware Security Stack

Application

RPC Abstraction

Proxy

ORB

Security

Service

Security

Mechanism

Implementation

OS

Network

Application

ORB

Security

Service

OS

Network

Adapter

Skeleton

Actual messages

Client Server

Application

Server

Security

Mechanism

Implementation

Middleware Security

security context abstraction

Page 29: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Policy Enforcement and Decision

Target

Enforcement

Function

Decision

FunctionDecision

Request

Decision

Middleware

Middleware Security

Subsystem

Access

Request

Access

Request

Application

Page 30: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Distributed Authentication

Password-based Symmetric key

• e.g., Kerberos

Asymmetric key• e.g., PKI

Page 31: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Data Protection

Application

RPC Abstraction

Proxy

ORB

Security

Service

Security

Mechanism

Implementation

OS

Network

Application

ORB

Security

Service

OS

Network

Adapter

Skeleton

Actual messages

Client Server

Application

Server

Security

Mechanism

Implementation

Middleware Security

security context abstraction

Page 32: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Copyright © 2004-2005 Konstantin Beznosov

Data Protection in Web Services

Page 33: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

33

<? Xml version=‘1.0’ ?><env:Envelope xmlns:env=“http://www.w3.org/2001/12/soap-envelope” xmlns:sec=“http://schmas.xmlsoap.org/ws/2002/04/secext” xmlns:sig=“http://www.w3.org/2000/09/xmldsig#” xmlns:enc=“http://www.w3.org/2001/04/xmlenc#”> <env:Header> <sec:Security

sec:actor=“http://www.w3.org/2001/12/soap-envelope/actor/next” sec:mustUnderstand=“true”> <sig:Signature> … </sig:Signature> <enc:EncryptedKey> … </enc:EncryptedKey> <sec:BinarySecurityToken … </sec:BinarySecurityToken

</sec:Security> </env:Header> <env:Body> <enc:EncryptedData>

… </enc:EncryptedData> </env:Body></env:Envelope>

SOAP Message with WS-Security

Page 34: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

34

WS-Security

Message integrity and messageconfidentiality

Compliance with XML Signature and XMLEncryption

Encoding for binary security tokens• Set of related claims (assertions) about a

subject• X.509 certificates• Kerberos tickets• Encrypted keys

Page 35: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

35

XML Encryption

Encrypt all or part of an XML message Separation of encryption information

from encrypted data Super-encryption of data

<EncryptedData xmlns='http://www.w3.org/2001/04/xmlenc#' Type='http://www.w3.org/2001/04/xmlenc#Content'> <EncryptionMethod Algorithm='http://www.w3.org/2001/04/xmlenc#3des-cbc'/> <ds:KeyInfo xmlns:ds='http://www.w3.org/2000/09/xmldsig#'> <ds:KeyName>John Smith</ds:KeyName> </ds:KeyInfo> <CipherData> <CipherValue>A23B45C56</CipherValue> </CipherData></EncryptedData>

Page 36: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

36

XML Signature Apply to all or part of a document Contains: references to signed portions, canonicalization

algorithm, hashing and signing algorithm Ids, public keyof the signer.

Multiple signatures with different characteristics over thesame content

<Signature Id="MySignature" xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3.org/…/REC-xml-c14n-20010315"/> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/> <Reference URI="http://www.w3.org/TR/2000/REC-xhtml1-20000126/"> <Transforms>

<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> </Transforms> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <DigestValue>j6lwx3rvEPO0vKtMup4NbeVu8nk=</DigestValue>

</Reference> </SignedInfo> <SignatureValue>MC0CFFrVLtRlk=...</SignatureValue> <KeyInfo> <KeyValue> <DSAKeyValue>

<P>...</P><Q>...</Q><G>...</G><Y>...</Y> </DSAKeyValue> </KeyValue> </KeyInfo></Signature>

Page 37: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Copyright © 2004-2005 Konstantin Beznosov

Security Policy Decisions

Page 38: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Policy Enforcement and Decision

Target

Enforcement

Function

Decision

FunctionDecision

Request

Decision

Middleware

Middleware Security

Subsystem

Access

Request

Access

Request

Application

Page 39: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

39

Targ

ets

Methods

Subjects

Clien

ts

attributes permissions domains, types

scaling policy decisions

Page 40: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Credentials Delegation

What are credentials? Push and pull models

Page 41: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development
Page 42: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Issues in Distributed Audit

Monitor activity across and betweenobjects.

Order of the audit records is hard todetermine because of the lack of globaltime.

Performance No guarantee that an event has been

logged.

Page 43: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

43

Outline

Middleware and Web services• What are middleware and Web services?• What’s special about middleware and Web services

security?

Security in middleware and Web services• What are common architectures for security

mechanisms in most middleware and Web servicetechnologies?

• What are the differences among security mechanismsof COM+ and EJB?

Conclusions• Summary• Where to go from here?

Page 44: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Copyright © 2004-2005 Konstantin Beznosov

COM+ Specifics

Page 45: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

45

Authentication in COM+ Supported mechanisms

• Kerberos• Windows NT LAN Manager (NTLM)

Granularity modes• Never• At the time of establishing secure channel• On every call• With every network packet

Credentials delegation options• No delegation• Unconstrained simple delegation (a.k.a.,

impersonation)• Only one hop for NTLM

Page 46: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

46

Data Protection in COM+

Supported modes• Origin authentication and integrity protection• As above + confidentiality protection

Page 47: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

47

Access Control in COM+

The three hurdles to go through1. Activate server process2. Process border checks3. DLL border checks

Granularity• Component• Interface• Method

Page 48: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

48

Administering Access Control

Page 49: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

49

0..*

0..*

1..*implements

defines

1..*

0..*

is granted access to

is granted access to

contains

0..*

0..*

0..*

0..*

is granted access to

0..*

0..*

0..*

0..*

hosts

component

Interface

method

role

account

groupCOM+ Application

Windows Machine

COM+ Access Control Architecture

Page 50: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

50

Application DescriptionApplication: 10 students: s1 … s10

3 instructors: i1, i2, i3 5 courses: c1, … c5

• C1 = {i1, {s1, s2, s3}}• C2 = {i2, {s3, s4, s5}}• C3 = {i3, {s5, s6, s7}}• C4 = {i1, {s7, s8, s9}}• C5 = {{i2, i3}, {s8, s9, s10}}

Policy:1. Students can

1. read course material andassignment instructions for thecourses they are registered

2. submit (i.e., write) theirassignments for the registeredcourses

2. Instructors can1. read student submitted

assignments for the courses theyteach, and

2. post (i.e., write) course materialand assignment instructions fortheir courses

Configure COM+ online course application to implement this policy

Page 51: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

51

A Possible Solution Interface Course with methods

• postMaterials ( CourseId id, Materials m, Module module)• Materials getMaterials (CourseId id, Module module )• submitAssignment (CourseId id, int assignmentNumber )• getAssignment (CourseId id, Student student, int number )• postAssignmentInstructions ( CourseId id, Instructions i, int number)

+postAssignmentInstructions

+getAssignment

+submitAssignment

++getMaterials

+postMaterials

instructorstudent

Page 52: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

52

Accountability in COM+

No out-of-the-box support Developers should rely on Windows event

logs

Page 53: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

Copyright © 2004-2005 Konstantin Beznosov

EJB Specifics

Page 54: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

54

Enterprise Bean class

Client address space (JVM)

EJB object stub

Enterprise Bean instance

Container address space (JVM)

EJB server

Container

Caller IdentityCaller Identity

AccessControlEntries

Bean Identity

EJB object

Common Secure Interoperability (CSI) v2 defineswire protocol

EJB Run-time Security

Page 55: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

55

Authentication in EJB

Defines only the use of JAAS forauthenticating and credentials retrieving

Implementation-specific Credentials delegation options

• No delegation• Unconstrained simple delegation (a.k.a.,

impersonation)

Page 56: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

56

Data Protection in EJB

Implementation-specific

Page 57: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

57

Access Control in EJB

Configured through deployment descriptor Granularity

• Down to individual method on a class, but not beaninstance

• Can be different from JAR to JAR

Expressiveness• method grouped into “method permissions”• Subjects grouped by plain roles• No role hierarchy

Java Authorization Contract for Containers(JACC)• APIs for plugging authorization engines

Page 58: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

58

Defining Roles in EJB<assembly-descriptor> <security-role> <description> blah-blah-blah … </description> <role-name>student</role-name> </security-role>

<security-role> <description> blah-blah-blah … </description> <role-name>instructor</role-name> </security-role> ...</assembly-descriptor>

Page 59: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

59

Assigning Users to Roles in EJB<security-role-mapping> <role-name>student</role-name> <principal-name>S1</principal-name> <principal-name>S2</principal-name> <group-name>students</group-name> </security-role-mapping>

<security-role-mapping> <role-name>instructor</role-name> <principal-name>I1</principal-name> </security-role-mapping>

Page 60: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

60

Assigning Methods to Roles in EJB<method-permission> <role-name>student</role-name> <method> <ejb-name>Course</ejb-name> <method-name>getMaterials</method-name> <method-name>submitAssignment</method-name> </method></method-permission>

<method-permission> <role-name>instructor</role-name> <method> <ejb-name>Course</ejb-name> <method-name>postMaterials</method-name> <method-name>getAssignment</method-name> </method></method-permission>

Page 61: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

61

0..*defines

0..*

0..*

0..1

0..*hosts

0..*0..* permission on

0..*

1..*

grants

0..*

0..* permission on

0..*

Container

Application

entity

security-role

Method

method-permission

roles and permissions in EJB

Page 62: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

62

Fine-grain authorization in EJB

0..*0..1

0..*

hosts

0..*

0..*

0..1role-link

0..*

0..*

1

role-name0..*

security-role

Application

Container

entity

security-role-ref

<<implicit>>internal role

isCallerInRole(role)

Page 63: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

63

Accountability in EJB

Implementation-specific

Page 64: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

64

Summary

Middleware & Web services• Software layer between OS and application to

provide transparencies• Security-related issues: scaling, granularity,

naming

Security in Middleware & Web services• Common features/elements• Technology/product specific

Page 65: secappdev-09-middleware and web services security mechanismslersse-dl.ece.ubc.ca/record/63/files/63.pdf · Middleware and Web Services Security Mechanisms Secure Application Development

65

Where To Go From Here?

B. Hartman, D. J. Flinn, K. Beznosov, and S.Kawamoto, chapter 7, Mastering Web ServicesSecurity, John Wiley & Sons, Inc., 2003.

E. Roman, S. Ambler, and T. Jewell, MasteringEnterprise JavaBeans, Second ed: WileyComputer Publishing, 2002.

B. Hartman, D. J. Flinn, and K. Beznosov,Enterprise Security With EJB and CORBA. JohnWiley & Sons, Inc., 2001.

“Security Engineering …” by Ross Anderson