SlideShare a Scribd company logo
1 of 50
Download to read offline
DevSecOps
What Why and How?
Anant Shrivastava
@anantshri
NotSoSecure Global Services
Director NotSoSecure Global Services
Sysadmin / Development / Security
Trainer / Speaker: BlackHat, Nullcon, RootConf, RuxCon, IPExpo, C0c0n
Project Owner: Android Tamer, Code Vigilant
Contributor: null, G4H, OWASP and more
https://anantshri.info (@anantshri on social platforms)
About: Anant Shrivastava
2
● What is DevSecOps?
● Why do we need DevSecOps?
● How do we do DevSecOps?
● Integrate Security in DevOps Pipeline
● Tools of Trade
● Sample Implementation (On Prem and Cloud Native)
● Case Studies
Agenda
3
● I will be listing a lot of tools, It’s not an exhaustive list
● I don't endorse or recommend any specific tool / vendor
● Every environment is different: Test and validate before
implementing any ideas
Disclaimer
4
Effort to strive for “Secure by Default”
● Integrate Security via tools
● Create Security as Code culture
● Promote cross skilling
What is DevSecOps?
5
● DevOps moves at rapid pace, traditional security just can’t
keep up
● DevSecOps makes it easier to manage rapid pace of
development & large scale secure deployments
● DevSecOps allows for much smoother scaling of process
● Security as part of process is the only way to ensure safety
Why do we need DevSecOps?
6
Shifting Left saves cost & time
7
Developer
Source
Code
Repository
Build
CI/CD
Server
Staging/
QA
Production Monitoring
Suite of
Security
Test
Shifting Left saves cost & time
8
1 SQL Injection
Fewer Man Day Effort
No New Deployments
Automated Source
Code Review
Developer
Source
Code
Repository
Build
CI/CD
Server
Staging/QA Production Monitoring
Suite of
Security
Test
● DevSecOps is Automation + Cultural Changes
● Integrate security tools into your DevOps Pipeline
● Enable cultural changes to embrace DevSecOps
How do we do DevSecOps?
9
Pre-Commit
Hooks
IDE Plugins
Developer
Secrets
Management
Code
Repository
CI/CD Server
Static Application
Security
Testing(SAST)
Source
Composition
Analysis (SCA)
Pre-Build
Dynamic
Application
Security
Testing(DAST)
Post-Build
Build Artifacts
versioning against
code commits
Artifact
Repository
Manual Web
Application
Pentesting
Business Logic
Flaws
QA/Staging
Security in Iaac
Compliance as
Code
Alerting &
Monitoring
Production
Vulnerability Management
Injecting Sec in DevOps
10
DevOps Pipeline
DevSecOps Pipeline
DevOps ---> DevSecOps
● Sensitive information such as the access keys, access
tokens, SSH keys etc. are often erroneously leaked due to
accidental git commits
● Pre-commit hooks can be installed on developer’s
workstations to avoid the same
● Work on pure Regex-based approach for filtering sensitive
data
● If developers want they can circumvent this step hence use
it like a defense in depth but don't fully rely on it
Pre-Commit Hooks
12
● IDE Plugin's provide quick actionable pointer to developers
● It is useful to stop silly security blunders
● Work on pure Regex-based approach
● If developers want they can circumvent this step hence use
it like a defense in depth but don't fully rely on it
IDE Security Plugin
13
● Often credentials are stored in config files
● Leakage can result in abuse scenario
● Secrets Management allows you to
tokenize the information
Secrets Management
14
● We don’t write software's, we build on frameworks
● Biggest portion of software is now third party libraries
● Major languages provide module managements
● PIP, NPM, Gems, go get, perl cpan, php packager and more
● Software Composition Analysis performs checks to identify
vulnerable/outdated 3rd
party libraries
Software Composition Analysis
15
● White-box security testing using automated tools
● Useful for weeding out low-hanging fruits like SQL Injection,
Cross-Site Scripting, insecure libraries etc
● Tool by default configured with generic setting, needs
manual oversight for managing false-positives
Static Analysis Security Testing
16
● Black/Grey-box security testing using automated tools
● SAST may not get full picture without application deployment
● DAST will help in picking out deployment specific issues
● Results from DAST and SAST can be compared to weed out
false-positives
● Tools may need prior set of configuration settings to give
good results
Dynamic Analysis Security Testing
17
● Infrastructure as a code allows you to document and
version control the infra
● It also allows you to perform audit on the infrastructure
● Docker / K8s infra relies on base images
● Environment is as secure as the base image
● Base images need to be minimal in nature and need to be
assessed to identify inherited vulnerabilities
Security in Infrastructure as Code
18
● Compliance could be industry standard (PCI DSS, HIPAA,
SOX) or org specific
● Compliance is essentially a set of rules and hence can be
converted into written test cases
● Having written code format this can again be version
controlled
Compliance as Code
19
● All the tools discussed above result in report fatigue
● Every tool has a different style of presentation
● A central dashboard is required to normalize the data
● Vulnerability Management System can then be integrated to
bug tracking systems to allow devs to work on items
Vulnerability Management
20
● Monitoring is needed for two end goals
● Understand if our security controls are effective
● What and where we need to improve
● To test Security control effectiveness:
● When did an attack occur
● Was it blocked or not
● What level of access was achieved
● what data was bought in and bought out
Alerting and Monitoring
21
● With recent advancements assets now should include
anything and everything where organization data resides
● With rapid development & provisioning the asset inventory
can't be a static inventory
● We need to monitor the assets constantly both on premise
and Cloud
Reference: https://redhuntlabs.com/blog/redifining-assets-a-modern-perspective.html
Asset Monitoring
22
Sample Implementation - Java
A simplistic flow of DevSecOps Pipeline incorporating various stages
https://www.youtube.com/watch?v=7ILrzYLpr14
Tools of The Trade
24
Pre-Commit Hooks
Software Composition Analysis
Static Analysis Security Testing
(SAST)
Secret Management
Threat Modelling Tools ThreatSpec
Microsoft Threat
Modeling Tool
Retire.js
IDE Plugins CAT.net
Git HoundtruffleHog
Keywhiz
Preference given to open-source tools; we don’t endorse any tool
Tools of The Trade
25
Dynamic Analysis Security
Testing (DAST)
Security in Infrastructure as
Code
Compliance as Code
Vulnerability Management
WAF
Preference given to open-source tools; we don’t endorse any tool
Docker Bench for Security
● API / command line access
● Execution start to final output should be 15 minutes max
● Tools should be Containerizable / scriptable
● Minimal licensing limitations (parallel scans or threads)
● Output format parsable / machine readable (no to stdout,
yes to json / xml)
● Configurable to counter false negatives / false positives
To be or Not to Be in Pipeline
26
● Pipeline to be tweaked based on Milestone (Initiative/Epic/Story)
● Remember initial onboarding is tedious
● Ensure dataset dependent tool get frequent data refresh
● Sample optimization
● Only CSS Changes: no need for SCA
● Only pom.xml or gradle changes: no need of SAST
● If Infra as code has zero changes skip or fast track infra scan
● Ensure to run full (non optimized) pipeline periodically
Pipeline Optimization
● Different programming languages need different tools for
static analysis and software composition analysis
● Some tools support multiple languages like sonarqube
● Others are focused on one language
Does Programming Language Matter
28
Language Specific Tools
29
JAVA
PHP
Python
Ruby/Rails
Languages Software Composition Analysis Source Code Static Analysis
.NET DotNET Retire
SafeNuGet
ClearlyDefined
Node JS
ClearlyDefined
graudit
graudit
graudit
DotNet
Security
Guard
Brakeman graudit
Preference given to open-source tools; we don’t endorse any tool
NodeJsScan
npm-check
DevSecOps Lab - Ruby
DevSecOps Lab - PHP
DevSecOps Lab - Python
DevSecOps Lab - NodeJS
● The Threat Landscape changes
- Identity and Access Management
- Asset Inventory
- Billing
● Infrastructure as Code allows quick audit / linting
● Focus more on:
- Security groups
- Permissions to resources
- Rogue / shadow admins
- Forgotten resources (compromises / billing)
What about Cloud
34
● Different Service Providers Approach Security Differently
● All of them provide some of the ingredient in-house
● Irrespective of Cloud provider some tools will still need to
be sourced
● Static Code Analysis Tool
● Dynamic Code Analysis Tool
● Software Composition Analysis
● Vulnerability Management Tool
Cloud Native Approach to Security
35
AWS Cloud Native DevSecOps
36https://youtu.be/i38-YQsnqfw
Cloud Native Dev[Sec]Ops
37
Conventional Infra AWS Azure GCP
Source Code Management Bitbucket, Github, Gitlab etc.. AWS CloudCommit Azure Repos Cloud Source Repositories
Infrastructure As a Code Chef, Puppet, Ansible more.. Amazon CloudFormation Azure DevTest Labs Cloud Code
CI/CD Server
Jenkins, Bamboo, Gitlab,
Travis CI, Circleci more
AWS CodeBuild
AWS CodeDeploy
AWS CodePipeline
Azure Pipelines, Azure Test Plans Cloud Build, Tekton
Artifactory Repository
jFrog Artifactory,
Sonatype Nexus, more..
Amazon S3 Azure Artifacts Cloud Firestore
Stg/Prod Servers
VMWare,
On-premises servers
EC2
ECS (Elastic Containers)
EKS (Elastic Kubernetes)
Virtual Machines,
Azure Lab Services,
Azure Kubernetes Service (AKS)
Compute Engine,
App Engine,
Shielded VMs
Monitoring & Alert Nagios, Graphite, Grafana AWS CloudWatch Azure Monitor, Network Watcher Access Transparency
Firewall Modsecurity
AWS Firewall Manager, AWS
WAF
Azure Firewall Application Gateway
DLP MyDLP, OpenDLP Amazon Macie Azure Information Protection Cloud Data Loss Prevention
Threat Detection Snort, Kismet Amazon GuardDuty
Azure Advanced Threat
Protection
Event Threat Detection (beta)
Vulnerability Scanning OpenVAS, Nessus Amazon Inspector Azure Security Center Cloud Security Scanner
Secrets Management Hashicorp Vault, Docker Secrets AWS Secrets Manager Azure Key Vault Secrets management
● Automation alone will not solve the problems
● Encourage security mindset especially if outside sec team
● Cultivate/Identify common goals for greater good
● Build allies (security champions) in company
● Focus on collaboration and inclusive culture
● Avoid Blame Game
Security team should try to eliminate the need of dedicated security team
Cultural Aspect
38
● Bridge between Dev, Sec and Ops teams
● Single Person per team
● Everyone provided with similar cross skilling opportunities
● Incentivize other teams to collaborate with Sec team
○ Internal Bug bounties
○ Sponsor Interactions (Parties / get-togethers)
○ Sponsor cross skilling trainings for other teams
Security Champion
39
Security Enablers
40
People
• Build relationships between
teams, don’t isolate
• Identify, nurture security
conscious individuals
• Empower Dev / ops to
deliver better and faster
and secure, instead of
blocking.
• Focus on solutions instead
of blaming
Process
• Involve security from get-go
(design or ideation phase)
• Fix by priority, don’t
attempt to fix it all
• Security Controls must be
programmable and
automated wherever
possible
• DevSecOps Feedback
process must be smooth
and governed
Technology
• Templatize scripts/tools per
language/platform
• Adopt security to devops
flow don’t expect others to
adopt security
• Keep an eye out for simpler
and better options and be
pragmatic to test and use
new tools
Generic Case Study
41
Case Studies – Fannie Mae
42https://www.slideshare.net/DevSecOpsDays/fannie-mae-devsecops-journey-with-chitra-elango-and-john-willis
Case Studies – Fannie Mae
43https://www.slideshare.net/DevSecOpsDays/fannie-mae-devsecops-journey-with-chitra-elango-and-john-willis
Case Studies – ABN Amro
44https://www.slideshare.net/derweeksglobal/abn-amro-devsecops-journey
Case Studies – ABN Amro
45https://www.slideshare.net/derweeksglobal/abn-amro-devsecops-journey
Negative Case Studies
46
Cloud Assets Misconfiguration
Prevention: Continuous monitoring and review of cloud assets and config
● Rite of passage by periodic pen test and continuous bug bounty
● It's not just important to get feedback but to also action on them
● Risk Acceptance Documentation should be the worst case scenario
not your first bet
Is it Enough?
47
● Did we secure the security controls
● DevSecOops: If attacker controls security
tools / build chain It has limitless power
● Ensure the same practice is followed back
again for these tools
● Security role doesn't means you get to
circumvent the rules
● Follow basic security hygiene we always
keep talking about
● Secure configuration
● Patching Policy
Who Watches the Watcher
48
•https://www.blackhat.com/docs/us-17/thursday/us-17-Lackey-Practical%20Tips-for-Defendin
g-Web-Applications-in-the-Age-of-DevOps.pdf
•https://www.sonatype.com/hubfs/2018%20State%20of%20the%20Software%20Supply%20
Chain%20Report.pdf
•https://snyk.io/opensourcesecurity-2019/
•https://scaling-threat-detection.awssecworkshops.com/
•https://www.veracode.com/state-of-software-security-report
References
49
● Security is everyone responsibility
● Embrace security as an integral part of the process, use feedback to
refine the process
● DevSecOps is not a one size fit all: your mileage will vary
Key Takeaways
50
@anantshri
anant@notsosecure.com

