SlideShare uma empresa Scribd logo
1 de 33
Octopus
Java EE Security Framework
Concepts
• Authentication
– validating the identity of a user
• Authorization
– whether a user is allowed to execute a certain
action
• Permission
• User/Principal
Security
• Standards
– Only role based
• Not good
– Documentation (which role is allowed to do
what)
– Change (redeployment because we changed
role assignments to method)
Permission based
• Each (group) action(s)
– Associated with a permission
• User need permission to execute it
• Very complex system
– User can be assigned to group
– Permissions are assigned to the group
Octopus
• Permission based
• Declarative
• Secures
– URL, JSF Components, CDI, EJB
• CDI integrated
Configuration
• Jar File (maven artifact)
– <dependency>
<groupId>be.c4j.ee.security</groupId>
<artifactId>octopus</artifactId>
<version>0.9.3</version>
</dependency>
• octopusConfig.properties
• CDI bean implements SecurityDataProvider
• WEB-INF/securedURLs.ini
• ejb-jar.xml
octopusConfig.properties
• All configuration options of framework
• Required options have default values
• Empty file
– Only authentication for URL
SecurityDataProvider
• Supply authentication and authorization
information to Octopus
• AuthenticationInfo
getAuthenticationInfo(UsernamePasswordToken token);
• AuthorizationInfo
getAuthorizationInfo(PrincipalCollection principals);
login.xhtml
• No requirements imposed by Octopus
• Fields
– #{loginBean.username}
– #{loginBean.password}
– #{loginBean.doLogin}
• actionListener for the login
• Std JSF messages in case of errors
getAuthenticationInfo()
• token.getUsername()
– User name entered in login screen
• Return null if user name is not known
• AuthenticationInfoBuilder
– For easier instantiation of method result
AuthenticationInfoBuilder
• principalId(Serializable)
– Unique identification of user, used in authorization call
• name(String)
– Display name for user
• password(Object)
– Password for user
• salt(ByteSource)
– For salted hashed passwords
• addUserInfo
– Additional info usefull for custom permission checks
getAuthorizationInfo()
• principals.getPrimaryPrincipal().getId()
– Id of user supplied during authentication
• AuthorizationInfoBuilder
• For easier instantiation of method result
AuthorizationInfoBuilder
• addPermission()
• addPermissions()
• Supply permissions for user
Named permission
• Based on Apache Shiro domain permission
• Domain permission
– Domain
• Functional area of your application
– Action
• Some action within the domain
– Target
• Restriction on what items action is allowed
• No interpretation, just strings
Domain permission
• Example
– Department:read:*
• * is wildcard
• Used in verifying if user has permission
– User is permitted to execute
Required permission User permission
Department:read:* Department:*:*
Domain permission(2)
• Multiple values allowed
– Department:read,update:*
Named permission ?
• Assign useful name to permission
• Named can be constant of Enum
• Configuration needed in octopusModule
Define named permission
• enum DemoPermission implements NamedPermission {
DEPARTMENT_READ, EMPLOYEE_READ_INFO //…
}
• namedPermission.class =
be.c4j.demo.security.permission.DemoPermission
Define named permission (2)
• @ApplicationScoped @Produces
public PermissionLookup<DemoPermission>
buildLookup() {
List<NamedDomainPermission> allPermissions =
permissionService.getAllPermissions();
return new PermissionLookup<DemoPermission>
(allPermissions, DemoPermission.class);
}
• Mapping between enum and domain
permisions.
Protect URL
• Specify which URL needs to be protected
• Define in securedURLs.ini
• /pages/** = user
• All pages within pages directory (and
subdirectories now requires authentication
Protect URL
• /pages/department/** = user, namedPermission[xxx]
• Pages requires authentication and the named
permission xxx
– xxx = value of enum class
• np instead of namedPermission also
allowed
Protect JSF component
• <sec:securedComponent
permission="DEPARTMENT_CREATE"/>
• Can be placed inside any JSF component
• Component only shown when user has
permission
Protect JSF component (2)
• <sec:requiresUser />
• Only authenticated persons see component
• Inverse of rule
• not=“true” attribute
– On securedComponent and requiresUser
Protect EJB method
• Annotation based
• @RequiresUser
• Custom annotation for named permissions
– @DemoPermissionCheck(DemoPermission.DEPARTMENT_CR
EATE
Custom annotation for security
• public @interface DemoPermissionCheck {
DemoPermission[] value();
}
• namedPermissionCheck.class =
be.c4j.demo.security.permission.DemoPermissionCheck
Custom voters
• extends AbstractGenericVoter
• checkPermission(InvocationContext
invocationContext, Set<SecurityViolation>
violations) {
• @Named
– Needed for securing JSF components
Custom voters (2)
• Set<SecurityViolation> parameter
– Put violations messages, empty means allowed
• this.userPrincipal
– Current user info
• this.newSecurityViolation(String)
– Create violation, for adding to the Set
Custom voters and URL
• /pages/updateSalary.xhtml = user,
voter[employeeSalaryUpdateVoter]
• this.hasServletRequestInfo(InvocationContext)
– Called from within URL context?
• this.getURLRequestParameter(InvocationContext, String)
– Get URL parameter
Custom voters and EJB methods
• this.checkMethodHasParameterTypes(Set<SecurityViolati
on>, InvocationContext, Class<?>…)
– Check if method has correct type of parameters
– If not, additional entry in Set
• this.verifyMethodHasParameterTypes(InvocationContext,
Class<?>…)
– As above, but return boolean
– When multiple methods with different
parameter types are supported
• this.getAssignableParameter(InvocationContext,
Class<T>[, int])
– Get parameter value of method call
– Optional position can be used if multiple
parameters has same type (0-based)
Using custom voters on EJB
• @CustomVoterCheck(EmployeeSalaryUpdateVoter.class)
Custom voters on JSF component
• <sec:securedComponent
voter="employeeSalaryUpdateVoter" >
• Voter is the @named CDI bean
Custom voters on JSF component
• Dynamic parameters
• <sec:securedComponent voter="employeeSalaryUpdateVoter" >
<sec:securedComponentParameter
value="#{employeeBean.employee.id}" />
</sec:securedComponent>
</sec:securedComponent>
• #{employeeBean.employee.id}
– Becomes the single parameters which can be retrieved
by getAssignableParameter()

Mais conteúdo relacionado

Mais procurados

Java Web Application Security with Java EE, Spring Security and Apache Shiro ...
Java Web Application Security with Java EE, Spring Security and Apache Shiro ...Java Web Application Security with Java EE, Spring Security and Apache Shiro ...
Java Web Application Security with Java EE, Spring Security and Apache Shiro ...Matt Raible
 
Spring Framework - Spring Security
Spring Framework - Spring SecuritySpring Framework - Spring Security
Spring Framework - Spring SecurityDzmitry Naskou
 
Deep dive into Java security architecture
Deep dive into Java security architectureDeep dive into Java security architecture
Deep dive into Java security architecturePrabath Siriwardena
 
ApacheCon 2014: Infinite Session Clustering with Apache Shiro & Cassandra
ApacheCon 2014: Infinite Session Clustering with Apache Shiro & CassandraApacheCon 2014: Infinite Session Clustering with Apache Shiro & Cassandra
ApacheCon 2014: Infinite Session Clustering with Apache Shiro & CassandraDataStax Academy
 
Super simple application security with Apache Shiro
Super simple application security with Apache ShiroSuper simple application security with Apache Shiro
Super simple application security with Apache ShiroMarakana Inc.
 
Building Layers of Defense with Spring Security
Building Layers of Defense with Spring SecurityBuilding Layers of Defense with Spring Security
Building Layers of Defense with Spring SecurityJoris Kuipers
 
Learn Apache Shiro
Learn Apache ShiroLearn Apache Shiro
Learn Apache ShiroSmita Prasad
 
From 0 to Spring Security 4.0
From 0 to Spring Security 4.0From 0 to Spring Security 4.0
From 0 to Spring Security 4.0robwinch
 
Access Control Pitfalls v2
Access Control Pitfalls v2Access Control Pitfalls v2
Access Control Pitfalls v2Jim Manico
 
Fun With Spring Security
Fun With Spring SecurityFun With Spring Security
Fun With Spring SecurityBurt Beckwith
 
Spring Security
Spring SecuritySpring Security
Spring SecurityBoy Tech
 
Enterprise Security mit Spring Security
Enterprise Security mit Spring SecurityEnterprise Security mit Spring Security
Enterprise Security mit Spring SecurityMike Wiesner
 
Spring Security
Spring SecuritySpring Security
Spring SecuritySumit Gole
 
Token Authentication in ASP.NET Core
Token Authentication in ASP.NET CoreToken Authentication in ASP.NET Core
Token Authentication in ASP.NET CoreStormpath
 
Build A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIBuild A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIStormpath
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Jim Manico
 
Java Web Application Security - Utah JUG 2011
Java Web Application Security - Utah JUG 2011Java Web Application Security - Utah JUG 2011
Java Web Application Security - Utah JUG 2011Matt Raible
 

Mais procurados (20)

Spring Security 3
Spring Security 3Spring Security 3
Spring Security 3
 
Java Web Application Security with Java EE, Spring Security and Apache Shiro ...
Java Web Application Security with Java EE, Spring Security and Apache Shiro ...Java Web Application Security with Java EE, Spring Security and Apache Shiro ...
Java Web Application Security with Java EE, Spring Security and Apache Shiro ...
 
Spring Framework - Spring Security
Spring Framework - Spring SecuritySpring Framework - Spring Security
Spring Framework - Spring Security
 
Deep dive into Java security architecture
Deep dive into Java security architectureDeep dive into Java security architecture
Deep dive into Java security architecture
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
ApacheCon 2014: Infinite Session Clustering with Apache Shiro & Cassandra
ApacheCon 2014: Infinite Session Clustering with Apache Shiro & CassandraApacheCon 2014: Infinite Session Clustering with Apache Shiro & Cassandra
ApacheCon 2014: Infinite Session Clustering with Apache Shiro & Cassandra
 
Super simple application security with Apache Shiro
Super simple application security with Apache ShiroSuper simple application security with Apache Shiro
Super simple application security with Apache Shiro
 
Building Layers of Defense with Spring Security
Building Layers of Defense with Spring SecurityBuilding Layers of Defense with Spring Security
Building Layers of Defense with Spring Security
 
Learn Apache Shiro
Learn Apache ShiroLearn Apache Shiro
Learn Apache Shiro
 
From 0 to Spring Security 4.0
From 0 to Spring Security 4.0From 0 to Spring Security 4.0
From 0 to Spring Security 4.0
 
Access Control Pitfalls v2
Access Control Pitfalls v2Access Control Pitfalls v2
Access Control Pitfalls v2
 
Fun With Spring Security
Fun With Spring SecurityFun With Spring Security
Fun With Spring Security
 
Spring Security
Spring SecuritySpring Security
Spring Security
 
Intro to Apache Shiro
Intro to Apache ShiroIntro to Apache Shiro
Intro to Apache Shiro
 
Enterprise Security mit Spring Security
Enterprise Security mit Spring SecurityEnterprise Security mit Spring Security
Enterprise Security mit Spring Security
 
Spring Security
Spring SecuritySpring Security
Spring Security
 
Token Authentication in ASP.NET Core
Token Authentication in ASP.NET CoreToken Authentication in ASP.NET Core
Token Authentication in ASP.NET Core
 
Build A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIBuild A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON API
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2
 
Java Web Application Security - Utah JUG 2011
Java Web Application Security - Utah JUG 2011Java Web Application Security - Utah JUG 2011
Java Web Application Security - Utah JUG 2011
 

Semelhante a Octopus framework; Permission based security framework for Java EE

IBM Spectrum Scale Authentication For Object - Deep Dive
IBM Spectrum Scale Authentication For Object - Deep Dive IBM Spectrum Scale Authentication For Object - Deep Dive
IBM Spectrum Scale Authentication For Object - Deep Dive Smita Raut
 
Advance java session 19
Advance java session 19Advance java session 19
Advance java session 19Smita B Kumar
 
ASP.NET MVC 2.0
ASP.NET MVC 2.0ASP.NET MVC 2.0
ASP.NET MVC 2.0Buu Nguyen
 
Building Secure OSGi Applications
Building Secure OSGi ApplicationsBuilding Secure OSGi Applications
Building Secure OSGi ApplicationsMarcel Offermans
 
Implementing application security using the .net framework
Implementing application security using the .net frameworkImplementing application security using the .net framework
Implementing application security using the .net frameworkLalit Kale
 
[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능
[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능
[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능Hyperledger Korea User Group
 
Cache Security- Configuring a Secure Environment
Cache Security- Configuring a Secure EnvironmentCache Security- Configuring a Secure Environment
Cache Security- Configuring a Secure EnvironmentInterSystems Corporation
 
Simple blog wall creation on Java
Simple blog wall creation on JavaSimple blog wall creation on Java
Simple blog wall creation on JavaMax Titov
 
Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - uploadBin Yang
 
SQL: Permissions and Data Protection
SQL: Permissions and Data ProtectionSQL: Permissions and Data Protection
SQL: Permissions and Data ProtectionLearnNowOnline
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApiRaffaele Rialdi
 
Securing Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPSecuring Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPRafal Gancarz
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?Dmitry Buzdin
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC DeploymentsSujit Kumar
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2Rodrigo Cândido da Silva
 
Secure Search - Using Apache Sentry to Add Authentication and Authorization S...
Secure Search - Using Apache Sentry to Add Authentication and Authorization S...Secure Search - Using Apache Sentry to Add Authentication and Authorization S...
Secure Search - Using Apache Sentry to Add Authentication and Authorization S...Lucidworks
 
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsFelipe Prado
 

Semelhante a Octopus framework; Permission based security framework for Java EE (20)

Cache Security- The Basics
Cache Security- The BasicsCache Security- The Basics
Cache Security- The Basics
 
IBM Spectrum Scale Authentication For Object - Deep Dive
IBM Spectrum Scale Authentication For Object - Deep Dive IBM Spectrum Scale Authentication For Object - Deep Dive
IBM Spectrum Scale Authentication For Object - Deep Dive
 
Advance java session 19
Advance java session 19Advance java session 19
Advance java session 19
 
Rails Security
Rails SecurityRails Security
Rails Security
 
ASP.NET MVC 2.0
ASP.NET MVC 2.0ASP.NET MVC 2.0
ASP.NET MVC 2.0
 
Building Secure OSGi Applications
Building Secure OSGi ApplicationsBuilding Secure OSGi Applications
Building Secure OSGi Applications
 
Implementing application security using the .net framework
Implementing application security using the .net frameworkImplementing application security using the .net framework
Implementing application security using the .net framework
 
[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능
[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능
[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능
 
Cache Security- Configuring a Secure Environment
Cache Security- Configuring a Secure EnvironmentCache Security- Configuring a Secure Environment
Cache Security- Configuring a Secure Environment
 
Simple blog wall creation on Java
Simple blog wall creation on JavaSimple blog wall creation on Java
Simple blog wall creation on Java
 
Secure all things with CBSecurity 3
Secure all things with CBSecurity 3Secure all things with CBSecurity 3
Secure all things with CBSecurity 3
 
Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - upload
 
SQL: Permissions and Data Protection
SQL: Permissions and Data ProtectionSQL: Permissions and Data Protection
SQL: Permissions and Data Protection
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApi
 
Securing Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPSecuring Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTP
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2
 
Secure Search - Using Apache Sentry to Add Authentication and Authorization S...
Secure Search - Using Apache Sentry to Add Authentication and Authorization S...Secure Search - Using Apache Sentry to Add Authentication and Authorization S...
Secure Search - Using Apache Sentry to Add Authentication and Authorization S...
 
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
 

Mais de Rudy De Busscher

jakarta-integration-testing.pdf
jakarta-integration-testing.pdfjakarta-integration-testing.pdf
jakarta-integration-testing.pdfRudy De Busscher
 
core-profile_jakartaOne2022.pdf
core-profile_jakartaOne2022.pdfcore-profile_jakartaOne2022.pdf
core-profile_jakartaOne2022.pdfRudy De Busscher
 
MicroStream-WithoutDatabase.pdf
MicroStream-WithoutDatabase.pdfMicroStream-WithoutDatabase.pdf
MicroStream-WithoutDatabase.pdfRudy De Busscher
 
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application StartupHow Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application StartupRudy De Busscher
 
Creating a Kubernetes Operator in Java
Creating a Kubernetes Operator in JavaCreating a Kubernetes Operator in Java
Creating a Kubernetes Operator in JavaRudy De Busscher
 
Finally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersFinally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersRudy De Busscher
 
Control and monitor_microservices_with_microprofile
Control and monitor_microservices_with_microprofileControl and monitor_microservices_with_microprofile
Control and monitor_microservices_with_microprofileRudy De Busscher
 
Transactions in micro-services (fall 2019)
Transactions in micro-services (fall 2019)Transactions in micro-services (fall 2019)
Transactions in micro-services (fall 2019)Rudy De Busscher
 
Transactions in micro-services (summer 2019)
Transactions in micro-services (summer 2019)Transactions in micro-services (summer 2019)
Transactions in micro-services (summer 2019)Rudy De Busscher
 
Monitor Micro-service with MicroProfile metrics
Monitor Micro-service with MicroProfile metricsMonitor Micro-service with MicroProfile metrics
Monitor Micro-service with MicroProfile metricsRudy De Busscher
 
Gradual migration to MicroProfile
Gradual migration to MicroProfileGradual migration to MicroProfile
Gradual migration to MicroProfileRudy De Busscher
 
From Monolith to micro-services and back : The Self Contained Systems
From Monolith to micro-services and back : The Self Contained SystemsFrom Monolith to micro-services and back : The Self Contained Systems
From Monolith to micro-services and back : The Self Contained SystemsRudy De Busscher
 

Mais de Rudy De Busscher (14)

jakarta-integration-testing.pdf
jakarta-integration-testing.pdfjakarta-integration-testing.pdf
jakarta-integration-testing.pdf
 
core-profile_jakartaOne2022.pdf
core-profile_jakartaOne2022.pdfcore-profile_jakartaOne2022.pdf
core-profile_jakartaOne2022.pdf
 
MicroStream-WithoutDatabase.pdf
MicroStream-WithoutDatabase.pdfMicroStream-WithoutDatabase.pdf
MicroStream-WithoutDatabase.pdf
 
Jakarta EE 8 on JDK17
Jakarta EE 8 on JDK17Jakarta EE 8 on JDK17
Jakarta EE 8 on JDK17
 
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application StartupHow Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
 
Creating a Kubernetes Operator in Java
Creating a Kubernetes Operator in JavaCreating a Kubernetes Operator in Java
Creating a Kubernetes Operator in Java
 
Finally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersFinally, easy integration testing with Testcontainers
Finally, easy integration testing with Testcontainers
 
Control and monitor_microservices_with_microprofile
Control and monitor_microservices_with_microprofileControl and monitor_microservices_with_microprofile
Control and monitor_microservices_with_microprofile
 
Transactions in micro-services (fall 2019)
Transactions in micro-services (fall 2019)Transactions in micro-services (fall 2019)
Transactions in micro-services (fall 2019)
 
Transactions in micro-services (summer 2019)
Transactions in micro-services (summer 2019)Transactions in micro-services (summer 2019)
Transactions in micro-services (summer 2019)
 
Monitor Micro-service with MicroProfile metrics
Monitor Micro-service with MicroProfile metricsMonitor Micro-service with MicroProfile metrics
Monitor Micro-service with MicroProfile metrics
 
Gradual migration to MicroProfile
Gradual migration to MicroProfileGradual migration to MicroProfile
Gradual migration to MicroProfile
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RS
 
From Monolith to micro-services and back : The Self Contained Systems
From Monolith to micro-services and back : The Self Contained SystemsFrom Monolith to micro-services and back : The Self Contained Systems
From Monolith to micro-services and back : The Self Contained Systems
 

Último

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Último (20)

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

Octopus framework; Permission based security framework for Java EE

  • 2. Concepts • Authentication – validating the identity of a user • Authorization – whether a user is allowed to execute a certain action • Permission • User/Principal
  • 3. Security • Standards – Only role based • Not good – Documentation (which role is allowed to do what) – Change (redeployment because we changed role assignments to method)
  • 4. Permission based • Each (group) action(s) – Associated with a permission • User need permission to execute it • Very complex system – User can be assigned to group – Permissions are assigned to the group
  • 5. Octopus • Permission based • Declarative • Secures – URL, JSF Components, CDI, EJB • CDI integrated
  • 6. Configuration • Jar File (maven artifact) – <dependency> <groupId>be.c4j.ee.security</groupId> <artifactId>octopus</artifactId> <version>0.9.3</version> </dependency> • octopusConfig.properties • CDI bean implements SecurityDataProvider • WEB-INF/securedURLs.ini • ejb-jar.xml
  • 7. octopusConfig.properties • All configuration options of framework • Required options have default values • Empty file – Only authentication for URL
  • 8. SecurityDataProvider • Supply authentication and authorization information to Octopus • AuthenticationInfo getAuthenticationInfo(UsernamePasswordToken token); • AuthorizationInfo getAuthorizationInfo(PrincipalCollection principals);
  • 9. login.xhtml • No requirements imposed by Octopus • Fields – #{loginBean.username} – #{loginBean.password} – #{loginBean.doLogin} • actionListener for the login • Std JSF messages in case of errors
  • 10. getAuthenticationInfo() • token.getUsername() – User name entered in login screen • Return null if user name is not known • AuthenticationInfoBuilder – For easier instantiation of method result
  • 11. AuthenticationInfoBuilder • principalId(Serializable) – Unique identification of user, used in authorization call • name(String) – Display name for user • password(Object) – Password for user • salt(ByteSource) – For salted hashed passwords • addUserInfo – Additional info usefull for custom permission checks
  • 12. getAuthorizationInfo() • principals.getPrimaryPrincipal().getId() – Id of user supplied during authentication • AuthorizationInfoBuilder • For easier instantiation of method result
  • 14. Named permission • Based on Apache Shiro domain permission • Domain permission – Domain • Functional area of your application – Action • Some action within the domain – Target • Restriction on what items action is allowed • No interpretation, just strings
  • 15. Domain permission • Example – Department:read:* • * is wildcard • Used in verifying if user has permission – User is permitted to execute Required permission User permission Department:read:* Department:*:*
  • 16. Domain permission(2) • Multiple values allowed – Department:read,update:*
  • 17. Named permission ? • Assign useful name to permission • Named can be constant of Enum • Configuration needed in octopusModule
  • 18. Define named permission • enum DemoPermission implements NamedPermission { DEPARTMENT_READ, EMPLOYEE_READ_INFO //… } • namedPermission.class = be.c4j.demo.security.permission.DemoPermission
  • 19. Define named permission (2) • @ApplicationScoped @Produces public PermissionLookup<DemoPermission> buildLookup() { List<NamedDomainPermission> allPermissions = permissionService.getAllPermissions(); return new PermissionLookup<DemoPermission> (allPermissions, DemoPermission.class); } • Mapping between enum and domain permisions.
  • 20. Protect URL • Specify which URL needs to be protected • Define in securedURLs.ini • /pages/** = user • All pages within pages directory (and subdirectories now requires authentication
  • 21. Protect URL • /pages/department/** = user, namedPermission[xxx] • Pages requires authentication and the named permission xxx – xxx = value of enum class • np instead of namedPermission also allowed
  • 22. Protect JSF component • <sec:securedComponent permission="DEPARTMENT_CREATE"/> • Can be placed inside any JSF component • Component only shown when user has permission
  • 23. Protect JSF component (2) • <sec:requiresUser /> • Only authenticated persons see component • Inverse of rule • not=“true” attribute – On securedComponent and requiresUser
  • 24. Protect EJB method • Annotation based • @RequiresUser • Custom annotation for named permissions – @DemoPermissionCheck(DemoPermission.DEPARTMENT_CR EATE
  • 25. Custom annotation for security • public @interface DemoPermissionCheck { DemoPermission[] value(); } • namedPermissionCheck.class = be.c4j.demo.security.permission.DemoPermissionCheck
  • 26. Custom voters • extends AbstractGenericVoter • checkPermission(InvocationContext invocationContext, Set<SecurityViolation> violations) { • @Named – Needed for securing JSF components
  • 27. Custom voters (2) • Set<SecurityViolation> parameter – Put violations messages, empty means allowed • this.userPrincipal – Current user info • this.newSecurityViolation(String) – Create violation, for adding to the Set
  • 28. Custom voters and URL • /pages/updateSalary.xhtml = user, voter[employeeSalaryUpdateVoter] • this.hasServletRequestInfo(InvocationContext) – Called from within URL context? • this.getURLRequestParameter(InvocationContext, String) – Get URL parameter
  • 29. Custom voters and EJB methods • this.checkMethodHasParameterTypes(Set<SecurityViolati on>, InvocationContext, Class<?>…) – Check if method has correct type of parameters – If not, additional entry in Set • this.verifyMethodHasParameterTypes(InvocationContext, Class<?>…) – As above, but return boolean – When multiple methods with different parameter types are supported
  • 30. • this.getAssignableParameter(InvocationContext, Class<T>[, int]) – Get parameter value of method call – Optional position can be used if multiple parameters has same type (0-based)
  • 31. Using custom voters on EJB • @CustomVoterCheck(EmployeeSalaryUpdateVoter.class)
  • 32. Custom voters on JSF component • <sec:securedComponent voter="employeeSalaryUpdateVoter" > • Voter is the @named CDI bean
  • 33. Custom voters on JSF component • Dynamic parameters • <sec:securedComponent voter="employeeSalaryUpdateVoter" > <sec:securedComponentParameter value="#{employeeBean.employee.id}" /> </sec:securedComponent> </sec:securedComponent> • #{employeeBean.employee.id} – Becomes the single parameters which can be retrieved by getAssignableParameter()