Top Banner
APPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010
62

APPLICATION SECURITY E J EE 6 - · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

Mar 06, 2018

Download

Documents

phungnga
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

APPLICATION SECURITY

ENHANCEMENTS IN JAVA EE 6

SRINI PENCHIKALA

Austin Java User Group Meeting

October 26, 2010

Page 2: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

ABOUT THE SPEAKER

Security Architect

Certified Scrum Master

Author, Editor (InfoQ)

IASA Austin Chapter Leader

Detroit Java User Group Leader

Working with Java since 1996, JEE (2000), SOA

(2006) & PPT since 01/2010

Current: Agile Security Architectures, Domain-

Driven Design, Architecture Enforcement, MDD

Future: Role of DSL in Architecture Enforcement 2

Page 3: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

GOALS FOR THIS PRESENTATION

Overview of new authentication and authorization

features in Java EE 6 release

Best practices in using the new security features 3

Page 4: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

SCOPE

Covered:

Web Profile

Authentication in Web Tier

Authorization

Transport Security

Not Covered:

EJB/WebServices Security

Message Security

Other security aspects (Cryptography etc)

Assumptions:

Familiarity with Servlet 3.0 annotations 4

Page 5: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

FORMAT

New Security Features Overview

Demos

Interactive

Q & A

Duration: 1 hour

5

Page 6: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

BEFORE WE START

How many use other security frameworks?

6

Page 7: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AGENDA

Application Security Model

Java EE 6 Security Enhancements

Web Module Security – Authentication

Authorization

Enforcing Transport Security

New Security Features in Java EE 7

Best Practices

Conclusions

7

Page 8: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AGENDA

Application Security Model

Java EE 6 Security Enhancements

Web Module Security – Authentication

Authorization

Enforcing Transport Security

New Security Features in Java EE 7

Best Practices

Conclusions

8

Page 9: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

SECURITY ARCHITECTURE GOALS

Portability

Transparency

Isolation

Extensibility

Flexibility

Abstraction

Independence

Compatibility Testing

Secure Interoperability

*Source: Java EE 6 Specification

9

Page 10: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

APPLICATION SECURITY MODEL

Authentication

Authorization (Access Control)

Data integrity

Confidentiality or Data Privacy

Non-repudiation

Auditing

*Source: Java EE 6 Specification

10

Page 11: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

SECURITY ARCHITECTURE FRAMEWORK

Security Architecture provides for:

Availability of systems and data through:

Identification

Authorization and access control

Integrity of data

Confidentiality of data and system information

Accountability, which includes:

Requirements that actions of an entity can be traced to that entity

Non-repudiation, deterrence, fault isolation, and intrusion

detection / prevention.

Audit

Assurance

*Source: NIST Special Publications 800-33 and 800-53

11

Page 12: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

APPLICATION SECURITY IN JAVA EE

Prior to Java EE 6:

Security in web tier was optional

Non-standard implementations

12

Page 13: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

APPLICATION SECURITY IN JAVA EE

Prior to Java EE 6:

Security in web tier was optional

Non-standard implementations

Java EE 6:

Common support for security-constraint processing

Integration of custom authentication mechanisms

Track authentication information at the servlet container

level

13

Page 14: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

JAVA EE 6 AT A GLANCE

Profiles

Pruning

More support for Annotations

14

Page 15: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

JAVA EE 6 TECHNOLOGIES

Java Platform, Enterprise Edition 6 (JSR 316)

Enterprise JavaBeans 3.1 (includes Interceptors 1.1) (JSR

318)

Java Servlet 3.0 (JSR 315)

JavaServer Faces 2.0 (JSR 314)

Contexts and Dependency Injection for Java (Web Beans

1.0) (JSR 299)

Dependency Injection for Java 1.0 (JSR 330)

Java API for RESTful Web Services (JAX-RS) 1.1 (JSR

311)15

Page 16: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

JAVA EE 6 TECHNOLOGIES (2)

Bean Validation 1.0 (JSR 303)

Java EE Connector Architecture 1.6 (JSR 322)

Java Persistence 2.0 (JSR 317)

Common Annotations for the Java Platform 1.1 (JSR 250)

Java Message Service API 1.1 (JSR 914)

16

Page 17: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

MANAGEMENT AND SECURITY

