Sponsored Dzone Refcard CD Pipeline Security Essen

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

380 BROUGHT TO YOU IN PARTNERSHIP WITH

CONTENTS

Continuous Delivery
•  Overview of CD Pipeline Security

•  Essentials of Continuous Delivery


Pipeline Security
−  Testing

Pipeline Security −  IaC Automation


−  Runtime Security
−  Role-Based Access Control

Essentials
−  Threat Modeling
−  Source Control
−  Continuous Monitoring
−  Incident Response Plans
−  Secure Secrets
−  Vulnerability Scanning
SUDIP SENGUPTA •  Summary
TECHNICAL WRITER, JAVELYNN

A DevOps model follows a non-traditional approach to application security into a delivery pipeline allows software teams to automatically
delivery that relies on continuous automation and wider collaboration run stress, acceptance, and performance tests, documenting early
among distributed teams. While automation and collaboration are warnings of security risks before they make it into production. While
fundamental features of a DevOps framework, securing deployment CD helps to deliver advanced features and bug patches rapidly,
pipelines requires diligent planning, efficient threat modeling, and organizations remain mostly apprehensive toward various challenges
comprehensive testing. in securing a continuous delivery pipeline.

In this Refcard, we delve into various challenges and key considerations CHALLENGES OF MAINTAINING SECURITY IN A
for administering robust security into continuous delivery pipelines. CONTINUOUS DELIVERY PIPELINE
CD pipelines are built to shorten delivery times, which fundamentally
OVERVIEW OF CD PIPELINE SECURITY remains the prime concern of organizations that are looking to perform
Continuous delivery supports accelerated application deployment and extensive security and QA analyses. Some common challenges of
delivery cycles by leveraging sustainable, frequent updates. In a typical implementing security within CD pipelines include: an inconsistent
DevOps framework, continuous delivery is extended upon continuous approach to services, resistance from developers, reduced delivery
integration (CI) to collectively help in automatic deployment of velocity, compliance requirements, and inadequate integration of
infrastructure and code changes into a production environment. security automation tools.

Figure 1: Administering security in a typical DevOps workflow

Interactive App
Continuous Security Testing
Penetration Testing
Integration Event Monitoring
}

Infrastructure Scanning
Dynamic Scanning

Code Commit Build Test Review Deploy

Production
}

Threat Modeling
Pre-Commit Review
IDE Scanning
Continuous
Static Code Deployment &
Analysis Testing
Delivery

Enforcing CD security is crucial for enterprises as it enables developers,


operators, and security teams to make informed decisions on the
deployment pipeline's architecture and workflow pattern. Integrating

REFCARD | JULY 2022 1


REFCARD | CONTINUOUS DELIVERY PIPELINE SECURIT Y ESSENTIALS

INCONSISTENT APPROACH TO SERVICES monitoring, testing, and documentation. As CD pipelines leverage


