Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here https://mariadb.com/kb/en/the-community-is-chaining-upns-via-authentication_options-when-using-the-gs/ a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and what he actually needs is a plugin supporting Active Directory group membership. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token.
The proposed syntax
GROUP prefix
CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' |
CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' |
SID prefix
CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) |
CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WD' #well-known SID 2 letter prefix (WD=world, Everyone) |
The lookup by SID was suggested by users in the above mentioned KB discussion, will perform slightly better, performance-wise, and won't need lookups in the AD. SID potentially can also be used with Unix kerberos, in case AD is used (i.e Linux or Mac join Windows domain) , there will be membership data in kerberos ticket in this case.
The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string.
Implementation
The GROUP: prefix will cause need group name to SID transation (LookupAccountName, which can cause roundtrip to AD)
the SID: prefix will cause string SID to binary SID translation (ConvertSidStringToSid)
Once the SID is here, server impersonates the SSPI context,checks membership via CheckTokenMembership() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR
Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how CheckTokenMembership() works)
Note also, that CheckTokenMembership checks for ENABLED flags in current token groups. The practical implication is that to use "GROUP:Administrators in the UAC environment, client process must run elevated ("as Administrator")
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | In Progress [ 3 ] |
Description |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. Obviously, this is the SSPI/Windows specific functionality, and not the Unix GSSAPI but still a good and useful functionality, in my opinion. |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax GROUP prefix CREATE USER root IDENTIFIED VIA gssapi as "GROUP:Administrators" SID prefix CREATE USER root IDENTIFIED VIA gssapi as "SID: S-1-5-32-544" (usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as "SID:WO" (well-known SID 2 letter prefix) Implementation The GROUP: prefix will cause need group name to SID transation (LookupAccountName, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (ConvertSidStringToSid) Once the SID is here, server impersonates the SSPI context,checks membership via CheckMembership() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how CheckMembership works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
Description |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax GROUP prefix CREATE USER root IDENTIFIED VIA gssapi as "GROUP:Administrators" SID prefix CREATE USER root IDENTIFIED VIA gssapi as "SID: S-1-5-32-544" (usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as "SID:WO" (well-known SID 2 letter prefix) Implementation The GROUP: prefix will cause need group name to SID transation (LookupAccountName, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (ConvertSidStringToSid) Once the SID is here, server impersonates the SSPI context,checks membership via CheckMembership() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how CheckMembership works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:SQL} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} SID prefix {code:SQL} CREATE USER root IDENTIFIED VIA gssapi as 'SID: S-1-5-32-544" # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as "SID:WO" #well-known SID 2 letter prefix {code} Implementation The GROUP: prefix will cause need group name to SID transation (LookupAccountName, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (ConvertSidStringToSid) Once the SID is here, server impersonates the SSPI context,checks membership via CheckMembership() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how CheckMembership works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
Labels | Windows |
Component/s | Platform Windows [ 10138 ] |
Labels | Windows |
Description |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:SQL} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} SID prefix {code:SQL} CREATE USER root IDENTIFIED VIA gssapi as 'SID: S-1-5-32-544" # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as "SID:WO" #well-known SID 2 letter prefix {code} Implementation The GROUP: prefix will cause need group name to SID transation (LookupAccountName, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (ConvertSidStringToSid) Once the SID is here, server impersonates the SSPI context,checks membership via CheckMembership() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how CheckMembership works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID: S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WO' #well-known SID 2 letter prefix {code} The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (LookupAccountName, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (ConvertSidStringToSid) Once the SID is here, server impersonates the SSPI context,checks membership via CheckMembership() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how CheckMembership works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
Description |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID: S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WO' #well-known SID 2 letter prefix {code} The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (LookupAccountName, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (ConvertSidStringToSid) Once the SID is here, server impersonates the SSPI context,checks membership via CheckMembership() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how CheckMembership works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID: S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WO' #well-known SID 2 letter prefix {code} The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckMembership _works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
Description |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID: S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WO' #well-known SID 2 letter prefix {code} The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckMembership _works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WO' #well-known SID 2 letter prefix {code} The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckMembership _works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
Description |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and he needs plugin supporting AD (or local) Groups. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WO' #well-known SID 2 letter prefix {code} The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckMembership _works) Note also, that CheckMembership checks for "enabled" flags in current token groups. The practical implication is that to use "GROUP:Administrators", in the UAC environment, the client process must run elevated ("as Administrator") |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here https://mariadb.com/kb/en/the-community-is-chaining-upns-via-authentication_options-when-using-the-gs/ a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and what he actually needs is a plugin supporting Active Directory group membership. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WO' #well-known SID 2 letter prefix {code} The lookup by SID was suggested by users in the above mentioned KB discussion, will perform slightly better, performance-wise, and won't need lookups in the AD. SID potentially can also be used with Unix kerberos, in case AD is used (i.e Linux or Mac join Windows domain) , there will be membership data in kerberos ticket in this case. The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckMembership _works) Note also, that CheckMembership checks for ENABLED flags in current token groups. The practical implication is that to use "GROUP:Administrators in the UAC environment, client process must run elevated ("as Administrator") |
Summary | GSSAPI plugin - support AD or local group name on Windows | GSSAPI plugin - support AD or local group name , and SIDs on Windows |
Description |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here https://mariadb.com/kb/en/the-community-is-chaining-upns-via-authentication_options-when-using-the-gs/ a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and what he actually needs is a plugin supporting Active Directory group membership. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WO' #well-known SID 2 letter prefix {code} The lookup by SID was suggested by users in the above mentioned KB discussion, will perform slightly better, performance-wise, and won't need lookups in the AD. SID potentially can also be used with Unix kerberos, in case AD is used (i.e Linux or Mac join Windows domain) , there will be membership data in kerberos ticket in this case. The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckMembership _works) Note also, that CheckMembership checks for ENABLED flags in current token groups. The practical implication is that to use "GROUP:Administrators in the UAC environment, client process must run elevated ("as Administrator") |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here https://mariadb.com/kb/en/the-community-is-chaining-upns-via-authentication_options-when-using-the-gs/ a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and what he actually needs is a plugin supporting Active Directory group membership. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WD' #well-known SID 2 letter prefix (WD=world, Everyone) {code} The lookup by SID was suggested by users in the above mentioned KB discussion, will perform slightly better, performance-wise, and won't need lookups in the AD. SID potentially can also be used with Unix kerberos, in case AD is used (i.e Linux or Mac join Windows domain) , there will be membership data in kerberos ticket in this case. The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckMembership _works) Note also, that CheckMembership checks for ENABLED flags in current token groups. The practical implication is that to use "GROUP:Administrators in the UAC environment, client process must run elevated ("as Administrator") |
Description |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here https://mariadb.com/kb/en/the-community-is-chaining-upns-via-authentication_options-when-using-the-gs/ a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and what he actually needs is a plugin supporting Active Directory group membership. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WD' #well-known SID 2 letter prefix (WD=world, Everyone) {code} The lookup by SID was suggested by users in the above mentioned KB discussion, will perform slightly better, performance-wise, and won't need lookups in the AD. SID potentially can also be used with Unix kerberos, in case AD is used (i.e Linux or Mac join Windows domain) , there will be membership data in kerberos ticket in this case. The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckMembership _works) Note also, that CheckMembership checks for ENABLED flags in current token groups. The practical implication is that to use "GROUP:Administrators in the UAC environment, client process must run elevated ("as Administrator") |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here https://mariadb.com/kb/en/the-community-is-chaining-upns-via-authentication_options-when-using-the-gs/ a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and what he actually needs is a plugin supporting Active Directory group membership. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WD' #well-known SID 2 letter prefix (WD=world, Everyone) {code} The lookup by SID was suggested by users in the above mentioned KB discussion, will perform slightly better, performance-wise, and won't need lookups in the AD. SID potentially can also be used with Unix kerberos, in case AD is used (i.e Linux or Mac join Windows domain) , there will be membership data in kerberos ticket in this case. The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckTokenMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckTokenMembership _works) Note also, that CheckTokenMembership checks for ENABLED flags in current token groups. The practical implication is that to use "GROUP:Administrators in the UAC environment, client process must run elevated ("as Administrator") |
Description |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here https://mariadb.com/kb/en/the-community-is-chaining-upns-via-authentication_options-when-using-the-gs/ a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and what he actually needs is a plugin supporting Active Directory group membership. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WD' #well-known SID 2 letter prefix (WD=world, Everyone) {code} The lookup by SID was suggested by users in the above mentioned KB discussion, will perform slightly better, performance-wise, and won't need lookups in the AD. SID potentially can also be used with Unix kerberos, in case AD is used (i.e Linux or Mac join Windows domain) , there will be membership data in kerberos ticket in this case. The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckTokenMembership_() API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckTokenMembership _works) Note also, that CheckTokenMembership checks for ENABLED flags in current token groups. The practical implication is that to use "GROUP:Administrators in the UAC environment, client process must run elevated ("as Administrator") |
The GSSAPI plugin only accepts user if username matches, which for some use might be too restrictive.
Here https://mariadb.com/kb/en/the-community-is-chaining-upns-via-authentication_options-when-using-the-gs/ a user struggles to move from MySQL Windows authentication (which is GSSAPI, under the hood, mostly), and what he actually needs is a plugin supporting Active Directory group membership. This is easily done since on the server side we will get a user's token, and group membership is easily derived from the token. The proposed syntax *GROUP prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:Administrators' CREATE USER root IDENTIFIED VIA gssapi as 'GROUP:BUILTIN\\Administrators' {code} *SID prefix* {code:sql} CREATE USER root IDENTIFIED VIA gssapi as 'SID:S-1-5-32-544' # usual SID form) CREATE USER everyone IDENTIFIED VIA gssapi as 'SID:WD' #well-known SID 2 letter prefix (WD=world, Everyone) {code} The lookup by SID was suggested by users in the above mentioned KB discussion, will perform slightly better, performance-wise, and won't need lookups in the AD. SID potentially can also be used with Unix kerberos, in case AD is used (i.e Linux or Mac join Windows domain) , there will be membership data in kerberos ticket in this case. The GROUP: or SID: prefixes are case-sensitive, and there should not be any extra spaces in the string. *Implementation* The GROUP: prefix will cause need group name to SID transation (_LookupAccountName_, which can cause roundtrip to AD) the SID: prefix will cause string SID to binary SID translation (_ConvertSidStringToSid_) Once the SID is here, server impersonates the SSPI context,checks membership via _CheckTokenMembership()_ API, then impersonation is reverted, and the returns result of the check as CR_OK or CR_ERROR Note , that neither GROUP name nor SID need to be actual group in AD or local computer. It can be the name or SID of the user (this is just how _CheckTokenMembership()_ works) Note also, that _CheckTokenMembership_ checks for ENABLED flags in current token groups. The practical implication is that to use "GROUP:Administrators in the UAC environment, client process must run elevated ("as Administrator") |
Assignee | Vladislav Vaintroub [ wlad ] | Sergei Golubchik [ serg ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Fix Version/s | 10.6.0 [ 24431 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Assignee | Sergei Golubchik [ serg ] | Vladislav Vaintroub [ wlad ] |
Resolution | Fixed [ 1 ] | |
Status | In Review [ 10002 ] | Closed [ 6 ] |
Summary | GSSAPI plugin - support AD or local group name , and SIDs on Windows | GSSAPI plugin - support AD for local group name , and SIDs on Windows |
Workflow | MariaDB v3 [ 114605 ] | MariaDB v4 [ 134350 ] |
@serg , I understand that most of the Windows internal stuff might be uninteresting, but I'd like to have a feedback on functionality, as well as on suggested syntax with GROUP: and SID: prefixes.