ausearch_add_item - Linux


Overview

ausearch_add_item enhances the capabilities of the Linux Audit Framework by allowing users to add customizable audit data to audit records. This enables administrators and auditors to capture specific information relevant to their unique security needs.

Syntax

ausearch_add_item -a <attribute> -v <value> [-k <key>] [-c <comments>] [-t <timestamp>] [-e <event>] [-u <user>]

Options/Flags

  • -a, –attribute: Specify the attribute to add to the audit record.
  • -v, –value: Set the value associated with the specified attribute.
  • -k, –key: Provide a key for the attribute. Useful for grouping related attributes together.
  • -c, –comments: Add comments to provide additional context or clarification about the added item.
  • -t, –timestamp: Specify a custom timestamp for the audit record.
  • -e, –event: Set the name of the event to which this item is being added.
  • -u, –user: Specify the username responsible for the action that generated the audit record.

Examples

Simple Usage

ausearch_add_item -a custom_attribute_1 -v sensitive_data

Complex Usage

ausearch_add_item -a audit_rule -v custom_policy_name -c "Policy applied to specific files" -e filesystem_event -u security_analyst -t "$(date +%s)"

Common Issues

  • Invalid attributes: Ensure that the specified attribute is allowed for the particular audit event.
  • Protection: added items may be accessible to unprivileged users, consider using a Trusted Platform Module (TPM) for secure storage.

Integration

ausearch_add_item can be used in conjunction with other audit tools like auditctl to create advanced audit configurations. For example:

auditctl -a exit,always -S execve -F larch=access
ausearch_add_item -a larch.access.0.filename -v /etc/passwd

Related Commands

  • aureport: Generate human-readable reports from audit records.
  • aureport -e: Display audit records with added items.
  • Official documentation: Detailed specifications and additional options.