Threat Modelling for Web Application Deployment. Ivan Ristic ivanr@webkreator.com (Thinking Stone)



Similar documents
A Decision Maker s Guide to Securing an IT Infrastructure

ETHICAL HACKING APPLICATIO WIRELESS110 00NETWORK APPLICATION MOBILE MOBILE0001

Host Hardening. Presented by. Douglas Couch & Nathan Heck Security Analysts for ITaP 1

CS 356 Lecture 25 and 26 Operating System Security. Spring 2013

Penetration Testing Report Client: Business Solutions June 15 th 2015

Passing PCI Compliance How to Address the Application Security Mandates

External Supplier Control Requirements

National Endowment for the Arts Evaluation Report. Table of Contents. Results of Evaluation Areas for Improvement Exit Conference...

DMZ Gateways: Secret Weapons for Data Security

SAST, DAST and Vulnerability Assessments, = 4

The Open Cyber Challenge Platform *

Directory and File Transfer Services. Chapter 7

Designing and Coding Secure Systems

Hardening Joomla 1. HARDENING PHP. 1.1 Installing Suhosin. 1.2 Disable Remote Includes. 1.3 Disable Unneeded Functions & Classes

Acano solution. Security Considerations. August E

Virtualization System Security

SECURITY TRENDS & VULNERABILITIES REVIEW 2015

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

SECURITY DOCUMENT. BetterTranslationTechnology

How To Manage Web Content Management System (Wcm)

WEB APPLICATION VULNERABILITY STATISTICS (2013)

Web Intrusion Detection with ModSecurity. Ivan Ristic

Created By: 2009 Windows Server Security Best Practices Committee. Revised By: 2014 Windows Server Security Best Practices Committee

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

Black Box Penetration Testing For GPEN.KM V1.0 Month dd "#$!%&'(#)*)&'+!,!-./0!.-12!1.03!0045!.567!5895!.467!:;83!-/;0!383;!

Web Application Firewalls: When Are They Useful? OWASP AppSec Europe May The OWASP Foundation

What IT Auditors Need to Know About Secure Shell. SSH Communications Security

Goals. Understanding security testing

05.0 Application Development

FIREWALLS & NETWORK SECURITY with Intrusion Detection and VPNs, 2 nd ed. Chapter 4 Finding Network Vulnerabilities

THE TOP 4 CONTROLS.

Adobe Systems Incorporated

NETWORK AND CERTIFICATE SYSTEM SECURITY REQUIREMENTS

Protecting Your Organisation from Targeted Cyber Intrusion

Web App Security Audit Services

Threat Modeling. Frank Piessens ) KATHOLIEKE UNIVERSITEIT LEUVEN

Building Energy Security Framework

Overview of Network Security The need for network security Desirable security properties Common vulnerabilities Security policy designs

Redhawk Network Security, LLC Layton Ave., Suite One, Bend, OR

Securing Linux Servers Best Practice Document

Guidelines for Website Security and Security Counter Measures for e-e Governance Project

Web Security School Entrance Exam

SecurityMetrics Vision whitepaper

Defense-in-Depth Strategies for Secure, Open Remote Access to Control System Networks

Penetration Testing Service. By Comsec Information Security Consulting

Complete Web Application Security. Phase1-Building Web Application Security into Your Development Process

TECHNICAL AUDITS FOR CERTIFYING EUROPEAN CITIZEN COLLECTION SYSTEMS

Where every interaction matters.

nwstor Storage Security Solution 1. Executive Summary 2. Need for Data Security 3. Solution: nwstor isav Storage Security Appliances 4.

Mingyu Web Application Firewall (DAS- WAF) All transparent deployment for Web application gateway

Basic & Advanced Administration for Citrix NetScaler 9.2

Railo Installation on CentOS Linux 6 Best Practices

Sitefinity Security and Best Practices

Magento Security and Vulnerabilities. Roman Stepanov

DFW INTERNATIONAL AIRPORT STANDARD OPERATING PROCEDURE (SOP)

Privacy + Security + Integrity

IBM. Vulnerability scanning and best practices

Quick Start Guide oscommerce: Guidelines for installation and setup. Why oscommerce?

Data Breaches and Web Servers: The Giant Sucking Sound

Hacking the WordpressEcosystem

CLOUD FRAMEWORK & SECURITY OVERVIEW

HTExploit: Bypassing htaccess Restrictions

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

CCM 4350 Week 11. Security Architecture and Engineering. Guest Lecturer: Mr Louis Slabbert School of Science and Technology.

Building A Secure Microsoft Exchange Continuity Appliance

Using Nessus In Web Application Vulnerability Assessments

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including:

90% of data breaches are caused by software vulnerabilities.

modules 1 & 2. Section: Information Security Effective: December 2005 Standard: Server Security Standard Revised: Policy Ref:

Linux VPS with cpanel. Getting Started Guide

Security Issues with Integrated Smart Buildings

