@@ -31,10 +31,10 @@ (define-module (gnu services auditd)
%default-auditd-configuration-directory))
(define auditd.conf
- (plain-file "auditd.conf" "log_file = /var/log/audit.log\nlog_format = \
-ENRICHED\nfreq = 1\nspace_left = 5%\nspace_left_action = \
-syslog\nadmin_space_left_action = ignore\ndisk_full_action = \
-ignore\ndisk_error_action = syslog\n"))
+ (plain-file "auditd.conf" "\
+space_left = 5%
+space_left_action = syslog
+"))
(define %default-auditd-configuration-directory
(computed-file "auditd"
@@ -50,6 +50,14 @@ (define-record-type* <auditd-configuration>
(default audit))
(configuration-directory auditd-configuration-configuration-directory)) ; file-like
+(define (auditd-activation config)
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+ (let ((var-log-audit "/var/log/audit"))
+ (mkdir-p var-log-audit)
+ (chmod var-log-audit #o700)))))
+
(define (auditd-shepherd-service config)
(let* ((audit (auditd-configuration-audit config))
(configuration-directory (auditd-configuration-configuration-directory config)))
@@ -67,7 +75,9 @@ (define auditd-service-type
(extensions
(list
(service-extension shepherd-root-service-type
- auditd-shepherd-service)))
+ auditd-shepherd-service)
+ (service-extension activation-service-type
+ auditd-activation)))
(default-value
(auditd-configuration
(configuration-directory %default-auditd-configuration-directory)))))