LinuxCommandLibrary

audit2why

Translate SELinux denial messages into human-readable explanations.

TLDR

Explain the most recent SELinux denial

$ sudo audit2why
copy
Explain SELinux denials from a specific audit log file
$ sudo audit2why -i [path/to/audit.log]
copy
Explain all SELinux denials from the audit log
$ sudo ausearch -m avc | audit2why
copy
Explain denials for a specific service
$ sudo ausearch -m avc -c [service_name] | audit2why
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

-i, --input file

Read audit events from the specified file instead of stdin
-w, --why
Show the reason for the denial (default behavior)
-p, --policy file
Use an alternate policy file

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

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community