Top Banner
Stretching out for trustworthy reproducible builds Holger Levsen [email protected] Lunar [email protected] FOSDEM’15 2015-01-31 Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 1 / 108
108

Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ... #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Sep 17, 2018

Download

Documents

phamliem
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Stretching out for trustworthyreproducible builds

Holger [email protected]

[email protected]

FOSDEM’152015-01-31

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 1 / 108

Page 2: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

What?

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 2 / 108

Page 3: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

What are reproducible builds?

“reproducible builds”enable anyone to reproduceidentical binary packages

from a given source

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 3 / 108

Page 4: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

“I want to believe”

source binarybuild

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 4 / 108

Page 5: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

“I want to believe”

source binarybuild

free softwarefreedomto study

freedomto run

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 5 / 108

Page 6: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

“I want to believe”

source binarybuild

can be verified can be used

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 6 / 108

Page 7: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

“I want to believe”

source binarybuild

can be verified can be used

prove itto me!

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 7 / 108

Page 8: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Why?

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 8 / 108

Page 9: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Why?

Reproducible builds allow for independent verificationsthat a binary matches what the source intended toproduce.

… and other nice things.

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 9 / 108

Page 10: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

But I’m the developer!

“I know what’s in the binary because I compiled itmyself!”

“I’m an upstanding, careful, and responsible individual!”

“Why should I have to worry about hypothetical risksabout the contents of my binaries?”

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 10 / 108

Page 11: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

But the build machines are secure

How can you be sure?

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 11 / 108

Page 12: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Unpleasant thoughts

We think of software development as a fundamentallybenign activity.

I “I’m not that interesting.”

Users can be targeted through developersKnown successful attacks against infrastructure usedby Linux (2003), FreeBSD (2013)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 12 / 108

Page 13: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Strong motivations

Compromise one computer to get:I Hundreds of millions of other computers?I Every bank account in the world?I Every Windows computer in the world?I Every Linux server in the world?

Compromise one computer is worth:I $100k USD? (Market price of remote 0day)I $100M USD? (Censorship budget of Iran per year)I $4B USD? (Bitcoin market cap)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 13 / 108

Page 14: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

How small can a backdoor be?

OpenSSH 3.0.2 (CVE-2002-0083) – exploitable securitybug (privilege escalation: user can get root)

