Automatic vs. Manual Code Analysis



Similar documents
Software Security. Group project: application security verification using OWASP ASVS

Software Security. Group project: application security verification using OWASP ASVS

Application Code Development Standards

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

Validation Procedure. ANNEX 4. Security Testing Basis

Adobe Systems Incorporated

Learning objectives for today s session

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

elearning for Secure Application Development

Rational AppScan & Ounce Products

Performing a Web Application Security Assessment

Source Code Review Using Static Analysis Tools

! Resident of Kauai, Hawaii

Comparing the Effectiveness of Penetration Testing and Static Code Analysis

Web Application Penetration Testing

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

What is Web Security? Motivation

Software security assessment based on static analysis

Expert PHP and MySQL. Application Desscpi and Development. Apress" Marc Rochkind

Section 1 CREDIT UNION Member Information Security Due Diligence Questionnaire

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

IT Security & Compliance. On Time. On Budget. On Demand.

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

BASELINE SECURITY TEST PLAN FOR EDUCATIONAL WEB AND MOBILE APPLICATIONS

JVA-122. Secure Java Web Development

Passing PCI Compliance How to Address the Application Security Mandates

Building & Measuring Security in Web Applications. Fabio Cerullo Cycubix Limited 30 May Belfast

Where every interaction matters.

Promoting Application Security within Federal Government. AppSec DC November 13, The OWASP Foundation

The Top Web Application Attacks: Are you vulnerable?

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

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

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

Chapter 1 Web Application (In)security 1

Web Engineering Web Application Security Issues

Integrating Web Application Security into the IT Curriculum

Magento Security and Vulnerabilities. Roman Stepanov

D. Best Practices D.1. Assurance The 5 th A

Web application security: automated scanning versus manual penetration testing.

Certified Selenium Professional VS-1083

Finding Your Way in Testing Jungle. A Learning Approach to Web Security Testing.

Columbia University Web Security Standards and Practices. Objective and Scope

Lecture 11 Web Application Security (part 1)

The Need for Fourth Generation Static Analysis Tools for Security From Bugs to Flaws

Security and Vulnerability Testing How critical it is?

Web application testing

IBM Managed Security Services Vulnerability Scanning:

White Paper Delivering Web Services Security: The Entrust Secure Transaction Platform

Promoting Application Security within Federal Government. AppSec DC November 13, The OWASP Foundation

Interactive Application Security Testing (IAST)

(WAPT) Web Application Penetration Testing

Architectural Risk Analysis for Android Applications

Excellence Doesn t Need a Certificate. Be an. Believe in You AMIGOSEC Consulting Private Limited

Detecting SQL Injection Vulnerabilities in Web Services

Comparing Application Security Tools

HP WebInspect Tutorial

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

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

QuickBooks Online: Security & Infrastructure

Integrating Security into the Application Development Process. Jerod Brennen, CISSP CTO & Principal Security Consultant, Jacadis

WebGoat for testing your Application Security tools

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

Security Testing For RESTful Applications

WHITE PAPER FORTIWEB WEB APPLICATION FIREWALL. Ensuring Compliance for PCI DSS 6.5 and 6.6

CONQUERING COMPLIANCE ISSUES WITH RHN SATELLITE AND TENABLE NESSUS SECURITY

OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair

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

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

CHAPTER 5 INTELLIGENT TECHNIQUES TO PREVENT SQL INJECTION ATTACKS

Web Application Security How to Minimize Prevalent Risk of Attacks

SAST, DAST and Vulnerability Assessments, = 4

Advanced Service Desk Security

Web Application Security

Application Security Testing. Erez Metula (CISSP), Founder Application Security Expert

Christchurch Polytechnic Institute of Technology Information Systems Acquisition, Development and Maintenance Security Standard

Web Application Guidelines

Web Applications Testing

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Collaborate on your projects in a secure environment. Physical security. World-class datacenters. Uptime over 99%

Intrusion detection for web applications

IBM Rational AppScan: Application security and risk management

TOOL EVALUATION REPORT: FORTIFY

Cutting Edge Practices for Secure Software Engineering

Building a Mobile App Security Risk Management Program. Copyright 2012, Security Risk Advisors, Inc. All Rights Reserved

General principles and architecture of Adlib and Adlib API. Petra Otten Manager Customer Support

Information Supplement: Requirement 6.6 Code Reviews and Application Firewalls Clarified

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

Secure Software Programming and Vulnerability Analysis

State of The Art: Automated Black Box Web Application Vulnerability Testing. Jason Bau, Elie Bursztein, Divij Gupta, John Mitchell

Getting software security Right

Web Application Security Assessment and Vulnerability Mitigation Tests

Workday Mobile Security FAQ

Transcription:

Automatic vs. Manual Code Analysis 2009-11-17 Ari Kesäniemi Senior Security Architect Nixu Oy ari.kesaniemi@nixu.com Copyright The Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the License. The Foundation http://www.owasp.org

Agenda Automatic and manual security verification overview Pros and cons for both techniques Statistics from WASC Application Security Verification Standard and automatic verification Source code scan problem areas Mixing automatic tools and manual work Conclusion 2

Application Security Verification Automated vs. manual Dynamic vs. static Dynamic can be black-box or white-box This presentation focuses on static Dynamic Static Automatic Dynamic Scan Source Code Scan Manual Security Test Code Review 3

Code Review Techniques Automatic source code scan: Text matching in source code Token matching Abstract syntax tree analysis Input/output path analysis Complexity analysis Statistical analysis Do most automatic code scan findings relate to how data is handled in the application, and not so much to the actual behavior and its consequences? 4

