-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine project goals #3
Comments
This is super important for rust binary security and I'm overjoyed that someone's working on this! I believe that once this is finished, release engineers can combine this with Guix's Rust bootstrap to have bootstrappable+reproducible builds, effectively mitigating "Trusting Trust".
|
@dongcarl some what you mentioned calls to mind some important goals this tool should have (IMO):
|
@tarcieri Glad I somewhat helped 😄. However, I feel like I'm missing a bit of context here. Esp. w/re interactions with reproducible builds in |
@dongcarl that's the basic idea, yes. The idea is to provide an easy-to-use, cargo-driven workflow which leverages the ongoing work in |
Hmmm... Perhaps not relevant, but off the top of my head w/re testing for reproducibility, one thing that needs to be in the design is how we'll represent the "inputs" (perhaps source code + deps + build-tool versions + build configuration) to the build and its outputs such that they're easily comparable without bit-for-bit diffing. In this context, I think this project''s overall invariant to be maintained is that the same inputs produce the same outputs. I believe that sha256 would work well to represent both the inputs and the outputs. (This is what NixOS and Gitian does I believe) What would need to be spec'd out is the exact structure of the preimage or what exactly constitutes the "input", as in we need to decide what the input hash "commits" to and the exact ordering. |
Excellent point! Somewhat related to this is @Shnatsel's rust-audit tool, which is capable of embedding/extracting (via the unpublished Perhaps this is a question for @Shnatsel, but it seems to me like it'd be nice if his tool could be extended to include all parameters needed to reproduce a build, e.g. by collecting a manifest of those parameters and serializing them as another TOML file to also include in the resulting binary. Another important question is: what's an exhaustive list of those parameters, and which ones can presently be supplied/overridden when |
I've worked on reproducible rust as part of the reproducible builds project, from my point of view there's mostly one issue left that would need some love (besides occasional regressions and issues in crates): rust-lang/cargo#5505 With that patch in place we're always going to get the same binary with a plain
I think the 1st one could be addressed by interfacing with rustup, the 2nd one by making I think auditable has a different scope, for reproducible builds we must have access to the source tar ball anyway which means we have a copy of the I'm not sure a specific subcommand is needed since the 3rd step is most likely too much work and everything else can be done with vanilla cargo, but I would love to hear some specific usecases that I might be missing. :) |
That's all great to hear, and given that it certainly sounds like much of the suggested project scope I gave earlier is unnecessary. Given that it seems like the utility of a Do any of those approaches sound interesting to you @kpcyrd? Does anything I just said overlap with existing efforts in Cargo proper? Regarding this:
What I had in mind specifically was a tool intended to act on a Cargo project's source tree, be it in git, a tarball, or what have you. I suppose the simple solution to eliminating |
This has probably already been raised but I couldn't find it in this discussion. Note that for example Rust's procedural macros could expand to non-deterministic code during compilation. The compiler is certainly not going to be able to reason about the internal workings of procedural macros they are used pervasively within the Rust ecosystem and people won't stop using them. Do you have any ideas about how you could solve this? |
I can only offer the "Doctor, it hurts when I try to make reproducible builds of programs with nondeterministic procedural macros" solution of: If you want your build to reproducible, all parts of it must be deterministic, including procedural macros. I would suggest filing a bug against the dependency with nondeterministic codegen. |
Based on the discussion above, I propose a
Longer term it might be nice to get rid of the dependency on reprotest, but for me it seems like an OK way to start. Does this approach sound good to everyone? |
@tarcieri Sorry been quiet for a bit. I'm reading thru the comments and I want to understand what the diff between |
@dongcarl that's what I'm proposing after discovering the current state of reproducibility of cargo builds. Still curious what people think about that. If people feel that's worthwhile, it'd be good to enumerate specifically what's needed. I'm thinking things like:
|
If we had a tool that could pin point where we're introducing non-determinancy that would be great. If it could point the finger at an offending crate that would seem like a good start to me. |
At a high level, the goal of this project is to make it easy to develop software in Rust which, when compiled, can be independently verified to determine that a given binary was produced from a particular source code input.
To accomplish this, compiling Rust code must produce byte-for-byte identical results given a particular source code input, allowing multiple third parties to come to a consensus on a “correct” result.
How exactly this should be accomplished is debatable, and this issue is a place to discuss potential designs.
See the previous Secure Code WG issue on this topic for more background:
rust-secure-code/wg#28
Prior Art
The text was updated successfully, but these errors were encountered: