-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
client certificate validation #21221
Conversation
Hi @lunny, any chance this can be merged soonish? |
I think we need some tests. |
I'm genuinely not sure of the use of this without adding in an authentication layer using the subject layer in the certificate. Is that an intended follow-up to this PR? |
No it is not. For my use-case the simple validation against a specific CA is enough. There's still the usual authentication happening just like now. The main benefit is that, with public reachable services that yet should be limited in access have a secure way of allowing access to such service. A possible attacker couldn't even abuse a security issue within Gitea because the tls connection isn't even established. |
@4xoc Are you still interested in this PR? Could you add a test for it as requested previously? |
What would you like to see being tested here? Generally I'm not to sure what makes sense to really test here, other than maybe validating that |
@lunny Could you clarify what you'd like to see to be tested? |
Looks like it's not easy to have a test for the listening. Then maybe someone could have a manually test. |
@4xoc Could you please resolve the conflicts? I'd then test the feature manually and probably approve the PR |
Personally I don't see added value for this to be implemented in gitea directly if it does not add actual user authentication. This can easily be implemented already using pretty much any reverse proxy in front of gitea |
I think it is okay to offer it directly, not everyone wants to use a reverse proxy. And after all this isn't a lot of code to be added. |
@lafriks I get your point but the scope of doing user authentication is much larger than simply having the TLS engine take care of establishing the secure connection. Personally I don't have the need for authentication with certs thus this isn't part of the PR. I may look into this in the future or if there's genuine interest in that feature. Otherwise I'd not like to add code to authentication that is essentially not used by anyone and turns out to be a security risk in the future because nobody took care of it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the feature manually and it works as expected
When can this finally be merged? The lack of progress is honestly quite annoying for a simple ans small PR like this. It's over a year now that this PR has been opened and every time I rebase it's just getting stale yet again. If something's missing or needs to be done please say so but the sheer lack of communication is unacceptable for such a small change. |
@4xoc reverse proxy in front of gitea can also do client certificate authentication, so I see no added value for gitea if this does not result into actual user authentication. Examples: |
I do not see enough benefit either by introducing this patch without a complete design. For such spacial use case, reverse proxy could do well. |
Hello @4xoc |
Hey @Wizmaster, I'm sorry to say but you're probably too late for the party. I've lost any interest in this PR and will not pick it up anymore mainly because I don't see any chance this change getting through. I'm fully aware this sounds salty and arrogant, but I've got better things to do than chase a small PR for 1y+ to end up getting nowhere. |
No worries @4xoc! I quite understand. |
This PR implements client certificate validation for TLS based web server instances of Gitea. When
CA_FILE
is set in the server section, the contents of that file (one or more PEM encoded CA certs) is used to validate a client certificate sent by the user when establishing the TLS channel. The use of client certificate becomes mandatory once the setting is used for all requests going to the web server.Existing configuration is not affected by this change. It's not expected this breaks anything for users not actively using this new feature.
No information of the client certificate is used for authentication or authorization within Gitea outside the TLS channel. Although it is possible to use certificate information to log in users automatically this is not implemented.