2024-09-08 13:57:12 +01:00
|
|
|
# audit2allow
|
|
|
|
|
|
|
|
> Create an SELinux local policy module to allow rules based on denied operations found in logs.
|
2025-01-06 04:58:55 +08:00
|
|
|
> Note: Use audit2allow with caution. Always review the generated policy before applying it, as it may allow excessive access.
|
2024-09-08 13:57:12 +01:00
|
|
|
> More information: <https://manned.org/audit2allow>.
|
|
|
|
|
|
|
|
- Generate a local policy to allow access for all denied services:
|
|
|
|
|
2025-04-20 00:21:53 +03:00
|
|
|
`sudo audit2allow {{[-a|--all]}} -M {{local_policy_name}}`
|
2024-09-08 13:57:12 +01:00
|
|
|
|
|
|
|
- Generate a local policy module to grant access to a specific process/service/command from the audit logs:
|
|
|
|
|
|
|
|
`sudo grep {{apache2}} /var/log/audit/audit.log | sudo audit2allow -M {{local_policy_name}}`
|
|
|
|
|
|
|
|
- Inspect and review the Type Enforcement (.te) file for a local policy:
|
|
|
|
|
|
|
|
`vim {{local_policy_name}}.te`
|
|
|
|
|
|
|
|
- Install a local policy module:
|
|
|
|
|
2025-04-20 00:21:53 +03:00
|
|
|
`sudo semodule {{[-i|--install]}} {{local_policy_name}}.pp`
|