OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_0-66-g52da4b9
Gerrit Code Review
gerrit@openafs.org
Sun, 29 Nov 2020 11:55:10 -0500
The following commit has been merged in the master branch:
commit 52da4b94889e09bc07aa51154810e5b9f909915f
Author: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri Nov 13 11:20:15 2020 -0700
audit: Support multiple audit interfaces and interface options
Currently, the audit subsystem only allows for one audit log to exist
for the entire process. This can make it cumbersome to use for sites
that have multiple tools or destinations that want to read the audit
data. For example, to feed the audit data to two separate scripts, one
script needs to read the data, and retransmit the data to the second
script.
To make such a setup easier, change the audit system to allow for
multiple audit logs to exist at once. To allow callers to associate
each audit log with an interface, we change the syntax for the value to
the -auditlog parameter to the following:
[interface:]filespec[:options]
For example:
-auditlog sysvmq:/tmp/msgqueue
To accommodate the existing -audit-interface parameter, change the
behavior of -audit-interface so that it sets the default audit interface
if none is specified for -auditlog. This allows existing users of
-audit-interface to experience the same behavior as before.
In order to implement this, change the audit API and all existing audit
interfaces to avoid using per-interface globals, and instead allocate
per-instance contexts during startup. Also change the code so the audit
message is constructed inside audit.c, instead of via a per-interface
callback, which eliminates the duplicated logic in each interface's
append_msg(), and lets us avoid holding 'audit_lock' during message
construction.
While we're changing the audit API, also introduce a few new operations:
open_interface, close_interface and set_options. This commit and the
existing interfaces do not make use of these new functions, but future
commits will do so.
This commit also only changes the audit subsystem itself to be able to
handle multiple audit logs, and doesn't change any command-line parsing
logic. Future commits will add the command-line parsing logic changes
required so daemons can actually configure multiple interfaces.
Thanks to Andrew Deason (adeason@sinenomine.net) for providing the
changes needed to reduce holding the 'audit_lock' and improve
performance as well as providing input during the development of this
change.
Change-Id: I1311ea417fdd0ba38d2206083cd65bd7a054d017
Reviewed-on: https://gerrit.openafs.org/13774
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/audit/audit-api.h | 50 ++++-
src/audit/audit-file.c | 60 ++++--
src/audit/audit-sysvmq.c | 121 +++++++-----
src/audit/audit.c | 511 +++++++++++++++++++++++++++++++++++++++-------
src/audit/audit.h | 5 +-
src/cf/roken.m4 | 1 +
6 files changed, 596 insertions(+), 152 deletions(-)
--
OpenAFS Master Repository