You are on page 1of 13

267 BROUGHT TO YOU IN PARTNERSHIP WITH

Introduction to CONTENTS

•  What Is DevSecOps?

•  Key DevSecOps Themes

DevSecOps •  Getting Started With DevSecOps

•  DevSecOps Core Practices

•  DevSecOps Additional Practices

•  What’s Next for DevSecOps?

•  References

ALIREZA CHEGINI
SENIOR DEVOPS ENGINEER, AZURE SPECIALIST AT S-RM

Today, most companies have implemented DevOps practices within their “security as code” culture that encourages security to be treated like
organization. DevOps provides a culture where teams can deliver reliable other software components of the SDLC pipeline.
software and updates faster. This approach presents an opportunity
Figure 1
for teams to focus on quality rather than wasting time on operations.
However, as a result, security practices are often left to security specialists
at the end of the delivery pipeline. A specialized security approach then
creates unnecessary overhead within the delivery process as unexpected
issues frequently arise at the end of delivery. Consequently, teams lose
time fixing the code and starting the same process repeatedly, ultimately
making delivery costly and inefficient.

DevSecOps has become increasingly important as most companies


have embarked on digital transformation. With these plans, companies
are moving to the cloud. This results in moving away from on-premises
infrastructures and transitioning to public cloud solutions. Cloud
providers offer cost-effective, scalable, highly available, and reliable
solutions. However, these advantages come with new security
challenges.

Security deserves a higher priority than ever before. With cloud


solutions, there is no room for mistakes. By not following security
requirements, you might open the door of your network to dozens of
security threats. Therefore, security should be considered earlier during
the design phase. Developers are more successful with this approach
because they first create a secure environment before developing their
features. Additionally, developers are more involved and aware of
security requirements since it is now part of development.

DevSecOps integrates security into DevOps as an integral component


of the SDLC instead of observing security as an afterthought. It
also distributes security responsibilities amongst team members.
In collaboration with security specialists, teams can implement a

REFCARD | FEBRUARY 2022 1


A faster, better way to secure
applications and infrastructure
Reduce cost and complexity with
infrastructure as code security
Unify security standards throughout the
development lifecycle with codified protection

Unleash the power of collaboration


Embed security into developer workflows to streamline
remediations and secure cloud infrastructure before deployment.

Shift-left to minimize risk and boost ROI


Improve efficiency and productivity by reducing time spent
addressing issues and configuring policies.

Automate patching and remediation at scale


Mitigate misconfigurations and reduce alerts by leveraging
automation across the entire development lifecycle.

FREE TRIAL
REFCARD | INTRODUCTION TO DEVSECOPS

WHAT IS DEVSECOPS? DEVSECOPS GUIDEPOSTS


DevSecOps is the full stack: DevSecOps spans the entire IT stack
THEME DESCRIPTION
and includes network, host, container, server, cloud, mobile, and
application security. All of these layers are increasingly turning Shift left From developers to DevOps engineers, everyone is
involved in security. Shifting security “left” means
into software, which makes application security a critical focus for
that security activities start during development
DevSecOps. DevSecOps spans the entire software development and extend throughout the SDLC, with continuous
lifecycle, including development and operations. In development, feedback at every stage from development to
production. See “DevSecOps Additional Practices”
security focuses on identifying and preventing vulnerabilities, while
below for more examples.
in operations, monitoring and defending against attacks are the main
Security as Code Like continuous integration and continuous
objectives. deployment, continuous security means that
teams respond to continuous threats with security
Can teams apply DevSecOps practices and tools to non-DevOps activities that are performed continuously, as part
projects? Absolutely. The ideas in this Refcard apply to almost any of the development and operations process, and
integrated into the tools team members are already
software project. If the goal is to produce highly secure software in the
using. Security as code is the key to automating
most cost-effective way possible, DevSecOps is the path forward. security operations, which leads to an end-to-end
process for security practices.
Organizations practicing DevSecOps have shown impressive results.
Integrate As a result of the shift-left approach, security is
According to Gartner, these early adopters are 2.6x more likely to have security into CI/ considered right away from the development stage.
security testing keep up with frequent application updates and show a CD workflows CI/CD workflow is not only for building and deploying
the application anymore. Security is the new part of
2x reduction in time to fix vulnerabilities.
this workflow in which every line of code is scanned
and verified against vulnerabilities. New tools make
Understanding the different types of security work and their value to the
this relatively easy for developers. These tools
organization is critical to successful DevSecOps initiatives. Until teams identify the security issues and immediately provide
truly understand the work, it will be difficult to deliver it effectively. To actionable solutions to fix the issues. Besides
security scanning, there are various methods to
learn more about this topic and DevOps in general, read books like The
conduct security testing. These are discussed later
Phoenix Project and The DevOps Handbook. in the “Creating Your DevSecOps Pipeline” section.

Continuous Security activities are performed continuously as


KEY DEVSECOPS THEMES security part of the development and operations process and
Every DevSecOps program is a little bit different. It is best to view integrated into the tools team members are already
DevSecOps as a journey. As organizations progress, they may find using to address continuous threats.

that different teams are at different points down the path. The themes Continuous When development is complete, monitoring begins;
monitoring we need to constantly track the behavior of our
below are not specific activities. Instead, they are guideposts to help
applications to detect anomalies and possible
make decisions along the journey. attacks. Continuous monitoring shows insight into
the application’s security and provides feedback for
Table 1 the development team.

