-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
TLS 1.3 for EAP-TLS, user search by certificate CN #1751
Conversation
419df7e
to
65bc87c
Compare
Looking up user by certificate is not reliable. What if two users have the same certificate? |
@domosekai In any way, if two users have the same cert, then technically the user can and should login as either of theese users, and logging in as the user with the same username as the certificate CN is a valid default, but the expectation under Win is that no other configuration is required for logging in with a certificate... The certificate lookup is implemented as a fallback mechanism only if the username wasn't found. The older mechanism of looking up by username still works, and if a username with the same name as a CN was found (or was overriden in configuration - actually overriding in config is the only way to customize another hub name) it'll use it. |
I am not against the idea generally, but we need to pay attention to the implementation difference.
This is not an assumption in SoftEther and we should not expand our interpretation of the design. A client certificate should bear the username in its CN or UPN. This is true in Windows domain environment and should be true in SoftEther as well unless there is a strong reason. Moreover, Windows client already offers a standard way to override the implied username. Therefore I don't think this function is useful. |
One of the options would be making it behind a configuration flag (false by default, for example). |
I tested on Windows 2022 RRAS. |
Well, on my previous job we used smartcards, and the CN contained the "full name" instead of the "account name" in it. The account name being in the username_un format, while the CN being "Username U. Name". This was used as a domain authentication certificate, and it matched the user just fine (apparently using the E in the format of [email protected]), so there's that. |
Now EAP-TLS 1.3 works by default with Windows 11. EAP-TLS 1.2 works with Windowses which doesn't work with TLS 1.3. PPPD defaults are 1.2, it works with this EAP-TLS rework too (for PPPD 1.3 support refer ppp-project/ppp#388 - I consider it broken for now anyway). VPN Client Pro for Android tries using EAP-TLS 1.3, errors and then downgrades to 1.2, resulting in working authorization too. Honestly, I did probably all I could for supporting different clients. Requesting tests from other clients (eg I don't have any Apple devices to test). |
About the certificate-user matching - I tried to create a certificate with the E field, and it still sends the CN to the server. So there are existings setups where the CN can differ from the actual account name, and the user is matched by certificate. |
Found a way to support PPPD 1.3 without breaking Windows 1.3. The support works the same way as the support for VPN Client Pro was implemented - by iteratively downgrading the TLS specs - first we start in TLS 1.3 mode + Session Tickets, if we fail we downgrade to TLS 1.3 without Session Tickets, if we still fail we downgrade to TLS 1.2. |
* Reworking EAP-TLS flow * Implementing iterative TLS downgrade supporting PPPD TLS 1.3+Tickets, Windows TLS 1.3 w/o Tickets, VPN Client Pro TLS 1.2.
0cf7ffc
to
149096e
Compare
Windows client allows to override the default username inferred from the certificate. It's the recommended way to tackle the problem where CN differs from the real username. |
Matching users by CN is somewhat useful in corporate environment.
However, I would like to keep current/default behaviour as is
…On Tue, Jan 24, 2023, 6:02 AM Yihong Wu ***@***.***> wrote:
Windows client allows to override the default username inferred from the
certificate. It's the recommended way to tackle the problem where CN
differs from the real username.
Again, in SoftEther VPN it's not reliable or secure to lookup user by its
certificate, because unlike in AD, there is no CA function and certificates
cannot represent users.
—
Reply to this email directly, view it on GitHub
<#1751 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ5KUD7W53EY355GTRI2Q3WT4L2ZANCNFSM6AAAAAAUDFE2CU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
So, what do you think about hiding it behind a false by default configuration parameter? |
вт, 24 янв. 2023 г. в 12:20, Evengard ***@***.***>:
So, what do you think about hiding it behind a false by default
configuration parameter?
that would be my choice.
i.e. to keep current behaviour unchanged and introduce new
behaviour/parameter
… —
Reply to this email directly, view it on GitHub
<#1751 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ5KUBWHV73VRBVCLMOXNDWT5YDFANCNFSM6AAAAAAUDFE2CU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'll try to update the PR in the coming days. Admin options seems like a good place for that? |
Now EAP-TLS by default does not match by certificate. This can be enabled by setting allow_eap_tls_match_user_by_cert Admin option of the hub to 1. |
f9f862e
to
ad30011
Compare
…disabled by default
ad30011
to
0a60cdf
Compare
Reworked it to AllowEapMatchUserByCert Extended hub option instead of Admin option. |
c571068
to
26403c7
Compare
A review and a test on different clients (namely MacOS/iOS ones) would be appreciated. |
Never knew, but there's actually a EAP-TLS 1.3 separate RFC! https://www.rfc-editor.org/rfc/rfc9190.html |
I plan to merge it if nobody minds
…On Fri, Jan 27, 2023, 12:28 AM Evengard ***@***.***> wrote:
A review and a test on different clients (namely MacOS/iOS ones) would be
appreciated.
—
Reply to this email directly, view it on GitHub
<#1751 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ5KUCKCBOYRBQFYIJ6U6LWUK65LANCNFSM6AAAAAAUDFE2CU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@chipitsine wait for now please, as I said in the previous message I need to rework it for the RFC conformance. |
Please mark it as draft (and mark back once it is ready)
…On Tue, Jan 31, 2023, 3:38 PM Evengard ***@***.***> wrote:
@chipitsine <https://github.com/chipitsine> wait for now please, as I
said in the previous message I need to rework it for the RFC conformance.
—
Reply to this email directly, view it on GitHub
<#1751 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ5KUHRYPGWRTQQ27KTFZTWVDMRPANCNFSM6AAAAAAUDFE2CU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
3d5baf8
to
d1af75e
Compare
@Evengard . I have an idea. are there other implementations of RFC9190 ? maybe we can have a look and take some automated test cases from those projects ? |
… certificate instead of certificate CN
d1af75e
to
edcdc92
Compare
Not that I am aware of, if it could exist anywhere then probably in IEEE-802.1X, IEEE-802.11 or IKEv2 environments. The PPP project will apparently attempt to implement it as close to the RFC as possible, but that will be sometimes in the future... Anyway, I think I managed to rework it. As I thought, this AppData 0x00 message made the Windows client accept the session tickets. I still kept the downgrade attempt without session tickets just in case. We can remove it though and leave only the TLS 1.3 => TLS 1.2 downgrade instead. The certificate matching was reworked too. It is still behind a virtual hub option, but now it matches not by CNs, but by the certificate itself. If enabled and when the server can't find the identity specified in the EAP Identity flow, it restricts the EAP auth flow to only use EAP-TLS. During the EAP-TLS it tries to find the user with the specified certificate, failing if it can't find it. This certificate matching behaviour seems to be something which would work OK with the privacy shenanigans described by the RFC. Still, disabled by default, as requested. |
Forgot about tested clients. The compability is the same, both Windows and PPPD clients works in both EAP-TLS 1.3 and 1.2 modes, and VPN Client Pro (Android) automatically downgrades to EAP-TLS 1.2 without problems. I still don't have any MacOS/iOS devices. |
can you share steps how do you invoke pppd for testing ? I'll try to automate. it is not a blocker, just side note |
same as myself, windows and android. |
I'm using the SSTP client for that. Debian Testing have the needed package for that.
Invoke it like this (as root): As a side note, without |
And yeah, the PR is ready for a review or merge I guess. |
Fix thread safety after #1751
@Evengard , this PR is merged. I tried to implement automatic pppd testing. so far, I tried your script to check whether sstpc will crash or not without --log-stderr mine did not crash, I tried 1.0.17-1 on Ubuntu 22.04 and I built master branch https://gitlab.com/eivnaes/sstp-client which version is shipped with debian (?) that crashes ? hopefully, I'll be back with automatic testing soon :) |
as for automated testing, it fails with "authentication fails", I'm investingating what I did wrong. however, there's interesting message
why it tries to find |
Surprisingly, I also did compile it from the source code AND both tried to use it from the Debian packages, but I did use it from within WSL2. That may add unexpected things. Maybe it crashed because it failed to find the syslog or smth. As for the openssl.cnf, that is weird, I don't have such a file on my system and it did "Just Work" ©, although I did use the version from Debian repos, maybe they pointed it to the system default /etc/ssl/openssl.cnf. The eap-tls README does mention it though: https://github.com/ppp-project/ppp/blob/master/README.eap-tls (3. Configuration). Is your private key encrypted? I used a decrypted one, for the encrypted it seems to use the openssl.cnf for the decryption key. |
This fixes #1722, restricting the TLS 1.3 only for the EAP-TLS flow. Allowing TLS 1.3 requires more research (more info about that in #1722 (comment)), so a safe choice would be to let it be disabled - it is still treated as highly experimental pretty much everywhere.
As an added bonus, implemented searching a user account by it's certificate CommonName (CN). This is useful when the certificate CN doesn't match the user login in the VPN server, and as the Windows PPP client sends the certificate CN as EAP Identify packet, this fixes the inability to find the user by it's certificate.
Maybe this should also be backported to other protocols relying on cert auth (namely OpenVPN?), but I have no ideas how that works for them (maybe the actual username is still being sent).