While containers offer a lightweight, portable, and platform- distributed environments for deploying different components of
independent deployment option, they require a non-traditional the workload, comprehensive observability of infrastructure and
approach to protect workloads that is considerably more complex than compliance risks is often a complex undertaking.
securing monolithic frameworks.
Security compliance monitoring and audits require the proper
Security profiling tools in such instances often need more memory and alignment between architecture principles, coding practices, and
processing power than a container image can be allocated. Due to the safety controls, which further add to the complexity of modern
distributed nature of multiple loosely coupled services, the framework deployment pipelines.
requires security controls to be broken down and deployed at the
INADEQUATELY INTEGRATED SECURITY
service level while ensuring minimal impact to orchestration patterns.
AUTOMATION TOOLS
As each service relies on independent platform configuration and
Although most security solutions offer a web UI or CLI tool for
threat control, any inconsistency may lead to additional complexity of
integrating and interacting with the continuous delivery pipeline,
securing CD pipelines.
lack of comprehensive automation is often considered insufficient
DEVELOPER RESISTANCE for holistic security. In the absence of appropriately administered
Securing a CD pipeline relies on successful collaboration between automation, a CD pipeline relies on human intervention to perform
developers, security experts, QA, and operations teams. Developers security management functions at predefined checkpoints. A pipeline
usually restrain from implementing CD security practices, as dealing should also be configured to move seamlessly from one stage of the
with infrastructure engineering and production troubleshooting application security testing process to the next.
adds to their workload. Most developers are accustomed to a specific
Besides this, once a vulnerability is identified, developers are
technology stack that helps build functional code quickly without
responsible for taking down the affected service and making sure
factoring in cyber threats and security best practices.
the application stays available while they build security patches.
Administering robust security throughout the CD pipeline also implies Lack of automation in administering security not only raises manual
more time spent testing the code. This essentially requires developers overheads but is also considered an inefficient approach of mitigating
to adopt incremental security checks throughout their programming attacks in real time.
process, and hence, is one of the most common reasons for developer
ESSENTIALS OF CONTINUOUS
resistance toward a security-first approach.
DELIVERY PIPELINE SECURITY
SECURITY REDUCES DELIVERY VELOCITY Securing CD pipelines requires a multi-faceted approach that
The core objective of DevOps CD pipelines is to automate frequent involves alignment between different frameworks, technologies, and
deployments and updates. While attributing more importance to operational cultures. As a result, the security of a typical CD pipeline
automation and collaboration as the fundamental benefits of a DevOps can be subdivided into a number of different aspects, including testing,
model, security is often viewed as an afterthought, where security tests IaC automation, runtime security, role-based access controls, threat
are performed at the end of the SDLC. modeling, source control, continuous monitoring, incident response
plans, secure secrets, and vulnerability scanning.
Traditional approaches of static and dynamic application security
testing rely on scanning the entire codebase, even with a few committed TESTING
changes. As CD pipelines undergo frequent code changes, such testing Software security testing aims to identify threats and system
mechanisms eventually reduce the velocity at which newer features weaknesses before they can be exploited in production. Used by QA
make it to production. teams and security experts alike, comprehensive testing helps to
determine a system's vulnerability score and provides guidance for
Besides this, modern applications operate on a loosely coupled service
hardening security measures.
architecture, with each service requiring its own stack of application
security solutions. Aggregating data from these disparate sources Security testing is often considered to be a broad term that includes
introduces bottlenecks in security decision-making processes, further a number of security mechanisms focused on different components
slowing down the CD pipeline. of a workflow, including application security testing (AST), runtime
application self-protection (RASP), software composition analysis
COMPLIANCE REQUIREMENTS (SCA), vulnerability scanning and penetration testing, and quality
Industry standards and security frameworks offer guidance on the way analysis (QA) testing.
data should be transmitted between different systems in a continuous
delivery toolchain. Although these guidelines help adopt industry
best practices, implementing them adds to effort overhead toward

REFCARD | JULY 2022 3 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | CONTINUOUS DELIVERY PIPELINE SECURIT Y ESSENTIALS

Figure 2: Essentials of security within the CD pipeline

Auditing and Continuous Monitoring

Runtime
Security
Aspects of
CD Security Application Security Testing
SAST DAST

Source Control & Version Management QA Testing

Access Control, Secrets Management

Software Composition Analysis, Vulnerability Scanning, Threat Modeling Penetration Testing

CD Pipeline
Source Build Test Deploy
Stages

APPLICATION SECURITY TESTING RUNTIME APPLICATION SELF-PROTECTION


Application security tools scan, analyze, and report the security RASP is an advanced technology that has evolved over time to respond
posture of an application across different phases of the CI/CD pipeline. to security vulnerabilities and attacks in real time. The tool runs on an
An AST mechanism is primarily categorized into the groups shown in application server to help obtain collective visibility of the application's
the table below: source code and underlying runtime components. RASP protection
tools are primarily used to detect active threats while sniffing out and
CATEGORY PURPOSE BENEFITS
isolating malicious actors.
Static •  Follows a white-box Identifies vulnerabilities
application approach. such as: While RASP can be customized differently for prevention tactics, the
security •  Requires thorough •  Code/command most common approaches are to either issue an alert, terminate the
testing injection
understanding of session, or both.
(SAST)
underlying technology. •  Directory indexing
•  Helps analyze the app for •  Insufficient transport SOFTWARE COMPOSITION ANALYSIS
inherent security gaps layer protection SCA automates the identification of open-source software
within the source code,
•  Credential leakage vulnerabilities used within the application stack. A typical software
libraries, frameworks,
and various software composition analysis involves scanning the container images, manifest
components used. files, source code, and binary files to come up with a Software Bill of
Materials (SBOM), which is compared against a database of known
Dynamic •  Follows a black-box Identifies vulnerabilities
application approach. such as: vulnerabilities for security posture evaluation.
security •  Helps security teams write •  App misconfiguration
testing SCA tools also enable security teams to evaluate the code quality,
tests without learning the •  Improper input
(DAST) fundamentals of the app's license limitations, and compliance of open-source software used
handling
source code. within an existing workflow.
•  HTTP request
•  Scans exposed external smuggling
interfaces of an app VULNERABILITY SCANNING AND PENETRATION TESTING
•  Content spoofing
to uncover runtime Vulnerability scanning and penetration testing are active threat
vulnerabilities. •  Cross-site scripting
identification processes that involve inspecting the application from
Interactive •  Combines SAST and DAST Remediates CD security an attacker's point of view. Though the processes are mostly used as
application to widen the range of flaws much quicker by two separate approaches, they can also be used as concurrent steps to
security effectiveness. identifying root cause
identify application flaws.
testing of runtime issues and
•  Although purpose-built
(IAST) pinpointing specific
to run and scan apps As the first step, vulnerability scanning helps proactively identify
during runtime, IAST also code segments causing
weaknesses within the enterprise network. Once these vulnerabilities
compiles source code an error.
are identified, security professionals perform penetration tests to see
similar to SAST tools.
how the attacker can exploit them to orchestrate attacks.

REFCARD | JULY 2022 4 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | CONTINUOUS DELIVERY PIPELINE SECURIT Y ESSENTIALS

Beyond identifying system weaknesses, threat hunting functionalities researchers commonly use threat modeling to identify potential
also help determine the effectiveness of security controls in place and security gaps and attack mechanisms of a tech stack to help mitigate
flag enhancement opportunities. known and unknown vulnerabilities.

QUALITY ANALYSIS TESTING Though the process involves integrating security checks throughout
QA testing is the process of evaluating whether the software performs the development lifecycle to identify and remediate security issues,
to customer expectations and the required standards of the user the approach is considered one of the most critical security practices
experience. Beyond testing the functional and technical performance during the initial phases of system design.
of software, QA tests assess the product's usability, compatibility, and
known vulnerabilities. SOURCE CONTROL
Version/source control management (SCM) enables cross-functional
IAC AUTOMATION teams to collaborate liberally without the apprehension of unwanted
Infrastructure as Code (IaC) enables the provisioning and management changes and updates. Leveraging a centralized branch as a single
of infrastructure resources across multiple deployment environments source of truth for all interlinked systems of the workflow, SCM tools
using declarative text files. Developers can leverage dedicated CD and retain committed changes in an organized and well-structured format.
DevOps processes for security testing, version control, application SCM tools also maintain comprehensive version history that allows CD
updates, and security fixes. With automated IaC tools, organizations security teams to roll back or undo erroneous updates.
can proactively enhance the security posture of an application's
infrastructure while fostering collaboration between security, CONTINUOUS MONITORING
development, and operation teams. Continuous monitoring is one of the core processes that automates
the identification of security flaws and compliance errors throughout
RUNTIME SECURITY
the software development lifecycle. The mechanism essentially
Runtime security encompasses various activities focused on identifying
blends observability into the continuous change processes that
and remediating security flaws of a production environment. Securing
characterize a typical CD pipeline. Continuous monitoring covers
a runtime primarily involves analyzing the application's source code
multiple facets, including:
and server activity — as well as monitoring network activity — for any
defects and potential threats. On account of its multiple underlying •  Comparison of deployments over time

components and sub-processes, securing a runtime often involves •  Daily trend analysis
leveraging various tools and a collection of security controls, including: •  Vulnerability scanning, reporting, and remediation
•  Runtime application self-protection (RASP) •  Security incident alerting
•  Web application firewall (WAF) •  Retrospective analysis of security incidents
•  Log analysis
Besides helping to identify error sources and security vulnerabilities,
•  Vulnerability scanning
continuous monitoring also aids enterprises in measuring the user
•  Container security experience and KPIs. Adoption of such monitoring tools allows QA
teams to receive prompt feedback on how a recent security update
ROLE-BASED ACCESS CONTROL
affects users, subsequently helping to refine the security strategy.
Role-based access control (RBAC) is one of the most widely adopted
mechanisms for governing permissions and actions of a CD pipeline INCIDENT RESPONSE PLANS
at the component/sub-workflow level. The mechanism forms the An incident response plan allows organizations to maintain clarity
foundation of CD security by relating data privacy, confidentiality, and an escalation matrix during a security crisis. The plan outlines the
compliance, and access to specified resources and processes. systematic handling of security attacks to ensure such incidents cause
minimal impact to the organization's assets, financials, and reputation.
RBAC helps developers implement resource access as a function of the
firm's organizational structure, helping to group users efficiently based
Diligently designed incident response plans help CD security teams
on seniority or functions performed. To achieve this, RBAC systems
protect crucial data, maintain trust, and safeguard the firm's revenue
implement an innate separation of duties, breaking down sensitive
while resolving a security crisis.
functionalities into smaller units, thereby reducing the attack surface
in the event of an account breach. SECURE SECRETS
Secrets such as user credentials, configuration files, API keys, tokens,
THREAT MODELING
and other sensitive information exist throughout the lifecycle of a CD
Threat modeling involves an elaborate analysis of how a system
pipeline. These secrets are considered one of the primary sources of
operates while examining the combination of user behavior with
data leakage and hence, should be consistently hidden, protected,
data flows across network components. Ethical hackers and security

