audit: Centralize ordering and systemd service override#1635
Merged
brianmcgillion merged 1 commit intotiiuae:mainfrom Dec 15, 2025
Merged
audit: Centralize ordering and systemd service override#1635brianmcgillion merged 1 commit intotiiuae:mainfrom
brianmcgillion merged 1 commit intotiiuae:mainfrom
Conversation
This override addresses two separate issues: 1. The standard NixOS auditd module generates an audit.rules file that includes flags to set the backlog limit (`-b 8192`) and failure mode (`-f`). In some environments `auditctl` lacks the permissions to set these kernel parameters at runtime, causing failures. The `-D` was kept to clear any pre-existing rules. In summary, The kernel parameters were defined redundantly. 2. Resetting the service dependencies makes it run later, like a normal service, resolving a race condition problem. Signed-off-by: Everton de Matos <everton.dematos@tii.ae>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses two separate issues:
The standard NixOS auditd module generates an
audit.rulesfile that includes flags to set the backlog limit (-b 8192) and failure mode (-f). We are already defining those parameters insidesecurity.audit. In some environments,auditctllacks the permissions to set these kernel parameters at runtime, causing failures. The-Dwas kept to clear any pre-existing rules. In summary, the kernel parameters were defined redundantly.Resetting the service dependencies makes it run later, like a normal service, resolving a race condition problem. Previously, it was added only to
zathura-vmto solve this issue. However, we could see the same issue inghaf-hostwhen some specific audit rules were applied. That is why it was decided to centralize the ordering for all the VMs.Description of Changes
Type of Change
Related Issues / Tickets
https://jira.tii.ae/browse/SSRCSP-7625
Checklist
make-checksand it passesTesting Instructions
Applicable Targets
aarch64aarch64x86_64x86_64x86_64Installation Method
nixos-rebuild ... switchTest Steps To Verify:
audit.enabletotrue: https://github.com/everton-dematos/ghaf/blob/pr_audit_fixes/modules/reference/profiles/mvp-user-trial.nix#L112auditdandaudit-rules-nixosservices are active/enabled (any VM - speciallyghaf-host,chrome-vm, andzathura-vmthat were presenting issues):2.1
systemctl status audit-rules-nixos.service2.2
systemctl status auditd.serviceenableOspptotrue- https://github.com/everton-dematos/ghaf/blob/pr_audit_fixes/modules/common/security/audit/default.nix#L52