More Related Content

What's hot

2019 DevSecOps Reference Architectures
2019 DevSecOps Reference Architectures2019 DevSecOps Reference Architectures
2019 DevSecOps Reference ArchitecturesSonatype
 
DevSecOps | DevOps Sec
DevSecOps | DevOps SecDevSecOps | DevOps Sec
DevSecOps | DevOps SecRubal Jain
 
[DevSecOps Live] DevSecOps: Challenges and Opportunities
[DevSecOps Live] DevSecOps: Challenges and Opportunities[DevSecOps Live] DevSecOps: Challenges and Opportunities
[DevSecOps Live] DevSecOps: Challenges and OpportunitiesMohammed A. Imran
 
DevSecOps and the CI/CD Pipeline
 DevSecOps and the CI/CD Pipeline DevSecOps and the CI/CD Pipeline
DevSecOps and the CI/CD PipelineJames Wickett
 
Slide DevSecOps Microservices
Slide DevSecOps Microservices Slide DevSecOps Microservices
Slide DevSecOps Microservices Hendri Karisma
 
Introduction to DevSecOps
Introduction to DevSecOpsIntroduction to DevSecOps
Introduction to DevSecOpsSetu Parimi
 
DEVSECOPS: Coding DevSecOps journey
DEVSECOPS: Coding DevSecOps journeyDEVSECOPS: Coding DevSecOps journey
DEVSECOPS: Coding DevSecOps journeyJason Suttie
 
DevSecOps The Evolution of DevOps
DevSecOps The Evolution of DevOpsDevSecOps The Evolution of DevOps
DevSecOps The Evolution of DevOpsMichael Man
 
DevSecOps : an Introduction
DevSecOps : an IntroductionDevSecOps : an Introduction
DevSecOps : an IntroductionPrashanth B. P.
 
ABN AMRO DevSecOps Journey
ABN AMRO DevSecOps JourneyABN AMRO DevSecOps Journey
ABN AMRO DevSecOps JourneyDerek E. Weeks
 
DevOps to DevSecOps Journey..
DevOps to DevSecOps Journey..DevOps to DevSecOps Journey..
DevOps to DevSecOps Journey..Siddharth Joshi
 
Bridging the Security Testing Gap in Your CI/CD Pipeline
Bridging the Security Testing Gap in Your CI/CD PipelineBridging the Security Testing Gap in Your CI/CD Pipeline
Bridging the Security Testing Gap in Your CI/CD PipelineDevOps.com
 
Security Process in DevSecOps
Security Process in DevSecOpsSecurity Process in DevSecOps
Security Process in DevSecOpsOpsta
 
DevSecOps reference architectures 2018
DevSecOps reference architectures 2018DevSecOps reference architectures 2018
DevSecOps reference architectures 2018Sonatype
 
The What, Why, and How of DevSecOps
The What, Why, and How of DevSecOpsThe What, Why, and How of DevSecOps
The What, Why, and How of DevSecOpsCprime
 

What's hot (20)

DEVSECOPS.pptx
DEVSECOPS.pptxDEVSECOPS.pptx
DEVSECOPS.pptx
 
Implementing DevSecOps
Implementing DevSecOpsImplementing DevSecOps
Implementing DevSecOps
 
2019 DevSecOps Reference Architectures
2019 DevSecOps Reference Architectures2019 DevSecOps Reference Architectures
2019 DevSecOps Reference Architectures
 
Introduction to DevSecOps
Introduction to DevSecOpsIntroduction to DevSecOps
Introduction to DevSecOps
 
DevSecOps | DevOps Sec
DevSecOps | DevOps SecDevSecOps | DevOps Sec
DevSecOps | DevOps Sec
 
[DevSecOps Live] DevSecOps: Challenges and Opportunities
[DevSecOps Live] DevSecOps: Challenges and Opportunities[DevSecOps Live] DevSecOps: Challenges and Opportunities
[DevSecOps Live] DevSecOps: Challenges and Opportunities
 
DevSecOps and the CI/CD Pipeline
 DevSecOps and the CI/CD Pipeline DevSecOps and the CI/CD Pipeline
DevSecOps and the CI/CD Pipeline
 
Slide DevSecOps Microservices
Slide DevSecOps Microservices Slide DevSecOps Microservices
Slide DevSecOps Microservices
 
Introduction to DevSecOps
Introduction to DevSecOpsIntroduction to DevSecOps
Introduction to DevSecOps
 
DEVSECOPS: Coding DevSecOps journey
DEVSECOPS: Coding DevSecOps journeyDEVSECOPS: Coding DevSecOps journey
DEVSECOPS: Coding DevSecOps journey
 
DevSecOps The Evolution of DevOps
DevSecOps The Evolution of DevOpsDevSecOps The Evolution of DevOps
DevSecOps The Evolution of DevOps
 
DevSecOps
DevSecOpsDevSecOps
DevSecOps
 
DevSecOps : an Introduction
DevSecOps : an IntroductionDevSecOps : an Introduction
DevSecOps : an Introduction
 
ABN AMRO DevSecOps Journey
ABN AMRO DevSecOps JourneyABN AMRO DevSecOps Journey
ABN AMRO DevSecOps Journey
 
DevOps to DevSecOps Journey..
DevOps to DevSecOps Journey..DevOps to DevSecOps Journey..
DevOps to DevSecOps Journey..
 
