30
8 PATTERNS FOR CONTINUOUS CODE SECURITY By Chris Wysopal, CTO Veracode produced for Threat Stack

8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Embed Size (px)

DESCRIPTION

Deploying insecure web applications into production can be risky -- resulting in potential loss of customer data, corporate intellectual property and/or brand value. Yet many organizations still deploy public-facing applications without assessing them for common and easily-exploitable vulnerabilities such as SQL Injection and Cross-Site Scripting (XSS). This is because traditional approaches to application security are typically complex, manual and time-consuming – deterring agile teams from incorporating code analysis into their sprints. But it doesn’t have to be that way. By incorporating key SecDevOps concepts into the Software Development Lifecycle (SDLC) – including centralized policies and tighter collaboration and visibility between security and DevOps teams – we can now embed continuous code-level security and assessment into our agile development processes. We’ve uncovered eight patterns that work together to transform cumbersome waterfall methodologies into efficient and secure agile development.

Citation preview

Page 1: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

8 PATTERNS FOR CONTINUOUS CODE

SECURITYBy Chris Wysopal, CTO Veracode

produced for Threat Stack

Page 2: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Introductions

Chris WysopalCo-Founder and CTO, Veracode

Chris Wysopal, co-founder and CTO of Veracode, is recognized as an expert and a well-known speaker in the information security field. He has given keynotes at computer security events and has testified on Capitol Hill on the subjects of government computer security and how vulnerabilities are discovered in software. At Veracode, Mr. Wysopal is responsible for the security analysis capabilities of Veracode technology. He can be found on Twitter as @WeldPond.

Page 3: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Best Practices of Secure Agile Teams

Page 4: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Web applications are the #1 attack vector leading to data breaches.

According to the 2014 Verizon Data Breach Investigation Report (DBIR)…

Page 5: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Deploying insecure web applications into production can be risky

…resulting in potential loss of customer data, corporate intellectual property and/or brand value!

Page 6: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Many organizations still deploy public-facing applications without assessing them for

common and easily-exploitable vulnerabilities such as SQL Injection and

Cross-Site Scripting (XSS).

Page 7: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

WHY?

Page 8: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Traditional approaches to application security are complex, manual and time-consuming, deterring agile teams from incorporating code

analysis into sprints.

Page 9: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

IT DOESN’T HAVE TO BE THAT WAY…

Page 10: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Just follow these eight patterns.

Incorporating SecDevOps concepts into the Software Development Lifecycle (SDLC), we can embed continuous

code-level security and assessment into our agile development processes.

Page 11: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

1. Think Like A Developer

Page 12: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

• Upload code to a cloud-based application security service, such as Veracode, directly from the IDE

!

• Analyze code automatically !

• Results downloaded to development environment — addressing vulnerabilities before check in

This finds vulnerabilities DURING coding instead of during a SEPARATE security hardening sprint.

How to do this in agile environments

Page 13: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

2. Find It Early. Fix It Early.

Page 14: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

• This makes vulnerabilities easier and less expensive to fix

!

• It reduces the overall risk of successfully delivering the team’s payload

!

• This allows continuous security assessments to fit into a one to two week sprint

Frequent assessments allow teams to identify and remediate blockers early in the cycle.

Page 15: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

3. Use Multiple Analysis Techniques For Optimum Coverage

And Accuracy

Page 16: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Achieving the broadest view of application security

Binary static analysis

Also known as “white box testing” or “inside out testing”, this analyzes data and control paths without actually executing the application, looking for vulnerabilities such as SQLi and XSS.

3 components:

Dynamic analysis (DAST) Manual penetration testing

Also known as “black box” or “outside in” testing, identifies exploitable vulnerabilities at runtime, during pre-production QA/staging.

This looks for vulnerabilities that can only be found by humans, such as Cross-Site Request Forgery (CSRF) or business logic issues.

Page 17: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

4. Automate To Blend In

Page 18: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

• Automation inside the IDE (Eclipse): Used to build, upload, scan and download results, which are shown against the code inside the editor for easy remediation.

!

• Automation at team or release candidate stage: Allows the build server (Jenkins) to automatically upload build artifacts for assessment, using Veracode APIs.

!

• API-driven automation in bug tracking system (JIRA): Downloads results and manages vulnerability lifecycle.

!

• Tickets for vulnerabilities are triaged: This uses the same process as all other bugs.

!

Blending in with developers’ automated toolchains means leveraging tools they already use.

Page 19: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

When security assessments are blended in, developers don’t need to switch context

— and can work more efficiently!

Page 20: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

5. Play In The Sandbox

Page 21: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

• Consider an assessment sandbox a branch inside the application

!

• Developers scan the branch and understand if it will pass the current policy

!

• Each team can have a sandbox for merging multiple branches to assess the integration

!

!

Assess new code against the organization’s security policy without affecting policy compliance.

Page 22: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

6. Avoid Replicating Vulnerabilities

Page 23: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Developers work in copy and paste patterns. !

But when vulnerabilities get replicated across the code base, it magnifies risk across project. This causes

a “security debt” to clean up those vulnerabilities

The “copy and paste” effect

Page 24: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

7. Learn From Constant Feedback

Page 25: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Direct interaction between developers +

detailed vulnerability feedback =

self-reflection

Page 26: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Self-reflection allows developers to see their own coding habits and gain insights into how to develop more secure ones. !

“Oh I shouldn’t have coded it this way because as soon as I upload it, I’m going to see the same results.” !

!

Reuse secure patterns and avoid insecure ones!

The “aha” moment

Page 27: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

8. Be Transparent About Security Risk Via Policies

Page 28: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

This raises visibility into vulnerabilities and allows for triaging of every application-layer threat before release. !

•Triage involves answering: •“Do we need to remediate this vulnerability?” •“Can we mitigate instead, and if so, how?” •“Is this a risk we’re willing to accept?”

Using labels to identify vulnerabilities that violate corporate security policies

Visibility enables pragmatic discussions about risk within the normal agile sprint management process.

Page 29: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

Adopting these 8 patterns has helped Veracode and Threat Stack become more

!

efficient secure

successful !

in delivering code with short delivery cycles — without sacrificing security.

Page 30: 8 Patterns For Continuous Code Security by Veracode CTO Chris Wysopal

!

!

Start Implementing Continuous Code Security Today

!

!

threatstack.com veracode.com @threatstack @veracode