LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

audit2why

Translate SELinux denial messages into human-readable explanations.

TLDR

Explain the denials recorded since the last boot
$ sudo audit2why --boot
copy
Explain every denial in the audit log
$ sudo audit2why --all
copy
Read a particular log file
$ sudo audit2why --input [path/to/audit.log]
copy
Read denials out of the kernel ring buffer
$ sudo audit2why --dmesg
copy
Explain only what happened since the last policy reload
$ sudo audit2why --lastreload
copy
Feed it records filtered by ausearch
$ sudo ausearch -m avc | audit2why
copy
Narrow those records to one process
$ sudo ausearch -m avc -c [httpd] | audit2why
copy
Check the denials against a specific policy file
$ sudo audit2why --policy [path/to/policy.pp] --all
copy

SYNOPSIS

audit2why [options] < input

DESCRIPTION

audit2why translates SELinux denial messages from audit logs into human-readable explanations. It identifies the cause of each denial and often suggests solutions such as boolean toggles, policy modules, or file context corrections.The tool reads audit events from standard input or a specified file. It is typically used in conjunction with ausearch to filter and analyze specific types of denials.

PARAMETERS

-a, --all

Read input from both the audit log and the message log.
-b, --boot
Read input from audit messages since the last boot.
-d, --dmesg
Read input from the output of dmesg(1).
-i file, --input file
Read audit events from the specified file instead of stdin.
-l, --lastreload
Read only audit events generated after the last policy reload.
-p file, --policy file
Use the given policy file for analysis instead of the active one.
-w, --why
Show the reason for each denial (default behavior for audit2why).
-v, --verbose
Enable verbose output.

CAVEATS

Requires root privileges to read audit logs. The tool only explains denials; it does not automatically fix them. Suggested booleans should be reviewed before enabling as they may have security implications. Part of the policycoreutils-python-utils package.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid