Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
audit2why reads AVC messages and says why each one happened: missing rule, a boolean that is off, or a wrong label. audit2allow -M NAME writes a policy module that allows exactly the denied actions; semodule -i NAME.pp installs it.
Use modules only when labels, ports and booleans cannot solve the problem, and read the rules first: allowing a denial blindly may allow an attack.
Zo schrijf je het
audit2allow [OPTION]...
audit2why [OPTION]...Opties 17
Meest gebruikt
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1Why was it denied?
ausearch -m AVC -ts recent | audit2why Was caused by: The boolean httpd_can_network_connect was set incorrectly.Then: setsebool -P httpd_can_network_connect on.
2Missing type enforcement rule
ausearch -m AVC -c myapp -ts today | audit2why"Missing type enforcement (TE) allow rule" = no label or boolean fix; maybe a module.
3Show the rules that would be needed
ausearch -m AVC -c myapp -ts today | audit2allow allow myapp_t var_log_t:file { append open };Read them carefully.
4Build and install a module
ausearch -m AVC -c myapp -ts today | audit2allow -M myapp_local semodule -i myapp_local.ppOnly after checking myapp_local.te.
5List and remove modules
semodule -l | grep local semodule -r myapp_localRemove modules you no longer need.
6Explain from a saved log
audit2why -i /root/avc.logAnalyze offline.
7Since the last boot
audit2allow -b -wExplanations for this boot.
8Do not allow everything (security)
Rules like these mean an attack or a broken app — do not allow them.
9Use reference macros
ausearch -m AVC -c myapp | audit2allow -RNicer rules with policy interfaces.
10Generate dontaudit rules for noisy denials
ausearch -m AVC -c myapp | audit2allow -D -M myapp_quietHides harmless denials (they stay blocked).
Niets past bij dit filter.
Exitcodes
0 | Done. |
1 | Error. |