mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-16 21:23:02 -05:00
Support signed pushes #6265
Closed
opened 2025-11-02 06:50:22 -06:00 by GiteaMirror
·
20 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1.16.0
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.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
type/proposal
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#6265
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @silverwind on GitHub (Nov 7, 2020).
Git supports signing pushes since 2.2.0, we should enable it server side if git is at least that version as it's a backwards-compatible feature. Essentially we need to configure each repo or git globally with:
Maybe the UI can also indicate push signatures, but I guess that can come later.
certNonceSeedcould be set to a hash derived fromsecurity.SECRET_KEY.https://people.kernel.org/monsieuricon/signed-git-pushes
7f7ebe054a/Documentation/RelNotes/2.2.0.txt (L81-L87)@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Nov 8, 2020):
first of all - cheers.
I wanted to ask.
If I already have this enabled on my server, would I have to edit the app.ini config (namely the certNonceSeed value) before upgrading once this option is ready or would it leave .gitconfig unchanged (that is - working as it is)?
@silverwind commented on GitHub (Nov 12, 2020):
I'm actually also wondering what happens if
certNonceSeedchanges on the server. Does anyone know if that will that invalidate anything?@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Nov 12, 2020):
You yourself as the operator would not be able to verify the validity of the old certificates with the new nonce seed.
I think it does not matter if you are just recording the certs or rejecting invalid or unsigned pushes - that's done using the current nonce seed, others would probably barely notice, since they don't have access to the nonce seed in the first place, otherwise they'd be able to forge certs.
Until you need to verify something.
At which point you'd have to recall when exactly you changed it, what was the original (and/or all of the previous values) and go about trying all your different past nonce seeds to see if the cert can finally be verified
So the seed probably shouldn't be changed in a random way as no mechanism to keep track of the changes exists (other than your
pass).Similarly to your GPG key, you don't normally change it every day.
You could maybe change it on a yearly basis knowing when it's done and saving previous values safely.
@silverwind commented on GitHub (Nov 12, 2020):
Right, so ideally we should expose a option to allow users to set their own
certNonceSeedto allow them keep the verifyability of old signatures. If there is no user-defined nonce, generate one derived fromsecurity.SECRET_KEY.I guess if really necessary one could also expose a option to input past nonces for verification purpose, but I think in the general use case we can assume a user either sets their previous nonce or sets none at all, getting the default.
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Nov 12, 2020):
I don't think it works like that.
It's set server-wide, like a TLS cert for a domain/service rather than for the specific user.
It's more of a mechanism for server to keep stateful-ish track of the pushes, really, and (in case you want it) to act on the info.
This would then probably be a non-standard and non-intended use of the thingy, while I agree it's a nice idea.
Still, would probably require more thought on the subject.
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Nov 12, 2020):
I also have no idea how hard resets are solved in the scenario of changed nonce seed, much less of an idea if we consider per-user nonce seed.
Which is probably why IMO it'd be best to first stick to the default, per-server nonce seed that is not supposed to change and maybe experiment later.
@silverwind commented on GitHub (Nov 12, 2020):
I never said per-user nonce. I of course meant per-server (or if a cluster of servers, shared among them).
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Nov 12, 2020):
right, my bad...I got the users part as general instance users, not as Gitea users == instance admins
@silverwind commented on GitHub (Nov 12, 2020):
Yeah, I meant admins, not actual gitea users 😉
@silverwind commented on GitHub (Sep 1, 2021):
So I think we can close this, the preferred way should be to configure it in
/etc/gitconfigand the git server process will pick it up there. Docker users can mount that file into the container. No explicit support from gitea required.@6543 commented on GitHub (Sep 1, 2021):
I think we should at least document it ?
@silverwind commented on GitHub (Sep 2, 2021):
Hmm yes, some docs regarding this and
/etc/gitconfigin general would be nice.@silverwind commented on GitHub (Sep 2, 2021):
Testing this again, I think we can improve the error message seen when signed push is not enabled in gitconfig:
Compare to GitHub which also does not support signed push but does not show the latter two messages:
@a1012112796 commented on GitHub (Nov 9, 2021):
maybe we can provide option to check and block unsigned git push, which is similar with "require signed commits"
@Mikaela commented on GitHub (Jan 16, 2022):
Is the procedure the same for SSH signed pushes or are those even a thing?
Edit: the answer appears to be yes, as long as the server has a SSH-signing capable git version.
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Mar 8, 2022):
I think this is a perfectly valid question, it'd perhaps be nice to have this mentioned in the docs.
@OdinVex commented on GitHub (Mar 9, 2022):
Would prefer to be able to do it over HTTPS if possible.
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented on GitHub (Mar 10, 2022):
I believe there's a confusion, I'll try to clarify.
This thread discusses (commit) push signing methods, which could either be
gpgorssh(you can now sign stuffTM using your ssh keys, too), irrespective of the actual push transfer method used, that could be either SSH or HTTP/HTTPS.@silverwind commented on GitHub (Mar 10, 2022):
Exactly. I think this is a pure documentation issue. It may be possible for gitea to automatically configure
gitif it supports signed pushes, but I'm not sure we have interfaces for doing that.@OdinVex commented on GitHub (Mar 10, 2022):
I wasn't able to get push advertising working, so I've stuck to simple gpgsign-ing.