{Channel *c;

- if (id < 0 || id > channels_alloc) {+ if (id < 0 || id >= channels_alloc) {

log("channel_lookup: %d: bad id", id);return;

}

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 14 / 108

Page 15: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Result of fixing the bug (asm)

cmpl $0x0,0x8(%ebp) cmpl $0x0,0x8(%ebp)js 16 js 16mov 0x4,%eax mov 0x4,%eaxcmp %eax,0x8(%ebp) cmp %eax,0x8(%ebp)jle 30 jl 30mov 0x8(%ebp),%eax mov 0x8(%ebp),%eaxmov %eax,0x4(%esp) mov %eax,0x4(%esp)movl $0x4c,(%esp) movl $0x4c,(%esp)call 25 call 25

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 15 / 108

Page 16: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Result of fixing the bug (asm)

cmpl $0x0,0x8(%ebp) cmpl $0x0,0x8(%ebp)js 16 js 16mov 0x4,%eax mov 0x4,%eaxcmp %eax,0x8(%ebp) cmp %eax,0x8(%ebp)jle 30 jl 30mov 0x8(%ebp),%eax mov 0x8(%ebp),%eaxmov %eax,0x4(%esp) mov %eax,0x4(%esp)movl $0x4c,(%esp) movl $0x4c,(%esp)call 25 call 25

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 16 / 108

Page 17: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Resulting difference in the binaryWhat’s the difference between if (a > b)and if (a >= b) in x86 assembly?

assembly: JLE JL

opcode: 0x7E 0x7C

binary: 01111110 01111100

A single bit!

Other corresponding opcode pairs also differ by just asingle bit (JGE=0x7D, JG=0x7F)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 17 / 108

Page 18: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Result of fixing the bug (hex)Vulnerable Fixed55 89 e5 83 ec28 83 7d 08 0078 0a a1 04 0000 00 39 45 087e 1a 8b 45 0889 44 24 04 c704 24 4c 00 0000 e8 fc ff ffff b8 00 00 0000 eb 35

55 89 e5 83 ec28 83 7d 08 0078 0a a1 04 0000 00 39 45 087c 1a 8b 45 0889 44 24 04 c704 24 4c 00 0000 e8 fc ff ffff b8 00 00 0000 eb 35

Overall file size: approx. 500 kBHolger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 18 / 108

Page 19: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Result of fixing the bug (hex)Vulnerable Fixed55 89 e5 83 ec28 83 7d 08 0078 0a a1 04 0000 00 39 45 087e 1a 8b 45 0889 44 24 04 c704 24 4c 00 0000 e8 fc ff ffff b8 00 00 0000 eb 35

55 89 e5 83 ec28 83 7d 08 0078 0a a1 04 0000 00 39 45 087c 1a 8b 45 0889 44 24 04 c704 24 4c 00 0000 e8 fc ff ffff b8 00 00 0000 eb 35

Overall file size: approx. 500 kBHolger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 19 / 108

Page 20: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

How did this start?

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 20 / 108

Page 21: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Bitcoin’s motivation

Malicious modifications to binaries could result inirrevocable unwanted transfers of bitcoinsIndividual developers could be blamed for suchmodificationsUsers might not believe that a developer’s machinewas hackedReproducible builds therefore protect developers

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 21 / 108

Page 22: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Nothing new though

From: Martin Uecker <[email protected]>Cc: [email protected]: Sun, 23 Sep 2007 23:32:59 +0200

I think it would be really cool if the Debian policy requiredthat packages could be rebuild bit-identical from source.At the moment, it is impossible to independly verify theintegricity of binary packages.

https://lists.debian.org/debian-devel/2007/09/msg00746.html

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 22 / 108

Page 23: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Wouldn’t it be cool?

Debian is the largest collection of free softwareMore than 21,000 source packages“Our priorities are our users and free software”

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 23 / 108

Page 24: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

How?

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 24 / 108

Page 25: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

How?

Record the build environmentReproduce the build environmentEliminate unneeded variations

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 25 / 108

Page 26: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

How:Record the build environment

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 26 / 108

Page 27: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

*.buildinfo

New control file *.buildinfo which records:

Versions of build dependenciesI … and their dependencies

Checksum of the source package.Checksums of the binary packages.

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 27 / 108

Page 28: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Example *.buildinfo

Format: 1.9Build-Architecture: amd64Source: txtorconBinary: python-txtorconArchitecture: allVersion: 0.11.0-1Build-Path: /usr/src/debian/txtorcon-0.11.0-1Checksums-Sha256:a26549d9…7b 125910 python-txtorcon_0.11.0-1_all.deb28f6bcbe…69 2039 txtorcon_0.11.0-1.dsc

Build-Environment:base-files (= 8),base-passwd (= 3.5.37),bash (= 4.3-11+b1),…

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 28 / 108

Page 29: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

How:Reproduce the build environment

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 29 / 108

Page 30: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

snapshot.debian.org

snapshot.debian.org archives every state of theDebian archive.2015-01-29: 28 terabytes of data in almost 17 millionfiles.

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 30 / 108

Page 31: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

srebuild

Thin wrapper around sbuildFind the right archive snapshotInstall packages listed in the *.buildinfo fileStart the build

Status: work in progress

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 31 / 108

Page 32: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

How:Eliminate unneeded variations

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 32 / 108

Page 33: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

General approach

Gitian (Bitcoin, Tor Browser):I Use a VM: same kernel, same user, same build pathI libfaketime

Debian:I Fix the toolsI Fix the build systemsI Work-arounds as last resort

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 33 / 108

Page 34: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

strip-nondeterminism

Normalize various file formatsCurrently handle:

I ar archives (.a)I gzipI Java jarI Javadoc HTMLI ZIP archives

Written in Perl (like dpkg-dev)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 34 / 108

Page 35: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Investigating packages

debbindiff :

Two files → HTMLRecursively unpack archivesSeeks human readability:

I uncompress PDFI disassemble binaries,I unpack Gettext files,I … easy to extend to new file formats

Falls back to binary comparison

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 35 / 108

Page 36: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Test(and test again)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 36 / 108

Page 37: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

reproducible.debian.net: idea

Build the packageRebuild the packageCompare the results

Initially a 10 lines shell script…

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 37 / 108

Page 38: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

reproducible.debian.net: todayDriven by jenkins.debian.net

I announced 2014-09-26

14 jobs defined in 263 LOC of YAMLI 3 build jobs, rescheduled every 2 minutesI Job for auto-schedulingI Jobs to recreate pbuilder base.tgz and debbindiff schrootI Job to update notes and issues from GitI JSON outputI Remaining jobs mostly to create HTML and graphs

13 Shell scripts with 2049 LOC4 Python scripts with 948 LOC

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 38 / 108

Page 39: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

reproducible.debian.net: variations

The second build is different in:

timefile orderingCPU ordering and availabilityhostnameuser & grouplocale

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 39 / 108

Page 40: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

reproducible.debian.net: more goodies

https://reproducible.debian.net/$PACKAGEReproducibility status in tracker.debian.orgPackage sets:

I Essential:yes, build-essentialI 1337 most frequently installed packages (popcon)I Packages installed on Debian machinesI All packages in Tails and their build dependenciesI All packages in Grml and their build dependencies

List of unreproducible packages per maintainer

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 40 / 108

Page 41: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

reproducible.debian.net: not reproducible

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 41 / 108

Page 42: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

reproducible.debian.net: package

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 42 / 108

Page 43: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

reproducible.debian.net: package

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 43 / 108

Page 44: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

reproducible.debian.net: package

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 44 / 108

Page 45: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Experimental “reproducible” toolchain

Test and refine changes to tools used by build systemsCurrently 20 source packagesExamples : dpkg, debhelper, cdbs, libxslt,r-base, gtk-doc, fontforge, …Most patches already submittedgit://git.debian.org/reproducible/$pkg.gitin branch pu/reproducible_builds

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 45 / 108

Page 46: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

reproducible.debian.net overall stats

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 46 / 108

Page 47: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

For those in the back

81.7%More than 17,600 source packages!

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 47 / 108

Page 48: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

For those in the back

81.7%More than 17,600 source packages!

(in our test environment!)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 48 / 108

Page 49: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

What is not tested (yet)

uname outputDay/month/year/proc/cpuinfoMore?

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 49 / 108

Page 50: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Investigated packages

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 50 / 108

Page 51: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 51 / 108

Page 52: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Findings

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 52 / 108

Page 53: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues

Timestamps (recording current time)File order(Pseudo-)randomness:

I Temporary file pathsI UUIDI Protection against complexity attacks

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 53 / 108

Page 54: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues (cont.)

CPU and memory related:I Code optimizations for current CPU classI Recording of memory addresses

Build-pathOthers, eg. locale settings

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 54 / 108

Page 55: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues (cont.)

ExamplesTimestamps added by build systems

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 55 / 108

Page 56: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in static libraries

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 56 / 108

Page 57: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in static libraries (cont.)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 57 / 108

Page 58: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by Maven

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 58 / 108

Page 59: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by PyQt4

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 59 / 108

Page 60: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by Erlang compiler

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 60 / 108

Page 61: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in PE binariesWindows, UEFI, Mono…

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 61 / 108

Page 62: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in Java jar

They are ZIP archives, really.

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 62 / 108

Page 63: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in PHP registry

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 63 / 108

Page 64: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps by a template engine

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 64 / 108

Page 65: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues (cont.)

ExamplesArchives

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 65 / 108

Page 66: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in gzip headers

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 66 / 108

Page 67: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in ZIP archives

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 67 / 108

Page 68: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in tarballs

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 68 / 108

Page 69: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Users and groups in tarballs

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 69 / 108

Page 70: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues (cont.)

ExamplesTimestamps in documentation

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 70 / 108

Page 71: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by Doxygen

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 71 / 108

Page 72: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by docbook-to-man

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 72 / 108

Page 73: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by Ghostscript

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 73 / 108

Page 74: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by Ghostscript (cont.)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 74 / 108

Page 75: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by GNU groff

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 75 / 108

Page 76: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by Javadoc

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 76 / 108

Page 77: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps written by man2html

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 77 / 108

Page 78: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in TeX output (.dvi)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 78 / 108

Page 79: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues (cont.)

Examples“Compiled at/on/by”

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 79 / 108

Page 80: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Build time via C preprocessor macros

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 80 / 108

Page 81: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Build time via C preprocessor macros

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 81 / 108

Page 82: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Build time recorded via Makefile

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 82 / 108

Page 83: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Hostname recorded via ./configure

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 83 / 108

Page 84: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Build time recorded via ./configure

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 84 / 108

Page 85: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

m4 macros for autoconf (build time)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 85 / 108

Page 86: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

m4 macros for autoconf (username)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 86 / 108

Page 87: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

m4 macros for autoconf (hostname)

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 87 / 108

Page 88: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues (cont.)

ExamplesFile ordering

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 88 / 108

Page 89: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

File ordering in python-support files

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 89 / 108

Page 90: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues (cont.)

ExamplesRandomness

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 90 / 108

Page 91: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Random Perl hash orderSee Algorithmic complexity attacks in perlsec(1).

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 91 / 108

Page 92: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Random serial numbers in Ogg streams

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 92 / 108

Page 93: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Identified issues (cont.)

ExamplesEven more timestamps!

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 93 / 108

Page 94: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in PNGEven images!

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 94 / 108

Page 95: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Timestamps in TrueType font files

And fonts!

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 95 / 108

Page 96: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Please help!

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 96 / 108

Page 97: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Please help!

Do not record time, username, hostname, kernelversion…

I … or make it optional.

Sort file paths.Sort dictionary keys.Merge our patches!

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 97 / 108

Page 98: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Bugs filed

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 98 / 108

Page 99: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Help Debian?

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 99 / 108

Page 100: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Help Debian?Inventory issuesMake packages build reproduciblyFix known common issues:

I Get reproducible PE binaries;I Random filenames with GCC;I …

Hack Debian archive infrastructureI Store and distribute *.buildinfo files (#763822)I …

Hack tools to display local packages reproducibilitystatus

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 100 / 108

Page 101: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Contributors

akira Hans-Christoph Steiner Peter De WachterAndrew Ayer Helmut Grohne Reiner HerrmannAsheesh Laroia Holger Levsen Stefano RiveraChris Lamb (lamby) josch Stéphane GlonduChris West Lunar Steven ChamberlainDaniel Kahn Gillmor Mattia Rizzolo Tom FitzhenryDavid Suarez Niels Thykier Tomasz BuchertDrew Fisher Niko Tyni WookeyGuillem Jover Paul Wise Ximin Luo

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 101 / 108

Page 102: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Stay in touch

Subscribe to the ReproducibleBuilds wiki pages.Mailing lists:

I [email protected] [email protected]

Join #debian-reproducible on irc.oftc.net

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 102 / 108

Page 103: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Other distributions

Fedorahttp://securityblog.redhat.com/2013/09/18/reproducible-builds-for-fedora/OpenSUSE build-comparehttps://build.opensuse.org/package/show/openSUSE:Factory/build-compareNixOShttp://lists.science.uu.nl/pipermail/nix-dev/2013-June/011357.html

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 103 / 108

Page 104: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Reproducible Fedora?

No known activity after the initial blog post.Fedora is leading developments for key components.Can we help reproducible Fedora?

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 104 / 108

Page 105: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

SLES? OpenBSD? Firefox? LibreOffice?We hope reproducible builds will become the norm.Our documentation should be helpful to others.Come talk to us!

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 105 / 108

Page 106: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Future

Ready for the next Debian release (stretch)Reproducible installation mediaReproducible live images (pure Debian, Grml, Tails)Reproducible cross-platform builds (“rebootstrap”)Binary transparency logs: public log of all softwarereleases

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 106 / 108

Page 107: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Thanks

Mike Perry and Seth Schoen for their 31C3 talkProfitbricks for sponsoring jenkins.debian.netGlobalsign for sponsoring X.509 certificatesDesigners of Tango iconsEveryone who helped!

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 107 / 108

Page 108: Stretching out for trustworthy reproducible builds - … · r-base,gtk-doc,fontforge, ...   #debian-reproducibleonOFTC ... Stretching out for trustworthy reproducible builds ...

Questions? Comments?

?https://wiki.debian.org/ReproducibleBuilds

https://reproducible.debian.net/#debian-reproducible on OFTC

Holger B8BF 5413 7B09 D35C F026 FE9D 091A B856 069A AA1C

Lunar 0603 CCFD 9186 5C17 E88D 4C79 8382 C95C 2902 3DF9

Holger & Lunar (Debian) Stretching reproducible builds FOSDEM’15 108 / 108