AU_EVENT(3)

πŸ“¦
version 1.1 Β· 2 versions
, in nixos 26.05, nixpkgs unstable

πŸ’… AU_EVENT(3) β€” the audit event database lookup girlies ✨

ok so this is the AU_EVENT(3) manual page, bestie, straight out of the libbsm Basic Security Module Library. it's giving "I know every audit event by name AND by number" energy and honestly? iconic. let's get into it πŸŽ€


✨ NAME ✨

free_au_event_ent, setauevent, endauevent, getauevent, getauevent_r, getauevnam, getauevnam_r, getauevnum, getauevnum_r, getauevnonam, getauevnonam_r β€” these are your look-up girlies for pulling info out of the audit_event database 🌸


πŸ“š LIBRARY πŸ“š

Basic Security Module Library β€” libbsm, and you link it with -lbsm πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

ok so first you gotta invite them in:

#include <bsm/libbsm.h>

then it's just a whole friend group of function signatures, no cap:

void
setauevent(void);

void
endauevent(void);

struct au_event_ent *
getauevent(void);

struct au_event_ent *
getauevent_r(struct au_event_ent *e);

struct au_event_ent *
getauevnam(const char *name);

struct au_event_ent *
getauevnam_r(struct au_event_ent *e, const char *name);

struct au_event_ent *
getauevnum(au_event_t event_number);

struct au_event_ent *
getauevnum_r(struct au_event_ent *e, au_event_t event_number);

au_event_t *
getauevnonam(const char *event_name);

au_event_t *
getauevnonam_r(au_event_t *ev, const char *event_name);

🌈 DESCRIPTION 🌈

these interfaces let you peek inside the audit_event(5) database, which is literally the database that describes audit events. every entry in there is described by a struct au_event_ent, and you get those entries handed to you by calling getauevent(), getauevnam(), or getauevnum(). and plot twist β€” you can also go the other way and look up an event number by calling getauevnonam() πŸ‘‘

let's meet the cast, one by one:

  • setauevent() β€” resets the database access session for audit_event(5), so the next getauevent() call starts over at the very first entry in the database. it's the "ok let's rewind, bestie" function πŸ”
  • endauevent() β€” closes the audit_event(5) database session. say bye πŸ‘‹
  • getauevent() β€” returns a reference to the next entry in the audit_event(5) database. it iterates, she slays.
  • getauevnam() β€” returns a reference to the entry in the audit_event(5) database whose name is name. searching by name, we love to see it πŸ’…
  • getauevnum() β€” returns a reference to the entry in the audit_event(5) database whose event number is event_number. numbers era πŸ”’
  • getauevnonam() β€” returns a reference to an audit event number, using the audit_event(5) database. full circle moment 🫢

πŸ’€ RETURN VALUES πŸ’€

so getauevent(), getauevent_r(), getauevnam(), getauevnam_r(), getauevnum(), getauevnum_r(), and getauevnonam() all return a reference to a struct au_event_ent or an au_event_t when things go right ✨ β€” or NULL when they don't 😭, and in that case errno is set to give you more deets about what went wrong.


🧚 SEE ALSO 🧚

go read those too, iykyk πŸ“–


πŸŽ€ HISTORY πŸŽ€

the OpenBSM implementation was created by McAfee Research β€” that's the security division of McAfee Inc. β€” working under contract to Apple Computer, Inc., back in 2004. it then got adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution. glow-up story fr fr 🌟


πŸ‘‘ AUTHORS πŸ‘‘

this software was created by Robert Watson, Wayne Salamon, and Suresh Krishnaswamy for McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer, Inc. 🫢

and the Basic Security Module (BSM) interface to audit records and the audit event stream format were defined by Sun Microsystems. legends only ⭐


πŸ™ˆ BUGS πŸ™ˆ

heads up bestie, errno is not always properly set after a failure. so like… don't fully trust it every single time πŸ’€
also these routines are thread-safe but not re-entrant, so if you use them simultaneously or in an interleaved way, that's gonna mess with the iterator. no cap, the iterator is shared and she will get confused 😭

and that's the whole page!! this one's from the Debian crowd, dated April 19, 2005, filed under AU_EVENT(3) β€” mwah, stan libbsm, bye bestie πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from