Appalachian Regional Commission Evaluation Report. Table of Contents. Results of Evaluation Areas for Improvement... 2

Use of The Information Services Active Directory Service (AD) Code of Practice

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

ensure prompt restart of critical applications and business activities in a timely manner following an emergency or disaster

Infor CloudSuite. Defense-in-depth. Table of Contents. Technical Paper Plain talk about Infor CloudSuite security

The Weakest Link: Mitigating Web Application Vulnerabilities. webscurity White Paper. webscurity Inc. Minneapolis, Minnesota USA

Security Whitepaper: ivvy Products

Cyber Essentials Scheme

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

Application Security Testing. Generic Test Strategy

Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure

CompTIA Security+ Certification Study Guide. (Exam SYO-301) Glen E. Clarke. Gravu Hill

PENETRATION TESTING GUIDE. 1

Pentests more than just using the proper tools

BM482E Introduction to Computer Security

Locking down a Hitachi ID Suite server

USB Portable Storage Device: Security Problem Definition Summary

How To Perform An External Security Vulnerability Assessment Of An External Computer System

What Do You Mean My Cloud Data Isn t Secure?

Transcription:

Threat Modelling for Web Application Deployment Ivan Ristic ivanr@webkreator.com (Thinking Stone)

Talk Overview 1. Introducing Threat Modelling 2. Real-world Example 3. Questions

Who Am I? Developer / architect / administrator, spent a great deal of time looking at web security issues from different points of view. Author of ModSecurity, an open source web application firewall/ids. Author of Apache Security (O'Reilly) Founder of Thinking Stone, a web security company.

State of Web Security It is a difficult job web deployments consist of many different systems. Most decisions are made ad-hoc. Assumptions under which defence is designed are rarely challenged. Consequently, many systems are not adequately protected. We are in need of methodology that will help us design secure systems. Threat Modelling can do this.

Threat Modelling 1. Introduction To Threat Modelling

Threat Modelling Threat modelling is a semi-formal technique that is used to understand threats against your system. It is a hot, fashionable, buzzword! But it is genuinely useful and does not have to be difficult. Not rocket science.

Key Questions Where does your system live? What do you have to protect? Who are your users? Who are your adversaries? What are your weak points? What can you do to mitigate the threats?

Threat Modelling Advantage Thinking like the adversary! (What is wrong in this system and how can I exploit it?)

Who Should Practice It? Everyone! Developers. System Administrators. System Architects. Consultants.

What Is It Good For? Planning. Testing (especially penetration testing). Training my favourite. Security improvement. It is never too late to start using it. Do try to use it as early as possible it is much safer and cheaper that way.

Scope Full title of this talk: A lightweight threat modelling methodology for web application deployment. Includes a mixture of the following: network security, host security, web security, application security. Practical: 20% effort 80% gain. (The remaining 80% of effort is mostly in details of web application security.) At this level we treat web applications as black boxes.

Methodology Overview 1. Information Gathering 2. Analysis 3. Mitigation

Methodology Overview 1. Information Gathering Look at existing documents. Interview stakeholders. Inspect system. Understand system. 2. Analysis 3. Mitigation

Methodology Overview 1. Information Gathering 2. Analysis User roles and usage scenarios. Components and trust boundaries. Assets and attacker motivation. Entry points, exit points, data flow. Weaknesses and threats. 3. Mitigation

Methodology Overview 1. Information Gathering 2. Analysis 3. Mitigation Establish budget. Rank treats (fuzzy) - use a model that works for you. Decide what to do with the threats.

Analysis: Stepping Stones Algorithm: 1. Pretend you are the adversary. 2. Look at the exposed parts. 3. Find ways to subvert them. 4. Find ways to use the resources available to you to get to the inner layers. 5. Repeat until you grab the asset! Also known as Attack Trees.

Mitigation: Choices Ignore risk. (Popular choice!) Mitigate risk. Intrusions are expensive Security is expensive What can you afford? Accept risk.

Mitigation: Strategies Remove entry points (attack vectors). Reduce attack surface. Compartmentalise. Practice the principle of least privilege. Fail safely.

Tips & Tricks Do not attempt to do too much - you might get lost. Branch out sub-models to cope with complexity, or work in iterations. Most web applications are similar - develop a library of reusable threat models. Start from scratch and assume nothing; mitigating the most obvious threats will result in foolproof operational procedures.

Threat Modelling 2. Real-world Example

Overview E-commerce operation: Web site (CMS-powered) Online store Two servers: Application server Database server

Physical Security Servers are collocated with a hosting company: Restricted physical access Biometrics at the entrance Equipment in own locked cage Good, physical security is out of the scope of this talk anyway.

System Users (1) Customers (public). Store administration staff. Marketing department. Developers. System administrators.

System Users (2) Developers?? System administrators? Customers Store administration Marketing department Services?

System Users (3) SSH (22), FTP (20, 21), MYSQL (3306) Developers (manage application, maintain and backup database): 2 SSH SSH (22) FTP System administrators (manage servers): 2 MYSQL Apache (80) Public (browse web site, buy stuff): 1 BILLION Store administration (manage store): 4 Marketing department (manage web site): 1 Services APACHE

System Users (4) Threat: possible password and data compromise through the use of plaintext communication protocols. Mitigation: Disallow plain-text protocols: Shopping in the store Administrative interfaces (Store, CMS) Database access

System Users (5) SSH (22), SFTP (115), MYSQL+SSL (3306) Developers (manage application, maintain and backup database): 2 SSH SSH (22) SFTP System administrators (manage servers): 2 MYSQL Apache (80), Apache+SSL (443) Public (browse web site, buy stuff): 1 BILLION Store administration (manage store): 4 Marketing department (manage web site): 1 Services APACHE

Entry Points (1) On the network level, each service represents one entry point. Implement firewall restrictions to allow only what is absolutely necessary: External firewall (hosting company). Host firewalls (iptables on Linux). Leave no trust between two internal servers either, only let port 3306 through.

Entry Points (2) Threat: possible compromise through vulnerabilities in Apache, SFTPD, SSHD, and MySQL. Mitigation: Prevent access to nonessential services (SFTPD, SSHD, MySQL). Option: buy an expensive hardware firewall.

What the Public Now Sees (1) APACHE Store Apache (80), Apache+SSL (443) Public (browse web site, buy stuff): 1 BILLION Two of four services are not needed to be accessed by the public. But the firewall cannot do any better than this. Store Admin Web Site CMS Admin

Attack Surface Reduction (1) APACHE Store Apache (80), Apache+SSL (443) Public (browse web site, buy stuff): 1 BILLION Using Apache access control to allow access only to a small subset of IP addresses Store Admin Web Site CMS Admin

Attack Surface Reduction (2) APACHE Attack surface reduction Store Store Admin APACHE1 Store APACHE2 Store Admin Web Site CMS Admin Web Site 192.168.0.1 CMS Admin 192.168.0.2 192.168.0.1 Services split to two IP addresses. We can now use the firewall again.

What the Public Now Sees (2) APACHE1 Apache (80), Apache+SSL (443) Store Public (browse web site, buy stuff): 1 BILLION Web Site

Entry Points (4) Threat: possible compromise through vulnerabilities in Apache. Mitigation: Keep Apache up-to-date: Automated patching (use binary Apache) Manual patching (build Apache from source)

Entry Points (5) Threat: possible compromise through Apache misconfiguration. Mitigation: Configuration management. Mitigation: Regular independent configuration assessments.

Entry Points (6) Threat: possible compromise through unmitigated Apache problems. Mitigation: Put Apache in jail. Mitigation: Implement integrity validation. Mitigation: Implement kernel patches (e.g. grsecurity).

Remaining Assets (1) Threat: Adversary accesses the credit card database. Mitigation: Do not store credit cards online, or store them using public-key encryption. (We lowered the value of the asset.) Mitigation: Document policy on the web site.

Remaining Assets (2) Threat: Source code stolen. Mitigation: Do not keep the source code online, compile PHP pages before uploading. (Again, we lowered the value of the asset.)

Threat That Remains Threat: Compromise through a vulnerability of the application. This opens a door to a new threat modelling sub-model: web application security. Mitigate from the outside. Treat the application as a black box, and look where action gets out.

Web Application Model Input Validation Error SQL Injection Web Client Web Server Application Database Server Cross-site Scripting R W X File system Command Execution File Disclosure Privilege Escalation

Security Categories Data validation and transformation Authentication and authorisation Sensitive data transport and storage Session management Fault management Auditing and logging

Fix Filesystem Permissions Do not allow read access prevents file disclosure. Do not allow write access prevents privilege escalation. Do not have binaries or a compiler around prevents command execution.

Screen System Boundaries If you can t fix the application focus on libraries that interact with external systems. Screen database queries. Screen external command execution. Screen file system operations.

Examine Attack Paths Web site All paths lead to the database, which is used by all four applications! Customers Apache 1 Store Database Server Staff Apache 2 CMS Admin Store Admin Two web servers are isolated from each other to contain intrusion.

Central Database Mitigation Have four database accounts, each with different access level. Or, deploy a separate database engine for the CMS application (web site).

Final Mitigation Activities Know when you are compromised Activity monitoring Integrity Validation Intrusion Detection Have off-site backups and disaster recovery procedures!

Where To Go From Here Chapter 3 of Improving Web Application Security: Threats and Countermeasures (free download). Chapter 4 of Writing Secure Code. If you are a programmer, read Threat Modeling. Use the free threat modelling tool from Microsoft. More here: http://www.modsecurity.org/blog/ archives/2006/01/threat_modellin.html

Questions? Thank you! Download this presentation from http://www.thinkingstone.com/talks/