stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
IT'S YOUR OPEN-SOURCE, NOT SOMEONE ELSE'S
IT'S YOUR OPEN-SOURCE, NOT SOMEONE ELSE'S
HOW TO HACK AND DEFEND
(YOUR) OPEN-SOURCE
Roman Zhukov
Product Security Manager, Security Champion for LF UXL
DISCLAIMER:
The opinions expressed are solely
my own and do not necessarily
reflect the official views or opinions
of my employer.
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
https://www.sonatype.com/state-of-the-
software-supply-chain
https://www.synopsys.com/software-
integrity/resources/analyst-
reports/open-source-security-risk-
analysis.html
(companies’)
Software
https://shorturl.at/inxJS
www.google.com
www.google.com
https://www.endorlabs.com/blog/introducing-
the-top-10-open-source-software-oss-risks
UNDERSTAND WHERE RISK IS FOR YOU
Must have a look
• Open-Source Security Foundation (OpenSSF)
• Secure Supply Chain Consumption Framework
(S2C2F)
• new OWASP Product Security Capability
Framework
Worth reading
• NIST Secure Software Development Framework
(SSDF)
• CISA Open-Source Software Security Roadmap
• CIS SW Supply Chain Security benchmark
• SLSA (Supply-chain Levels for Software Artifacts)
Good, but more generic and complex
• DOD DevSecOps framework
• NSA/CISA/ODNI: Securing the Software Supply
Chain
• NIST Cybersecurity Supply Chain Risk
publications
• UK National CSC: Supply chain cyber security
• ENISA Good practices for supply chain
cybersecurity
• CNCF Secure Software Factory
• OWASP SAMM
• BSIMM
INDUSTRY BEST PRACTICES
Secure
sourcing
Secure
development
Build & Release
Maintaining
production
open-
source
security
Community
engagement
SBOM
Dependency confusion
2
3
1
4
Typosquatting, Masquerading
Trojan injection, Protestware
Repo or package Hijacking
> npm install analytics-paypal
// Used to launch malicious script to
make DNS requests to
dns.alexbirsan-hacks-paypal.com to
run data exfiltration. Now
deprecated.
EleuterAI instead of EleutherAI
//fake LLM model was added to
Hugging Face
> dependabot[bot] committed
//Malicious pull request that’s
accepted contains info stealer
> coa
was hijacked over npm account
takeover incorporating password
stealer
//command line option parser with
over 9 Million weekly downloads
Secure
sourcing
ASSESS 3RD PARTY REPOS
✓ Why? Most popular ≠ Most secure
✓ Each of 19 individual check returns a score
of 0 to 10, compiling to aggregate score for
the repo
✓ Score >= 7 usually means very good
✓ It’s easy to achieve 5.9 and not a big deal to bump to 8.1
✓ Works with GitHub and GitLab repos
✓ Utilize GUI by accessing URL
✓ Run automatically using the GitHub Action
✓ Run manually via the Command Line Interface or Docker
✓ Use the REST API to query pre-calculated scores of OSS
projects
✓ [new] Scorecard Monitor – auto notification, PRs, etc.
https://github.com/ossf/scorecard
Secure
sourcing
• Check repo maintenance cadence
• At least 1 tagged release per half a year
• More than active 1 maintainer/contributor
• Check for CVEs & Pay attention to vulnerability research
• No disclosed CVEs is not necessarily good
• What’s in Security.md file
• Examine repo documentation maturity
• License
• Contribution rules definitions, review process, etc.
• All possible verifications: checksum, signatures, provenance, malware scan
• npm ci instead of npm install
• Curate and mirror locally critical dependencies – update them smart
• Why are you linking all these (pre-built) binaries instead of building them from source?
• e.g, .jar or .dll
OTHER BEST PRACTICES
Secure
sourcing
Source health check
• Open SSF ScoreCards – supports GitHub/GitLab
• deps.dev – project to assess packages - now has
API
• npm audit – built-in command checking for vulns
• npm doctor – verify npm env. Installation
• Chain-Bench – check for CIS SW Supply Chain
Security Benchmark
Local package management
• Pulp – local package organizer
• OpenSSF Package Analysis – track for malicious
behavior
• Use your SCM & CI tool native hardening features ☺
Dependencies & CVE detection + updating
• Dependabot & Dependabot core - check for CVE
and bumping up versions
• Renovatebot - bumping up versions
• PyUp (for Python) – bumping up Python components
• Intel CVE-Bin-Tool - check for CVE in (!) binaries
• OSV-Scanner (uses osv.dev database) – check for
CVE
• Fossa CLI, ScanCode, Dependency-Check - check
for CVE
• Trivy – scanning containers, dockerfiles,
configurations
FREE TOOLS
Secure
sourcing
SaaS SCM
(e.g., github.com)
Developer
Internal
Network
Runner 1 Runner 2 Runner 3
Commit/
Workflow
Push
REST API
Self-hosted Runners
GitHub
Actions
connection
Attacker
Git repository
Malicious
workflow
Malicious
push
Runner checks
out Attacker
code
Attacker server
Command & Control
connection +
RCE
Build &
Release
GitHub, GitLab, etc. allows
to run CI jobs and provides
curated runners available at
marketplace.
GitHub or GitLab allows to
using self-host runners that are
executed locally offering more
control of hardware, operating
system.
ephemeral runners perform
1 job at the time, then are
unregistered. Auto-update
option is enabled by default
(but shouldn’t be!).
non-ephemeral runners are
not stick to 1 job, any
contributor (even to
documentation) with
previous PR approved ever
can trigger it
• Isolate (build dev DMZ) accessing your internal infrastructure
• Harden OS
• Review access & token management
• Mange secrets properly and verify nothing is leaked
• Enable 2FA whenever possible, disable passwords
• Least privilege (root? again?)
• Leverage git permissions and branch protection
• Use JIT (ephemeral or runtime) runners
• Apply “codeowners” feature review to runners
• Prevent runners from approving PR
• Scan binaries (again!) for CVEs and malware
• Double-check supporting infra scripts (.yaml, .json)
• Connect logs and alerts to monitoring system
SUMMARY OF BEST PRACTICES Build &
Release
Repo and runner settings check
• Open SSF ScoreCards - yes, you can even
use it internally
Secret management
• Vault, Infisical
Secret scanning
• GitGuardian, Gitleaks, Whispers
• Detect-secrets, TruffleHog
“Classic” network security & scanning
• pfSense
• OpenSCAP, OpenVAS, Wazuh
CVE, malware & script scanning
• CVE Bin Tool – intel open-source tool
• Retire.js - CVE scan for JS-libs
• ClamAV – anti-malware scanning
• Trivy, Checkov – scripts & IaC scanning
Container specific
• Trivy, grype – dockerfiles, CVEs, secrets
• Docker Bench for Security, CIS Docker
Benchmark
FREE TOOLS Build &
Release
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
SBOM
SBOM Quality report, 2023, Purdue University, In-Q-Tel, Chainguard
SBOM – Software Bills of Material
• 3 reasons Why ingesting SBOM:
• Inventory
• Automation
• Accountability
• Don’t be obsessed by the format, just pull
something
• Validate SBOM, provenance and signature
(where applicable) of 3rd parties
• Create your own SBOM (even if don’t ship
to US Gov)
• Leverage ingesting VEX (in machine-
readable CSAF format)
SBOM CONSIDERATIONS SBOM
VEX – Vulnerability Exploitability eXchange
https://industrialcyber.co/
KEY TAKEAWAYS
Highlight [your own]
open-source risks
Just doing what
leaders do solves
80% issues
Automate it!
Security is [now] dev-
friendly ☺
Be on top of hacking
techniques
2023 Intel Product Security Report
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
https://opensourcesecurityindex.io/
IT’S YOUR OPEN-SOURCE.
TAKE CARE OF IT.
LINKEDIN.COM/IN/ROZHUKOV
Reach out to me:

More Related Content

PDF
we45 DEFCON Workshop - Building AppSec Automation with Python
PPTX
Using Chef InSpec for Infrastructure Security
PPTX
InSpec For DevOpsDays Amsterdam 2017
PPTX
dependency-check is ppt from owasp to test dependecies
PDF
Pragmatic Pipeline Security
ODP
Effective DevSecOps
PPT
Code Quality - Security
PPTX
Version Control and Continuous Integration
we45 DEFCON Workshop - Building AppSec Automation with Python
Using Chef InSpec for Infrastructure Security
InSpec For DevOpsDays Amsterdam 2017
dependency-check is ppt from owasp to test dependecies
Pragmatic Pipeline Security
Effective DevSecOps
Code Quality - Security
Version Control and Continuous Integration

Similar to stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf (20)

PPTX
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
PPTX
Adding Security to Your Workflow with InSpec (MAY 2017)
PDF
Modern Web 2019 從零開始加入自動化資安測試
PDF
Inspec: Turn your compliance, security, and other policy requirements into au...
PPTX
InSpec - June 2018 at Open28.be
PDF
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
PDF
Prescriptive System Security with InSpec
PPTX
Prescriptive Security with InSpec - All Things Open 2019
PPTX
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
PDF
Analysis of-quality-of-pkgs-in-packagist-univ-20171024
PPTX
InSpec Workflow for DevOpsDays Riga 2017
PPTX
Adding Security and Compliance to Your Workflow with InSpec
PDF
How do JavaScript frameworks impact the security of applications?
PPTX
Open DevSecOps 2019 - Securing the Software Supply Chain - Sonatype
PPTX
InSpec at DevOps ATL Meetup January 22, 2020
PPTX
10 Useful Testing Tools for Open Source Projects @ TuxCon 2015
PDF
Thick Application Penetration Testing: Crash Course
PPTX
Continuous Security Testing with Devops - OWASP EU 2014
PPTX
Jason Kent - AppSec Without Additional Tools
PDF
The Future of Security and Productivity in Our Newly Remote World
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
Adding Security to Your Workflow with InSpec (MAY 2017)
Modern Web 2019 從零開始加入自動化資安測試
Inspec: Turn your compliance, security, and other policy requirements into au...
InSpec - June 2018 at Open28.be
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
Prescriptive System Security with InSpec
Prescriptive Security with InSpec - All Things Open 2019
DevOpsDaysRiga 2017: Mandi Walls - Building security into your workflow with ...
Analysis of-quality-of-pkgs-in-packagist-univ-20171024
InSpec Workflow for DevOpsDays Riga 2017
Adding Security and Compliance to Your Workflow with InSpec
How do JavaScript frameworks impact the security of applications?
Open DevSecOps 2019 - Securing the Software Supply Chain - Sonatype
InSpec at DevOps ATL Meetup January 22, 2020
10 Useful Testing Tools for Open Source Projects @ TuxCon 2015
Thick Application Penetration Testing: Crash Course
Continuous Security Testing with Devops - OWASP EU 2014
Jason Kent - AppSec Without Additional Tools
The Future of Security and Productivity in Our Newly Remote World

