Introduction To Devsecops: Powerful Automation
Introduction To Devsecops: Powerful Automation
Introduction to CONTENTS
öö Introduction
DevSecOps
öö DevSecOps Core Practices
The exact formulation is still emerging, but we think it’s useful to capture development teams by 2021. Organizations practicing DevSecOps have
emerging practices for achieving security while building applications and shown impressive results. These early adopters are 2.6x more likely to have
APIs without disrupting high-speed software pipelines. security testing keep up with frequent application updates and show a 2x
reduction in time to fix vulnerabilities.
• DevSecOps is full stack: DevSecOps spans the entire IT stack and includes
network, host, container, server, cloud, mobile, and application security. Understanding the different types of security work and their value to your
Increasingly, all of these layers are turning organization is critical to successful DevSecOps initiatives. Until you truly
into software, which makes application security a critical focus understand the work, it’s going to be difficult to deliver it effectively. You
for DevSecOps. can learn more about this topic and DevOps in general by reading books
• DevSecOps is full SLC: DevSecOps also spans the full software lifecycle, like The Phoenix Project and The DevOps Handbook.
Powerful
automation
for your entire
hybrid and
cloud-native estates.
Learn more
1
Say goodbye
to soul-crushing
manual tasks
From automating simple tasks to securing
global infrastructure, Puppet’s products and
open source projects can/will help you:
• Enforce infrastructure configuration and compliance at scale
• Secure your infrastructure and fix vulnerabilities faster
• Deliver cloud-native infrastructure quickly and consistently
we ever detect or stop all attackers. Therefore, • Celebrate the knowledge gleaned from
Prevent and Protect the best security strategies involve a balance of security issues rather than blaming those
runtime protection during operations (SecOps). • Spend more effort on upgrading practices
and preventive measures than vulnerability
remediation and incident response.
Once we are done with this security challenge, we can start in on the next
one. Each time we complete a challenge, we leave behind the infrastructure
to make sure it stays secure. Note that we don’t want to create a fragment-
ed set of individual defenses, so it’s important to make good decisions over
time about security architecture.
In this diagram, we show how security fits into the normal DevOps cycle at In DevSecOps, we don’t let perfect be the enemy of good. We’re looking to
a very high level. Notice that these security augmentations are designed to improve our security story on every iteration. Your first attempt might be a
fit naturally into the process. No extra steps, no gates, no delays. Instead, partial solution with sampling instead of a rigorous defense and complete
we will cycle quickly on small security tasks that are structured to be deliv- testing. Our goal is to get this cycle running and make measurable progress
ered by the development and operations teams using the tools they already over time.
use. We will explore these core practices in detail later.
CREATING YOUR DEVSECOPS PIPELINE
“HELLO, WORLD!” A FIRST STEP TOWARDS DEVSECOPS
A DevSecOps pipeline is the set of tools and processes that continuously
Let’s use a very simple example to demonstrate. Imagine that we have a
performs security work as code is written, integrated, tested, deployed,
web application being built by a DevOps project. All we know is that the ap-
and operated. While there’s really just one delivery pipeline, having a
plication didn’t do well on a recent security scan. There is no threat model
security “view” of your pipeline may help you understand the security
or security architecture. How should we get started with DevSecOps?
value stream separately, revealing bottlenecks and inspiring confidence
in the results. The DevSecOps pipeline spans the full lifecycle, handling
We’re not going to try to secure everything at once. both development (vulnerabilities) and operations (attacks).
The most critical scan findings indicated that this
The goal of the security part of our pipeline is to provide vulnerability in-
1. Analyze: Identify application has obvious SQL injection problems.
formation to development team members in real time, through the tools
Your Next Most We want to make tangible progress quickly, so we
they are already using. As we move into operations, our goal is to create
Critical Security decide to deal with this first. We’re going to build
visibility into who is attacking,what attack vectors they are attempting
Challenge our defenses and assurance over time in small
to exploit, what systems they are targeting, and whether the attacks are
pieces, not all at once. We create a JIRA ticket to
being prevented successfully.
address SQL injection.
The main cycle in the DevSecOps pipeline involves security tools, an ana- Implementing a notification infrastructure encourages downstream secu-
lytics hub, and integrations with development and operations tools. The rity stakeholders (developers, testers, operations, audit, executives, etc.)
security tools at the bottom of the diagram identify vulnerabilities in appli- to work closely with upstream providers (like security testers) to ensure
cations and APIs across development, test, and production environments. that the work is optimized for them. Your DevSecOps pipeline should be
In production, other tools monitor and prevent attacks. The telemetry from designed for very tight feedback loops — think seconds, not hours, weeks,
these tools feeds into an analytics system for historical tracking, analysis, or months. The faster you can get feedback to the people that need it, the
and notifications. Common events include: more secure and cost-effective your DevSecOps pipeline will be.
• Custom code vulnerabilities. When you start, your DevSecOps pipeline will only verify a few simple
• Known vulnerabilities in libraries and frameworks. things about your software. But over time, as you address challenges, you
• Attacks on custom code vulnerabilities. will automate verification of more and more of your security strategies and
• Attacks on libraries and frameworks. defenses. Over time, the goal is to migrate from manual security testing to
• Application inventory, including all libraries and frameworks. a fully automated pipeline capable of deploying secure code directly into
• Software architecture details. production without gates.
In general, DevSecOps favors the use of notifications (real-time integrations CHOOSING SECURITY TOOLS AND TECHNOLOGIES
into normal development and operations tools) over PDF reports. However, Here are a few of the attributes to consider when choosing security tools
for some purposes, such as compliance, PDF reports may be generated. and technologies to build your DevSecOps pipeline across the entire SLC.
Notifications alert team members who need to know about security events Please note that there is no one set of best tools for DevSecOps. The tools
immediately through the tools they are already using as part of their you choose should match the way that you build software, your goals, your
normal job. While a single analytics system would be ideal, today, you may culture, and the other technologies you use.
need separate systems for vulnerabilities and threat events.
Think of all your security testing and attack moni- Policy actually covers the risks you need it to cover. Many
toring as a set of sensors that is instrumenting your Coverage products have surprising shortcomings in this area. See
software development organization and systems. The the OWASP Benchmark Project for help.
support, ChatOps integrations like HipChat and Slack, ture to make an informed decision about the next most critical security
notifications with PagerDuty and VictorOps, and SIEM challenge. What is the cost to the company of certain kinds of attacks? What
integrations like Splunk. is the cost of implementing preventive measures for those attacks? Try
to use data from both internal and external sources to figure out the next
thing to do that will most effectively reduce risk.
a partial measure or a tiny improvement to your most critical challenge. and security research to continuously zero in on your next most critical se-
Working in small increments makes sure we stay on track. curity challenge. Note that this process is significantly different from trying
to assess all your threats. Many organizations get overwhelmed trying to
When deciding what to work on next, the team looks at all the potential protect against everything at once.
security “work” available and makes it visible. The team might add new fea-
DevSecOps Threat Intelligence, Security Research, and As part of the defense strategy, you should also
Security Architecture
consider how to configure, operate, and use these
Operational
External sources: ISACs (STIX/TAXII), OWASP, SANS, defenses. This guidance should apply to end
Guidelines
BlackHat, DefCon, LASCON, DevSecCon, CISO events, users and operations staff, and even indicate how
Threat friendly peer companies, etc. developers should use the defense effectively.
Intelligence Internal sources: Monitor your systems for attacks The final part of the defense strategy is to detail
Security Testing
and learn from the data. Understanding actual how you will continuously verify the correctness
Approach
attacks is a major factor in prioritizing. and effectiveness of the defense strategy.
Security research should focus on challenging Your strategy is right when you can easily answer with confidence when
security architectures and identifying new strategic anyone asks, “How do you protect against X?” Having a clear, concise, de-
Security
ways to improve security. Where possible, work with fensible answer to this kind of question can not only provide an easy path
Research
development to enhance the DevSecOps pipeline to compliance but can also provide business advantage over competitors.
with new testing methods.
Your defense strategy doesn’t have to be perfect from the very start. It’s
There is a dearth of great threat modeling and far better to start with a basic defense and evolve it over time. In fact, after
Security security architecture tools. But some interesting you implement a basic defense, you may choose to work on another, more
Architecture projects include OWASP Threat Dragon, IriusRisk, pressing, threat. The key to DevSecOps is to continuously reprioritize based
and Chaos Engineering (Chaos Monkey, ChaoSlingr). on the threat and your existing defenses. The ability to respond quickly is
critical for a world of continuously changing threats.
You’ll have to work out your own cadence for re-examining your threat
The work of actually implementing the security defense shouldn’t be any dif-
model. So, increasing your cycle speed will have a direct effect on the level
ferent than any other feature, and should, to the maximum extent possible, be
of security you are able to achieve. And because DevSecOps adds to your
delivered as code or configuration with everything in source control. Managing
security incrementally with continuous security verification (discussed
security in this way makes it possible to test and redeploy at any time, ensuring
below), you have protection against backsliding.
that defenses are in place, working correctly, and properly configured.
Every tool that you adopt means additional You may be using a security testing tool
process steps, a full set of integrations, and that covers this risk. It's critical to verify that
Do we already test for it?
a team of people to configure, run, and your tool does a good job of accurately and
Avoid “Tool Soup” interpret. Choose powerful platforms that efficiently verifying your security defense.
very difficult to verify this by looking at the source code, as there are so the number of things that you need
many ways that this might be accomplished. human experts to test, bug bounties
bounties, red team exercises, and manual
DevSecOps Security Testing Funnel Do we need human penetration testing can provide useful
Think carefully about exactly what you want to to test automatically. Ensure that these
test and the results you want. Direct, complete efforts deliver rules, test cases, and other
What are we trying
verification of application behavior is always automation, not PDF reports.
to test?
best, but you can use sampling, fuzzing, design
Examples: BugCrowd, HackerOne
analysis, and other techniques.
It’s impossible to know everything, so
certain kinds of testing rely on volume and
Probably, yes. But you should clearly prioritize Are we also testing for
randomness to try to force applications
things that are the most critical to security and what we didn’t think of?
Do we need to test it? to behave badly. Fuzz testing and chaos
the most likely to be discovered and exploited
engineering tools can help here.
by an attacker.
Any security issues discovered during testing should feed into the DevSec-
Are we able to verify that the application always
Ops management infrastructure described above to notify all the people
follows a known good pattern of execution
that need to know through the tools they are already using.
Positive or negative (positive security) or will we have to resort
testing? to trying to verify that the application never
4. DEFEND: DETECT ATTACKS AND PREVENT EXPLOITS
follows any of the known bad patterns of DevSecOps organizations recognize that you can never test yourself secure,
execution (negative security)? so, they adopt a balanced approach that focuses on minimizing vulnerabil-
ities during development and on identifying and preventing vulnerabilities
from being exploited in production. While these two activities have tradi- STANDARD DEFENSES AND ENTERPRISE SECURITY AR-
tionally been separate, DevOps has brought them together and DevSecOps CHITECTURE
projects support the full software lifecycle. Generally, DevSecOps organizations — particularly those with large
application portfolios — prefer standard security defenses that are heavily
DevSecOps Attack Detection and Prevention Tools tested for correctness and effectiveness. Don’t reinvent authentication,
authorization, encryption, etc. for every application and API you build. This
reduces the amount of security work that has to be done and simplifies the
RASP uses application instrumentation to add attack
organization’s security architecture. Achieving effective enterprise security
detection and prevention directly to applications
Runtime architecture in a DevSecOps manner is beyond the scope of this document,
regardless of where or how they are deployed.
Application but these guidelines are good first steps.
DevSecOps projects can use RASP to achieve
Self Protection
accurate attack-blocking and the flexibility to easily
(RASP)
deploy in cloud/container environments. You should generally use popular, well-tested libraries
for security features, as it is dangerously easy to
Examples: Contrast Protect, Prevoty, Immunio.
make small but disastrous mistakes writing your own.
Security Probably the best approach here is to assemble your
WAFs have been on the market since the early
Libraries own enterprise security API that implements, extends,
2000s and have a history of complex configuration
wraps, or is based on existing security libraries like
and spotty protection. Nevertheless, a DevSecOps
Web Application Spring Security, OWASP ESAPI, BouncyCastle, OWASP
project might be able to use a WAF for basic
Firewall (WAF) Encoder, AntiXSS, AntiSamy, Jasypt, etc.
protection or as a platform for virtual patches.
DevSecOps organizations must know the Finally, re-establish continuous security for each of
exact version of every library, framework, your newly virtualized workloads by selecting and
Reload
application, and API that is running on deploying modern protection technology at the
every server in every environment. The best application, library, container, and network layers.
Self-Inventory approach is to enable all your systems to self-
inventory by reporting their “bill of materials”
This strategy is very compatible with DevSecOps, as it allows for efficient
to a central database. This “always up to date”
centralized security management with distributed enforcement for
inventory will enable you to respond quickly
speed and accuracy.
to novel attacks.
• amazon.com/Phoenix-Project-DevOps-Helping-Business/dp/0988262592
• https://www.youtube.com/watch?v=cIvOth0fxmI
• dzone.com/articles/a-devops-approach-to-building-security
• contrastsecurity.com/continuous-app-sec-cas
• linkedin.com/pulse/lose-security-wheel-edward-amoroso
• ruggedsoftware.org/
• ca.com/content/dam/ca/us/files/msf-hub-assets/research-assets/
integrating-security-into-the-dna-of-your-software-lifecycle.pdf
• whitehatsec.com/news/12th-annual-application-security-statistics-
report
Devada, Inc.
600 Park Offices Drive
Suite 150
Research Triangle Park, NC
888.678.0399 919.678.0300
DZone communities deliver over 6 million pages each month to
more than 3.3 million software developers, architects, and de- Copyright © 2019 Devada, Inc. All rights reserved. No part of this
cision makers. DZone offers something for everyone, including publication may be reproduced, stored in a retrieval system, or
news, tutorials, cheat sheets, research guides, feature articles, transmitted, in any form or by means electronic, mechanical,
source code, and more. "DZone is a developer’s dream," says PC photocopying, or otherwise, without prior written permission of
Magazine. the publisher.