SlideShare a Scribd company logo
1 of 26
Securing the Continuous
Integration
Irene Michlin
People, process, and technology
Step 1: make sure your CI does not harm your security
Step 2: only then it can be used to improve your security
People
ProcessTechnology
Image from https://www.blazemeter.com/blog/ultimate-devops-tools-ecosystem-tutorial-part-1
Basic CI cycle
Developer Development machine Version Control repo CI Server
Write code +
tests
Pull latest code + tests
Local
build +
test run
Commit
Poll
Generate feedback
Feedback
Dashboard or gadget
“Continuous Integration assumes a high degree of tests
which are automated into the software”, Martin Fowler
Isolate your environment
• Phishing link in email => keylogger installed => source code gone (or backdoor
deployed)
• Experimenting with development network => accounting department affected before
EOY
• Extra challenges: remote work or BYOD
Basic CI cycle
Developer Development machine Version Control repo CI Server
Write code +
tests
Pull latest code + tests
Local
build +
test run
Commit
Poll
Generate feedback
Feedback
Dashboard or gadget
Version control server
• It has one job only – remove or disable everything else
• No shared or generic accounts
• Matching business process to close accounts
Basic CI cycle
Developer Development machine Version Control repo CI Server
Write code +
tests
Pull latest code + tests
Local
build +
test run
Commit
Poll
Generate feedback
Feedback
Dashboard or gadget
Integration build server
• Who is responsible for keeping it up to date?
• Where do external components come from?
• Check vendor advice on compiler and linker options
On September 18, 2014, RiskIQ
detected credential-stealing malware
being loaded onto users’ computers
through a drive-by download at
jQuery.com.
Not too long ago, news
broke about a malicious
version of Xcode dubbed
XcodeGhost that had been
surreptitiously injecting
malicious code into iOS
developers’ apps.
SK-CSIRT identified malicious software libraries in the
official Python package
repository, PyPI, posing as well known libraries. A
prominent example is a fake
package urllib-1.21.1.tar.gz, based upon a well known
package
urllib3-1.21.1.tar.gz.
Basic CI cycle
Developer Development machine Version Control repo CI Server
Write code +
tests
Pull latest code + tests
Local
build +
test run
Commit
Poll
Generate feedback
Feedback
Dashboard or gadget
Feedback mechanism
• IoT electronic toys are notoriously insecure
• Custom integration scripts - are you cutting corners?
Do no harm
• Do not acquire CI components « by accident »
• Not everything is secure out of the box
• Dormant account today is an attacker-controlled account tomorrow
- Compromising a staging continuous integration server (Jenkins) from a developer's
machine, which then gave us access to the company's production Chef repository,
allowing us to push a reverse shell to a production server.
- Using access to a dev/staging Jenkins server to modify code in repositories after they've
been through code review, which were then replicated to production.
https://www.blackhat.com/us-17/briefings.html#developing-trust-and-gitting-betrayed
Treat people right
• Don’t leave new starters to figure out CI rules on their own
• Controls are safety net, not surveillance
• Anyone on security team?
• Help devs to automate “boring” things
• Learn to say “yes”
• Security goals must support business goals
• Anyone in management?
• Don’t abuse metrics
Stop blaming developers
• Technology
• People
• Process
Code reviews
• No change too small
• Leave trivial checks to tools
• Not a separate task, but in DoD for each task
• Reject & rework is part of “normal”
Root-cause analysis
• What happens to externally reported issues?
• The first security feedback to introduce
• What was missing in our CI process? => Improve
Chain of custody
• Can you trust your release notes?
• Has every “unit of work” in the release gone through all the checks?
• Was it modified since “time of check”?
Reference implementations
• Give dev teams libraries / tools that are secure by default
• Leverage frameworks (e.g. output encoding)
• Build your own
• Potential areas to consider:
• Managing secrets
• Anything related to crypto
• Authentication / authorization
• SQL, file system access, shell exec()
Core takeaway:
• “<X> is hard to do securely, have to be aware of threats 1, 2, and …”
• Build a secure by default implementation
• Automate the tests
Static analysis
If you didn’t laugh at the previous one…
• Static analysis – reason about code based on looking at it
• Dynamic analysis – run code and observe how it behaves
• Fundamental trade-offs:
• Static analysis – high coverage, imprecise (false positives)
• Dynamic analysis – code coverage is a challenge, but precise (the issues it finds are true
positives)
Pick your poison
Grep
• Localized
• Not syntax-aware
• Regex
Lint/AST
• Syntax aware
• Some semantics
• Can express rules that use
code constructs
SAST
• Builds detailed model of
code
• Complex rules that rely
on control and/or data
flow
Static analysis
• Run on dev machine needs to be fast, low to no false positives
• Ideally – integrated with IDE
• Run in CI needs to provide fast feedback
• Can be implemented with git hooks or as a part of the test suite
• Integration with version control is useful
• Integration with bug tracker is useful (but…)
• Ability to enable analysis by defect type is very useful
“On commit” is your best friend
• Automated coding standards checks
• Code complexity / code duplication
• Banned functions / APIs
• Dynamic analysis
• Static analysis
• Fuzzing
• https://www.nccgroup.trust/uk/our-research/securing-the-continuous-integration-process/
• https://www.nccgroup.trust/uk/our-research/best-practices-for-the-use-of-static-code-analysis-
within-a-real-world-secure-development-lifecycle/
Points of contact
Irene Michlin
Principal Security Consultant
M: +44 (0) 7972 333 148
E: irene.michlin@nccgroup.trust
T: @IreneMichlin
Thanks and credit to Clint Gibler - @clintgibler and Antti Vähä-Sipilä - @@anttivs
https://www.nccgroup.trust/uk/our-research/securing-the-continuous-integration-
process/
https://www.nccgroup.trust/uk/our-research/best-practices-for-the-use-of-static-code-
analysis-within-a-real-world-secure-development-lifecycle/

