Threat Modeling. A workshop on how to create threat models by creating a hands-on example



Similar documents
Security Solutions & Training. Exploit-Me. Open Source Firefox Plug-Ins for Penetration Testing

Web Application Report

The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.

Network Security Audit. Vulnerability Assessment (VA)

FINAL DoIT v.4 PAYMENT CARD INDUSTRY DATA SECURITY STANDARDS APPLICATION DEVELOPMENT AND MAINTENANCE PROCEDURES

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

Passing PCI Compliance How to Address the Application Security Mandates

Web Application Attacks and Countermeasures: Case Studies from Financial Systems

The Top Web Application Attacks: Are you vulnerable?

APPLICATION SECURITY AND ITS IMPORTANCE

What is Web Security? Motivation

Auditing a Web Application. Brad Ruppert. SANS Technology Institute GWAS Presentation 1

Adobe Systems Incorporated

Where every interaction matters.

Know your enemy. Class Objectives Threat Model Express. and know yourself and you can fight a hundred battles without disaster.

FINAL DoIT v.8 APPLICATION SECURITY PROCEDURE

Columbia University Web Security Standards and Practices. Objective and Scope

Hacking Web Apps. Detecting and Preventing Web Application Security Problems. Jorge Blanco Alcover. Mike Shema. Technical Editor SYNGRESS

05.0 Application Development

elearning for Secure Application Development

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

JVA-122. Secure Java Web Development

Magento Security and Vulnerabilities. Roman Stepanov

External Network & Web Application Assessment. For The XXX Group LLC October 2012

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

Detecting Web Application Vulnerabilities Using Open Source Means. OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008

WEB SERVICES VULNERABILITIES

Web Application Security Guidelines for Hosting Dynamic Websites on NIC Servers

(WAPT) Web Application Penetration Testing

Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability

SECURITY ADVISORY. December 2008 Barracuda Load Balancer admin login Cross-site Scripting

Rational AppScan & Ounce Products

SAST, DAST and Vulnerability Assessments, = 4

ETHICAL HACKING APPLICATIO WIRELESS110 00NETWORK APPLICATION MOBILE MOBILE0001

Common Security Vulnerabilities in Online Payment Systems

Threat Modeling/ Security Testing. Tarun Banga, Adobe 1. Agenda

Hack Proof Your Webapps

Penetration Testing. Types Black Box. Methods Automated Manual Hybrid. oless productive, more difficult White Box

Criteria for web application security check. Version

Enterprise Application Security Workshop Series

Application Security Testing

Check list for web developers

Penetration Testing Service. By Comsec Information Security Consulting

STOPPING LAYER 7 ATTACKS with F5 ASM. Sven Müller Security Solution Architect

Web Application Security Assessment and Vulnerability Mitigation Tests

Secure Web Development Teaching Modules 1. Threat Assessment

ASP.NET MVC Secure Coding 4-Day hands on Course. Course Syllabus

Client vs. Server Implementations of Mitigating XSS Security Threats on Web Applications

Web Application Security

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

BASELINE SECURITY TEST PLAN FOR EDUCATIONAL WEB AND MOBILE APPLICATIONS

Penetration Test Report

Last update: February 23, 2004

Attack Vector Detail Report Atlassian

Web Application Security

Payment Card Industry (PCI) Data Security Standard

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Recommended Practice Case Study: Cross-Site Scripting. February 2007

Kenna Platform Security. A technical overview of the comprehensive security measures Kenna uses to protect your data

Secure development and the SDLC. Presented By Jerry

Cloud Security Through Threat Modeling. Robert M. Zigweid Director of Services for IOActive

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

Security features of ZK Framework

QualysGuard WAS. Getting Started Guide Version 3.3. March 21, 2014

OWASP TOP 10 ILIA

Basic & Advanced Administration for Citrix NetScaler 9.2

Web Application Security

Still Aren't Doing. Frank Kim

white SECURITY TESTING WHITE PAPER

Using Foundstone CookieDigger to Analyze Web Session Management

Adobe ColdFusion. Secure Profile Web Application Penetration Test. July 31, Neohapsis 217 North Jefferson Street, Suite 200 Chicago, IL 60661

Technical Findings Sample Report

Columbia University Web Application Security Standards and Practices. Objective and Scope

Threat Modelling for Web Application Deployment. Ivan Ristic (Thinking Stone)

OWASP Top Ten Tools and Tactics

Introduction to Web Application Security. Microsoft CSO Roundtable Houston, TX. September 13 th, 2006

Learn Ethical Hacking, Become a Pentester

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

Security in Network-Based Applications. ITIS 4166/5166 Network Based Application Development. Network Security. Agenda. References

Web Engineering Web Application Security Issues

CONTENTS. PCI DSS Compliance Guide

DFW INTERNATIONAL AIRPORT STANDARD OPERATING PROCEDURE (SOP)

Securing Your Web Application against security vulnerabilities. Ong Khai Wei, IT Specialist, Development Tools (Rational) IBM Software Group

Thick Client Application Security

Spigit, Inc. Web Application Vulnerability Assessment/Penetration Test. Prepared By: Accuvant LABS

Lecture 11 Web Application Security (part 1)

Strategic Information Security. Attacking and Defending Web Services

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

Testing the OWASP Top 10 Security Issues

Web Application Worms & Browser Insecurity

SENSITIVE AUSTRALIAN SPORTS COMMISSION ATHLETE MANAGEMENT SYSTEM (AMS) SMARTBASE SECURITY TEST PLAN. Final. Version 1.0

FileCloud Security FAQ

OWASP AND APPLICATION SECURITY

A Practical Approach to Threat Modeling

Transcription:

Threat Modeling A workshop on how to create threat models by creating a hands-on example

Introduction 2

Introduction 3

Part 1: Application- Layer Attacks A brief primer on some web application attacks

Authentication How can you break authentication? Brute-force Dictionary Birthday paradox Forgotten passwords (Paris Hilton attack) More advanced forms: Timing-based attacks Cryptanalysis Token replay attacks 5

Session Management Lots of potential attacks: Guess Session ID Modification attacks Content-caching Replay attacks / Session-hijacking Cookie attack DNS cache poisoning XSS (Input/Output validation) 6

Parameter Manipulation Free TVs for everyone! 7

SQL Injection DB can t differentiate between user-supplied values and computer generated values Classic 1 = 1 attack of course can get very severe xp_cmdshell 8

Part 2: Threat Model Case Study Intro to the case study for this class

Case Study Introduction You are consultants for Security Compass You have been contracted to perform a source code review and threat model on the False Secure Order web services site You will have 1 week to cover 7,500 out of over 145,000 lines of code You, as a group, have just over 2 hours to perform the threat model Prioritize which areas to cover in the threat model and identify which components are most critical You will review the architecture, interview the architect, determine data flows, determine and prioritize risk, and provide a list of countermeasures against high risk threats to look for in the review 10

Regular Users Read ACR Values Calls Caller Client Bro wser Apache Web Server My App Server Affected Roles Net Data Effect Threats and Risk Ratings Action Request data Send MQ Message Retrieve data from DB Regular, Administrative Users Read Mailing Options/ Mailing Options History Steps of Threat Modeling Gather Information Decompose App Brokerage Users Diagram User Type Regular User Admin User DFDs Identify Risk Use Cases Attack Trees 11

Gather Information Architect will walk you through the architecture of the application Please review the architecture documents provided Questions to ask Architect: Describe the application Who uses it? What is it used for? How often is it used? What kinds of data does it hold? Determine regulatory / legislative applicability Does it store/handle Personal data? Financial-reporting data? Cardholder data? Any others? What systems does it connect with? What are the entry points? Major app-sec domains: How does it handle access control, session management, logging, and input validation? Note that the architect is at too a high level to discuss issues such as error handling Remember the 5 Ws to determine business risk Who? What? When? Where? Why? How comes afterwards 12

Regular Users Read ACR Values Calls Caller Client Bro wser Apache Web Server My App Server Affected Roles Net Data Effect Threats and Risk Ratings Action Request data Send MQ Message Retrieve data from DB Regular, Administrative Users Read Mailing Options/ Mailing Options History Steps of Threat Modeling Gather Information Decompose App Brokerage Users Diagram User Type Regular User Admin User DFDs Identify Risk Use Cases Attack Trees 13

Decompose App Using the worksheets and stickers provided, break down: System Components Users Data Types Use Cases (don t do this now - complete this after the DFD) 14

Regular Users Read ACR Values Calls Caller Client Bro wser Apache Web Server My App Server Affected Roles Net Data Effect Threats and Risk Ratings Action Request data Send MQ Message Retrieve data from DB Regular, Administrative Users Read Mailing Options/ Mailing Options History Steps of Threat Modeling Gather Information Decompose App Brokerage Users Diagram User Type Regular User Admin User DFDs Identify Risk Use Cases Attack Trees 15

Data Flow Diagrams As a group, we re going to create a Level 1 DFD for a typical transaction flow based on the data we ve been given Identify components, data stores, and flow of data 5. Message returned to client Client Browser End User 1. Client sends request over web Determine trust boundaries are those trust boundaries legitimate? Web Server A Level 2 DFD would use the layers described in the presentation and middle tier design documents 4. Application server returns message to web server App Server 2. Web server forwards request to app server Allows us to drill in on those components we need to look at most 3. App server processes logic and updates DB Database 16

Interactive Time Our next steps will involve examining use cases and determining risk levels So what are the most pertinent use cases for this application? 17

Regular Users Read ACR Values Calls Caller Client Bro wser Apache Web Server My App Server Affected Roles Net Data Effect Threats and Risk Ratings Action Request data Send MQ Message Retrieve data from DB Regular, Administrative Users Read Mailing Options/ Mailing Options History Steps of Threat Modeling Gather Information Decompose App Brokerage Users Diagram User Type Regular User Admin User DFDs Identify Risk Use Cases Attack Trees 18

Create Use Case Using the worksheets and stickers provided to fill out use cases based on a single transaction flow from the DTD Example: User Updates Inventory in I-Tracker Client Browser 1. Sends inventory update HTTP form 2. Forwards HTTP Request 3. Update DB I-Tracker DB I-Tracker Web I-Tracker App 4. Notifies shipping team Notifications Description of Call Flow Call # Sender Receiver Description 1 Client I-Tracker Web Client sends an inventory request form submitted via the app along with JSESSION ID cookie 2 I-Tracker Web I-Tracker App Web server forwards request to app server 3 I-Tracker App I-Tracker DB App Server updates DB with new value for inventory 4 I-Tracker App Notifications Notification is sent to shipping if necessary 19

Find Risk for Threats This is the most difficult part of the threat model Starts with a solid base of knowledge of application security attacks (learned through your last class) What are the attack types? Do they affect C,I, or A? How likely are they? Enhanced by keeping up-to-date with other attacks. Reading the OWASP attacks section is a great resource: www.owasp.org/index.php/category:attack 20

Find Risk for Threats Common Weaknesses Enumeration is another great resource: http://cwe.mitre.org/data/leafnodes.html May be too big to read all, but can do meaningful keyword searching (e.g. look for XML) 21

Find Risk for Threats For the purposes of this class we ll rely on the knowledge of the students Please use blank template provided Ignore Threat # for now Threats and Risk Ratings Attack Vector Data Types CIA Risk Threat # At client Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs At client Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs At client Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs From client to web server Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs From client to web server Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs From client to web server Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs 22

Use Cases Determining Risk We take the highest value from the data-types for each threat, and use that as our impact rating Threats and Risk Ratings Attack Vector At client At client At client Data Types Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs CIA Data Risk Data Type Description Inventory Levels L H M Amount of inventory for each product Customer IDs L H M Unique ID for each end customer Sales Order Numbers L H M Unique order # for each sales order Description of Orders L L L Description of sales order Product IDs L H M User is authenticated, User is authorized to perform functions Password H M M Password of system user User ID M M M ID of system user Session ID H M M Session ID value for user (JSession from Tomcat) 23

