A deep dive into SPRING security

Slides:



Advertisements
Similar presentations
Suchin Rengan Principal Technical Architect Salesforce.com
Advertisements

REST support for B2B access to your AppServer PUG Challenge Americas Michael Jacobs : Senior Software Architect Edsel Garcia : Principal Software.
FIspace Security Components FIspace Security Components NetFutures 2015 FIspace project Javier Romero Negrín Javier Hitado Simarro ATOS Serdar Arslan KoçSistem.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
® IBM Software Group © 2006 IBM Corporation Securing Your Application With WebSphere Security You will need to develop Login procedures for your web applications.
NMD202 Web Scripting Week5. What we will cover today PHPmyAdmin Debugging – using print_r Modifying Data PHP (cont.) 4D Methodology File and IO operations.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 5 Database Application Security Models.
WEB2P security Java web application security Dr Jim Briggs.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
Chapter 5 Database Application Security Models
Authenticating REST/Mobile clients using LDAP and OERealm
UNIT-V The MVC architecture and Struts Framework.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
TAM STE Series 2008 © 2008 IBM Corporation WebSEAL SSO, Session 108/2008 TAM STE Series WebSEAL SSO, Session 1 Presented by: Andrew Quap.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
DB-19: OpenEdge® Authentication Without the _User Table
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
MCSE Guide to Microsoft Exchange Server 2003 Administration Chapter Four Configuring Outlook and Outlook Web Access.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Finish configuration cloudclinica root jdbc:postgresql:5432//localhost/cc_db JDBC Url: JDBC Driver: User name: Password: ******** org.postgresql.Driver.
WaveMaker Visual AJAX Studio 4.0 Training Authentication.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
Launch ClinCapture root jdbc:postgresql:5432//localhost/cc_db JDBC Url: JDBC Driver: User name: Password: ******** org.postgresql.Driver When CC starts.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Securing a Microsoft ASP.NET Web Application.
FIspace SPT Seyhun Futaci. Technology behind FIspace Authentication and Authorization IDM service of Fispace provides SSO solution for web apps, mobile.
DEV-5: Introduction to WebSpeed ® Stephen Ferguson Sr. Training Program Manager.
Oracle Application Express Security. © 2009 Oracle Corporation Authentication Out-of-the-Box Pre-Configured Schemes LDAP Directory credentials Oracle.
TWSd - Security Workshop Part I of III T302 Tuesday, 4/20/2010 TWS Distributed & Mainframe User Education April 18-21, 2010  Carefree Resort  Carefree,
Shibboleth: Installation and Deployment Scott Cantor July 29, 2002 Scott Cantor July 29, 2002.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
Access control 2/18/2009. TOMCAT Security Model Declarative Security:  the expression of application security external to the application, and it allows.
WEB SERVER SOFTWARE FEATURE SETS
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
15 Copyright © 2004, Oracle. All rights reserved. Adding JAAS Security to the Client.
Securing Web Applications Lesson 4B / Slide 1 of 34 J2EE Web Components Pre-assessment Questions 1. Identify the correct return type returned by the doStartTag()
Business Objects XIr2 Windows NT Authentication Single Sign-on 18 August 2006.
CS520 Web Programming Spring – Web MVC Chengyu Sun California State University, Los Angeles.
Why Does The Site Need an SSL Certification?. Security should always be a high concern for your website, but do you need an SSL certificate? A secure.
David Hatten Developer, UrbanCode 17 October 2013
562: Power of Single Sign-On in OpenEdge
Ask the Experts – Building Login-Based Sites in AEM
CS520 Web Programming Declarative Security (II)
CS5220 Advanced Topics in Web Programming Declarative Security
CollegeSource Security Application &
Single Sign-On Led by Terrice McClain, Jen Paulin, & Leighton Wingerd
Chapter One: Mastering the Basics of Security
Federation made simple
Using E-Business Suite Attachments
Module Overview Installing and Configuring a Network Policy Server
Information Security Professionals
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Data Virtualization Tutorial… CORS and CIS
Configuring and Troubleshooting Routing and Remote Access
Web Software Model CS 4640 Programming Languages for Web Applications
Knowledge Byte In this section, you will learn about:
Template library tool and Kestrel training
IBM Certified WAS 8.5 Administrator
Sessions.
IIS.
Web Server Administration
Client side & Server side scripting
Configuring Internet-related services
AbbottLink™ - IP Address Overview
CS5220 Advanced Topics in Web Programming Secure REST API
Presentation transcript:

A deep dive into SPRING security June 6th 2017 – Frank Hilhorst Progress

The laws of SPRING configuration 1st law Until you’ve got everyting right, nothing will work 2nd law When it doesn’t work you will be kept in the dark as to why it doesn’t work 3rd law Until you are authenticated you shall be treated as an intruder

Some information about me Started working with PROGRESS in 1992 Principal Software Architect of JAZZ application Billing application for Hospitality (300 installs serving 1500 hotels) Started Progressive Consulting in 2006 Specialize in integration projects JAVA Messaging (JMS, RABBIT MQ, ACTIVE MQ, etc) Yoga teacher

What this session will cover Understanding security SPRING security basics SpEL – The Spring Expression Language OpenEdge Implementation of SPRING security Configuration specifics for OpenEdge Realm based security LDAP based security Customizing the login/logout Closing the back door

Understanding security threats

The two dimensions of System Security Authentication Identifying the user as an authorized user Limiting the time the user can operate in the system before re-identifying himself Securing that all requests for the duration of the session come from the identified user Authorization Constraining the operations the logged in user can perform in accordance with his assigned roles

With regards to security threats The bottom line is In the 4GL we are ill equipped to deal with these threats Therefore Lets hand the management of these risks over to a separate security layer

SPRING security basics

What is SPRING? A JAVA Framework for defining an application as an assembly of interchangeable components An assembly component is called a JAVA bean Assembly defined in spring.xml file

Example of bean configuration in spring.xml <preauthHandler ref="preauthAuthProvider" /> <b:bean id="preauthAuthProvider" class="security.OEPreAuthenticatedAuthenticationProvider"> <b:property name="rolePrefix" value="ROLE_" /> <b:property name="enabledAttrName" value="ATTR_ENABLED" /> <b:property name="lockedAttrName" value="ATTR_LOCKED" /> <b:property name="expiredAttrName" value="ATTR_EXPIRED" /> </b:bean>

Examples configurable SPRING components <authentication-manager ref=“..”/> <authentication-provider ref=“..” /> <access-denied-handler ref=“…" /> <authentication-success-handler-ref=“…“> <authentication-failure-handler-ref=“…“>

The SPRING Security Model

Authentication Models Supported in Spring Security No Security Model Supported in OpenEdge 1 JDBC Based Authentication Good luck, you are on your own 2 LDAP Yes 3 OpenID 4 Client Certificate Authentication Yes on the server side No on the client side 5 Single Sign On with Central Authentication Service yes 6 Container based security (Use Tomcat user authentication) 7 Custom authentication (by customizing the HybridRealm class) Progress

Authorization Models Supported in Spring Security No Authorization Model Supported in OpenEdge 1 Url based security Yes 2 Annotation based security 3 Dynamic URL filtering 4 Access Control Lists Progress

SpEL – The Spring Expression Language

The basic directory (URL) structure of a REST webapp ./static ./static/auth ./static/error ./static/images ./static/webspeed ./WEB-INFO (REST)

The definition of an intercept URL

The SpEL (SPRING expression language) verbs Arguments Description hasRole(…) Role Name Permit access only users with the specified role hasAnyRole(…) Comma separated list of roles Permit access only to users who have at least one of the roles specified in the comma separated list of roles permitAll() none Give access to everybody denyAll() Give access to nobody isAuthenticated() Give access to all users who are authenticated. Deny access for request by users who have not been authenticated isFullyAuthenticated() Give access to users who have been authenticated by logging in. Deny access to users who have been authenticated by way of the remember me feature Progress

