9 ms·
How to make Linux more trustworthy
- deleted 10y ago[deleted]
- CiPHPerCoder 10y agoReproducible builds are one of three components necessary to have a secure code delivery system: https://defuse.ca/triangle-of-secure-code-delivery.htm https://defuse.ca/triangle-of-secure-code-delivery.htm That Red Hat and Ubuntu aren't interested in delivering trustworthy software means you shouldn't trust them.
- nickpsecurity 10y agoThis isnt accurate. High-assurance established the requirements by mid-1980's in TCSEC. Wheeler, inventor of reproducible builds, also has the best page for SCM security which describes such methods. Here's what it takes: 1. Build system that only developers can access, review of their submissions, a trusted compiler that turns them into binary, and then signs both binary and source. 2. That source or binary is distributed with its signature over any medium. Add TLS for defense in depth if you want. 3. User checks their against signature to determine if trustworthy. Source they compile themselves if worried about substitution. Now, maybe that repo is compromised. Decentralized checking approach says let them pull source signatures from many other repos that are all building from same source on diverse platforms and such. Go with what (strongest) majority says while reporting inconsistencies. Compile source yourself for sure. Now, the user might not trust the compiler. If repo is trustworthy, then compiler source should be too with bootstrapping done by experts in diverse ways. However, if one really wants compiler verification, they have to both understand the source and turn it to machine code themselved for at least first run. Ive shown here before how to do that increnentally. Looking at above, it boils down to a secure, signed distribution of source code for compiler and app. That's all you need. Reproducible builds can have benefits but arent good enough to stop subversion that will mostly be 0-days in source or attacks on endpoint. They're not necessary to stop MITM attacks given signed distribution of source handles that. They're not necessary to bootstrap major compilers as distros come with scripting or executable tools by default that can be trusted to do initial source. If you cant trust them, your distro should already be considered subverted. There you go. That's about all of it if we're not talking about eliminating code injection from or formal verification of these components. So, strongest repo security they could build should be FOSS's plan. Repo appliances on microkernels or stripped OpenBSD with append-only storage. Signatures (incl key storage) in HSM's or carefully-done embedded boards. Transport node for Internet connection on its own machine with mediation against device-level attacks on host. Old shit. Would work if they just put work into it. Oh yeah: paper backups hidden in various places. As fail-safe. :)
- walterbell 10y agoOpenEmbedded BitBake supports file integrity verification for remote code sources, http://www.yoctoproject.org/docs/2.3/bitbake-user-manual/bitbake-user-manual.html#the-download-fetch http://www.yoctoproject.org/docs/2.3/bitbake-user-manual/bit... File integrity is of key importance for reproducing builds. For non-local archive downloads, the fetcher code can verify SHA-256 and MD5 checksums to ensure the archives have been downloaded correctly. You can specify these checksums by using the SRC_URI variable with the appropriate varflags as follows: SRC_URI[md5sum] = "value" SRC_URI[sha256sum] = "value"
- heavenlyhash 10y agoI love that tools like BitBake support integrity, but I also feel it's not enough to merely support it. We must incentivize it, if not outright require it. Integrity is a property of the whole ecosystem. Our toolchains are complex, and call other tools, and those call yet more tools. Optional "support" at any layer means even though the user might ask for integrity at one level, their security and integrity may be unverified by another layer of tool. If we want integrity from the whole ecosystem, we must demand it from every part. Integrity should be a mandate, not an option.
- walterbell 10y agoMost (all?) OpenEmbedded production recipes already use this mechanism to specify hashes during builds.
- heavenlyhash 10y agoMost isn't enough. "All?" with a question mark isn't enough. Just like one zero-day is enough to totally compromise a system, one unverified source anywhere in a build dependency tree is a great way to land just one RCE, leaving your system precisely as hosed as if you just got hit with a zero-day. :) I saw another blog about the summit the top link reports on discuss this as well -- from https://garbas.si/2016/reproducible-builds-summit-in-berlin.html https://garbas.si/2016/reproducible-builds-summit-in-berlin.... : > As with zero vulnerability days, there should probably be zero reproducibility days.
- hannob 10y agoGood summary, but disappointing reactions from other distros. Just to add some info: In the past few days a couple of people gathered in Berlin to discuss reproducible builds. There were some people from the distributions quoted that they don't show much interest, so maybe there will be more movement than this article suggests. My personal take is that I think there are a few more pieces that are needed for really trustworthy software distribution. I tried to get a grip on that with the idea that we have a chain "upstream repo" - "usptream tarball" - "potentially insecure transport" - "distribution compile" - "package" - "user download". Reproducible builds basically fix the tarball to package way, but there's a lot more. E.g. how does a repo become a tarball? Who's checking that? And how does user a know he has the same software as user b? (This is mentioned at the end of the article with the comments of Joanna Rutkowska. Others have discussed basically the same ideas under the term "binary transparency".)
- cyphar 10y agoHave you taken a look at OBS (openSUSE)? Every package in openSUSE:Factory should have a link or _source script to fetch the archive which is then used for the build, so the source of the source should be transparent.
- kirushik 10y agoIdeally, you shouldn't even upload the sources to the OBS manually at all! Just provide a so called "service" file with an instruction hour to fetch the sources (tarball or git), and everything after that will be handled by BuildService.
- cyphar 10y agoI use disabled services. The _service auto-run magic always makes me feel iffy (it won't work on my local machine for some reason, for example).
- digi_owl 10y agoSadly once one start down that road on find oneself deep down a endless rabbit hole before one know it.
- tombrossman 10y agoI wonder if Canonical could use this to their advantage, now that they are 'taking a stand against unofficial Ubuntu images'.[0] (looking at you, OVH...) It could also go a long way towards addressing concerns that they, as a UK corporation, may now be subject to the Investigatory Powers Act requiring encryption 'back doors' be inserted in communications software.[1] Even if you argue that Ubuntu isn't communication software, they do ship plenty of packages that are. [0]http://insights.ubuntu.com/2016/12/01/taking-a-stand-against-unstable-risky-unofficial-ubuntu-images/ http://insights.ubuntu.com/2016/12/01/taking-a-stand-against... [1]http://www.theregister.co.uk/2016/11/30/investigatory_powers_act_backdoors/ http://www.theregister.co.uk/2016/11/30/investigatory_powers...
- dispose13432 10y agoIs Debian really built on private computers? How is this any more secure than a random PPA/EXE download from the internet?
- yrro 10y agoSource-only uploads have been supported for some time, but they are not yet mandatory. https://wiki.debian.org/SourceOnlyUpload https://wiki.debian.org/SourceOnlyUpload
- dublinben 10y agoWhat is the alternative? Public computers?
- dispose13432 10y agoCentralized computers of reputable projects are much more secure than private computers of individual developers
- eeZah7Ux 10y agoThat's what the Debian buildbots do, plus companies doing their own rebuild. Reproducible builds allow comparing the outputs: they'll have to be identical.
- ryukafalz 10y agoThe source ultimately comes from those developers' computers, though. Do you trust those computers not to tamper with the source? If you do, but you don't trust them not to tamper with the resulting binary - well, that's what reproducible builds are for. If you don't... you've got bigger problems than your build system.
- angry-hacker 10y agoWho reads ALL the source code? If no one, then it doesn't matter where it's built.
- 10y ago
- deleted 10y ago[deleted]
- JonnieCache 10y agoThe other notable thing about deterministic builds is that they are needed for the nix package manager.
- tomberek 10y agoNix has been working on reproducibility: http://nixos.org/nix/ http://nixos.org/nix/
- airesQ 10y agoThis article focus a lot on security, but deterministic builds are also good property to have for other reasons (e.g. it can serve as strong evidence that a new build environment is sound; gives people more trust in the build process).
- koolba 10y ago> Alarmed at the prospect of being unable to trust all 24,000-plus Debian packages, most of which are built on package maintainers’ laptops, the Debian Project has pushed hard over the last three years to make as many packages reproducibly buildable as possible. As of this writing, 91 percent have achieved that goal, and the project hopes to hit 100 percent in 2017. 91% already? That's pretty impressive! I remember when they first started discussing this but haven't tracked the progress at all. Happy to see how far long it's come.
- mikepurvis 10y ago> most of which are built on package maintainers’ laptops Gracious, is that really true? My experience of interacting with Debian/Ubuntu is via launchpad.net, where you push the dsc (source tarball + patches + metadata), and the server takes care of producing binary archives for the supported architectures.
- BuuQu9hu 10y agoFor the most popular architecture amongst developers (amd64 right now, i386 earlier), that was true until the last couple of years where Debian supports source-only uploads.
- rlpb 10y agoUbuntu does source-only uploads. Binaries cannot be uploaded by anyone; everything is built on Launchpad's infrastructure (managed by Canonical). Debian traditionally has done source-and-binary uploads for the maintainer's architecture (usually amd64), and builds for other architectures via the its buildd infrastructure (managed by contributors, AIUI). More recently it is possible to do source-only uploads to Debian now, but I'm told it doesn't work for new packages.
- MR4D 10y agoSeems like package hashes could be stored in a block chain to prevent modification by certain three letter agencies and other non-benign actors.
- hannob 10y agoThat's basically the idea of binary transparency (which is a bit stalled right now, but people are aware that this would be a good move). BT is a complement to reproducible builds, not a replacement.
- andrewflnr 10y agoWell, yeah, obviously you need a deterministic build before you can have a meaningful hash to store on your blockchain.
- heavenlyhash 10y agoDisagree :) We don't need repro to start logging what we build! We should start logging what we build so it's an incentive to get repro results :) Reproducible builds are a pursuit. You can never "prove" yo have them: only keep checking and be vigilant. So it's best to start logging now, and then keep putting in the work to make sure it's "meaningful".
- hyperion2010 10y agoFrom [0] > Of course building everything yourself generally isn't practical. I've been using gentoo for a decade and I'm sad to say that I still can't get to 100% built from source. There is always some useful program out there, or something that I don't want to maintain the build process for, that ends up being a binary that I know nothing about. Getting to 90% is possible. 100% is extremely difficult requires making some hard choices about what software you are going to use. 0. http://sobersecurity.blogspot.co.uk/2016/05/trusting-trusting-trust.html http://sobersecurity.blogspot.co.uk/2016/05/trusting-trustin...
- Taek 10y agoIt's all kind of moot anyway if you are running hardware with blobs (Intel ME, for example). Getting truly to 100% is pretty far away, as frustrating as that is.
- walterbell 10y agoWith major effort, ME has been disabled on Lenovo X230 (Ivy Bridge).
- timonovici 10y agoWhere do you get your information from? AFAIK, it's only has been stripped down to a bare minimum, putting it in some sort of recovery mode - but it can't be erased from the BIOS chip yet.
- eximius 10y agohttps://www.coreboot.org/pipermail/coreboot/2016-September/082049.html https://www.coreboot.org/pipermail/coreboot/2016-September/0...
- timonovici 10y agoI was thinking of this project - https://github.com/corna/me_cleaner https://github.com/corna/me_cleaner This is the one that strips most of the ME (which seems to be Java applets, if I remember correctly Igor Skochinsky's presentation), but there's still the core "OS" in PCH, which loads and executes the applets - we don't know what nefarious things that part of ME might be up to - and it has DMA, and access to the network controller - that's how they remotely wipe HDD's, even without an OS being installed, even without the computer being turned on - that shit is straight out of Orwell's 1984. Telescreen, that's what it is.
- hengheng 10y agoOnce you go full tin-foil hat, you want silicon level validation. And when you find out that isn't really viable, you realize that an open source driver that uses high-level silicon functions isn't all that different from a binary blob.
- cryptarch 10y agoThere's a really interesting open hardware project that's developing a Raspberry Pi competitor, "LowRISC". If they end up fully blob-less (no firmware blobs, open chip designs, open board layout) they're going to be the first group to achieve that ever AFAIK, so I'm on the edge of my seat for it.
- andrewflnr 10y agoI'd heard of lowRISC, didn't really realize that was their goal. That would be phenomenal. Also, I have to ask: is your username a Quantum Thief reference?
- timonovici 10y agoYes, it's a very interesting project. I'm already subscribed to their list, I got on their site accidentally. If they do not succeed, the next best thing is to wait until ARM gets powerful enough, and hope they don't go down the orwellian route, like Intel and AMD.
- alainv 10y agoThat's approaching a chicken-and-egg problem. Other parties are working on verifiable open hardware, but their work is only worth so much if any useful software can be tampered with at multiple other points in the chain. Reproducible builds are an absolutely achievable way of adding trust to that particular step and reducing the overall attack surface. We don't need to live in a world of two extremes, 'curl http:// http:// | sudo bash' or hand-built silicon.
- aseipp 10y agoThe idiotic, reductionist viewpoint that "I have intel ME on my machine so anything and everything that you could ever do is worthless and pointless and moot, trust me on that" is so utterly backwards, such an insane state of denial -- I can't even comprehend it. Until I realize it almost exclusively, in my experience, comes from people who eat tinfoil and have never worked in security. Honestly, I consider it lucky that the people who typically promote this nonsensical bullshit are probably not actually security engineers or researchers, or allowed to do security related work in any way -- because they would be terrible at it with a position like that. Actual security engineers understand that there are things called "threat models" and "tradeoffs" and you can, in fact, measurably improve security in meaningful ways for many systems. You might as well just starve yourself to death because -- hey -- eating is pointless when you could get hit by a bus at any moment. Why prevent your application from having SQL injections? Why not just dump all your customer records and private keys on pastebin? After all, the NSA can just steal those secrets from your computer with some Unicorn Magic, so clearly securing anything is actually pointless.
- jwilk 10y agoReproducible builds is an excellent QA initiative, but let's not overestimate their security benefits. They're maybe going to protect us from random ELF viruses on developers' machines, but not from a targeted attack. Why bother pwning binaries when it's much easier to pwn the source? I mean, it's so easy it's already been done: https://lists.debian.org/20030213165225.GB7379@azure.humbug.org.au https://lists.debian.org/20030213165225.GB7379@azure.humbug....
- nickpsecurity 10y agoLets also remember that its threat model is FBI, CIA, and do on. They mainly exploit vulnerabilities in software or bad configurations. They're quite successful. Repeoducible builds with normal Linux environments isnt going to stop them. Doing it with "hardened" OS's might but incurs the risk that such niche OS gets less security review. So, this post and effort is ultimately misguided if it's about securing computers from nation states. Linux cant be trusted for this job. They need strong, endpoint security with verified source and compilation for that. Likely be console apps with a microkernel OS since labor involved will demand simple system.
- drvdevd 10y agoAlso, lets not forget that it's not just Linux (or any one kernel or OS) that's the issue but also every popular hardware architecture can be expected to be subvertable, especially x86 it would appear. And exploiting these types of bugs is within the capablilities of many non-nation state actors as well at this point.
- nickpsecurity 10y agoOh yeah. It's why you see me pushing things like the GPL'd Leon3 processor (SPARC) that can be implemented on visually-inspectable nodes. Or the 8-16bitters or Forth CPU's if it really needs minimalism. Even open-source EDA tools like Qflow that could use attention from smart OSS contributors.
- linkregister 10y ago
- partycoder 10y agoI am just going to leave this here: https://en.wikipedia.org/wiki/NSAKEY https://en.wikipedia.org/wiki/NSAKEY Linux might not be the most trustworthy but it would be hard to sneak in something like that.
- angry-hacker 10y agoThere is fairly good explanation for this, or no?
- partycoder 10y agoYou won't find it in Linux. Especially by surprise.
- pksadiq 10y ago> "Red Hat has never intentionally inserted a back door in our products, and we have never received a court order to do so," Sure. But that doesn't mean it doesn't contain any backdoors. RedHat (also Fedora, Ubuntu, and many others) kindly accepts non-free binary blobs (in Linux kernel), which may make the system vulnerable with backdoors. Not much people care about software freedom. Most care about "open source." Though it does have some interest in freedom (ie, opening the source, but not freeing), that's not its vital aim. For most, it is money (though they say, quality), and for a few it is power. As long as the majority of the world focuses on money or power, we will see some weakness in security, and freedom (That doesn't mean free software are more secure, but the user have the choice).
- andrewflnr 10y agoSmall details like differences in timestamps or build directories result in different binaries. Why is this even a problem? Did people actually think it was a good idea to have a compiler's binary output depend on incidental crap like this, or did it sneak in somehow?
- madez 10y agoI am also surprised a compiler includes this information into a binary. My expection is that the compiler creates an optimized machine code functionally equivalent to the source code, and nothing else.
- breadbox 10y agoI think a lot of times it just sneaks in. For example, when one of my projects was in alpha state, I added the build timestamp to the `--version` output, so that I could reserve version number changes for actual releases. At that point in time I never thought it would become a debian package, much less that reproducible builds would be a thing someday.
- lelandbatey 10y agoThere are many ways to intentionally compile this kind of information into your binary. It's frequently done to include things like "this binary was compiled on 'x date'", usually for debugging use.
- breadbox 10y agoIt's also worth highlighting that diffoscope.org is an extremely cool tool. This project is worthwhile just for having encouraged its creation.