Find Risk for Threats Likliehood was determined from our knowledge of threats and by external resources. We assign a value of 1 for low, 2 for medium, and 3 for high for both likelihood and impact Risk = Likelihood X Impact Use the following chart from the resulting product to determine the risk level Likelihood X Impact = Risk Score 1-3 4-6 7-9 Low Medium High 24

Fill in the Risk! Threats and Risk Ratings Attack Vector Data Types CIA Risk Threat # At client Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs H 1 At client Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs H 2 At client Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs N/A 3 From client to web server Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs H 4 From client to web server Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs H 5 From client to web server Inventory Levels Customer IDs Sales Order Numbers Product IDs Session IDs N/A 6 25

Regular Users Read ACR Values Calls Caller Client Bro wser Apache Web Server My App Server Affected Roles Net Data Effect Threats and Risk Ratings Action Request data Send MQ Message Retrieve data from DB Regular, Administrative Users Read Mailing Options/ Mailing Options History Steps of Threat Modeling Gather Information Decompose App Brokerage Users Diagram User Type Regular User Admin User DFDs Identify Risk Use Cases Attack Trees 26

Attack Trees Determine how a threat may be exploited Confidentiality at client Plaintext data read during transmission Cross-site scripting in app Properly configured SSL Strong input validation 27

Attack Trees Can be very cumbersome and time-consuming Alternative notation is easier: Threat #1: Confidentiality at client Attack: Malware steals data Countermeasure: Set cache-control to no-cache for sensitive pages Attack: Sensitive data stored on client machine Countermeasure: Set cache-control to no-cache for sensitive pages Countermeasure: Prevent sensitive data from reaching client in error messages by providing a default, generic error page defined in Struts web.xml. Ensure all runtime and checked exceptions are caught and handled before reaching any JSP or Servlet. Attack: Session compromised Countermeasure: Use strong session identifiers use existing functionality to do this (e.g. JSESSION ID) Countermeasure: Expire sessions after 15 minutes of inactivity Countermeasure: Enforce hard time out after 8 hours regardless of amount of activity Countermeasure: Expire cookie at end of browsing session Countermeasure: Validate all user input using Apache Struts validators to prevent XSS Countermeasure: HTML encode all output using URLEncoder to prevent XSS Countermeasure: Use HTTP-Only tag to mitigate risk of XSS-stolen cookies 28

Determine Attacks For the three highest risk threats in your use case: Determine attacks Determine possible countermeasures (from your own knowledge, web resources, or by asking experts) Please fill out the attack tree sheets provided 29

Share Findings Which areas of code are most pertinent to review given our limited timelines? What suggestions would we make to the architect/management to improve the application s security in the next release? 30

Tools Unfortunately, not many tools out there Microsoft Threat Analysis & Modeling free tool is best bet Search for this at msdn.microsoft.com 31

Questions / Profile Our consultants have serviced large (Fortune 500) and medium sized companies across most major industries We have worked for major security players, including Foundstone and Deloitte We have co-authored or contributed to several security books, including: Hacking Exposed: Web Applications, 2nd Edition HackNotes: Network Security Buffer Overflow Attacks: Detect, Exploit & Prevent Windows XP Professional Security Writing Security Tools and Exploits We have presented at and continue to present at security conferences, including: Blackhat Amsterdam; Reverse Engineering Conference 2005 in Montreal; HackInTheBox 2005 in Malaysia; ISC2's Infosec Conferences in Las Vegas, NYC, Toronto & DC; CSI NetSec; DallasCon; ToorCon; and Freenix. We present and contribute to open source projects: Chair at OWASP Toronto, Presented at OWASP Toronto, Contributed to YASSP Project (Lead by SANS and Xerox). 32