Surrogate Dependencies (in

Similar documents
Web 2.0 and AJAX Security. OWASP Montgomery. August 21 st, 2007

Solutions Business Manager Web Application Security Assessment

OWASP Top 10 The Ten Most Critical Web Application Security Risks

OWASP Thailand. Proxy Caches and Web Application Security. OWASP AppSec Asia October 21, Using the Recent Google Docs 0-Day as an Example

OWASP Top David Caissy OWASP Los Angeles Chapter July 2017

Protect your apps and your customers against application layer attacks

Security and Privacy. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Provide you with a quick introduction to web application security Increase you awareness and knowledge of security in general Show you that any

Securing Cloud Applications with a Distributed Web Application Firewall Riverbed Technology

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11

Fortify Software Security Content 2017 Update 4 December 15, 2017

Enterprise Overview. Benefits and features of Cloudflare s Enterprise plan FLARE

Application security : going quicker

TIBCO Cloud Integration Security Overview

Developing ASP.NET MVC Web Applications (486)

Security. CSC309 TA: Sukwon Oh

Human vs Artificial intelligence Battle of Trust

IronWASP (Iron Web application Advanced Security testing Platform)

Web Application Security. Philippe Bogaerts

Framework for Application Security Testing. September 11th, 2018

Welcome to the OWASP TOP 10

Aguascalientes Local Chapter. Kickoff

shortcut Tap into learning NOW! Visit for a complete list of Short Cuts. Your Short Cut to Knowledge

Securing Production Applications & Data at Runtime. Prevoty

Application Security through a Hacker s Eyes James Walden Northern Kentucky University

Web Application with AJAX. Kateb, Faris; Ahmed, Mohammed; Alzahrani, Omar. University of Colorado, Colorado Springs

N different strategies to automate OWASP ZAP

The PKI Lie. The OWASP Foundation Attacking Certificate Based Authentication. OWASP & WASC AppSec 2007 Conference

Perslink Security. Perslink Security. Eleonora Petridou Pascal Cuylaerts. System And Network Engineering University of Amsterdam.

Evaluating the Security Risks of Static vs. Dynamic Websites

Defend Your Web Applications Against the OWASP Top 10 Security Risks. Speaker Name, Job Title

Multi-Post XSRF Web App Exploitation, total pwnage

Application Security Buyer s Guide

Security Solution. Web Application

Using the Cisco ACE Application Control Engine Application Switches with the Cisco ACE XML Gateway

To Kill a Monolith: Slaying the Demons of a Monolith with Node.js Microservices on CloudFoundry. Tony Erwin,

Security Research Advisory IBM WebSphere Portal Cross-Site Scripting Vulnerability

RKN 2015 Application Layer Short Summary

CIS 4360 Secure Computer Systems XSS

Web basics: HTTP cookies

Integrated Web Application Firewall (WAF) & Distributed Denial Of Service (DDoS) Mitigation For Today s Enterprises

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

OWASP TOP Release. Andy Willingham June 12, 2018 OWASP Cincinnati

Application Design and Development: October 30

Featuring. and. Göteborg. Ulf Larson Thursday, October 24, 13

CONTRAST ASSESS MARKET-DEFINING APPLICATION SECURITY TESTING FOR MODERN AGILE AND DEVOPS TEAMS WHITEPAPER

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach

BUYER S GUIDE APPLICATION SECURITY BUYER S GUIDE:

REST Easy with Infrared360

Ur/Web: A Simple Model for Programming the Web. Adam Chlipala MIT CSAIL POPL 2015 January 15, 2015

Evolution of the "Web

Andrew Muller, Canberra Managing Director, Ionize, Canberra The challenges of Security Testing. Security Testing. Taming the Wild West

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH

Security Engineering by Ross Andersson Chapter 18. API Security. Presented by: Uri Ariel Nepomniashchy 31/05/2016

DreamFactory Customer Privacy and Security Whitepaper Delivering Secure Applications on Salesforce.com

Exploring Chrome Internals. Darin Fisher May 28, 2009

OWASP InfoSec Romania 2013

Application vulnerabilities and defences

Simple AngularJS thanks to Best Practices

Web Application Security. OWASP 11 th August, The OWASP Foundation Basic SQL injection Basic Click Jacking

Application Security at DevOps Speed and Portfolio Scale. Jeff Contrast Security

86% of websites has at least 1 vulnerability and an average of 56 per website WhiteHat Security Statistics Report 2013

Web basics: HTTP cookies

Testing NodeJS, REST APIs and MongoDB with UFT January 19, 2016

Develop and test your Mobile App faster on AWS

Web Application Penetration Testing

NoScript, CSP and ABE: When The Browser Is Not Your Enemy

WEB SECURITY: XSS & CSRF

70-486: Developing ASP.NET MVC Web Applications

IBM Watson Content Hub. Architecture Overview

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang

Web Applications Penetration Testing

Azure DevOps. Randy Pagels Intelligent Cloud Technical Specialist Great Lakes Region

Copyright

epldt Web Builder Security March 2017

Chrome Extension Security Architecture

OPEN WEB APPLICATION SECURITY PROJECT OWASP TOP 10 VULNERABILITIES

INJECTING SECURITY INTO WEB APPS WITH RUNTIME PATCHING AND CONTEXT LEARNING

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

SOLUTION BRIEF CA API MANAGEMENT. Enable and Protect Your Web Applications From OWASP Top Ten With CA API Management

Application. Security. on line training. Academy. by Appsec Labs

INNOV-09 How to Keep Hackers Out of your Web Application

The 3 Pillars of SharePoint Security

Black Hat Europe 2006

Content Security Policy

INF3700 Informasjonsteknologi og samfunn. Application Security. Audun Jøsang University of Oslo Spring 2015

OWASP Top 10. Copyright 2017 Ergon Informatik AG 2/13

Robots with Pentest Recipes:

TRAINING CURRICULUM 2017 Q2

Attacking the Application OWASP. The OWASP Foundation. Dave Ferguson, CISSP Security Consultant FishNet Security.

SOLUTION BRIEF. Enabling and Securing Digital Business in API Economy. Protect APIs Serving Business Critical Applications

Exploiting and Defending: Common Web Application Vulnerabilities

WEB APPLICATION SCANNERS. Evaluating Past the Base Case

InterCall Virtual Environments and Webcasting

Offline-first PWA con Firebase y Vue.js

GOING WHERE NO WAFS HAVE GONE BEFORE

WHY CSRF WORKS. Implicit authentication by Web browsers

Lecture Overview. IN5290 Ethical Hacking

Lecture 6: Web hacking 2, Cross Site Scripting (XSS), Cross Site Request Forgery (CSRF), Session related attacks

Don't Trust The Locals: Exploiting Persistent Client-Side Cross-Site Scripting in the Wild

Transcription:

Surrogate Dependencies (in NodeJS) @DinisCruz London, 29th Sep 2016

Me Developer for 25 years AppSec for 13 years Day jobs: Leader OWASP O2 Platform project Application Security Training JBI Training, others Part of AppSec team of: The Hut Group BBC AppSec Consultant and Mentor I build AppSec teams. https://twitter.com/diniscruz http://blog.diniscruz.com http://leanpub.com/u/diniscruz

A SURROGATE DEPENDENCY

Defintion https://en.wikipedia.org/wiki/surrogate https://en.wikipedia.org/wiki/surrogate_model

What is it? It tests the API and replays responses Use integration tests to lock the api used Save responses in JSON format Replay data to client Allow client to be offline

Locking the API using tests A client Network API Integration tests Network API Git repo with data store as JSON files

Replay stored JSON Client/app is running Offline! A client Network API Modify data (optional) Surrogate Dependency Git repo with data store as JSON files

Adding security tests (to server) Insert Payloads here To attack the server Integration tests Network API Git repo with data store as JSON files

Adding Security Tests (from server) To attack the client (from the server) A client Network Insert Payloads here Modify data (optional) Surrogate Dependency What kind of issues can be found this way? - XSS - SQL Injection - CSRF (to server) - DoS - Steal Sessions tokens Git repo with data store as JSON files

Once you know where the client is vulnerable A client Network Once you know which data received from the server will exploit the client API You ask the API where did that data come from? and follow the rabbit holes Which might lead to and external source (i.e. attacker)

With Proxy A client Request for xyz url (GET, POST, PUT) Send data to user in Cache? yes no Load data from real service Modify data (optional) Load data from cache Save data to cache Git repo with data store as JSON files

Demo Running a mobile app offline

BUILDING A TEST FRAMEWORK

Problems that developers have Fragile dev and QA environments Inefficient TDD (specially for Integration tests) Lack of production-like data Can t work offline Lots of manual testing Massive Versioning issues with dependencies (namely Web Services) Weak Schema contracts remember that String is not a type and Strings are not Strongly typed :) No/few dedicated micro services for their app

