Skip to content

Commit e87fe61

Browse files
authored
Merge pull request #27 from cgzones/noaudit
RFE: list noaudit exemptions
2 parents 4f5a43c + e41128d commit e87fe61

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

src/auditing.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- [AVC Audit Events](#avc-audit-events)
44
- [Example Audit Events](#example-audit-events)
55
- [General SELinux Audit Events](#general-selinux-audit-events)
6+
- [Capability Audit Exemptions](#capability-audit-exemptions)
67

78
For SELinux there are two main types of audit event:
89

@@ -377,6 +378,100 @@ new-context=?: exe="/usr/bin/newrole" hostname=? addr=?
377378
terminal=/dev/pts/0 res=failed'
378379
```
379380

381+
## Capability Audit Exemptions
382+
383+
In the general case a rejected capability check will result in an audit event.
384+
There are however some instances in the kernel where denied capability checks
385+
are not audited, which could lead to differences in behavior between enforcing
386+
and permissive mode.
387+
388+
List of exemptions (no guarantee for completeness)(locations are based on
389+
kernel v6.5 unless otherwise specified):
390+
391+
- *fs/proc/base.c#L1110*,
392+
*fs/proc/base.c#L1129*
393+
394+
If not granted *CAP_SYS_RESOURCE* the OOM kill score adjustment min value is
395+
not set.
396+
397+
- *fs/overlayfs/inode.c#L429*,
398+
*fs/xattr.c#L1298*
399+
400+
If not granted *CAP_SYS_ADMIN* in its namespace extended attributes in the
401+
*trusted* namespace are not listed.
402+
403+
- *fs/xfs/xfs_fsmap.c#L894*
404+
405+
If not granted *CAP_SYS_ADMIN* the XFS data device's *bnobt* is queried
406+
instead of *rmapbt*.
407+
408+
- *fs/xfs/xfs_ioctl.c#L1199*,
409+
*fs/xfs/xfs_iops.c#L709*
410+
411+
If not granted *CAP_FOWNER* XFS quota checks on transactions are performed.
412+
413+
- *io_uring/io_uring.c#L3887*
414+
415+
If not granted *CAP_IPC_LOCK* io_uring operations are accounted against the
416+
user's RLIMIT_MEMLOCK limit.
417+
418+
- *kernel/capability.c#L519*
419+
420+
If not granted *CAP_SYS_PTRACE* tracing an unsafe (e.g. *no_new_privs* set
421+
or shared, see *fs/exec.c:check_unsafe_exec()*) task or a coredump of a
422+
non-user process is not permitted.
423+
424+
- *kernel/ksyms_common.c#L37*
425+
426+
If not granted *CAP_SYSLOG* kallsyms information are not shown, except if
427+
kernel profiling is enabled and is explicitly not set to paranoid.
428+
429+
- *kernel/ptrace.c#L282*
430+
431+
If not granted *CAP_SYS_PTRACE* in its namespace several fields in the *PID*
432+
directory entry *stat* files are not populated (*startcode*, *endcode*,
433+
*startstack*, *kstkesp*, *kstkeip*, *wchan*, *start_data*, *end_data*,
434+
*start_brk*, *arg_start*, *arg_end*, *env_start*, *env_end* and
435+
*exit_code*).
436+
437+
- *kernel/seccomp.c#L662*
438+
439+
If not granted *CAP_SYS_ADMIN* in its namespace preparing a seccomp filter
440+
running without *no_new_privs* is not permitted.
441+
442+
- *lib/vsprintf.c#L881*
443+
444+
If not granted *CAP_SYSLOG* restricted pointers are not included in strings
445+
formatted via *%pK*.
446+
447+
- *net/vmw_vsock/af_vsock.c#L779*
448+
449+
If not granted *CAP_NET_ADMIN* in its namespace new *VSOCK* sockets are not
450+
marked as trusted.
451+
452+
- *net/sysctl_net.c#L48*
453+
454+
If not granted *CAP_NET_ADMIN* in its namespace the inodes of
455+
*/proc/sys/net* have more restricted *DAC* permissions.
456+
457+
- *security/commoncap.c#L1405*
458+
459+
If not granted *CAP_SYS_ADMIN* allocation of a new virtual mapping are
460+
restricted in size to reserve memory for sysadmin.
461+
462+
- *security/integrity/ima/ima_policy.c#L607*
463+
464+
If not granted *CAP_SETUID* rules regarding foreign *UID*s are not matched.
465+
466+
- *security/integrity/ima/ima_policy.c#L618*
467+
468+
If not granted *CAP_SETGID* rules regarding foreign *GID*s are not matched.
469+
470+
- *security/landlock/syscalls.c#L413*
471+
472+
If not granted *CAP_SYS_ADMIN* in its namespace enforcing a Landlock ruleset
473+
running without *no_new_privs* is not permitted.
474+
380475
<!-- %CUTHERE% -->
381476

382477
---

0 commit comments

Comments
 (0)