SlideShare a Scribd company logo
ADDRESSING TOMORROW'S SECURITY
REQUIREMENTS IN ENTERPRISE APPLICATIONS

Ben Alex, Principal Software Engineer
TS-6348

                                        Speaker’s logo here
                                            (optional)
Learn what's coming in enterprise application
security, and how to achieve it easily today.




                                  2008 JavaOneSM Conference | java.com.sun/javaone |   2
Agenda

 A Quick Landscape Review
 Simple Web Application Security
 Beyond Simple Web Application Security
 Adding Method Authorization
 Enterprise Connectivity
 AJAX Clients and Web 2.0
 Final Thoughts




                                          2008 JavaOneSM Conference | java.com.sun/javaone |   3
Approaching AAAA
 Security considerations revolve around AAAA
  • Authentication: who are they?
  • Authorization: what can they do?
  • Accounting: what resources did they consume in doing it?
  • Auditing: what exactly did they do?

 Java™ Servlets and JAAS

 Third party products

 Build your own



                                                 2008 JavaOneSM Conference | java.com.sun/javaone |   4
Java™ Servlet Security
 Solid foundation provided by the Servlet API

 HttpServletRequest methods
  • boolean isUserInRole(String role)
  • String getRemoteUser()
  • Principal getUserPrincipal()

 Configured in web.xml
  • <security-constraint>
  • <login-config>
  • <security-role>

 Self registration requirements being considered in JSR 315

                                          2008 JavaOneSM Conference | java.com.sun/javaone |   5
JAAS
 Java Authentication and Authorization Service (JAAS)
 Optional in Java™ 1.3, and included in SDK from Java™ 1.4

 LoginContext
 CallbackHandler
 LoginModule
 Subject
 Principal

 Configured in policy files
 Many Java™ servers use JAAS


                                           2008 JavaOneSM Conference | java.com.sun/javaone |   6
Agenda

 A Quick Landscape Review
 Simple Web Application Security
 Beyond Simple Web Application Security
 Adding Method Authorization
 Enterprise Connectivity
 AJAX Clients and Web 2.0
 Final Thoughts




                                          2008 JavaOneSM Conference | java.com.sun/javaone |   7
What Are “Simple Requirements”?
 Login form
 Authentication against common backends
 Web URL authorization
 Determining who is logged in
 Programmatic authorization
 Logout mechanism
 Externalization of deployment configuration
 Transport-level protection
 Maintaining authentication scope during a session




                                         2008 JavaOneSM Conference | java.com.sun/javaone |   8
Demonstration Software
 My demos today will use Spring Security 2
 • Open source project from SpringSource, the company behind Spring
 • Formerly known as “Acegi Security”, and publicly available since 2003

 Builds upon the Java™ platform
  • Integrates with Java™ Servlet Security container authentication
  • Integrates with JAAS login modules
  • External porting efforts underway to .Net, Python and other platforms

 Spring Security supports all technologies discussed today

 Widely used in global banking, defense, government etc


                                                 2008 JavaOneSM Conference | java.com.sun/javaone |   9
Implementing Simple Requirements
(in 10 minutes or less)




                          2008 JavaOneSM Conference | java.com.sun/javaone |   10
Agenda

 A Quick Landscape Review
 Simple Web Application Security
 Beyond Simple Web Application Security
 Adding Method Authorization
 Enterprise Connectivity
 AJAX Clients and Web 2.0
 Final Thoughts




                                          2008 JavaOneSM Conference | java.com.sun/javaone |   11
Component, State and Transition Security
 We're moving towards component-based web frameworks
 • For example, Java™ Server Faces
 • Reducing development time, and increasing modularity

 Spring Web Flow provides a JSF model and authorization of
  • States
  • Flows
  • Transitions

 Spring Web Flow unifies JSF and Spring Security




                                          2008 JavaOneSM Conference | java.com.sun/javaone |   12
CAPTCHA Overview
 Completely Automated Public Test to tell Computers and
 Humans Apart

 Useful for mitigating denial of service and IP infringement

 Popular Java™ solutions include JCaptcha and reCAPTCHA

 Consider accessibility issues
  • http://tinyurl.com/3ypzck (Matt May, “Escape from Captcha”, 2004)

 Captchas are often machine decipherable
  • http://www.cs.sfu.ca/~mori/research/gimpy/

                                               2008 JavaOneSM Conference | java.com.sun/javaone |   13
Single Sign On and Federated Identity
 NTLM for Microsoft® Windows® intranet apps
  • Works with Mozilla® Firefox® and Microsoft® Internet Explorer®
  • Implement using Samba JCIFS

 JA-SIG Central Authentication Service (CAS) for intranet apps
  • Java™ (for both client and server, plus full Spring Security support)
  • Other clients include .Net, PHP, Perl, Apache etc

 OpenID for Internet apps
  • Sun®, IBM®, Microsoft®, Google®, Yahoo®, AOL®, Yahoo®, Blogger™
  • Implement using OpenID4Java



                                                   2008 JavaOneSM Conference | java.com.sun/javaone |   14
Agenda

 A Quick Landscape Review
 Simple Web Application Security
 Beyond Simple Web Application Security
 Adding Method Authorization
 Enterprise Connectivity
 AJAX Clients and Web 2.0
 Final Thoughts




                                          2008 JavaOneSM Conference | java.com.sun/javaone |   15
Protecting Methods
 Strongly recommended in preference to web authorization
  • Can still be used concurrently with web URL authorization

 Before a method invocation
  • Is the user authorized in view of the signature and arguments?

 After a method invocation
  • Was the user authorized in view of the returned object?
  • Should the returned object be modified in some manner?

 Typically used on the services or domain layer
  • Thus all client layers are secured (web, rich client, JMS etc)
  • Of course, proper encapsulation and layering should remain a priority

                                                  2008 JavaOneSM Conference | java.com.sun/javaone |   16
JSR 250 Method Security Metadata
 JSR 250: “Common Annotations for the Java™ Platform™”

 Annotate classes
  • @RunAs(“someRole”)
  • @RolesAllowed(“someRole”)
  • @PermitAll()
  • @DenyAll()
  • @DeclareRoles(“someRole”)

 Annotation interaction defined in JSR 250, Section 2.11

 Spring Security supports JSR-250, plus @Secured, <protect-
 pointcut>, <protect-method> and custom strategies

                                          2008 JavaOneSM Conference | java.com.sun/javaone |   17
Domain Access Control
 Domain access control considers
  • Who the user is
  • Which method they are invoking on which Java™ type
  • Which domain object instance they are invoking the method on

 Major considerations
 • Performance and normalization level of the ACL database
 • Appropriate tier to perform filtering (eg database-side or Java™)
 • Potential propagation of user identity from Java™ to database




                                                   2008 JavaOneSM Conference | java.com.sun/javaone |   18
Method Authorization




                       2008 JavaOneSM Conference | java.com.sun/javaone |   19
Agenda

 A Quick Landscape Review
 Simple Web Application Security
 Beyond Simple Web Application Security
 Adding Method Authorization
 Enterprise Connectivity
 AJAX Clients and Web 2.0
 Final Thoughts




                                          2008 JavaOneSM Conference | java.com.sun/javaone |   20
Basic Authentication
 Great for RESTful paradigms and remote clients

 RFC 1945, Section 11.1

 Stateless HTTP header based
  • Header name: “Authorization”
  • Header value: “Basic” + “ “ + Base64(username + “:” + password)
  • Some SSO solutions permit session tokens to be presented over Basic

 Recommended, but only if used with HTTPS
  • Consider Digest authentication if only HTTP is available
  • See RFC 2617 Section 4 for a comparison of Basic and Digest
  • Be aware of cross-site request forgery risks

                                                  2008 JavaOneSM Conference | java.com.sun/javaone |   21
