SlideShare a Scribd company logo
Chris LambChris Lamb
@lolamby@lolamby
chris@reproducible-builds.orgchris@reproducible-builds.org
Speck&TechSpeck&Tech
Trento, ItalyTrento, Italy
26th Febuary, 201926th Febuary, 2019
Debian Project Leader 2017—
OpenSource.org board director
Free so ware developer for 10+ years
Freelance so ware developer
You think you're not a target? A tale of three developers...
Three developers…Three developers…
AliceAlice
You think you're not a target? A tale of three developers...
You think you're not a target? A tale of three developers...
BobBob
← Caro← Caro
Eve →Eve →
You think you're not a target? A tale of three developers...
General problemGeneral problem
Can view source code for malicious flaws
But users install pre-compiled packages
Can we trust the compilation process?
Solution?Solution?
1. Start with the same source
2. Ensure builds always have identical results
3. Compare results
You think you're not a target? A tale of three developers...
You think you're not a target? A tale of three developers...
You think you're not a target? A tale of three developers...
How does this help?How does this help?
Alice → Blackmail will be uncovered
Bob → Compromise detected
Carol → Tampered laptop will be discovered
Reduces incentive to attack in the first place
"Builds with the same dependencies"... ✖
"Reliable" builds... ✖
Identical build results
Wait…Wait…
Dictionary/hash/database ordering
Parallelism in builds
Timestamps
Build paths
Non-deterministic file ordering
Users, groups, umask, environment variables, etc.
Other advantages?Other advantages?
Minimal diffs on "deliberate" changes
Cache ratio — save time, money & CO2
Remove build-dependencies
Finds bugs!
Predictable OpenID secretPredictable OpenID secret
# Build.PL
$build->config_data(OpenIDConsumerSecret=>int(1e15*rand()));
Every installation of this build shares the same secret.
# /usr/share/perl5/GBrowse/ConfigData.pm
{
'OpenIDConsumerSecret' => '639098210478536',
'cgibin' => '/usr/lib/cgi-bin/gbrowse',
'conf' => '/etc/gbrowse',
[..]
},
Random characters in manpages?Random characters in manpages?
-This manual page documents the usageoof WikipediaFS.
+This manual page documents the usage of WikipediaFS.
memcpy(&buf[1], &buf[2], strlen(buf)-1);
memcpy(3): The memory areas must not overlap
- memcpy(&buf[1], &buf[2], strlen(buf)-1);
+ memmove(&buf[1], &buf[2], strlen(buf)-1);
Fails to build 0.46% of the time?Fails to build 0.46% of the time?
x = f(u('abc'), 16)
y = f(u('abc'), 16)
self.assertEqual(sorted(set(x)), [u('a'), u('b'), u('c')])
AssertionError: Lists differ: [u'a', u'b'] != [u'a', u'b', u'c']
(3C2)*(2/3)16 – (3C1)*(1/3)16 =~ 0.46%
Debian & Reproducible BuildsDebian & Reproducible Builds
"Torture test""Torture test"
Time & date
Hostname & domain name
Filesystem (disorderfs)
Timezone & locale
uid & gid
Kernel & CPU type
First rebuild in 2013 24% packages reproducible
March 2018 93% packages reproducible
 