Key for AppSec is to make Devs more productive We need projects/activities that align AppSec needs with Dev needs The Surrogate dependencies (which allows the app to run offline is one of those projects)

Aligning AppSec with Dev Surrogate Dependencies are here What Developers want What AppSec want

What do I mean by an Dependency Anything that is external to the application under development Web Services Message Queues Inbound Http traffic (i.e. users) Other protocols (SMTP, FTP) Basically all inputs (i.e. the real Attack surface) For now lets focus on Web Services (i.e. json, xml and html traffic)

Why a new Test Framework Be able to answer: What APIs are used at each layer? What is their schema? string is not a type we need to ban strings What happens if the server s response is is malicious http://www.grahamlea.com/2015/07/microservices-security-questions/

Answer Questions What happens if data is malicious: from Client from Server to Server How can we have assurance of the Application properties prove there are no exploitable XSS

Why NodeJS It s JSON Native Fast Effective TDD Powerful APIs JsDom

TECHNOLOGIES

JSDom Ability to simulate the browser DOM in Node Even supports complex frameworks (and event loops) like Angular yes, you can run on NodeJS (i.e. server) Angular controllers, directives, services (with live Http Requests)

WallabyJS WallabyJS real time unit test execution real time code coverage

Unit/Integration tests That hit the live server and save the JSON

Git as database Content is stored as JSON on the file system Version control received data (using git diffs)

JSON Very good for data storage Powerful diffs (between test execution runs) provide visualisation of dynamic data identify inconsistent data Write tests against store JSON to confirm schema, data received easy to identify bad server data deliveries (for example: multiple requests required, when one should be used) Over supply of data (i.e. assets sent when they are not needed by client) Confirms happy paths data Will be used for payload injections and DoS tests

Microservices Surrogate dependency is a model/template for dedicated micro-services Eventually Microservices should replace the original Surrogate dependency the Microservices will have their own Surrogate dependencies

JSDom Used to load html pages and render the Javascript Much better than selenium and PhatomJS since it is native to Node Test execution is super fast

XSS Proxy New module will add ability to act like a proxy make requests to live server when request is not in cache save response from live server in cache Idea is to auto-generate the tests for the requests recorded This will make it easier to create new surrogate dependencies projects

Containers Best surrogates are the real code running inside a container 2nd best solution is when the surrogates only exist on the 2nd level of dependencies Btw, if the app your are coding today is not designed to support containers (i.e micro services) in the near future Where you will be able to run dozens, hundreds or thousands versions in a separate container (aka Docker) You are not aligned with the next major dev revolution (similar to git) In a couple years, your app will be as legacy as what you today call legacy key vision is that each user should run in it s own container

Open source project XSS Proxy is already there https://github.com/o2platform/node-ssl-strip Other code coming soon to OWASP Be involved :) Your developers will love it and you will dramatically improve yours testing capabilities

Thanks, any questions @diniscruz dinis.cruz@owasp.org