Skip to content

Commit c8de690

Browse files
WOnder93dburgener
authored andcommitted
Explain NNP transitions
Provide a brief explanation of the NNP concept and how it realtes to SELinux transitions to help guide people deciding whether to allow the nnp_transtion permission or not. Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com> Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com> Signed-off-by: Daniel Burgener <Daniel.Burgener@microsoft.com>
1 parent 9852746 commit c8de690

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/lsm_selinux.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,9 @@ or *libsepol* library.
729729

730730
- Enables SELinux domain transitions to occur under *no_new_privs* (NNP)
731731
or on *nosuid* mounts if the corresponding permission (*nnp_transition*
732-
for NNP, *nosuid_transition* for *nosuid*, defined in the *process2*
733-
security class) is allowed between the old and new contexts.
732+
for NNP, *nosuid_transition* for *nosuid*, defined in the
733+
[*process2* security class](object_classes_permissions.md#process2))
734+
is allowed between the old and new contexts.
734735

735736
*policy_capabilities/open_perms*
736737

src/object_classes_permissions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,19 @@ Extension of *process* class.
19111911
*nnp_transition*
19121912

19131913
- Enables SELinux domain transitions to occur under *no_new_privs* (*NNP*).
1914+
- *NNP* is a flag, which a process can set on itself, that ensures that any
1915+
subsequent execve(2)/fork(2)/clone(2) doesn't lead to the process gaining
1916+
more privileges than it had before the operation. Strictly restricting
1917+
SELinux domain transitions under NNP in the same way would be impractical
1918+
and could often go against the principle of least privilege, so the writer
1919+
of the policy is given the choice to explicitly allow a given transition
1920+
under NNP where it makes sense using this permission. For example, a
1921+
reasonable criterion could be that the target domain and any domains that
1922+
it can possibly transition into are reasonably confined and it's not
1923+
possible to "escape" into a domain that has excess permissions (e.g.
1924+
an unconfined or a permissive domain).
1925+
- See the [original kernel commit's description](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=af63f4193f9fbbbac50fc766417d74735afd87ef)
1926+
for more details.
19141927

19151928
*nosuid_transition*
19161929

0 commit comments

Comments
 (0)