Introduction. Secure Software Development 9/03/2015. Matias starts. Daan takes over. Matias takes over. Who are we? Round of introductions



Similar documents
Seven Practical Steps to Delivering More Secure Software. January 2011

HP ESP Partner Enablement Fortify Proof of Concept Boot Camp Training

Building Security into the Software Life Cycle

Application Security Testing How to find software vulnerabilities before you ship or procure code

How to start a software security initiative within your organization: a maturity based and metrics driven approach OWASP

The Top Web Application Attacks: Are you vulnerable?

WebGoat for testing your Application Security tools

A Strategic Approach to Web Application Security The importance of a secure software development lifecycle

Stories From the Front Lines: Deploying an Enterprise Code Scanning Program

Building Security Into The Software Life Cycle

Secure in 2010? Broken in 2011!

The AppSec How-To: Achieving Security in DevOps

Development. Resilient Software. Secure and. Mark S. Merkow Lakshmikanth Raghavan. CRC Press. Taylor& Francis Croup. Taylor St Francis Group,

A Network Administrator s Guide to Web App Security

Learning Course Curriculum

Static Analysis Techniques for Testing Application Security. OWASP San Antonio January 31 st, 2008

Improving your Secure SDLC ( SSDLC ) with Prevoty. How adding real-time application security dramatically decreases vulnerabilities

Software security specification and verification

Black Box versus White Box: Different App Testing Strategies John B. Dickson, CISSP

Passing PCI Compliance How to Address the Application Security Mandates

Static Analysis Techniques for Testing Application Security. OWASP Austin March 25 th, 2008

WHITEPAPER. Nessus Exploit Integration

The Web AppSec How-to: The Defenders Toolbox

Integrating Application Security into the Mobile Software Development Lifecycle. WhiteHat Security Paper

HP Fortify Application Security Lucas v. Stockhausen PreSales Manager HP Fortify EMEA Enterprise Security

Product Roadmap. Sushant Rao Principal Product Manager Fortify Software, a HP company

Automatic vs. Manual Code Analysis

Learning objectives for today s session

SAST, DAST and Vulnerability Assessments, = 4

Braindumps.C questions

Rational AppScan & Ounce Products

! Resident of Kauai, Hawaii

Threat Modeling. Categorizing the nature and severity of system vulnerabilities. John B. Dickson, CISSP

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

Web Application Security

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

Starting your Software Security Assurance Program. May 21, 2015 ITARC, Stockholm, Sweden

Getting Started with Web Application Security

Adobe Systems Incorporated

Software Security Touchpoint: Architectural Risk Analysis

Strategic Information Security. Attacking and Defending Web Services

Information Security: Enabling the Business Developing an Effective Application Security Program

Web Application Penetration Testing

NETWORK PENETRATION TESTS FOR EHR MANAGEMENT SOLUTIONS PROVIDER

Protect Your Organization With the Certification That Maps to a Master s-level Education in Software Assurance

Cyber Exploits: Improving Defenses Against Penetration Attempts

Accelerating Software Security With HP. Rob Roy Federal CTO HP Software

Secrets of Vulnerability Scanning: Nessus, Nmap and More. Ron Bowes - Researcher, Tenable Network Security

IBM Rational AppScan: Application security and risk management

Interactive Application Security Testing (IAST)

How To Ensure That Your Computer System Is Safe

White Paper. Automating Your Code Review: Moving to a SaaS Model for Application Security

ISSECO Syllabus Public Version v1.0

Secure in 2010? Broken in 2011! Matias Madou, PhD Principal Security Researcher

Why The Security You Bought Yesterday, Won t Save You Today

Bringing Security Testing to Development. How to Enable Developers to Act as Security Experts

elearning for Secure Application Development

The Security Development Lifecycle. Steven B. Lipner, CISSP Senior Director Security Engineering Strategy Microsoft Corp.

The monsters under the bed are real World Tour

Secure Programming with Static Analysis. Jacob West

Web application testing

Security Testing of Java web applications Using Static Bytecode Analysis of Deployed Applications

HackMiami Web Application Scanner 2013 PwnOff

Enterprise Application Security Program

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

Reducing Application Vulnerabilities by Security Engineering

Application security testing: Protecting your application and data

Web Application Security

Streamlining Application Vulnerability Management: Communication Between Development and Security Teams

Redefining Static Analysis A Standards Approach. Mike Oara CTO, Hatha Systems

90% of data breaches are caused by software vulnerabilities.

Integrated Threat & Security Management.

How To Protect Your Data From Attack

How to Instrument for Advanced Web Application Penetration Testing

2015 Vulnerability Statistics Report

The Evolution of Enterprise Application Security. Why enterprises need runtime application self-protection

Security Assessment of Waratek AppSecurity for Java. Executive Summary

