-
Notifications
You must be signed in to change notification settings - Fork 752
GUACAMOLE-2057: Add configuration parameters for supporting Kerberos authentication for RDP. #581
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,9 @@ const char* GUAC_RDP_CLIENT_ARGS[] = { | |
| "console-audio", | ||
| "server-layout", | ||
| "security", | ||
| "auth-pkg", | ||
| "kdc-url", | ||
| "kerberos-cache", | ||
| "ignore-cert", | ||
| "cert-tofu", | ||
| "cert-fingerprints", | ||
|
|
@@ -296,6 +299,28 @@ enum RDP_ARGS_IDX { | |
| */ | ||
| IDX_SECURITY, | ||
|
|
||
| /** | ||
| * The authentication package to use based on the underlying FreeRDP support | ||
| * for alternatives to NTML. Currently FreeRDP2 only supports NTLM, while | ||
| * FreeRDP3 introduces support for Kerberos and continues to support NTLM. | ||
| * The default is to negotiate between guacd and the remote server. | ||
| */ | ||
| IDX_AUTH_PKG, | ||
|
Comment on lines
+302
to
+308
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be part of the |
||
|
|
||
| /** | ||
| * When kerberos authentication is in use, the URL of the KDC server to use | ||
| * for ticket validation. If not specified, guacd will use the underlying | ||
| * system's kerberos configuration. | ||
| */ | ||
| IDX_KDC_URL, | ||
|
|
||
| /** | ||
| * When kerberos authentication is in use, the path to the kerberos ticket | ||
| * cache, relative to GUACAMOLE_HOME. If not specified, the default system | ||
| * cache of the underlying system on which guacd is running will be used. | ||
|
Comment on lines
+318
to
+320
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't look to me like the path is evaluated relative to |
||
| */ | ||
| IDX_KERBEROS_CACHE, | ||
|
|
||
| /** | ||
| * "true" if validity of the RDP server's certificate should be ignored, | ||
| * "false" or blank if invalid certificates should result in a failure to | ||
|
|
@@ -832,6 +857,30 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user, | |
| settings->security_mode = GUAC_SECURITY_ANY; | ||
| } | ||
|
|
||
| /* Use kerberos authentication */ | ||
| if (strcmp(argv[IDX_AUTH_PKG], "kerberos") == 0) { | ||
| guac_user_log(user, GUAC_LOG_INFO, "Authentication package: Kerberos"); | ||
| settings->auth_pkg = GUAC_AUTH_PKG_KERBEROS; | ||
| } | ||
|
|
||
| else if (strcmp(argv[IDX_AUTH_PKG], "ntlm") == 0) { | ||
| guac_user_log(user, GUAC_LOG_INFO, "Authentication package: NTLM"); | ||
| settings->auth_pkg = GUAC_AUTH_PKG_NTLM; | ||
| } | ||
|
|
||
| else { | ||
| guac_user_log(user, GUAC_LOG_INFO, "No authentication package requested, defaulting to negotiate."); | ||
| settings->auth_pkg = GUAC_AUTH_PKG_ANY; | ||
| } | ||
|
|
||
| /* Set KDC URL */ | ||
| settings->kdc_url = guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, | ||
| argv, IDX_KDC_URL, NULL); | ||
|
|
||
| /* Set Kerberos cache */ | ||
| settings->kerberos_cache = guac_user_parse_args_string(user, | ||
| GUAC_RDP_CLIENT_ARGS, argv, IDX_KERBEROS_CACHE, NULL); | ||
|
|
||
| /* Set hostname */ | ||
| settings->hostname = | ||
| guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv, | ||
|
|
@@ -1410,6 +1459,8 @@ void guac_rdp_settings_free(guac_rdp_settings* settings) { | |
| guac_mem_free(settings->timezone); | ||
| guac_mem_free(settings->username); | ||
| guac_mem_free(settings->printer_name); | ||
| guac_mem_free(settings->kdc_url); | ||
| guac_mem_free(settings->kerberos_cache); | ||
|
|
||
| /* Free channel name array */ | ||
| if (settings->svc_names != NULL) { | ||
|
|
@@ -1695,6 +1746,29 @@ void guac_rdp_push_settings(guac_client* client, | |
|
|
||
| } | ||
|
|
||
| /* Set the authentication package to use. */ | ||
| switch(guac_settings->auth_pkg) { | ||
|
|
||
| case GUAC_AUTH_PKG_NTLM: | ||
| freerdp_settings_set_string(rdp_settings, FreeRDP_AuthenticationPackageList, "ntlm,!kerberos"); | ||
| break; | ||
|
|
||
| case GUAC_AUTH_PKG_KERBEROS: | ||
| freerdp_settings_set_string(rdp_settings, FreeRDP_AuthenticationPackageList, "!ntlm,kerberos"); | ||
| break; | ||
|
|
||
| case GUAC_AUTH_PKG_ANY: | ||
| freerdp_settings_set_string(rdp_settings, FreeRDP_AuthenticationPackageList, "ntlm,kerberos"); | ||
| break; | ||
|
|
||
| } | ||
|
|
||
| if (guac_settings->kdc_url != NULL) | ||
| freerdp_settings_set_string(rdp_settings, FreeRDP_KerberosKdcUrl, guac_strdup(guac_settings->kdc_url)); | ||
|
|
||
| if (guac_settings->kerberos_cache != NULL) | ||
| freerdp_settings_set_string(rdp_settings, FreeRDP_KerberosCache, guac_strdup(guac_settings->kerberos_cache)); | ||
|
Comment on lines
+1750
to
+1770
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The specific Kerberos code should only be enabled with FreeRDP >= 3.x to avoid compilation errors in 2.x. |
||
|
|
||
| /* Security */ | ||
| freerdp_settings_set_bool(rdp_settings, FreeRDP_Authentication, !guac_settings->disable_authentication); | ||
| freerdp_settings_set_bool(rdp_settings, FreeRDP_IgnoreCertificate, guac_settings->ignore_certificate); | ||
|
|
@@ -1947,6 +2021,29 @@ void guac_rdp_push_settings(guac_client* client, | |
|
|
||
| } | ||
|
|
||
| /* Set the authentication package preferences */ | ||
| switch(guac_settings->auth_pkg) { | ||
|
|
||
| case GUAC_AUTH_PKG_NTLM: | ||
| rdp_settings->AuthenticationPackageList = "ntlm,!kerberos"; | ||
| break; | ||
|
|
||
| case GUAC_AUTH_PKG_KERBEROS: | ||
| rdp_settings->AuthenticationPackageList = "!ntlm,kerberos"; | ||
| break; | ||
|
|
||
| case GUAC_AUTH_PKG_ANY: | ||
| rdp_settings->AuthenticationPackageList = "ntlm,kerberos"; | ||
| break; | ||
|
|
||
| } | ||
|
|
||
| /* Kerberos KDC URL */ | ||
| rdp_settings->KerberosKdcUrl = guac_strdup(guac_settings->kdc_url); | ||
|
|
||
| /* Kerberos ticket cache */ | ||
| rdp_settings->KerberosCache = guac_strdup(guac_settings->kerberos_cache); | ||
|
|
||
| /* Security */ | ||
| rdp_settings->Authentication = !guac_settings->disable_authentication; | ||
| rdp_settings->IgnoreCertificate = guac_settings->ignore_certificate; | ||
|
|
||
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.
Just a typo (NTML > NTLM)