Recently uploaded (20)

PDF
Overview of Fundamentals of Project Management
PDF
Building event-driven application with RAP Business Events in ABAP Cloud
PPTX
IIINtroduction_Macroperspective (1).pptx
PPTX
HRPTA PPT 2024-2025 FOR PTA MEETING STUDENTS
PDF
_INVITATIONS AND REPLIES.pdffhihgushfuhug
PPTX
Brief presentation for multiple products
PPTX
Enterprise Network Design and Implementation Project using Cisco ASA, FortiGa...
PPTX
Karl Marx – Overview,arly Life: Born 1818, Germany • Studied philosophy
PPTX
Where is the Best Place to Invest in Real Estate.pptx
PPTX
The-Impact-of-Study-Spaces-on-Academic-Performance.pptx
PPTX
MASTERING TIME: STRATEGIES FOR MANAGING STRESS AND BOOSTING PRODUCTIVITY A Mo...
PPTX
2025-08-31 Joseph 05 (shared slides).pptx
PPTX
RP Virtual Session One intro to workplace readiness
PPTX
WEEK 6 and 7 (1).pptx ingles de psicologia
PDF
Unit 3 Ratio Analysis.pdf xdvdssdfsdfsd sdf
PPTX
AI-assisted Next Generation Risk Assessment and Safe and Sustainable Design W...
PPTX
Lesson-4-MS-Word-Inserting-Editing-Formatting-Objects.pptx.pptx
PPTX
Template for edu 3D Stairs Templates.pptx
PPTX
The walking dead SERIE PARA EXPONER DISPOSITIVA
PDF
Ch-5.pdf important formulas requires for class 12
Overview of Fundamentals of Project Management
Building event-driven application with RAP Business Events in ABAP Cloud
IIINtroduction_Macroperspective (1).pptx
HRPTA PPT 2024-2025 FOR PTA MEETING STUDENTS
_INVITATIONS AND REPLIES.pdffhihgushfuhug
Brief presentation for multiple products
Enterprise Network Design and Implementation Project using Cisco ASA, FortiGa...
Karl Marx – Overview,arly Life: Born 1818, Germany • Studied philosophy
Where is the Best Place to Invest in Real Estate.pptx
The-Impact-of-Study-Spaces-on-Academic-Performance.pptx
MASTERING TIME: STRATEGIES FOR MANAGING STRESS AND BOOSTING PRODUCTIVITY A Mo...
2025-08-31 Joseph 05 (shared slides).pptx
RP Virtual Session One intro to workplace readiness
WEEK 6 and 7 (1).pptx ingles de psicologia
Unit 3 Ratio Analysis.pdf xdvdssdfsdfsd sdf
AI-assisted Next Generation Risk Assessment and Safe and Sustainable Design W...
Lesson-4-MS-Word-Inserting-Editing-Formatting-Objects.pptx.pptx
Template for edu 3D Stairs Templates.pptx
The walking dead SERIE PARA EXPONER DISPOSITIVA
Ch-5.pdf important formulas requires for class 12

stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf

  • 2. IT'S YOUR OPEN-SOURCE, NOT SOMEONE ELSE'S
  • 3. IT'S YOUR OPEN-SOURCE, NOT SOMEONE ELSE'S
  • 4. HOW TO HACK AND DEFEND (YOUR) OPEN-SOURCE Roman Zhukov Product Security Manager, Security Champion for LF UXL DISCLAIMER: The opinions expressed are solely my own and do not necessarily reflect the official views or opinions of my employer.
  • 11. Must have a look • Open-Source Security Foundation (OpenSSF) • Secure Supply Chain Consumption Framework (S2C2F) • new OWASP Product Security Capability Framework Worth reading • NIST Secure Software Development Framework (SSDF) • CISA Open-Source Software Security Roadmap • CIS SW Supply Chain Security benchmark • SLSA (Supply-chain Levels for Software Artifacts) Good, but more generic and complex • DOD DevSecOps framework • NSA/CISA/ODNI: Securing the Software Supply Chain • NIST Cybersecurity Supply Chain Risk publications • UK National CSC: Supply chain cyber security • ENISA Good practices for supply chain cybersecurity • CNCF Secure Software Factory • OWASP SAMM • BSIMM INDUSTRY BEST PRACTICES
  • 13. Dependency confusion 2 3 1 4 Typosquatting, Masquerading Trojan injection, Protestware Repo or package Hijacking > npm install analytics-paypal // Used to launch malicious script to make DNS requests to dns.alexbirsan-hacks-paypal.com to run data exfiltration. Now deprecated. EleuterAI instead of EleutherAI //fake LLM model was added to Hugging Face > dependabot[bot] committed //Malicious pull request that’s accepted contains info stealer > coa was hijacked over npm account takeover incorporating password stealer //command line option parser with over 9 Million weekly downloads Secure sourcing
  • 14. ASSESS 3RD PARTY REPOS ✓ Why? Most popular ≠ Most secure ✓ Each of 19 individual check returns a score of 0 to 10, compiling to aggregate score for the repo ✓ Score >= 7 usually means very good ✓ It’s easy to achieve 5.9 and not a big deal to bump to 8.1 ✓ Works with GitHub and GitLab repos ✓ Utilize GUI by accessing URL ✓ Run automatically using the GitHub Action ✓ Run manually via the Command Line Interface or Docker ✓ Use the REST API to query pre-calculated scores of OSS projects ✓ [new] Scorecard Monitor – auto notification, PRs, etc. https://github.com/ossf/scorecard Secure sourcing
  • 15. • Check repo maintenance cadence • At least 1 tagged release per half a year • More than active 1 maintainer/contributor • Check for CVEs & Pay attention to vulnerability research • No disclosed CVEs is not necessarily good • What’s in Security.md file • Examine repo documentation maturity • License • Contribution rules definitions, review process, etc. • All possible verifications: checksum, signatures, provenance, malware scan • npm ci instead of npm install • Curate and mirror locally critical dependencies – update them smart • Why are you linking all these (pre-built) binaries instead of building them from source? • e.g, .jar or .dll OTHER BEST PRACTICES Secure sourcing
  • 16. Source health check • Open SSF ScoreCards – supports GitHub/GitLab • deps.dev – project to assess packages - now has API • npm audit – built-in command checking for vulns • npm doctor – verify npm env. Installation • Chain-Bench – check for CIS SW Supply Chain Security Benchmark Local package management • Pulp – local package organizer • OpenSSF Package Analysis – track for malicious behavior • Use your SCM & CI tool native hardening features ☺ Dependencies & CVE detection + updating • Dependabot & Dependabot core - check for CVE and bumping up versions • Renovatebot - bumping up versions • PyUp (for Python) – bumping up Python components • Intel CVE-Bin-Tool - check for CVE in (!) binaries • OSV-Scanner (uses osv.dev database) – check for CVE • Fossa CLI, ScanCode, Dependency-Check - check for CVE • Trivy – scanning containers, dockerfiles, configurations FREE TOOLS Secure sourcing
  • 17. SaaS SCM (e.g., github.com) Developer Internal Network Runner 1 Runner 2 Runner 3 Commit/ Workflow Push REST API Self-hosted Runners GitHub Actions connection Attacker Git repository Malicious workflow Malicious push Runner checks out Attacker code Attacker server Command & Control connection + RCE Build & Release GitHub, GitLab, etc. allows to run CI jobs and provides curated runners available at marketplace. GitHub or GitLab allows to using self-host runners that are executed locally offering more control of hardware, operating system. ephemeral runners perform 1 job at the time, then are unregistered. Auto-update option is enabled by default (but shouldn’t be!). non-ephemeral runners are not stick to 1 job, any contributor (even to documentation) with previous PR approved ever can trigger it
  • 18. • Isolate (build dev DMZ) accessing your internal infrastructure • Harden OS • Review access & token management • Mange secrets properly and verify nothing is leaked • Enable 2FA whenever possible, disable passwords • Least privilege (root? again?) • Leverage git permissions and branch protection • Use JIT (ephemeral or runtime) runners • Apply “codeowners” feature review to runners • Prevent runners from approving PR • Scan binaries (again!) for CVEs and malware • Double-check supporting infra scripts (.yaml, .json) • Connect logs and alerts to monitoring system SUMMARY OF BEST PRACTICES Build & Release
  • 19. Repo and runner settings check • Open SSF ScoreCards - yes, you can even use it internally Secret management • Vault, Infisical Secret scanning • GitGuardian, Gitleaks, Whispers • Detect-secrets, TruffleHog “Classic” network security & scanning • pfSense • OpenSCAP, OpenVAS, Wazuh CVE, malware & script scanning • CVE Bin Tool – intel open-source tool • Retire.js - CVE scan for JS-libs • ClamAV – anti-malware scanning • Trivy, Checkov – scripts & IaC scanning Container specific • Trivy, grype – dockerfiles, CVEs, secrets • Docker Bench for Security, CIS Docker Benchmark FREE TOOLS Build & Release
  • 21. SBOM SBOM Quality report, 2023, Purdue University, In-Q-Tel, Chainguard SBOM – Software Bills of Material
  • 22. • 3 reasons Why ingesting SBOM: • Inventory • Automation • Accountability • Don’t be obsessed by the format, just pull something • Validate SBOM, provenance and signature (where applicable) of 3rd parties • Create your own SBOM (even if don’t ship to US Gov) • Leverage ingesting VEX (in machine- readable CSAF format) SBOM CONSIDERATIONS SBOM VEX – Vulnerability Exploitability eXchange https://industrialcyber.co/
  • 23. KEY TAKEAWAYS Highlight [your own] open-source risks Just doing what leaders do solves 80% issues Automate it! Security is [now] dev- friendly ☺ Be on top of hacking techniques 2023 Intel Product Security Report
  • 26. IT’S YOUR OPEN-SOURCE. TAKE CARE OF IT. LINKEDIN.COM/IN/ROZHUKOV Reach out to me: