SlideShare a Scribd company logo
1 of 48
Securing
Application
Deployments in
CI/CD Environments
Hello!
I am Binu Ramakrishnan
Principal Security Engineer
at Yahoo
You can find me at:
@securitysauce
Overview
◎CI/CD platform overview.
◎High level objectives.
◎Threat modeling.
◎Security patterns and best practices.
CI/CD
CI/CD Deployments
◎Single-tenant
◎Multi-tenant
Single-tenant
Dedicated build environments.
Multi-tenant
Shared build environment.
Driven by economies of scale.
CI/CD in Nutshell
Enterprise CI/CD
High Level Security
Objectives
Verifiable
Chain of
Trust
No Elevated
Privileges for
Build Jobs
Threat Modeling
CI/CD Admin
Exclusive access to CI/CD
platform
Actors
Developer
User/customer of the
platform.
CI/CD Platform
Developer
Limited admin access to
platform.
Trust
Boundaries.
https://www.flickr.com/photos/nasamarshall/14596371842
Trust
Boundaries
Web interface
◎ UI
◎ REST APIs
Application
Trust
Boundaries
Isolation based on Docker containers or
VMs.
Host
Trust
Boundaries
Segmentation
Network
Attack Surface
Entry Points
Exit Points
Entry Points
◎ Build web interface.
◎ Commit and build notification handlers.
◎ Source and package dependencies.
Internal Entry Points
◎ Build slave endpoint (to launch builds; SSH).
◎ Other control plane endpoints/REST APIs.
Exit Points
◎ Deployable artifacts.
◎ Build notifications - eg emails, IRC and Hipchat
messages.
◎ Build console logs.
◎ Git repo update with build status and badges.
Threats
Common Threats
◎ User account compromise & insider
threats.
○ User and platform admins.
◎ Network Intrusion.
○ CI/CD internal and external endpoints.
Build Slave Compromise
Large attack surface, spread across multiple networks (iphone, Android,
Server app etc.)
How?
◎ A network level compromise, exploiting a vulnerability in build slave.
◎ Jobs break out of build container.
Impact
◎ Access to production servers.
◎ Listen to the network, spoof identity and access unauthorized data.
Shared/Non-ephemeral Keys
◎ Locally stored long-lived keys to access protected
services.
Two forms:
◉ Shared key
◉ Per-job keys (eg. OAuth tokens)
SSH over Unrestricted Shell
Allows arbitrary commands to get
executed on a remote host.
Building External Code
An attacker can take this path to get into internal
networks, either by adding backdoors or exploiting
known vulnerabilities with open source software.
Baseline security controls that are
expected to be there in 2016
Existing Security Controls
◎ Authenticated endpoints.
◎ Web application security practices - CSRF,
HTTPS, HTTPOnly cookies, XSS protection etc.
◎ Source control: granular authorization for repos.
◎ Use KMS to manage secrets; no hardcoded
secrets.
Security Patterns for
Risk Reduction
Ephemeral Keys
https://www.flickr.com/photos/articnomad/241620406
Stateless Auth
Architecture
https://www.flickr.com/photos/18946008@N06/14551311971/
◎ Events:
○ Commit trigger.
○ Manual trigger from build UI.
○ Automated/cron job.
○ Trigger a downstream job.
◎ Upstream service stores downstream service credentials
(OAuth, Shared Keys etc.).
◎ Equal trust on all components in the pipeline
Audit Trails
https://www.flickr.com/photos/adriensifre/8403355648
Container,
ToolChain
Hardening
http://www.publicdomainfiles.com/show_file.php?id=13493588417214
Network Segmentation
https://www.flickr.com/photos/bretagne-
balades/15355029654
Do not pull PII or other sensitive info to build
machine.
Minimal Builds
Few more...
SSH: Use
Restricted
Shells
Headless SSH access for
automated deployment
should use a restricted
shell.
Roll Keys
Periodically
Establish a process to
periodically roll trust anchor
keys (and do it periodically).
Restrict Job
Console Logs
Restrict build job console logs
only to authorized users
Enable 2FA
Admins must follow good
security hygiene and use
2FA to access platform
application and hosts
Prune Admin
Access List
Keep admin list small for
build systems and Git repo
access
Vulnerability
Patch Mgmt
Maintain an inventory of all
packages in use and have a
mechanism to patch the
system in response to a
disclosure
Acknowledgements
◎ Christopher Harrell
◎ St John Johnson
◎ Mike Shema
◎ Jeremiah Wuenschel
Let’s recap major concepts
Ephemeral
Keys
Ephemeral keys are the
future. Service providers
should start supporting
ephemeral keys for
authorization
Stateless Auth
Architecture
Augment the trust dependency
of 1:1 relationship between the
pipeline components with
workflow job tokens.
Audit Logs
A verifiable chain of trust
based on traceable audit
logs is a foundational
requirement for CI/CD.
Minimal Builds
Avoid pulling PII or other
production sensitive data to
build environments. Keep
the builds to minimum
Network
Segmentation
Network level Isolation of CI/CD
machines from other machines
ToolChain
Hardening
Build tools and Docker
containers must be
adequately hardened.
Thanks!
Any questions?
You can find me at:
@securitysauce
Appendix-A
Use
◎ Source code
◎ Pre-built packages
Risks
◎ Targeted back doors
◎ Vulnerabilities
Hard Problem: Securing Supply Chain
This threat is more to do with applications than the
CI/CD platform itself.
Open source components constitute a large part of
modern Internet based applications.
Appendix-B
Credits
Special thanks to all the people who made and
released these awesome resources for free:
◎ Presentation template by SlidesCarnival
◎ Photographs by Unsplash & Death to the Stock
Photo (license)

More Related Content

What's hot

[OWASP Poland Day] Saving private token
[OWASP Poland Day] Saving private token[OWASP Poland Day] Saving private token
[OWASP Poland Day] Saving private tokenOWASP
 
Linux Security for Developers
Linux Security for DevelopersLinux Security for Developers
Linux Security for DevelopersMichael Boelen
 
CSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on androidCSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on androidCanSecWest
 
Evaluating container security with ATT&CK Framework
Evaluating container security with ATT&CK FrameworkEvaluating container security with ATT&CK Framework
Evaluating container security with ATT&CK FrameworkSandeep Jayashankar
 
Security Issues in Android Custom ROM
Security Issues in Android Custom ROMSecurity Issues in Android Custom ROM
Security Issues in Android Custom ROMAnant Shrivastava
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldDevOps.com
 
[OWASP Poland Day] Security knowledge framework
[OWASP Poland Day] Security knowledge framework[OWASP Poland Day] Security knowledge framework
[OWASP Poland Day] Security knowledge frameworkOWASP
 
When the internet bleeded : RootConf 2014
When the internet bleeded : RootConf 2014When the internet bleeded : RootConf 2014
When the internet bleeded : RootConf 2014Anant Shrivastava
 
Apache Struts2 CVE-2017-5638
Apache Struts2 CVE-2017-5638Apache Struts2 CVE-2017-5638
Apache Struts2 CVE-2017-5638Riyaz Walikar
 