WSS (formerly WS-Security) and REST POX
 WSS provides key security functionality for SOAP

 Use XWSS for Java™ WSS
  • Visit https://xwss.dev.java.net/
  • XWSS version 2.0 implements OASIS WSS Specification 1.0
  • XWSS version 3.0 implements OASIS WSS Specification 1.1
  • Part of Project Metro (https://metro.dev.java.net/) and Glassfish™

 Spring Web Services integrates XWSS and Spring Security

 Securing Plain Old XML using the RESTful paradigm
  • Option 1: Use HTTP Basic authentication
  • Option 2: Use XPath to extract username/password from XML payload

                                                  2008 JavaOneSM Conference | java.com.sun/javaone |   22
Securing JMS and ESBs
 JMS 1.1 does not provide message integrity or privacy
  • Refer to JMS 1.1 Specification (JSR 914) Section 2.7
  • Implementations are expected to provide such features

 Destination authorization may be provided (eg ActiveMQ)
  • Read from destination; write to destination; admin destination

 ESBs may provide implementation-specific capabilities
  • Endpoint authorization; channel authorization; security translation

 Spring Integration addresses security in its Q2 2008 roadmap



                                                  2008 JavaOneSM Conference | java.com.sun/javaone |   23
Enterprise Connectivity




                          2008 JavaOneSM Conference | java.com.sun/javaone |   24
Agenda

 A Quick Landscape Review
 Simple Web Application Security
 Beyond Simple Web Application Security
 Adding Method Authorization
 Enterprise Connectivity
 AJAX Clients and Web 2.0
 Final Thoughts




                                          2008 JavaOneSM Conference | java.com.sun/javaone |   25
Securing GWT
 GWT offers no authentication-specific features
  • Option 1: ServiceDefTarget.setServiceEndPoint(...) with jsessionid
  • Option 2: Establish a token, then present it as a cookie and in RPC calls

 Key considerations
  • Session and/or token timeout issues
  • How to robustly logout
  • Cross-site request forgery
  • Transition of existing server-side authentication to GWT client

 Useful GWT security advice
  • http://tinyurl.com/3akc6y (GWT wiki) offers GWT security advice
  • http://tinyurl.com/2ynd26 (GWT incubator) includes Spring Security

                                                    2008 JavaOneSM Conference | java.com.sun/javaone |   26
AJAX Clients and Web 2.0




                           2008 JavaOneSM Conference | java.com.sun/javaone |   27
Agenda

 A Quick Landscape Review
 Simple Web Application Security
 Beyond Simple Web Application Security
 Adding Method Authorization
 Enterprise Connectivity
 Remote Clients and Web 2.0
 Final Thoughts




                                          2008 JavaOneSM Conference | java.com.sun/javaone |   28
Enterprise Application Security Tips
 Use a proven security framework; don't roll your own
 Start simply, and add complexity incrementally
 Consider user registration requirements
 Plan for federated identity, particularly involving OpenID
 For in-house applications, consider NTLM and CAS
 Employ Captcha techniques to mitigate DoS attacks
 Favor method authorization over web authorization
 Annotations-based authorization metadata is quick and easy
 Very carefully consider any domain object instance security
 Prefer Basic authentication for RESTful, HTTPS interactions
 Leverage WSS for transport-independent SOAP


                                         2008 JavaOneSM Conference | java.com.sun/javaone |   29
Ben Alex, Principal Software Engineer
TS-6348



                                                    Speaker’s logo here
                                                        (optional)




                                        2008 JavaOneSM Conference | java.com.sun/javaone |   30

More Related Content

PDF
Asec r01-resting-on-your-laurels-will-get-you-pwned
PDF
Data power v7 update - Ravi Katikala
PDF
InfoTRAMS - Czy platforma Microsoft Azure jest biznoseow bezpieczna?
ODP
Microservice Architecture JavaCro 2015
PPT
Why Security Teams should care about VMware
PPTX
Virtualization: Security and IT Audit Perspectives
PDF
What is tackled in the Java EE Security API (Java EE 8)
PDF
VMworld 2013: Introducing NSX Service Composer: The New Consumption Model for...
Asec r01-resting-on-your-laurels-will-get-you-pwned
Data power v7 update - Ravi Katikala
InfoTRAMS - Czy platforma Microsoft Azure jest biznoseow bezpieczna?
Microservice Architecture JavaCro 2015
Why Security Teams should care about VMware
Virtualization: Security and IT Audit Perspectives
What is tackled in the Java EE Security API (Java EE 8)
VMworld 2013: Introducing NSX Service Composer: The New Consumption Model for...

What's hot (20)

PPTX
Java ee 8 + security overview
PDF
VMworld 2013: Security Automation Workflows with NSX
PPT
Case Study: University of California, Berkeley and San Francisco
PDF
Community and Java EE @ DevConf.CZ
PDF
Barracuda web application_firewall_wp_advantage
PDF
WSO2 Charon
PDF
JavaCro'15 - Oracle Java Cloud Service Java PaaS - Duško Vukmanović
PDF
Security in practice with Java EE 6 and GlassFish
PDF
How to avoid top 10 security risks in Java EE applications and how to avoid them
PPTX
Windows Azure Security Features And Functionality
PDF
[OWASP Poland Day] Web App Security Architectures
PPT
The Top 10 Things Oracle UCM Users Need To Know About WebLogic
PPT
Java Security
PPTX
vCenter Orchestrator APIs
PPTX
Java Security Framework's
PDF
VMworld 2013: Enhancing Workplace Mobility and BYOD with the VMware Mobile Se...
PPTX
Scim overview
PDF
VMworld 2013: VMware Compliance Reference Architecture Framework Overview
PPTX
Master IAM in the Cloud with SCIM v2.0
PPTX
Radware - WAF (Web Application Firewall)
Java ee 8 + security overview
VMworld 2013: Security Automation Workflows with NSX
Case Study: University of California, Berkeley and San Francisco
Community and Java EE @ DevConf.CZ
Barracuda web application_firewall_wp_advantage
WSO2 Charon
JavaCro'15 - Oracle Java Cloud Service Java PaaS - Duško Vukmanović
Security in practice with Java EE 6 and GlassFish
How to avoid top 10 security risks in Java EE applications and how to avoid them
Windows Azure Security Features And Functionality
[OWASP Poland Day] Web App Security Architectures
The Top 10 Things Oracle UCM Users Need To Know About WebLogic
Java Security
vCenter Orchestrator APIs
Java Security Framework's
VMworld 2013: Enhancing Workplace Mobility and BYOD with the VMware Mobile Se...
Scim overview
VMworld 2013: VMware Compliance Reference Architecture Framework Overview
Master IAM in the Cloud with SCIM v2.0
Radware - WAF (Web Application Firewall)
Ad

Viewers also liked (19)

PDF
Coordenação de Informática - 2011
PDF
Aula 01 - POO - Bem Vindo a Objetolândia!
PPTX
Tratamento de exceções com PHP
PDF
Aula 02 POO - Meu Primeiro Código
PPT
Ferramentas Case E Oo
PDF
Aula 03 - POO - Um pouco mais sobre variáveis
PDF
Aula 04 - POO - Estruturas de Controle e Repetição
PPTX
Banco de dadados MySQL com PHP
PDF
PHP 5.3 - Classes e Objetos
PDF
Design Patterns com PHP
PDF
Programação Orientada a Objetos (POO) com PHP - Parte 1
PDF
Programação Orientada a Objetos (POO) com PHP - Parte 2
PDF
Aplicando SOLID com PHP7
PDF
Concurso de Pitch - EDIFPI
PPTX
Hackeando sua aplicaçao php na pratica
PPTX
Curso Desenvolvimento WEB com PHP - PHP (parte 1)
PPT
Desenvolvimento web: PHP orientado a objetos
PDF
Uma Abordagem Prática de Orientação a Objetos com PHP (FLISOL DF 2011)
PPS
CURSO DE PHP PARA INICIANTES - AULA 1
Coordenação de Informática - 2011
Aula 01 - POO - Bem Vindo a Objetolândia!
Tratamento de exceções com PHP
Aula 02 POO - Meu Primeiro Código
Ferramentas Case E Oo
Aula 03 - POO - Um pouco mais sobre variáveis
Aula 04 - POO - Estruturas de Controle e Repetição
Banco de dadados MySQL com PHP
PHP 5.3 - Classes e Objetos
Design Patterns com PHP
Programação Orientada a Objetos (POO) com PHP - Parte 1
Programação Orientada a Objetos (POO) com PHP - Parte 2
Aplicando SOLID com PHP7
Concurso de Pitch - EDIFPI
Hackeando sua aplicaçao php na pratica
Curso Desenvolvimento WEB com PHP - PHP (parte 1)
Desenvolvimento web: PHP orientado a objetos
Uma Abordagem Prática de Orientação a Objetos com PHP (FLISOL DF 2011)
CURSO DE PHP PARA INICIANTES - AULA 1
Ad

Similar to ADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONS (20)

PDF
TS-5358
PDF
TS-5358
PDF
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-On
PPTX
Web security
PDF
OWASP Top 10 2007 for JavaEE
PDF
Implementing Microservices Security Patterns & Protocols with Spring
KEY
RESTful Security
PDF
The Thing That Should Not Be
PDF
Openstack identity protocols unconference
PPT
J2 Ee Vs. .Net Workshop
PPT
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-on
PDF
Anil saldhana securityassurancewithj_bosseap
PDF
O Dell Secure360 Presentation5 12 10b
PPT
Session 8 Tp8
PDF
Geneva Application Security Forum: Vers une authentification plus forte dans ...
PDF
2010 - Fédération des identités et OpenID
PPTX
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
PDF
Anil saldhana cloudidentitybestpractices
PDF
Attacking XML Security
TS-5358
TS-5358
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-On
Web security
OWASP Top 10 2007 for JavaEE
Implementing Microservices Security Patterns & Protocols with Spring
RESTful Security
The Thing That Should Not Be
Openstack identity protocols unconference
J2 Ee Vs. .Net Workshop
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-on
Anil saldhana securityassurancewithj_bosseap
O Dell Secure360 Presentation5 12 10b
Session 8 Tp8
Geneva Application Security Forum: Vers une authentification plus forte dans ...
2010 - Fédération des identités et OpenID
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
Anil saldhana cloudidentitybestpractices
Attacking XML Security

More from elliando dias (20)

PDF
Clojurescript slides
PDF
Why you should be excited about ClojureScript
PDF
Functional Programming with Immutable Data Structures
PPT
Nomenclatura e peças de container
PDF
Geometria Projetiva
PDF
Polyglot and Poly-paradigm Programming for Better Agility
PDF
Javascript Libraries
PDF
How to Make an Eight Bit Computer and Save the World!
PDF
Ragel talk
PDF
A Practical Guide to Connecting Hardware to the Web
PDF
Introdução ao Arduino
PDF
Minicurso arduino
PDF
Incanter Data Sorcery
PDF
PDF
Fab.in.a.box - Fab Academy: Machine Design
PDF
The Digital Revolution: Machines that makes
PDF
Hadoop + Clojure
PDF
Hadoop - Simple. Scalable.
PDF
Hadoop and Hive Development at Facebook
PDF
Multi-core Parallelization in Clojure - a Case Study
Clojurescript slides
Why you should be excited about ClojureScript
Functional Programming with Immutable Data Structures
Nomenclatura e peças de container
Geometria Projetiva
Polyglot and Poly-paradigm Programming for Better Agility
Javascript Libraries
How to Make an Eight Bit Computer and Save the World!
Ragel talk
A Practical Guide to Connecting Hardware to the Web
Introdução ao Arduino
Minicurso arduino
Incanter Data Sorcery
Fab.in.a.box - Fab Academy: Machine Design
The Digital Revolution: Machines that makes
Hadoop + Clojure
Hadoop - Simple. Scalable.
Hadoop and Hive Development at Facebook
Multi-core Parallelization in Clojure - a Case Study

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Cloud computing and distributed systems.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Big Data Technologies - Introduction.pptx
PDF
KodekX | Application Modernization Development
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Machine learning based COVID-19 study performance prediction
PPT
Teaching material agriculture food technology
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Cloud computing and distributed systems.
MIND Revenue Release Quarter 2 2025 Press Release
Advanced methodologies resolving dimensionality complications for autism neur...
Big Data Technologies - Introduction.pptx
KodekX | Application Modernization Development
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Machine learning based COVID-19 study performance prediction
Teaching material agriculture food technology
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Electronic commerce courselecture one. Pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
Approach and Philosophy of On baking technology

ADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONS

  • 1. ADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONS Ben Alex, Principal Software Engineer TS-6348 Speaker’s logo here (optional)
  • 2. Learn what's coming in enterprise application security, and how to achieve it easily today. 2008 JavaOneSM Conference | java.com.sun/javaone | 2
  • 3. Agenda A Quick Landscape Review Simple Web Application Security Beyond Simple Web Application Security Adding Method Authorization Enterprise Connectivity AJAX Clients and Web 2.0 Final Thoughts 2008 JavaOneSM Conference | java.com.sun/javaone | 3
  • 4. Approaching AAAA Security considerations revolve around AAAA • Authentication: who are they? • Authorization: what can they do? • Accounting: what resources did they consume in doing it? • Auditing: what exactly did they do? Java™ Servlets and JAAS Third party products Build your own 2008 JavaOneSM Conference | java.com.sun/javaone | 4
  • 5. Java™ Servlet Security Solid foundation provided by the Servlet API HttpServletRequest methods • boolean isUserInRole(String role) • String getRemoteUser() • Principal getUserPrincipal() Configured in web.xml • <security-constraint> • <login-config> • <security-role> Self registration requirements being considered in JSR 315 2008 JavaOneSM Conference | java.com.sun/javaone | 5
  • 6. JAAS Java Authentication and Authorization Service (JAAS) Optional in Java™ 1.3, and included in SDK from Java™ 1.4 LoginContext CallbackHandler LoginModule Subject Principal Configured in policy files Many Java™ servers use JAAS 2008 JavaOneSM Conference | java.com.sun/javaone | 6
  • 7. Agenda A Quick Landscape Review Simple Web Application Security Beyond Simple Web Application Security Adding Method Authorization Enterprise Connectivity AJAX Clients and Web 2.0 Final Thoughts 2008 JavaOneSM Conference | java.com.sun/javaone | 7
  • 8. What Are “Simple Requirements”? Login form Authentication against common backends Web URL authorization Determining who is logged in Programmatic authorization Logout mechanism Externalization of deployment configuration Transport-level protection Maintaining authentication scope during a session 2008 JavaOneSM Conference | java.com.sun/javaone | 8
  • 9. Demonstration Software My demos today will use Spring Security 2 • Open source project from SpringSource, the company behind Spring • Formerly known as “Acegi Security”, and publicly available since 2003 Builds upon the Java™ platform • Integrates with Java™ Servlet Security container authentication • Integrates with JAAS login modules • External porting efforts underway to .Net, Python and other platforms Spring Security supports all technologies discussed today Widely used in global banking, defense, government etc 2008 JavaOneSM Conference | java.com.sun/javaone | 9
  • 10. Implementing Simple Requirements (in 10 minutes or less) 2008 JavaOneSM Conference | java.com.sun/javaone | 10
  • 11. Agenda A Quick Landscape Review Simple Web Application Security Beyond Simple Web Application Security Adding Method Authorization Enterprise Connectivity AJAX Clients and Web 2.0 Final Thoughts 2008 JavaOneSM Conference | java.com.sun/javaone | 11
  • 12. Component, State and Transition Security We're moving towards component-based web frameworks • For example, Java™ Server Faces • Reducing development time, and increasing modularity Spring Web Flow provides a JSF model and authorization of • States • Flows • Transitions Spring Web Flow unifies JSF and Spring Security 2008 JavaOneSM Conference | java.com.sun/javaone | 12
  • 13. CAPTCHA Overview Completely Automated Public Test to tell Computers and Humans Apart Useful for mitigating denial of service and IP infringement Popular Java™ solutions include JCaptcha and reCAPTCHA Consider accessibility issues • http://tinyurl.com/3ypzck (Matt May, “Escape from Captcha”, 2004) Captchas are often machine decipherable • http://www.cs.sfu.ca/~mori/research/gimpy/ 2008 JavaOneSM Conference | java.com.sun/javaone | 13
  • 14. Single Sign On and Federated Identity NTLM for Microsoft® Windows® intranet apps • Works with Mozilla® Firefox® and Microsoft® Internet Explorer® • Implement using Samba JCIFS JA-SIG Central Authentication Service (CAS) for intranet apps • Java™ (for both client and server, plus full Spring Security support) • Other clients include .Net, PHP, Perl, Apache etc OpenID for Internet apps • Sun®, IBM®, Microsoft®, Google®, Yahoo®, AOL®, Yahoo®, Blogger™ • Implement using OpenID4Java 2008 JavaOneSM Conference | java.com.sun/javaone | 14
  • 15. Agenda A Quick Landscape Review Simple Web Application Security Beyond Simple Web Application Security Adding Method Authorization Enterprise Connectivity AJAX Clients and Web 2.0 Final Thoughts 2008 JavaOneSM Conference | java.com.sun/javaone | 15
  • 16. Protecting Methods Strongly recommended in preference to web authorization • Can still be used concurrently with web URL authorization Before a method invocation • Is the user authorized in view of the signature and arguments? After a method invocation • Was the user authorized in view of the returned object? • Should the returned object be modified in some manner? Typically used on the services or domain layer • Thus all client layers are secured (web, rich client, JMS etc) • Of course, proper encapsulation and layering should remain a priority 2008 JavaOneSM Conference | java.com.sun/javaone | 16
  • 17. JSR 250 Method Security Metadata JSR 250: “Common Annotations for the Java™ Platform™” Annotate classes • @RunAs(“someRole”) • @RolesAllowed(“someRole”) • @PermitAll() • @DenyAll() • @DeclareRoles(“someRole”) Annotation interaction defined in JSR 250, Section 2.11 Spring Security supports JSR-250, plus @Secured, <protect- pointcut>, <protect-method> and custom strategies 2008 JavaOneSM Conference | java.com.sun/javaone | 17
  • 18. Domain Access Control Domain access control considers • Who the user is • Which method they are invoking on which Java™ type • Which domain object instance they are invoking the method on Major considerations • Performance and normalization level of the ACL database • Appropriate tier to perform filtering (eg database-side or Java™) • Potential propagation of user identity from Java™ to database 2008 JavaOneSM Conference | java.com.sun/javaone | 18
  • 19. Method Authorization 2008 JavaOneSM Conference | java.com.sun/javaone | 19
  • 20. Agenda A Quick Landscape Review Simple Web Application Security Beyond Simple Web Application Security Adding Method Authorization Enterprise Connectivity AJAX Clients and Web 2.0 Final Thoughts 2008 JavaOneSM Conference | java.com.sun/javaone | 20
  • 21. Basic Authentication Great for RESTful paradigms and remote clients RFC 1945, Section 11.1 Stateless HTTP header based • Header name: “Authorization” • Header value: “Basic” + “ “ + Base64(username + “:” + password) • Some SSO solutions permit session tokens to be presented over Basic Recommended, but only if used with HTTPS • Consider Digest authentication if only HTTP is available • See RFC 2617 Section 4 for a comparison of Basic and Digest • Be aware of cross-site request forgery risks 2008 JavaOneSM Conference | java.com.sun/javaone | 21
  • 22. WSS (formerly WS-Security) and REST POX WSS provides key security functionality for SOAP Use XWSS for Java™ WSS • Visit https://xwss.dev.java.net/ • XWSS version 2.0 implements OASIS WSS Specification 1.0 • XWSS version 3.0 implements OASIS WSS Specification 1.1 • Part of Project Metro (https://metro.dev.java.net/) and Glassfish™ Spring Web Services integrates XWSS and Spring Security Securing Plain Old XML using the RESTful paradigm • Option 1: Use HTTP Basic authentication • Option 2: Use XPath to extract username/password from XML payload 2008 JavaOneSM Conference | java.com.sun/javaone | 22
  • 23. Securing JMS and ESBs JMS 1.1 does not provide message integrity or privacy • Refer to JMS 1.1 Specification (JSR 914) Section 2.7 • Implementations are expected to provide such features Destination authorization may be provided (eg ActiveMQ) • Read from destination; write to destination; admin destination ESBs may provide implementation-specific capabilities • Endpoint authorization; channel authorization; security translation Spring Integration addresses security in its Q2 2008 roadmap 2008 JavaOneSM Conference | java.com.sun/javaone | 23
  • 24. Enterprise Connectivity 2008 JavaOneSM Conference | java.com.sun/javaone | 24
  • 25. Agenda A Quick Landscape Review Simple Web Application Security Beyond Simple Web Application Security Adding Method Authorization Enterprise Connectivity AJAX Clients and Web 2.0 Final Thoughts 2008 JavaOneSM Conference | java.com.sun/javaone | 25
  • 26. Securing GWT GWT offers no authentication-specific features • Option 1: ServiceDefTarget.setServiceEndPoint(...) with jsessionid • Option 2: Establish a token, then present it as a cookie and in RPC calls Key considerations • Session and/or token timeout issues • How to robustly logout • Cross-site request forgery • Transition of existing server-side authentication to GWT client Useful GWT security advice • http://tinyurl.com/3akc6y (GWT wiki) offers GWT security advice • http://tinyurl.com/2ynd26 (GWT incubator) includes Spring Security 2008 JavaOneSM Conference | java.com.sun/javaone | 26
  • 27. AJAX Clients and Web 2.0 2008 JavaOneSM Conference | java.com.sun/javaone | 27
  • 28. Agenda A Quick Landscape Review Simple Web Application Security Beyond Simple Web Application Security Adding Method Authorization Enterprise Connectivity Remote Clients and Web 2.0 Final Thoughts 2008 JavaOneSM Conference | java.com.sun/javaone | 28
  • 29. Enterprise Application Security Tips Use a proven security framework; don't roll your own Start simply, and add complexity incrementally Consider user registration requirements Plan for federated identity, particularly involving OpenID For in-house applications, consider NTLM and CAS Employ Captcha techniques to mitigate DoS attacks Favor method authorization over web authorization Annotations-based authorization metadata is quick and easy Very carefully consider any domain object instance security Prefer Basic authentication for RESTful, HTTPS interactions Leverage WSS for transport-independent SOAP 2008 JavaOneSM Conference | java.com.sun/javaone | 29
  • 30. Ben Alex, Principal Software Engineer TS-6348 Speaker’s logo here (optional) 2008 JavaOneSM Conference | java.com.sun/javaone | 30