DEVSECOPS GUIDEPOSTS Prevent and No team will ever produce perfect code. Nor will
protect they ever detect or stop all attackers. Therefore, the
THEME DESCRIPTION best security strategies involve balancing secure
coding during development (DevSec) and runtime
Empowering Development and operations are empowered
protection during operations (SecOps).
engineering to deliver secure applications into production
teams themselves. Security experts provide support as Cloud security Despite the numerous benefits introduced by cloud
coaches and tool smiths but do not have primary solutions, there is still a big challenge from a security
responsibility for security. Ensure that tools standpoint. On the cloud, developers can create
and processes are designed for developers and resources in a couple of minutes and connect to the
operations, not security experts. This way, teams public cloud. From a DevOps standpoint, this is quite
can share expertise amongst all members of a team. interesting since most organizations need to protect
customer data and/or avoid a security breach.
Making security In many organizations, security work is hidden,
visible unknown, and untracked. In the end, the value At the same time, organizations want to utilize the
of security is often not easy to understand. In benefits of cloud solutions. Here, a DevSecOps
DevSecOps, we make small security tasks that can approach becomes mandatory, and most security
be tracked, tasked, and measured like any other decisions should be made during the design phase.
type of work. Additionally, security becomes part of It is also easier to provide isolated environments
day-to-day responsibilities, allowing security to be for developers on the cloud to try out new features
transparent to everyone. without compromising any customer data.

REFCARD | FEBRUARY 2022 3 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | INTRODUCTION TO DEVSECOPS

THREE MISTAKES TO AVOID IN ENTERPRISE


