Closed thblt closed 6 years ago
It's pretty exiting that borg
now has an extension. Not too long ago it didn't even have more than a handful of users. :wink:
I am a little busy getting Magit, borg
, epkg
, closql
, and emir
releases ready, so I will comment later.
Just a quick note for those following links :wink:
As a security measure I have already added a command that only clones a package without also installing to allow reviewing a package before any of it is executed. Additionally I plan to show a warning when a user attempts to install an unsafe package and add an option to epkg
to hide all Emacswiki packages.
Hi Jonas, just a friendly remember this issue is still waiting for your feedback :) There's no hurry since I'm still really busy (too, I guess), but knowing what you think would help me get started whenever I can. Thanks!
I guess you're busy, I think I'll just start working on this and send a PR when I've got something done, it will probably be easier to discuss code than ideas :-)
I guess you're busy,
I found some time to work on borg
today, but...
I think I'll just start working on this
...please do that.
A new function
borg-upgrade
orborg-switch-version
would be added, which would prompt the user for a commit or a tag, checkout it, and verify signature (usingsubmodules.DRONE.signingkey
) before building.
Your proposal seems to be centered around this idea. I don't really want to go down that road because I want to keep using Magit directly to do those things. (And then call borg-build
to handle the one part it does not handle. Though in practice I usually skip that too and rely on auto-compile
to rebuild the next time I start Emacs.)
So I think it would be better to build the core functionality first - providing some way to verify signatures and warn about missing/bad signatures. And much of that should probably be implemented in Magit, not Borg. Magit already does support signature verification to some extend, but that could certainly be improved. The list of submodules for example for example could display the signature status for the checked out tips.
While I agree that Borg should allow users to verify the integrity of packages more easily and (optionally) even warn them when departing from the safe path, I don't know how to do it. You have proposed one approach, which I have some doubts about. But that should not keep you from implementing it if you care enough about it. Maybe I will change my mind once I see the implementation. I would however recommend that you make use of hooks (including hooks you have to implement first). That way you could provide this functionality even if end up not merging into Borg (except for the necessary hooks).
Like https://github.com/magit/magit/pull/3451 I am closing this too. I assume that once you have finished that you will start working on this again too, at which point I would be happy to reopen this.
It would be nice if Borg did verify PGP signatures before building/activating a drone. I've included such a feature in a little UI frontend for Borg I've been working on as an Elisp exercise, but I think it could take place in the core instead. I imagine it working this way:
borg-assimilate
would verify if the package is signed after cloning. If it is not, but if the most recent tag on default branch is, it would offer to checkout this tag instead of HEAD.If the git object (tag or commit) is signed with a missing signature, Borg may offer to download the public key.
If a valid signature is found, Borg could offer to add a
submodules.DRONE.signingkey
field with the identifier of the signing key.If no signature can be verified, it would ask the user whether they still want to activate the package, and offer the choice to remove it instead.
borg-clone
would do the same, but won't offer to modify.gitmodules
.A new function
borg-upgrade
orborg-switch-version
would be added, which would prompt the user for a commit or a tag, checkout it, and verify signature (usingsubmodules.DRONE.signingkey
) before building.A new variable,
borg-always-valid-keys
would be introduced, which would store a list of GnuPG key identifiers to consider valid for all packages. This would typically store the ID of the user's own key.Optional: A new variable
borg-verify-signatures-on-initialization
could be introduced, defaulted to nil. If non-nil,borg-initialize
would only activate packages with a valid signature and a clean working-tree. (This is a kind of "paranoia" mode.)If you're interested to have such a feature on Borg, I'd like to work on it.
Thanks for reading this!