mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
s3-libads Default to NOT using the server-supplied principal from SPNEGO
This principal is not supplied by later versions of windows, and using it opens up some oportunities for man in the middle attacks. (Becuase it isn't the name being contacted that is verified with the KDC). This adds the option 'client use spnego principal' to the smb.conf (as used in Samba4) to control this behaivour. As in Samba4, this defaults to false. Against 2008 servers, this will not change behaviour. Against earlier servers, it may cause a downgrade to NTLMSSP more often, in environments where server names are not registered with the KDC as servicePrincipalName values. Andrew Bartlett
This commit is contained in:
parent
10441ed83d
commit
bb7806283e
@ -3306,6 +3306,7 @@ bool lp_use_mmap(void);
|
|||||||
bool lp_unix_extensions(void);
|
bool lp_unix_extensions(void);
|
||||||
bool lp_use_spnego(void);
|
bool lp_use_spnego(void);
|
||||||
bool lp_client_use_spnego(void);
|
bool lp_client_use_spnego(void);
|
||||||
|
bool lp_client_use_spnego_principal(void);
|
||||||
bool lp_hostname_lookups(void);
|
bool lp_hostname_lookups(void);
|
||||||
bool lp_change_notify(const struct share_params *p );
|
bool lp_change_notify(const struct share_params *p );
|
||||||
bool lp_kernel_change_notify(const struct share_params *p );
|
bool lp_kernel_change_notify(const struct share_params *p );
|
||||||
|
@ -664,10 +664,12 @@ static ADS_STATUS ads_generate_service_principal(ADS_STRUCT *ads,
|
|||||||
the principal name back in the first round of
|
the principal name back in the first round of
|
||||||
the SASL bind reply. So we guess based on server
|
the SASL bind reply. So we guess based on server
|
||||||
name and realm. --jerry */
|
name and realm. --jerry */
|
||||||
/* Also try best guess when we get the w2k8 ignore
|
/* Also try best guess when we get the w2k8 ignore principal
|
||||||
principal back - gd */
|
back, or when we are configured to ignore it - gd,
|
||||||
|
abartlet */
|
||||||
|
|
||||||
if (!given_principal ||
|
if (!lp_client_use_spnego_principal() ||
|
||||||
|
!given_principal ||
|
||||||
strequal(given_principal, ADS_IGNORE_PRINCIPAL)) {
|
strequal(given_principal, ADS_IGNORE_PRINCIPAL)) {
|
||||||
|
|
||||||
status = ads_guess_service_principal(ads, &p->string);
|
status = ads_guess_service_principal(ads, &p->string);
|
||||||
|
@ -1279,10 +1279,9 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we get a bad principal, try to guess it if
|
/* We may not be allowed to use the server-supplied SPNEGO principal, or it may not have been supplied to us
|
||||||
we have a valid host NetBIOS name.
|
|
||||||
*/
|
*/
|
||||||
if (strequal(principal, ADS_IGNORE_PRINCIPAL)) {
|
if (!lp_client_use_spnego_principal() || strequal(principal, ADS_IGNORE_PRINCIPAL)) {
|
||||||
TALLOC_FREE(principal);
|
TALLOC_FREE(principal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,6 +338,7 @@ struct global {
|
|||||||
bool bClientNTLMv2Auth;
|
bool bClientNTLMv2Auth;
|
||||||
bool bClientPlaintextAuth;
|
bool bClientPlaintextAuth;
|
||||||
bool bClientUseSpnego;
|
bool bClientUseSpnego;
|
||||||
|
bool client_use_spnego_principal;
|
||||||
bool bDebugPrefixTimestamp;
|
bool bDebugPrefixTimestamp;
|
||||||
bool bDebugHiresTimestamp;
|
bool bDebugHiresTimestamp;
|
||||||
bool bDebugPid;
|
bool bDebugPid;
|
||||||
@ -1398,6 +1399,15 @@ static struct parm_struct parm_table[] = {
|
|||||||
.enum_list = NULL,
|
.enum_list = NULL,
|
||||||
.flags = FLAG_ADVANCED,
|
.flags = FLAG_ADVANCED,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.label = "client use spnego principal",
|
||||||
|
.type = P_BOOL,
|
||||||
|
.p_class = P_GLOBAL,
|
||||||
|
.ptr = &Globals.client_use_spnego_principal,
|
||||||
|
.special = NULL,
|
||||||
|
.enum_list = NULL,
|
||||||
|
.flags = FLAG_ADVANCED,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.label = "username",
|
.label = "username",
|
||||||
.type = P_STRING,
|
.type = P_STRING,
|
||||||
@ -5711,6 +5721,7 @@ FN_GLOBAL_BOOL(lp_use_mmap, &Globals.bUseMmap)
|
|||||||
FN_GLOBAL_BOOL(lp_unix_extensions, &Globals.bUnixExtensions)
|
FN_GLOBAL_BOOL(lp_unix_extensions, &Globals.bUnixExtensions)
|
||||||
FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego)
|
FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego)
|
||||||
FN_GLOBAL_BOOL(lp_client_use_spnego, &Globals.bClientUseSpnego)
|
FN_GLOBAL_BOOL(lp_client_use_spnego, &Globals.bClientUseSpnego)
|
||||||
|
FN_GLOBAL_BOOL(lp_client_use_spnego_principal, &Globals.client_use_spnego_principal)
|
||||||
FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups)
|
FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups)
|
||||||
FN_LOCAL_PARM_BOOL(lp_change_notify, bChangeNotify)
|
FN_LOCAL_PARM_BOOL(lp_change_notify, bChangeNotify)
|
||||||
FN_LOCAL_PARM_BOOL(lp_kernel_change_notify, bKernelChangeNotify)
|
FN_LOCAL_PARM_BOOL(lp_kernel_change_notify, bKernelChangeNotify)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user