HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic...

26
HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO AUTOMATE APPSEC TESTING AND PROTECTION Jeff Williams | CTO and cofounder | [email protected]

Transcript of HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic...

Page 1: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

HOW TO BUILD AWESOMESECURITY INSTRUMENTATION TO AUTOMATE APPSEC TESTING AND PROTECTIONJeff Williams | CTO and cofounder | [email protected]

Page 2: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

200X MORE FREQUENT DEPLOYS

24X FASTER RECOVERY TIMES

3X LOWER CHANGE FAILURE RATE

10X AMOUNT OF CODE

FLOW | FEEDBACK | CONTINUOUS EXPERIMENTATION & LEARNINGDEVELOPMENT’S RESPONSE:

THE GOAL IS SIMPLE:

DELIVER VALUE

TO CUSTOMERS,

FASTER

SECURE

SECURITY BACKLOG

REMEDIATION

ANALYSISCLOUD CONTAINERSMICROSERVICES / API’SOPEN SOURCECI/CD

MODERN SECURITY CAN BE MORE!

WHY NOT?

INCREASE

VELOCITY

MANAGE

RISKDRIVE

INNOVATION

DECREASE COMPLEXITY

MINIMIZE DELAYS

10X

CODE

TIME

CAPA

CITY

DEVELOPMENTSECURITY

SECURITY MODERNIZATION

DEVOPS MANDATE

DIGITAL TRANSFORMATION

LEGACY TOOL REVIEW

BREACH PREVENTION

AUTOMATION INITATIVES

MAJOR INITIATIVES:

LEGACY OUTCOMES:

1. SECURITY SLOWS VALUE DELIVERY STREAM

2. DEVELOPMENT BYPASSES SECURITY & RELEASE INSECURE CODE

3. RUN SECURITY ASYNCHRONOUS TO SDLC AS A COMPLIANCE CHECK

HOW DO YOU SECURE MODERN SOFTWARE WITH LEGACY TOOLS?SECURITY’S CHALLENGE:

DEV OPSSEC

MANUAL

PROCESS

ES

(I.E. SCA

N & TRIAGE)

TRASH

IMPOSSIBLEECONOMICS

TOOLS

EXPERTS

COMPLEXITY

FRICTION

Page 3: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

Average serious vulnerabilities:

26.7Average serious vulnerabilities:

26.72002 2019

1970

FormalMethods

1991

SW CMM

1985

TCSECDOD 5200.28

1997

SSE-CMM

1998

VulnerabilityDisclosure

1999

PenetrationTesting

1998

CommonCriteria

2001

OWASPT10

2002

DynamicScanning

2003

StaticAnalysis

2004

WAF

2005

DeveloperTraining

2009

BSIMMOpenSAMM

2013

DevOps

2007

Compliance

2017

DevSecOps

2015

Shift Left

IS IT WORKING YET?

Page 4: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

4

DEVSECOPS IS ABOUT CHANGING *SECURITY* NOT *DEVOPS*

https://itrevolution.com/the-three-ways-principles-underpinning-devops/

1. Establish work flow

2. Ensure instant feedback

3. Culture of experimentation

1. Establish security work flow

2. Ensure instant security feedback

3. Build a security culture

DEVOPS DEVSECOPS

Page 5: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

5

INSTRUMENTATION CHANGES EVERYTHING

Page 6: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

6

WHAT IS SECURITY INSTRUMENTATION?

Platform

Agent Loader

ClassClassClass

ClassClassClass

Transformer

OriginalCode

InstrumentedCode

Add sensors here!

Run instrumented code!

Page 7: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

7

1. SECURITY TESTING WITH INSTRUMENTATION

Put SecurityAdvice inside Statement.execute

Report rule violation when it happens

Page 8: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

8

DEMO: TESTING FOR SQL INJECTION

Now your normal test cases fail for security reasons if you

have a vulnerability!

Page 9: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

9

TYPICAL “SCANNING” APPROACH

SCANNER SIMULATES ATTACKS

TO DETECT VULNERABILITIES

ATTACKS

HTTP RESPONSES

PROBLEMS WITH SPEED, SCALE, AND ACCURACY

• HTTP RESPONSE

Page 10: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

10

SECURITY SPECIALISTS TRANSLATE NEW THREATS INTO RULES

TESTING WITH AN AGENT ON THE INSIDE!

AGENT OBSERVES APPLICATION BEHAVIOR DIRECTLY

DEVELOPER USES APPLICATION

NORMALLY

NORMAL APP USE

DETAILEDSECURITY ANALYSIS

RESULTS

• EXACT LINE OF CODE, FULL QUERY, FULL HTTP REQUEST, CONTROL FLOW, DATA FLOW, LIBRARIES, CONFIGURATION, ETC…

Page 11: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

11

DEMO:

