-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Integrating attestation verification into brew install
(and brew verify
)
#17019
Comments
See also #16543 for the prior phase of this 🙂 |
How difficult would it be to support verifying attestations natively in Ruby? I'd prefer to avoid needed |
Thanks @woodruffw!
Should probably default to an empty/unset variable being false rather than handling
Should probably be
👍🏻
I think it's less about the time and more about just gradual ramp-up based on bugs/issues/performance regressions seen. Generally these things go through:
I think this is fine while the ENV variable is opt-in or for the
Sounds good, assuming the performance overhead here is minimal. |
I'm OK relying on I'm less OK with doing so unconditionally as we've generally been moving away from arbitrary external tools (beyond guaranteed system-provided tools on macOS). See past efforts of: moving from But a lot of this can be "questions for later". I was going to point out |
I strongly agree, although unfortunately the answer to "how difficult" is currently "very difficult" -- verifying an attestation here requires a full Sigstore verifier implementation, and there currently isn't a suitable native Ruby one that's ready for use here. The closest implementation is probably the one that the RubyGems folks have been working on (they have similar native-Ruby-only requirements), but IIUC they're still in active development as well and probably aren't ready for downstream dependencies yet.
Makes sense! I was using shorthand here; I figure this would go in
Makes sense. To align this and @carlocab's comment: is the thought that users would have to explicitly If so, that makes sense to me (in the sense that it does an end-run around the bootstrapping problem) and IMO is an acceptable solution until we can vendor-in a pure Ruby attestation verifier. My proposal with that:
|
Also: re: |
This might be an interesting watch. We don't necessarily have to move quickly here. If this route looks dead later in the year we can re-evaluate options but it seems worthwhile watching that space as a potential way forward removing the env-gate. If RubyGems needs/likes any input/contributions from me then I'm happy to do that too. |
I think it'd be OK for it to install |
I'd be ok as a |
Paging @segiddins 🙂
Sounds good! We'll make that explicit. |
https://github.com/segiddins/sigstore-cosign-verify should almost be usable! |
I've opened #17049 with the first bits of this: that PR adds |
#17049 seems to work well, but verifying attestations seems a bit slow:
Note: bottle pre-fetched so download time is not included |
Yeah, I think there's some low hanging fruit that I can optimize here: |
FYI, trying to run
This is likely because |
Thanks for catching that! Looking at it now. Edit: I was able to reproduce this:
|
@carlocab I think your theory is right: Edit: Opened #17106 with a prospective fix. |
Updates:
(This puts us within ~600ms of non-verifying |
A variant of the bootstrapping bug is when the user does
The fix should be straightforward here: we shouldn't bootstrap Edit: For recordkeeping purposes: I'll fix this today. |
Details in Homebrew 4.3.0 annoncement: https://brew.sh/2024/05/14/homebrew-4.3.0/ Related links: Homebrew/brew#17019 https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/
Details in Homebrew 4.3.0 annoncement: https://brew.sh/2024/05/14/homebrew-4.3.0/ Related links: Homebrew/brew#17019 https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/
This comment was marked as off-topic.
This comment was marked as off-topic.
You're not missing anything, it just isn't supported yet 🙂. We need some way for 3p taps to communicate that they're fully attested, which in effect will probably require a new piece of tap metadata. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Not stale, still tracking remaining items. |
#17692 expands the current verification beta to include people with developer flags set. |
Hi, just FYI if user have signed in to GitHub Enterprise on
|
That particular issue should have already been fixed. Let me know which version you're running ( |
@Bo98 unfortunately the log was from last week and I have since logged out and homebrew could have been updated since then. I have tried to reinstall xz and everything seems to be working fine now. Thanks! |
@woodruffw Just as an FYI more than anything, it turns out if you have an older
|
Thanks -- I have #17926 open to specialize the error in that case, but it popped off my stack 😅 -- I'll set aside some time tomorrow to address the comments there. |
@woodruffw Thanks! Bo's comment seems sound, I don't know if there's many of us kicking around with a custom |
This comment was marked as off-topic.
This comment was marked as off-topic.
tl;dr If you are getting THE ERROR, then you need to do brew upgrade gh before you do brew upgrade or brew upgrade anything_else |
Verification
brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.Provide a detailed description of the proposed feature
I'm opening this to begin the discussion/design review process for the final piece of the build provenance work that we (@josephsweeney and I) have been doing.
For context:
Combined, this means that every currently reachable bottle in
homebrew-core
either has a direct attestation or a fallback "backfill" attestation.The next step from here is to actually verify these attestations, which is what is proposed below 🙂
Proposal
TL;DR variant:
BREW_VERIFY_ATTESTATIONS
environment config, which will default tofalse
during the beta period.BREW_VERIFY_ATTESTATIONS=true
,brew install
will additionally perform verification of each bottle's attestation as it gets downloaded (or reused from cache).BREW_VERIFY_ATTESTATIONS
, the separatebrew verify [formulae ...]
command will allow users to explicitly verify bottle(s) by their formulae names.The above technical elements will be implemented by myself and @josephsweeney, primarily by integrating our MVP
brew verify
implementation here: https://github.com/trailofbits/homebrew-brew-verify. We will make sure this implementation is suitable for both API and CLI use (i.e., so that it can be used as part ofbrew install
's steps as well as with a stand-alonebrew verify
invocation).Outstanding considerations
gh
CLI, meaning thatBREW_VERIFY_ATTESTATIONS=true
will require a bootstrapping phase withbrew install gh
or similar to start. Should this be hash-pinned or similar?What is the motivation for the feature?
This feature was previously reviewed and approved by the Homebrew TSC and leadership at the 2023 and 2024 AGMs.
How will the feature be relevant to at least 90% of Homebrew users?
During the beta period (i.e.
BREW_VERIFY_ATTESTATIONS=false
), this will have no effect on Homebrew users besides those who choose to explicitly enable it.Once enabled by default, this will enable build provenance (modulo the backfill) verification for every bottle in
homebrew-core
, changing Homebrew's bottle integrity guarantee from "it matches a known digest" to "it matches a known digest and it was produced on Homebrew's own CI/CD."What alternatives to the feature have been considered?
None.
The text was updated successfully, but these errors were encountered: