All of lore.kernel.org
 help / color / mirror / Atom feed
* systemd.exec(5) PAMName= with libselinux
@ 2025-07-21  8:47 Dominick Grift
  2025-07-22 19:06 ` Stephen Smalley
  0 siblings, 1 reply; 7+ messages in thread
From: Dominick Grift @ 2025-07-21  8:47 UTC (permalink / raw)
  To: selinux


systemd has an identity directive called PAMName= which allows you to
run a unit with a specified PAM stack. The issue here is that in this
case the "session leader" is always systemd.

Thus you get into issues with pam_selinux because since systemd is for
example always associated with "init_t" you can't really specify log
SELinux identity foo_u in with foo_r:foo_t:s0 if this PAM stack is used
and log SELinux identity foo_u in with bar_r:bar_t:s0 if that PAM stack
is used.

This previously was not a big issue since this feature is pretty niche
but with the advent of `run0` it became an issue since that relies on
PAMName=

The problem is that pam_selinux is often already used to start the
systemd --user instance, for example:

/etc/selinux/TYPE/contexts/users/foo_u (/etc/pam.d/systemd-user):
system_r:init_t:s0 foo_r:foo_systemd_user_instance_t:s0

So you can't add the following because it would conflict

/etc/selinux/TYPE/contexts/user/foo_u (/etc/pam.d/run0):
system_r:init_t:s0 foo_r:foo_shell_t:s0

Ideas? Suggestions?

-- 
gpg --locate-keys dominick.grift@defensec.nl (wkd)
Key fingerprint = FCD2 3660 5D6B 9D27 7FC6  E0FF DA7E 521F 10F6 4098
Dominick Grift
Mastodon: @kcinimod@defensec.nl

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-09-30 20:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-21  8:47 systemd.exec(5) PAMName= with libselinux Dominick Grift
2025-07-22 19:06 ` Stephen Smalley
2025-07-22 19:31   ` Dominick Grift
2025-07-23 19:16     ` Dominick Grift
2025-07-24  5:34       ` Dominick Grift
2025-09-29  2:29         ` Rahul Sandhu
2025-09-30 20:01           ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.