Architectural Design Patterns for SSO Single Sign On

  • Slides: 26
Download presentation
Architectural Design Patterns for SSO (Single Sign On) Design and Use Cases for Financial

Architectural Design Patterns for SSO (Single Sign On) Design and Use Cases for Financial Web Applications Wei Zhang & Marco Morana OWASP Cincinnati, U. S. A. OWASP Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP Foundation http: //www. owasp. org

Presentation outline < The needs/challenges for securing SSO architectures in financial web applications <

Presentation outline < The needs/challenges for securing SSO architectures in financial web applications < Secure SSO design patterns < Security consideration and risk for SSO design < Secure architecture principles < Architectural diagrams < Data flow diagrams < Sequence diagrams < Threat models of SSO architectures < Attack trees and misuse cases < Security risk framework for secure design of SSO architectures OWASP 2

Single Sign On (SSO) needs for financial web systems < Different systems serving different

Single Sign On (SSO) needs for financial web systems < Different systems serving different functions 4 ATM cash withdraw 4 Branch deposit 4 Monthly statements 4 Make a payment with a check 4 Wire transfer < Different systems have different type of user’s information 4 Personal and sensitive information 4 Financial transactions 4 Bank statements < Different business features are available for each system 4 Saving/checking accounts 4 Credit card accounts 4 Mortgage applications or loans 4 Cash rewards 4 Mileage rewards OWASP 3

Requirements for SSO <User friendly is the key <Single view is the goal <Eliminate

Requirements for SSO <User friendly is the key <Single view is the goal <Eliminate additional sign on is the approach <Security is the foundation OWASP 4

SSO Use Case <User can sign on site A to do function B about

SSO Use Case <User can sign on site A to do function B about product C <User can sign on site X to do function Y about product Z. <For users with both product C and Z, user should be able to sign on from Site A to access function B and function Y without additional authentication. <Site X will not be sunset to support users with only product Z. OWASP 5

Design options for SSO < Duplicate function Y on site A and access information

Design options for SSO < Duplicate function Y on site A and access information on site X 4 Pros: § Make it possible to sunset site X 4 Cons: § Introduce duplicated function on two sites § Needs to maintain the function and processing rules on two sites. < Build SSO for user to access function Y on site X 4 Pros: § No need to maintain two sets of function and processing rules on two sites § Enable the possibility to fully leverage functions on site X 4 Cons: § Make site A depends on site X § Introduce security complexity: – – Authentication Authorization Session coordination UI OWASP 6

SSO Design Patterns <Ad-hoc Encrypted Token: Use symmetric and public key cryptography to encrypt

SSO Design Patterns <Ad-hoc Encrypted Token: Use symmetric and public key cryptography to encrypt the application data that used for SSO <Standard Secure Token Service (STS): Central Security Token Service to respond with standard SAML token that supports federation across different sites upon request. OWASP

SSO – Ad-Hoc Encrypted Token <Pros: 4 Easy to set up and implement 4

SSO – Ad-Hoc Encrypted Token <Pros: 4 Easy to set up and implement 4 Supports PKI and SAML 4 No dependency on other system. <Cons: 4 Not a unified solution 4 Each federated site has to manage cryptographic key OWASP 8

SSO – Ad-hoc encrypted token Internet SSO with encrypted token Decrypt token and authenticate

SSO – Ad-hoc encrypted token Internet SSO with encrypted token Decrypt token and authenticate Secure token for SSO Site A Sign on Customer Application Server credential store Key store Site X Application Server Key store User information OWASP 9

SSO – STS <Pros: 4 Drives to unified solution for both internal and external

SSO – STS <Pros: 4 Drives to unified solution for both internal and external communication. 4 Centralized cryptographic key management approach. 4 Supports SAML and SOAP <Cons: 4 Introduces dependences on STS for federated sites 4 Introduces additional internet hop for communication OWASP 10

