SlideShare a Scribd company logo
1 of 54
License Compliance in
Embedded Linux with the
Yocto Project
Paul Barker, Beta Five Ltd
Introduction
About Me
• Involved in Yocto Project since 2013
• Work across the whole embedded stack
• Managing Director & Principal Engineer
@ Beta Five Ltd
• Contact: paul@betafive.co.uk
• Website: https://www.betafive.co.uk/
Disclaimer
• This is not legal advice
• Best practices are given based on my
experience as a developer and an open source
community member
• If in doubt, consult an appropriate lawyer
About This Talk
• Best practices and pitfalls to avoid
– Build system agnostic
• License Compliance in Yocto Project
– Available tools
– Ongoing and future work
– Comparisons with other projects
• Other relevant projects
Not Covered Here
• DRM/Tivo-isation concerns
• How to interpret licenses
– What do we need to provide in each case?
Why Care?
• Selling an embedded device typically involves
distribution of open source software
• This carries the risk of legal action if not done
properly
• Doing this right gives you standing in the
community
Another Reason Why
• You should be retaining full sources anyway!
• Need to be able to rebuild old releases with
minor changes
– For debugging
– To satisfy customer requests
• Sources often disappear from the internet
General Advice
The Fundamentals
• Provide license text and notices (BSD, MIT, etc)
– On device?
– In documentation?
– On website?
• Provide Complete Corresponding Source (GPL)
– Published directly?
– Via an offer letter?
The Distributed Image
• This is the image that’s actually distributed
• For devices: What is on the device when it is
shipped to a customer?
• For downloads: What is in the file a customer
downloads?
Single Command Build
• Probably the most important practice
• Reduces human error in build/release process
Test Your Releases!
• Your build/release process is non trivial
• It needs tests!
– Check for expected artifacts
– Check inside tarballs as well
– Check you can rebuild from source releases
• Automate your tests
Use Your Build System
• Build the Distributed Image with Yocto Project,
Buildroot, etc
• Avoid modifying this image in a post-build script
– Lose access to the tools in your build system
– Easy to break license compliance this way
• You can move, copy, compress, etc the image in
a post-build script
Factory Test
• What happens on device between initial image
programming and distribution?
• On-device package management at this stage
complicates things
– Again, very easy to break license compliance
• Try to limit additional data added at this stage
– Configuration data, calibration data, etc is fine
Proprietary Components
• License compliance also means not releasing
source for proprietary components
– You need some filtering
• Test for accidental release!
• May be useful to have a separate pure open
source image
Source Patches
• Remember to include these with sources
• Watch out for hidden patches
– Use of sed or similar tools in recipes or build scripts
• Make sure your system records the patch order
Recipes and Build Scripts
• GPLv2 says to include “scripts used to control
compilation and installation”
• This may include full Yocto Project layers &
bitbake, full buildroot tree, etc as appropriate
• There are different interpretations here
– IANAL
Using Desktop/Server Distros
• Just say no
• Difficult to audit license compliance
• Difficult to provide all required source code
Docker
• A Dockerfile is not the Complete Corresponding
Source for an image
• You may not even know exactly what is installed
in your base image (FROM statement)
• Watch out when using containers in Embedded
Linux
Pre-compiled Toolchains
• E.g. ARM toolchain, Linaro toolchain
– Built around gcc, glibc, etc
• Libraries from this toolchain typically end up in
the distributed image
• Remember to capture the source code for this
– May not be well automated
Language-Specific Package Managers
• E.g. NPM, Cargo, etc
• These are often trash on fire
– May not support offline compilation well
– May not offer an easy way to get the license text
and/or correct source for dependencies
• You need to do your own research here
Other Insanities
• Watch out for unadvertised network access in
Makefiles or other build scripts
– May download additional sources with different license
conditions
– May use online tools during build process, breaking
offline builds
• Every sin you can think of exists in a project
Makefile somewhere
Metadata Bugs
• Licenses given in recipes may be incorrect or
incomplete
– This does happen!
• Follow stable updates where possible
• For major commercial projects you should do
your own verification
– Fossology can be useful here
Yocto Project
Metadata in Yocto Project Recipes
• LICENSE
– SPDX License Identifiers used these days
• LIC_FILES_CHKSUM
– Catches changes in license
Metadata Advice
• Avoid `LICENSE = “CLOSED”`
– Give your proprietary license a name and include it
– CLOSED disables license checksum verification
• Avoid `SRCREV = “AUTOREV”` in releases
– Too easy to mismatch images and released source
– Rebuilding the image in several months may give a
different result
Common Licenses
• LICENSE_PATH is a space separated list of
directories to search for generic license text
• A layer can have its own directory for license text
– Extend LICENSE_PATH in layer.conf
• Use this instead of `CLOSED` or `Proprietary`
licenses if possible
Unique Licenses
• NO_GENERIC_LICENSE allows license text to be
copied from the package source
– Set `LICENSE = “blah”`
– Set `NO_GENERIC_LICENSE[blah] = “blah_license.txt”`
• Use this rather than ignoring warnings
– Makes it easier to audit and to capture license text
properly later
Capturing License Text
• Copy or tarball `tmp/deploy/licenses`
• Should do this after a clean build
• May require some manual post-processing
Including License Text in an Image
• Set `COPY_LIC_MANIFEST = “1”`
• Set `COPY_LIC_DIRS = “1”`
• Places files into /usr/share/common-licenses
License Packages
• Set `LICENSE_CREATE_PACKAGE = “1”`
• Creates a package `${PN}-lic` for each recipe
• Places license text in /usr/share/licenses
• Provides an upgrade path for license text
– COPY_LIC_DIRS does not provide this
Capturing Source Code
• Two possible approaches here
– Shipping the downloads directory
– Using the archiver
• Archiver is more flexible
– Supports filtering by license and recipe type
– Configurable to fit your legal advice
Shipping the Downloads Directory
• Set `BB_GENERATE_MIRROR_TARBALLS = “1”`
– Enables the mirroring of git repositories
• Build an image
– Should be a clean build
• Copy or tarball the downloads directory
– You can exclude `.done` files and version control
subdirectories
Shallow Mirror Tarballs
• By default, git mirror tarballs contain full history
• Set the following to enable:
– `BB_GIT_SHALLOW = “1”`
– `BB_GENERATE_SHALLOW_TARBALLS = “1”`
• Can save a lot of space in a mirror
– 7.5 GB -> 1 GB in one recent project
Using the Archiver
• Set `INHERIT += “archiver”` and choose the mode:
– `ARCHIVER_MODE = “original”`
– `ARCHIVER_MODE = “patched”`
– `ARCHIVER_MODE = “configured”`
• Other options
– Original source -> patched source diff
– Recipe files
Copyleft Filtering
• COPYLEFT_LICENSE_INCLUDE
– Defaults to `GPL* LGPL* AGPL*`
• COPYLEFT_LICENSE_EXCLUDE
– Defaults to `CLOSED Proprietary`
• COPYLEFT_RECIPE_TYPES
– Defaults to target only
– Can add native, nativesdk, cross, crosssdk, cross-canadian
Providing Layers
• The best way to capture recipes and patches
• Publish as much of your layers as possible
– Either as tarballs or full git repositories
– Add them to the layer index if they’re open source
(https://layers.openembedded.org)
• Isolate proprietary recipes from open source recipes
Local Configuration
• When providing layers, watch out for changes in
local.conf
• Two possible solutions:
– Version control local.conf
– Capture local.conf as part of the build
• Also consider including bblayers.conf
SDK/ESDK Distribution
• An SDK is just a different type of image
– Built from packages
• The ESDK is different
– Built from sstate
– May contain files which aren’t usually packaged
• If using the archiver, make sure to extend
COPYLEFT_RECIPE_TYPES
INCOMPATIBLE_LICENSE
• Allows recipes to be excluded by license
– Prevents accidental inclusion of unwanted code
• Applies to target packages only
• meta-gplv2 layer may be needed if excluding
GPL 3.0 or later
License Flags
• Another method of excluding recipes by license class
• May be used to highlight non-copyright issues such as
required patent licenses
• Set LICENSE_FLAGS_WHITELIST to enable flagged
recipes
SPDX File Creation
• SPDX is a standard data exchange format for
software manifests
• Supported in Yocto Project by meta-spdxscanner
layer
• Uses DoSOCSv2 or a Fossology Server to
perform analysis
Recent Improvements
• Per-image INCOMPATIBLE_LICENSE
• Devtool and recipetool have improved license
handling
• Several license metadata fixes
WIP: Mirror Archiver
• The capture of Complete Corresponding Source
must be testable
• The best test is a full rebuild
– Even better as support for reproducible builds improves
• Current archiver modes do not support this
WIP: Mirror Archiver (2)
• Supports split (directory per package) or combined
(single directory) mirror creation
• Uses the fetcher in bitbake to capture SRC_URI items
– Like grabbing the downloads directory but supports copyleft
filtering
• Allows further filtering of SRC_URI
– E.g. You can exclude `file://` URIs if you’re also providing
layers
WIP: License Information Bundle
• Single license info artifact per image
• HTML format
– Two sections: Packages and common licenses
– License text in <pre> tags
– Suitable for use in documentation
• Can also be compressed and installed into an image
Comparisons and
Other Projects
Comparison with Buildroot
• Buildroot has `make legal-info`
– Well documented
– Less configurable than Yocto Project but still pretty good
– Captures original sources, patches and license text
• Packages can be excluded by setting
`<PKG>_REDISTRIBUTE = NO`
Comparison with OpenWRT
• Can’t find license compliance documentation for
OpenWRT
• This needs improvement
Other Projects: Fossology
• Run license, copyright and export control scans
• Automated scanning process with support for manual
correction
• Command line and Web UI interfaces
• A Linux Foundation project
Other Projects: OpenChain Project
• Improving license compliance across software supply
chains
• Defines a specification and a training curriculum
• Conformance certification to
build trust
• A Linux Foundation project
Other Projects: Software Heritage
• Collects and preserves software source code
• Indexed at source file level and searchable by SHA1 hash
• Allows submission by web interface or API
• An Inria project
– French national research institute for the
digital sciences
Thank You!
Follow Up:
paul@betafive.co.uk

More Related Content

What's hot

Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2Qualcomm Developer Network
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCUlrich Krause
 
Yocto project and open embedded training
Yocto project and open embedded trainingYocto project and open embedded training
Yocto project and open embedded trainingH Ming
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntfUlrich Krause
 
IBM i: Fertile Ground for PHP Developers
IBM i: Fertile Ground for PHP DevelopersIBM i: Fertile Ground for PHP Developers
IBM i: Fertile Ground for PHP DevelopersAlan Seiden
 
Web services on IBM i with PHP and Zend Framework
Web services on IBM i with PHP and Zend FrameworkWeb services on IBM i with PHP and Zend Framework
Web services on IBM i with PHP and Zend FrameworkAlan Seiden
 
Read-only rootfs: theory and practice
Read-only rootfs: theory and practiceRead-only rootfs: theory and practice
Read-only rootfs: theory and practiceChris Simmonds
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using ErlangFrank Hunleth
 
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Anne Nicolas
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Projectrossburton
 
Embedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsEmbedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsFrank Hunleth
 
Embedded Linux primer
Embedded Linux primerEmbedded Linux primer
Embedded Linux primerDrew Fustini
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yoctoAlex Gonzalez
 
Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...
Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...
Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...GlobalLogic Ukraine
 
Android beyond the smartphone
Android beyond the smartphoneAndroid beyond the smartphone
Android beyond the smartphoneChris Simmonds
 
Embedded Recipes 2017 - An easy-to-install real world embedded Linux distribu...
Embedded Recipes 2017 - An easy-to-install real world embedded Linux distribu...Embedded Recipes 2017 - An easy-to-install real world embedded Linux distribu...
Embedded Recipes 2017 - An easy-to-install real world embedded Linux distribu...Anne Nicolas
 
Linux day 2016 Yocto Project
Linux day 2016 Yocto ProjectLinux day 2016 Yocto Project
Linux day 2016 Yocto ProjectMarco Cavallini
 
Linux field-update-2015
Linux field-update-2015Linux field-update-2015
Linux field-update-2015Chris Simmonds
 
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Chris Simmonds
 

What's hot (20)

Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVC
 
Yocto project and open embedded training
Yocto project and open embedded trainingYocto project and open embedded training
Yocto project and open embedded training
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntf
 
IBM i: Fertile Ground for PHP Developers
IBM i: Fertile Ground for PHP DevelopersIBM i: Fertile Ground for PHP Developers
IBM i: Fertile Ground for PHP Developers
 
Web services on IBM i with PHP and Zend Framework
Web services on IBM i with PHP and Zend FrameworkWeb services on IBM i with PHP and Zend Framework
Web services on IBM i with PHP and Zend Framework
 
Read-only rootfs: theory and practice
Read-only rootfs: theory and practiceRead-only rootfs: theory and practice
Read-only rootfs: theory and practice
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using Erlang
 
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Project
 
Embedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsEmbedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBots
 
Embedded Linux primer
Embedded Linux primerEmbedded Linux primer
Embedded Linux primer
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yocto
 
Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...
Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...
Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...
 
Android beyond the smartphone
Android beyond the smartphoneAndroid beyond the smartphone
Android beyond the smartphone
 
Embedded Recipes 2017 - An easy-to-install real world embedded Linux distribu...
Embedded Recipes 2017 - An easy-to-install real world embedded Linux distribu...Embedded Recipes 2017 - An easy-to-install real world embedded Linux distribu...
Embedded Recipes 2017 - An easy-to-install real world embedded Linux distribu...
 
Linux day 2016 Yocto Project
Linux day 2016 Yocto ProjectLinux day 2016 Yocto Project
Linux day 2016 Yocto Project
 
Yocto Project - OSCON 7-17-2012
Yocto Project - OSCON 7-17-2012Yocto Project - OSCON 7-17-2012
Yocto Project - OSCON 7-17-2012
 
Linux field-update-2015
Linux field-update-2015Linux field-update-2015
Linux field-update-2015
 
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017
 

Similar to License compliance in embedded linux with the yocto project

Open Source License Compliance with AGL
Open Source License Compliance with AGLOpen Source License Compliance with AGL
Open Source License Compliance with AGLPaul Barker
 
Kubernetes and container security
Kubernetes and container securityKubernetes and container security
Kubernetes and container securityVolodymyr Shynkar
 
yocto_scale_handout-with-notes
yocto_scale_handout-with-notesyocto_scale_handout-with-notes
yocto_scale_handout-with-notesSteve Arnold
 
scaling compiled applications - highload 2013
scaling compiled applications - highload 2013scaling compiled applications - highload 2013
scaling compiled applications - highload 2013ice799
 
Joe Damato
Joe DamatoJoe Damato
Joe DamatoOntico
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Ahmed El-Arabawy
 
Managing Open Source Software in the GitHub Era
Managing Open Source Software in the GitHub EraManaging Open Source Software in the GitHub Era
Managing Open Source Software in the GitHub EranexB Inc.
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Bruno Capuano
 
OpenChain Webinar #11 - Open Source Issues Remediation - Jari Koivisto - 2020...
OpenChain Webinar #11 - Open Source Issues Remediation - Jari Koivisto - 2020...OpenChain Webinar #11 - Open Source Issues Remediation - Jari Koivisto - 2020...
OpenChain Webinar #11 - Open Source Issues Remediation - Jari Koivisto - 2020...Shane Coughlan
 
Managing OSS license obligations
Managing OSS license obligationsManaging OSS license obligations
Managing OSS license obligationsnexB Inc.
 
Spring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionSpring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionStefan Schmidt
 
Tips and best practices for Docker
Tips and best practices for DockerTips and best practices for Docker
Tips and best practices for DockerCalidad Infotech
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux KernelDocker, Inc.
 
Preparing your dockerised application for production deployment
Preparing your dockerised application for production deploymentPreparing your dockerised application for production deployment
Preparing your dockerised application for production deploymentDave Ward
 
Oracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version ControlOracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version ControlChris Muir
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins worldBrent Laster
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...E. Camden Fisher
 
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
 

Similar to License compliance in embedded linux with the yocto project (20)

Open Source License Compliance with AGL
Open Source License Compliance with AGLOpen Source License Compliance with AGL
Open Source License Compliance with AGL
 
Kubernetes and container security
Kubernetes and container securityKubernetes and container security
Kubernetes and container security
 
yocto_scale_handout-with-notes
yocto_scale_handout-with-notesyocto_scale_handout-with-notes
yocto_scale_handout-with-notes
 
scaling compiled applications - highload 2013
scaling compiled applications - highload 2013scaling compiled applications - highload 2013
scaling compiled applications - highload 2013
 
Joe Damato
Joe DamatoJoe Damato
Joe Damato
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management
 
Building foundations
Building foundationsBuilding foundations
Building foundations
 
Managing Open Source Software in the GitHub Era
Managing Open Source Software in the GitHub EraManaging Open Source Software in the GitHub Era
Managing Open Source Software in the GitHub Era
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
OpenChain Webinar #11 - Open Source Issues Remediation - Jari Koivisto - 2020...
OpenChain Webinar #11 - Open Source Issues Remediation - Jari Koivisto - 2020...OpenChain Webinar #11 - Open Source Issues Remediation - Jari Koivisto - 2020...
OpenChain Webinar #11 - Open Source Issues Remediation - Jari Koivisto - 2020...
 
Managing OSS license obligations
Managing OSS license obligationsManaging OSS license obligations
Managing OSS license obligations
 
Spring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionSpring Roo Add-On Development & Distribution
Spring Roo Add-On Development & Distribution
 
Tips and best practices for Docker
Tips and best practices for DockerTips and best practices for Docker
Tips and best practices for Docker
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
 
Preparing your dockerised application for production deployment
Preparing your dockerised application for production deploymentPreparing your dockerised application for production deployment
Preparing your dockerised application for production deployment
 
Oracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version ControlOracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version Control
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 
Git preso to valtech cfml team
Git preso to valtech cfml teamGit preso to valtech cfml team
Git preso to valtech cfml team
 
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 ...
 

Recently uploaded

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

License compliance in embedded linux with the yocto project

  • 1. License Compliance in Embedded Linux with the Yocto Project Paul Barker, Beta Five Ltd
  • 3. About Me • Involved in Yocto Project since 2013 • Work across the whole embedded stack • Managing Director & Principal Engineer @ Beta Five Ltd • Contact: paul@betafive.co.uk • Website: https://www.betafive.co.uk/
  • 4. Disclaimer • This is not legal advice • Best practices are given based on my experience as a developer and an open source community member • If in doubt, consult an appropriate lawyer
  • 5. About This Talk • Best practices and pitfalls to avoid – Build system agnostic • License Compliance in Yocto Project – Available tools – Ongoing and future work – Comparisons with other projects • Other relevant projects
  • 6. Not Covered Here • DRM/Tivo-isation concerns • How to interpret licenses – What do we need to provide in each case?
  • 7. Why Care? • Selling an embedded device typically involves distribution of open source software • This carries the risk of legal action if not done properly • Doing this right gives you standing in the community
  • 8. Another Reason Why • You should be retaining full sources anyway! • Need to be able to rebuild old releases with minor changes – For debugging – To satisfy customer requests • Sources often disappear from the internet
  • 10. The Fundamentals • Provide license text and notices (BSD, MIT, etc) – On device? – In documentation? – On website? • Provide Complete Corresponding Source (GPL) – Published directly? – Via an offer letter?
  • 11. The Distributed Image • This is the image that’s actually distributed • For devices: What is on the device when it is shipped to a customer? • For downloads: What is in the file a customer downloads?
  • 12. Single Command Build • Probably the most important practice • Reduces human error in build/release process
  • 13. Test Your Releases! • Your build/release process is non trivial • It needs tests! – Check for expected artifacts – Check inside tarballs as well – Check you can rebuild from source releases • Automate your tests
  • 14. Use Your Build System • Build the Distributed Image with Yocto Project, Buildroot, etc • Avoid modifying this image in a post-build script – Lose access to the tools in your build system – Easy to break license compliance this way • You can move, copy, compress, etc the image in a post-build script
  • 15. Factory Test • What happens on device between initial image programming and distribution? • On-device package management at this stage complicates things – Again, very easy to break license compliance • Try to limit additional data added at this stage – Configuration data, calibration data, etc is fine
  • 16. Proprietary Components • License compliance also means not releasing source for proprietary components – You need some filtering • Test for accidental release! • May be useful to have a separate pure open source image
  • 17. Source Patches • Remember to include these with sources • Watch out for hidden patches – Use of sed or similar tools in recipes or build scripts • Make sure your system records the patch order
  • 18. Recipes and Build Scripts • GPLv2 says to include “scripts used to control compilation and installation” • This may include full Yocto Project layers & bitbake, full buildroot tree, etc as appropriate • There are different interpretations here – IANAL
  • 19. Using Desktop/Server Distros • Just say no • Difficult to audit license compliance • Difficult to provide all required source code
  • 20. Docker • A Dockerfile is not the Complete Corresponding Source for an image • You may not even know exactly what is installed in your base image (FROM statement) • Watch out when using containers in Embedded Linux
  • 21. Pre-compiled Toolchains • E.g. ARM toolchain, Linaro toolchain – Built around gcc, glibc, etc • Libraries from this toolchain typically end up in the distributed image • Remember to capture the source code for this – May not be well automated
  • 22. Language-Specific Package Managers • E.g. NPM, Cargo, etc • These are often trash on fire – May not support offline compilation well – May not offer an easy way to get the license text and/or correct source for dependencies • You need to do your own research here
  • 23. Other Insanities • Watch out for unadvertised network access in Makefiles or other build scripts – May download additional sources with different license conditions – May use online tools during build process, breaking offline builds • Every sin you can think of exists in a project Makefile somewhere
  • 24. Metadata Bugs • Licenses given in recipes may be incorrect or incomplete – This does happen! • Follow stable updates where possible • For major commercial projects you should do your own verification – Fossology can be useful here
  • 26. Metadata in Yocto Project Recipes • LICENSE – SPDX License Identifiers used these days • LIC_FILES_CHKSUM – Catches changes in license
  • 27. Metadata Advice • Avoid `LICENSE = “CLOSED”` – Give your proprietary license a name and include it – CLOSED disables license checksum verification • Avoid `SRCREV = “AUTOREV”` in releases – Too easy to mismatch images and released source – Rebuilding the image in several months may give a different result
  • 28. Common Licenses • LICENSE_PATH is a space separated list of directories to search for generic license text • A layer can have its own directory for license text – Extend LICENSE_PATH in layer.conf • Use this instead of `CLOSED` or `Proprietary` licenses if possible
  • 29. Unique Licenses • NO_GENERIC_LICENSE allows license text to be copied from the package source – Set `LICENSE = “blah”` – Set `NO_GENERIC_LICENSE[blah] = “blah_license.txt”` • Use this rather than ignoring warnings – Makes it easier to audit and to capture license text properly later
  • 30. Capturing License Text • Copy or tarball `tmp/deploy/licenses` • Should do this after a clean build • May require some manual post-processing
  • 31. Including License Text in an Image • Set `COPY_LIC_MANIFEST = “1”` • Set `COPY_LIC_DIRS = “1”` • Places files into /usr/share/common-licenses
  • 32. License Packages • Set `LICENSE_CREATE_PACKAGE = “1”` • Creates a package `${PN}-lic` for each recipe • Places license text in /usr/share/licenses • Provides an upgrade path for license text – COPY_LIC_DIRS does not provide this
  • 33. Capturing Source Code • Two possible approaches here – Shipping the downloads directory – Using the archiver • Archiver is more flexible – Supports filtering by license and recipe type – Configurable to fit your legal advice
  • 34. Shipping the Downloads Directory • Set `BB_GENERATE_MIRROR_TARBALLS = “1”` – Enables the mirroring of git repositories • Build an image – Should be a clean build • Copy or tarball the downloads directory – You can exclude `.done` files and version control subdirectories
  • 35. Shallow Mirror Tarballs • By default, git mirror tarballs contain full history • Set the following to enable: – `BB_GIT_SHALLOW = “1”` – `BB_GENERATE_SHALLOW_TARBALLS = “1”` • Can save a lot of space in a mirror – 7.5 GB -> 1 GB in one recent project
  • 36. Using the Archiver • Set `INHERIT += “archiver”` and choose the mode: – `ARCHIVER_MODE = “original”` – `ARCHIVER_MODE = “patched”` – `ARCHIVER_MODE = “configured”` • Other options – Original source -> patched source diff – Recipe files
  • 37. Copyleft Filtering • COPYLEFT_LICENSE_INCLUDE – Defaults to `GPL* LGPL* AGPL*` • COPYLEFT_LICENSE_EXCLUDE – Defaults to `CLOSED Proprietary` • COPYLEFT_RECIPE_TYPES – Defaults to target only – Can add native, nativesdk, cross, crosssdk, cross-canadian
  • 38. Providing Layers • The best way to capture recipes and patches • Publish as much of your layers as possible – Either as tarballs or full git repositories – Add them to the layer index if they’re open source (https://layers.openembedded.org) • Isolate proprietary recipes from open source recipes
  • 39. Local Configuration • When providing layers, watch out for changes in local.conf • Two possible solutions: – Version control local.conf – Capture local.conf as part of the build • Also consider including bblayers.conf
  • 40. SDK/ESDK Distribution • An SDK is just a different type of image – Built from packages • The ESDK is different – Built from sstate – May contain files which aren’t usually packaged • If using the archiver, make sure to extend COPYLEFT_RECIPE_TYPES
  • 41. INCOMPATIBLE_LICENSE • Allows recipes to be excluded by license – Prevents accidental inclusion of unwanted code • Applies to target packages only • meta-gplv2 layer may be needed if excluding GPL 3.0 or later
  • 42. License Flags • Another method of excluding recipes by license class • May be used to highlight non-copyright issues such as required patent licenses • Set LICENSE_FLAGS_WHITELIST to enable flagged recipes
  • 43. SPDX File Creation • SPDX is a standard data exchange format for software manifests • Supported in Yocto Project by meta-spdxscanner layer • Uses DoSOCSv2 or a Fossology Server to perform analysis
  • 44. Recent Improvements • Per-image INCOMPATIBLE_LICENSE • Devtool and recipetool have improved license handling • Several license metadata fixes
  • 45. WIP: Mirror Archiver • The capture of Complete Corresponding Source must be testable • The best test is a full rebuild – Even better as support for reproducible builds improves • Current archiver modes do not support this
  • 46. WIP: Mirror Archiver (2) • Supports split (directory per package) or combined (single directory) mirror creation • Uses the fetcher in bitbake to capture SRC_URI items – Like grabbing the downloads directory but supports copyleft filtering • Allows further filtering of SRC_URI – E.g. You can exclude `file://` URIs if you’re also providing layers
  • 47. WIP: License Information Bundle • Single license info artifact per image • HTML format – Two sections: Packages and common licenses – License text in <pre> tags – Suitable for use in documentation • Can also be compressed and installed into an image
  • 49. Comparison with Buildroot • Buildroot has `make legal-info` – Well documented – Less configurable than Yocto Project but still pretty good – Captures original sources, patches and license text • Packages can be excluded by setting `<PKG>_REDISTRIBUTE = NO`
  • 50. Comparison with OpenWRT • Can’t find license compliance documentation for OpenWRT • This needs improvement
  • 51. Other Projects: Fossology • Run license, copyright and export control scans • Automated scanning process with support for manual correction • Command line and Web UI interfaces • A Linux Foundation project
  • 52. Other Projects: OpenChain Project • Improving license compliance across software supply chains • Defines a specification and a training curriculum • Conformance certification to build trust • A Linux Foundation project
  • 53. Other Projects: Software Heritage • Collects and preserves software source code • Indexed at source file level and searchable by SHA1 hash • Allows submission by web interface or API • An Inria project – French national research institute for the digital sciences