Skip to content

pam: apply SIDs from PAC to authentication indicators#8571

Open
sumit-bose wants to merge 3 commits intoSSSD:masterfrom
sumit-bose:pac_ama
Open

pam: apply SIDs from PAC to authentication indicators#8571
sumit-bose wants to merge 3 commits intoSSSD:masterfrom
sumit-bose:pac_ama

Conversation

@sumit-bose
Copy link
Copy Markdown
Contributor

This patch reads the PAC of a Kerberos ticket while evaluating the
authentication indicators of the Kerberos ticket during a pam_sss_gss
request. Based on the value of the pam_gssapi_indicators_apply option
the found SIDs might add additional authentication indicators to the
evaluation.

The primary use case is to handle SIDs added by Active Directory's
Authentication Mechanism Assurance (AMA).

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the pam_gssapi_indicators_apply configuration option, which allows SSSD to assign additional authentication indicators based on information extracted from Kerberos tickets, specifically SIDs from the PAC. The implementation involves updating the configuration schema, documentation, and the PAM responder's GSSAPI logic to handle PAC data parsing and SID-to-indicator mapping. Review feedback identifies a bug where an error code is not properly set upon memory allocation failure and suggests improving the robustness of GSSAPI attribute matching to avoid partial string matches.

Comment thread src/responder/pam/pamsrv_gssapi.c
Comment on lines 662 to +663
if (strncmp(AUTH_INDICATORS_TAG, attrs->elements[i].value,
sizeof(AUTH_INDICATORS_TAG) - 1) != 0)
sizeof(AUTH_INDICATORS_TAG) - 1) == 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The check for AUTH_INDICATORS_TAG uses strncmp without checking the length of the attribute name. This could lead to a partial match if another attribute name starts with "auth-indicators". For consistency and correctness, it's better to perform an exact match, similar to how MSPAC_TAG is checked.

        if (attrs->elements[i].length == sizeof(AUTH_INDICATORS_TAG) - 1 &&
            strncmp(AUTH_INDICATORS_TAG, (char *)attrs->elements[i].value,
                    sizeof(AUTH_INDICATORS_TAG) - 1) == 0) {

Comment thread src/providers/ad/ad_pac_common.c Dismissed
@sumit-bose sumit-bose force-pushed the pac_ama branch 4 times, most recently from 6bddc35 to 99bcff1 Compare April 2, 2026 06:22
@sumit-bose sumit-bose requested a review from thalman April 2, 2026 12:37
@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label Apr 9, 2026
@alexey-tikhonov alexey-tikhonov requested a review from pbrezina April 9, 2026 12:31
Comment thread src/responder/pam/pamsrv_gssapi.c
Copy link
Copy Markdown
Member

@pbrezina pbrezina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, code looks good, but it deserves a release note.

To make ad_get_sids_from_pac() better reusable it is moved with its
dependencies into ad_pac_common.c
This patch reads the PAC of a Kerberos ticket while evaluating the
authentication indicators of the Kerberos ticket during a pam_sss_gss
request. Based on the value of the pam_gssapi_indicators_apply option
the found SIDs might add additional authentication indicators to the
evaluation.

The primary use case is to handle SIDs added by Active Directory's
Authentication Mechanism Assurance (AMA).

:relnote: During the processing of the pam_sss_gss request SSSD will
read the SID from the PAC of the Kerberos ticket and might add
authentication indicators based on the value of the new option
pam_gssapi_indicators_apply. The primary use case is to handle SIDs
added by Active Directory's Authentication Mechanism Assurance (AMA).
@sumit-bose
Copy link
Copy Markdown
Contributor Author

Hi, code looks good, but it deserves a release note.

Hi,

thanks for the review, added.

bye,
Sumit

Copy link
Copy Markdown
Contributor

@thalman thalman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work, ACK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants