AUDIT_SET_ENABLED(3)

πŸ“¦
version 4.2.1 Β· 2 versions
, in alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– AUDIT_SET_ENABLED πŸ’–

okay bestie, so this is a page from the Linux Audit API (section 3 of the manual, iykyk) and it's all about the one little function that flips the whole audit system on and off. no cap. πŸŽ€


✨ NAME ✨

audit_set_enabled β€” the function that turns auditing on or off, like a light switch but for your kernel's whole surveillance era 🫢


🌸 SYNOPSIS 🌸

#include <libaudit.h>

int audit_set_enabled(int fd, uint32_t enabled);

πŸ¦‹ DESCRIPTION πŸ¦‹

so audit_set_enabled is literally the vibe check for the entire audit system β€” it controls whether the audit system is active or not, periodt.

when the audit system is enabled (enabled set to 1), it's giving full main character energy: every single syscall will pass through the audit system so it can collect information and potentially trigger an event. every one. no syscall gets to sneak past. πŸ‘‘

when the audit system is disabled (enabled set to 0), syscalls do not enter the audit system and no data is collected. it's quiet. it's peaceful. it's a digital nap. 😴

πŸ’€ but wait β€” plot twist β€” there may still be some events generated by MAC subsystems like SE Linux even though the audit system is disabled. not me being off and them still showing up uninvited πŸ™ˆ

the good news? it is possible to suppress those events too, by adding an audit rule with flags set to AUDIT_FILTER_EXCLUDE. slay. problem solved. πŸ’…


⭐ RETURN VALUE ⭐

the return value is <= 0 on error β€” so zero or anything negative means something went wrong, bestie 😭

otherwise, it's the netlink sequence id number. and heads up: this function can have any error that sendto would encounter, so don't come for the error list, it's the same energy as sendto. πŸ”₯


🌈 SEE ALSO 🌈

go read those too, they're part of the lore πŸ“š


πŸ’œ AUTHOR πŸ’œ

Steve Grubb β€” the icon, the legend, the moment ✨


and that's the whole page, bestie!! this one came out of the Linux Audit API corner of the world, courtesy of Red Hat, dated October 2006 β€” yes, 2006, we love a vintage baddie πŸŽ€ β€” and it lives in section 3 of the manual as AUDIT_SET_ENABLED. stan a classic. bye pookie, go enable your auditing responsibly πŸ’–πŸ¦‹πŸŒΈ