“NO CODE” SECURITY OBSERVABILITY!

Page 12: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

12

DEMO:

TESTING ACCESS CONTROL!

Page 13: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

13

DEMO:

MAKING SECURITY OBSERVABLE WITH INSTRUMENTATION

Page 14: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

14

DEMO: MAKING SECURITY OBSERVABLE WITH INSTRUMENTATION

Page 15: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

15

DEMO: PREVENTING COMMAND INJECTION EXPLOITS WITH INSTRUMENTATION!

Page 16: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

16

DEMO: PREVENTING COMMAND INJECTION

Create accurate appsecvisibility in OPS

Page 17: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

17

DEMO: PREVENTING EXPRESSION LANGUAGE INJECTION EXPLOITS WITH INSTRUMENTATION!

Page 18: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

18

DEMO: PREVENTING EXPRESSION LANGUAGE INJECTION

Runtime Protection!

Page 19: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

19

In DEV and TEST

RASP

ConfigSensors

CodeSensors

Control Flow Sensors

HTTPSensors

BackendSensors

Data Flow Sensors

LibrarySensors

IAST

In PROD

✘ExploitPrevented

VulnerabilityConfirmed

ConfigSensors

CodeSensors

Control Flow Sensors

HTTPSensors

BackendSensors

Data Flow Sensors

LibrarySensors

Interactive Application Security Testing detects vulnerabilities in both custom code and libraries during normal use

Runtime Application Self-Protection detects attacks and prevents exploits in both custom code and libraries

Page 20: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

20

Network

Host

Container

Application/API

Security Instrumentation

NetworkScanning

and Firewalls

Host

Container

Application/API

Internet, Intranet,Data Center

Internet, Cloud

IAST and RASP

Yesterday: Scanning and firewallingat network layer

Today: Security Instrumentation meansaccuracy, speed, scalability

SECURITY WORKS BETTER FROM INSIDE-OUT

Page 21: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

21

• SSS 9.1 | RUNTIME APPLICATION SELF-PROTECTIONThe software detects and alerts upon detection of anomalous behavior, such as changesin postdeployment configurations or obvious attack behavior.

• SSS 10.2 | INTERACTIVE APPLICATION SECURITY TESTINGVulnerabilities in the software and third-party components are tested for and fixed prior torelease using … [techniques including]… interactive application security testing (IAST) ….

• SA-11(9) | INTERACTIVE APPLICATION SECURITY TESTINGRequire the developer of the system, system component, or system service to employinteractive application security testing (IAST) tools to identify flaws and document the results.

• SI-7(17) | RUNTIME APPLICATION SELF-PROTECTIONImplement [Assignment: organization-defined controls] for applicationself-protection at runtime (RASP).

SECURITY INSTRUMENTATION STANDARDS

NIST 800-53

SOFTWARESECURITYSTANDARD

Page 22: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

22

TURNING SECURITY INTO CODE

CI/CD PRODDEV

Your Development Process and Toolchain

…ACTUALLY, THE REAL VULNERABILITIES ARE IN THE PIPELINE ITSELF

automated

manual

before after

Page 23: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

PDFPDF

CI/CD

PRODSTAGETEST

TRACK RUN DAST

CORRELATE

RUN SAST PENTEST

CI/CD

PRODSTAGETEST

Continuous automated security testingand exploit prevention

Accurate, RealtimeTelemetryAttacks

SEC

DEV OPS

FLOW(BUSINESS VALUE)

TRADITIONALSECURITY (OUTSIDE – IN)

MODERNSECURITY (INSIDE – OUT)

APPSEC’S ABILITY TO DELIVER VALUE TO CUSTOMERS, FASTER

“Aaaaah!”

DEV

RUNTIME

APP SERVERFRAMEWORKS

LIBRARIESCUSTOM CODE

Self-Testing

Self-Protecting

VulnerabilitiesInstrumentation

Sensors

LIBRARIES

CUSTOM CODEDEV

TRIAGE

PDF

FalsePositives!

Backlog

RUN SCA

RUN SAST

RUNTIMEAPP SERVER

FRAMEWORKSLIBRARIES

CUSTOM CODE

WAF

Page 24: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

Development

Security

Harmony

Page 25: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

25

https://www.contrastsecurity.com/ce

C O M M U N I T Y E D I T I O N

AVAILABLE NOW COMING SOON

A totally free and full-strength application security platform

Protect against attacks with RASP Find vulnerabilities with IAST Secure open-source with SCA

Page 26: HOW TO BUILD AWESOME SECURITY INSTRUMENTATION TO … · 1 day ago · OWASP T10 2002 Dynamic Scanning 2003 Static Analysis 2004 WAF 2005 Developer Training 2009 BSIMM OpenSAMM 2013

26

ASK ME ANYTHING

Jeff Williams, Cofounder and CTO@planetlevel