Bridging the Security Testing Gap in Your CI/CD Pipeline
Bridging the Security Testing Gap in Your CI/CD PipelineBridging the Security Testing Gap in Your CI/CD Pipeline
Bridging the Security Testing Gap in Your CI/CD Pipeline
 
DevSecOps
DevSecOpsDevSecOps
DevSecOps
 
Security Process in DevSecOps
Security Process in DevSecOpsSecurity Process in DevSecOps
Security Process in DevSecOps
 
DevSecOps reference architectures 2018
DevSecOps reference architectures 2018DevSecOps reference architectures 2018
DevSecOps reference architectures 2018
 
The What, Why, and How of DevSecOps
The What, Why, and How of DevSecOpsThe What, Why, and How of DevSecOps
The What, Why, and How of DevSecOps
 

Similar to DevSecOps: What Why and How : Blackhat 2019

Agile Secure Development
Agile Secure DevelopmentAgile Secure Development
Agile Secure DevelopmentBosnia Agile
 
TechTalk 2021: Peran IT Security dalam Penerapan DevOps
TechTalk 2021: Peran IT Security dalam Penerapan DevOpsTechTalk 2021: Peran IT Security dalam Penerapan DevOps
TechTalk 2021: Peran IT Security dalam Penerapan DevOpsDicodingEvent
 
Deepfence.pdf
Deepfence.pdfDeepfence.pdf
Deepfence.pdfVishwas N
 
Platform Security IRL: Busting Buzzwords & Building Better
Platform Security IRL:  Busting Buzzwords & Building BetterPlatform Security IRL:  Busting Buzzwords & Building Better
Platform Security IRL: Busting Buzzwords & Building BetterEqual Experts
 
DevOps & DevSecOps in Swiss Banking
DevOps & DevSecOps in Swiss BankingDevOps & DevSecOps in Swiss Banking
DevOps & DevSecOps in Swiss BankingAarno Aukia
 
DevSecOps: essential tooling to enable continuous security 2019-09-16
DevSecOps: essential tooling to enable continuous security 2019-09-16DevSecOps: essential tooling to enable continuous security 2019-09-16
DevSecOps: essential tooling to enable continuous security 2019-09-16Rich Mills
 
Tw noche geek quito webappsec
Tw noche geek quito   webappsecTw noche geek quito   webappsec
Tw noche geek quito webappsecThoughtworks
 
Web Application Security: Introduction to common classes of security flaws an...
Web Application Security: Introduction to common classes of security flaws an...Web Application Security: Introduction to common classes of security flaws an...
Web Application Security: Introduction to common classes of security flaws an...Thoughtworks
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline SecurityJames Wickett
 
Integracia security do ci cd pipelines
Integracia security do ci cd pipelinesIntegracia security do ci cd pipelines
Integracia security do ci cd pipelinesJuraj Hantak
 
Deploy 22 microservices from scratch in 30 mins with GitOps
Deploy 22 microservices from scratch in 30 mins with GitOpsDeploy 22 microservices from scratch in 30 mins with GitOps
Deploy 22 microservices from scratch in 30 mins with GitOpsOpsta
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil FrameworkVeilFramework
 
Shift Left Security
Shift Left SecurityShift Left Security
Shift Left Securitygjdevos
 
Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?Sqreen
 
OWASP Brisbane - SDN Security
OWASP Brisbane - SDN SecurityOWASP Brisbane - SDN Security
OWASP Brisbane - SDN SecurityDavid Jorm
 
Security in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps EngineersSecurity in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps EngineersDevOps.com
 
Q Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - ConjurQ Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - Conjurconjur_inc
 
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Codemotion
 

Similar to DevSecOps: What Why and How : Blackhat 2019 (20)

Agile Secure Development
Agile Secure DevelopmentAgile Secure Development
Agile Secure Development
 
TechTalk 2021: Peran IT Security dalam Penerapan DevOps
TechTalk 2021: Peran IT Security dalam Penerapan DevOpsTechTalk 2021: Peran IT Security dalam Penerapan DevOps
TechTalk 2021: Peran IT Security dalam Penerapan DevOps
 
Deepfence.pdf
Deepfence.pdfDeepfence.pdf
Deepfence.pdf
 
Platform Security IRL: Busting Buzzwords & Building Better
Platform Security IRL:  Busting Buzzwords & Building BetterPlatform Security IRL:  Busting Buzzwords & Building Better
Platform Security IRL: Busting Buzzwords & Building Better
 
DevOps & DevSecOps in Swiss Banking
DevOps & DevSecOps in Swiss BankingDevOps & DevSecOps in Swiss Banking
DevOps & DevSecOps in Swiss Banking
 
Security in open source projects
Security in open source projectsSecurity in open source projects
Security in open source projects
 
DevSecOps: essential tooling to enable continuous security 2019-09-16
DevSecOps: essential tooling to enable continuous security 2019-09-16DevSecOps: essential tooling to enable continuous security 2019-09-16
DevSecOps: essential tooling to enable continuous security 2019-09-16
 