REFCARD | JULY 2022 5 BROUGHT TO YOU IN PARTNERSHIP WITH


REFCARD | CONTINUOUS DELIVERY PIPELINE SECURIT Y ESSENTIALS

and governed. While seamless delivery of code through different phases Additional Resources:
of the SDLC is crucial, it is equally important to maintain robust security •  "Continuous Delivery Patterns and Anti-Patterns" Refcard –
of secrets across all stages of the workflow. https://dzone.com/refcardz/continuous-delivery-patterns
•  "Continuous Integration Patterns and Anti-Patterns" Refcard –
The adoption of secret management systems that streamline the
https://dzone.com/refcardz/continuous-integration
storage and management of access management components is often
considered a key factor that prevents unauthorized access of system •  "Introduction to DevSecOps" Refcard – https://dzone.com/

resources without impacting delivery. refcardz/introduction-to-devsecops


•  OWASP DevSecOps Maturity Model – https://owasp.org/www-
Some of these solutions also offer encryption, key management, and project-devsecops-maturity-model/
identity management services, further simplifying the secure access to
•  Web Security Learning Materials and Labs – https://portswigger.
organizational data and resources.
net/web-security

OPEN SOURCE VULNERABILITY SCANNING •  Overview of Cloud-Native Security – https://kubernetes.io/docs/

Organizations that rely on third-party-developed open-source software concepts/security/overview/

often tend to overlook certain features and vulnerabilities of their •  How to Exploit a Microservice Architecture – https://www.javelynn.
source code. On account of the open source nature of such software, com/devops/how-to-exploit-a-microservice-architecture/
hackers typically possess detailed intricacies of the code along with the
list of known vulnerabilities.

Unsurprisingly, mitigating attacks in such workflows requires focused WRITTEN BY SUDIP SENGUPTA,
TECHNICAL WRITER, JAVELYNN
vulnerability scans of open-source components to identify weaknesses
before they are exploited. Vulnerabilities in open-source software Sudip Sengupta is a TOGAF Certified Solutions
Architect with more than 15 years of experience
commonly arise due to a number of factors, including: working for global majors such as CSC, Hewlett
Packard Enterprise, and DXC Technology. Sudip now works as
•  Inexperienced developers and maintainers
a full-time tech writer, focusing on Cloud, DevOps, SaaS, and
of the open-source code cybersecurity. When not writing or reading, he's likely on the
squash court or playing chess.
•  Lack of coding best practices

•  Outdated/unpatched code

600 Park Offices Drive, Suite 300


SUMMARY Research Triangle Park, NC 27709
888.678.0399 | 919.678.0300
Continuous delivery enables rapid builds by provisioning test
environments that match production as closely as possible. Although At DZone, we foster a collaborative environment that empowers developers and
tech professionals to share knowledge, build skills, and solve problems through
integrating security across all stages of a CD pipeline has its own content, code, and community. We thoughtfully — and with intention — challenge
the status quo and value diverse perspectives so that, as one, we can inspire
challenges, with automation and programmable infrastructure, it is positive change through technology.
possible to secure continuous delivery components and underlying
processes. As the threat landscape continuously evolves, it is also Copyright © 2022 DZone, Inc. All rights reserved. No part of this publication
critical for organizations to adopt a shift left for security mindset — the may be reproduced, stored in a retrieval system, or transmitted, in any form or
by means of electronic, mechanical, photocopying, or otherwise, without prior
approach that essentially prioritizes security at par with automation written permission of the publisher.

and collaboration.

REFCARD | JULY 2022 6 BROUGHT TO YOU IN PARTNERSHIP WITH

You might also like