isdebianreproducibleyet.comisdebianreproducibleyet.com
Beyond Debian…Beyond Debian…
coreboot, Fedora, LEDE, OpenWRT, NetBSD, FreeBSD,
Archlinux, Qubes, F-Droid, NixOS, Guix, Meson, etc.
Other projects using "Debian"'s testing framework
Reproducible Builds summits (Athens, Berlin)
# diff -urNad file1 file2
--- file1 2017-06-18 12:37:03.179186661 +0800
+++ file2 2017-06-18 12:37:04.811193648 +0800
@@ -1 +1 @@
-This is the first file.
+This is the second file.
You think you're not a target? A tale of three developers...
You think you're not a target? A tale of three developers...
https://diffoscope.org/
├── aspell-de_20131206-5_all.deb
│ ├── metadata
│ │ rw-r--r-- 0/0 4 Jun 11 16:19 2014 debian-binary
│ │ -rw-r--r-- 0/0 2893 Jun 11 16:19 2014 control.tar.gz
│ │ -rw-r--r-- 0/0 329600 Jun 11 16:19 2014 data.tar.xz
│ │ +rw-r--r-- 0/0 2875 Jun 11 16:19 2014 control.tar.gz
│ │ +rw-r--r-- 0/0 329596 Jun 11 16:19 2014 data.tar.xz
│ ├── control.tar.gz
│ │ ├── control.tar
│ │ │ ├── md5sums
│ │ │ │┄ Files in package differ
│ ├── data.tar.xz
│ │ ├── data.tar
│ │ │ ├── ./usr/lib/aspell/de_affix.dat
│ │ │ │ #
│ │ │ │ -# Version: 20131206 (build 20150801)
│ │ │ │ +# Version: 20131206 (build 20150802)
│ │ │ │ #
│ │ │ ├── ./usr/share/aspell/de-common.cwl.gz
│ │ │ │ ├── metadata
│ │ │ │ │ -gzip compressed data, last modified: Sat Aug 1 18:21
│ │ │ │ │ +gzip compressed data, last modified: Sat Aug 1 18:24
HTML outputHTML output
Android APK files, Android boot images, Ar(1) archives, Berkeley DB database
files, Bzip2 archives, Character/block devices, ColorSync colour profiles (.icc),
Coreboot CBFS filesystem images, Cpio archives, Dalvik .dex files, Debian
.buildinfo files, Debian .changes files, Debian source packages (.dsc), Device Tree
Compiler blob files, Directories, ELF binaries, Ext2/ext3/ext4/btrfs filesystems,
FreeDesktop Fontconfig cache files, FreePascal files (.ppu), Gettext message
catalogues, GHC Haskell .hi files, GIF image files, Git repositories, GNU R
database files (.rdb), GNU R Rscript files (.rds), Gnumeric spreadsheets, Gzipped
files, ISO 9660 CD images, Java .class files, JavaScript files, JPEG images, JSON
files, LLVM IR bitcode files, MacOS binaries, Microso Windows icon files,
Microso Word .docx files, Mono 'Portable Executable' files, Ogg Vorbis audio
files, OpenOffice .odt files, OpenSSH public keys, OpenWRT package archives
(.ipk), PDF documents, PGP signed/encrypted messages, PNG images, PostScript
documents, RPM archives, Rust object files (.deflate), SQLite databases,
SquashFS filesystems, Statically-linked binaries, Symlinks, Tape archives (.tar),
Tcpdump capture files (.pcap), Text files, TrueType font files, XML binary schemas
(.xsb), XML files, XZ compressed files, etc.
try.diffoscope.orgtry.diffoscope.org
Show differences in security uploads
diffoscope ≠ definition of reproducible!
Binary blobs (eg. images for routers / IoT devices)
What's le to do?What's le to do?
Source codeSource code
Programming errors
Backdoors / obfusticated code
Weak algorithms
Code with "testing" modes
$ apt install python-pywt-doc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
python-pywt-doc
0 upgraded, 1 newly installed, 0 to remove and 4 not upgrad
Need to get 102 kB of archives.
After this operation, 978 kB of additional disk space will
WARNING: The following packages are not reproducible!
python-pywt-doc
Install these packages anyway? [y/N]
Toolchain fixes (GCC, Go, R)
Infrastructure changes
Improving developer tools
Mandating Debian packages be reproducible?
Defeating Trusting Trust…?
Get involved!Get involved!
Visit:
Follow: @ReproBuilds on Twitter
Join: #reproducible-builds (OFTC)
reproducible-builds.org
Grazie!Grazie!
@lolamby@lolamby
lamby@debian.orglamby@debian.org
chris-lamb.co.ukchris-lamb.co.uk
reproducible-builds.orgreproducible-builds.org

More Related Content

PDF
Kernel Recipes 2016 - Patches carved into stone tablets...
PPTX
Linux
PDF
Intro to Python programming and iPython
PDF
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
PDF
Quick Guide with Linux Command Line
PDF
UNIX Basics and Cluster Computing
PPT
bh-us-02-murphey-freebsd
PDF
Kernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - Patches carved into stone tablets...
Linux
Intro to Python programming and iPython
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
Quick Guide with Linux Command Line
UNIX Basics and Cluster Computing
bh-us-02-murphey-freebsd
Kernel Recipes 2016 - The kernel report

What's hot (20)

