Skip to content
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

[Security] git verify-commit everywhere #2686

Closed
openoms opened this issue Oct 30, 2021 · 6 comments
Closed

[Security] git verify-commit everywhere #2686

openoms opened this issue Oct 30, 2021 · 6 comments

Comments

@openoms
Copy link
Collaborator

openoms commented Oct 30, 2021

Introducing a script d514402 to verify the checked out git commits with the BTCpay update: #2683

All scripts installing services built from the source code can have a header like:

PGPsigner="nicolasdorier"
PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc"
PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE"

and can run:

# pin version
sudo -u $installingUser git reset --hard $version
# PGP verify
sudo -u $installingUser /home/admin/config.scripts/blitz.git-verify.sh "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1

to reduce trust in the download source.

Failing to verify the PGP signature on the checked commit breaks the installation.

Can implement this on all services as we go on applying the pinned updates.

@nyxnor
Copy link
Contributor

nyxnor commented Oct 30, 2021

YES !!!
If possible, add to SECURITY.md

@Kixunil
Copy link

Kixunil commented Oct 30, 2021

Note that you can run gpg --recv-keys FINGERPRINT and so don't need to specify URL.

Also be mindful of downgrade attacks (an attacker could send a valid old signed version with known vulnerability so that he can then exploit it).

@openoms
Copy link
Collaborator Author

openoms commented Oct 30, 2021

Note that you can run gpg --recv-keys FINGERPRINT and so don't need to specify URL.

yes, but some keys are not shared on the keyservers unfortunately. I find it best when people share it on their own website and then can be double checked in person, on a keyserver and maybe having some verified signatures too from other known entities ("circle of trust").

@Kixunil
Copy link

Kixunil commented Oct 30, 2021

So far all keys I use are on keyserver (Ubuntu), if there are any missing it may be nicer to ask people to share them.
One only needs to check fingerprint, no need to check whole key.

openoms added a commit to openoms/raspiblitz that referenced this issue Nov 8, 2021
keys are downloaded to pgp_keys.asc
imported only from that file and checked for fingerprint
exit status is used to verify signature
discussed in:
raspiblitz#2683
raspiblitz#2686
@rootzoll rootzoll modified the milestones: 1.8 Release, 1.7.2 Release Nov 11, 2021
@rootzoll rootzoll added the final testing was fixed - needs testing label Nov 30, 2021
@rootzoll
Copy link
Collaborator

PR merged for final testing

@rootzoll rootzoll removed the final testing was fixed - needs testing label Feb 17, 2022
@rootzoll
Copy link
Collaborator

Works so far good with RCs .. closing foir release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants