Skip to content

Commit 1f680ed

Browse files
sumit-bosealexey-tikhonov
authored andcommitted
pam: apply SIDs from PAC to authentication indicators
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). Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Tomáš Halman <thalman@redhat.com>
1 parent 22de4fd commit 1f680ed

6 files changed

Lines changed: 360 additions & 27 deletions

File tree

Makefile.am

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,13 +1522,15 @@ sssd_pam_SOURCES = \
15221522
src/responder/pam/pam_prompting_config.c \
15231523
src/sss_client/pam_sss_prompt_config.c \
15241524
src/responder/pam/pam_helpers.c \
1525+
src/providers/ad/ad_pac_common.c \
15251526
$(SSSD_RESPONDER_OBJ)
15261527
if BUILD_PASSKEY
15271528
sssd_pam_SOURCES += src/responder/pam/pamsrv_passkey.c
15281529
endif
15291530
sssd_pam_CFLAGS = \
15301531
$(AM_CFLAGS) \
15311532
$(GSSAPI_KRB5_CFLAGS) \
1533+
$(NDR_KRB5PAC_CFLAGS) \
15321534
$(NULL)
15331535
sssd_pam_LDADD = \
15341536
$(LIBADD_DL) \
@@ -1540,6 +1542,8 @@ sssd_pam_LDADD = \
15401542
$(SSSD_INTERNAL_LTLIBS) \
15411543
libsss_iface.la \
15421544
libsss_sbus.la \
1545+
$(NDR_KRB5PAC_LIBS) \
1546+
libsss_idmap.la \
15431547
$(NULL)
15441548

15451549
if BUILD_SUDO
@@ -2564,13 +2568,15 @@ pam_srv_tests_SOURCES = \
25642568
src/responder/pam/pamsrv_dp.c \
25652569
src/responder/pam/pam_prompting_config.c \
25662570
src/sss_client/pam_sss_prompt_config.c \
2571+
src/providers/ad/ad_pac_common.c \
25672572
$(NULL)
25682573
pam_srv_tests_CFLAGS = \
25692574
-U SSSD_LIBEXEC_PATH -DSSSD_LIBEXEC_PATH=\"$(abs_builddir)\" \
25702575
-I$(abs_builddir)/src \
25712576
$(AM_CFLAGS) \
25722577
$(CMOCKA_CFLAGS) \
25732578
$(GSSAPI_KRB5_CFLAGS) \
2579+
$(NDR_KRB5PAC_CFLAGS) \
25742580
$(NULL)
25752581
pam_srv_tests_LDFLAGS = \
25762582
-Wl,-wrap,sss_packet_get_body \
@@ -2592,6 +2598,7 @@ pam_srv_tests_LDADD = \
25922598
libsss_certmap.la \
25932599
libsss_iface.la \
25942600
libsss_sbus.la \
2601+
$(NDR_KRB5PAC_LIBS) \
25952602
$(NULL)
25962603
if BUILD_PASSKEY
25972604
pam_srv_tests_SOURCES += src/responder/pam/pamsrv_passkey.c
@@ -2608,13 +2615,15 @@ test_pamsrv_json_SOURCES = \
26082615
src/responder/pam/pam_prompting_config.c \
26092616
src/sss_client/pam_sss_prompt_config.c \
26102617
src/tests/cmocka/test_pamsrv_json.c \
2618+
src/providers/ad/ad_pac_common.c \
26112619
$(NULL)
26122620
if BUILD_PASSKEY
26132621
test_pamsrv_json_SOURCES += src/responder/pam/pamsrv_passkey.c
26142622
endif # BUILD_PASSKEY
26152623
test_pamsrv_json_CFLAGS = \
26162624
$(AM_CFLAGS) \
26172625
$(CMOCKA_CFLAGS) \
2626+
$(NDR_KRB5PAC_CFLAGS) \
26182627
$(NULL)
26192628
test_pamsrv_json_LDFLAGS = \
26202629
-Wl,-wrap,json_array_append_new \
@@ -2632,6 +2641,7 @@ test_pamsrv_json_LDADD = \
26322641
libsss_certmap.la \
26332642
libsss_iface.la \
26342643
libsss_sbus.la \
2644+
$(NDR_KRB5PAC_LIBS) \
26352645
$(NULL)
26362646

26372647
test_sss_pam_data_SOURCES = \

src/config/SSSDConfig/sssdoptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def __init__(self):
111111
'pam_gssapi_indicators_map': _('List of pairs <PAM service>:<authentication indicator> that '
112112
'must be enforced for PAM access with GSSAPI authentication'),
113113
'pam_gssapi_indicators_apply': _('List of triples <type>:<value>:<authentication indicator> that '
114-
'assigns additional information from the Kerberos ticket to an'
114+
'assigns additional information from the Kerberos ticket to an '
115115
'authentication indicator.'),
116116
'pam_passkey_auth': _('Allow passkey device authentication.'),
117117
'passkey_child_timeout': _('How many seconds will pam_sss wait for passkey_child to finish'),

src/responder/pam/pamsrv_cmd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
along with this program. If not, see <http://www.gnu.org/licenses/>.
2121
*/
2222

23+
#ifndef _GNU_SOURCE
2324
#define _GNU_SOURCE
25+
#endif
2426

2527
#include <time.h>
2628
#include <string.h>

0 commit comments

Comments
 (0)