PDF
Browsing The Source Code of Linux Packages
PDF
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
PPTX
Disk forensics for the lazy and the smart
PDF
Embedded Rust – Rust on IoT devices
PPT
securing_syslog_onFreeBSD
PDF
Linux introduction (eng)
PPT
101 4.1 create partitions and filesystems
PDF
Bootkits: Past, Present & Future - Virus Bulletin
PDF
Basic commands
DOCX
Data hiding and finding on Linux
PDF
Security of Linux containers in the cloud
PPT
Basic 50 linus command
PDF
Linux distribution for the cloud
PDF
Docker, Linux Containers (LXC), and security
PDF
Managing your data - Introduction to Linux for bioinformatics
PDF
Debian packaging
PPTX
Linux powerpoint
PPSX
Linux: An Unbeaten Empire
PDF
Linux commands
PDF
AOS Lab 1: Hello, Linux!
Browsing The Source Code of Linux Packages
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Disk forensics for the lazy and the smart
Embedded Rust – Rust on IoT devices
securing_syslog_onFreeBSD
Linux introduction (eng)
101 4.1 create partitions and filesystems
Bootkits: Past, Present & Future - Virus Bulletin
Basic commands
Data hiding and finding on Linux
Security of Linux containers in the cloud
Basic 50 linus command
Linux distribution for the cloud
Docker, Linux Containers (LXC), and security
Managing your data - Introduction to Linux for bioinformatics
Debian packaging
Linux powerpoint
Linux: An Unbeaten Empire
Linux commands
AOS Lab 1: Hello, Linux!
Ad

Similar to You think you're not a target? A tale of three developers... (20)