TECHNOLOGIES

Java Servlet 3.0 (JSR 315)*

Enterprise JavaBeans 3.1 (JSR 318)

Java Authentication Service Provider Interface for

Containers (JSR 196)

Java Authorization Contract for Containers 1.3 (JSR

115)

*Focus of this presentation

17

Page 18: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AGENDA

Application Security Model

Java EE 6 Security Enhancements

Web Module Security – Authentication

Authorization

Enforcing Transport Security

New Security Features in Java EE 7

Best Practices

Conclusions

18

Page 19: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

JAVA EE 6 WEB PROFILE

What is it?

Designed for modern web application development for

creating small- to medium-sized enterprise web

applications

Provides J2EE Services:

Transaction Processing

Security

Persistence

Easy to move to the Full Platform

19

Page 20: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

SECURITY ENHANCEMENTS IN JAVA EE 6

Web Tier (Servlet 3.0 specification)

Support for Authentication and Authorization in web tier

Programmatic Security

Declarative Security

EJB Tier

Web Services

Application Client Container (ACC)

20

Page 21: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

JAVA SECURITY PACKAGES

javax.annotation.security

javax.ejb

javax.servlet.annotation

javax.servlet.http

javax.ws.rs.core

javax.interceptor

21

Page 22: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AGENDA

Application Security Model

Java EE 6 Security Enhancements

Web Module Security – Authentication

Authorization

Enforcing Transport Security

New Security Features in Java EE 7

Best Practices

Conclusions

22

Page 23: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AUTHENTICATION - PROGRAMMATIC

SECURITY

When to use:

Need to control security programmatically

Declarative security alone is not sufficient

New methods in HttpServletRequest (Servlet 3.0)

authenticate

login

logout

Other methods to access security information about

the user

getRemoteUser

isUserInRole

getUserPrincipal

23

Page 24: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

DEMO SAMPLE APPLICATION DETAILS

Use Case:

Loan processing application

Different user roles for different business functions

Architecture:

Servlet 3.0

CDI, EJB 3.1

Technologies:

GlassFish Server v3.1

LDAP authentication (OpenDS Server)

Tools:

NetBeans 6.9 IDE

Maven

24

Page 25: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

USER ROLES

Role Function Permission

Borrower Loan Application RW

Loan Officer Loan Processing RW

Loan Officer Loan Underwriting R

Underwriter Loan Underwriting RW

Funding Processor Funding RW

Funding Processor Loan Underwriting R

25

Page 26: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

DEMO 1: PROGRAMMATIC SECURITY

Demo of authenticate() method

AuthenticationServlet

URL: http://localhost:8080/jeesecurityapp/auth

login() and logout() methods – code samples

LoginServlet

Security using Servlet Filter

Example: LoginFilter

26

Page 27: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

DECLARATIVE SECURITY

When to use:

Need to define security model external to application code

Annotation driven

New annotations for authentication & authorization

@ServletSecurity

@HttpConstraint , @HttpMethodConstraint

@WebFilter

@DeclareRoles

@RunAs

Transport Security:

ServletSecurity.EmptyRoleSemantic

ServletSecurity.TransportGuarantee

27

Page 28: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AGENDA

Application Security Model

Java EE 6 Security Enhancements

Web Module Security – Authentication

Authorization

Enforcing Transport Security

New Security Features in Java EE 7

Best Practices

Conclusions

28

Page 29: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AUTHORIZATION - DECLARING SECURITY

ROLES

role-name defined in web.xml deployment descriptor

<security-role>

<role-name>Underwriter</role-name>

</security-role>

29

Page 30: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

DECLARING SECURITY ROLES (2)

security-role-ref element of deployment descriptor

Example:

<servlet>

...

<security-role-ref>

<role-name>Underwriter</role-name>

<role-link>Underwriter</role-link>

</security-role-ref>

...

</servlet>

30

Page 31: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

ROLE BASED ACCESS ANNOTATION

@WebServlet(name="UnderwritingServlet",

urlPatterns={"/UnderwritingServlet"})

@ServletSecurity(@HttpConstraint(

rolesAllowed = { "Underwriter“, “” }))

public class UnderwritingServlet extends

HttpServlet {

31

Page 32: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

DEMO 2: AUTHORIZATION

“rolesAllowed” attribute of @HttpConstraint

attribute of @ServletSecurity annotation

Example: UnderwritingServlet

32

Page 33: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AGENDA

Application Security Model

Java EE 6 Security Enhancements

Web Module Security – Authentication

Authorization

Enforcing Transport Security

New Security Features in Java EE 7

Best Practices

Conclusions

33

Page 34: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

ENFORCING TRANSPORT SECURITY

Enforce use of SSL when user is accessing managed

resources

"user-data-constraint" and "transport-guarantee"

elements in web.xml

"transportGuarantee" attribute of @HttpConstraint

annotation

TransportGuarantee values:

NONE

INTEGRAL

CONFIDENTIAL34

Page 35: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

TRANSPORT SECURITY EXAMPLE – DEPLOYMENT

DESCRIPTOR

<security-constraint>

...

<user-data-constraint>

<transport-guarantee>

CONFIDENTIAL

</transport-guarantee>

</user-data-constraint>

...

</security-constraint>

35

Page 36: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

TRANSPORT SECURITY EXAMPLE - ANNOTATION

Code Example:

@ServletSecurity(

value=@HttpConstraint(

transportGuarantee=ServletSecurity.TransportGuar

antee.CONFIDENTIAL),

httpMethodConstraints={

@HttpMethodConstraint(value="GET",

transportGuarantee=ServletSecurity.TransportGu

arantee.CONFIDENTIAL, rolesAllowed = {

"Underwriter" })

}

36

Page 37: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AGENDA

Application Security Model

Java EE 6 Security Enhancements

Web Module Security – Authentication

Authorization

Enforcing Transport Security

New Security Features in Java EE 7

Best Practices

Conclusions

37

Page 38: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

FUTURE DIRECTION OF JAVA EE SECURITY

Auditing

Instance-based Access Control

User Registration

38

Page 39: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

APPLICATION SECURITY FEATURES WISH

LIST

Built-in “Remember Me” Feature

Self-Registration Use Case

Forgot User Id/Forgot Password

Multi-Factor Authentication

EL based authorization

API for managing the ACL's

39

Page 40: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AUDITING

Protect application resources from illegal use by

authorized users

GlassFish support for auditing

Fine-grained auditing

Example: CDI and Interceptor based solution

40

Page 41: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AUDITING - CODE SAMPLE

Using Custom Annotation

Annotation: SecurityAuditLog

Implementation: SecurityAuditLogInterceptor

Used by UnderwritingBean

41

Page 42: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AGENDA

Application Security Model

Java EE 6 Security Enhancements

Web Module Security – Authentication

Authorization

Enforcing Transport Security

New Security Features in Java EE 7

Best Practices

Conclusions

42

Page 43: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

SECURITY BEST PRACTICES

Separation of Security and Business Logic

Authentication Logic in Controller Layer

Authorization Logic in Service or Controller classes

Access decision model to be data driven than code driven

Access Control: Whitelisting v. Blacklisting

Auditing

Application Security in SOAP and REST Web Services

Use user data constraint with Basic or Form

authentication

43

Page 44: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

AGENDA

Application Security Model

Java EE 6 Security Enhancements

Web Module Security

Enforcing Transport Security

EJB Module Security

Securing Web Services

Other Security Features in Java EE

Best Practices

Conclusions44

Page 45: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

SUMMARY: SECURITY BY ARCHITECTURE LAYER

Domain Layer

Access Control Lists (ACLs)

Data Encryption / Method Interception

Service/Facade

Declarative (@RolesAllowed)

Programmatic

Controller

Declarative (@ServletSecurity, @RolesAllowed)

Programmatic (authenticate, login, logout)

Presentation

URL Pattern Access Control

Transport Layer

CONFIDENTIAL, INTEGRAL, NONE

45

Page 46: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

CONCLUSIONS

Web Profile in Java EE 6

Authentication and Authorization in Web Tier

Declarative and Programmatic Security

Transport Layer Security

Annotation Driven Security Implementation

46

Page 47: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

Q & A

47

Page 48: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

REFERENCES

JSR 316: Java EE 6.0 Specification

(http://www.jcp.org/en/jsr/detail?id=316)

JSR 315: Java Servlet 3.0 Specification

(http://jcp.org/en/jsr/detail?id=315)

JSR 318: Enterprise JavaBeans 3.1

(http://jcp.org/en/jsr/detail?id=318)

JSR 196: Java Authentication Service Provider Interface

for Containers (http://jcp.org/en/jsr/detail?id=196)

JSR 115: Java Authorization Contract for Containers

(http://jcp.org/en/jsr/detail?id=115)

JSR 250: Common Annotations for the Java Platform

(http://jcp.org/en/jsr/detail?id=250)

48

Page 49: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

REFERENCES (2)

Java EE 6 Tutorial, (http://docs.sun.com/app/docs/doc/820-

7627/gijrp?l=en&n=1&a=view)

Part VII - Security

Chapter 24, Introduction to Security in the Java EE Platform

Chapter 25, Getting Started Securing Web Applications

Chapter 26, Getting Started Securing Enterprise Applications

SecureJavaEE6App Tutorial - NetBeans Wiki

(http://wiki.netbeans.org/SecureJavaEE6App)

Java EE 6: Application Security Enhancements

(http://www.infoq.com/news/2010/07/javaee6-security)

GlassFish Security, Masoud Kalali, Packt Publishing

Getting Started with Java EE Security, DZone Refcardz

49

Page 50: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

REFERENCES - TOOLS

GlassFish Server

(https://glassfish.dev.java.net/downloads/v3-final.html)

OpenDS Server

(https://opends.dev.java.net/public/downloads_index.html)

NetBeans (http://netbeans.org/downloads/)

Maven (http://maven.apache.org)

50

Page 51: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

REFERENCES - FRAMEWORKS

Spring Security 3 (http://static.springsource.org/spring-

security/site/index.html)

JBoss PicketLink (http://jboss.org/picketlink)

Seam Security 3

(http://anonsvn.jboss.org/repos/seam/modules/security/tru

nk/)

51

Page 52: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

THANK YOU

Thank you for your attention

Session feedback

Contact Information:

Domain-Driven Design, Security and Enterprise

Architecture articles on InfoQ

website: http://www.infoq.com

[email protected]

@srinip

http://srinip2007.blogspot.com

52

Page 53: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

EXTRA SLIDES

53

Page 54: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

WEB PROFILE TECHNOLOGIES

JSR 315: Java Servlet 3.0

JSR 314: JavaServer Faces (JSF) 2.0

JSR 245: JavaServer Pages 2.2 and Expression Language

(EL) 1.2

JSR 52: A Standard Tag Library for JavaServer Pages 1.2

JSR-45: Debugging Support for Other Languages 1.0

JSR 299: Contexts and Dependency Injection for the Java EE

Platform 1.0

JSR 330: Dependency Injection for Java

JSR 318: Enterprise JavaBeans 3.1 (EJB Lite)

JSR 317: Java Persistence API 2.0

JSR 250: Common Annotations for the Java Platform 1.1

54

Page 55: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

EJB MODULE SECURITY

Declarative

@DeclareRoles

@RunAs

@PermitAll

@DenyAll

@RolesAllowed

Programmatic

EJBContext

isCallerInRole()

getCallerPrincipal()

55

Page 56: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

WEB SERVICES SECURITY

SOAP Web Services

SAML

WS-Security

RESTful Web Services

JAX-RS Authentication

56

Page 57: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

WEB SERVICES SECURITY IN JEE6

Web Modules

Dispatch client API

Authenticator

EJB Modules

Stateless Session Bean

57

Page 58: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

WEB SERVICES SECURITY DEMO

REST Web Services Security Demo

Jersey JAX-RS Authentication

58

Page 59: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

APPLICATION CLIENT SECURITY

Application Client Container

Callback handler to collect user credentials

Example:

<callback-handler>

org.test.CustomCallBackHandler

</callback-handler>

59

Page 60: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

CONNECTOR ARCHITECTURE

Container managed sign-on

Component managed sign-on

Resource adapter security

60

Page 61: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

OTHER SECURITY FEATURES

Java Authentication SPI

JACC

61

Page 62: APPLICATION SECURITY E J EE 6 -   · PDF fileAPPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6 SRINI PENCHIKALA Austin Java User Group Meeting October 26, 2010

OTHER SECURITY FRAMEWORKS

Spring Security 3

JBoss PicketLink

Seam Security

62