Continous Security - That Conference

53

Transcript of Continous Security - That Conference

Page 1: Continous Security - That Conference
Page 2: Continous Security - That Conference
Page 3: Continous Security - That Conference

Bear ProofApplicationsUsing Continuous Security to

Mitigate ThreatsWendy Istvanick -

[email protected]

Page 4: Continous Security - That Conference

What I Will Cover

Attack VolumesRecent AttacksTaking an Agile ApproachProject OverviewTool SurveyWrap Up

Page 5: Continous Security - That Conference

Attack Volumes

Page 6: Continous Security - That Conference

http://www.informationisbeautiful.net/visualizations/worlds-biggest-data-breaches-hacks/

Page 7: Continous Security - That Conference

High Profile Attacks

Page 8: Continous Security - That Conference

Target (Nov-Dec 2013)

Unnecessarily Exposed Vendor ListPhishing AttackInadequate Network

SegmentationOut of Date SoftwareIn Memory DataMissed Internal AlertsDefault Username/Password

40 million cards

70 million

Customers

2000

Stores

Page 9: Continous Security - That Conference

Stolen Vendors CredentialsImproper ConfigurationsImportant Anti-Virus Feature Turned OffPOS Systems Running on Windows XPUnencrypted Data In Transit

Improper Segmentation between Corporate and POS NetworksInadequate Monitoring

Home Depot (Apr-Sep 2014)

56 million cards

53 million

EMail

addresses

2200 Stores

Page 10: Continous Security - That Conference

Sally Beauty (Mar 2014)

Credentials Taped to LaptopNetwork Admin Credentials

in VB ScriptsInstalled Malware on Cash

Registers

2600

Stores

260,000 cards

Page 11: Continous Security - That Conference

An Agile Approach

Page 12: Continous Security - That Conference

Testing

Unit Tests

Service Tests

UI Tests

Page 13: Continous Security - That Conference

Continuous Delivery

Code

Code

Code

Config

Build Test

Package

Integration

Staging

Production

Env1

Env2

Env3

Testing Environments

Build Test & Release

Page 14: Continous Security - That Conference

How Can We Apply This to Security?

Page 15: Continous Security - That Conference

Project Overview

Page 16: Continous Security - That Conference
Page 17: Continous Security - That Conference

Tool Survey

Page 18: Continous Security - That Conference

If checking for vulnerable components

is good,

we will do so every time we commit code.

Page 19: Continous Security - That Conference

Objenesis

Vulnerable Components

GuavaMyBatis JUnit Hamcrest

Hamcrest Hamcrest

Mockito

#9

Page 20: Continous Security - That Conference

Vulnerable Components

http://www.aspectsecurity.com/research-presentations/the-unfortunate-reality-of-insecure-libraries

We studied the 31 most popular Java frameworks and security libraries downloaded from the [maven central]

and discovered that 26% of these have known vulnerabilities.

More than half of the Global 500 use software built using components

with vulnerable code.

Page 21: Continous Security - That Conference

Spring Remote

Code Execution

RubyGemsHostnameValidation

Allowed a request without an identity token to

gain full permissions to any

web service.

Vulnerable Components - Examples

https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities

Apache CXF Authentication Bypass

(Not Apache App Server)

Checkmarx CxSAST

(Formerly CxSuite)

Allowed execution of arbitrary code via expression

language.

Could be used to take over a server.

Allowed remote unauthenticated users to bypass

sandbox protection

mechanism.

Could be used to execute arbitrary

C# code.

Hostname not validated when fetching gems.

Could be used to execute a “DNS hijack attack”.

Page 22: Continous Security - That Conference

Vulnerable Components - The Tools

CSharpSafeNuGet - MSBuild TaskOWASP Dependency Check

JavaOWASP Dependency Check

RubyBundler AuditDawnscanner

CSharpSafeNuGet - MSBuild TaskOWASP Dependency Check

JavaOWASP Dependency Check

CSharpSafeNuGet - MSBuild TaskOWASP Dependency Check

Page 23: Continous Security - That Conference

Vulnerable Components - Tool Integration

Page 24: Continous Security - That Conference

If updating our dependencies

is desired,

we will run canary builds

regularly to tell us when we can

update.

Page 25: Continous Security - That Conference

Objenesis

Upgrading Dependencies

GuavaMyBatis JUnit Hamcrest

Hamcrest Hamcrest

MockitoMockito

Hamcrest

Objenesis

Page 26: Continous Security - That Conference

Upgrading Dependencies - The Tools

Code

Code

Code

Config

Build Test

Package

Integration

Staging

Production

Env1

Env2

Env3

Testing Environments

Page 27: Continous Security - That Conference

If not exposing secrets is important,

we will ensure they are never committed

to our version control system.

Page 28: Continous Security - That Conference

Exposing Secrets

Page 29: Continous Security - That Conference

A talisman is an object which is believed to contain

certain magical or sacramental properties which would provide good luck for the possessor or possibly offer protection

from evil or harm.

Exposing Secrets - The Tools

https://en.wikipedia.org/wiki/Talisman

Page 30: Continous Security - That Conference

Exposing Secrets - Tool Integration

Page 31: Continous Security - That Conference

Exposing Secrets - Tool Integration

19:54:42.329 :findSecrets FAILED19:54:42.336 19:54:42.336 BUILD FAILED19:54:42.336 19:54:42.336 Total time: 3.085 secs19:54:42.339 19:54:42.339 FAILURE: Build failed with an exception.19:54:42.339 19:54:42.339 * What went wrong:19:54:42.339 Execution failed for task ':findSecrets'.

java/build.gradlejava/gradle/wrapper/gradle-wrapper.jarjava/gradle/wrapper/gradle-wrapper.propertiesjava/gradlewjava/gradlew.batjava/notReallyAn._rsa…java/src/vulnerableCheckSuppression.xmlThe following errors were detected in java/notReallyAn._rsa

The file name "java/notReallyAn._rsa" failed checks against the pattern ^.+_rsa$

Page 32: Continous Security - That Conference

If searching forpossible attack vectors

for our web sitesis good,

we willautomate this search.to our version control

system.

Page 33: Continous Security - That Conference

Finding Vulnerabilities

Page 34: Continous Security - That Conference

Finding Vulnerabilities - The Tools

HTML

Ajax

ExtensionsPort ScanningFuzzingLDAP InjectionSession Fixation

OWASP ZAP

Page 35: Continous Security - That Conference

OWASP ZAP

Page 36: Continous Security - That Conference

OWASP ZAP

Page 37: Continous Security - That Conference

OWASP ZAP

Page 38: Continous Security - That Conference

Finding Vulnerabilities - Tool Integration

PluginsJenkins (https://wiki.jenkins-ci.org/display/JENKINS/ZAProxy+Plugin)

Maven (https://github.com/pdsoftplan/zap-maven-plugin)

Grails (https://grails.org/plugin/zap-security-tests)

Command Line Interface

Page 39: Continous Security - That Conference

Wrap Up

Page 40: Continous Security - That Conference

Java Source

Ruby Source

Current Pipelines

C# Source

Java Secrets

C# Build

C# Test

Java Build

Java Test

Ruby Build

Ruby Test

Java Comps

C# Comps

Ruby Comps

JS Source

Page 41: Continous Security - That Conference

C-Sharp Pipeline

Page 42: Continous Security - That Conference

Ruby Pipeline

Page 43: Continous Security - That Conference

Java Pipeline

Page 44: Continous Security - That Conference

All Pipelines

Page 45: Continous Security - That Conference

JS Deploy

Java Deploy

C# Deploy

Ruby Deploy

Java Source

Ruby Source

JS Source

Targeted Pipelines

C# Source

JS Secrets

C# Secrets

Java Secrets

Ruby Secrets

C# Build

C# Test

Java Build

Java Test

Ruby Build

Ruby Test

JS Comps

Java Comps

C# Comps

Ruby Comps

OWASPZAP

Page 46: Continous Security - That Conference

Potential Downsides

False PositivesLonger Running BuildsWon’t Catch EverythingNew Things Everyday

Page 47: Continous Security - That Conference

Attack Tie Backs - Target

ZAP testing might have highlighted vulnerability in vendor portalUp to date credit card

system could have eliminated in memory credit card data

Page 48: Continous Security - That Conference

Attack Tie Backs - Home Depot

Up to date POS OS may have eliminated vulnerabilities

Page 49: Continous Security - That Conference

Attack Tie Backs - Sally Beauty

Secrets may not have been discovered$

Page 50: Continous Security - That Conference

Application Code: https://github.com/wendyi/continuousSecurity*

* = Csharp | Java | Ruby | Web

Pipelines: https://github.com/wendyi/continuousSecurityCi

Slides:http://www.slideshare.net/WendyIstvanick

Links

Page 51: Continous Security - That Conference

Next Steps

Finish Wiring Up Existing ChecksContribute Talisman ChangesFinish End to End CodeWire Up ZAPSet Up Canary BuildsFind Other Tools to Include

Page 52: Continous Security - That Conference

Thank You Questions?

Page 53: Continous Security - That Conference