More Related Content

What's hot

Vulnerabilities are bugs, Let's Test For Them!
Vulnerabilities are bugs, Let's Test For Them!Vulnerabilities are bugs, Let's Test For Them!
Vulnerabilities are bugs, Let's Test For Them!VAddy
 
Is Your Mobile App Secure?
Is Your Mobile App Secure?Is Your Mobile App Secure?
Is Your Mobile App Secure?Sam Bowne
 
Customer Case Study: ScienceLogic - Many Paths to Compliance
Customer Case Study: ScienceLogic - Many Paths to ComplianceCustomer Case Study: ScienceLogic - Many Paths to Compliance
Customer Case Study: ScienceLogic - Many Paths to ComplianceBlack Duck by Synopsys
 
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja WarriorsRyan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja WarriorsRyan Elkins
 
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Denim Group
 
Quickstart for continuous integration
Quickstart for continuous integrationQuickstart for continuous integration
Quickstart for continuous integrationFabricio Epaminondas
 
Myths and Misperceptions of Open Source Security
Myths and Misperceptions of Open Source Security Myths and Misperceptions of Open Source Security
Myths and Misperceptions of Open Source Security Black Duck by Synopsys
 
Making the Transition from Suite to the Hub
Making the Transition from Suite to the HubMaking the Transition from Suite to the Hub
Making the Transition from Suite to the HubBlack Duck by Synopsys
 
BlueHat v18 || Improving security posture through increased agility with meas...
BlueHat v18 || Improving security posture through increased agility with meas...BlueHat v18 || Improving security posture through increased agility with meas...
BlueHat v18 || Improving security posture through increased agility with meas...BlueHat Security Conference
 
Just Enough Threat Modeling
Just Enough Threat ModelingJust Enough Threat Modeling
Just Enough Threat ModelingStephen de Vries
 
Java Card Security
Java Card SecurityJava Card Security
Java Card SecurityRiscure
 
Application Security within Agile
Application Security within AgileApplication Security within Agile
Application Security within AgileNetlight Consulting
 
Building a Modern Security Engineering Organization
Building a Modern Security Engineering OrganizationBuilding a Modern Security Engineering Organization
Building a Modern Security Engineering OrganizationZane Lackey
 
DevOps Security Coffee - Lazy hackers who think out of the box, but stay in t...
DevOps Security Coffee - Lazy hackers who think out of the box, but stay in t...DevOps Security Coffee - Lazy hackers who think out of the box, but stay in t...
DevOps Security Coffee - Lazy hackers who think out of the box, but stay in t...Freek Kauffmann
 
The Continuous delivery value - Funaro
The Continuous delivery value - FunaroThe Continuous delivery value - Funaro
The Continuous delivery value - FunaroCodemotion
 
Ibm עמרי וייסמן
Ibm  עמרי וייסמןIbm  עמרי וייסמן
Ibm עמרי וייסמןlihig
 
Building Security Controls around Attack Models
Building Security Controls around Attack ModelsBuilding Security Controls around Attack Models
Building Security Controls around Attack ModelsSeniorStoryteller
 

What's hot (19)

Vulnerabilities are bugs, Let's Test For Them!
Vulnerabilities are bugs, Let's Test For Them!Vulnerabilities are bugs, Let's Test For Them!
Vulnerabilities are bugs, Let's Test For Them!
 
Is Your Mobile App Secure?
Is Your Mobile App Secure?Is Your Mobile App Secure?
Is Your Mobile App Secure?
 
Customer Case Study: ScienceLogic - Many Paths to Compliance
Customer Case Study: ScienceLogic - Many Paths to ComplianceCustomer Case Study: ScienceLogic - Many Paths to Compliance
Customer Case Study: ScienceLogic - Many Paths to Compliance
 
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja WarriorsRyan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
 
Agile and Secure SDLC
Agile and Secure SDLCAgile and Secure SDLC
Agile and Secure SDLC
 
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
 
Quickstart for continuous integration
Quickstart for continuous integrationQuickstart for continuous integration
Quickstart for continuous integration
 
Myths and Misperceptions of Open Source Security
Myths and Misperceptions of Open Source Security Myths and Misperceptions of Open Source Security
Myths and Misperceptions of Open Source Security
 
Making the Transition from Suite to the Hub
Making the Transition from Suite to the HubMaking the Transition from Suite to the Hub
Making the Transition from Suite to the Hub
 
BlueHat v18 || Improving security posture through increased agility with meas...
BlueHat v18 || Improving security posture through increased agility with meas...BlueHat v18 || Improving security posture through increased agility with meas...
BlueHat v18 || Improving security posture through increased agility with meas...
 
Just Enough Threat Modeling
Just Enough Threat ModelingJust Enough Threat Modeling
Just Enough Threat Modeling
 
Java Card Security
Java Card SecurityJava Card Security
Java Card Security
 
Application Security within Agile
Application Security within AgileApplication Security within Agile
Application Security within Agile
 
Building a Modern Security Engineering Organization
Building a Modern Security Engineering OrganizationBuilding a Modern Security Engineering Organization
Building a Modern Security Engineering Organization
 
DevOps Security Coffee - Lazy hackers who think out of the box, but stay in t...
DevOps Security Coffee - Lazy hackers who think out of the box, but stay in t...DevOps Security Coffee - Lazy hackers who think out of the box, but stay in t...
DevOps Security Coffee - Lazy hackers who think out of the box, but stay in t...
 
The Continuous delivery value - Funaro
The Continuous delivery value - FunaroThe Continuous delivery value - Funaro
The Continuous delivery value - Funaro
 
Ibm עמרי וייסמן
Ibm  עמרי וייסמןIbm  עמרי וייסמן
Ibm עמרי וייסמן
 
Effective DevSecOps
Effective DevSecOpsEffective DevSecOps
Effective DevSecOps
 
Building Security Controls around Attack Models
Building Security Controls around Attack ModelsBuilding Security Controls around Attack Models
Building Security Controls around Attack Models
 

Similar to Securing the continuous integration

DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012Nick Galbreath
 
