SlideShare a Scribd company logo
Deep dive into the
secure software supply chain
on Infrastructure as Code (IaC)
Paolo Mainardi
➔ Co-founder and CTO @Sparkfabrik
➔ Linux Foundation Europe Advisory Member
➔ Blog: paolomainardi.com
➔ Podcast: Continuous Delivery
➔ linkedin.com/in/paolomainardi
➔ continuousdelivery.social/@paolomainardi
➔ paolo.mainardi@sparkfabrik.com
@paolomainardi
➔ What is a Software Supply Chain
➔ IaC and OCI containers
➔ DEMO of Sigstore and Syft
THE
SESSION
“A supply chain is a network
of individuals and companies
who are involved in creating
a product and delivering it
to the consumer”
https://slsa.dev/spec/v0.1/#supply-chain-threats
2020
About 18,000 customers of SolarWinds installed the infected updates,
including firms like Microsoft (Cisco, Intel, Deloitte) and top government US agencies
like Pentagon, Homeland security, National Nuclear Security etc.
WHAT SOLARWINDS TAUGHT US
● Only install signed versions ❌
● Update your software to the latest version ❌
● Review source code ❌
● Closed source is more secure by design ❌
CONVENTIONAL SECURITY ADVICE
THAT DON’T APPLY HERE:
Log4j - Log4shell 2021 - CVE-2021-44228
https://www.lunasec.io/docs/blog/log4j-zero-day/
Timeline - Log4shell 2021 - CVE-2021-44228
➔ 24th November: Issue discovered by Chen Zhaojun of the Alibaba Cloud Security Team,
and reported to the Apache Software Foundation.
➔ 9th December: The RCE 0-day vulnerability was tweeted along with a POC posted on
GitHub - RCE can be fired just by passing a certain string
◆ Hours later hundreds of companies and governments confirmed to be
affected to Log4Shell attacks
➔ 10th December: Apache released an emergency security update and details on a critical
vulnerability in Log4j - assigning a CVSS score of 10.
➔ Patches introduced other critical vulnerabilities: CVE-2021–45046 - CVE-2021–45105 -
CVE-2021–4104
➔ All applications using directly or indirectly log4j are affected as a result of a supply
chain dependency
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cloud.pdf
Source: Sonatype Log4j exploit update
https://www.sonatype.com/state-of-the-software-supply-chain/introduction
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cloud.pdf
https://linuxfoundation.eu/cyber-resilience-act
Keynote: The Next Steps in Software Supply Chain Security - Brandon Lum, Software Engineer, Google
STATE OF THE
IaC
ECOSYSTEM
Infrastructure as code
➔ Declarative describe your infrastructure as code
◆ K8S, VMs, networks, storage, users, permissions…
➔ Examples:
◆ Terraform - OpenTofu (HCL)
◆ Pulumi (Typescript, Python, GO, C#, Java, YAML)
◆ Crossplane (Kubernetes) (YAML)
Extensible with dependencies
● Terraform registry
○ Providers
○ Modules
● Crossplane Contrib
○ Providers
○ Compositions (XRD)
● Pulumi registry
○ Packages
Terraform/OpenTofu
DEEP-DIVE
TERRAFORM: PROVIDERS AND MODULES
● Providers are API implementation (GCP, AWS, DO etc…) and Modules are
groups of resources.
● Terraform providers and modules used in your Terraform configuration
have full access to the variables and Terraform state within a workspace
● Modules don’t have any form of signature or checksum (tampering risk)
● Anyone can publish a module on public Terraform Registry from a Github
repository (typosquatting risk)
● Modules versions are based on git tags (tampering risk)
TERRAFORM: ANATOMY OF A MODULE AND SECURITY RISKS
What can a module do,
other than create cloud
resources?
TERRAFORM: MODULE MALICIOUS CODE
● Can run any form of custom code (local-exec, external)
● Can interact with the network using the http provider
Hey team, we have an urgency for a big marketing campaign
just confirmed by the customer.
We need to deploy a new static website on GCP
and give access to an external team
to let them update it when needed, can you help us?
Please 🥺
BUSINESS REQUEST ON THURSDAY, DEADLINE IS FRIDAY
TERRAFORM: Find a module on Google: “gcp static website terraform”
Step 1 - Found the module we need
��
TERRAFORM: Review the module’s code
Step 2 - Quickly review the code
TERRAFORM: Get hacked
Step 3 - Got hacked - Saturday morning call: we have been hacked, what happened ??
TERRAFORM: HOW TO DETECT A SERVICE ACCOUNT LEAK ?
TERRAFORM: DETECT SERVICE ACCOUNT LEAK WITH CHECKOV
https://github.com/bridgecrewio/checkov
TERRAFORM: DETECT SERVICE ACCOUNT LEAK WITH CHECKOV
TERRAFORM: DETECT SERVICE ACCOUNT LEAK WITH CHECKOV
LESSON LEARNED
TERRAFORM: MODULE MALICIOUS CODE
Do not blindly trust community modules
Always use a static security scan tool like
Checkhov or TFscan or Trivy
Not enough alone, write your own policies.
DOCKER OCI IMAGES DEEP-DIVE
OCI stands for Open Container Initiative.
OCI defines the specifications and standards
for container technologies
(Runtime, Image and Distribution spec).
Container registries can be also used to store
other kind of artifacts (like Helm charts)
or just any arbitrary files.
What is the trusting model behind a Container Image,
or in general, a digital artifact?
How can i be sure that what I’m running
is coming from a trusted source?
https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf
1984
SECURE SOFTWARE SUPPLY CHAIN CHECKLIST
✅ Who built it, when and how
(Signatures and Provenance Attestations)
✅ The list of things who made the artifact
(SBOM - Software Bill of Material)
DIGITAL SIGNATURES 101
Integrity
Ensure the data signed was
not altered.
Authenticity
Attest that the data was
sent by the signer.
Non-repudiation
Ensure that the signer
cannot deny the authenticity
of the signature.
Managing keys is hard
Distribution, Storage, Compromise
DIGITAL SIGNATURES - SIGSTORE
Sigstore is an OSS
project under the
umbrella of OpenSSF
foundation.
Fast growing
community and
mainstream adopted
Used in Kubernetes
and many other big
vendors
(Github, Rubygems, Arch Linux etc..)
DIGITAL SIGNATURES - SIGSTORE
Keyless signing of any
software artifact
Signatures metadata
are stored in a public
tamper-resistant log
Signatures are stored
alongside images in
OCI registry
SBOM:
SOFTWARE
BILL OF
MATERIALS
A list of “ingredients”
for a software artifact
Can be used for:
➔ Vulnerability scanning
➔ Software transparency
➔ License policy
➔ Find abandoned dependencies
SBOM
FOR
CONTAINERS
Creating a SBOM for an artifact is a
complex problem
Dependencies live at different levels:
➔ Operating system (Windows, Debian, Alpine
etc…)
➔ Operating system dependencies (RPM, DEB,
APK, PKG…)
➔ Application dependencies (Composer, NPM,
Rubygems, Pypi, etc…)
➔ Static binaries and their dependencies (Go,
Rust etc…)
SBOM - Tools
$ docker sbom
DEMO
Takeaways
➔ Software Supply Chain security must be taken
very seriously
➔ IaC suffers from the same issues of the software
projects
➔ Always use static analysis tools for like Checkov
| Trivy | TFSec
➔ Sign your artifacts, Sigstore is nice and easy!
➔ Generate SBOM and scan for vulnerabilities
Snyk | Grype | Trivy
➔ Automate your dependencies with DependaBot
or RenovateBot
THANKS

More Related Content

PDF
Deep dive nella supply chain della nostra infrastruttura cloud
PDF
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
PDF
What is the Secure Supply Chain and the Current State of the PHP Ecosystem
PDF
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
PDF
Secure Software Ecosystem Teqnation 2024
PDF
Tracy Miranda_DevOps Loop, May 2022.pdf
PDF
OpenSSF.Repository.WG.Presentation.OpenSSF.Repository.WG.Presentation
PDF
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Deep dive nella supply chain della nostra infrastruttura cloud
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
What is the Secure Supply Chain and the Current State of the PHP Ecosystem
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Secure Software Ecosystem Teqnation 2024
Tracy Miranda_DevOps Loop, May 2022.pdf
OpenSSF.Repository.WG.Presentation.OpenSSF.Repository.WG.Presentation
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...

Similar to CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cloud.pdf (20)

PDF
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
PPTX
Why Building Your Ship (Application) with Raw Materials is a Bad Idea!.pptx
PDF
GDG Cloud Southlake #8 Steve Cravens: Infrastructure as-Code (IaC) in 2022: ...
PPTX
Key Takeaways for Java Developers from the State of the Software Supply Chain...
PDF
Preventing Supply Chain Attacks on Open Source Software
PDF
Software bill of materials: strumenti e analisi di progetti open source dell’...
PDF
Vulnerability Alert Fatigue and Malicious Code Attacks Meetup 11012024.pdf
PDF
Safeguarding Container Supply Chain - Anshul Patel
PDF
apidays Australia 2023 - Building Trust Brick by Brick, Dasith Wijesiriwarden...
PPTX
All You need to Know about Secure Coding with Open Source Software
PPTX
"Building Trust: Strengthening Your Software Supply Chain Security", Serhii V...
PDF
ISACA SV Chapter: Securing Software Supply Chains
PDF
BackStabber Special: Supply chain attacks
PPTX
Securing Infrastructure as a Code - DevFest 2022 Presentation
PDF
OSSCR: A framework for detecting Software Supply Chain “Risks” in Open- sourc...
PPTX
Nadog dev secops_survey
PDF
Securing your Software Delivery Pipelines with a slight shift to the left.
PPTX
(Micro)chips and SLSA: Securing the Software Supply Chain
PDF
Terraform: Check Your Source
PPT
IBM Open Cloud Update XCITE Fall 2014
stackconf 2024 | How to hack and defend (your) open source by Roman Zhukov.pdf
Why Building Your Ship (Application) with Raw Materials is a Bad Idea!.pptx
GDG Cloud Southlake #8 Steve Cravens: Infrastructure as-Code (IaC) in 2022: ...
Key Takeaways for Java Developers from the State of the Software Supply Chain...
Preventing Supply Chain Attacks on Open Source Software
Software bill of materials: strumenti e analisi di progetti open source dell’...
Vulnerability Alert Fatigue and Malicious Code Attacks Meetup 11012024.pdf
Safeguarding Container Supply Chain - Anshul Patel
apidays Australia 2023 - Building Trust Brick by Brick, Dasith Wijesiriwarden...
All You need to Know about Secure Coding with Open Source Software
"Building Trust: Strengthening Your Software Supply Chain Security", Serhii V...
ISACA SV Chapter: Securing Software Supply Chains
BackStabber Special: Supply chain attacks
Securing Infrastructure as a Code - DevFest 2022 Presentation
OSSCR: A framework for detecting Software Supply Chain “Risks” in Open- sourc...
Nadog dev secops_survey
Securing your Software Delivery Pipelines with a slight shift to the left.
(Micro)chips and SLSA: Securing the Software Supply Chain
Terraform: Check Your Source
IBM Open Cloud Update XCITE Fall 2014
Ad

More from sparkfabrik (20)

PDF
Talks on my machine: Drupal, Storybook e SDC
PDF
Talks on my machine: Drupal CMS versus The Cool Kids
PDF
Talks on my machine: Drupal: AI e Typesense come integrare la ricerca semantica
PDF
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
PDF
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
PDF
2023 - Drupalcon - How Drupal builds your pages
PDF
2023 - TAC23 - Agile HR - Racconti dal fronte
PDF
UX e Web sostenibile (UXday 2023).pdf
PDF
KCD Italy 2022 - Application driven infrastructure with Crossplane
PDF
Come Drupal costruisce le tue pagine
PDF
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
PDF
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
PPTX
Do you know what your Drupal is doing_ Observe it!
PDF
Progettare e sviluppare soluzioni serverless con AWS
PPTX
From React to React Native - Things I wish I knew when I started
PDF
Headless Drupal: A modern approach to (micro)services and APIs
PDF
Cloud-Native Drupal: a survival guide
PDF
Mobile Development: una introduzione per Web Developers
PDF
Retro gaming machine made with Javascript and Kubernetes
PDF
Gitops: the kubernetes way
Talks on my machine: Drupal, Storybook e SDC
Talks on my machine: Drupal CMS versus The Cool Kids
Talks on my machine: Drupal: AI e Typesense come integrare la ricerca semantica
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
2023 - Drupalcon - How Drupal builds your pages
2023 - TAC23 - Agile HR - Racconti dal fronte
UX e Web sostenibile (UXday 2023).pdf
KCD Italy 2022 - Application driven infrastructure with Crossplane
Come Drupal costruisce le tue pagine
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
Do you know what your Drupal is doing_ Observe it!
Progettare e sviluppare soluzioni serverless con AWS
From React to React Native - Things I wish I knew when I started
Headless Drupal: A modern approach to (micro)services and APIs
Cloud-Native Drupal: a survival guide
Mobile Development: una introduzione per Web Developers
Retro gaming machine made with Javascript and Kubernetes
Gitops: the kubernetes way
Ad

Recently uploaded (20)

PPTX
How to Build Crypto Derivative Exchanges from Scratch.pptx
PDF
Event Presentation Google Cloud Next Extended 2025
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
DevOps & Developer Experience Summer BBQ
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
creating-agentic-ai-solutions-leveraging-aws.pdf
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PDF
Modernizing your data center with Dell and AMD
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
REPORT: Heating appliances market in Poland 2024
PDF
Google’s NotebookLM Unveils Video Overviews
PDF
Top Generative AI Tools for Patent Drafting in 2025.pdf
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
How to Build Crypto Derivative Exchanges from Scratch.pptx
Event Presentation Google Cloud Next Extended 2025
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Transforming Manufacturing operations through Intelligent Integrations
DevOps & Developer Experience Summer BBQ
Chapter 3 Spatial Domain Image Processing.pdf
creating-agentic-ai-solutions-leveraging-aws.pdf
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Smarter Business Operations Powered by IoT Remote Monitoring
Modernizing your data center with Dell and AMD
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
REPORT: Heating appliances market in Poland 2024
Google’s NotebookLM Unveils Video Overviews
Top Generative AI Tools for Patent Drafting in 2025.pdf
Enable Enterprise-Ready Security on IBM i Systems.pdf
Understanding_Digital_Forensics_Presentation.pptx

CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cloud.pdf

  • 1. Deep dive into the secure software supply chain on Infrastructure as Code (IaC)
  • 2. Paolo Mainardi ➔ Co-founder and CTO @Sparkfabrik ➔ Linux Foundation Europe Advisory Member ➔ Blog: paolomainardi.com ➔ Podcast: Continuous Delivery ➔ linkedin.com/in/paolomainardi ➔ continuousdelivery.social/@paolomainardi ➔ [email protected] @paolomainardi
  • 3. ➔ What is a Software Supply Chain ➔ IaC and OCI containers ➔ DEMO of Sigstore and Syft THE SESSION
  • 4. “A supply chain is a network of individuals and companies who are involved in creating a product and delivering it to the consumer”
  • 6. 2020 About 18,000 customers of SolarWinds installed the infected updates, including firms like Microsoft (Cisco, Intel, Deloitte) and top government US agencies like Pentagon, Homeland security, National Nuclear Security etc.
  • 7. WHAT SOLARWINDS TAUGHT US ● Only install signed versions ❌ ● Update your software to the latest version ❌ ● Review source code ❌ ● Closed source is more secure by design ❌ CONVENTIONAL SECURITY ADVICE THAT DON’T APPLY HERE:
  • 8. Log4j - Log4shell 2021 - CVE-2021-44228 https://www.lunasec.io/docs/blog/log4j-zero-day/
  • 9. Timeline - Log4shell 2021 - CVE-2021-44228 ➔ 24th November: Issue discovered by Chen Zhaojun of the Alibaba Cloud Security Team, and reported to the Apache Software Foundation. ➔ 9th December: The RCE 0-day vulnerability was tweeted along with a POC posted on GitHub - RCE can be fired just by passing a certain string ◆ Hours later hundreds of companies and governments confirmed to be affected to Log4Shell attacks ➔ 10th December: Apache released an emergency security update and details on a critical vulnerability in Log4j - assigning a CVSS score of 10. ➔ Patches introduced other critical vulnerabilities: CVE-2021–45046 - CVE-2021–45105 - CVE-2021–4104 ➔ All applications using directly or indirectly log4j are affected as a result of a supply chain dependency
  • 11. Source: Sonatype Log4j exploit update
  • 15. Keynote: The Next Steps in Software Supply Chain Security - Brandon Lum, Software Engineer, Google
  • 17. Infrastructure as code ➔ Declarative describe your infrastructure as code ◆ K8S, VMs, networks, storage, users, permissions… ➔ Examples: ◆ Terraform - OpenTofu (HCL) ◆ Pulumi (Typescript, Python, GO, C#, Java, YAML) ◆ Crossplane (Kubernetes) (YAML)
  • 18. Extensible with dependencies ● Terraform registry ○ Providers ○ Modules ● Crossplane Contrib ○ Providers ○ Compositions (XRD) ● Pulumi registry ○ Packages
  • 20. TERRAFORM: PROVIDERS AND MODULES ● Providers are API implementation (GCP, AWS, DO etc…) and Modules are groups of resources. ● Terraform providers and modules used in your Terraform configuration have full access to the variables and Terraform state within a workspace
  • 21. ● Modules don’t have any form of signature or checksum (tampering risk) ● Anyone can publish a module on public Terraform Registry from a Github repository (typosquatting risk) ● Modules versions are based on git tags (tampering risk) TERRAFORM: ANATOMY OF A MODULE AND SECURITY RISKS
  • 22. What can a module do, other than create cloud resources?
  • 23. TERRAFORM: MODULE MALICIOUS CODE ● Can run any form of custom code (local-exec, external) ● Can interact with the network using the http provider
  • 24. Hey team, we have an urgency for a big marketing campaign just confirmed by the customer. We need to deploy a new static website on GCP and give access to an external team to let them update it when needed, can you help us? Please 🥺 BUSINESS REQUEST ON THURSDAY, DEADLINE IS FRIDAY
  • 25. TERRAFORM: Find a module on Google: “gcp static website terraform” Step 1 - Found the module we need
  • 26. �� TERRAFORM: Review the module’s code Step 2 - Quickly review the code
  • 27. TERRAFORM: Get hacked Step 3 - Got hacked - Saturday morning call: we have been hacked, what happened ??
  • 28. TERRAFORM: HOW TO DETECT A SERVICE ACCOUNT LEAK ?
  • 29. TERRAFORM: DETECT SERVICE ACCOUNT LEAK WITH CHECKOV https://github.com/bridgecrewio/checkov
  • 30. TERRAFORM: DETECT SERVICE ACCOUNT LEAK WITH CHECKOV
  • 31. TERRAFORM: DETECT SERVICE ACCOUNT LEAK WITH CHECKOV
  • 33. TERRAFORM: MODULE MALICIOUS CODE Do not blindly trust community modules Always use a static security scan tool like Checkhov or TFscan or Trivy Not enough alone, write your own policies.
  • 34. DOCKER OCI IMAGES DEEP-DIVE
  • 35. OCI stands for Open Container Initiative. OCI defines the specifications and standards for container technologies (Runtime, Image and Distribution spec). Container registries can be also used to store other kind of artifacts (like Helm charts) or just any arbitrary files.
  • 36. What is the trusting model behind a Container Image, or in general, a digital artifact? How can i be sure that what I’m running is coming from a trusted source?
  • 38. SECURE SOFTWARE SUPPLY CHAIN CHECKLIST ✅ Who built it, when and how (Signatures and Provenance Attestations) ✅ The list of things who made the artifact (SBOM - Software Bill of Material)
  • 39. DIGITAL SIGNATURES 101 Integrity Ensure the data signed was not altered. Authenticity Attest that the data was sent by the signer. Non-repudiation Ensure that the signer cannot deny the authenticity of the signature.
  • 40. Managing keys is hard Distribution, Storage, Compromise
  • 41. DIGITAL SIGNATURES - SIGSTORE Sigstore is an OSS project under the umbrella of OpenSSF foundation. Fast growing community and mainstream adopted Used in Kubernetes and many other big vendors (Github, Rubygems, Arch Linux etc..)
  • 42. DIGITAL SIGNATURES - SIGSTORE Keyless signing of any software artifact Signatures metadata are stored in a public tamper-resistant log Signatures are stored alongside images in OCI registry
  • 43. SBOM: SOFTWARE BILL OF MATERIALS A list of “ingredients” for a software artifact Can be used for: ➔ Vulnerability scanning ➔ Software transparency ➔ License policy ➔ Find abandoned dependencies
  • 44. SBOM FOR CONTAINERS Creating a SBOM for an artifact is a complex problem Dependencies live at different levels: ➔ Operating system (Windows, Debian, Alpine etc…) ➔ Operating system dependencies (RPM, DEB, APK, PKG…) ➔ Application dependencies (Composer, NPM, Rubygems, Pypi, etc…) ➔ Static binaries and their dependencies (Go, Rust etc…)
  • 45. SBOM - Tools $ docker sbom
  • 46. DEMO
  • 47. Takeaways ➔ Software Supply Chain security must be taken very seriously ➔ IaC suffers from the same issues of the software projects ➔ Always use static analysis tools for like Checkov | Trivy | TFSec ➔ Sign your artifacts, Sigstore is nice and easy! ➔ Generate SBOM and scan for vulnerabilities Snyk | Grype | Trivy ➔ Automate your dependencies with DependaBot or RenovateBot