SUSE Support

Here When You Need Us

auditd stops sending audit messages of NFS share

This document (000021145) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15 all service packs
SUSE Linux Enterprise Server 12 all service packs

Situation

auditd is configured to monitor a NFS share, let's say /sap with sap-nfs key, as follows audit.rules
 
-w /sap -p rwxa -k sap-nfs

However when the share is unmounted and mounted again, no more logs are recorded and the following message is seen
 
audit: type=1305 : op=remove_rule dir="/sap" key="sap-nfs" list=4 res=1

Resolution

Restart audit after unmounting/mounting a NFS share. However, with systemd, this can be automated with the following service on-sap-nfs-mount.service 
[Unit]
RequiresMountsFor=/sap
BindsTo=sap.mount

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c "/usr/sbin/auditctl -w /sap -p rwxa -k sap-nfs || true"
[Install]
WantedBy=sap.mount
copy the service file to /etc/systemd/system/
systemctl enable --now on-sap-nfs-mount

With that, auditctl is executed to reload the rules for the NFS share that is being mounted back.

Cause

This occurs because when the NFS share is unmounted, audit removes its corresponding rules, when it is mounted again, audit doesn't know about it and so no logs are being recorded.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021145
  • Creation Date: 21-Jul-2023
  • Modified Date:28-Sep-2023
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.