Launcher Products Bitnami Documentationimaxe CLI Blog Contact
imaxe audit audit v1.0.0

System auditing, in plain language

Query auditd events and manage the CIS audit rules with readable commands — without memorizing the syntax of auditctl or ausearch. See who logged in, what was touched and which rules are loaded at a glance.

$ imaxe audit events --since today
Version
v1.0.0
Subcommands
6
Config
/etc/imaxe/audit.yml
Requires root
yes
Engine
auditd · auditctl

What this module does #

auditd is the Linux kernel's auditing subsystem: it records who logs in, who uses sudo, which sensitive files are modified and which system calls are executed. It is the foundation of almost any compliance requirement (CIS, PCI, ISO). The problem is that its native tools — auditctl, ausearch, aureport — have a rough, unfriendly syntax.

The audit module puts a readable layer on top: it tells you at a glance whether auditd is active and with its rules loaded, lists recent events filtering by time or by rule key, gives you a report-style summary (logins, sudo/authentication and file changes) and lets you query the active CIS audit rules — all without having to remember each tool's flags.

Before you start

auditd rules are usually loaded in immutable mode (locked until the next reboot) so nobody can disable them on the fly. That's why reload will warn you if a change requires a reboot instead of forcing it through.

Quick startstep-by-step tasks

Common tasks #

Pick what you want to do. Each recipe comes with the command ready to go — copy it, adjust it if needed and hit Copy.

1

Check whether auditing is active

Confirms that auditd is running, with its rules loaded and no backlog.

Connect to your server over SSH as the ubuntu user and run:

terminal
$ sudo imaxe audit status

Need the output for a script or a dashboard? Add --json:

terminal
$ sudo imaxe audit status --json
You see whether auditd is active, how many rules are loaded, whether the mode is immutable and whether the backlog is healthy.
2

View recent events

See what has happened, filtering by time or by rule key.

List today's events in a readable summary:

terminal
$ sudo imaxe audit events --since today

Want only the events of a specific rule (by its key) and in JSON? Combine --key and --json:

terminal
$ sudo imaxe audit events --key identity --json
You get the filtered events without remembering the syntax of ausearch. If you don't pass --since, the default window from audit.yml is used.
3

Get a summary of the day

An aureport-style report: logins, sudo/auth and file changes.

Ask for the aggregated activity summary:

terminal
$ sudo imaxe audit summary
At a glance you see how many logins, uses of sudo and file modifications have been recorded.
4

View or reload the rules

Query the active rules and apply changes while respecting immutable mode.

List the audit rules loaded right now (equivalent to auditctl -l):

terminal
$ sudo imaxe audit rules list

If you have edited the rule files, reload them. If the system is in immutable mode, the command will warn you that a reboot is required:

terminal
$ sudo imaxe audit rules list --json
$ sudo imaxe audit reload
You know exactly which rules are watching the system and can apply changes without disabling protection by mistake.
No events showing up?

If events comes up empty, first check with status that auditd is active and has its rules loaded. Perhaps the --since window is too short, or no rule uses the key you're filtering by. Check the rules with rules list.

CLI referencecommands, flags and files

Synopsis #

usage
imaxe audit <subcomando> [<subcomando anidado>] [--since T] [--key K] [--json]

Every subcommand reads from the auditing subsystem, which is only accessible as root (use sudo). Add --json to status, events or rules list for machine-readable output, suitable for scripting and dashboards.

Subcommands #

SubcommandWhat it doesRelevant flags
statusStatus: auditd active, rules loaded, immutable mode and backlog.--json
eventsLists recent, filterable events in a readable summary.--since, --key, --json
summaryaureport-style summary: logins, sudo/auth and file changes.
rulesManagement group for the audit rules. Requires a nested subcommand.
rules listLists the active rules (equivalent to auditctl -l).--json
reloadReloads the rules; respects immutable mode and warns if a reboot is required.

Arguments and flags #

FlagTypeDefaultDescription
--sincestringaudit.ymlIn events: from when to list (e.g. today, recent, 'now-1 hour'). If omitted, default_since from audit.yml is used.
--keystringIn events: filters by the key of an auditd rule (e.g. identity).
--jsonboolfalseIn status, events and rules list: emits the result as structured JSON on stdout.

summary, rules and reload take no flags: they run as-is. Remember that rules always needs the nested subcommand list.

Files and paths #

PathContents
/etc/imaxe/audit.ymlModule configuration: default window for events (default_since) and other options.
/etc/audit/audit.rulesAudit rules loaded at boot by auditd (CIS baseline).
/etc/audit/rules.d/Rule fragments that are assembled into the final set.
/var/log/audit/audit.logEvent log that auditd writes and that events/summary read.

Example audit.yml:

/etc/imaxe/audit.yml
events:
  default_since: today

Exit codes and logs #

Each run returns a code you can check with echo $? — handy for chaining in scripts:

0OKQuery or operation completed successfully.
1ERRGeneric unclassified error. Check the log.
2USAGEInvalid arguments or missing nested subcommand.
3AUDITDauditd is not active or not responding.
4IMMUTABLEThe change requires a reboot (rules locked).

Follow the log live while you troubleshoot:

terminal
$ sudo journalctl -u auditd -f
$ sudo tail -f /var/log/audit/audit.log

Troubleshooting #

SymptomLikely causeFix
You get AUDITD (code 3)The auditd service is not running.Start it with systemctl start auditd and repeat imaxe audit status.
events returns nothing--since window too short or nonexistent key.Widen --since (e.g. 'now-1 hour') or check the keys with rules list.
reload warns about a rebootThe rules are in immutable mode (locked until reboot).Schedule a reboot to apply the changes; until then the previous rules remain in effect.
You get USAGE (code 2)rules was called without the nested subcommand.Use imaxe audit rules list: rules always requires a subcommand.

Stuck with the Audit module?

Write to us with the output of «imaxe <module> status --json» and we'll get back to you fast.

Contact support