Code Review Techniques Manual code review: Look for specific signs ( text matching) Attack surface discovery Input/output path analysis Component usage and configuration analysis Authorization logic validation Custom security constraints, e.g. approval procedures Privacy issues Architecture analysis etc 5

Automatic vs. Manual Manual review by an expert gives probably less false negatives certainly less false positives insight also concerning design and architecture, overall quality etc OTOH, automatic review is faster broader repeatable 6

Interpreting automatic analysis results Every security verification needs conclusions of results Is security expertise needed? Assessing true positives (real findings) Determining false positives (false alerts) Estimating false negatives (undiscovered vulnerabilities) Making sure scanning configuration is correct Can we get good suggestions on how to remedy vulnerabilities automatically? 7

Some tools for source code scan Tool Languages Type ITS4 C/C++ Token matching Splint C Semantic matching Flawfinder C/C++ Text matching RATS C/C++, Perl, PHP, Python Text matching LAPSE Java EE Data flow analysis Fortify 360 SCA Ounce 6 (IBM AppScan Source Edition) IBM AppScan 8

WASC Web App Security Statistics 2008 Source: Web Application Security Consortium (WASC) http://projects.webappsec.org/web-application-security-statistics 9

WASC Web App Security Statistics 2008 Less than 60% of vulnerabilities are in code 10

WASC Web App Security Statistics 2008 Whitebox approach (dynamic or static) is needed to catch vulnerabilities 11

Application Security Verification Standard (ASVS) 12

Types of security verification Dynamic Static Automatic Dynamic Scan (1A) Source Code Scan (1B) Manual Security Test (2A) Code Review (2B) In addition, in ASVS level 3 is Design Verification (manual) level 4 is Internal Verification (manual) 13

ASVS High-level requirements Detailed requirements Reporting requirements Tools are an important part of every ASVS level. At higher levels in ASVS, the use of tools is encouraged. But to be effective, the tools must be heavily tailored and configured to the application and framework in use. And, at all levels, tool results must be manually verified. 14

ASVS Detailed requirements V1. Security Architecture V2. Authentication V3. Session Management V4. Access Control V5. Input Validation V6. Output Encoding/Escaping V7. Cryptography V8. Error Handling and Logging V9. Data Protection V10. Communication Security V11. HTTP Security V12. Security Configuration V13. Malicious Code Search V14. Internal Security 15

ASVS Verification Requirements Matrix Dynamic Source Code Security Code Scan Scan Test Review 16

Quasi-scientific quantitative matrix analysis 0 2 4 6 8 10 12 14 16 V1: Security Architecture V2: Authentication V3: Session Management V4: Access Control V5: Input Validation V6: Output Encoding/Escaping V7: Cryptography V8: Error Handling and Logging V9: Data Protection V10: Communication Security V11: HTTP Security V12: Security Configuration V13: Malicious Code Search V14: Internal Security Source Code Scan (1B) Code Review (2B) 17

Examples of what requirements CAN be verified using automatic code scan [V5.2] Verify that a positive validation pattern is defined and applied to all input. [V6.1] Verify that all untrusted data that are output to HTML (including HTML elements, HTML attributes, javascript data values, CSS blocks, and URI attributes) are properly escaped for the applicable context. [V8.1] Verify that that the application does not output error messages containing sensitive data that could assist an attacker, including session id and personal information. [V11.2] Verify that the application accepts only a defined set of HTTP request methods, such as GET and POST. 18

Examples of what requirements CANNOT be verified using automated code scan [V2.5] Verify that all authentication controls (including libraries that call external authentication services) have a centralized implementation. [V2.13] Verify that account passwords are salted using a salt that is unique to that account (e.g., internal user ID, account creation) and hashed before storing. [V4.4] Verify that direct object references are protected, such that only authorized objects are accessible to each user. (This can be of course checked dynamically.) 19

Examples of what CANNOT (cont d) [V5.7] Verify that all input validation failures are logged. [V8.6] Verify that each log event includes: 1. a time stamp from a reliable source, 2. severity level of the event [ ] and 7. a description of the event. [V9.2] Verify that the list of sensitive data processed by this application is identified, and that there is an explicit policy for how access to this data must be controlled, and when this data must be encrypted (both at rest and in transit). Verify that this policy is properly enforced. [V14.2] Verify that security control interfaces are simple enough to use that developers are likely to use them correctly. (This is a level 4 requirement.) 20

Problems in automatic source code scan A static analyzer cannot step back and look at the big picture, e.g. architectural layers Evaluating non-functional security is almost impossible, e.g. robustness against DoS attack Logic flaws (e.g. in authorization) or missing security requirements cannot be detected Significant parts of the code may be missed completely, e.g. when in a different language or IoC/plugin code Configuration analysis may be problematic as well 21

Mixing automation and manual work Manual code review on paper is pain! Tools are of great value, e.g.: An IDE for traversing code (esp. jumping between caller and callee) Grep or similar to quickly get pointers to interesting places and getting overview of technology used Manual testing is good match for manual code review, and for that good tools (e.g. browser plugins) are essential 22

From manual review to automation Build automated checks for manual findings Doing this statically is not easy without proper tools Dynamic approach may be easier, e.g. targeted automated scan or unit tests 23

Conclusion When, where and how to use automated tools? Web portals implemented on a known and robust platform using systematic access control may be very good candidates: Typical findings would be injection problems Probably not much privacy or business assets to protect Complex business web application (e.g. extranet application) could be harder to verify: Logical checks, privacy more delicate Scalability and transactions to think of 24

Conclusion Choice of verification methodology based on risk analysis Automatic code scan can give a rough measurement of a system even when run unconfigured Automatic code scanning is best combined with manual inspection, and/or as part of development build cycle Scanner needs to be properly configured, though 25