PDF
Reverse Engineering in Linux - The tools showcase
PDF
The Ultimate Debian Database
PDF
Linux Distribution Automated Testing
PDF
[FOSDEM2023] Bit-for-bit reproducible builds with Dockerfile
PDF
Reproducible Builds on openSUSE
PDF
Sergi Álvarez + Roi Martín - radare2: From forensics to bindiffing [RootedCON...
PDF
Infrastructure as code might be literally impossible / Joe Domato (packageclo...
PDF
Joe Damato
PPT
scaling compiled applications - highload 2013
PDF
Build and deploy scientific Python Applications
ODP
The Gory Details of Debian packages
PDF
Dist::Zilla - Maximum Overkill for CPAN Distributions
PDF
Take a step forward from user to maintainer or developer in open source secur...
PPTX
Impact of Installation Counts on Perceived Quality: A Case Study on Debian
PDF
Filip palian mateuszkocielski. simplest ownage human observed… routers
PDF
Simplest-Ownage-Human-Observed… - Routers
PPT
Simple Bugs and Vulnerabilities in Linux Distributions
ODP
Debian packaging talk, Pysheff sept 2012
TXT
Packages
PDF
Android Variants, Hacks, Tricks and Resources
Reverse Engineering in Linux - The tools showcase
The Ultimate Debian Database
Linux Distribution Automated Testing
[FOSDEM2023] Bit-for-bit reproducible builds with Dockerfile
Reproducible Builds on openSUSE
Sergi Álvarez + Roi Martín - radare2: From forensics to bindiffing [RootedCON...
Infrastructure as code might be literally impossible / Joe Domato (packageclo...
Joe Damato
scaling compiled applications - highload 2013
Build and deploy scientific Python Applications
The Gory Details of Debian packages
Dist::Zilla - Maximum Overkill for CPAN Distributions
Take a step forward from user to maintainer or developer in open source secur...
Impact of Installation Counts on Perceived Quality: A Case Study on Debian
Filip palian mateuszkocielski. simplest ownage human observed… routers
Simplest-Ownage-Human-Observed… - Routers
Simple Bugs and Vulnerabilities in Linux Distributions
Debian packaging talk, Pysheff sept 2012
Packages
Android Variants, Hacks, Tricks and Resources
Ad

More from Speck&Tech (20)

PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
PDF
Persuasive AI: risks and opportunities in the age of digital debate
PDF
Fai da te ed elettricità, con la bobina di Tesla!
PDF
DIY ed elettronica ai tempi dell’università
PDF
Sotto il letto, sopra il cloud: costruirsi un’infrastruttura da zero
PDF
Verze e diamanti: oltre le nanotecnologie
PDF
Respira, sei in Trentino! Monitorare l'invisibile
PDF
Cognitive Robotics: from Babies to Robots and AI
PDF
Edge AI: Bringing Intelligence to Embedded Devices
PDF
Genere e gioco da tavolo: il caso di "Free to Choose"
PDF
SPaRKLE: un rivelatore compatto di radiazioni spaziali, realizzato dagli stud...
PDF
Il ruolo degli stati alterati di coscienza e degli psichedelici nella terapia
PDF
Unity3D: Things you need to know to get started
PDF
Learning from Biometric Fingerprints to prevent Cyber Security Threats
PDF
How do we program a God? - Do the Androids dream of the electric sheep?
PDF
The bad, the ugly and the weird about IoT
PDF
Arduino is Hardware, Software, IoT and Community
PDF
Computational privacy: balancing privacy and utility in the digital era
PDF
Il trucco c'è (e si vede) - Beatrice Mautino
PDF
ScrapeGraphAI: AI-powered web scraping, reso facile con l'open source
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Persuasive AI: risks and opportunities in the age of digital debate
Fai da te ed elettricità, con la bobina di Tesla!
DIY ed elettronica ai tempi dell’università
Sotto il letto, sopra il cloud: costruirsi un’infrastruttura da zero
Verze e diamanti: oltre le nanotecnologie
Respira, sei in Trentino! Monitorare l'invisibile
Cognitive Robotics: from Babies to Robots and AI
Edge AI: Bringing Intelligence to Embedded Devices
Genere e gioco da tavolo: il caso di "Free to Choose"
SPaRKLE: un rivelatore compatto di radiazioni spaziali, realizzato dagli stud...
Il ruolo degli stati alterati di coscienza e degli psichedelici nella terapia
Unity3D: Things you need to know to get started
Learning from Biometric Fingerprints to prevent Cyber Security Threats
How do we program a God? - Do the Androids dream of the electric sheep?
The bad, the ugly and the weird about IoT
Arduino is Hardware, Software, IoT and Community
Computational privacy: balancing privacy and utility in the digital era
Il trucco c'è (e si vede) - Beatrice Mautino
ScrapeGraphAI: AI-powered web scraping, reso facile con l'open source

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Cloud computing and distributed systems.
PPT
Teaching material agriculture food technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
sap open course for s4hana steps from ECC to s4
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
“AI and Expert System Decision Support & Business Intelligence Systems”
The Rise and Fall of 3GPP – Time for a Sabbatical?
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Electronic commerce courselecture one. Pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Cloud computing and distributed systems.
Teaching material agriculture food technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
sap open course for s4hana steps from ECC to s4

You think you're not a target? A tale of three developers...

  • 2. Debian Project Leader 2017— OpenSource.org board director Free so ware developer for 10+ years Freelance so ware developer
  • 12. General problemGeneral problem Can view source code for malicious flaws But users install pre-compiled packages Can we trust the compilation process?
  • 13. Solution?Solution? 1. Start with the same source 2. Ensure builds always have identical results 3. Compare results
  • 17. How does this help?How does this help? Alice → Blackmail will be uncovered Bob → Compromise detected Carol → Tampered laptop will be discovered Reduces incentive to attack in the first place
  • 18. "Builds with the same dependencies"... ✖ "Reliable" builds... ✖ Identical build results
  • 20. Dictionary/hash/database ordering Parallelism in builds Timestamps Build paths Non-deterministic file ordering Users, groups, umask, environment variables, etc.
  • 22. Minimal diffs on "deliberate" changes Cache ratio — save time, money & CO2 Remove build-dependencies Finds bugs!
  • 23. Predictable OpenID secretPredictable OpenID secret # Build.PL $build->config_data(OpenIDConsumerSecret=>int(1e15*rand())); Every installation of this build shares the same secret. # /usr/share/perl5/GBrowse/ConfigData.pm { 'OpenIDConsumerSecret' => '639098210478536', 'cgibin' => '/usr/lib/cgi-bin/gbrowse', 'conf' => '/etc/gbrowse', [..] },
  • 24. Random characters in manpages?Random characters in manpages? -This manual page documents the usageoof WikipediaFS. +This manual page documents the usage of WikipediaFS. memcpy(&buf[1], &buf[2], strlen(buf)-1); memcpy(3): The memory areas must not overlap - memcpy(&buf[1], &buf[2], strlen(buf)-1); + memmove(&buf[1], &buf[2], strlen(buf)-1);
  • 25. Fails to build 0.46% of the time?Fails to build 0.46% of the time? x = f(u('abc'), 16) y = f(u('abc'), 16) self.assertEqual(sorted(set(x)), [u('a'), u('b'), u('c')]) AssertionError: Lists differ: [u'a', u'b'] != [u'a', u'b', u'c'] (3C2)*(2/3)16 – (3C1)*(1/3)16 =~ 0.46%
  • 26. Debian & Reproducible BuildsDebian & Reproducible Builds
  • 27. "Torture test""Torture test" Time & date Hostname & domain name Filesystem (disorderfs) Timezone & locale uid & gid Kernel & CPU type
  • 28. First rebuild in 2013 24% packages reproducible March 2018 93% packages reproducible
  • 29.  
  • 31. Beyond Debian…Beyond Debian… coreboot, Fedora, LEDE, OpenWRT, NetBSD, FreeBSD, Archlinux, Qubes, F-Droid, NixOS, Guix, Meson, etc. Other projects using "Debian"'s testing framework Reproducible Builds summits (Athens, Berlin)
  • 32. # diff -urNad file1 file2 --- file1 2017-06-18 12:37:03.179186661 +0800 +++ file2 2017-06-18 12:37:04.811193648 +0800 @@ -1 +1 @@ -This is the first file. +This is the second file.
  • 36. ├── aspell-de_20131206-5_all.deb │ ├── metadata │ │ rw-r--r-- 0/0 4 Jun 11 16:19 2014 debian-binary │ │ -rw-r--r-- 0/0 2893 Jun 11 16:19 2014 control.tar.gz │ │ -rw-r--r-- 0/0 329600 Jun 11 16:19 2014 data.tar.xz │ │ +rw-r--r-- 0/0 2875 Jun 11 16:19 2014 control.tar.gz │ │ +rw-r--r-- 0/0 329596 Jun 11 16:19 2014 data.tar.xz │ ├── control.tar.gz │ │ ├── control.tar │ │ │ ├── md5sums │ │ │ │┄ Files in package differ │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── ./usr/lib/aspell/de_affix.dat │ │ │ │ # │ │ │ │ -# Version: 20131206 (build 20150801) │ │ │ │ +# Version: 20131206 (build 20150802) │ │ │ │ # │ │ │ ├── ./usr/share/aspell/de-common.cwl.gz │ │ │ │ ├── metadata │ │ │ │ │ -gzip compressed data, last modified: Sat Aug 1 18:21 │ │ │ │ │ +gzip compressed data, last modified: Sat Aug 1 18:24
  • 38. Android APK files, Android boot images, Ar(1) archives, Berkeley DB database files, Bzip2 archives, Character/block devices, ColorSync colour profiles (.icc), Coreboot CBFS filesystem images, Cpio archives, Dalvik .dex files, Debian .buildinfo files, Debian .changes files, Debian source packages (.dsc), Device Tree Compiler blob files, Directories, ELF binaries, Ext2/ext3/ext4/btrfs filesystems, FreeDesktop Fontconfig cache files, FreePascal files (.ppu), Gettext message catalogues, GHC Haskell .hi files, GIF image files, Git repositories, GNU R database files (.rdb), GNU R Rscript files (.rds), Gnumeric spreadsheets, Gzipped files, ISO 9660 CD images, Java .class files, JavaScript files, JPEG images, JSON files, LLVM IR bitcode files, MacOS binaries, Microso Windows icon files, Microso Word .docx files, Mono 'Portable Executable' files, Ogg Vorbis audio files, OpenOffice .odt files, OpenSSH public keys, OpenWRT package archives (.ipk), PDF documents, PGP signed/encrypted messages, PNG images, PostScript documents, RPM archives, Rust object files (.deflate), SQLite databases, SquashFS filesystems, Statically-linked binaries, Symlinks, Tape archives (.tar), Tcpdump capture files (.pcap), Text files, TrueType font files, XML binary schemas (.xsb), XML files, XZ compressed files, etc.
  • 40. Show differences in security uploads diffoscope ≠ definition of reproducible! Binary blobs (eg. images for routers / IoT devices)
  • 41. What's le to do?What's le to do?
  • 42. Source codeSource code Programming errors Backdoors / obfusticated code Weak algorithms Code with "testing" modes
  • 43. $ apt install python-pywt-doc Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: python-pywt-doc 0 upgraded, 1 newly installed, 0 to remove and 4 not upgrad Need to get 102 kB of archives. After this operation, 978 kB of additional disk space will WARNING: The following packages are not reproducible! python-pywt-doc Install these packages anyway? [y/N]
  • 44. Toolchain fixes (GCC, Go, R) Infrastructure changes Improving developer tools Mandating Debian packages be reproducible? Defeating Trusting Trust…?
  • 45. Get involved!Get involved! Visit: Follow: @ReproBuilds on Twitter Join: #reproducible-builds (OFTC) reproducible-builds.org