-
Notifications
You must be signed in to change notification settings - Fork 524
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
Restore bundled protoc
binary
#725
Comments
I don't think so. Library users should source the Protocol Buffers compiler on their own since it provides more security, which is far more critical than the "ease of use" you are talking about. Having the library fetching automatically the compiler also creates non-hermetic environments and, by default, breaks *semi-*offline builds (CI/CD pipelines are critical and should avoid downloading a lot of stuff directly). In addition, attackers have fewer opportunities to compromise the integrity of the downloaded tool due to them being required to compromise the internal policy of an organization (instead of simply having to compromise the download URI). I can also add that the new behavior is far more idiomatic since developers expect their builds to fail when they are missing the required dependencies. It is possible to forget to configure We could argue that transitive dependencies should be distributed alongside the library (which is the role of Cargo/any dependency management system), however, In conclusion, I do think the recent changes are great steps in the modularization of |
What if there was a helper crate you could depend on, which packages a protobuf compiler? Essentially letting users opt-in to the old behaviour, and it was a separate crate for ease of maintenance. |
I agree with @n1c00o here. People are open to publishing their own crate which bundles the protoc binaries but I don't want that to be a responsibility of the prost project. Its pretty easy to install protoc on your system or compile it from source. Going to close this issue, feel free to re-open if you have any more questions/concerns. |
There are options that don't require you to source prost from the PATH, there are vendored crates available and there is even I do agree that the developer experience did take a hit though I disagree with that its actually that bad. I've had to on many occasions had to install stuff to get crates to build, its quite normal. Openssl does this for example (you can include vendored but then you also have more deps).
When it comes to security I don't think there is even any wiggle room here, being 100% secure in a project is more important than a dev having to do an extra step. Taking a hard stance is extremely important to the health of the ecosystem. That said, ideally, down the line |
Yep. Finding crates that bundle Taking a "hard stance" in security doesn't just create friction, it's less secure. It's well documented that if you force people to change their passwords constantly security gets worse not better, because people get frustrated and sticky-note their password to their computer screen; Rubber Hose Cryptography is a time-tested phenomenon. In this case people are going to copy-paste the first command they find from Google on 'how to install If you just don't want to support downloading |
To circle back on this 6mo later, this change was painful for us, but we dealt with that pain by switching to checking in the generated Rust code. While checking in generated code is aesthetically distasteful, in practice it has been much, much more manageable, and we completely avoid all of these problems. In retrospect we should have done that from the start, and I think a better solution to this rough edge would be to have better documentation about workflows for managing generated Rust code. |
This is certainly an option, but it negates a lot of the benefits you get from using an IDL in the first place. Protobuf loosely links your projects together into a mono-repo, where the interface is defined in As an aside, for a sane approach to how |
As far as I understand, containing unverified binaries that get stored on something like cratesio and get shipped to every computer is a risk. Its better to build your software from source when you can anyways, it builds more confidence and trust. I could probably find you some security papers on this but I don't have the time.
Good I am glad you found something that works for you 😄, prost isn't for everyone.
Yes, this was a failure by me running out of time (burnout) and not properly documenting things. I would love to have some help here on telling people what (I think) is the right way to do code gen in rust. |
I'm in the process of updating from 0.9 to 0.12 after putting it off due to this change which has been fairly painful and I am wondering if anyone has any guidance on the best way to do this. It seems like the reason for removal of Rather than go into the merits of this trade-off, it seems the key missing information is how to increase the likelihood of a user choosing a secure Finally, I will also say that a big part of security comes down to trust and by removing the |
You are not supposed to blindly trust crate authors tho, you always need to verify the code you are importing. The old behavior was making it hard because it relied heavily on the binary being directly provided, which is hard to audit and not a deterministic process (thus breaking a lot of minimal security requirements in general). |
Also you can still use |
Woops, had to delete recent post, got myself confused on which crate was what. Sorry about that. @MJohnson459 You can use https://crates.io/crates/protoc-fetcher I've been using that and it works well. |
version of 0.8 is very nice! i just tried minutes ago. |
Previously,
prost-build
"just worked", by including a bundledprotoc
binary.Now, it does not, because #657 removed the bundled binary, ostensibly to improve the crate's security posture. However, this change degrades the usability of the crate for a rather unclear security benefit: either users have to compile
protoc
from source, which requires them to pull even more build tools and source code (generally tools that are worse than cargo), or they need to fetch a precompiledprotoc
, in which case they're in exactly the same position as they were before, but now the work of determining whichprotoc
binary to use is spread across the entire ecosystem, rather than being in one place (thetonic
crate) where it can be done correctly. So an attacker now has many more opportunities to compromise security, because every part of the ecosystem will have their own bespoke way of sourcingprotoc
.It would be better to restore the previous usability and security story, rather than forcing downstream users to figure out how to safely get a copy of
protoc
on their own.The text was updated successfully, but these errors were encountered: