Reproducibly building artifacts that contain embedded signatures
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 28 | |
Author | ||
License | CC Attribution 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/61034 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
NixCon 20225 / 28
10
12
20
21
22
24
25
26
27
00:00
Electronic signatureComputer virusComputer animation
00:15
Exception handlingVisualization (computer graphics)Computer animation
00:28
Graph (mathematics)Sign (mathematics)Graph (mathematics)Arrow of timeCuboidFunction (mathematics)Set (mathematics)Computer animation
00:59
Sign (mathematics)Electronic signatureComputer animation
01:30
Graph (mathematics)Numbering schemeElectronic signatureDeterminismFingerprintDerivation (linguistics)Formal verificationoutputElectronic visual displayDefault (computer science)Computer-generated imageryNetwork topologyDemo (music)CodeComputer virusCollaborationismSign (mathematics)Derivation (linguistics)Electronic signatureKey (cryptography)FingerprintFormal verificationProcess (computing)MereologyNumbering schemeHeegaard splittingFunction (mathematics)Substitute goodSimilarity (geometry)CodeBitMetadataExpected valueVariable (mathematics)State of matterPoint (geometry)InformationComputer animation
Transcript: English(auto-generated)
00:02
All right, hello. I think everybody can hear me. I hope so. My name is Martin Schweighofer. I'm going to talk to you about reproducibly building artifacts with embedded signatures. And the first thing we're gonna look at is a dependency graph, except I'm just kidding.
00:21
That's kind of some visualization of dark matter, so it's not a huge dependency graph, but it could be, right? This is a nicer dependency graph, but we heard a lot about dependency graphs already. It's just kind of where I'm also starting from, so we have some outputs here,
00:40
and then a set of arrows that go into one of those, like the boxes are the outputs, and a set of arrows that goes into one such box is kind of a build step that produces that output, and that's conceptually where we're starting from. And we might have a signing step anywhere in our dependency graph, right? No matter if it's a huge one or a small one,
01:02
there might be a signing step in there, and that's what I'm talking about. So the first thing that doesn't really have to do with signatures is, but it's important, is that we have this nixbuild rebuild command, which lets us rerun individual build steps,
01:21
but it's individual steps, right? So we're not producing the graph again. We're just rerunning the last, the bottom load, right? And there's also, there's a few issues with signatures specifically.
01:40
They might be anywhere in our output artifact embedded somewhere, right? They might be produced by any build steps. Actually, nix is quite nice for reproducibility because we can kind of split up our build into different steps and then deal with reproducibility on an individual step level, which makes things easier.
02:04
But with signatures, our signing step might not be deterministic. That's an issue with some signing schemes. But mostly it's, we probably don't have access to the key, right? So the reason why we're wanting to reproduce an artifact
02:22
is because we don't want to trust the person that's producing it. So we want to be able to do it on our own. And with signatures, that's kind of incompatible, right? And still, if we can't avoid having a signature somewhere, we can still manage that problem
02:40
and that's an improvement. And we can manage that problem by verifying the signatures. And this is something that we can model in nix. So the rough idea is this. We have some unsigned thing that we want to sign and we have a signing step that then produces some unverified artifact. And then we have an explicit verification step
03:02
and then that produces a verified artifact. And the key goes into the signing step but it doesn't go into the verification step. So one derivation for signing and one derivation for verification. And yeah, this means that if we can reproduce the verification step, we don't have to trust
03:21
the signing step any longer. And now let's look at what that can specifically look like in nix, right? So I have some nix code here and it's pretty unsurprising. It just takes the unsigned thing and then runs a command to sign it. This is probably gonna be impure in practice.
03:44
And then outputs the signed artifact. But this is not the full story because here we have a first kind of weird thing which is a load-bearing comment. So this comment is required to make substitution work
04:01
correctly with what I'm constructing here. We're putting the key fingerprint into the derivation here so that substitution will actually only substitute things that have a signature with the correct key fingerprint. And actually, if we were to want to properly do this,
04:21
we would want to verify the signature here as well so that we can't upload something that's signed with the wrong key by mistake. And then the second step, the verification looks kind of similar. It just takes the input, verifies the signature, verifies that it's signed with the correct key that we're expecting.
04:43
And yeah, and if that's the case, then it just passes the output along. But here again, there's a caveat. We would also have to verify that the unsigned thing matches what we expect to really not have to trust the signing derivation anymore.
05:02
And there's a last thing that I did in here which is this environment variable that says Verifies. That's kind of a bit of a magical thing. So it's metadata actually, and it makes the verifying derivation point to the signing derivation. And we can use that information in tools
05:24
so that they can manage this additional information and let us know, oh, hey, this one derivation might not be reproducible, but there's some other derivation that exists that is reproducible, and it verifies what the other one was doing.
05:42
So it's kind of a better state because we can track and manage that part of our build process that is not reproducible. And that's everything that I have. Thanks, everyone. If you have questions, please ask them later on.
06:02
Please say hello. I'd be happy. I'm looking for collaborators on this and other things related to reproducibility. Thanks, everyone.