SlideShare a Scribd company logo
Model-based Analysis of
Java EE Web Security
Configurations
Salvador Martínez - AtlanMod team, Mines Nantes & Inria & Lina
Valerio Cosentino - AtlanMod team, Mines Nantes & Inria & Lina
Jordi Cabot - SOM Research Lab, ICREA-UOC
Java EE WEB
Applications:
● Widespread means to provide
distributed information and
services to clients.
● Work over Untrusted Networks.
● Unauthorized disclosures and
manipulation of data may cause
important losses
● Confidentiality and Integrity are
strong requirements.
Access-control to the rescue
<security-constraint>
<display-name>
GET To Employees
</display-name>
<web-resource-collection>
<web-resource-name>
Restricted
</web-resource-name>
<url-pattern>
/restricted/employee/*
</url-pattern>
<http-method>GET</http-
method>
</web-resource-collection>
<auth-constraint>
<role-name>Employee</role-
name>
</auth-constraint>
</security-constraint>
$@WebServlet(name = "RestrictedServlet",
urlPatterns ={"/restricted/employee/*"})
$@ServletSecurity((httpMethodConstraints = {
$@HttpMethodConstraint(
value = "GET",
rolesAllowed = "Employee")
$transportGuarantee =
TransportGuarantee.None)})
public class RestrictedServlet extends HttpServlet {...}
Java EE declarative access-control mechanisms for WEB Applications:
PROBLEM? Low level technologies.
Dispersion of the policy.
Difficult to understand (implicit
combination rules)
OWASP: Security
Misconfigurations - 5th more
dangerous security error in Web
applications
OWASP Top 10 2013-A5-Security Misconfiguration
Threat Agents Attack Vectors Security Weakness Technical Impacts Business Impacts
Application
Specific
Exploitability
EASY
Prevalence
COMMON
Detectability
EASY
Impact
MODERATE
Application /
Business Specific
Consider
anonymous
external attackers
as well as users
with their own
accounts that may
attempt to
compromise the
system. Also
consider insiders
wanting to disguise
their actions.
Attacker accesses
default accounts,
unused pages,
unpatched flaws,
unprotected files
and directories, etc.
to gain unauthorized
access to or
knowledge of the
system.
Security misconfiguration can happen at any level of
an application stack, including the platform, web
server, application server, database, framework, and
custom code. Developers and system administrators
need to work together to ensure that the entire stack is
configured properly. Automated scanners are useful
for detecting missing patches, misconfigurations, use
of default accounts, unnecessary services, etc.
The system could be
completely compromised
without you knowing it.
All of your data could be
stolen or modified slowly
over time.
Recovery costs could be
expensive
The system could be
completely
compromised without
you knowing it. All your
data could be stolen or
modified slowly over
time.
Recovery costs could
be expensive.
What do Java EE Web developers think?
Q: Do you normally define Access-control Policies
Q: How critical are security aspects?
Q: How difficult is the definition of AC policies?
Q: Would you find useful a tool for detecting
security problems?
Overview: General Approach For Solution
Representation:
-Text Files
-Annotations
…
Target?
- To modelware!
- STEPS?
Original
configuration
Policy
extraction
Policy
integration
Analysis
Integration:
-Higher-level
-Integrated
-Contains all the
relevant info.
Analysis
-Anomalies
-Visualizations
-Metrics
-Translations…
Global Approach
Original
configuration Policy
extraction
Policy
integration
Analysis
Global Approach: Extraction
Java Annotations Metamodel XML Metamodel
Global Approach: Integration - Servlet
Security Metamodel
Global Approach: Analysis
Evaluation of SECURITY PROPERTIES
as OCL Constraints:
- Completeness
- Redundancy
- Shadowing
- Syntactical
- Reachability
Completeness property
The 10 Most Important Security
Controls Missing in JavaEE:
5. Security Misconfiguration – beware the <http-method>
tag in a <security-constraint>. This indicates that the
security-constraint only applies to the listed methods,
allowing attackers to use other HTTP methods, like HEAD
and PUT, to bypass the entire security constraint.
<security-constraint>
<display-name>
GET To Employees
</display-name>
<web-resource-collection>
<url-pattern>
/restricted/employee/*
</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>Employee</role-name>
</auth-constraint>
</security-constraint>
Restricts GET
HTTP_Method
All other
Http_methods get
free access!
Redundancy Property
<security-constraint>
<web-resource-collection>
<url-pattern>/restricted/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Employee</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<url-pattern>/restricted/employee/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Employee</role-name>
</auth-constraint>
</security-constraint>
Both constraints Permits
access only to the employee
Role.
/restricted/employee/* is
included in /restricted/*
The second constraint can be
removed from the policy
definition without modifying
the effective policy.
Shadowing Property
<security-constraint>
<web-resource-collection>
<url-pattern>/restricted/employee/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Employee</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<url-pattern>/restricted/employee/*</url-pattern>
</web-resource-collection>
</auth-constraint>
</security-constraint>
Both rules constrain the
access to:
/restricted/employee/*
An empty auth_constraint
precludes all access. It also
gives higher precedence to
the rule, so that the effects of
the first rule are overrided.
Syntactical Property
<security-constraint>
<web-resource-collection>
<url-pattern>/restricted/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Employee</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<url-pattern>/restricted/employee/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>
The role Employee has not
been declared in the policy.
The policy works but relies in
implicit mappings
'*', when used in a security
constraint maps to the list of
all declared roles. Therefore,
using '*' without explicitly
declared roles will preclude
the access to the resource.
Reacheability Property
</security-constraint>
<security-constraint>
<web-resource-collection>
<url-pattern>/restricted/employee/*</url-pattern>
</web-resource-collection>
</auth-constraint>
</security-constraint>
An empty auth_constraint
precludes all access.
However, all paths named in
a web security policy should
allow at least one role to
access them.
Property evaluation: OCL Invariant (only for OCL Hardcore fans) that evaluates the
property using a standard OCL interpreter
let HTTP_METHODS : Sequence(OclAny) = Sequence{'OPTIONS','GET','HEAD','POST','PUT','DELETE','TRACE','CONNECT'} in
let ALL_HTTP_METHODS : Sequence(PSM!HttpMethod) = PSM!HttpMethod.allInstances() in
let httpMethodsToCheck : Sequence(String) =
if self.omission then
HTTP_METHODS->select(m | m = self.name)
else
HTTP_METHODS->reject(m | m = self.name)
endif
in
let selfUrlPatterns : Sequence(PSM!UrlPattern) = self.refImmediateComposite().urlPattern in
selfUrlPatterns->iterate(sup; output : Boolean = true |
let declaredHttpMethods : Sequence(PSM!HttpMethod) = ALL_HTTP_METHODS->reject(hm | hm = self)
->select(hm | hm.refImmediateComposite().urlPattern->exists(up | sup.value = up.value)) in
if declaredHttpMethods->isEmpty() then
false
else
output and httpMethodsToCheck->forAll(m | declaredHttpMethods->exists(dhm | dhm.name = m))
endif
Report Model and Error Fixing
Reuse of our OCL security properties in
the context of model transformations:
- To produce anomaly reports
- To generate quick-fixes
- Traceability
Report Model and Error Fixing
helper context PSM!HttpMethod def : quickFix(source :
String) : String =
let unnamedMethods : Sequence(String) =
s.getUncompleteMethodsNames() in
if source = 'XML' then return
'<security-constraint>
<web-resource-collection>
<url-pattern>' + self.getUrlPattern() +
'<url-pattern>
<http-method>' + unnamedMethods +
'</http-method>
</web-resource-collection>
</auth-constraint>
<security-constraint>'
else return '@HttpMethodConstraint(value="'+
unnamedMethods +
'", emptyRoleSemantic = EmptyRoleSemantic.DENY))'
endif;
create OUT : Anomalies from IN : PSM;
helper def : HTTP_METHODS : Sequence(OclAny) = ...
helper def : ALL_HTTP_METHODS :Sequence(PSM!HttpMethod)
= ...
helper context PSM!HttpMethod def : isComplete :
Boolean = ...
rule HttpMethod2Completeness {
from s: PSM!HttpMethod (not s.isComplete)
to t: Anomalies!UnprotectedMethod (
description <- s.getUncompleteMethodsNames(),
t.trace <- Sequence{s};)
}
Quick-fix generation Report Model Element Creation
Analysis: Other Applications
query reachableResources =
PSM!SecurityConstraint.allInstances()
->select(sc|sc.authConstraint.oclIsUndefined())
->collect(sc|sc.webResourceCollection)
->collect(wrc|wrc.urlPattern)
->collect(up|up.value)->asSet()->size();
Metric: Open Access-resourcesPolicy Visualization
Analysis: Other Applications
InteroperabilityForward engineering
- Application re-generation
- Integration Test Generation
- Code Styles
+
- Translations towards other representations:
SecureUML
Evaluation
R.Q.1. Do the properties we have provided occur in existing
Java EE projects?
R.Q.2. Is our approach capable of automatically evaluate
these properties over existing projects in a correct and
efficient manner?
Evaluation: methodology
We sampled gitHub and obtained 60
non-trivial Java EE projects.
We analyzed them automatically
with our tool.
Finally, we manually analyze a
subset of the sample, looking for
false positives or negatives.
Evaluation: R.Q.1.
70% of projects present at least one anomaly
No project is affected by shadowing
Reachability problems are found in many projects due to Google container
semantics.
R.Q.1. Answer: We did find a relevant number of projects containing security
configurations anomalies.
Evaluation: R.Q.2.
We selected 20 projects out of the original sample of 60 and we analyzed
them by hand.
We did not find false negatives nor false positives.
The evaluation time per project ranges between 0.06 and 0.2 seconds
R.Q.2. Answer: Our approach does accurately detect security anomalies in
an efficient way.
Tool Support
Tool available in GitHub:
https://github.com/atlanmod/web-
application-security
We have used MoDisco for the
injection of models from the
original configuration.
ATL has been used to implement
OCL properties, report generation
and quick-fixes.
Future Work
Programmatic Security Constraints
Other sources of information: Database back-ends, logs, etc.
More complex Frameworks: Spring?

More Related Content

PPTX
Rule-Based Access-Control Evaluation through Model-Transformation
PDF
Effective Unit Test Style Guide
PDF
yagdao-0.3.1 hibernate guide
PDF
yagdao-0.3.1 JPA guide
PPTX
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
PPTX
OCL tutorial
PPTX
Introducing Eclipse MoDisco
PPTX
Wanna see your open source project succeed? - Nurture your community
Rule-Based Access-Control Evaluation through Model-Transformation
Effective Unit Test Style Guide
yagdao-0.3.1 hibernate guide
yagdao-0.3.1 JPA guide
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
OCL tutorial
Introducing Eclipse MoDisco
Wanna see your open source project succeed? - Nurture your community

Viewers also liked (20)

PDF
Mogwaï: a Framework to Handle Complex Queries on Large Models
PPTX
Our research lines on Model-Driven Engineering and Software Engineering
PPTX
Findings from GitHub. Methods, Datasets and Limitations - MSR 2016 at ICSE
PPTX
MetaScience: Holistic Approach for Research Modeling and Analysis
PDF
Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...
PPTX
Looking at WordPress through the eyes of a Software Researcher
PPTX
Governance Rules for Open Source Software Systems
PDF
PrefetchML: a Framework for Prefetching and Caching models
PDF
ATL tutorial - EclipseCon 2008
PPTX
Improving Software Languages: usage patterns to the rescue
PDF
Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...
PDF
Introduction to PicketLink
PPT
MoDisco & ATL - Eclipse DemoCamp Indigo 2011 in Nantes
PDF
EMF Compare 2.0: Scaling to Millions (updated)
PDF
MoDisco EclipseCon2010
PDF
fREX: fUML-based Reverse Engineering of Executable Behavior for Software Dyna...
PDF
Textual Modeling Framework Xtext
PDF
Acceleo Code Generation
PDF
Certificate Pinning in Mobile Applications
PDF
You need to extend your models? EMF Facet vs. EMF Profiles
Mogwaï: a Framework to Handle Complex Queries on Large Models
Our research lines on Model-Driven Engineering and Software Engineering
Findings from GitHub. Methods, Datasets and Limitations - MSR 2016 at ICSE
MetaScience: Holistic Approach for Research Modeling and Analysis
Eclipse Modeling & MoDisco - An Introduction to Modeling and (Model Driven) R...
Looking at WordPress through the eyes of a Software Researcher
Governance Rules for Open Source Software Systems
PrefetchML: a Framework for Prefetching and Caching models
ATL tutorial - EclipseCon 2008
Improving Software Languages: usage patterns to the rescue
Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...
Introduction to PicketLink
MoDisco & ATL - Eclipse DemoCamp Indigo 2011 in Nantes
EMF Compare 2.0: Scaling to Millions (updated)
MoDisco EclipseCon2010
fREX: fUML-based Reverse Engineering of Executable Behavior for Software Dyna...
Textual Modeling Framework Xtext
Acceleo Code Generation
Certificate Pinning in Mobile Applications
You need to extend your models? EMF Facet vs. EMF Profiles
Ad

Similar to Model-based Analysis of Java EE Web Security Configurations - Mise 2016 (20)

PPTX
Don't get stung - an introduction to the OWASP Top 10
PDF
4 andrii kudiurov - web application security 101
PDF
Everything you do is wrong
PPT
Security patterns and model driven architecture
PDF
Java online training, java training in bangalore, java training
PDF
Introduction to AngularJS
PDF
Web Development Security
PPTX
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
PDF
7.Trust Management
PPTX
RSA Conference 2010 San Francisco
PPTX
Stored procedures by thanveer danish melayi
PPTX
Thinking Beyond ORM in JPA
PPTX
Security: Odoo Code Hardening
PPTX
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
PPTX
MVC & SQL_In_1_Hour
ODP
Pyramid patterns
PPTX
LRT MoodleMootUK11 Unconf Presentation
PDF
Java Web Application Security with Java EE, Spring Security and Apache Shiro ...
PDF
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
PPTX
Walking Through Cloud Serving at Yahoo!
Don't get stung - an introduction to the OWASP Top 10
4 andrii kudiurov - web application security 101
Everything you do is wrong
Security patterns and model driven architecture
Java online training, java training in bangalore, java training
Introduction to AngularJS
Web Development Security
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
7.Trust Management
RSA Conference 2010 San Francisco
Stored procedures by thanveer danish melayi
Thinking Beyond ORM in JPA
Security: Odoo Code Hardening
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
MVC & SQL_In_1_Hour
Pyramid patterns
LRT MoodleMootUK11 Unconf Presentation
Java Web Application Security with Java EE, Spring Security and Apache Shiro ...
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
Walking Through Cloud Serving at Yahoo!
Ad

More from Jordi Cabot (20)

PPTX
Who will create the languages of the future?
PPTX
Societal challenges of AI: biases, multilinguism and sustainability
PPTX
¿Cómo será el programador del futuro? ¿Tendremos trabajo?
PPTX
The low-code handbook - Chapter 1: Basic Low-code questions and answers.
PPTX
Who is going to develop the apps of the future? (hint: it’s not going to be ...
PPTX
Application of the Tree-of-Thoughts Framework to LLM-Enabled Domain Modeling
PPTX
AI and Software consultants: friends or foes?
PPTX
Model-driven engineering for Industrial IoT architectures
PPTX
Smart modeling of smart software
PPTX
Modeling should be an independent scientific discipline
PPTX
¿Quién va a desarrollar las Apps del futuro? (aviso: no serán los programador...
PPTX
How to sustain a tool building community-driven effort
PPTX
All Researchers Should Become Entrepreneurs
PPTX
The Software Challenges of Building Smart Chatbots - ICSE'21
PPTX
Low-code vs Model-Driven Engineering
PDF
Lessons learned from building a commercial bot development platform
PDF
Future Trends on Software and Systems Modeling
PPTX
Ingeniería del Software dirigida por modelos -Versión para incrédulos
PPTX
Chatbot Tutorial - Create your first bot with Xatkit
PPTX
Création facile de chatbots - Créez votre chatbot en 20 minutes avec une plat...
Who will create the languages of the future?
Societal challenges of AI: biases, multilinguism and sustainability
¿Cómo será el programador del futuro? ¿Tendremos trabajo?
The low-code handbook - Chapter 1: Basic Low-code questions and answers.
Who is going to develop the apps of the future? (hint: it’s not going to be ...
Application of the Tree-of-Thoughts Framework to LLM-Enabled Domain Modeling
AI and Software consultants: friends or foes?
Model-driven engineering for Industrial IoT architectures
Smart modeling of smart software
Modeling should be an independent scientific discipline
¿Quién va a desarrollar las Apps del futuro? (aviso: no serán los programador...
How to sustain a tool building community-driven effort
All Researchers Should Become Entrepreneurs
The Software Challenges of Building Smart Chatbots - ICSE'21
Low-code vs Model-Driven Engineering
Lessons learned from building a commercial bot development platform
Future Trends on Software and Systems Modeling
Ingeniería del Software dirigida por modelos -Versión para incrédulos
Chatbot Tutorial - Create your first bot with Xatkit
Création facile de chatbots - Créez votre chatbot en 20 minutes avec une plat...

Recently uploaded (20)

PPTX
Introduction to Artificial Intelligence
PPTX
Transform Your Business with a Software ERP System
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Essential Infomation Tech presentation.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Introduction to Artificial Intelligence
Transform Your Business with a Software ERP System
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Odoo Companies in India – Driving Business Transformation.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Softaken Excel to vCard Converter Software.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
How to Migrate SBCGlobal Email to Yahoo Easily
Design an Analysis of Algorithms II-SECS-1021-03
2025 Textile ERP Trends: SAP, Odoo & Oracle
Navsoft: AI-Powered Business Solutions & Custom Software Development
Essential Infomation Tech presentation.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PTS Company Brochure 2025 (1).pdf.......
L1 - Introduction to python Backend.pptx
Reimagine Home Health with the Power of Agentic AI​
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

Model-based Analysis of Java EE Web Security Configurations - Mise 2016

Editor's Notes

  • #6: Owasp es la organización esta que se dedica a hacer una lista de los 10 riesgos de seguridad mas graves en internet. Las versiones de 2011 y 2013 (la última) ponen misconfigurations en 5 lugar. La tabla es directamente una copia del informe OWASP i debe entenderse mas como una figura que como una tabla para leer.
  • #7: Aquí sólo pongo las que indican la relevancia de la seguridad. Las de las propiedades aparecen mas tarde cuando se explica la parte de OCL evaluation como apliación.
  • #8: El esquema general de siempre. En la siguiente se entra en detalles.
  • #10: Here just say: 1) It is just a mere technological space switch 2) There is no information loss. 3) we remain in the same abstraction level
  • #11: No hay mucho que contar aquí sin entrar a enseñar código. Yo creo que con decir cual es el objetivo y allanar el camino para mostrar el metamodelo, tenemos.
  • #12: This metamodel provides 1) integration, 2) linguistic unification 3) no information-loss 4) reusee of MDE tools and techniques
  • #13: A partir de aquí, comienzan las diferentes aplicaciones...
  • #14: Se mostrará luego la definición de cada propiedad. Sin detalles de implementación. Con saber que es OCL debería valer (se puede mostrar un trozo de código, pero es un tocho)
  • #15: Las otras propiedades vienen con su definición. Aquí he pensado que poner el link de DZone le da mas espectacularidad. Se puede poner como las otras en cualquier caso.
  • #21: No hay mucha chicha aqui. Decir que hay Repor Model con trazabilidad y ya. Las dos siguientes slides siguen este estilo.