SSO – STS SSO with SAML token Internet Site A Application Server SAML token

SSO – STS SSO with SAML token Internet Site A Application Server SAML token for SSO Sign on Customer Site X Varify SAML Application token/authenticate STS SAML token credential store Key store Server Key store User information OWASP 11

SSO design and security considerations <Secure authentication and authorization 4 Ad-hoc encrypted token 4

SSO design and security considerations <Secure authentication and authorization 4 Ad-hoc encrypted token 4 STS <Secure session management: one dies, both die 4 Session initiation 4 Session termination 4 Session recovery 4 Keep alive <Secure web page wrapping: look and feel of the site 4 i. Frames OWASP 12

Potential Security Issues with SSO Design <In-Secure Session Management: 4 Sessions are not sync:

Potential Security Issues with SSO Design <In-Secure Session Management: 4 Sessions are not sync: one dies, one left open 4 Session Replay 4 Session Riding (CSRF) 4 Session hijacking 4 Sessions un-protected/in clear, cached, logged <Malicious Data Injections: 4 XSS, SQL Injection <Elevation of Privileges, Bypass of Authentication 4 Bypass authorizations 4 Forceful browsing OWASP 13

Secure Architecture Design < General Security Design Principles 1. Implement Authentication With Adequate Strength

Secure Architecture Design < General Security Design Principles 1. Implement Authentication With Adequate Strength 2. Enforce Least Privilege 3. Protect Data In Storage, Transit And Display 4. Enforce Minimal Trust 5. Trace and Log User Actions And Security Events 6. Fail Securely And Gracefully 7. Apply Defense in Depth 8. Apply Security By Default 9. Design For Simplicity, KISS Principle 10. Secure By Design, Development and Deployment 11. Secure As The Weakest Link 12. Avoid Security By Obscurity OWASP 14

Security Controls Design Guidelines: Authentication and Authorization <Authentication, What, Where and How 4 Mandatory

Security Controls Design Guidelines: Authentication and Authorization <Authentication, What, Where and How 4 Mandatory to restrict access to validated users 4 Strength depends on application risk/data classification 4 Compliant with regulations/standards 4 Provide for secure password and account management 4 Mitigates brute forcing and credentials harvesting 4 Mitigates Man In The Middle Attacks (Mi. TM) 4 Provides for user and host to host authentication <Authorization Most Common Flaws 4 Flaws in Role Base Access Controls (RBAC) 4 Flaws allow for horizontal and vertical privilege escalation 4 Forceful browsing 15 OWASP

Security Controls Design Guidelines: Session Management < Avoid common session management flaws: 4 Session

Security Controls Design Guidelines: Session Management < Avoid common session management flaws: 4 Session cookies and authentication tokens unprotected (e. g. clear text) between client and server 4 Missing session invalidation at idle-time out and user logout 4 Missing re-issuance of new session token to prevent reuse for authentication 4 Un-secure storage in a session store in clear text 4 Lack of strong random generation of session cookies/identifiers (e. g. >128 bit) 4 Lack of coordinated session between application tiers OWASP 16

Security Controls Design Guidelines: Input Validation <What and where to validate 4 Type, format,

Security Controls Design Guidelines: Input Validation <What and where to validate 4 Type, format, range and length of input data 4 Wherever data crosses system or trust boundaries 4 Input and output 4 Client validation vs. server validation <How to validate 4 Constraint, Reject, Sanitize 4 Canonical Validation 4 Encoding 4 Integrity Checks OWASP 17

Architecture of Financial Web Applications OWASP 18

Architecture of Financial Web Applications OWASP 18

Data flow diagram-Online Banking Application OWASP 19

Data flow diagram-Online Banking Application OWASP 19

Sequence diagram of SAML SSO OWASP 20

Sequence diagram of SAML SSO OWASP 20

Threat Modeling Web Applications From Improving Web Application Security: Threats and Countermeasures http: //msdn.

Threat Modeling Web Applications From Improving Web Application Security: Threats and Countermeasures http: //msdn. microsoft. com/en-us/library/ms 994921. aspx OWASP 21

Attack Trees-Online Banking Applications Analyzing the Security of Internet Banking Authentication Mechanisms : http:

Attack Trees-Online Banking Applications Analyzing the Security of Internet Banking Authentication Mechanisms : http: //www. itgi. org/Template. cfm? Section=Home&CONTENTID=35743&TEMPLATE=/Content. Management/Content. Display. cfm OWASP 22

Use and Misuse Case of Authentication From OWASP Security Testing Guide https: //www. owasp.

Use and Misuse Case of Authentication From OWASP Security Testing Guide https: //www. owasp. org/index. php/Testing_Guide_Introduction#Security_Requirements_Test_Derivation OWASP 23

Security risk framework for secure design of SSO architectures Threat Agents Misuses and Attack

Security risk framework for secure design of SSO architectures Threat Agents Misuses and Attack Vectors Security Weaknesses Security Controls/ Countermeasures Technical Impacts Business Impacts Users, Customers/ Employees User logs out from one application and forget to log out to another application that SSOs into it Inherent weaknesses in synchronizing sessions among applications Single Logout Among Applications, Keep-alives Loss of sensitive/confident ial data Reputation loss. Unlawful compliance fines Malicious Users, Fraudsters Victim is targeted by phishing, download of malware Social Engineering, Web Application Vulnerabilities, XSS Consumer Education, Data Filtering, escape all untrusted data based on HTML content Execute JS on client, install malware Fraud, financial losses, reputation loss/defacements Malicious Users, Fraudsters Attacker sends malicious data to the application Input Validation Vulnerabilities: XSS, SQL Injection Filtering, parameterized API, ESAPI filtering APIs, white-list validations Loss of data, data alteration, denial of service/access Public disclosure of vulnerability Reputation damage Malicious Users, Fraudsters Attacker target design flaws in the SSO/authentication or session management functions Weak Auth and Session Mgmt Vulnerabilities Follow Security Requirements For Secure Password Policies, Implement Account Locking, Disable “Auto-logons” Unauthorized access to data, functions Legal and financial implications Fraudsters Attacker creates forged HTTP requests and tricks a victim into submitting them Cross Site Request Forgery Vulnerabilities Include the unique token in a hidden field. Can change data and functions on behalf of the user Fraud, revenue loss because of denial of access Automated Scripts/ Spam Bots Attacker uses a bot/script to attack the application for denial of service and harvesting Insufficient Anti. Automation protection Include CAPTCHA, ESAPI intrusion detection APIs Can overflow/deny service to process spam data, harvest accounts. /data Loss due to business Disruptions/losse s, reputational damage 24 OWASP

References < Open. SAML: https: //spaces. internet 2. edu/display/Open. SAML/Home < ESAPI: https: //www.

References < Open. SAML: https: //spaces. internet 2. edu/display/Open. SAML/Home < ESAPI: https: //www. owasp. org/index. php/Category: OWASP_Enterprise_Security_A PI < Improving Web Application Security: Threats and Countermeasures http: //msdn. microsoft. com/en-us/library/ms 994921. aspx < Analyzing the Security of Internet Banking Authentication Mechanisms http: //www. itgi. org/Template. cfm? Section=Home&CONTENTID=35743&T EMPLATE=/Content. Management/Content. Display. cfm < OWASP Security Testing Guide https: //www. owasp. org/index. php/Testing_Guide_Introduction#Sec urity_Requirements_Test_Derivation OWASP

THANK YOU! <Q&A <Contact: 4张炜:zhangwei@hotmail. com 4 Marco Morana: marco. m. morana@gmail. com OWASP

THANK YOU! <Q&A <Contact: 4张炜:zhangwei@hotmail. com 4 Marco Morana: marco. m. morana@gmail. com OWASP