SlideShare una empresa de Scribd logo
1 de 80
Descargar para leer sin conexión
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.1
Finally,
EE Security API JSR 375
Alex Kosowski
JSR 375 Specification Lead
WebLogic Server Security
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.3
Safe Harbor Statement
The following is intended to outline our general product direction. It is
intended for information purposes only, and may not be incorporated into
any contract. It is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making purchasing
decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole
discretion of Oracle.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.4
Agenda
§  Motivations
§  A New JSR
§  Ideas
§  Get Involved
§  Q & A
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.5
Agenda
§  Motivations
§  A New JSR
§  Ideas
§  Get Involved
§  Q & A
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.6
Why a Java EE Security API JSR?
§  EE 8 survey results
§  4500 total responses
§  Priorities Pie Chart
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.7
What’s wrong with Java EE Security?
"The ultimate goal is to have basic security working without the need of
any kind of vendor specific configuration, deployment descriptors, or
whatever. ” – Arjan Tijms
“[The EE security] model is problematic in cloud/PaaS environments
where developers do not necessarily have easy access to non-standard
vendor runtime features and a self-contained application is much easier
to manage.” – Reza Rahman
The community says…
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.8
What’s wrong with Java EE Security?
§  Java EE Security viewed as not portable, abstract/confusing,
antiquated
§  Doesn’t fit cloud app developer paradigm: requires app server
configuration
§  Losing value to non-standard 3rd Party Frameworks…less likely to
move back to Java EE when requirements increase
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.9
What to do?
§  Plug the portability holes
§  Modernize
–  Context Dependency Injection (CDI)
§  Intercept at Access Enforcement Points: POJO methods
–  Expression Language (EL)
§  Enable Access Enforcement Points with complex rules
§  App Developer Friendly
–  Common security configurations not requiring server changes
–  Annotation defaults not requiring XML
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.10
Agenda
§  Motivations
§  A New JSR
§  Ideas
§  Get Involved
§  Q & A
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.11
JSR 375 History
§  August 2014: First proposed to Oracle Java EE Architects
§  December 2014: Approved by JCP
§  Expert Group nominations:
–  EE API veterans: many JSRs, many years struggling with Security API
–  3rd party security framework creators/developers
–  EE platform security implementers
§  March 2015: Expert Group started discussions
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.12
JSR 375 – Expert Group
Name Representing
Adam Bien Individual
David Blevins Tomitribe
Rudy De Busscher Individual
Ivar Grimstad Individual
Les Hazlewood Stormpath, Inc.
Will Hopkins Oracle
Werner Keil Individual
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.13
JSR 375 – Expert Group
Name Representing
Matt Konda Jemurai
Alex Kosowski Oracle
Darran Lofthouse RedHat
Jean-Louis Monteiro Tomitribe
Ajay Reddy IBM
Pedro Igor Silva RedHat
Arjan Tijms ZEEF
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.14
JSR 375 History
§  In first month, expert group had an EXPLOSION of activity
–  Lot of Brainstorming!
–  237 messages on EG mailing list
–  81 commits in Github playgrounds for examples and proposals
–  24 JIRA issues
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.15
Agenda
§  Motivations
§  A New JSR
§  Ideas
§  Get Involved
§  Q & A
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.16
Ideas
§  Terminology
§  API for Authentication Mechanism
§  API for Identity Store
§  API for Password Aliasing
§  API for Role/Permission Assignment
§  API for Security Context
§  API for Authorization Interceptors
To modernize, standardize, simplify
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.17
Ideas
To modernize, standardize, simplify
Identity Store
Authentication
Mechanism
Security Context
Authorization
Interceptors
Role/Permission
Assignment
Password Aliasing
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.18
Ideas
§  Terminology
§  API for Authentication Mechanism
§  API for Identity Store
§  API for Password Aliasing
§  API for Role/Permission Assignment
§  API for Security Context
§  API for Authorization Interceptors
To modernize, standardize, simplify
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.19
Ideas - Terminology
§  EG discussions revealed inconsistency in security API terms
§  Different EE containers have different names for the same concepts
§  When “something” gets authenticated, is that something a…
–  A User? (e.g. HttpServletRequest.getUserPrincipal)
–  A Caller? (e.g. EJBContext.getCallerPrincipal)
§  What is a group?
–  A group of users?
–  A permission
–  Vs Role?
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.20
Ideas - Terminology
§  What is that “something” where identities are stored?
–  security provider (WebLogic)
–  realm (Tomcat, some hints in Servlet spec)
–  (auth) repository
–  (auth) store
–  login module (JAAS)
–  identity manager (Undertow)
–  authenticator (Resin, OmniSecurity, Seam Security)
–  authentication provider (Spring Security)
–  identity provider
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.21
Ideas
§  Terminology
§  API for Authentication Mechanism
§  API for Identity Store
§  API for Password Aliasing
§  API for Role/Permission Assignment
§  API for Security Context
§  API for Authorization Interceptors
To modernize, standardize, simplify
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.22
Use Case
§  Application manages its own users and groups
§  Application needs to authenticate users in order to assign Roles
§  Application authenticates based on application-domain models
§  Application needs to use an authentication method not supported on
the server, like OpenID Connect
§  Developer wants to use portable EE Authentication standard
API for Authentication Mechanism
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.23
Current Solutions
§  Proprietary server support
§  3rd party security frameworks provide authentication
§  JASPIC: Java Authentication Service Provider Interface for Containers
API for Authentication Mechanism
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.24
JASPIC
§  Java Authentication Service Provider Interface for Containers
§  JSR 196, Maintenance Release 1.1, in 2013
§  Standardized, portable, thin, low-level authentication framework
§  Extensible from within an application
§  Integrates with the container to build an authenticated Subject
§  Implement any authentication method
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.25
JASPIC Server Auth Module
public interface ServerAuthModule {
public void initialize(MessagePolicy requestPolicy,
MessagePolicy responsePolicy, CallbackHandler handler,
Map options) throws AuthException;
public AuthStatus validateRequest(MessageInfo messageInfo,
Subject clientSubject, Subject serviceSubject);
public Class<?>[] getSupportedMessageTypes();
public AuthStatus secureResponse(MessageInfo messageInfo,
Subject serviceSubject);
public void cleanSubject(MessageInfo messageInfo, Subject subject);
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.26
JASPIC Per-Application Installation
ServletContextListener
AuthConfigFactory
AuthConfigProvider
ServerAuthConfig
ServerAuthContext
ServerAuthModule
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.27
Ideas – Simple ServerAuthModule Installation
ServletContextListener
AuthConfigFactory
AuthConfigProvider
ServerAuthConfig
ServerAuthContext
ServerAuthModule
ServletContextListener
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.28
Ideas – Simple ServerAuthModule Installation
@WebListener
public class SamRegistrationListener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
Jaspic.registerServerAuthModule(new TokenAuthModule(),
sce.getServletContext());
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
}
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.29
Ideas – Simple ServerAuthModule Installation
@Authenticator("org.acme.TokenAuthModule")
@WebServlet("/SimpleServlet")
@ServletSecurity(@HttpConstraint(rolesAllowed = {"manager"}))
public class SimpleServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.getWriter().print("my GET");
}
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.30
Ideas – Profile Specific Helper Classes
public class BasicServerAuthModule implements ServerAuthModule {
public void initialize(…) throws AuthException { … }
public Class<?>[] getSupportedMessageTypes() { … }
public AuthStatus secureResponse(MessageInfo messageInfo,
Subject serviceSubject) throws AuthException { … }
public void cleanSubject(MessageInfo messageInfo, Subject subject)
throws AuthException { … }
public AuthStatus validateRequest(MessageInfo messageInfo,
Subject clientSubject, Subject serviceSubject) throws AuthException {
final HttpServletRequest request =
(HttpServletRequest) messageInfo.getRequestMessage();
… }
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.31
Ideas – Profile Specific Helper Classes
public class BasicServerAuthModule extends HttpServerAuthModule {
public AuthStatus validateHttpRequest(HttpServletRequest request,
HttpServletResponse response, HttpMessageContext httpMessageContext)
throws AuthException {
…
}
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.32
Ideas – Profile Specific Helper Classes
public class BasicServerAuthModule extends HttpServerAuthModule {
public AuthStatus validateHttpRequest(HttpServletRequest request,
HttpServletResponse response, HttpMessageContext httpMessageContext)
throws AuthException {
final String header = request.getHeader("Authorization");
final String[] credentials = parseCredentials(header);
final String username = credentials[0];
final String password = credentials[1];
if (!"snoopy".equals(username) || !"woodst0ck".equals(password)) {
return FAILURE;
} // No callbacks required!!!
return httpMessageContext.notifyContainerAboutLogin(
"snoopy",
// the groups/roles of the authenticated user
Arrays.asList("RedBaron", "JoeCool", "MansBestFriend"));
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.33
Ideas – Standardized Authenticators
@Authenticator("javax.security.authenticator.OpenIDConnect")
@WebServlet("/SimpleServlet")
@ServletSecurity(@HttpConstraint(rolesAllowed = {"manager"}))
public class SimpleServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.getWriter().print("my GET");
}
}
§  OpenID Connect ServerAuthModule
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.34
Ideas – Authentication Events
§  Throw standardized CDI events at important moments
–  PreAuthenticate Event
–  PostAuthenticate Event
–  PreLogout Event
–  PostLogout Event
§  Possible uses:
–  Tracking number of logged-in users
–  Tracking failed login attempts per account
–  Side effects, like creating a new local user after initial successful
authentication via a remote authentication provider
–  Loading application-specific user preferences
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.35
Ideas
§  Terminology
§  API for Authentication Mechanism
§  API for Identity Store
§  API for Password Aliasing
§  API for Role/Permission Assignment
§  API for Security Context
§  API for Authorization Interceptors
To modernize, standardize, simplify
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.36
Use Case
§  Application manages its own users and groups
§  Need to access a repository of identities, like users
§  Users may be stored in app-specified repository (e.g. LDAP)
§  Users are managed without access to server configuration
API for Identity Store
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.37
Survey Results
API for Identity Store
'
Should we simplify authorization by introducing an EL-enabled authorization
annotation?
'
Should we standardize on requirements for simple security providers and their
configuration?
'
'
Approximately'58%'thought'we'should'add'support'for'password'aliases,'including'the'
ability'to'provision'credentials'along'with'the'application.'
'
70%'thought'that'we'should'standardize'group`to`role'mapping.'
'
53%'thought'we'should'simplify'JASPIC'authentication.'
'
67%'thought'that'we'should'simplify'authorization'and'make'it'more'flexible'by'
introducing'EL`based'authorization'annotations,'introducing'a'capability'more'general'
than'use'of'@RolesAllowed'and'simpler'than'use'of'interceptors'to'do'programmatic'
authorization.'
'
65%'thought'we'should'standardize'on'requirements'for'simple'security'providers'and'
their'configuration.'
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.38
Current Solutions
§  No Java EE support
§  Only proprietary server support
§  3rd party security frameworks provide user/group APIs
API for Identity Store
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.39
Ideas – Identity Store
public interface Identity {
String getUsername();
char[] getPassword();
boolean isAccountExpired();
boolean isAccountLocked();
boolean isPasswordExpired();
boolean isEnabled();
IdentityAttributeValue getAttribute(String name);
}
public interface IdentityAttributeValue {
String getValue();
String getMetaInfo(String name);
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.40
Ideas – Identity Store
public interface IdentityStore{
Identity loadIdentityByName(String name);
void changePassword(char[] oldPassword, char[] newPassword);
void createIdentity(Identity user);
void deleteIdentity(String name);
void updateIdentity(Identity identity);
boolean identityExists(String name);
void createGroup(String group);
void deleteGroup(String group);
void addIdentityToGroup(String name, String group);
void removeIdentityFromGroup(String name, String group);
boolean isIdentityInGroup(String name, String group);
List<String> getIdentityGroups(String name);
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.41
Ideas – Identity Store
IdentityStore
LDAP Server
Identity
DBFile
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.42
Ideas – Identity Store
@LdapIdentityStore(name=“java:app/prodIdentityStore”,
ldapUrl=“ldap://blah”, ldapUser=“ElDap”,ldapPassword=“welcome”)
public class MyAuthenticator {
@Resource(lookup=“java:app/prodIdentityStore”)
private IdentityStore identityStore;
private boolean isAccountEnabled(String username) {
return identityStore.loadUserByUsername(username).isEnabled();
} …
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.43
Ideas – Identity Store
@EmbeddedIdentityStore(name=“java:app/devIdentityStore”,
{@Identity(username="ray", password="secret", groups="admin"),
@Identity(username="jo", password="secret", groups="user"),
@Identity(username="sam", password="secret", groups="user")})
@DatabaseIdentityStore(name=“java:app/testIdentityStore”,
lookup="somedatabase",
userQuery="SELECT password FROM principals WHERE username=?",
groupQuery="SELECT group FROM groups where username=?", ...)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.44
Ideas
§  Terminology
§  API for Authentication Mechanism
§  API for Identity Store
§  API for Password Aliasing
§  API for Role/Permission Assignment
§  API for Security Context
§  API for Authorization Interceptors
To modernize, standardize, simplify
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.45
Use Case
§  Application uses passwords to access resources like LDAP and DB
§  Passwords stored in annotations, deployment descriptors
§  Best practices dictate that passwords are never stored in clear text
§  Need a portable way to protect stored passwords
API for Password Aliasing
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.46
Survey Results
§  Deferred from Java EE 7
API for Password Aliasing
Of'the'small'fraction'of'participants'who'added'comments,'most'of'these'strongly'urged'
for'improvements'in'logging'–'either'by'the'revision'of'java.util.logging,'or'replacement'
of'its'use'by'either'slf4j,''slf4j'with'LogBack,'or'log4j.'
'
'
'
Security'
'
Most'of'the'suggested'improvements'in'the'security'area'received'strong'support.'
'
Should we add support for password aliases (including the ability to provision
credentials along with the application)?
'
Should we standardize group-to-role mapping?
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.47
Current Solutions
§  No Java EE support
§  Proprietary server support, e.g. GlassFish
§  3rd party security framework support for embedded password
encryption, not aliasing
API for Password Aliasing
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.48
Ideas – Password Aliasing
§  For annotations
@DataSourceDefinition(
name="java:app/jdbc/test",
user="root",
password="${ALIAS=password}",…)
§  For deployment descriptors
<data-source>
<name>java:app/env/testDS</name>
<user>APP</user>
<password>${ALIAS=password}</password>
…
</data-source>
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.49
Ideas – Password Aliasing
${ALIAS=token} "mysecret"
Resolved
when used
Cleared
when done
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.50
Ideas – Password Aliasing
Password Alias
Archive
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.51
Ideas – Password Aliasing
§  For configuration: Annotations, Deployment Descriptors
§  Secure credentials archive for bundling the alias and actual password
values with applications
§  Platform consumes the credentials archive upon deployment
§  Standard tooling for CRUD operations on the credential archive, e.g.
keytool
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.52
Ideas
§  Terminology
§  API for Authentication Mechanism
§  API for Identity Store
§  API for Password Aliasing
§  API for Role/Permission Assignment
§  API for Security Context
§  API for Authorization Interceptors
To modernize, standardize, simplify
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.53
Use Case
§  Application manages its own users and groups
§  Application needs to assign roles (i.e., authorities, permissions) to
users and groups, based on application-specific model
§  Users may be stored in app-specified repository (e.g. LDAP)
§  Users are managed without access to server configuration
API for Role/Permission Assignment
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.54
Survey Results
API for Role/Permission Assignment
Security'
'
Most'of'the'suggested'improvements'in'the'security'area'received'strong'support.'
'
Should we add support for password aliases (including the ability to provision
credentials along with the application)?
'
Should we standardize group-to-role mapping?
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.55
Current Solutions
§  No Java EE support
§  Only proprietary server support
§  3rd party security frameworks provide role/authority/permission APIs
API for Role/Permission Assignment
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.56
Ideas – Standardized Role Mapping
§  Support in Deployment Descriptors, e.g. web.xml
<security-role-map>
<!-- Role name as set/returned by Authentication Module -->
<group>MANAGER</group>
<!-- Role name for mapping -->
<role-name>EDIT_ACCOUNTS</role-name>
</security-role-map>
<!– One-to-one group to role mapping -->
<security-role-map groupToRoleMapping="false" />
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.57
Ideas – Role Mapping Annotation
@EmbeddedRoleMapper(
users={
@RoleMap(user=“foo”,roles=“admin”),
@RoleMap(group=“admin”,roles={“admin”,”manager”})
}
)
public class MyServlet {
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.58
Ideas – Dynamic Role Mapping
public interface RoleMapper {
void grantRoleToUser(String username, String role);
void revokeRoleFromUser(String username, String role);
boolean hasRoleForUser(
String username, String role, boolean includeGroups);
List<String> getRolesForUser(
String username, boolean includeGroups);
List<String> getUsersWithRole(
String role, boolean includeGroups);
void grantRoleToGroup(String group, String role);
void revokeRoleFromGroup(String group, String role);
boolean hasRoleForGroup(String group, String role);
List<String> getRolesForGroup(String group);
List<String> getGroupsWithRole(String role);
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.59
Ideas – Dynamic Role Mapping
@Inject
RoleMapper roleMapper;
roleMapper.grantRoleToGroup("Manager", "EDIT_ACCOUNTS");
boolean has = roleMapper.hasRoleForGroup("Manager", "CLOSE_ACCT");
List<String> roles = roleMapper.getRolesForGroup("Manager");
List<String> groups = roleMapper.getGroupsWithRole("VIEW_ACCOUNTS");
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.60
Ideas
§  Terminology
§  API for Authentication Mechanism
§  API for Identity Store
§  API for Password Aliasing
§  API for Role/Permission Assignment
§  API for Security Context
§  API for Authorization Interceptors
To modernize, standardize, simplify
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.61
Use Case
§  Application needs to access the security API
–  To get the authenticated user
–  To check roles
–  To invoke runAs.
§  Application needs the same API to access security context, regardless
of container
API for Security Context
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.62
Current Solutions
§  No Java EE support
§  3rd party security frameworks provide a security context
API for Security Context
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.63
Current Solutions
@Singleton
public class MyEjb {
@Resource
private SessionContext sessionContext;
public String sayHello() {
if (sessionContext.isCallerInRole("admin")) {
return "Hello World!";
}
throw new SecurityException("User is unauthorized.");
}
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.64
Current Solutions
public class MyServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request,
HttpServletResponse resp) throws ServletException, IOException {
if (request.isUserInRole("admin")) {
// do something
}
throw new ServletException("User is unauthorized.");
}
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.65
Current Solutions
@RequestScoped
public class MyCdiBean {
// Oh snap! No SecurityContext class for CDI
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.66
Current Solutions
public class MyJaxRsService {
@GET
@Produces("text/plain;charset=UTF-8")
@Path("/hello")
public String sayHello(@Context SecurityContext sc) {
if (sc.isUserInRole("admin")) {
return "Hello World!";
}
throw new SecurityException("User is unauthorized.");
}
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.67
Ideas – Security Context
public interface SecurityContext {
String getUserPrincipal();
boolean isUserInRole(String role);
List<String> getAllUsersRoles();
boolean isAuthenticated();
boolean isUserInAnyRole(List<String> roles);
boolean isUserInAllRoles(List<String> roles);
void login(Object request, Object response);
void login(Map map);
void logout();
void runAs(String role);
boolean hasAccessToResource();
boolean hasAccessToBeanMethod();
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.68
Ideas – Security Context
§  For all managed beans: CDI, Servlet, EJB, JAX-RS, etc
public class MyFutureCdiBean {
@Inject
private SecurityContext securityContext;
public String sayHello() {
if (securityContext.isUserInRole("admin")) {
return "Hello World!";
}
throw new SecurityException("User is unauthorized.");
}
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.69
Ideas
§  Terminology
§  API for Authentication Mechanism
§  API for Identity Store
§  API for Password Aliasing
§  API for Role/Permission Assignment
§  API for Security Context
§  API for Authorization Interceptors
To modernize, standardize, simplify
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.70
Use Case
§  Application needs to restrict specific methods to authorized users
§  Application-model rules are used to make access decisions
§  Role is insufficient
API for Authorization Interceptors
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.71
Survey Results
API for Authorization Interceptors
this'last'question.''Thymeleaf,'Freemarker,'and'Velocity'were'the'most'frequently'
mentioned'here.'
'
'
'
'
CDI'
'
The'next'four'questions'focused'on'continued'CDI'alignment.''This'was'one'of'the'focus'
areas'of'Java'EE'7.'
'
Should we consider adding Security Interceptors in Java EE 8?
Should we simplify JASPIC?
'
Should we simplify authorization by introducing an EL-enabled authorization
annotation?
'
Should we standardize on requirements for simple security providers and their
configuration?
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.72
Current Solutions
§  EE authorization has no rule based authorization, only role based
§  3rd party security frameworks provide rule, role and permission based
APIs
API for Authorization Interceptors
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.73
Ideas – EL Authorization Rules
§  Expression Language rule would have access to managed beans for
SecurityContext and InvocationContext
@ EvaluateSecured("security.hasRoles('MANAGER') &&
schedule.nowIsOfficeHrs")
void transferFunds() {..};
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.74
Ideas – EL Authorization Rules
§  EL Authorization rules centrally managed in a repository
@LdapAuthorizationRules (
name="java:app/accountAuthRules",
ldapUrl="ldap://blah",
ldapUser="ElDap",
ldapPassword=“mysecret”
)
public class MyBean {
@ EvaluateSecured(
ruleSourceName="java:app/accountAuthRules", rule="transferFunds")
void transferFunds() {..};
…
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.75
Ideas – AccessDecisionVoter
§  A user-defined class for making access decisions
@Secured(AccountAccessDecisionVoter.class)
void transferFunds() {..};
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.76
Ideas – AccessDecisionVoter
public class AccountAccessDecisionVoter implements AccessDecisionVoter {
@Override
public void checkPermission(AccessDecisionVoterContext ctx,
Set<SecurityViolation> violations) {
// Check for violations
Method method = ctx.<InvocationContext>getSource().getMethod();
…
violations.add(new SecurityViolation("Sorry, not allowed"));
}
}
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.77
Agenda
§  Motivations
§  A New JSR
§  Ideas
§  Get Involved
§  Q & A
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.78
Get Involved
§  Project Page: The starting point to all resources
https://java.net/projects/javaee-security-spec
§  Users List: Subscribe and contribute
users@javaee-security-spec.java.net
§  Github Playground: Fork and Play!
https://github.com/javaee-security-spec/javaee-security-proposals
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.79
Q/A
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.80

Más contenido relacionado

La actualidad más candente

EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyDavid Delabassee
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Reza Rahman
 
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015Edward Burns
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot David Delabassee
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsMurat Yener
 
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015Werner Keil
 
What's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondWhat's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondOracle
 
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial SystemsJava EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial SystemsArshal Ameen
 
Best Way to Write SQL in Java
Best Way to Write SQL in JavaBest Way to Write SQL in Java
Best Way to Write SQL in JavaGerger
 
Modern web application development with java ee 7
Modern web application development with java ee 7Modern web application development with java ee 7
Modern web application development with java ee 7Shekhar Gulati
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0David Delabassee
 
Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Heather VanCura
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchReza Rahman
 
Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Edward Burns
 

La actualidad más candente (16)

EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?
 
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
 
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
JSR 375 - Have you seen Java EE Security API lately? - codemotion Tel Aviv 2015
 
What's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondWhat's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and Beyond
 
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial SystemsJava EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
 
Move from J2EE to Java EE
Move from J2EE to Java EEMove from J2EE to Java EE
Move from J2EE to Java EE
 
Best Way to Write SQL in Java
Best Way to Write SQL in JavaBest Way to Write SQL in Java
Best Way to Write SQL in Java
 
Modern web application development with java ee 7
Modern web application development with java ee 7Modern web application development with java ee 7
Modern web application development with java ee 7
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
 
Java on Azure
Java on AzureJava on Azure
Java on Azure
 
Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great Match
 
Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015
 

Destacado

Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 updateDavid Delabassee
 
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouDavid Delabassee
 
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youJava EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youAlex Theedom
 
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013Martin Fousek
 
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingDmitry Kornilov
 
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portionmnriem
 
2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI Alignment2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI AlignmentDavid Blevins
 
JSR 375 Segurança em Java EE 8
JSR 375 Segurança em Java EE 8JSR 375 Segurança em Java EE 8
JSR 375 Segurança em Java EE 8Helder da Rocha
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckEdward Burns
 
HTTP2 最速実装 〜入門編〜
HTTP2 最速実装 〜入門編〜HTTP2 最速実装 〜入門編〜
HTTP2 最速実装 〜入門編〜Kaoru Maeda
 
Paul Johnston - What I Wish I'd Known Last Year
Paul Johnston - What I Wish I'd Known Last YearPaul Johnston - What I Wish I'd Known Last Year
Paul Johnston - What I Wish I'd Known Last YearServerlessConf
 
Introduction to CDI and DI in Java EE 6
Introduction to CDI and DI in Java EE 6Introduction to CDI and DI in Java EE 6
Introduction to CDI and DI in Java EE 6Ray Ploski
 
API Security from the DevOps and CSO Perspectives (Webcast)
API Security from the DevOps and CSO Perspectives (Webcast)API Security from the DevOps and CSO Perspectives (Webcast)
API Security from the DevOps and CSO Perspectives (Webcast)Apigee | Google Cloud
 
Javaでのバリデーション 〜Bean Validation篇〜
Javaでのバリデーション 〜Bean Validation篇〜Javaでのバリデーション 〜Bean Validation篇〜
Javaでのバリデーション 〜Bean Validation篇〜eiryu
 
Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)Dmitry Kornilov
 
3年間の情報漏洩事件からみるデータ保護対策の勘所 ~ データ・セキュリティ、考え方とその仕組み
3年間の情報漏洩事件からみるデータ保護対策の勘所 ~ データ・セキュリティ、考え方とその仕組み3年間の情報漏洩事件からみるデータ保護対策の勘所 ~ データ・セキュリティ、考え方とその仕組み
3年間の情報漏洩事件からみるデータ保護対策の勘所 ~ データ・セキュリティ、考え方とその仕組みオラクルエンジニア通信
 

Destacado (19)

Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 update
 
Java EE Next
Java EE NextJava EE Next
Java EE Next
 
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
 
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youJava EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
 
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
 
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON Binding
 
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion
 
2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI Alignment2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI Alignment
 
JSR 375 Segurança em Java EE 8
JSR 375 Segurança em Java EE 8JSR 375 Segurança em Java EE 8
JSR 375 Segurança em Java EE 8
 
http2 最速実装 v2
http2 最速実装 v2 http2 最速実装 v2
http2 最速実装 v2
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
 
HTTP2 最速実装 〜入門編〜
HTTP2 最速実装 〜入門編〜HTTP2 最速実装 〜入門編〜
HTTP2 最速実装 〜入門編〜
 
Paul Johnston - What I Wish I'd Known Last Year
Paul Johnston - What I Wish I'd Known Last YearPaul Johnston - What I Wish I'd Known Last Year
Paul Johnston - What I Wish I'd Known Last Year
 
Java EE for the Cloud
Java EE for the CloudJava EE for the Cloud
Java EE for the Cloud
 
Introduction to CDI and DI in Java EE 6
Introduction to CDI and DI in Java EE 6Introduction to CDI and DI in Java EE 6
Introduction to CDI and DI in Java EE 6
 
API Security from the DevOps and CSO Perspectives (Webcast)
API Security from the DevOps and CSO Perspectives (Webcast)API Security from the DevOps and CSO Perspectives (Webcast)
API Security from the DevOps and CSO Perspectives (Webcast)
 
Javaでのバリデーション 〜Bean Validation篇〜
Javaでのバリデーション 〜Bean Validation篇〜Javaでのバリデーション 〜Bean Validation篇〜
Javaでのバリデーション 〜Bean Validation篇〜
 
Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)
 
3年間の情報漏洩事件からみるデータ保護対策の勘所 ~ データ・セキュリティ、考え方とその仕組み
3年間の情報漏洩事件からみるデータ保護対策の勘所 ~ データ・セキュリティ、考え方とその仕組み3年間の情報漏洩事件からみるデータ保護対策の勘所 ~ データ・セキュリティ、考え方とその仕組み
3年間の情報漏洩事件からみるデータ保護対策の勘所 ~ データ・セキュリティ、考え方とその仕組み
 

Similar a Finally, EE Security API JSR 375

Java2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the CloudJava2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the CloudWerner Keil
 
Modern App Development with Oracle Cloud
Modern App Development with Oracle CloudModern App Development with Oracle Cloud
Modern App Development with Oracle CloudJuan Carlos Ruiz Rico
 
Oracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsOracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsMaria Colgan
 
REST API Doc Best Practices
REST API Doc Best PracticesREST API Doc Best Practices
REST API Doc Best PracticesMarta Rauch
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data ServicesChris Muir
 
JavaOne2015フィードバック @ 富山合同勉強会
JavaOne2015フィードバック @ 富山合同勉強会JavaOne2015フィードバック @ 富山合同勉強会
JavaOne2015フィードバック @ 富山合同勉強会Takashi Ito
 
JavaOne Shanghai 2013 - Servlet 3.1 (JSR 340)
JavaOne Shanghai 2013 - Servlet 3.1 (JSR 340)JavaOne Shanghai 2013 - Servlet 3.1 (JSR 340)
JavaOne Shanghai 2013 - Servlet 3.1 (JSR 340)Shing Wai Chan
 
20160123 java one2015_feedback @ Osaka
20160123 java one2015_feedback @ Osaka20160123 java one2015_feedback @ Osaka
20160123 java one2015_feedback @ OsakaTakashi Ito
 
Boost Your Content Strategy for REST APIs
Boost Your Content Strategy for REST APIsBoost Your Content Strategy for REST APIs
Boost Your Content Strategy for REST APIsMarta Rauch
 
Java Web Application Security - Denver JUG 2013
Java Web Application Security - Denver JUG 2013Java Web Application Security - Denver JUG 2013
Java Web Application Security - Denver JUG 2013Matt Raible
 
How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesPavel Bucek
 
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)jeckels
 
Integrating Enterprise Controls with the Cloud
Integrating Enterprise Controls with the CloudIntegrating Enterprise Controls with the Cloud
Integrating Enterprise Controls with the CloudAtul Goyal
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureJavaDayUA
 
geecon 2016: "What's Oracle Doing with JavaScript?!"
geecon 2016: "What's Oracle Doing with JavaScript?!"geecon 2016: "What's Oracle Doing with JavaScript?!"
geecon 2016: "What's Oracle Doing with JavaScript?!"Geertjan Wielenga
 
What_to_expect_from_oracle_database_12c
What_to_expect_from_oracle_database_12cWhat_to_expect_from_oracle_database_12c
What_to_expect_from_oracle_database_12cMaria Colgan
 
10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em StartupsMySQL Brasil
 
Introduction to Java Micro Edition (ME) 8
Introduction to Java Micro Edition (ME) 8Introduction to Java Micro Edition (ME) 8
Introduction to Java Micro Edition (ME) 8terrencebarr
 

Similar a Finally, EE Security API JSR 375 (20)

Java2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the CloudJava2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the Cloud
 
Oracle JET overview
Oracle JET overviewOracle JET overview
Oracle JET overview
 
Modern App Development with Oracle Cloud
Modern App Development with Oracle CloudModern App Development with Oracle Cloud
Modern App Development with Oracle Cloud
 
Oracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsOracle database 12c_and_DevOps
Oracle database 12c_and_DevOps
 
REST API Doc Best Practices
REST API Doc Best PracticesREST API Doc Best Practices
REST API Doc Best Practices
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data Services
 
JavaOne2015フィードバック @ 富山合同勉強会
JavaOne2015フィードバック @ 富山合同勉強会JavaOne2015フィードバック @ 富山合同勉強会
JavaOne2015フィードバック @ 富山合同勉強会
 
JavaOne Shanghai 2013 - Servlet 3.1 (JSR 340)
JavaOne Shanghai 2013 - Servlet 3.1 (JSR 340)JavaOne Shanghai 2013 - Servlet 3.1 (JSR 340)
JavaOne Shanghai 2013 - Servlet 3.1 (JSR 340)
 
20160123 java one2015_feedback @ Osaka
20160123 java one2015_feedback @ Osaka20160123 java one2015_feedback @ Osaka
20160123 java one2015_feedback @ Osaka
 
Boost Your Content Strategy for REST APIs
Boost Your Content Strategy for REST APIsBoost Your Content Strategy for REST APIs
Boost Your Content Strategy for REST APIs
 
Java Web Application Security - Denver JUG 2013
Java Web Application Security - Denver JUG 2013Java Web Application Security - Denver JUG 2013
Java Web Application Security - Denver JUG 2013
 
How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based Microservices
 
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
 
Integrating Enterprise Controls with the Cloud
Integrating Enterprise Controls with the CloudIntegrating Enterprise Controls with the Cloud
Integrating Enterprise Controls with the Cloud
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and Architecture
 
Oracle JET
Oracle JETOracle JET
Oracle JET
 
geecon 2016: "What's Oracle Doing with JavaScript?!"
geecon 2016: "What's Oracle Doing with JavaScript?!"geecon 2016: "What's Oracle Doing with JavaScript?!"
geecon 2016: "What's Oracle Doing with JavaScript?!"
 
What_to_expect_from_oracle_database_12c
What_to_expect_from_oracle_database_12cWhat_to_expect_from_oracle_database_12c
What_to_expect_from_oracle_database_12c
 
10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups
 
Introduction to Java Micro Edition (ME) 8
Introduction to Java Micro Edition (ME) 8Introduction to Java Micro Edition (ME) 8
Introduction to Java Micro Edition (ME) 8
 

Último

GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 

Último (20)

GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 

Finally, EE Security API JSR 375

  • 1. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.1
  • 2. Finally, EE Security API JSR 375 Alex Kosowski JSR 375 Specification Lead WebLogic Server Security
  • 3. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.3 Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 4. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.4 Agenda §  Motivations §  A New JSR §  Ideas §  Get Involved §  Q & A
  • 5. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.5 Agenda §  Motivations §  A New JSR §  Ideas §  Get Involved §  Q & A
  • 6. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.6 Why a Java EE Security API JSR? §  EE 8 survey results §  4500 total responses §  Priorities Pie Chart
  • 7. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.7 What’s wrong with Java EE Security? "The ultimate goal is to have basic security working without the need of any kind of vendor specific configuration, deployment descriptors, or whatever. ” – Arjan Tijms “[The EE security] model is problematic in cloud/PaaS environments where developers do not necessarily have easy access to non-standard vendor runtime features and a self-contained application is much easier to manage.” – Reza Rahman The community says…
  • 8. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.8 What’s wrong with Java EE Security? §  Java EE Security viewed as not portable, abstract/confusing, antiquated §  Doesn’t fit cloud app developer paradigm: requires app server configuration §  Losing value to non-standard 3rd Party Frameworks…less likely to move back to Java EE when requirements increase
  • 9. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.9 What to do? §  Plug the portability holes §  Modernize –  Context Dependency Injection (CDI) §  Intercept at Access Enforcement Points: POJO methods –  Expression Language (EL) §  Enable Access Enforcement Points with complex rules §  App Developer Friendly –  Common security configurations not requiring server changes –  Annotation defaults not requiring XML
  • 10. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.10 Agenda §  Motivations §  A New JSR §  Ideas §  Get Involved §  Q & A
  • 11. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.11 JSR 375 History §  August 2014: First proposed to Oracle Java EE Architects §  December 2014: Approved by JCP §  Expert Group nominations: –  EE API veterans: many JSRs, many years struggling with Security API –  3rd party security framework creators/developers –  EE platform security implementers §  March 2015: Expert Group started discussions
  • 12. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.12 JSR 375 – Expert Group Name Representing Adam Bien Individual David Blevins Tomitribe Rudy De Busscher Individual Ivar Grimstad Individual Les Hazlewood Stormpath, Inc. Will Hopkins Oracle Werner Keil Individual
  • 13. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.13 JSR 375 – Expert Group Name Representing Matt Konda Jemurai Alex Kosowski Oracle Darran Lofthouse RedHat Jean-Louis Monteiro Tomitribe Ajay Reddy IBM Pedro Igor Silva RedHat Arjan Tijms ZEEF
  • 14. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.14 JSR 375 History §  In first month, expert group had an EXPLOSION of activity –  Lot of Brainstorming! –  237 messages on EG mailing list –  81 commits in Github playgrounds for examples and proposals –  24 JIRA issues
  • 15. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.15 Agenda §  Motivations §  A New JSR §  Ideas §  Get Involved §  Q & A
  • 16. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.16 Ideas §  Terminology §  API for Authentication Mechanism §  API for Identity Store §  API for Password Aliasing §  API for Role/Permission Assignment §  API for Security Context §  API for Authorization Interceptors To modernize, standardize, simplify
  • 17. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.17 Ideas To modernize, standardize, simplify Identity Store Authentication Mechanism Security Context Authorization Interceptors Role/Permission Assignment Password Aliasing
  • 18. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.18 Ideas §  Terminology §  API for Authentication Mechanism §  API for Identity Store §  API for Password Aliasing §  API for Role/Permission Assignment §  API for Security Context §  API for Authorization Interceptors To modernize, standardize, simplify
  • 19. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.19 Ideas - Terminology §  EG discussions revealed inconsistency in security API terms §  Different EE containers have different names for the same concepts §  When “something” gets authenticated, is that something a… –  A User? (e.g. HttpServletRequest.getUserPrincipal) –  A Caller? (e.g. EJBContext.getCallerPrincipal) §  What is a group? –  A group of users? –  A permission –  Vs Role?
  • 20. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.20 Ideas - Terminology §  What is that “something” where identities are stored? –  security provider (WebLogic) –  realm (Tomcat, some hints in Servlet spec) –  (auth) repository –  (auth) store –  login module (JAAS) –  identity manager (Undertow) –  authenticator (Resin, OmniSecurity, Seam Security) –  authentication provider (Spring Security) –  identity provider
  • 21. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.21 Ideas §  Terminology §  API for Authentication Mechanism §  API for Identity Store §  API for Password Aliasing §  API for Role/Permission Assignment §  API for Security Context §  API for Authorization Interceptors To modernize, standardize, simplify
  • 22. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.22 Use Case §  Application manages its own users and groups §  Application needs to authenticate users in order to assign Roles §  Application authenticates based on application-domain models §  Application needs to use an authentication method not supported on the server, like OpenID Connect §  Developer wants to use portable EE Authentication standard API for Authentication Mechanism
  • 23. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.23 Current Solutions §  Proprietary server support §  3rd party security frameworks provide authentication §  JASPIC: Java Authentication Service Provider Interface for Containers API for Authentication Mechanism
  • 24. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.24 JASPIC §  Java Authentication Service Provider Interface for Containers §  JSR 196, Maintenance Release 1.1, in 2013 §  Standardized, portable, thin, low-level authentication framework §  Extensible from within an application §  Integrates with the container to build an authenticated Subject §  Implement any authentication method
  • 25. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.25 JASPIC Server Auth Module public interface ServerAuthModule { public void initialize(MessagePolicy requestPolicy, MessagePolicy responsePolicy, CallbackHandler handler, Map options) throws AuthException; public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject); public Class<?>[] getSupportedMessageTypes(); public AuthStatus secureResponse(MessageInfo messageInfo, Subject serviceSubject); public void cleanSubject(MessageInfo messageInfo, Subject subject); }
  • 26. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.26 JASPIC Per-Application Installation ServletContextListener AuthConfigFactory AuthConfigProvider ServerAuthConfig ServerAuthContext ServerAuthModule
  • 27. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.27 Ideas – Simple ServerAuthModule Installation ServletContextListener AuthConfigFactory AuthConfigProvider ServerAuthConfig ServerAuthContext ServerAuthModule ServletContextListener
  • 28. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.28 Ideas – Simple ServerAuthModule Installation @WebListener public class SamRegistrationListener implements ServletContextListener { @Override public void contextInitialized(ServletContextEvent sce) { Jaspic.registerServerAuthModule(new TokenAuthModule(), sce.getServletContext()); } @Override public void contextDestroyed(ServletContextEvent sce) { } }
  • 29. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.29 Ideas – Simple ServerAuthModule Installation @Authenticator("org.acme.TokenAuthModule") @WebServlet("/SimpleServlet") @ServletSecurity(@HttpConstraint(rolesAllowed = {"manager"})) public class SimpleServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.getWriter().print("my GET"); } }
  • 30. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.30 Ideas – Profile Specific Helper Classes public class BasicServerAuthModule implements ServerAuthModule { public void initialize(…) throws AuthException { … } public Class<?>[] getSupportedMessageTypes() { … } public AuthStatus secureResponse(MessageInfo messageInfo, Subject serviceSubject) throws AuthException { … } public void cleanSubject(MessageInfo messageInfo, Subject subject) throws AuthException { … } public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) throws AuthException { final HttpServletRequest request = (HttpServletRequest) messageInfo.getRequestMessage(); … }
  • 31. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.31 Ideas – Profile Specific Helper Classes public class BasicServerAuthModule extends HttpServerAuthModule { public AuthStatus validateHttpRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) throws AuthException { … } }
  • 32. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.32 Ideas – Profile Specific Helper Classes public class BasicServerAuthModule extends HttpServerAuthModule { public AuthStatus validateHttpRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) throws AuthException { final String header = request.getHeader("Authorization"); final String[] credentials = parseCredentials(header); final String username = credentials[0]; final String password = credentials[1]; if (!"snoopy".equals(username) || !"woodst0ck".equals(password)) { return FAILURE; } // No callbacks required!!! return httpMessageContext.notifyContainerAboutLogin( "snoopy", // the groups/roles of the authenticated user Arrays.asList("RedBaron", "JoeCool", "MansBestFriend")); }
  • 33. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.33 Ideas – Standardized Authenticators @Authenticator("javax.security.authenticator.OpenIDConnect") @WebServlet("/SimpleServlet") @ServletSecurity(@HttpConstraint(rolesAllowed = {"manager"})) public class SimpleServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.getWriter().print("my GET"); } } §  OpenID Connect ServerAuthModule
  • 34. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.34 Ideas – Authentication Events §  Throw standardized CDI events at important moments –  PreAuthenticate Event –  PostAuthenticate Event –  PreLogout Event –  PostLogout Event §  Possible uses: –  Tracking number of logged-in users –  Tracking failed login attempts per account –  Side effects, like creating a new local user after initial successful authentication via a remote authentication provider –  Loading application-specific user preferences
  • 35. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.35 Ideas §  Terminology §  API for Authentication Mechanism §  API for Identity Store §  API for Password Aliasing §  API for Role/Permission Assignment §  API for Security Context §  API for Authorization Interceptors To modernize, standardize, simplify
  • 36. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.36 Use Case §  Application manages its own users and groups §  Need to access a repository of identities, like users §  Users may be stored in app-specified repository (e.g. LDAP) §  Users are managed without access to server configuration API for Identity Store
  • 37. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.37 Survey Results API for Identity Store ' Should we simplify authorization by introducing an EL-enabled authorization annotation? ' Should we standardize on requirements for simple security providers and their configuration? ' ' Approximately'58%'thought'we'should'add'support'for'password'aliases,'including'the' ability'to'provision'credentials'along'with'the'application.' ' 70%'thought'that'we'should'standardize'group`to`role'mapping.' ' 53%'thought'we'should'simplify'JASPIC'authentication.' ' 67%'thought'that'we'should'simplify'authorization'and'make'it'more'flexible'by' introducing'EL`based'authorization'annotations,'introducing'a'capability'more'general' than'use'of'@RolesAllowed'and'simpler'than'use'of'interceptors'to'do'programmatic' authorization.' ' 65%'thought'we'should'standardize'on'requirements'for'simple'security'providers'and' their'configuration.'
  • 38. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.38 Current Solutions §  No Java EE support §  Only proprietary server support §  3rd party security frameworks provide user/group APIs API for Identity Store
  • 39. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.39 Ideas – Identity Store public interface Identity { String getUsername(); char[] getPassword(); boolean isAccountExpired(); boolean isAccountLocked(); boolean isPasswordExpired(); boolean isEnabled(); IdentityAttributeValue getAttribute(String name); } public interface IdentityAttributeValue { String getValue(); String getMetaInfo(String name); }
  • 40. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.40 Ideas – Identity Store public interface IdentityStore{ Identity loadIdentityByName(String name); void changePassword(char[] oldPassword, char[] newPassword); void createIdentity(Identity user); void deleteIdentity(String name); void updateIdentity(Identity identity); boolean identityExists(String name); void createGroup(String group); void deleteGroup(String group); void addIdentityToGroup(String name, String group); void removeIdentityFromGroup(String name, String group); boolean isIdentityInGroup(String name, String group); List<String> getIdentityGroups(String name); }
  • 41. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.41 Ideas – Identity Store IdentityStore LDAP Server Identity DBFile
  • 42. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.42 Ideas – Identity Store @LdapIdentityStore(name=“java:app/prodIdentityStore”, ldapUrl=“ldap://blah”, ldapUser=“ElDap”,ldapPassword=“welcome”) public class MyAuthenticator { @Resource(lookup=“java:app/prodIdentityStore”) private IdentityStore identityStore; private boolean isAccountEnabled(String username) { return identityStore.loadUserByUsername(username).isEnabled(); } … }
  • 43. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.43 Ideas – Identity Store @EmbeddedIdentityStore(name=“java:app/devIdentityStore”, {@Identity(username="ray", password="secret", groups="admin"), @Identity(username="jo", password="secret", groups="user"), @Identity(username="sam", password="secret", groups="user")}) @DatabaseIdentityStore(name=“java:app/testIdentityStore”, lookup="somedatabase", userQuery="SELECT password FROM principals WHERE username=?", groupQuery="SELECT group FROM groups where username=?", ...)
  • 44. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.44 Ideas §  Terminology §  API for Authentication Mechanism §  API for Identity Store §  API for Password Aliasing §  API for Role/Permission Assignment §  API for Security Context §  API for Authorization Interceptors To modernize, standardize, simplify
  • 45. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.45 Use Case §  Application uses passwords to access resources like LDAP and DB §  Passwords stored in annotations, deployment descriptors §  Best practices dictate that passwords are never stored in clear text §  Need a portable way to protect stored passwords API for Password Aliasing
  • 46. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.46 Survey Results §  Deferred from Java EE 7 API for Password Aliasing Of'the'small'fraction'of'participants'who'added'comments,'most'of'these'strongly'urged' for'improvements'in'logging'–'either'by'the'revision'of'java.util.logging,'or'replacement' of'its'use'by'either'slf4j,''slf4j'with'LogBack,'or'log4j.' ' ' ' Security' ' Most'of'the'suggested'improvements'in'the'security'area'received'strong'support.' ' Should we add support for password aliases (including the ability to provision credentials along with the application)? ' Should we standardize group-to-role mapping?
  • 47. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.47 Current Solutions §  No Java EE support §  Proprietary server support, e.g. GlassFish §  3rd party security framework support for embedded password encryption, not aliasing API for Password Aliasing
  • 48. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.48 Ideas – Password Aliasing §  For annotations @DataSourceDefinition( name="java:app/jdbc/test", user="root", password="${ALIAS=password}",…) §  For deployment descriptors <data-source> <name>java:app/env/testDS</name> <user>APP</user> <password>${ALIAS=password}</password> … </data-source>
  • 49. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.49 Ideas – Password Aliasing ${ALIAS=token} "mysecret" Resolved when used Cleared when done
  • 50. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.50 Ideas – Password Aliasing Password Alias Archive
  • 51. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.51 Ideas – Password Aliasing §  For configuration: Annotations, Deployment Descriptors §  Secure credentials archive for bundling the alias and actual password values with applications §  Platform consumes the credentials archive upon deployment §  Standard tooling for CRUD operations on the credential archive, e.g. keytool
  • 52. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.52 Ideas §  Terminology §  API for Authentication Mechanism §  API for Identity Store §  API for Password Aliasing §  API for Role/Permission Assignment §  API for Security Context §  API for Authorization Interceptors To modernize, standardize, simplify
  • 53. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.53 Use Case §  Application manages its own users and groups §  Application needs to assign roles (i.e., authorities, permissions) to users and groups, based on application-specific model §  Users may be stored in app-specified repository (e.g. LDAP) §  Users are managed without access to server configuration API for Role/Permission Assignment
  • 54. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.54 Survey Results API for Role/Permission Assignment Security' ' Most'of'the'suggested'improvements'in'the'security'area'received'strong'support.' ' Should we add support for password aliases (including the ability to provision credentials along with the application)? ' Should we standardize group-to-role mapping?
  • 55. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.55 Current Solutions §  No Java EE support §  Only proprietary server support §  3rd party security frameworks provide role/authority/permission APIs API for Role/Permission Assignment
  • 56. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.56 Ideas – Standardized Role Mapping §  Support in Deployment Descriptors, e.g. web.xml <security-role-map> <!-- Role name as set/returned by Authentication Module --> <group>MANAGER</group> <!-- Role name for mapping --> <role-name>EDIT_ACCOUNTS</role-name> </security-role-map> <!– One-to-one group to role mapping --> <security-role-map groupToRoleMapping="false" />
  • 57. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.57 Ideas – Role Mapping Annotation @EmbeddedRoleMapper( users={ @RoleMap(user=“foo”,roles=“admin”), @RoleMap(group=“admin”,roles={“admin”,”manager”}) } ) public class MyServlet { }
  • 58. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.58 Ideas – Dynamic Role Mapping public interface RoleMapper { void grantRoleToUser(String username, String role); void revokeRoleFromUser(String username, String role); boolean hasRoleForUser( String username, String role, boolean includeGroups); List<String> getRolesForUser( String username, boolean includeGroups); List<String> getUsersWithRole( String role, boolean includeGroups); void grantRoleToGroup(String group, String role); void revokeRoleFromGroup(String group, String role); boolean hasRoleForGroup(String group, String role); List<String> getRolesForGroup(String group); List<String> getGroupsWithRole(String role); }
  • 59. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.59 Ideas – Dynamic Role Mapping @Inject RoleMapper roleMapper; roleMapper.grantRoleToGroup("Manager", "EDIT_ACCOUNTS"); boolean has = roleMapper.hasRoleForGroup("Manager", "CLOSE_ACCT"); List<String> roles = roleMapper.getRolesForGroup("Manager"); List<String> groups = roleMapper.getGroupsWithRole("VIEW_ACCOUNTS");
  • 60. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.60 Ideas §  Terminology §  API for Authentication Mechanism §  API for Identity Store §  API for Password Aliasing §  API for Role/Permission Assignment §  API for Security Context §  API for Authorization Interceptors To modernize, standardize, simplify
  • 61. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.61 Use Case §  Application needs to access the security API –  To get the authenticated user –  To check roles –  To invoke runAs. §  Application needs the same API to access security context, regardless of container API for Security Context
  • 62. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.62 Current Solutions §  No Java EE support §  3rd party security frameworks provide a security context API for Security Context
  • 63. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.63 Current Solutions @Singleton public class MyEjb { @Resource private SessionContext sessionContext; public String sayHello() { if (sessionContext.isCallerInRole("admin")) { return "Hello World!"; } throw new SecurityException("User is unauthorized."); } }
  • 64. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.64 Current Solutions public class MyServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException { if (request.isUserInRole("admin")) { // do something } throw new ServletException("User is unauthorized."); } }
  • 65. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.65 Current Solutions @RequestScoped public class MyCdiBean { // Oh snap! No SecurityContext class for CDI }
  • 66. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.66 Current Solutions public class MyJaxRsService { @GET @Produces("text/plain;charset=UTF-8") @Path("/hello") public String sayHello(@Context SecurityContext sc) { if (sc.isUserInRole("admin")) { return "Hello World!"; } throw new SecurityException("User is unauthorized."); } }
  • 67. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.67 Ideas – Security Context public interface SecurityContext { String getUserPrincipal(); boolean isUserInRole(String role); List<String> getAllUsersRoles(); boolean isAuthenticated(); boolean isUserInAnyRole(List<String> roles); boolean isUserInAllRoles(List<String> roles); void login(Object request, Object response); void login(Map map); void logout(); void runAs(String role); boolean hasAccessToResource(); boolean hasAccessToBeanMethod(); }
  • 68. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.68 Ideas – Security Context §  For all managed beans: CDI, Servlet, EJB, JAX-RS, etc public class MyFutureCdiBean { @Inject private SecurityContext securityContext; public String sayHello() { if (securityContext.isUserInRole("admin")) { return "Hello World!"; } throw new SecurityException("User is unauthorized."); } }
  • 69. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.69 Ideas §  Terminology §  API for Authentication Mechanism §  API for Identity Store §  API for Password Aliasing §  API for Role/Permission Assignment §  API for Security Context §  API for Authorization Interceptors To modernize, standardize, simplify
  • 70. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.70 Use Case §  Application needs to restrict specific methods to authorized users §  Application-model rules are used to make access decisions §  Role is insufficient API for Authorization Interceptors
  • 71. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.71 Survey Results API for Authorization Interceptors this'last'question.''Thymeleaf,'Freemarker,'and'Velocity'were'the'most'frequently' mentioned'here.' ' ' ' ' CDI' ' The'next'four'questions'focused'on'continued'CDI'alignment.''This'was'one'of'the'focus' areas'of'Java'EE'7.' ' Should we consider adding Security Interceptors in Java EE 8? Should we simplify JASPIC? ' Should we simplify authorization by introducing an EL-enabled authorization annotation? ' Should we standardize on requirements for simple security providers and their configuration?
  • 72. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.72 Current Solutions §  EE authorization has no rule based authorization, only role based §  3rd party security frameworks provide rule, role and permission based APIs API for Authorization Interceptors
  • 73. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.73 Ideas – EL Authorization Rules §  Expression Language rule would have access to managed beans for SecurityContext and InvocationContext @ EvaluateSecured("security.hasRoles('MANAGER') && schedule.nowIsOfficeHrs") void transferFunds() {..};
  • 74. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.74 Ideas – EL Authorization Rules §  EL Authorization rules centrally managed in a repository @LdapAuthorizationRules ( name="java:app/accountAuthRules", ldapUrl="ldap://blah", ldapUser="ElDap", ldapPassword=“mysecret” ) public class MyBean { @ EvaluateSecured( ruleSourceName="java:app/accountAuthRules", rule="transferFunds") void transferFunds() {..}; … }
  • 75. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.75 Ideas – AccessDecisionVoter §  A user-defined class for making access decisions @Secured(AccountAccessDecisionVoter.class) void transferFunds() {..};
  • 76. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.76 Ideas – AccessDecisionVoter public class AccountAccessDecisionVoter implements AccessDecisionVoter { @Override public void checkPermission(AccessDecisionVoterContext ctx, Set<SecurityViolation> violations) { // Check for violations Method method = ctx.<InvocationContext>getSource().getMethod(); … violations.add(new SecurityViolation("Sorry, not allowed")); } }
  • 77. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.77 Agenda §  Motivations §  A New JSR §  Ideas §  Get Involved §  Q & A
  • 78. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.78 Get Involved §  Project Page: The starting point to all resources https://java.net/projects/javaee-security-spec §  Users List: Subscribe and contribute users@javaee-security-spec.java.net §  Github Playground: Fork and Play! https://github.com/javaee-security-spec/javaee-security-proposals
  • 79. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.79 Q/A
  • 80. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.80