The SpEL pattern matching SpEL verb Allows Denies /Static/* permitAll() /static/main.htm /static/view/view1.htm /static/** /static/* hasRole(...) /static/*.json hasRole(…) /static/catalog.json /static/*.htm /static/**.js denyAll() /static/main.js /static/view/view1.js /static/main.jpg Progress

Classifying OpenEdge web applications (by technology) Cgi script Speedscript Static HTM pages using AJAX calls SOAP REST CGI scripts KENDO/JSDO/REST

Classifying OpenEdge web applications (by target audience) Private Appication runs on a VPN or LAN Public with .. Secured access Anonymous access Both Anonymous and secured access

Best practices Create a URL map of The static resources of your application (i.e static HTML pages) The dynamic resources (SOAP, REST, Cgi scripts) When using speedscript identify the business logic that cannot be identified with a url map In the resulting URL map identify which url pattern can be accessed by which roles For static resources identify which dynamic resources they use Make sure to protect both the static and the correlated dynamic resource consistently Identify the back doors (e.g. http:/localhost:8080/apsv) Close the back door I

OpenEdge Implementation of SPRING security (prior to version11.7)

Configuration files involved File name location Notes web.xml webapps/[app-nm]/WEB-INF Compare to progress.ini file oeablSecurity[basic/form][auth model].xml Is one of oeablSecurity-anonymous.xml oeablSecurity-basic-ldap.xml oeablSecurity-basic-ldap-ext.xml oeablSecurity-basic-local.xml oeablSecurity-basic-oerealm.xml oeablSecurity-basic-saml.xml oeablSecurity-container.xml oeablSecurity-form-ldap.xml oeablSecurity-form-ldap-ext.xml oeablSecurity-form-local.xml oeablSecurity-form-oerealm.xml oeablSecurity-form-saml.xml Progress

The basic steps for implementing an authentication model In the WEB-INFO/web.xml Select a security configuration file Customize parameters in the selected security parameter file Perform additional configuration operations

OpenEdge Implementation of SPRING security (as of version 11.7)

Configuration files involved File name location Notes oeablSecurity.properties Webapps\[app-nm]\WEB-INF All authentication models are configured by way of name value pairs oeablSecurity.csv Defines intercept url’s in csv format Progress

Changes to security configuration in OpenEdge version 7 All security related configuration defined in one file oeablSecurity.properties

Changes to security configuration in OpenEdge version 7 All security related configuration defined in one file oeablSecurity.csv

How to configure OERealm based security

Basic steps in setting up OEREALM security (prior to 11.7) In the web.xml file Select /WEB-INF/oeablSecurity-form-oerealm.xml as the security model Create a client principal token file (optional) Configure and deploy security properties file Make a copy of the %DLC%\src\samples\security\OpenEdge\Security\Realm\HybridRealm.cls Configure users, domains and roles in the data administration Or Customize HybridRealm.cls to use your own user, domain and roles implementation Deploy HybridRealm.cls, Properties.cls & properties file Edit properties in /WEB-INF/oeablSecurity-form-oerealm.xml

Edit the web.xml file (prior to 11.7)

Generate a client principal file From proenv type a genspacp command Example genspacp -password abc123 -role RESTAuth Deploy oespaclient.cp in [catalina-base]/conf

Configure security properties file Sample properties file is stored in %DLC%\src\samples\security\spaservice.properties Contents of properties file Set the password to the password created by genspacp Deploy security properties file in [CATALINA-BASE]/webbapps/[AppName]/WEB-INFO/openedge

Customizing the HybridRealm.cls (1) The JAVA SPRING layer makes Java OpenClient calls to 3 methods in the HybridRealm class ValidateUser Input - UserName (decrypted) Returns:: - UserId (Unique integer ID for the user) ValidatePassword Input - UserId (integer), Password(character) Returns - True /False GetAttribute 4 times for ATTR_EXPIRED, ATTR_LOCKED,ATTR_ENABLED, ATTR_ROLES Input - Userid(integer) Returns - AtributeValue (character) By default within each of the above methods a call is made to this-object:ValidateClient() Validates if method was called with a valid sealed client principal object

Customizing the HybridRealm.cls (2) The default implementation of the HybridRealm class uses the OpenEdge security tables _sec-authentication-domain _User _Sec-role _sec-granted-role However you can customize the realm class to use your application user tables Make sure that The constructor of the HybridRealm.cls loads the properties file correctly spaProps = NEW Properties("spaservice.properties"). For testing first disable client principal validation by modifying HybridRealm.ValidateClient()

Edit properties in /WEB-INF/oeablSecurity-form-oerealm.xml Bean ID Property Name Example Notes OERealmUserDetails realmClass auth.HybridRealm Point to deployed HybridRealm.cls You can deploy either under [CATALINA-BASE]/[Service]/WEB-INFO/openedge [CATALINA-BASE]/[openedge realmUrl http://localhost:8080/apsv internal://nxgas The url of the appserver that is going to handle the hybridRealm authentication realmTokenFile oespaclient.cp Should point to where the client principal is deployed By default tomcat looks in [CATALINA-BASE]/conf OERealmAuthProvider key oech1::31302c766076 Set to the key returned when we created the client principal file OEClientPrincipalFilter Progress

Configuring the OERealm Security Openedge version 11.7 and up All properties defined in oeablSecurity.properties Principle Select bean to use Define properties

Customizing the login/logout

How SPRING security defines where to go when the login succeeds of fails

What the login.jsp looks like

Rules for creating a custom login page Must have a form that posts to “j_spring_security_check” <form name='login' action="j_spring_security_check" method='POST'> Must have an input field for the user name with a name attribute of j_username <input type='text' name='j_username' value=‘’’> Must have an input field for the password with a name attribute of j_password <input type=‘password' name='j_password' value=‘’’> <input name="submit" type="submit" value="login" style="width:100%"/>

Example of a custom login page

What the logout.jsp looks like Logout is redirected to this logout page. Which we can customize

Closing the back door

A Security Perimiter is only as strong as its weakest link

Identifying the weakest link in the security perimiter The front door Your web application The back doors Another web application hosted on the same tomcat instance Appserver access GUI Application Procedure editor access Access to the file system

A few general recommendations Protect access to webapps/ROOT Protect access to the appserver http://localhost:[port_no]/apsv For access to the authentication module (HybridRealm.cls) If hosted on the same Tomcat instance Use internal access only internal://nxgas Protect file system access to the tomcat configuration files Protect access to user and role configuration

Questions?