1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-24 13:57:43 +03:00

140243 Commits

Author SHA1 Message Date
Stefan Metzmacher
2dba2a31c2 python:tests/krb5: let create_trust() take {ingress,egress}_claims_tf_rules
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Feb 24 10:28:02 UTC 2025 on atb-devel-224
2025-02-24 10:28:02 +00:00
Stefan Metzmacher
b1348ad288 python:tests/krb5: let create_trust() take forest_info
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:38 +00:00
Stefan Metzmacher
322827f792 python:tests/krb5: let modified_ticket() to take modify_{tkt,enc}_fn
This makes it possible modify the public ticket part well as the enc part.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:38 +00:00
Stefan Metzmacher
fabf0d1565 python:tests/krb5: add remove_pac_buffers()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:38 +00:00
Stefan Metzmacher
bcd1157983 python:tests/krb5: set_pac_claims with claims=[] should be an empty blob
Review with: git show -w

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:38 +00:00
Stefan Metzmacher
b78af64446 python:tests/krb5: let set_pac_sids() replace the requester_sid
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:38 +00:00
Stefan Metzmacher
a7349dd363 python:tests/krb5: add set_pac_names() to modify the names in a pac
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:38 +00:00
Stefan Metzmacher
5ab87a840f python:tests/krb5: give KerberosTicketCreds a basic __str__() function
This makes debugging easier...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:37 +00:00
Stefan Metzmacher
559bcd0c33 python:tests/krb5: let create_ccache[_with_ticket] use the correct crealm
It can be different from the servers realm.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:37 +00:00
Stefan Metzmacher
ab8473dd41 python:tests/krb5: allow get_service_ticket() to fail with expected_status
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:37 +00:00
Stefan Metzmacher
188da46637 python:tests/krb5: add KerberosTicketCreds.set_srealm()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24 09:27:37 +00:00
Stefan Metzmacher
154875244c s3:testparm: make it clear that 'client use krb5 netlogon' is experimental
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15815

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Feb 24 08:43:55 UTC 2025 on atb-devel-224
2025-02-24 08:43:55 +00:00
Stefan Metzmacher
5fc5f90dee samba-tool/testparm: make it clear that 'client use krb5 netlogon' is experimental
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15815

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2025-02-24 07:39:38 +00:00
Stefan Metzmacher
54514ad809 docs-xml/smbdotconf: make it clear that 'client use krb5 netlogon' is experimental
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15815

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2025-02-24 07:39:38 +00:00
Stefan Metzmacher
4926da6977 s4:kdc: split access check preparation from the actual check in samba_kdc_update_pac()
This allows us to add more access checks later...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Feb 22 23:04:04 UTC 2025 on atb-devel-224
2025-02-22 23:04:04 +00:00
Stefan Metzmacher
4f67f1a686 s4:kdc: let samba_kdc_get_claims_blob() check msDS-EgressClaimsTransformationPolicy
For now we only allow the implicit (default) or explicit allow all
policy, as well as a deny all policy.

For all others we return an error in order to indicate the
non-supported configuration.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
2e00821766 s4:kdc: let samba_kdc_get_claims_data() check msDS-IngressClaimsTransformationPolicy
For now we only allow the implicit (default) or explicit deny all
policy.

For all others we return an error in order to indicate the
non-supported configuration.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
df30d95694 s4:kdc: also fetch msDS-[In|E]gressClaimsTransformationPolicy
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
0da3bb7feb s4:dsdb/common: add dsdb_trust_get_claims_tf_policy()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
a99ce6c560 s4:kdc: let samba_kdc_update_pac() always call samba_kdc_get_upn_info_blob()
There's no reason not to regenerate it, it makes the code more
consistent.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
a1a0609da2 s4:kdc: let samba_kdc_update_pac() always call samba_kdc_get_logon_info_blob()
The logic in samba_kdc_get_logon_info_blob() also does
talloc_zero(tmp_ctx, DATA_BLOB) followed by calling
samba_get_logon_info_pac_blob().

So we can always just call samba_kdc_get_logon_info_blob().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
c8b08ee508 s4:kdc: also pass override_resource_groups to samba_kdc_get_logon_info_blob()
This will make the following changes easier...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
6cd0297ffe s4:kdc: move device_{info,claims}_blob generation in samba_kdc_update_pac()
We should generate the device blobs after generating the client blobs
and also after all access checking.