HP Fortify application security

Application Code Development Standards

THE EVOLUTION OF ENTERPRISE APPLICATION SECURITY

Source Code Review Using Static Analysis Tools

From the Bottom to the Top: The Evolution of Application Monitoring

IBM Rational Software

From Rivals to BFF: WAF & VA Unite OWASP The OWASP Foundation

TOOL EVALUATION REPORT: FORTIFY

Assuring Application Security: Deploying Code that Keeps Data Safe

Turning the Battleship: How to Build Secure Software in Large Organizations. Dan Cornell May 11 th, 2006

Metasploit The Elixir of Network Security

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

White Paper. Guide to PCI Application Security Compliance for Merchants and Service Providers

SAP NetWeaver Application Server Add-On for Code Vulnerability Analysis

Integrating Tools Into the SDLC

Implementation of Web Application Security Solution using Open Source Gaurav Gupta 1, B. K. Murthy 2, P. N. Barwal 3

The Defense RESTs: Automation and APIs for Improving Security

Security Testing and Vulnerability Management Process. e-governance

Software Development: The Next Security Frontier

Web application security: automated scanning versus manual penetration testing.

Software Security Testing

Realize That Big Security Data Is Not Big Security Nor Big Intelligence

Transcription:

Matias starts Who are we? Applying Static Analysis Matias Madou and Daan Raman, Leuven, Feb 27, 2015 1 At NVISO, I m responsible for the software security practice. Next to the client work, I also leads NVISO s product development efforts. I ve over a decade of software security experience. I was fortunate to spend 7 years building the leading static analysis solution as well as investigate leading software security initiatives at Fortune 100 companies through BSIMM. Currently, I m applying that knowledge to drastically improve software security initiatives in a cost efficient way. Daan takes over I am a member a security consultant at NVISO, and I specialize mostly in software security. I mainly use my software engineering skills during penetration tests and code reviews of mobile and desktop applications. I am additionally responsible for NVISO s Research & Development team, leading our technical research with a current focus on application security for mobile ecosystems and malware analysis. Matias Madou, Ph.D. +32 (0) 495 25 49 78 mmadou@nviso.be www.linkedin.com/in/matiasmadou/ Daan Raman +32 (0) 478 65 79 36 draman@nviso.be be.linkedin.com/in/daanraman 3 4 Matias takes over Round of introductions Welcome! Our goal is to let you be successful at what you re doing What company do you work for, what business unit do you work in? What are you working on? (Any static analysis?) What is your security background? (Trainings, hands-on, certification) What would you like to get out of this session? Secure Software Development Why it matters 5 1

Any Big Software Security Issues? Who s job is software security? 2009: The biggest case of identity theft in American history. 130 million credit card numbers using an SQL injection attack. Cost of breach: $140m. 2011: LulzSec hacks Sony Pictures Reveals 1m passwords unguarded using SQL injection attack. Sony did not learn from this bad experience. Developers Nobody? IT Security 2012: The hacker group D33Ds stole 450,000 plain text login credentials from Yahoo!. The breach was carried out by using a unionbased SQL injection attack. Software Security is everybody s job! It needs to be carried out throughout the organization, from the bottom to the top. 7 8 Problems in code, so what? Well, we have Security Software (same as Software Security, right?) Do you want to have more or less code next year? Security Software Software Security Secure Design Req. & Design Watch App Production SDLC Develop & review Secure Coding Deploy Test More code, more potential problems! Sanity Check Dynamic Testing 9 10 OK, what s the impact of such a program? Find security problems as fast as possible in the SDLC. Windows LOC vs. #CVE 60 1200 50 1000 40 800 30 600 20 400 10 200 0 0 NT 3.1 NT 3.5 NT 4.0 2000 XP Server Vista 7 (2009) 8 (2012) (1993) (1994) (1995) (2000) (2001) 2003 (2006) (2003) LOC #CVE Gates memo (2002): Trustworthy Computing. Microsoft SDL 11 12 2

Why audit code? Why audit code? 14 Why audit code? The SDLC When things go wrong Bad decisions can have big consequences! 15 16 The SDLC When things go wrong On Saturday, Nov. 30, the hackers had set their traps and had just one thing to do before starting the attack: plan the data s escape route. As they uploaded exfiltration malware to move stolen credit card numbers first to staging points spread around the U.S. to cover their tracks, then into their computers in Russia FireEye spotted them. Bangalore got an alert and flagged the security team in Minneapolis. And then The Secure Development Life Cycle (SDLC) Nothing happened. Source: http://www.businessweek.com/articles/2014-03-13/target-missed-alarmsin-epic-hack-of-credit-card-data 17 3

The SDLC Secure Development Life Cycle The SDLC Secure Development Life Cycle... the reality (Functionality over Security) 5. Maintain 1. Req. & Design SDLC 2. Develop & review A realistic goal: developers & architects find a happy medium between functional and security requirements 4. Deploy 3. Test A Secure Development Life Cycle is about building security into the software development life cycle. In an ideal scenario, security is an integrated part in each phase of the Software Development Life Cycle. Source: CISSP All-In-One Exam Guide 6 th Edition, Shon Harris 19 20 The SDLC Why you need a Secure Development Life Cycle The SDLC Implementation 1. Req. & Design 5. 2. Develop Maintain & review SDLC 4. 3. Deploy Test The Software Development Life Cycle (SDLC) The earlier (security) issues are identified, the lower the remediation cost. The relative cost of fixing defects in various stages of the SDLC. Source: The economics of testing (Rice Consulting) Comprehensive Lightweight Application Security Process (CLASP, OWASP Project) Touch-Point Model (Gary McGraw) The consequences of a security breach can be very expensive! Can you come up with examples? Microsoft Secure Software Development Life Cycle (SDL) 21 22 The SDLC Implementation Daan takes over Implement and use Secure Coding Standards Ban dangerous functions exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse _ini_file,show_source Bug vs. Flaw Perform reviews Manual source code reviews (ie. peer reviews) Automated static analysis 23 4

Defects: Bugs vs. Flaws Definition Defects: Bugs vs. Flaws Definition What do the terms bug and flaw mean to you? Defect Can be both implementation vulnerabilities and design vulnerabilities Bugs Flaws A bug is an implementationlevel software problem A flaw is instantiated in software code, but is far more present at the design level. Bugs and Features by Iris-hime 25 26 Bugs vs. Flaws Applied to code Bugs vs. Flaws (in) Famous examples Bugs Flaws Bugs Flaws Simple mistake. An error. A design problem. The Heartbleed bug: Microsoft Bob: Pardon me: Have you forgotten your password? Type your password here: 27 28 The first computer bug (in) Famous examples Bugs vs. Flaws (in) Famous examples 1947 Mark II Relay Calculator Moth trapped in a relay Moth was removed and a note was made in the log First actual case of bug being found Ariane 5 launch failure The launch, which took place on Tuesday, 4 June 1996, ended in failure due to an error in the software caused by assertions having been turned off, which in turn caused inadequate protection from integer overflow. This resulted in the rocket veering off its flight path 37 seconds after launch, beginning to disintegrate under high aerodynamic forces, and finally self-destructing by its automated flight termination system. The failure has become known as one of the most infamous and expensive software bugs in history. The failure resulted in a loss of more than US $370 million. 29 30 5

Bugs vs. Flaws (in) Famous examples Bugs vs. Flaws Applied to Secure Development Life Cycle 1. Req. & Design 5. Maintain SDLC 2. Develop & review 4. Deploy 3. Test Where do we find mainly bugs? Where do we find mainly flaws? 31 32 Bugs vs Flaws Applied to Secure Development Life Cycle Bugs vs Flaws Quiz 1. Req. & Design Architectural Risk analysis bug or flaw 5. Maintain SDLC 2. Develop & review Source Code Review 3. 4. Deploy Test Threat Modelling Penetration testing Where do we find mainly bugs? Where do we find mainly flaws? 33 34 Bugs vs Flaws Quiz Bugs vs Flaws Quiz bug or flaw bug or flaw 35 36 6

Bugs vs Flaws Quiz bug or flaw 37 Different approaches Static During, we are going to analyze the source code and/or the compiled version of the code in order to identify potential security defects. Web application if ( ($fq=strpos($fid,'"'))!==false ) $Fname = sanitize_title_with_dashes(substr( $Fid, $fq+1, strpos($fid,'"',$fq+1)-$fq-1 )); Static Application Security Testing (SAST) Dynamic Application Security Testing (DAST) 39 40 Combining Static and Dynamic Analysis Comparison of techniques To get the most out of, we will often combine both static and dynamic techniques. Automated techniques Static Analysis Dynamic Analysis Web application Static Application Security Testing Dynamic Application Security Testing Manual techniques Read through and review code manually Step through code using a debugger 41 42 7

Support in your favorite IDE Support in your favorite IDE Most modern IDE s support built-in static code analysis Demonstration 43 44 Stand-alone Static tools Manual and Automated techniques Bugs Simple mistake. An error. Flaws Design problems. HP Fortify (audit workbench) IBM AppScan Which techniques are most suitable in order to detect bugs & flaws? 45 46 Manual and Automated techniques Bugs Simple mistake. An error. Flaws Design problems. Choice in solutions: What does Gartner say? Leaders: HP, IBM, Veracode and WhiteHat Security: Offer at least SAST and DAST IAST (Interactive Application Security Testing) and RASP (Runtime) are a differentiator Mainly automated source code review techniques but also manual Mainly manual architectural risk analysis 47 48 8