[Wroclaw #2] Web Application Security Headers
[Wroclaw #2] Web Application Security Headers[Wroclaw #2] Web Application Security Headers
[Wroclaw #2] Web Application Security HeadersOWASP
 
Tale of Forgotten Disclosure and Lesson learned
Tale of Forgotten Disclosure and Lesson learnedTale of Forgotten Disclosure and Lesson learned
Tale of Forgotten Disclosure and Lesson learnedAnant Shrivastava
 
Problems with parameters b sides-msp
Problems with parameters b sides-mspProblems with parameters b sides-msp
Problems with parameters b sides-mspMike Saunders
 
"CERT Secure Coding Standards" by Dr. Mark Sherman
"CERT Secure Coding Standards" by Dr. Mark Sherman"CERT Secure Coding Standards" by Dr. Mark Sherman
"CERT Secure Coding Standards" by Dr. Mark ShermanRinaldi Rampen
 

What's hot (20)

[OWASP Poland Day] Saving private token
[OWASP Poland Day] Saving private token[OWASP Poland Day] Saving private token
[OWASP Poland Day] Saving private token
 
Linux Security for Developers
Linux Security for DevelopersLinux Security for Developers
Linux Security for Developers
 
Browser exploit framework
Browser exploit frameworkBrowser exploit framework
Browser exploit framework
 
Lession 9
Lession 9Lession 9
Lession 9
 
CSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on androidCSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on android
 
Evaluating container security with ATT&CK Framework
Evaluating container security with ATT&CK FrameworkEvaluating container security with ATT&CK Framework
Evaluating container security with ATT&CK Framework
 
Browser Exploit Framework
Browser Exploit FrameworkBrowser Exploit Framework
Browser Exploit Framework
 
Security Issues in Android Custom ROM
Security Issues in Android Custom ROMSecurity Issues in Android Custom ROM
Security Issues in Android Custom ROM
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote World
 
[OWASP Poland Day] Security knowledge framework
[OWASP Poland Day] Security knowledge framework[OWASP Poland Day] Security knowledge framework
[OWASP Poland Day] Security knowledge framework
 
Lession 7
Lession 7Lession 7
Lession 7
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
When the internet bleeded : RootConf 2014
When the internet bleeded : RootConf 2014When the internet bleeded : RootConf 2014
When the internet bleeded : RootConf 2014
 
Apache Struts2 CVE-2017-5638
Apache Struts2 CVE-2017-5638Apache Struts2 CVE-2017-5638
Apache Struts2 CVE-2017-5638
 
[Wroclaw #2] Web Application Security Headers
[Wroclaw #2] Web Application Security Headers[Wroclaw #2] Web Application Security Headers
[Wroclaw #2] Web Application Security Headers
 
Tale of Forgotten Disclosure and Lesson learned
Tale of Forgotten Disclosure and Lesson learnedTale of Forgotten Disclosure and Lesson learned
Tale of Forgotten Disclosure and Lesson learned
 
Anatomy of a Cloud Hack
Anatomy of a Cloud HackAnatomy of a Cloud Hack
Anatomy of a Cloud Hack
 
Securing Apache Web Servers
Securing Apache Web ServersSecuring Apache Web Servers
Securing Apache Web Servers
 
Problems with parameters b sides-msp
Problems with parameters b sides-mspProblems with parameters b sides-msp
Problems with parameters b sides-msp
 
"CERT Secure Coding Standards" by Dr. Mark Sherman
"CERT Secure Coding Standards" by Dr. Mark Sherman"CERT Secure Coding Standards" by Dr. Mark Sherman
"CERT Secure Coding Standards" by Dr. Mark Sherman
 

Viewers also liked

Open Standards in the Walled Garden
Open Standards in the Walled GardenOpen Standards in the Walled Garden
Open Standards in the Walled Gardendigitalbindery
 
Smaller, Flatter, Smarter
Smaller, Flatter, SmarterSmaller, Flatter, Smarter
Smaller, Flatter, SmarterWeb 2.0 Expo
 
Mobilising the world's Natural History - Open Data + Citizen Science
Mobilising the world's Natural History - Open Data + Citizen ScienceMobilising the world's Natural History - Open Data + Citizen Science
Mobilising the world's Natural History - Open Data + Citizen ScienceMargaret Gold
 
Kobo: What Do eBook Customers Really, Really Want? (Tools of Change 2011)
Kobo: What Do eBook Customers Really, Really Want? (Tools of Change 2011)Kobo: What Do eBook Customers Really, Really Want? (Tools of Change 2011)
Kobo: What Do eBook Customers Really, Really Want? (Tools of Change 2011)MTamblyn
 
(Short version) Building a Mobile, Social, Location-Based Game in 5 Weeks
(Short version) Building a Mobile, Social, Location-Based Game in 5 Weeks(Short version) Building a Mobile, Social, Location-Based Game in 5 Weeks
(Short version) Building a Mobile, Social, Location-Based Game in 5 WeeksJennie Lees
 
Social Gold: The Design of FarmVille and Other Social Games (Web2Expo 2010)
Social Gold: The Design of FarmVille and Other Social Games (Web2Expo 2010)Social Gold: The Design of FarmVille and Other Social Games (Web2Expo 2010)
Social Gold: The Design of FarmVille and Other Social Games (Web2Expo 2010)Amitt Mahajan
 
Web 2.0 Expo Speech: Open Leadership
Web 2.0 Expo Speech: Open LeadershipWeb 2.0 Expo Speech: Open Leadership
Web 2.0 Expo Speech: Open LeadershipCharlene Li
 
Data Science and Smart Systems: Creating the Digital Brain
Data Science and Smart Systems: Creating the Digital Brain Data Science and Smart Systems: Creating the Digital Brain
Data Science and Smart Systems: Creating the Digital Brain VMware Tanzu
 
Hadoop's Impact on the Future of Data Management | Amr Awadallah
Hadoop's Impact on the Future of Data Management | Amr AwadallahHadoop's Impact on the Future of Data Management | Amr Awadallah
Hadoop's Impact on the Future of Data Management | Amr AwadallahCloudera, Inc.
 
Locked Out in London (and tweeting about it) - version with my notes
Locked Out in London (and tweeting about it) - version with my notesLocked Out in London (and tweeting about it) - version with my notes
Locked Out in London (and tweeting about it) - version with my notesSylvain Carle
 
Did Social Media Hijack My Communications Strategy
Did Social Media Hijack My Communications StrategyDid Social Media Hijack My Communications Strategy
Did Social Media Hijack My Communications StrategyMike Smith
 
Kobo: What Do eBook Customers Really, Really Want? (Michael Tamblyn at Tools ...
Kobo: What Do eBook Customers Really, Really Want? (Michael Tamblyn at Tools ...Kobo: What Do eBook Customers Really, Really Want? (Michael Tamblyn at Tools ...
Kobo: What Do eBook Customers Really, Really Want? (Michael Tamblyn at Tools ...Kobo
 
The Laws of User Experience: Making it or Breaking It with the UX Factor
The Laws of User Experience: Making it or Breaking It with the UX FactorThe Laws of User Experience: Making it or Breaking It with the UX Factor
The Laws of User Experience: Making it or Breaking It with the UX FactorEffective
 
Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?Colin Charles
 
Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015Rakesh Chaudhary
 
Managing a large open source community - OSCON 2016
Managing a large open source community - OSCON 2016Managing a large open source community - OSCON 2016
Managing a large open source community - OSCON 2016{code}
 
Strata San Jose 2016: Deep Learning is eating your lunch -- and mine
Strata San Jose 2016: Deep Learning is eating your lunch -- and mineStrata San Jose 2016: Deep Learning is eating your lunch -- and mine
Strata San Jose 2016: Deep Learning is eating your lunch -- and mineSri Ambati
 
Lean Product Management for Web 2.0 Products
Lean Product Management for Web 2.0 ProductsLean Product Management for Web 2.0 Products
Lean Product Management for Web 2.0 ProductsDan Olsen
 

Viewers also liked (20)

Open Standards in the Walled Garden
Open Standards in the Walled GardenOpen Standards in the Walled Garden
Open Standards in the Walled Garden
 
Kevin Kelly
Kevin KellyKevin Kelly
Kevin Kelly
 
Demand Media
Demand MediaDemand Media
Demand Media
 
Smaller, Flatter, Smarter
Smaller, Flatter, SmarterSmaller, Flatter, Smarter
Smaller, Flatter, Smarter
 
Mobilising the world's Natural History - Open Data + Citizen Science
Mobilising the world's Natural History - Open Data + Citizen ScienceMobilising the world's Natural History - Open Data + Citizen Science
Mobilising the world's Natural History - Open Data + Citizen Science
 
Kobo: What Do eBook Customers Really, Really Want? (Tools of Change 2011)
Kobo: What Do eBook Customers Really, Really Want? (Tools of Change 2011)Kobo: What Do eBook Customers Really, Really Want? (Tools of Change 2011)
Kobo: What Do eBook Customers Really, Really Want? (Tools of Change 2011)
 
(Short version) Building a Mobile, Social, Location-Based Game in 5 Weeks
(Short version) Building a Mobile, Social, Location-Based Game in 5 Weeks(Short version) Building a Mobile, Social, Location-Based Game in 5 Weeks
(Short version) Building a Mobile, Social, Location-Based Game in 5 Weeks
 
Social Gold: The Design of FarmVille and Other Social Games (Web2Expo 2010)
Social Gold: The Design of FarmVille and Other Social Games (Web2Expo 2010)Social Gold: The Design of FarmVille and Other Social Games (Web2Expo 2010)
Social Gold: The Design of FarmVille and Other Social Games (Web2Expo 2010)
 
Web 2.0 Expo Speech: Open Leadership
Web 2.0 Expo Speech: Open LeadershipWeb 2.0 Expo Speech: Open Leadership
Web 2.0 Expo Speech: Open Leadership
 
Data Science and Smart Systems: Creating the Digital Brain
Data Science and Smart Systems: Creating the Digital Brain Data Science and Smart Systems: Creating the Digital Brain
Data Science and Smart Systems: Creating the Digital Brain
 
Hadoop's Impact on the Future of Data Management | Amr Awadallah
Hadoop's Impact on the Future of Data Management | Amr AwadallahHadoop's Impact on the Future of Data Management | Amr Awadallah
Hadoop's Impact on the Future of Data Management | Amr Awadallah
 
Locked Out in London (and tweeting about it) - version with my notes
Locked Out in London (and tweeting about it) - version with my notesLocked Out in London (and tweeting about it) - version with my notes
Locked Out in London (and tweeting about it) - version with my notes
 
Did Social Media Hijack My Communications Strategy
Did Social Media Hijack My Communications StrategyDid Social Media Hijack My Communications Strategy
Did Social Media Hijack My Communications Strategy
 
Kobo: What Do eBook Customers Really, Really Want? (Michael Tamblyn at Tools ...
Kobo: What Do eBook Customers Really, Really Want? (Michael Tamblyn at Tools ...Kobo: What Do eBook Customers Really, Really Want? (Michael Tamblyn at Tools ...
Kobo: What Do eBook Customers Really, Really Want? (Michael Tamblyn at Tools ...
 
The Laws of User Experience: Making it or Breaking It with the UX Factor
The Laws of User Experience: Making it or Breaking It with the UX FactorThe Laws of User Experience: Making it or Breaking It with the UX Factor
The Laws of User Experience: Making it or Breaking It with the UX Factor
 
Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?
 
Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015
 
Managing a large open source community - OSCON 2016
Managing a large open source community - OSCON 2016Managing a large open source community - OSCON 2016
Managing a large open source community - OSCON 2016
 
Strata San Jose 2016: Deep Learning is eating your lunch -- and mine
Strata San Jose 2016: Deep Learning is eating your lunch -- and mineStrata San Jose 2016: Deep Learning is eating your lunch -- and mine
Strata San Jose 2016: Deep Learning is eating your lunch -- and mine
 
Lean Product Management for Web 2.0 Products
Lean Product Management for Web 2.0 ProductsLean Product Management for Web 2.0 Products
Lean Product Management for Web 2.0 Products
 

Similar to Secure App Deployments in CI/CD with Ephemeral Keys and Audit Logs

How to Build a Basic Edge Cloud
How to Build a Basic Edge CloudHow to Build a Basic Edge Cloud
How to Build a Basic Edge CloudMirantis
 
Implementing a Security strategy in IoT, Practical example Automotive Grade L...
Implementing a Security strategy in IoT, Practical example Automotive Grade L...Implementing a Security strategy in IoT, Practical example Automotive Grade L...
Implementing a Security strategy in IoT, Practical example Automotive Grade L...LibreCon
 
From 0 to Secure in 1 Minute - Securing laaS - Nir Valtman
From 0 to Secure in 1 Minute - Securing laaS - Nir ValtmanFrom 0 to Secure in 1 Minute - Securing laaS - Nir Valtman
From 0 to Secure in 1 Minute - Securing laaS - Nir ValtmanEC-Council
 
Security Patterns for Microservice Architectures - ADTMag Microservices & API...
Security Patterns for Microservice Architectures - ADTMag Microservices & API...Security Patterns for Microservice Architectures - ADTMag Microservices & API...
Security Patterns for Microservice Architectures - ADTMag Microservices & API...Matt Raible
 
Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020Matt Raible
 
Security Patterns for Microservice Architectures
Security Patterns for Microservice ArchitecturesSecurity Patterns for Microservice Architectures
Security Patterns for Microservice ArchitecturesVMware Tanzu
 
DevSecCon Lightning 2021- Container defaults are a hackers best friend
DevSecCon Lightning 2021- Container defaults are a hackers best friendDevSecCon Lightning 2021- Container defaults are a hackers best friend
DevSecCon Lightning 2021- Container defaults are a hackers best friendEric Smalling
 
Security Patterns for Microservice Architectures - Oktane20
Security Patterns for Microservice Architectures - Oktane20Security Patterns for Microservice Architectures - Oktane20
Security Patterns for Microservice Architectures - Oktane20Matt Raible
 
Reversing & malware analysis training part 12 rootkit analysis
Reversing & malware analysis training part 12   rootkit analysisReversing & malware analysis training part 12   rootkit analysis
Reversing & malware analysis training part 12 rootkit analysisAbdulrahman Bassam
 
Security Patterns for Microservice Architectures - London Java Community 2020
Security Patterns for Microservice Architectures - London Java Community 2020Security Patterns for Microservice Architectures - London Java Community 2020
Security Patterns for Microservice Architectures - London Java Community 2020Matt Raible
 
Defcon23 from zero to secure in 1 minute - nir valtman and moshe ferber
Defcon23   from zero to secure in 1 minute - nir valtman and moshe ferberDefcon23   from zero to secure in 1 minute - nir valtman and moshe ferber
Defcon23 from zero to secure in 1 minute - nir valtman and moshe ferberMoshe Ferber
 
DEFCON 23 - Nir Valtman and Moshe Ferber - from zero to secure in 1
DEFCON 23 - Nir Valtman and  Moshe Ferber - from zero to secure in 1DEFCON 23 - Nir Valtman and  Moshe Ferber - from zero to secure in 1
DEFCON 23 - Nir Valtman and Moshe Ferber - from zero to secure in 1Felipe Prado
 
Security Best Practices for Your Ignition System
Security Best Practices for Your Ignition SystemSecurity Best Practices for Your Ignition System
Security Best Practices for Your Ignition SystemInductive Automation
 
Implementing zero trust in IBM Cloud Pak for Integration
Implementing zero trust in IBM Cloud Pak for IntegrationImplementing zero trust in IBM Cloud Pak for Integration
Implementing zero trust in IBM Cloud Pak for IntegrationKim Clark
 
Kubernetes fingerprinting with Prometheus.pdf
Kubernetes fingerprinting with Prometheus.pdfKubernetes fingerprinting with Prometheus.pdf
Kubernetes fingerprinting with Prometheus.pdfKawimbaLofgrens
 
Security Tips to run Docker in Production
Security Tips to run Docker in ProductionSecurity Tips to run Docker in Production
Security Tips to run Docker in ProductionGianluca Arbezzano
 
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...Priyanka Aash
 
Enforcing Immutability and Least Privilege to Secure Containerized Applicatio...
Enforcing Immutability and Least Privilege to Secure Containerized Applicatio...Enforcing Immutability and Least Privilege to Secure Containerized Applicatio...
Enforcing Immutability and Least Privilege to Secure Containerized Applicatio...DevOps.com
 
Control Plane: Security Rationale for Istio (DevSecOps - London Gathering, Ja...
Control Plane: Security Rationale for Istio (DevSecOps - London Gathering, Ja...Control Plane: Security Rationale for Istio (DevSecOps - London Gathering, Ja...
Control Plane: Security Rationale for Istio (DevSecOps - London Gathering, Ja...Michael Man
 
ICSEC2016-Policy management for docker ecosystem
ICSEC2016-Policy management for docker ecosystemICSEC2016-Policy management for docker ecosystem
ICSEC2016-Policy management for docker ecosystemBukhary Ikhwan Ismail
 

Similar to Secure App Deployments in CI/CD with Ephemeral Keys and Audit Logs (20)

How to Build a Basic Edge Cloud
How to Build a Basic Edge CloudHow to Build a Basic Edge Cloud
How to Build a Basic Edge Cloud
 
Implementing a Security strategy in IoT, Practical example Automotive Grade L...
Implementing a Security strategy in IoT, Practical example Automotive Grade L...Implementing a Security strategy in IoT, Practical example Automotive Grade L...
Implementing a Security strategy in IoT, Practical example Automotive Grade L...
 
From 0 to Secure in 1 Minute - Securing laaS - Nir Valtman
From 0 to Secure in 1 Minute - Securing laaS - Nir ValtmanFrom 0 to Secure in 1 Minute - Securing laaS - Nir Valtman
From 0 to Secure in 1 Minute - Securing laaS - Nir Valtman
 
Security Patterns for Microservice Architectures - ADTMag Microservices & API...
Security Patterns for Microservice Architectures - ADTMag Microservices & API...Security Patterns for Microservice Architectures - ADTMag Microservices & API...
Security Patterns for Microservice Architectures - ADTMag Microservices & API...
 
Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020
 
Security Patterns for Microservice Architectures
Security Patterns for Microservice ArchitecturesSecurity Patterns for Microservice Architectures
Security Patterns for Microservice Architectures
 
DevSecCon Lightning 2021- Container defaults are a hackers best friend
DevSecCon Lightning 2021- Container defaults are a hackers best friendDevSecCon Lightning 2021- Container defaults are a hackers best friend
DevSecCon Lightning 2021- Container defaults are a hackers best friend
 
Security Patterns for Microservice Architectures - Oktane20
Security Patterns for Microservice Architectures - Oktane20Security Patterns for Microservice Architectures - Oktane20
Security Patterns for Microservice Architectures - Oktane20
 
Reversing & malware analysis training part 12 rootkit analysis
Reversing & malware analysis training part 12   rootkit analysisReversing & malware analysis training part 12   rootkit analysis
Reversing & malware analysis training part 12 rootkit analysis
 
Security Patterns for Microservice Architectures - London Java Community 2020
Security Patterns for Microservice Architectures - London Java Community 2020Security Patterns for Microservice Architectures - London Java Community 2020
Security Patterns for Microservice Architectures - London Java Community 2020
 
Defcon23 from zero to secure in 1 minute - nir valtman and moshe ferber
Defcon23   from zero to secure in 1 minute - nir valtman and moshe ferberDefcon23   from zero to secure in 1 minute - nir valtman and moshe ferber
Defcon23 from zero to secure in 1 minute - nir valtman and moshe ferber
 
DEFCON 23 - Nir Valtman and Moshe Ferber - from zero to secure in 1
DEFCON 23 - Nir Valtman and  Moshe Ferber - from zero to secure in 1DEFCON 23 - Nir Valtman and  Moshe Ferber - from zero to secure in 1
DEFCON 23 - Nir Valtman and Moshe Ferber - from zero to secure in 1
 
Security Best Practices for Your Ignition System
Security Best Practices for Your Ignition SystemSecurity Best Practices for Your Ignition System
Security Best Practices for Your Ignition System
 
Implementing zero trust in IBM Cloud Pak for Integration
Implementing zero trust in IBM Cloud Pak for IntegrationImplementing zero trust in IBM Cloud Pak for Integration
Implementing zero trust in IBM Cloud Pak for Integration
 
Kubernetes fingerprinting with Prometheus.pdf
Kubernetes fingerprinting with Prometheus.pdfKubernetes fingerprinting with Prometheus.pdf
Kubernetes fingerprinting with Prometheus.pdf
 
Security Tips to run Docker in Production
Security Tips to run Docker in ProductionSecurity Tips to run Docker in Production
Security Tips to run Docker in Production
 
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
 
Enforcing Immutability and Least Privilege to Secure Containerized Applicatio...
Enforcing Immutability and Least Privilege to Secure Containerized Applicatio...Enforcing Immutability and Least Privilege to Secure Containerized Applicatio...
Enforcing Immutability and Least Privilege to Secure Containerized Applicatio...
 
Control Plane: Security Rationale for Istio (DevSecOps - London Gathering, Ja...
Control Plane: Security Rationale for Istio (DevSecOps - London Gathering, Ja...Control Plane: Security Rationale for Istio (DevSecOps - London Gathering, Ja...
Control Plane: Security Rationale for Istio (DevSecOps - London Gathering, Ja...
 
ICSEC2016-Policy management for docker ecosystem
ICSEC2016-Policy management for docker ecosystemICSEC2016-Policy management for docker ecosystem
ICSEC2016-Policy management for docker ecosystem
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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?
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 

Secure App Deployments in CI/CD with Ephemeral Keys and Audit Logs

Editor's Notes

  1. Securing application deployments in multi-tenant/shared CI/CD environments. Need to make sure the integrity of the application deployed through a multi-tenant CI/CD platforms. The focus is to reduce the large attack surface area with a shared CI/CD platform and
  2. Here is the overview of what we are covering in today’s talk. We start with a brief introduction to CI/CD systems, and the trends we are experiencing in past few years. Define high level security objectives of this effort. Next, we discuss the threat modeling in detail, talks about actors, trust boundaries, attack surface, and enumerate major threats The last section shares security pattern that matters to a multi-tenant CI/CD platform.
  3. This is a one minute introduction about CI/CD platform. CI/CD is a software engineering practice that consists of three steps or levels. Each level adds incremental maturity to the overall software development process. The first step - CI, is all about making incremental changes to the code, merge, build and unit test several times a day. CI helps development teams to identify and fix integration errors early in the development life cycle with minimum effort. Continuous Delivery is the extension to CI. It establishes a repeatable process to build, test and release deployable artifacts, typically to package repositories such as npm, artifactory, docker image repos etc. Continuous Deployment - The step after Continuous Delivery automates the deployment of applications to production. Many organizations deploy their applications multiple times a day. Some even deploy thousands of times a day.
  4. From a security perspective, I would like to classify deployments into two. Single tenant Multi-tenant The differentiation is important because these changes have a big impact on security. Our session is focused on the security of multi-tenant platform.
  5. Single-tenant build systems have been there for more than a decade. In this model, each team owns a dedicated set of build machines to build their applications. As part of the execution, build job requires access to protected services like source & package repositories. The common practice is to embed keys into these systems. This is not a big threat because (1) these systems are distributed and dedicated to each team, The access is restricted to team members. (2) The impact of a compromise expose only a limited set of hosts.
  6. In last few years, the industry is experiencing a major shift/trend towards multi-tenant shared build environments. One of the factors behind the consolidation is the economies of scale. A shared platform enables resource pooling of development and support resources, hardware. It also allow enterprise to centrally enforce development standards, security and compliance controls. With centralization, we create a build corridor that acts as a gateway to production networks. The earlier mode of embedding access keys inside build system is not safe because of its shared nature. Consolidation of keys makes the platform an attractive target for attackers. This model also make some security controls obsolete. For example - an IP whitelist protected endpoint. Imagine your build job needs to access an IP whitelist-protected endpoint. By whitelisting a build slave IP, it allows other build jobs running on the same host to access protected resource. This was not an issue with dedicated build environments.
  7. Here is a simple view of a modern CI/CD platform. Typically a workflow starts with a code commit from a developer. A code commit or a PR merge triggers a component build job. The job will get executed on a build slave, and creates a deployable artifact. A subsequent build triggered by component build notify the deployer. The deployer pulls artifacts and deploys the applications to production.
  8. The previous slide provides a simplified view of a multi-tenant CI/CD platform. However in practice these systems are fairly complex with multiple inter-dependent sub-systems. We logically grouped these systems into five. Build platform Source and deployable artifacts store Identity and auth services Platform and application services - saucelabs, your deployed applications etc. Deployment environment, consists of deployer and product hosts. The deployer takes request from a build job and deploy requested application to production machines. Let’s explain with a simple flow. The developer commits the code that triggers a build. In Yahoo’s case, we have a workflow engine, built on top of Jenkins and is designed to build, test and deploy software at scale. The workflow engine schedules and tracks build jobs. The build job will be executed inside a Docker container. As part of build execution, build jobs require credentials and keys to access protected services (package repos, database access, Saucelabs etc), and SSH access. The component job will build and publish the application, while subsequent job deploys the application in different environments (QA, stage, beta, prod etc.)
  9. We briefly touched up on security risks associated with operating such system at scale in an enterprise. This section talks about security properties or requirements for a shared build platform.
  10. The system should allow a legitimate product engineer/team to safely build and deploy applications to production. To differentiate legitimate and illegitimate, we need to have controls to prevent unauthorized use of CI/CD as a platform to modify applications and/or reach target production hosts. Image: https://www.dreamstime.com/royalty-free-stock-photography-sketch-piping-design-mixed-industrial-equipment-photos-photo-image32609927
  11. Modern CI/CD platform spans across multiple trust boundaries, operated by different organizations. How do we trust the application deployed through CI/CD platform?. For that we need a way to establish verifiable chain of trust from commit to deploy. This helps with monitoring and detect unauthorized activities within the platform. === Image source: https://www.dreamstime.com/stock-photo-generations-four-women-aging-young-to-old-image50612988#res16633042"
  12. Just because you run build job on a shared platform, the job should not have elevated privileges, and not cross the streams. For instance, The build jobs should not break out of their trust boundary and gain elevated privileges. Image source: http://www.istockphoto.com/photo/vip-pass-exclusive-access-gm523819320-92053949?st=_p_vippass
  13. This section talks actors, trust boundaries, attack surface, and enumerate major threats we identified as part of the exercise.
  14. We identified three types of actors related to this platform. Developers are the users who own repos and do frequent code commits. These are the ones who make use of the platform to build and deploy their application. Platform developers will have limited access to some or all components of the platform. Admins, who support the platform have exclusive access to all systems and applications. Icons: https://www.iconfinder.com/icons/532716/api_coding_configuration_development_html_programming_window_icon#size=128
  15. Trust boundaries https://www.flickr.com/photos/nasamarshall/14596371842 Trust boundary is distinct boundary within which a system trusts all sub-systems (including data). It enables implicit trust between its sub-systems.
  16. The build web interface is the application trust boundary of a CI/CD platform. It includes both UI and REST APIs. Data crossed the trust boundary through Jenkins master is trusted by slave. The slave also entrust the master to do authentication.
  17. The build jobs are executed inside a container on slave machines. The containers act as a trust boundary between host OS and build job.
  18. Network segmentation provides network level isolation between CI/CD platform and other machines. Co-locating CI/CD machines with less trusted machines increase security risks, because of the some implicit trust between systems within the same network trust boundary. Segmentation using network or host based firewalls.
  19. Discuss the entry and exit points of the CI/CD system. An application entry point also serves as entry point for attackers. The exit point is also important, because it may leak sensitive information outside. Image: http://www.mazegenerator.net/
  20. Entry points are interfaces to the platform. Web interface is used to create a build project, start builds and view build status and console logs. Platform also operates commit and build notification handlers to track commits and build status respectively External source and package repos is another way to get into the system. Build often pull packages directly from public repositories. (Internet).
  21. Internal endpoints that are exposed by sub-components (eg master, slave endpoints, etc. This is important because the attacker may manage to bypass the external entry points and directly attack internal endpoints. NOTE: The protection mechanism used by internal endpoints are often influenced by trust boundaries. A false assumption on trust boundary expose internal endpoints to various attacks.
  22. Exit points are important, because it may leak confidential information to outside. Think it as the trash bin that kept outside of your house. There are 2 cases here (1) unintentional exposure of sensitive data to console logs and build notifications (2) manipulation of data or packages, exploiting vulnerabilities that exist elsewhere that leaks sensitive data. For example - a PR request build. Anyone can submit a PR. If the attacker modifies the code to print credential or a key material to build console, he can can easily steal it from the build’s console log, which is publicly/readable by all in most cases.
  23. As part of the threat modeling exercise, we already discussed about actors, trust boundaries and attack surface of CI/CD platform. This section talks about major threats.
  24. When we talk about user account compromise, we have multiple user roles associated with this role. With a developer account compromise; attacker may use stolen credentials to: Modify source code in Git Build and push malicious code to production A CI/CD platform developer account compromise - attacker may gain access to few of the CI/CD machines. In most cases, that should be sufficient for an attacker to reach production machines. An admin account compromise would be the most dangerous one. This will give complete access to all CI/CD machines, and can gain access to production systems. Network Intrusion: A network intruder gain access to CI/CD components due to an application vulnerability (eg RCE, web vulnerabilities, lack of authentication or authorization) or lack of network segmentation etc. Denial of service issues - Abuse that affects other builds and deployments ====
  25. The build slaves constitute more than 90% of the CI/CD platform that spread across multiple clusters, often on multiple networks. The build jobs run inside a container or a VM on a build slave. How to compromise? A build job that is running inside a container can break out of the container A network level compromise, by exploiting a vulnerability on a build slave or through unprotected internal endpoints. Impact: To reach target production hosts Spoof other jobs, access sensitive materials etc.
  26. Locally storing long-lived keys. These keys are required to access protected services behalf of the build jobs. We have seen two patterns here. Use of shared key. In this model, the build use the same key for all jobs to push their artifacts to artifact repository. Use of job specific keys: In this model, build jobs do not share keys. An example is OAuth tokens commonly used with hosted CI platform. The per-job key makes harder to spoof the identity of other jobs, However, the impact of a security compromise is same for both shared key and job specific keys.
  27. SSH is one of the widely used mechanism to access a remote system. For automated deployments, we use SSH with a headless user and often it requires sudo access to deploy applications. By using unrestricted shells like bash shells, we are allowing the headless user to run arbitrary commands as root. This is a clear violation of principles of least privilege.
  28. Open source/untrusted packages and code is pulled into the build system at build time, and executed. This can be explicit via opensource.git, or implicit via, e.g., npm module installation / activation scripts.
  29. To make CI/CD platform secure, where do we start? We expect to have the baseline security control enabled for all systems in 2016, not just CI/CD platform. Let’s review those controls.
  30. Jenkins endpoints
  31. This last section discuss about security patterns that can significantly reduce the security risk with operating a multi-tenant CI/CD platform.
  32. Ephemeral keys are the future. There are few factors driving behind this: (1) Detecting a key compromise is hard, and there is a good chance that a key compromise may go undetected for long period of time. (2) The second issue is with key revocation. Key revocation is an equally hard problem, especially with environments that span multiple trust boundaries. (3) As we move more towards cloud/multi-tenant based solutions, delegation has become a necessity. For fully automated deployments, you delegate CI/CD platform to build, release and deploy your application behalf of you. To delegate a job, the recommended practice is to use scoped ephemeral tokens instead of using a long-lived keys or credentials. Amazon short lived tokens, JWT, SSH-CA, short lived certificates are all in the right direction
  33. Stateless auth architecture. Modern CI/CD environment spread across multiple trust boundaries and operated by different organizations. So the question is: How a job’s identity and capabilities are delegated/ propagated through this pipeline? Let’s examine this in next few slides.
  34. Every build is triggered by some events. We can relate an event to a commit trigger, in response to a code commit, a manual build trigger from build UI, an event generated from an automated cron job or even a event from upstream job to start a downstream job. Here is the abstract representation of a pipeline. In this diagram we can see each component stores creds to access downstream component. As we can see, it puts equal trust on all components. Now we have to deal with a large attack surface area, which is a big security risk. The job perm and capabilities are delegated through the 1:1 trust relationship that exists between components, and is transitive in nature.
  35. In current model, we need to equally trust each component in the pipeline, which is risky from a security perspective. Your build system is not designed to be a security system. One remediation we propose is to reduce Trusted Computing Base (TCB) footprint to few security augmented dedicated hosts. The second diagram shows the desired state. In this model, we have a new dedicated trust anchor that authenticates events, and create a cryptographically signed job token. The job token is ephemeral and is delegated to the downstream services. This token may get mutated, but ultimately should be able to track it back to the original build event. A downstream service honor only the requests with a valid job delegation token. This forms the chain of trust from commit to deploy. You can think about this model, very similar to the cookie based stateless authentication. You servers get session cookie only when a user initiates a request. This server may pass the cookies to downstream services (eg backend servers), and once you serve the request, you discard the cookie. This is a significant change from the existing model. This will disrupt existing practices, but I expect providers to start thinking on these lines.
  36. Immutable, append-only audit trails help us to monitor build events and its correlations. However the challenge is - how to consolidate and correlate audit trails from sources operated by different parties. It would be great if we can have a way to track events and its subsequent actions in one central place. A state machine built around the auth system would be helpful to track build events, and its states from commit to deploy. == Audit trails produced by auth component is especially useful because it keeps track of all build events.
  37. Hardening toolchain and build containers. [1] Hardening the build containers strengthen the trust boundary that isolates untrusted build jobs from build control plane. For example, docker build container should not run in privileged mode, and run it with minimum capabilities. [2] Toolchain - is the use of secure default configurations that integrate with available platform security to build packages. Example: building openssl package for your application, disabling insecure features - SSLv2, SSLv3, compression etc. A secure toolchain is not a silver bullet. It is one piece of an overall strategy in the engineering process to help ensure success. [3] Another aspect is the signing of packages. But the question is who keep the signing key and what is the assertion? Buld job, build platform or both? Ref: https://github.com/GDSSecurity/Docker-Secure-Deployment-Guidelines
  38. Couple of reasons to zone CI/CD platform from other systems. From a hosted platform perspective, it is running an untrusted code. But that should not allow a rogue or a compromised job to use build salve as a jump host to reach internal networks. Sharing the network with less trusted systems increase the risk of a network attack against CI/CD platform. It also help limit the access to an insider, partner or a third party. The platform may employ either network or host based firewalls.
  39. We all have complex build pipelines, but we need to limit what we pull/expose into our build jobs. If you are running integration tests or complex functional tests that require direct access to production services, it may expose production data or other sensitive materials to build platform. The recommendation is to use build job as a trigger to initiate complex tests outside build environment on a separate environment that you control, and track the test status.
  40. So far we covered the main points, however in practice, we still need to do more to protect our platform. We have few more, mostly OpSec related which are equally important. We widely use SSH, but 99% percent of the time we use unrestricted shells. The use of unrestricted shells with sudo privileges is very dangerous because an unrestricted shell like bash allows the headless user to execute arbitrary commands on connected hosts. The recommendation is to use a shell that allow only whitelisted commands to execute. One example chef deploy. To deploy your application using chef, one common pattern is to SSH to application hosts and run chef-client that converge the host with chef server. Just to run a chef-client on a target host, why do we need an unrestricted shell? Trust anchor keys should be rolled periodically. Though we focus on using ephemeral keys, we still need to use long-lived keys in few places, and we need to roll the keys periodically. The job console job, for example what we see in jenkins, may contain sensitive info depending. Keeping it public may leak this info. Enable 2FA. The admins must follow good security hygiene and use 2FA to access production hosts. Prune admin lists Patch management is also an important part in recovering from an public disclosure.
  41. I would take this opportunity to acknowledge and appreciate their contributions and support
  42. The summary of recommendations.
  43. I would the this opportunity to acknowledge their appreciate their contributions and support
  44. Supply chain is one of the main risk components Business risk Over 30% of Official Images in Docker Hub Contain High Priority Security Vulnerabilities https://banyanops.com/blog/analyzing-docker-hub/ Tech debt and security http://devops.com/2015/05/01/security-devops-and-the-shift-to-a-software-supply-chain/