We also use the samba_kdc_get_claims_blob() helper,
which is currently only a wrapper around
claims_data_encoded_claims_set(), but that will change in future...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
914533d38f s4:kdc: regenerate the client claims blob in samba_kdc_update_pac() if needed
Note that samba_kdc_get_claims_data() already handles the
samba_kdc_entry_pac_issued_by_trust() case to clear the
claims received from a trusted domain.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
e5591fd0b9 s4:kdc: let samba_kdc_get_claims_data() indicate if regeneration is needed
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
ff5548e4e1 s4:kdc: rewrite the logic in samba_kdc_get_claims_data()
We should also go via samba_kdc_get_claims_data_from_pac()
if the pack was issued by a trust. But for now we still
clear the claims, which is the default if
msDS-IngressClaimsTransformationPolicy is missing
on the trustedDomain object.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
93c69dfeb5 s4:kdc: let samba_kdc_get_claims_data_from_pac() return if a buffer was found
This will simplify further changes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
3b6ffb47b4 s4:kdc: let samba_kdc_get_pac() use samba_kdc_get_claims_blob()
We should avoid calling claims_data_encoded_claims_set() directly,
we'll have to do more than claims_data_encoded_claims_set() in future,
so make sure we always go via the common samba_kdc_get_claims_blob()
helper.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
72459f690e s4:kdc: let samba_kdc_get_claims_blob() take struct claims_data as input.
It means samba_kdc_update_pac() does not call
samba_kdc_get_claims_data_from_db() twice,
as it's already called by samba_kdc_get_claims_data().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
5ada7c17b7 s4:kdc: let samba_kdc_update_pac() always fetch the user claims
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
4f5be1cd78 s4:kdc: let samba_kdc_update_pac() use samba_kdc_entry_pac_valid_principal() to check delegated_proxy
This might not be needed, but it's more consistent.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
51d7db7e9f s4:kdc: remove useless samba_kdc_get_user_info_dc() from samba_kdc_get_device_info_blob()
There's no need to call it again if the caller already did.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
94e77288dc s4:kdc: move user_info_dc_shallow_copy variable in samba_kdc_update_pac()
This is only needed as tmp variable in the if block...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
593b9c2e9c s4:kdc: move samba_kdc_get_user_info_dc() for the device in samba_kdc_update_pac()
We should can already call this in the 'need_device' branch, then
it can be reused later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
9fda646adb s4:kdc: move samba_kdc_get_user_info_dc() up in samba_kdc_update_pac()
This will make further changes easier.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
8e0b132c08 s4:kdc: introduce need_device helper variable in samba_kdc_update_pac()
Also use samba_kdc_entry_pac_valid_principal() in order to catch
all conditions for a valid device. For principals issued by
trusted domains there's no device.entry pointer!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
e55caa68a5 s4:kdc: make samba_kdc_get_{user_info_dc,claims_data} static
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
55c47104c1 s4:kdc: pass samba_kdc_entry_pac to samba_kdc_check_s4u2proxy_rbcd()
This simplifies and unifies the callers.

For the MIT kdc we avoid using via kerberos_pac_to_user_info_dc()
directly.

Now both go via samba_kdc_get_user_info_dc() and MIT also
handles the samba_kdc_get_claims_data() path.

For the MIT kdc it means kerberos_pac_to_user_info_dc() is now
called via samba_kdc_get_user_info_dc() ->
samba_kdc_get_user_info_from_pac() and it is followed by
authsam_update_user_info_dc() consistently.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
58df2bd733 s4:kdc: move samba_kdc_check_s4u2proxy_rbcd() from db-glue to pac-glue
This will allow us to make more functions static in the next steps.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
4f5946ca0c s4:kdc: make a lot of pac-glue.c functions static
This makes the code base less confusing (at least for me).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
c004c32993 s4:kdc: let mit_samba_get_pac() use samba_kdc_get_pac()
It means we port commit b42fbc78395870c3caa33aa1c9636a59fde9e867 also to the
MIT kdc and enforce authentication policy service restrictions when getting a PAC

We should have this logic only once in order to avoid getting out of
sync between heimdal and MIT regarding the core logic.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
b5628d0f4a s4:kdc: split out samba_kdc_get_pac() from samba_wdc_get_pac()
samba_kdc_get_pac() will be re-used by mit_samba_get_pac() in
the next step.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
ddeb85fd72 s4:kdc: don't return ENOENT from samba_kdc_get_claims_data[_from_pac]
This will matter in the next commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
6e9d54a9eb s4:kdc: use better variable names in samba_wdc_check_client_access()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
4bc5b6f90f s4:auth: avoid talloc_reference in claims_data_encoded_claims_set()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 22:06:39 +00:00
Stefan Metzmacher
2cae470f23 winbindd: find_auth_domain() and find_lookup_domain_from_name() should handle namespaces
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Feb 22 17:03:27 UTC 2025 on atb-devel-224
2025-02-22 17:03:27 +00:00
Stefan Metzmacher
800048c131 winbindd: add find_routing_from_namespace_noinit()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 16:00:36 +00:00
Stefan Metzmacher
2fdb34c508 winbindd: remember ForestTrustInformation in routing_domain->fti
This will be used for sid/name filtering in the following commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 16:00:36 +00:00
Stefan Metzmacher
87bb258a3f s3:passdb: add pdb_filter_hints()
This reveals information about our own domain/forest.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 16:00:36 +00:00
Stefan Metzmacher
5f672b125f s4:rpc_server/lsa: let dcesrv_lsa_lookup_name_account() handle uPNSuffixes
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22 16:00:36 +00:00