All Apps and Add-ons

Convert audit.log uid to usernames using rlog.sh

jsb22
Path Finder

I've seen references to leveraging the rlog.sh script in the *NIX app to convert Linux uids and gids in the audit.log to human readable usernames, but I have not found exactly how to use this solution on custom apps. How can I use the rlog.sh in a custom app so the audit.log data coming in is in a human readable format. I assume this is not as simple as placing the file on the indexer, within the app's bin directory?

0 Karma
1 Solution

jsb22
Path Finder

It appears I figured out the solution. This setup essentially uses a "scripted-input". Add the following to your inputs.conf in your custom-app for your forwarder:

# This script reads the auditd logs translated with ausearch
[script://./bin/rlog.sh]
sourcetype = auditd
source = auditd
interval = 60
index = [INDEX NAME - CHANGE ME (default is "os"]
disabled = 0

Place a copy of the common.sh (rlog.sh leverages common.sh) and rlog.sh scripts in a directory called "bin" within the root your custom-app on the forwarder. That's it! Now I just need to figure out how to combine the 3 lines generated per log item in the audit.log to read as a single event.

View solution in original post

jsb22
Path Finder

It appears I figured out the solution. This setup essentially uses a "scripted-input". Add the following to your inputs.conf in your custom-app for your forwarder:

# This script reads the auditd logs translated with ausearch
[script://./bin/rlog.sh]
sourcetype = auditd
source = auditd
interval = 60
index = [INDEX NAME - CHANGE ME (default is "os"]
disabled = 0

Place a copy of the common.sh (rlog.sh leverages common.sh) and rlog.sh scripts in a directory called "bin" within the root your custom-app on the forwarder. That's it! Now I just need to figure out how to combine the 3 lines generated per log item in the audit.log to read as a single event.

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...