Webinar: "DBMaestro: Database Enforced Change Management (DECM) tool"
Webinar: "DBMaestro: Database Enforced Change Management (DECM) tool"Webinar: "DBMaestro: Database Enforced Change Management (DECM) tool"
Webinar: "DBMaestro: Database Enforced Change Management (DECM) tool"Emerasoft, solutions to collaborate
 
DevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to SecurityDevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to SecurityAlert Logic
 
DBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
DBmaestro's State of the Database Continuous Delivery Survey- Findings RevealedDBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
DBmaestro's State of the Database Continuous Delivery Survey- Findings RevealedDBmaestro - Database DevOps
 
ProdSec: A Technical Approach
ProdSec: A Technical ApproachProdSec: A Technical Approach
ProdSec: A Technical ApproachJeremy Brown
 
Alexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implementAlexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implementDefconRussia
 
Owasp tds
Owasp tdsOwasp tds
Owasp tdssnyff
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Securitysedukull
 
Sailing through devlopment with legacy code
Sailing through devlopment with legacy codeSailing through devlopment with legacy code
Sailing through devlopment with legacy codeprasadkunte
 
Security at Greenhouse
Security at GreenhouseSecurity at Greenhouse
Security at GreenhouseMichael O'Neil
 
Controlling Access to IBM i Systems and Data
Controlling Access to IBM i Systems and DataControlling Access to IBM i Systems and Data
Controlling Access to IBM i Systems and DataPrecisely
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013David Funaro
 
The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014David Funaro
 
4 florin coada - dast automation, more value for less work
4   florin coada - dast automation, more value for less work4   florin coada - dast automation, more value for less work
4 florin coada - dast automation, more value for less workIevgenii Katsan
 
Jason Kent - AppSec Without Additional Tools
Jason Kent - AppSec Without Additional ToolsJason Kent - AppSec Without Additional Tools
Jason Kent - AppSec Without Additional Toolscentralohioissa
 
Expand Your Control of Access to IBM i Systems and Data
Expand Your Control of Access to IBM i Systems and DataExpand Your Control of Access to IBM i Systems and Data
Expand Your Control of Access to IBM i Systems and DataPrecisely
 
Continuous Integration (& Mr Jenkins)
Continuous Integration (& Mr Jenkins)Continuous Integration (& Mr Jenkins)
Continuous Integration (& Mr Jenkins)Ciro Donato Caiazzo
 
Application security meetup k8_s security with zero trust_29072021
Application security meetup k8_s security with zero trust_29072021Application security meetup k8_s security with zero trust_29072021
Application security meetup k8_s security with zero trust_29072021lior mazor
 

Similar to Securing the continuous integration (20)

DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
 
Webinar: "DBMaestro: Database Enforced Change Management (DECM) tool"
Webinar: "DBMaestro: Database Enforced Change Management (DECM) tool"Webinar: "DBMaestro: Database Enforced Change Management (DECM) tool"
Webinar: "DBMaestro: Database Enforced Change Management (DECM) tool"
 
DevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to SecurityDevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to Security
 
In (database) automation we trust
In (database) automation we trustIn (database) automation we trust
In (database) automation we trust
 
DBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
DBmaestro's State of the Database Continuous Delivery Survey- Findings RevealedDBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
DBmaestro's State of the Database Continuous Delivery Survey- Findings Revealed
 
ProdSec: A Technical Approach
ProdSec: A Technical ApproachProdSec: A Technical Approach
ProdSec: A Technical Approach
 
Alexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implementAlexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implement
 
Owasp tds
Owasp tdsOwasp tds
Owasp tds
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
Sailing through devlopment with legacy code
Sailing through devlopment with legacy codeSailing through devlopment with legacy code
Sailing through devlopment with legacy code
 
Security at Greenhouse
Security at GreenhouseSecurity at Greenhouse
Security at Greenhouse
 
Controlling Access to IBM i Systems and Data
Controlling Access to IBM i Systems and DataControlling Access to IBM i Systems and Data
Controlling Access to IBM i Systems and Data
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013
 
The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014
 