MOST COMMON SECURITY CHALLENGES
ORGANIZATIONS
CHALLENGE DESCRIPTION
Before jumping into core practices, let’s address common problems
seen in most enterprise organizations: Lack of Sometimes developers need environments to test
playground for new software without common security limitations.
Table 2 developers These environments are known as a "SandBox,"
(cont'd) which are temporarily isolated environments.
MOST COMMON SECURITY CHALLENGES It is common that these environments have no
connection to any internal network and have no
CHALLENGE DESCRIPTION customer data. This way, engineers can easily
try new futures without being worried about not
Security in a silo Today, most companies have adopted Agile and
following common security compliances.
DevOps. However, it is still common for many of them
to keep security out of these processes and security
as a separate entity that specialized people can only THE “THREE WAYS” OF SECURITY
manage. For decades, both software and security have struggled with poor
On the one hand, this situation creates a silo around quality results, cost overruns, and processes that require experts.
security and prevents engineers from understanding
While DevOps has shown promise on the software side, security is
the necessity of security or applying security
measures from the beginning. Siloed security results still practiced in very traditional ways. DevSecOps is not just shoving
in an inefficient workflow for software development. traditional security practices and tools into DevOps.
The best practice is to share these responsibilities
across all team members instead of having a Instead, we must rethink the security work. We will need new practices
specialized security engineer.
and technologies to perform this work. We can give this transformation
Unbalanced Sometimes security becomes the priority, and structure using the “Three Ways” from The Phoenix Project. By framing
security then the organization loses creativity and quality
the problem this way, we can see that we need to get security work
performance as a price for security. Financial
institutions are an excellent example of where flowing, ensure instant security feedback, and create a security culture.
security is often unbalanced. Security has the highest
priority over any other software development Table 3
project in these scenarios. While this approach
is not wrong, the focus on security can lead to a THE “THREE WAYS” OF SECURITY
detrimental imbalance. As a result, other factors
APPROACH DESCRIPTION
such as performance and quality are neglected.
The focus and resource capacity are primarily spent Get your Most security work is monolithic and attempts to
making sure everything is secure. Consider both security work cover all risks in a single task, like a complete security
security and other essential application components flowing architecture or security scan. How do we get security
during the design stage to treat security as a regular work flowing?
aspect of the application. Then developers can
•  Make the work visible.
focus on development while feeling confident about
security instead of security departments delaying •  Work a single security challenge at a time.
development due to a lack of security considerations. •  Limit work in process.
•  Reduce handoffs.
Lack of Security obsession in some organizations leads to •  Automate everything.
playground for a strict environment with no room for creativity.
developers With security as the most critical factor, there is no Ensure instant Security is one of the most common causes of
playground environment; every new experiment or security technical debt, and the cost of this work increases
piece of software must go through a complicated feedback dramatically the farther it progresses across the
process and verification against security SDLC. Several reasons include lack of knowledge and
compliances before being used by developers. limited security specialists.

This prevents developers from having the space to •  How do we keep security work on track?
try out new things. Therefore, DevOps teams cannot •  Increase awareness about the importance of
do their job properly, which delays and negatively security.
impacts the entire SDLC. DevSecOps aims to keep •  Identify potential problems.
things secure so that everyone can do their job at
their pace. Developers are the source of creativity •  Make problems instantly visible.
in the software development workflow. This means •  Swarm on the problem.
that the more freedom they get, the more value they •  Seek the cause.
might deliver. Part of a developer's job is to try new
things out, break things, and learn from failure.
•  Ensure security “findings” are designed for
easy consumption.
•  Focus on providing a solution rather than
TABLE CONTINUES IN NEXT COLUMN
exaggerating the problem.
TABLE CONTINUES ON NEXT PAGE
REFCARD | FEBRUARY 2022 4 BROUGHT TO YOU IN PARTNERSHIP WITH
REFCARD | INTRODUCTION TO DEVSECOPS

THE “THREE WAYS” OF SECURITY augmentations are designed to fit naturally into the process: no extra
steps, no gates, no delays. Instead, teams cycle quickly on small
APPROACH DESCRIPTION
security tasks that are structured to be delivered by the development
Encourage a Many organizations have a security culture of blind and operations teams using the tools they already use. Let’s explore
security culture trust, blame, and hiding that prevents developers
these core practices in detail a bit later.
and operations from working with security. How do
we create a culture of security?
“HELLO, WORLD!” A FIRST STEP TOWARDS
•  Empower everyone to challenge security
DEVSECOPS
design and implementation.
•  Take every opportunity to make security Let’s use a straightforward example to demonstrate. Imagine that we
threats, policies, architecture, and have a web application being built by a DevOps project. All we know is
vulnerabilities visible. that the application didn’t do well on a recent security scan. There is no
•  Allow everyone on the team to participate in threat model or security architecture. How should we get started with
security.
DevSecOps?
•  Trust that engineering teams want to do the
right thing. 1. Analyze: Identify the next most critical security challenge
•  Celebrate the knowledge gleaned from
2. Security: Implement a defense strategy
security issues rather than blaming those
involved. 3. Verify: Automate security testing
•  Spend more effort on upgrading practices
4. Monitor and Defend: Detect attacks and prevent exploits
and preventive measures than vulnerability
remediation and incident response. 5. Documentation
•  Plan trainings and conduct workshops to
maintain continuous security throughout all 1. ANALYZE
teams.
Do not secure everything at once. The most critical scan findings
indicated that this application has obvious SQL injection problems. The
By following these three ways, teams will see security as a concrete
goal is to make tangible progress quickly, so it is best to deal with this
output from the development process. It is a combination of security
first. First, build defenses and assurance over time in small pieces, not
features and assurance, captured in a tangible way. By applying DevOps
all at once. Create a JIRA ticket to address the SQL injection.
concepts, we can produce this concrete security continuously and
effectively as a part of standard software development. 2. SECURE
Next, look at the SQL injections to determine which parts of the
GETTING STARTED WITH DEVSECOPS
application are vulnerable. Once that is complete, we need to build
Traditionally, security has been performed as a series of massive
our defense. The best strategy to prevent a SQL injection is to use
tasks spanning all risks. For example, security consisted of writing
input validation and parameterized queries everywhere across the
comprehensive security requirements, designing a broad security
codebase. It may be beneficial to break this task up into even smaller
architecture, performing a thorough security test, etc. But agility
pieces. So fill out the details of the defense strategy via ticket(s) and
requires a risk-based approach. To accomplish security work in a
start implementing them.
DevOps organization, we can prioritize our security tasks and break
them into small pieces for implementation. 3. VERIFY
Use simple tools to ensure that non-parameterized queries are
Figure 2
eliminated from the codebase. A deployed tool can be used to warn
developers in their IDE if they violate this rule. It is also important to
automatically re-verify during CI/CD as well as perform a final check
prior to deployment.

4. MONITOR AND DEFEND


Finally, be aware of any attackers that target with SQL injection
attacks. For visibility and protection in production, implement runtime
application self-protection (RASP). This application then monitors
requests and detects possible attacks.

This diagram shows how security fits into the normal DevOps
development cycle at a very high level. Notice that these security

REFCARD | FEBRUARY 2022 5 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | INTRODUCTION TO DEVSECOPS

5. DOCUMENTATION checking the code inside the application. This method is also
Now that these critical security steps are complete, it is time to document known as black-box testing, which can detect vulnerabilities like
everything. Document this process from design to completion to ensure SQL injections and cross-site scripting.
each task is visible to the rest of the team. Documentation provides •  Static Application Security Testing (SAST): Unlike DAST,
insight into what has worked and what has not worked to come up with SAST focuses on the code. So the security vulnerabilities can
potential improvements. be found earlier in the development stage without running the
code. Tools like Synk can be integrated into the pipeline to scan
Once each step is complete, it is time to start in on the next security
application codes constantly. This approach is quite efficient
breach or challenge. Each time we complete a challenge, we leave
and saves time and money for teams.
behind infrastructure to make sure it remains secure. Note that we don’t
want to create a fragmented set of individual defenses, so it’s important •  Container Scanning: Containers are great solutions, but they
to make good decisions over time about security architecture. can become a black box for security. So it is crucial to constantly
scan container images for vulnerabilities, malware, and other
In DevSecOps, don’t let perfect be the enemy of good. We’re looking
security measures to ensure nothing is left out of the radar.
to improve our security story on every iteration. Your first attempt
might be a partial solution with sampling instead of a rigorous defense Figure 3
and complete testing. The goal is to get this cycle running and make
measurable progress over time. Again, do not forget to create a
documentation for each implementation to ensure we set a standard
baseline for future applications.

CREATING YOUR DEVSECOPS PIPELINE


Let’s assume that you have implemented a CI/CD pipeline in your
current DevOps practices. This pipeline includes all required steps to
bring a piece of code from development to production. We need to
integrate security into this pipeline as a part of the application delivery.
Although implementing a separate pipeline for DevSecOps sounds
interesting, this is not an efficient approach and creates overhead for
teams. Additionally, DevSecOps aims to incorporate security earlier in
your current CI/CD pipeline. The main cycle in the DevSecOps pipeline involves security tools, an
analytics hub, and integrations with development and operations tools.
In each phase of the pipeline, there must be some tasks dedicated
The security tools at the bottom of the diagram identify vulnerabilities
to security. Implementing DevSecOps within your pipeline requires
in applications and APIs across development, test, and production
adopting tools and processes that continuously perform security as
environments. In production, other tools monitor and prevent attacks.
code is written, integrated, tested, deployed, and operated. While
The telemetry from these tools feeds into an analytics system for
there’s just one delivery pipeline, having a security “view” of your
historical tracking, analysis, and notifications.
pipeline may help you understand the security value stream separately,
revealing bottlenecks and inspiring confidence in the results. There Common events include:
are a lot of different components you can add to your pipeline. Many
•  Custom code vulnerabilities
security tools can help to implement:
•  Known vulnerabilities in libraries and frameworks
•  Unit Testing: This is the first opportunity to test any piece
of code against its functionality, and therefore, it is the best •  Attacks on custom code vulnerabilities

moment to check if a small part of the software can operate as •  Attacks on libraries and frameworks
expected.
•  Application inventory, including all libraries and frameworks
•  Dependency Scanning: Every project uses various libraries,
•  Software architecture details
and sometimes external libraries are used in the project.
With dependency scanning, those libraries are scanned for In general, DevSecOps favors the use of notifications (real-time integra-
vulnerabilities to ensure the libraries are safe to use. tions into normal development and operations tools) over PDF reports.
However, for some purposes, such as compliance, PDF reports may be
•  Dynamic Application Security Testing (DAST): DAST is how
generated. Notification alert team members need to know about secu-
you can test your applications for vulnerabilities without

REFCARD | FEBRUARY 2022 6 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | INTRODUCTION TO DEVSECOPS

rity events immediately through the tools they are already using as part seconds, not hours, weeks, or months. The faster you can get feedback
of their everyday job. While a single analytics system would be ideal, from the people that need it, the more secure and cost-effective your
today, you may need separate systems for vulnerabilities and threat DevSecOps pipeline will be.
events.
In the beginning, a DevSecOps pipeline will only verify a few simple
Table 4
things about the software. But over time, as challenges are addressed,
ESSENTIAL DEVSECOPS SYSTEMS you will automate verification of more and more of the security
strategies and defenses. Over time, the goal is to migrate from manual
SYSTEM DESCRIPTION
security testing to a fully automated pipeline capable of deploying
Smart alerting It is vital to design a smart alerting system when it
secure code directly into production without gates.
comes to monitoring — regardless of security or
other goals. The term “smart” here means that our
monitoring platform should raise an alert whenever CHOOSING SECURITY TOOLS AND TECHNOLOGIES
an action needs to be performed. This requires Here are a few of the attributes to consider when choosing security tools
the alerts to be designed and fine-tuned so that
and technologies to build your DevSecOps pipeline across the entire
we avoid being spammed with any unimportant
alerts. One example is getting an alert for a service SDLC. Please note that there is no one set of best tools for DevSecOps.
that is slower than usual but not slow enough to The tools you choose should match how you build software, your goals,
make a considerable impact on the whole system.
your culture, and the other technologies you use.
This incident is considered low severity and should
be investigated later, but it should not interrupt
Table 5
workflows.

Intelligent Use a platform that has implemented intelligent CONSIDERATIONS FOR DEVSECOPS TOOL SELECTION
security analysis security analysis to process the information
CONSIDERATION DESCRIPTION
constantly and identify anomalies. This makes
security monitoring much easier for security and Policy coverage First and foremost, you must confirm that the tool
DevOps engineers. One of the best examples of actually covers the risks you need it to cover. Many
this is the threat protection on Azure, a collection products have surprising shortcomings in this
of security services and functionalities. Azure area. See the OWASP Benchmark Project for help.
threat protection provides an overview of what
is happening at any time within your application. Accuracy Accuracy (eliminating both false positives and
Therefore, choosing the right platform for your false negatives) is critical. Inaccuracy means
infrastructure and configuring the right tools can humans have to fix results, which will destroy your
significantly impact security monitoring operations. pipeline. You should carefully test your tools to be
sure they accurately verify what you need.
Centralize A critical aspect of security monitoring is centralizing
security all security issues and managing monitoring. Speed You need to test whether tools are fast enough to
monitoring Especially for enterprise organizations, having a work as a part of your DevSecOps pipeline. That
birds-eye view is necessary. Without these, one may be microseconds, seconds, or minutes — but
might lose control on what is happening easily, probably not hours and certainly not days.
resulting in huge costs for the organization. On the Scale Consider the size of your application portfolio
cloud, this is called “security posture management.” and whether the tools you select can operate
As an example, let’s look at the Sentinel product from continuously, in parallel, and across the entire
portfolio. Be sure to factor in the number of people
Azure. Azure Sentinel connects to each different
you need to make that work.
solution to collect data. Then, inside Azure Sentinel,
you are notified of previously undetected incidents, Process fit It is best to verify that the tools are useful without
investigating issues using artificial intelligence and a complex installation process. When well-
other features. These help to respond to incidents meaning security folks buy tools for development
rapidly and stay compliant. and operations teams, it can cause friction if
Another example is the AWS Security Hub, which they aren’t compatible with their technology
provides cloud security posture management. stack or workflow. Engage the actual users in the
Therefore, there are still options for security evaluation process and conduct pilots to confirm
monitoring on any platform you choose. Having this they will be easy to install and use.
knowledge upfront will help to plan your security Integrations Verify that the tool integrates with the tools that
roadmap accordingly. people in your DevOps toolchain are already using.
Look for well-documented, supported REST APIs
Implementing a notification infrastructure encourages downstream and SDKs in a variety of languages, IDE plugins,
security stakeholders (developers, testers, operations, audit, webhook support, ChatOps integrations like
HipChat and Slack, notifications with PagerDuty
executives, etc.) to work closely with upstream providers (like security
and VictorOps, and SIEM integrations like Splunk.
testers) to ensure that the work is optimized for them. Your DevSecOps
TABLE CONTINUES ON NEXT PAGE
pipeline should be designed for very tight feedback loops — think

REFCARD | FEBRUARY 2022 7 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | INTRODUCTION TO DEVSECOPS

CONSIDERATIONS FOR DEVSECOPS TOOL SELECTION can improve security. Over time, you’ll build a complete security story
that will provide assurance both internally and externally.
CONSIDERATION DESCRIPTION

Security on the Security becomes a shared responsibility between 1. ANALYZE: IDENTIFY YOUR NEXT MOST CRITICAL
cloud cloud providers and companies in cloud solutions. SECURITY CHALLENGE
As the complexities of architecture increase on Why should one always focus on the most critical security challenge?
the cloud, controlling events is much easier than
on-premise architectures. The interesting thing Generally, working on anything else won’t change your security posture
about cloud architectures is that you can add very much. It doesn’t help to close the attic window when the garage
these options to your design before developing and front door are wide open. In DevSecOps, we get the work flowing
any line of code. So your solution design is already
security-proof before the implementation.
by creating small batch sizes. So, in most cases, we want to work on our
enterprise's most critical security challenge first. Still, don’t be afraid
Additionally, every resource is created by code,
and that’s how engineers can think of all security to choose a partial measure or a tiny improvement to your most critical
issues earlier on in the development process. challenge. Working in small increments makes sure we stay on track.
Cloud providers already give best practices for
various security practices such as using firewalls, When deciding what to work on next, the team looks at all the potential
network security groups, DDoS and identity
management, etc. They also provide various tools security “work” available and makes it visible. The team might add
and products to implement and monitor security new features, pay down some technical debt, make an architectural
measures. improvement, fix defects/vulnerabilities, or do something to improve
the team’s tools or practices to improve quality, security, or productivity.
DEVSECOPS CORE PRACTICES
DevSecOps takes a very agile approach to security, breaking down It’s important that the team use its threat model and security
massive security tasks into incremental improvements that are architecture to make an informed decision about the next most critical
performed as everyday development tasks. These small batches of security challenge. What is the cost to the company of certain kinds
work include continuous verification so that security builds over time of attacks? What is the cost of implementing preventive measures for
instead of repeatedly starting from scratch. those attacks? Try to use both internal and external data sources to
figure out the next thing to do that will most effectively reduce risk.
DevSecOps brings a culture of “security for everyone” to teams.
Everyone has a significant role to play in security at their organization. You may find yourself without a threat model or security architecture.
Security specialists are critical in this by mentoring, advising, and Fortunately, in DevSecOps, these artifacts are created one step at a
leading teams to ensure quality and security. time. When you’re starting out, it’s easy to identify your top challenges:
the problems that are the most likely to be found, exploited, and
Once we’ve identified the next security challenge, our normal
cause serious damage like injection, authorization problems, known
engineering process can execute on the improvement. In this section,
vulnerabilities, etc.
we explore four core practices to any DevSecOps initiative. Of course,
your DevSecOps process might be considerably more complex. See Consider all the different layers of your application stack:
the next section for more ideas, or add your own practices to this basic
cycle. Table 6

SECURITY CONSIDERATIONS FOR


Figure 4 LAYERS OF THE APPLICATION STACK

LAYER CONSIDERATION(S)

Applications and Do you have proactive controls in place? Are you


APIs susceptible to common vulnerabilities?

Libraries and Are your libraries and frameworks up-to-date and


frameworks properly configured? Do you have a complete, up-to-
date inventory (with exact version numbers) of all the
software you are running across all your servers?

Containers Have you hardened your platform configuration


and kept it up to date? Are your cloud environments
configured correctly? Did you consider scanning
container images against vulnerabilities? Did you
Fundamentally, it is the constant tension between creating defenses add security scans to your pipeline?

and attempting to break them that actually makes organizations more TABLE CONTINUES ON NEXT PAGE
secure. The faster you can repeat this DevSecOps cycle, the faster you

REFCARD | FEBRUARY 2022 8 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | INTRODUCTION TO DEVSECOPS

SECURITY CONSIDERATIONS FOR You’ll have to work out your own cadence for re-examining your threat
LAYERS OF THE APPLICATION STACK model. So, increasing your cycle speed will directly affect the level of
LAYER CONSIDERATION(S) security you are able to achieve. And because DevSecOps adds to your
security incrementally with continuous security verification (discussed
Cloud resources Are applications and customer data secure? Do
we have an authorization matrix in place to make below), you have protection against backsliding.
sure the right people have the right access? Are
networking configurations configured properly 2. SECURE: IMPLEMENT A DEFENSE STRATEGY
for each resource? Do we have the penetration test
Once you’ve decided on a security challenge to tackle, you’ll need to
results on public-facing resources?
choose a defense strategy. A defense strategy isn’t a single security
Network Do you have strong network security defenses in
place and monitored for attacks?
mechanism or product. A defense strategy can combine technical
security mechanisms, secure coding practices, procedural controls,

Use a risk-based approach to decide what to work on next. Be sure to supporting processes, training, background checks, and more. We are

consider whether there’s a viable connection between a threat agent, using the term “defense strategy” broadly to include anything that

attack vector, weakness, technical impact, and business impact in your you rely on to prevent a breach. Your defense strategy for a particular

enterprise. OWASP depicts this connection as follows: challenge can (and probably should) comprise one or more primary
defenses and a set of supporting defenses as well.
Figure 5
In an agile way, you have defined stories and tasks for each sprint. The
product owner is the person who defines new feature requests and also
the priority level. This usually applies to application features and not
security. In a DevSecOps approach, security is also considered a high
priority feature added to the backlog. Security specialists give consults
on what needs to be done, and all team members can participate in the
implementation, test, and delivery. This approach prevents teams from
having security silos, and security expertise is shared between all team
members from developers to testers and DevOps engineers.

You can capture each security strategy for implementation in a JIRA

Going forward, you should practice a combination of threat intelligence ticket that covers each security enhancement that you want to make,

and security research to continuously zero in on your next most critical including:

security challenge. Note that this process is significantly different from


Table 8
assessing all your threats. Many organizations get overwhelmed trying
to protect against everything at once. DEVSECOPS DEFENSE STRATEGIES

STRATEGY DESCRIPTION
Table 7
Challenge The goal is to justify why this is an important security
DEVSECOPS THREAT INTELLIGENCE, SECURITY RESEARCH,
description challenge concisely. This might take the form of a
AND SECURITY ARCHITECTURE
security story or misuse case. The description should
Threat External sources: ISACs (STIX/TAXII), OWASP, SANS, cover the elements shown in the OWASP diagram above.
intelligence BlackHat, DefCon, LASCON, DevSecCon, CISO Defense story This story should detail exactly how the defense
events, friendly peer companies, etc. should work. For technical defense mechanisms,
Internal sources: Monitor your systems for attacks the story should clearly detail how the threat is
and learn from the data. Understanding actual countered and why this defense is effective. For
attacks is a major factor in prioritizing. other defenses, how they work to provide protection
should be argued.
Security Security research should focus on challenging
research security architectures and identifying new strategic Documentation As part of the defense strategy, you should also
ways to improve security. Where possible, work with consider how to configure, operate, and use these
development to enhance the DevSecOps pipeline defenses. This guidance should be written as a
with new testing methods. tutorial to apply to end-users and operations staff,
and even indicate how developers should use
Security There is a shortage of great threat modeling and the defense effectively. It is vital to document all
architecture security architecture tools. But some interesting operations and implementations to prevent any
projects include OWASP Threat Dragon, IriusRisk, rework in the future.
and Chaos Engineering (Chaos Monkey, ChaoSlingr).
TABLE CONTINUES ON NEXT PAGE

REFCARD | FEBRUARY 2022 9 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | INTRODUCTION TO DEVSECOPS

DEVSECOPS DEFENSE STRATEGIES Table 9

STRATEGY DESCRIPTION
POPULAR DEVSECOPS AUTOMATION TECHNIQUES

Security testing It is important to define automated tests, which TECHNIQUE DESCRIPTION


approach verify the correctness and effectiveness of the
defense strategy. Automate It's not automated if you need humans in the loop.
everything Don't fall into the trap of thinking that you've
Fail and test Do not wait for disaster to strike in order to verify
automated security when all you really did was
your system security effectiveness. Instead, try to fail the system
automate the "scan" button. Think about the entire
and challenge implementations yourself. This can be
process. Does the tool require human expertise
done on environments other than production, where
to configure or run? Does it require an expert to
you may have a clone production environment like an
interpret and triage the results? We are looking to
acceptance environment. Simulate security issues to
eliminate the involvement of humans in the critical
see if the defense strategy works as expected.
path so that we can push code to production with
Security The final part of the defense strategy is to detail both speed and assurance.
monitoring how to will continuously monitor security and avoid
Avoid “tool Every tool that you adopt means additional process
possible attacks.
soup” steps, a full set of integrations, and a team of
people to configure, run, and interpret. Choose
Your strategy is right when you can easily answer with confidence when powerful platforms that will allow you to address
anyone asks: “How do you protect against X?” Having a clear, concise, many different types of security challenges using an
integrated framework. Therefore, you avoid having
defensible answer to this kind of question can not only provide an easy
overhead when maintaining multiple tools.
path to compliance but can also provide business advantages over
Test your testing Security testing tools vary significantly in their
competitors.
tools ability to test real applications for a broad range of
issues. The only way to know how well a particular
Your defense strategy doesn’t have to be perfect from the very start. It’s tool will work on your applications and APIs is to try
far better to start with a basic defense and evolve it over time. After you it. Consider temporarily adding “tool canaries” in
implement a basic defense, you may choose to work on another, more your applications to verify that real vulnerabilities
are being discovered and false alarms are not being
pressing, threat. The key to DevSecOps is to continuously reprioritize
flagged. See the OWASP Benchmark project for
based on the threat and existing defenses. The ability to respond details.
quickly is critical for a world of continuously changing threats.
Below is a DevSecOps security testing funnel to help you choose a
The work of implementing the security defense shouldn’t be any security verification technique for a particular security challenge. This
different than any other feature. It should — to the maximum extent may seem obvious, but don’t blindly rely on the wrong tool. Take a
possible — be delivered as code or configuration with everything in minute to select the simplest, fastest, most accurate way to check that
source control. Managing security in this way makes it possible to test your defense implementation is correct, complete, and configured.
and redeploy at any time, ensuring that defenses are in place, working
For example, testing for proper clickjacking protection is easy if you
correctly, and properly configured.
simply examine HTTP responses for the proper security headers. But
3. VERIFY: AUTOMATE SECURITY TESTING it would be very difficult to verify this by looking at the source code, as
A key part of DevSecOps is ensuring that the defense strategies have there are so many ways to accomplish this.
been properly implemented, configured, and operated. Security
Table 10
testing is how to verify that your actual security controls match your
intended defenses. In DevSecOps, we focus on automating those tests DEVSECOPS SECURITY TESTING FUNNEL
by “turning security into code” so that we can run them frequently
QUESTION RECOMMENDATION
without requiring humans, particularly security experts, in the critical
path. What are we Think carefully about exactly what you want to
trying to test? test and the results you want. Direct, complete
verification of application behavior is always best,
There are many ways to verify the security of a system automatically.
but you can use sampling, fuzzing, design analysis,
There is no possible way to list them all, but we provide a few examples and other techniques.
of popular tools that have proven to be DevSecOps compatible.
Do we need to Probably, yes. But you should clearly prioritize things
test it? that are the most critical to security and the most
likely to be discovered and exploited by an attacker.
TABLE BEGINS IN NEXT COLUMN

TABLE CONTINUES ON NEXT PAGE

REFCARD | FEBRUARY 2022 10 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | INTRODUCTION TO DEVSECOPS

DEVSECOPS SECURITY TESTING FUNNEL Table 11

QUESTION RECOMMENDATION
DEVSECOPS ATTACK DETECTION AND PREVENTION TOOLS

Positive or Are we able to verify that the application always TOOL DESCRIPTION
negative follows a known good pattern of execution (positive
testing? security), or will we have to resort to trying to verify Runtime RASP uses application instrumentation to add attack
that the application never follows any of the known Application detection and prevention directly to applications
bad patterns of execution (negative security)? Self Protection regardless of where or how they are deployed.
(RASP) DevSecOps projects can use RASP to achieve
Do we already You may be using a security testing tool that covers
accurate attack-blocking and the flexibility to deploy
test for it? this risk. It's critical to confirm that your tool does a
in cloud/container environments easily.
good job of accurately and efficiently verifying your
security defense. Examples: Contrast Protect, Prevoty, Immunio.

Do we already Perhaps you just need to enable a rule in a tool you're Web Application WAFs have been on the market since the early
have a platform already using. Or maybe you can use an existing tool Firewall (WAF) 2000s and have a history of complex configuration
that will allow as a platform for creating a custom rule. and spotty protection. Nevertheless, a DevSecOps
us to test this project might be able to use a WAF for basic
easily? protection or as a platform for virtual patches.

Can we test it by If we can't use a security testing platform, can we Examples: ModSecurity, Imperva, F5, Signal
writing custom create a custom test case? Sciences.
tests? Network There is a variety of network-, container-, and host-
Is there another •  Network: nmap, sslyze, ssh_scan, Tenable, Intrusion level protections against attacks. Seek out products
tool on the Qualys. Detection and that can be deployed and managed as part of your
market that can Prevention (IDS/ standard technology stack.
•  Cloud/container: Aqua, Twistlock, Redlock,
help test this? IPS)
ThreatStack. Examples: Snort, Suricata, Bro, Kismet.

•  Libraries/frameworks: OWASP Dependency Security SIEM tools provide real-time analysis of security
Check, retire.js, Contrast Assess, Snyk, Information alerts generated by applications and network
Sonatype, BlackDuck. and Event hardware and are important to handling attacks in
Application: OWASP ZAP, Arachni, sqlmap, Burp, Management DevSecOps.
Contrast Assess, Micro Focus, CA Veracode, (SIEM)
Examples: Splunk, ELK, SumoLogic, LogRhythm,
Synopsys, Checkmarx. ArcSight.

Do we need While the goal of DevSecOps is to minimize the


human experts number of things that you need human experts to The threat and attack data gathered should feed directly into the next
to test it? test, bug bounties, red team exercises, and manual DevSecOps cycle to use security research to help choose the next most
penetration testing can provide useful insight into critical security challenge.
defenses that are difficult to test automatically.
Ensure that these efforts deliver rules, test cases,
and other automation, not PDF reports.
DEVSECOPS ADDITIONAL PRACTICES
Additional sets of security challenges emerge when an enterprise has
Examples: BugCrowd, HackerOne
hundreds or thousands of applications in their portfolio. Doing security
Are we also It’s impossible to know everything, so certain kinds
testing for what of testing rely on volume and randomness to try to at this scale is far beyond what a small, dedicated security team can
we didn’t think force applications to misbehave. Fuzz testing and accomplish. DevSecOps is a technique for distributing this work
of? chaos engineering tools can help here. effectively across development and operations.

Any security issues discovered during testing should feed into the It’s worth noting that in most organizations, only a small percentage of
DevSecOps management infrastructure described above to notify all projects are very far along in their DevOps journey. So, managing the
the people that need to know through the tools they are already using. transition to DevSecOps across an entire application portfolio is a key
part of the challenge.
4. DEFEND: DETECT ATTACKS AND PREVENT
EXPLOITS STANDARD DEFENSES AND ENTERPRISE
DevSecOps organizations recognize that you can never test yourself SECURITY ARCHITECTURE
securely, so they adopt a balanced approach that focuses on minimizing Generally, DevSecOps organizations — particularly those with large
vulnerabilities during development and identifying and preventing application portfolios — prefer standard security defenses that are
vulnerabilities from being exploited in production. While these two heavily tested for correctness and effectiveness.
activities have traditionally been separated, DevOps has brought them
together by supporting the full software lifecycle. Don’t reinvent authentication, authorization, for encryption for every
application and API you build. This reduces the amount of security

REFCARD | FEBRUARY 2022 11 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | INTRODUCTION TO DEVSECOPS

work that must be done and simplifies the organization’s security In practice, this translates to a few important strategies:
architecture. Achieving effective enterprise security architecture in a
Table 13
DevSecOps manner is beyond the scope of this document, but these
guidelines are reasonable first steps. STRATEGIES FOR SECURE, EFFECTIVE SOFTWARE MANAGEMENT

STRATEGY DESCRIPTION
Table 12
Show some Be cautious about the libraries and frameworks that
GUIDELINES FOR EFFECTIVE restraint you adopt. Stick to projects that demonstrate a solid
ENTERPRISE SECURITY ARCHITECTURE security program, evidence of security testing, and
STRATEGY DESCRIPTION effective response to new vulnerabilities.

Self-inventory DevSecOps organizations must know the exact


Security Generally, it is best to use popular, well-tested
version of every library, framework, application,
libraries libraries for security features, as it is dangerously
and API that is running on every server in every
easy to make small but disastrous mistakes writing
environment. The best approach is to enable all your
your own. Probably the best approach here is to
systems to self-inventory by reporting their “bill of
assemble your own enterprise security API that
materials” to a central database. This “always-up-to-
implements, extends, wraps, or is based on existing
date” inventory will enable you to respond quickly to
security libraries like Spring Security, OWASP ESAPI,
novel attacks.
BouncyCastle, OWASP Encoder, AntiXSS, AntiSamy,
Jasypt, etc. Establish When you decide to take on a new library,
secure coding standardize how you will use it safely (both positive
Standardize To the greatest extent possible, you want a standard
guardrails and negative rules) and turn them into code so they
on a standard approach to security, and you should use the security
can be continuously tested.
software stack features provided by your software stack. This
makes security invisible or automatic and reduces Test for latent Before you trust your business to someone else’s
the likelihood of mistakes. Don't assume they're vulnerabilities code, you must verify that the defenses that are
working, though; you have to test these defenses provided by the libraries and frameworks work
continuously. as advertised and don't contain undiscovered
vulnerabilities. Very few libraries receive adequate
Security services Consider the extent to which you can turn security
security testing.
defenses into high assurance services that your
applications can invoke. This creates the possibility Continuously Modern applications are only fully composed at
of upgrading security across many applications monitor for new runtime, as their dynamic dependencies, plugins,
without having to recode, retest, and redeploy. In vulnerabilities and injections are fully realized. RASP tools
the spirit of DevOps, make sure there is a self-service and respond (discussed above) can proactively prevent both
way for your empowered engineering teams to known and unknown vulnerabilities from being
consume them without needing central approval or exploited.
provisioning.
EXPLODE, OFFLOAD, RELOAD
MANAGE THE SOFTWARE SUPPLY CHAIN While it’s not strictly necessary, many DevOps projects use the cloud,
Libraries have serious vulnerabilities, most of which have not yet been containers, and APIs. Many organizations have already discovered
discovered by the good guys. And attacks now start within a day or so of that this is, in fact, the fastest path to securely achieving digital
new vulnerabilities being disclosed. So, every DevSecOps project must transformation. DevSecOps projects should strongly consider Ed
pay attention to the security of its supply chain. Amoroso’s advice to “explode, offload, reload.”

Your software stack is composed of thousands of libraries, frameworks, Table 14


modules, and components written by unknown developers worldwide.
DEVSECOPS ADVICE: EXPLODE, OFFLOAD, RELOAD
This becomes an increasing concern when you have open-source
libraries or tools in your stack. These days, it is very common for ADVICE DESCRIPTION

developers to adopt open-source libraries such as Bootstrap, Angular Explode Perimeters are no longer effective at stopping
JS, OpenStack, etc. attacks, so the first step is to break up your
monolithic internal infrastructure into smaller
Although using these libraries can allow you to create software much distributed workloads.

more rapidly, what many may not realize is this convenience comes at Offload Second, take advantage of security and cost
a risk. Not all of these libraries are tested via security best practices, advantages by moving these new, smaller workloads
to virtual cloud and container infrastructure.
and some libraries are constantly providing new upgrades that need
Reload Finally, re-establish continuous security for each of
to be verified. This means that you must take full responsibility for the
your newly virtualized workloads by selecting and
security of all of that software. deploying modern protection technology at the
application, library, container, and network layers.

REFCARD | FEBRUARY 2022 12 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | INTRODUCTION TO DEVSECOPS

This strategy is very compatible with DevSecOps, as it allows for efficient WHAT’S NEXT FOR DEVSECOPS?
centralized security management with distributed enforcement for DevSecOps is still in the formative stages. The best way to get involved
speed and accuracy. is to implement DevSecOps in your organization and publish your
experiences. Here are some sources of additional information:
CREATE A SECURITY CULTURE
•  The Phoenix Project
Some companies simply seem to have the ability to take security
seriously, focus, and do a great job. But others — even companies that •  Microsoft Azure DevSecOps
seem to be doing all the same practices and using the same tools — are •  AWS DevSecOps Blog
simply terrible at security. The difference is culture. And while culture
•  GitHub's Architect's Guide to DevOps
is a difficult thing to change, there are a few key practices that have
worked in organizations and should be part of a DevSecOps program. •  Integrating Security Into the DNA of Your Software Lifecycle

•  WhiteHat Security's 12th Annual Application Security Statistics


DEVSECOPS CULTURE IN TEAMS
Report
When it comes to the DevSecOps culture implementation, teamwork
is key. Communication is the most important part of creating a REFERENCES
collaborative atmosphere within teams. The goal of DevSecOps is to get •  https://www.linkedin.com/pulse/lose-security-wheel-edward-
everyone involved so that security does not fall under the responsibility amoroso/
of one person or department, but it is distributed between everyone
•  https://docs.microsoft.com/en-us/azure/sentinel/
across the SDLC.
•  https://docs.microsoft.com/en-us/azure/security/
Now, let’s look at a few strategies to create a DevSecOps culture on your fundamentals/threat-detection
team.
•  https://aws.amazon.com/security-hub/

Table 15

DEVSECOPS CULTURE STRATEGIES FOR SUCCESS


WRITTEN BY ALIREZA CHEGINI,
STRATEGY DESCRIPTION
SENIOR DEVOPS ENGINEER, AZURE SPECIALIST AT S-RM
Executive You must have support from the executive level.
sponsorship Executives need to clarify that security is everyone’s Alireza is a software engineer with more than
20 years of experience in software development.
responsibility — and that simply getting past the
He started his career as a software developer, and
compliance audit is not the goal.
in recent years he transitioned into DevOps practices.
Micro-training Everyone needs to understand exactly what their Currently, he is helping companies and organizations move away
security responsibilities are. The best way to achieve from traditional development workflows and embrace a DevOps
culture. Additionally, Alireza is coaching organizations as Azure
this is by providing instant feedback while doing
Specialists in their migration journey to the public cloud.
their job.

Accountability Development and operations team members should


be responsible for the security of what they produce
and operate. Security specialists shouldn't be in
600 Park Offices Drive, Suite 300
the critical delivery path and should instead act as Research Triangle Park, NC 27709
coaches and tool smiths. 888.678.0399 | 919.678.0300

Security in Make security as visible as possible. Be sure that At DZone, we foster a collaborative environment that empowers developers and
sunshine vulnerability and attack data are never used to tech professionals to share knowledge, build skills, and solve problems through
content, code, and community. We thoughtfully — and with intention — challenge
shame people. Instead, celebrate security risks as the status quo and value diverse perspectives so that, as one, we can inspire
the fastest path to learning and improving. Only positive change through technology.
when security is visible can you achieve a culture of
making informed risk decisions.
Copyright © 2022 DZone, Inc. All rights reserved. No part of this publication
may be reproduced, stored in a retrieval system, or transmitted, in any form or
by means of electronic, mechanical, photocopying, or otherwise, without prior
written permission of the publisher.

REFCARD | FEBRUARY 2022 13 BROUGHT TO YOU IN PARTNERSHIP WITH

You might also like