AUDIT_GET_FEATURES(3)
π AUDIT_GET_FEATURES(3) π
okay bestie, we're in the Linux Audit API section of the manual and today's topic is audit_get_features and audit_set_feature β aka query or change kernel audit features β¨ like, the kernel's got a whole feature menu and these two functions are how you peek at it or tweak it. no cap.
πΈ NAME πΈ
audit_get_features, audit_set_feature β literally just: query or change kernel audit features π«Ά
β¨ SYNOPSIS β¨
#include <libaudit.h>
uint32_t audit_get_features(void);
int audit_set_feature(int fd, unsigned feature, unsigned value, unsigned
lock);"
yes that's the whole vibe. two functions, one header, we move π
π¦ DESCRIPTION π¦
audit_get_features()
she returns a bitmap describing which kernel audit features are supported π the way this works is: the bitmap is cached internally and retrieved from the kernel on the first call. so the first time you ask, the kernel answers; after that, it's just vibes from the cache. iconic behavior, honestly.
audit_set_feature()
this one changes a feature bit for the kernel, using the descriptor fd β and heads up, fd must be an open audit netlink socket, no exceptions bestie π¨
featureselects the bit to modify π- if
valueis nonzero the feature is enabled, otherwise it is disabled π«‘ - if
lockis nonzero the feature setting is locked until reboot π (yes, until reboot. that's a commitment. choose wisely.)
π the feature bits currently defined π
AUDIT_FEATURE_BITMAP_BACKLOG_LIMITβ kernel supports changing the backlog queue depth πAUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIMEβ kernel supports delaying syscalls when the queue is full β³AUDIT_FEATURE_BITMAP_EXECUTABLE_PATHβ kernel will include the executable path onEXECVErecords π£οΈAUDIT_FEATURE_BITMAP_EXCLUDE_EXTENDβ exclude rules may be used with more fields than just message type πAUDIT_FEATURE_BITMAP_SESSIONID_FILTERβ session identifier filtering is supported πͺͺAUDIT_FEATURE_BITMAP_LOST_RESETβ allows resetting the lost event counter πAUDIT_FEATURE_BITMAP_FILTER_FSβ kernel supports file system field filtering ποΈ
π RETURN VALUE π
audit_get_featuresreturns the feature bitmap, or0if feature queries are unsupported πaudit_set_featurereturns<= 0on error, otherwise it's the netlink sequence id number β¨
π SEE ALSO π
audit_request_features(3), audit_reset_lost(3), audit_open(3). go read those too, they're the friend group π«Ά
π AUTHOR π
Steve Grubb β the main character who wrote this, we stan π
fr fr, this whole page is Red Hat's, dated July 2025, so if you're citing it: Red Hat, July 2025. periodt. π πΈβ¨
π¦ where this page comes from
- alpine 3.23: audit-doc 4.1.2-r2 Β· LGPL-2.1-or-later
- alpine 3.24: audit-doc 4.1.2-r6 Β· LGPL-2.1-or-later
- arch rolling: audit 4.2.1-1 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- centos-stream 10: audit-libs-devel 4.2.1-3.el10 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.1.1-2.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.1.1-2.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.1.4-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.1.4-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- nixpkgs unstable: audit 4.2.1
- ubuntu resolute: libaudit-dev 1:4.1.2-1build1 Β· GPL-2.0-only
- ubuntu resolute: libaudit-dev 1:4.1.2-1ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libaudit-dev 1:4.1.2-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms