AUDITREDUCE(1)

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

🌸 AUDITREDUCE(1) 🌸

okay bestie, grab a snack, because we're diving into auditreduce β€” it's a General Commands Manual page and honestly it's kind of a baddie. πŸ’…


✨ NAME ✨

auditreduce β€” the girl who selects records from audit trail files πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

auditreduce [-A] [-a YYYYMMDD[HH[MM[SS]]]] [-b YYYYMMDD[HH[MM[SS]]]]
            [-c flags] [-d YYYYMMDD] [-e euid] [-f egid] [-g rgid]
            [-j id] [-m event] [-o object=value] [-r ruid] [-u auid]
            [-v] [file ...]

πŸ’– DESCRIPTION πŸ’–

So the auditreduce utility selects records from the audit trail files based on whatever criteria you gave it. It's giving filter icon energy. ✨

The matching audit records get printed out to the standard output in their raw binary form β€” yes, raw binary, she's not doing the pretty-print thing, that's somebody else's job. πŸ”₯

If you don't pass any file argument? No worries, the standard input is used by default. Default queen behavior. πŸ‘‘

And lowkey important: use the praudit(1) utility to print the selected audit records in human-readable form. That's your translator bestie. 🫢

The options are as follows:


🌈 OPTIONS 🌈

  • -A β€” Select all records. Every single one. No filter, no thoughts, just vibes. πŸ’€
  • -a YYYYMMDD[HH[MM[SS]]] β€” Select records that occurred after or on the given datetime. iykyk, it's the "from here onward" one. ⭐
  • -b YYYYMMDD[HH[MM[SS]]] β€” Select records that occurred before the given datetime. The mirror twin of -a. πŸͺž
  • -c flags β€” Select records matching the given audit classes, specified as a comma separated list of audit flags. Wanna know what the audit flags even are? See audit_control(5) for a description. πŸ“š
  • -d YYYYMMDD β€” Select records that occurred on a given date. πŸ—“οΈ But listen β€” this option cannot be used with -a or -b. It's an exclusive situation, fr fr.
  • -e euid β€” Select records with the given effective user ID or name. πŸ’œ
  • -f egid β€” Select records with the given effective group ID or name. πŸ“
  • -g rgid β€” Select records with the given real group ID or name. 🧚
  • -j id β€” Select records having a subject token with matching ID. πŸ‘‘
  • -m event β€” Select records with the given event name or number. You can use this option more than once to select records of multiple event types β€” stack 'em, collect 'em. ✨ See audit_event(5) for a description of audit event names and numbers.
  • -o object=value β€” the object-matching option, and she has range:
    • file β€” Select records containing path tokens, where the pathname matches one of the comma delimited extended regular expression contained in given specification. πŸ¦‹ Regular expressions which are prefixed with a tilde (~) are excluded from the search results. These extended regular expressions are processed from left to right, and a path will either be selected or deslected based on the first match. (yes, "deslected" β€” we're keeping the original spelling, it's iconic 😭)

Since commas are used to delimit the regular expressions, a backslash (\) character should be used to escape the comma if it is a part of the search pattern. Don't skip this step bestie, it will ruin your whole day. πŸ’€

  • msgqid β€” Select records containing the given message queue ID. πŸ“¬
  • pid β€” Select records containing the given process ID. 🧚
  • semid β€” Select records containing the given semaphore ID. πŸŽ€
  • shmid β€” Select records containing the given shared memory ID. πŸ’–
  • -r ruid β€” Select records with the given real user ID or name. 🌸
  • -u auid β€” Select records with the given audit ID. ⭐
  • -v β€” Invert sense of matching, to select records that do not match. the hater filter. πŸ™ˆ

πŸ”₯ EXAMPLES πŸ”₯

To select all records associated with effective user ID root from the audit log /var/audit/20031016184719.20031017122634:

auditreduce -e root \
    /var/audit/20031016184719.20031017122634

To select all setlogin(2) events from that log:

auditreduce -m AUE_SETLOGIN \
    /var/audit/20031016184719.20031017122634

Output from the above command lines will typically be piped to a new trail file, or via standard output to the praudit(1) command. 🫢

Select all records containing a path token where the pathname contains /etc/master.passwd:

auditreduce -o file="/etc/master.passwd" \
    /var/audit/20031016184719.20031017122634

Select all records containing path tokens, where the pathname is a TTY device:

auditreduce -o file="/dev/tty[a-zA-Z][0-9]+" \
    /var/audit/20031016184719.20031017122634

Select all records containing path tokens, where the pathname is a TTY except for /dev/ttyp2 β€” see that little ~ doing the excluding? that's the whole trick ✨:

auditreduce -o file="~/dev/ttyp2,/dev/tty[a-zA-Z][0-9]+" \
    /var/audit/20031016184719.20031017122634

πŸ’œ SEE ALSO πŸ’œ

praudit(1), audit_control(5), audit_event(5)

go read those too, they're all friends. 🌸


πŸŽ€ HISTORY πŸŽ€

The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc. in 2004. πŸ—“οΈ It was subsequently adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution. lore. πŸ”₯


πŸ‘‘ AUTHORS πŸ‘‘

This software was created by McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer Inc. Additional authors include Wayne Salamon, Robert Watson, and SPARTA Inc. πŸ’…

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


okay that's the whole page bestie, you ate that. πŸ«ΆπŸ’– this one's from Debian, dated January 24, 2004 β€” vintage but still slaying, periodt. βœ¨πŸ’…

πŸ“¦ where this page comes from