Tw noche geek quito webappsec
Tw noche geek quito   webappsecTw noche geek quito   webappsec
Tw noche geek quito webappsec
 
Web Application Security: Introduction to common classes of security flaws an...
Web Application Security: Introduction to common classes of security flaws an...Web Application Security: Introduction to common classes of security flaws an...
Web Application Security: Introduction to common classes of security flaws an...
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline Security
 
Integracia security do ci cd pipelines
Integracia security do ci cd pipelinesIntegracia security do ci cd pipelines
Integracia security do ci cd pipelines
 
Deploy 22 microservices from scratch in 30 mins with GitOps
Deploy 22 microservices from scratch in 30 mins with GitOpsDeploy 22 microservices from scratch in 30 mins with GitOps
Deploy 22 microservices from scratch in 30 mins with GitOps
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
 
Security for Humans
Security for HumansSecurity for Humans
Security for Humans
 
Shift Left Security
Shift Left SecurityShift Left Security
Shift Left Security
 
Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?
 
OWASP Brisbane - SDN Security
OWASP Brisbane - SDN SecurityOWASP Brisbane - SDN Security
OWASP Brisbane - SDN Security
 
Security in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps EngineersSecurity in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps Engineers
 
Q Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - ConjurQ Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - Conjur
 
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

DevSecOps: What Why and How : Blackhat 2019

  • 1. DevSecOps What Why and How? Anant Shrivastava @anantshri NotSoSecure Global Services
  • 2. Director NotSoSecure Global Services Sysadmin / Development / Security Trainer / Speaker: BlackHat, Nullcon, RootConf, RuxCon, IPExpo, C0c0n Project Owner: Android Tamer, Code Vigilant Contributor: null, G4H, OWASP and more https://anantshri.info (@anantshri on social platforms) About: Anant Shrivastava 2
  • 3. ● What is DevSecOps? ● Why do we need DevSecOps? ● How do we do DevSecOps? ● Integrate Security in DevOps Pipeline ● Tools of Trade ● Sample Implementation (On Prem and Cloud Native) ● Case Studies Agenda 3
  • 4. ● I will be listing a lot of tools, It’s not an exhaustive list ● I don't endorse or recommend any specific tool / vendor ● Every environment is different: Test and validate before implementing any ideas Disclaimer 4
  • 5. Effort to strive for “Secure by Default” ● Integrate Security via tools ● Create Security as Code culture ● Promote cross skilling What is DevSecOps? 5
  • 6. ● DevOps moves at rapid pace, traditional security just can’t keep up ● DevSecOps makes it easier to manage rapid pace of development & large scale secure deployments ● DevSecOps allows for much smoother scaling of process ● Security as part of process is the only way to ensure safety Why do we need DevSecOps? 6
  • 7. Shifting Left saves cost & time 7 Developer Source Code Repository Build CI/CD Server Staging/ QA Production Monitoring Suite of Security Test
  • 8. Shifting Left saves cost & time 8 1 SQL Injection Fewer Man Day Effort No New Deployments Automated Source Code Review Developer Source Code Repository Build CI/CD Server Staging/QA Production Monitoring Suite of Security Test
  • 9. ● DevSecOps is Automation + Cultural Changes ● Integrate security tools into your DevOps Pipeline ● Enable cultural changes to embrace DevSecOps How do we do DevSecOps? 9
  • 10. Pre-Commit Hooks IDE Plugins Developer Secrets Management Code Repository CI/CD Server Static Application Security Testing(SAST) Source Composition Analysis (SCA) Pre-Build Dynamic Application Security Testing(DAST) Post-Build Build Artifacts versioning against code commits Artifact Repository Manual Web Application Pentesting Business Logic Flaws QA/Staging Security in Iaac Compliance as Code Alerting & Monitoring Production Vulnerability Management Injecting Sec in DevOps 10
  • 12. ● Sensitive information such as the access keys, access tokens, SSH keys etc. are often erroneously leaked due to accidental git commits ● Pre-commit hooks can be installed on developer’s workstations to avoid the same ● Work on pure Regex-based approach for filtering sensitive data ● If developers want they can circumvent this step hence use it like a defense in depth but don't fully rely on it Pre-Commit Hooks 12
  • 13. ● IDE Plugin's provide quick actionable pointer to developers ● It is useful to stop silly security blunders ● Work on pure Regex-based approach ● If developers want they can circumvent this step hence use it like a defense in depth but don't fully rely on it IDE Security Plugin 13
  • 14. ● Often credentials are stored in config files ● Leakage can result in abuse scenario ● Secrets Management allows you to tokenize the information Secrets Management 14
  • 15. ● We don’t write software's, we build on frameworks ● Biggest portion of software is now third party libraries ● Major languages provide module managements ● PIP, NPM, Gems, go get, perl cpan, php packager and more ● Software Composition Analysis performs checks to identify vulnerable/outdated 3rd party libraries Software Composition Analysis 15
  • 16. ● White-box security testing using automated tools ● Useful for weeding out low-hanging fruits like SQL Injection, Cross-Site Scripting, insecure libraries etc ● Tool by default configured with generic setting, needs manual oversight for managing false-positives Static Analysis Security Testing 16
  • 17. ● Black/Grey-box security testing using automated tools ● SAST may not get full picture without application deployment ● DAST will help in picking out deployment specific issues ● Results from DAST and SAST can be compared to weed out false-positives ● Tools may need prior set of configuration settings to give good results Dynamic Analysis Security Testing 17
  • 18. ● Infrastructure as a code allows you to document and version control the infra ● It also allows you to perform audit on the infrastructure ● Docker / K8s infra relies on base images ● Environment is as secure as the base image ● Base images need to be minimal in nature and need to be assessed to identify inherited vulnerabilities Security in Infrastructure as Code 18
  • 19. ● Compliance could be industry standard (PCI DSS, HIPAA, SOX) or org specific ● Compliance is essentially a set of rules and hence can be converted into written test cases ● Having written code format this can again be version controlled Compliance as Code 19
  • 20. ● All the tools discussed above result in report fatigue ● Every tool has a different style of presentation ● A central dashboard is required to normalize the data ● Vulnerability Management System can then be integrated to bug tracking systems to allow devs to work on items Vulnerability Management 20
  • 21. ● Monitoring is needed for two end goals ● Understand if our security controls are effective ● What and where we need to improve ● To test Security control effectiveness: ● When did an attack occur ● Was it blocked or not ● What level of access was achieved ● what data was bought in and bought out Alerting and Monitoring 21
  • 22. ● With recent advancements assets now should include anything and everything where organization data resides ● With rapid development & provisioning the asset inventory can't be a static inventory ● We need to monitor the assets constantly both on premise and Cloud Reference: https://redhuntlabs.com/blog/redifining-assets-a-modern-perspective.html Asset Monitoring 22
  • 23. Sample Implementation - Java A simplistic flow of DevSecOps Pipeline incorporating various stages https://www.youtube.com/watch?v=7ILrzYLpr14
  • 24. Tools of The Trade 24 Pre-Commit Hooks Software Composition Analysis Static Analysis Security Testing (SAST) Secret Management Threat Modelling Tools ThreatSpec Microsoft Threat Modeling Tool Retire.js IDE Plugins CAT.net Git HoundtruffleHog Keywhiz Preference given to open-source tools; we don’t endorse any tool
  • 25. Tools of The Trade 25 Dynamic Analysis Security Testing (DAST) Security in Infrastructure as Code Compliance as Code Vulnerability Management WAF Preference given to open-source tools; we don’t endorse any tool Docker Bench for Security
  • 26. ● API / command line access ● Execution start to final output should be 15 minutes max ● Tools should be Containerizable / scriptable ● Minimal licensing limitations (parallel scans or threads) ● Output format parsable / machine readable (no to stdout, yes to json / xml) ● Configurable to counter false negatives / false positives To be or Not to Be in Pipeline 26
  • 27. ● Pipeline to be tweaked based on Milestone (Initiative/Epic/Story) ● Remember initial onboarding is tedious ● Ensure dataset dependent tool get frequent data refresh ● Sample optimization ● Only CSS Changes: no need for SCA ● Only pom.xml or gradle changes: no need of SAST ● If Infra as code has zero changes skip or fast track infra scan ● Ensure to run full (non optimized) pipeline periodically Pipeline Optimization
  • 28. ● Different programming languages need different tools for static analysis and software composition analysis ● Some tools support multiple languages like sonarqube ● Others are focused on one language Does Programming Language Matter 28
  • 29. Language Specific Tools 29 JAVA PHP Python Ruby/Rails Languages Software Composition Analysis Source Code Static Analysis .NET DotNET Retire SafeNuGet ClearlyDefined Node JS ClearlyDefined graudit graudit graudit DotNet Security Guard Brakeman graudit Preference given to open-source tools; we don’t endorse any tool NodeJsScan npm-check
  • 32. DevSecOps Lab - Python
  • 33. DevSecOps Lab - NodeJS
  • 34. ● The Threat Landscape changes - Identity and Access Management - Asset Inventory - Billing ● Infrastructure as Code allows quick audit / linting ● Focus more on: - Security groups - Permissions to resources - Rogue / shadow admins - Forgotten resources (compromises / billing) What about Cloud 34
  • 35. ● Different Service Providers Approach Security Differently ● All of them provide some of the ingredient in-house ● Irrespective of Cloud provider some tools will still need to be sourced ● Static Code Analysis Tool ● Dynamic Code Analysis Tool ● Software Composition Analysis ● Vulnerability Management Tool Cloud Native Approach to Security 35
  • 36. AWS Cloud Native DevSecOps 36https://youtu.be/i38-YQsnqfw
  • 37. Cloud Native Dev[Sec]Ops 37 Conventional Infra AWS Azure GCP Source Code Management Bitbucket, Github, Gitlab etc.. AWS CloudCommit Azure Repos Cloud Source Repositories Infrastructure As a Code Chef, Puppet, Ansible more.. Amazon CloudFormation Azure DevTest Labs Cloud Code CI/CD Server Jenkins, Bamboo, Gitlab, Travis CI, Circleci more AWS CodeBuild AWS CodeDeploy AWS CodePipeline Azure Pipelines, Azure Test Plans Cloud Build, Tekton Artifactory Repository jFrog Artifactory, Sonatype Nexus, more.. Amazon S3 Azure Artifacts Cloud Firestore Stg/Prod Servers VMWare, On-premises servers EC2 ECS (Elastic Containers) EKS (Elastic Kubernetes) Virtual Machines, Azure Lab Services, Azure Kubernetes Service (AKS) Compute Engine, App Engine, Shielded VMs Monitoring & Alert Nagios, Graphite, Grafana AWS CloudWatch Azure Monitor, Network Watcher Access Transparency Firewall Modsecurity AWS Firewall Manager, AWS WAF Azure Firewall Application Gateway DLP MyDLP, OpenDLP Amazon Macie Azure Information Protection Cloud Data Loss Prevention Threat Detection Snort, Kismet Amazon GuardDuty Azure Advanced Threat Protection Event Threat Detection (beta) Vulnerability Scanning OpenVAS, Nessus Amazon Inspector Azure Security Center Cloud Security Scanner Secrets Management Hashicorp Vault, Docker Secrets AWS Secrets Manager Azure Key Vault Secrets management
  • 38. ● Automation alone will not solve the problems ● Encourage security mindset especially if outside sec team ● Cultivate/Identify common goals for greater good ● Build allies (security champions) in company ● Focus on collaboration and inclusive culture ● Avoid Blame Game Security team should try to eliminate the need of dedicated security team Cultural Aspect 38
  • 39. ● Bridge between Dev, Sec and Ops teams ● Single Person per team ● Everyone provided with similar cross skilling opportunities ● Incentivize other teams to collaborate with Sec team ○ Internal Bug bounties ○ Sponsor Interactions (Parties / get-togethers) ○ Sponsor cross skilling trainings for other teams Security Champion 39
  • 40. Security Enablers 40 People • Build relationships between teams, don’t isolate • Identify, nurture security conscious individuals • Empower Dev / ops to deliver better and faster and secure, instead of blocking. • Focus on solutions instead of blaming Process • Involve security from get-go (design or ideation phase) • Fix by priority, don’t attempt to fix it all • Security Controls must be programmable and automated wherever possible • DevSecOps Feedback process must be smooth and governed Technology • Templatize scripts/tools per language/platform • Adopt security to devops flow don’t expect others to adopt security • Keep an eye out for simpler and better options and be pragmatic to test and use new tools
  • 42. Case Studies – Fannie Mae 42https://www.slideshare.net/DevSecOpsDays/fannie-mae-devsecops-journey-with-chitra-elango-and-john-willis
  • 43. Case Studies – Fannie Mae 43https://www.slideshare.net/DevSecOpsDays/fannie-mae-devsecops-journey-with-chitra-elango-and-john-willis
  • 44. Case Studies – ABN Amro 44https://www.slideshare.net/derweeksglobal/abn-amro-devsecops-journey
  • 45. Case Studies – ABN Amro 45https://www.slideshare.net/derweeksglobal/abn-amro-devsecops-journey
  • 46. Negative Case Studies 46 Cloud Assets Misconfiguration Prevention: Continuous monitoring and review of cloud assets and config
  • 47. ● Rite of passage by periodic pen test and continuous bug bounty ● It's not just important to get feedback but to also action on them ● Risk Acceptance Documentation should be the worst case scenario not your first bet Is it Enough? 47
  • 48. ● Did we secure the security controls ● DevSecOops: If attacker controls security tools / build chain It has limitless power ● Ensure the same practice is followed back again for these tools ● Security role doesn't means you get to circumvent the rules ● Follow basic security hygiene we always keep talking about ● Secure configuration ● Patching Policy Who Watches the Watcher 48
  • 50. ● Security is everyone responsibility ● Embrace security as an integral part of the process, use feedback to refine the process ● DevSecOps is not a one size fit all: your mileage will vary Key Takeaways 50 @anantshri anant@notsosecure.com