selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* strange pam selinux issue
@ 2020-03-04  7:29 Dominick Grift
  2020-03-04  7:42 ` Dominick Grift
  2020-03-04 14:40 ` Stephen Smalley
  0 siblings, 2 replies; 15+ messages in thread
From: Dominick Grift @ 2020-03-04  7:29 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]

The easiest way to explain this is as follows.

Consider this scenario:

# seinfo -xuwheel.id

Users: 1
   user wheel.id roles wheel.role level s0 range s0;

# selinuxconlist wheel.id sys.id:sys.role:sys.isid:s0
wheel.id:wheel.role:user.systemd.subj:s0

Now consider this scenario:

# echo '(userrole wheel.id sys.role)' > hack.cil && semodule -i hack.cil

# seinfo -xuwheel.id

Users: 1
   user wheel.id roles { wheel.role sys.role } level s0 range s0;

Here is the issue:

# selinuxconlist wheel.id sys.id:sys.role:sys.isid:s0
wheel.id:sys.role:sys.isid:s0


Some semi irrelevant background:

I am designing an improved "targeted" policy. Common targeted policies
are inefficient because they have several "unconfined" domains.
Unconfined domains are expensive because they have a lot of rules associated with them.
They're essentially all the same. Just duplicates.

I decided to have just one unconfined domain: "the system", and everything that is not targeted ends up in the system domain.
So now I want to have a confined login shell with role access to the system a'la: staff_u:staff_r:staff_t -> staff_u:unconfined_r:unconfined_t
pam_selinux seemingly cannot deal with this scenario as shown above. pam_selinux has many other issues. One of them is its concept of
"default_type". There is no such thing as a "default_type" and implying that there is a "default_type" causes issues.

There are other issues related to this as well: the env_params option depends on the "context contains" access vector being present.
It will not work even if you have handle_unknown=allow set.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2020-03-05 18:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04  7:29 strange pam selinux issue Dominick Grift
2020-03-04  7:42 ` Dominick Grift
2020-03-04 14:22   ` Stephen Smalley
2020-03-04 14:36     ` Dominick Grift
2020-03-04 14:40       ` Dominick Grift
2020-03-04 14:46       ` Stephen Smalley
2020-03-04 15:10         ` Stephen Smalley
2020-03-05 17:33         ` Petr Lautrbach
2020-03-05 17:39           ` Dominick Grift
2020-03-05 17:50             ` Dominick Grift
2020-03-05 18:00               ` Dominick Grift
2020-03-04 14:40 ` Stephen Smalley
2020-03-04 14:47   ` Dominick Grift
2020-03-04 15:19     ` Stephen Smalley
2020-03-04 15:28       ` Dominick Grift

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).