4 florin coada - dast automation, more value for less work
4   florin coada - dast automation, more value for less work4   florin coada - dast automation, more value for less work
4 florin coada - dast automation, more value for less work
 
Jason Kent - AppSec Without Additional Tools
Jason Kent - AppSec Without Additional ToolsJason Kent - AppSec Without Additional Tools
Jason Kent - AppSec Without Additional Tools
 
Expand Your Control of Access to IBM i Systems and Data
Expand Your Control of Access to IBM i Systems and DataExpand Your Control of Access to IBM i Systems and Data
Expand Your Control of Access to IBM i Systems and Data
 
Continuous Integration (& Mr Jenkins)
Continuous Integration (& Mr Jenkins)Continuous Integration (& Mr Jenkins)
Continuous Integration (& Mr Jenkins)
 
Application security meetup k8_s security with zero trust_29072021
Application security meetup k8_s security with zero trust_29072021Application security meetup k8_s security with zero trust_29072021
Application security meetup k8_s security with zero trust_29072021
 
Webinar: "In database automation we trust"
Webinar: "In database automation we trust"Webinar: "In database automation we trust"
Webinar: "In database automation we trust"
 

Recently uploaded

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 

Recently uploaded (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 

Securing the continuous integration

  • 2. People, process, and technology Step 1: make sure your CI does not harm your security Step 2: only then it can be used to improve your security People ProcessTechnology
  • 4. Basic CI cycle Developer Development machine Version Control repo CI Server Write code + tests Pull latest code + tests Local build + test run Commit Poll Generate feedback Feedback Dashboard or gadget “Continuous Integration assumes a high degree of tests which are automated into the software”, Martin Fowler
  • 5. Isolate your environment • Phishing link in email => keylogger installed => source code gone (or backdoor deployed) • Experimenting with development network => accounting department affected before EOY • Extra challenges: remote work or BYOD
  • 6. Basic CI cycle Developer Development machine Version Control repo CI Server Write code + tests Pull latest code + tests Local build + test run Commit Poll Generate feedback Feedback Dashboard or gadget
  • 7. Version control server • It has one job only – remove or disable everything else • No shared or generic accounts • Matching business process to close accounts
  • 8. Basic CI cycle Developer Development machine Version Control repo CI Server Write code + tests Pull latest code + tests Local build + test run Commit Poll Generate feedback Feedback Dashboard or gadget
  • 9. Integration build server • Who is responsible for keeping it up to date? • Where do external components come from? • Check vendor advice on compiler and linker options On September 18, 2014, RiskIQ detected credential-stealing malware being loaded onto users’ computers through a drive-by download at jQuery.com. Not too long ago, news broke about a malicious version of Xcode dubbed XcodeGhost that had been surreptitiously injecting malicious code into iOS developers’ apps. SK-CSIRT identified malicious software libraries in the official Python package repository, PyPI, posing as well known libraries. A prominent example is a fake package urllib-1.21.1.tar.gz, based upon a well known package urllib3-1.21.1.tar.gz.
  • 10. Basic CI cycle Developer Development machine Version Control repo CI Server Write code + tests Pull latest code + tests Local build + test run Commit Poll Generate feedback Feedback Dashboard or gadget
  • 11. Feedback mechanism • IoT electronic toys are notoriously insecure • Custom integration scripts - are you cutting corners?
  • 12. Do no harm • Do not acquire CI components « by accident » • Not everything is secure out of the box • Dormant account today is an attacker-controlled account tomorrow - Compromising a staging continuous integration server (Jenkins) from a developer's machine, which then gave us access to the company's production Chef repository, allowing us to push a reverse shell to a production server. - Using access to a dev/staging Jenkins server to modify code in repositories after they've been through code review, which were then replicated to production. https://www.blackhat.com/us-17/briefings.html#developing-trust-and-gitting-betrayed
  • 13. Treat people right • Don’t leave new starters to figure out CI rules on their own • Controls are safety net, not surveillance • Anyone on security team? • Help devs to automate “boring” things • Learn to say “yes” • Security goals must support business goals • Anyone in management? • Don’t abuse metrics
  • 14. Stop blaming developers • Technology • People • Process
  • 15.
  • 16. Code reviews • No change too small • Leave trivial checks to tools • Not a separate task, but in DoD for each task • Reject & rework is part of “normal”
  • 17. Root-cause analysis • What happens to externally reported issues? • The first security feedback to introduce • What was missing in our CI process? => Improve
  • 18. Chain of custody • Can you trust your release notes? • Has every “unit of work” in the release gone through all the checks? • Was it modified since “time of check”?
  • 19. Reference implementations • Give dev teams libraries / tools that are secure by default • Leverage frameworks (e.g. output encoding) • Build your own • Potential areas to consider: • Managing secrets • Anything related to crypto • Authentication / authorization • SQL, file system access, shell exec() Core takeaway: • “<X> is hard to do securely, have to be aware of threats 1, 2, and …” • Build a secure by default implementation • Automate the tests
  • 21. If you didn’t laugh at the previous one… • Static analysis – reason about code based on looking at it • Dynamic analysis – run code and observe how it behaves • Fundamental trade-offs: • Static analysis – high coverage, imprecise (false positives) • Dynamic analysis – code coverage is a challenge, but precise (the issues it finds are true positives)
  • 22. Pick your poison Grep • Localized • Not syntax-aware • Regex Lint/AST • Syntax aware • Some semantics • Can express rules that use code constructs SAST • Builds detailed model of code • Complex rules that rely on control and/or data flow
  • 23. Static analysis • Run on dev machine needs to be fast, low to no false positives • Ideally – integrated with IDE • Run in CI needs to provide fast feedback • Can be implemented with git hooks or as a part of the test suite • Integration with version control is useful • Integration with bug tracker is useful (but…) • Ability to enable analysis by defect type is very useful
  • 24.
  • 25. “On commit” is your best friend • Automated coding standards checks • Code complexity / code duplication • Banned functions / APIs • Dynamic analysis • Static analysis • Fuzzing • https://www.nccgroup.trust/uk/our-research/securing-the-continuous-integration-process/ • https://www.nccgroup.trust/uk/our-research/best-practices-for-the-use-of-static-code-analysis- within-a-real-world-secure-development-lifecycle/
  • 26. Points of contact Irene Michlin Principal Security Consultant M: +44 (0) 7972 333 148 E: irene.michlin@nccgroup.trust T: @IreneMichlin Thanks and credit to Clint Gibler - @clintgibler and Antti Vähä-Sipilä - @@anttivs https://www.nccgroup.trust/uk/our-research/securing-the-continuous-integration- process/ https://www.nccgroup.trust/uk/our-research/best-practices-for-the-use-of-static-code- analysis-within-a-real-world-secure-development-lifecycle/

Editor's Notes

  1. On people, I only have one piece of advice - Hire the right people and treat them right. The rest of the talk is on process and technology.
  2. The choice is enormous, not going to say “This is the recommended toolchain”. Not on the agenda, not on the hidden agenda. It’s rather what to look for in my tools, and how to put them together so that first of all I’m not harming my organisation’s security. And the secondary goal – I have this neat CI pipeline going, can I use it to improve my software’s security, amongst other things.
  3. To ensure we are on the same page for the rest of the talk.
  4. What happens in dev, stays in dev Physical or virtual, dev machines must be segregated from the main corporate environment.
  5. Let’s talk about version control server
  6. The choice of the version control pattern depends on multiple factors, such as frequency of releases, number of teams, structure of the code base etc. Generally speaking, patterns that require frequent commits to a shared branch are more suited for implementing CI. SSO is better than proliferation of accounts per each tool. RBAC with as much granularity as does not interfere with your work. Needs administrative component to terminate the accounts as required.
  7. Integration server
  8. It only needs R/O access to source control Set local repo for external libraries. Use scanners. Standard builds remove chasing the “it worked on my machine” problems
  9. Feedback mechanism
  10. Who is listening? Unless it is a low-tech mechanism “All the developers are in the same room and they look at a physical dashboard when they feel like it”, you have to consider the security of the mechanism. The tools are held together with what is often called “glue skills” – the developers are putting together ad hoc scripts, punching holes in firewalls, hardcode passwords. Even if the script itself isn’t dangerous, if it’s world-writable but runs at high privilege, it has a high potential to become dangerous. Glue skills are great to have in your team, but they can also be dangerous. Treat these scripts as first class citizens – under source control and under the same security standard as everything else. My example is not an attack on a particular tool, literally I’ve searched for “broken build gadgets” and picked a first example.
  11. CI environments are rarely planned upfront. The tools are introduced one by one and sometimes people only learn about everything they have during an audit, which is a bit too late. Secure system lifecycle. The product choice and evaluation can be quick and informal, but it has to be a conscious choice. Installation and configuration – don’t enable features you don’t need Ensure account management lifecycle covers all the CI tools.
  12. Luckily the industry is moving on from the “people are the weakest link” concept.
  13. Luckily the industry is moving on from the “people are the weakest link” concept. ©Giuseppe Colarusso http://www.gianlucagimini.it/prototypes/velocipedia.html Via AREyouKIDDINGmi And now we are to level 2 of this game: how to actually do good in security terms using CI.
  14. The figure above is based on several popular maturity matrices for continuous integration, as well as NCC Group experience with variety of clients. Won’t have time to go through them all, only couple. There is now understanding in the software development industry that security features are not enough for building a secure product. To achieve an acceptable level of overall security, the product needs all the features to be secure: the whole attack surface of the product must be considered from a security point of view, not only features that are directly security related, such as login functionality. The same is true for securing continuous integration. In the matrix above, the dedicated Security row lists explicit security related activities that must happen at some point towards CI maturity. However, every cell on the other rows needs to be evaluated for the security of its tools and processes as well.
  15. Frequently asked “are manual code reviews waste of time”? Not if done well. If your decision has only one possible outcome, then why bother with the decision? It’s waste of time. Another source of waste of time in review is “saving up” to end of week/end of iteration. It’s all about quick feedback.
  16. People like to rush into bug bounty programs Don't trouble trouble until trouble troubles you
  17. Whether you release each change individually in CD, or in batches, the same questions apply
  18. I’ve seen a company with a checklist for each api function – authentication, authorisation, input, output. Makes code reivew expensive, boring, and error prone. They’ve moved all the “boilerplate” to be given to developers for free. Test case that automatically checks for missing access controls and goes through the checklists
  19. Everybody’s favourite, right? https://78.media.tumblr.com/tumblr_m09u09jyo31qzrlhgo4_250.gif
  20. Either you love dogs very much, or you haven’t come across static analysis
  21. There is a range of complexity in “light-weight” vs “heavy-weight” static analysis approaches From simple text matching to understanding code syntax, semantics, and can reason about data and control flow Each of these have strengths and contexts in which they are useful
  22. The figure above is based on several popular maturity matrices for continuous integration, as well as NCC Group experience with variety of clients. Won’t have time to go through them all, only couple. There is now understanding in the software development industry that security features are not enough for building a secure product. To achieve an acceptable level of overall security, the product needs all the features to be secure: the whole attack surface of the product must be considered from a security point of view, not only features that are directly security related, such as login functionality. The same is true for securing continuous integration. In the matrix above, the dedicated Security row lists explicit security related activities that must happen at some point towards CI maturity. However, every cell on the other rows needs to be evaluated for the security of its tools and processes as well.
  23. Don’t throw all the tools at the dev team at the same time. Fuzzers, static analysis, dynamic analysis all take time to learn and configure and initially will bring the productivity down, not up Start with “new” code, ensure your debt isn’t growing. No two journeys towards maturity are the same. It may make sense for your organisation to take a practice from Intermediate or Advanced before doing everything in Beginner. It meant to inform, not to restrict. Hard to come with good questions on the spot, so I won’t force you. I’m here today, obviously, and if you have questions later, find me on twitter or by email.