Matias takes over 10.000 feet view A 10.000 feet view of static analysis Static Analysis Theory 50 Model Step 1: Translate phase: Translate source code to some language independent intermediate language Scanning Step 2: Scan phase: Apply analysis on top of the generic intermediate language Rules (language specific) 51 52 Theory: translation Build up model. Do analysis on model Theory: translation Missing library files (end points) (Source code scanning does not decompile, but extracts key information!!) Results: 1) 2) 3) 4) Duplicate (but different code) Old/Login.java Latest/Login.java 53 54 9

Theory: phase 2: scanning Build up model. Do analysis on model Theory: phase 2: scanning Build up model. Do analysis on model Language support: - Java -.NET - PHP - Language support: - Java -.NET - PHP - Hibernate Packages: - Hibernate - Struts - Hibernate Packages: - Hibernate - Struts - Package XYZ Package XYZ 55 56 Daan takes over False positives vs. False negatives Static analysis says you don t have this bug Static analysis says you have this bug Limitations of static analysis... and you don t have this bug True Negatives False Positives and you do have this bug False Negatives True Positives 58 False positives vs. False negatives When starting with static analysis The tool is reporting 10.000 instances of XSS! We don t care about these! Static analysis says you don t have this bug Static analysis says you have this bug Thinks you have an overwhelming amount of false positives (and that may be true) No clue about false negatives True Negatives False Positives False Positives Wanted results and you do have this bug False Negatives True Positives Unwanted results?? False Negatives?? True Positives 59 60 10

What you would like to achieve but what about the true positives? False Positives Reduce the amount of false positives to a manageable amount How to manage the amount of true positives? False Positives Understand where false negatives may be True Positives True Positives False Negatives False Negatives 61 62 Where do false positives and negatives come from? Example: Bug/Product does not really work with the framework The static analysis tool does not know Struts Matias takes over It ignores the actionerror escape attribute false negative! Triaging 63 Triaging Going through issues Triaging What to avoid Good part: The bulk of the work should be done by fine-tuning the scan with custom rules Bad part: they weeded out a ton of trivial issues, the hard part is left for you! Can it be exploited? Find exploit Argue about the exploit, severity, 65 66 11

Triaging High-level overview Issue Read the evidence Understand the problem category See if the evidence supports the problem category Take appropriate action 67 Static analysis theory Analyzers Static analysis theory Analyzers Different analyzers find different issues: Structural matching Taint tracking Control flow analysis Configuration file analysis Content analyzers (html files) Why do we need to understand the different analyzers: Understand why the tool is generating an issue Discover false positives and false negatives Feedback loop to solution improvements (customization) 69 70 Structural matching Grep++ Taint tracking Most important analyzer What other categories can be used to grep? (Think about manual code review) High level overview of taint tracking (what the dataflow analyzer does) Parameter1= Request.getParameter( the_first_parameter ); Other_variable= CopyData(Parameter1); CommandLine.execute(Other_variable) 71 72 12

Taint tracking Most important analyzer High level overview of taint tracking (what the dataflow analyzer does) Taint tracking Most important analyzer High level overview of taint tracking (what the dataflow analyzer does) Parameter1= Request.getParameter( the_first_parameter ); Source of taint Parameter1= Request.getParameter( the_first_parameter ); Source of taint Other_variable= CopyData(Parameter1); Passthrough Other_variable= CopyData(Parameter1); Passthrough CommandLine.execute(Other_variable) Sink CommandLine.execute(Other_variable) Sink 73 74 Taint tracking Most important analyzer Source rule: Q: Where can data enter our solution? How can data enter the solution? (White board) Taint tracking Most important analyzer High level overview of taint tracking (what the dataflow analyzer does) Source of taint Parameter1= Request.getParameter( the_first_parameter ); Other_variable= CopyData(Parameter1); Passthrough CommandLine.execute(Other_variable) Sink 75 76 Taint tracking Most important analyzer Passthrough rule: Q: How can data move through the solution? (White board) Taint tracking Most important analyzer High level overview of taint tracking (what the dataflow analyzer does) Source of taint Parameter1= Request.getParameter( the_first_parameter ); Other_variable= CopyData(Parameter1); Passthrough CommandLine.execute(Other_variable) Sink 77 78 13

Bugs Flow Inform Developers How do the developers get informed? Issue Inform Developers Problem Audit? 80 Bugs Flow Inform Developers How do the developers get informed? Issue Problem Audit Q&A Thank you! 81 mmadou@nviso.be draman@nviso.be @mmadou / @daanraman @NVISO_BE www.nviso.be Q 14