Running Splunk 9.3.5 on RHEL 8. STIG hardened environment.
The non-Splunk RHEL instances running a Universal Forwarder have no issue access the audit.log files, apparently by virtue of the statement
AmbientCapabilities=CAP_DAC_READ_SEARCH
located in the /etc/systemd/system/SplunkForwarder.service file. However, the same is not true on the Splunk instance. They require read access permissions via a file ACL or something. Where these options all result in multiple STIG compliance findings. Which each require write ups a vendor (Splunk) dependencies.
Question - why? Why can't Splunk access the audit.log files the same way as the UF? Or is there some way to do the same sort of thing with AmbientCapabilities for Splunkd.Service?
It is tempting to quit collecting these logs with Splunk itself and install UF on the Splunk instances too.
Too follow up. Using
[Service] AmbientCapabilities=CAP_DAC_READ_SEARCH
This fails under the following conditions:
ExecStart=!/opt/splunk/bin/splunk _internal_launch_under_systemd
If so, you will need to recreate the Splunkd.service file.
This works with a current Splunk version (mine is 9.3.5) created Splunkd.service file and using the Splunk_TA_nix script method of ingest using rlog.sh.
Kuddos to @livehybrid for causing me to review and realize I had an out of date Splunkd.service file
Hi @ewok
The Splunk Enterprise systemd unit (splunkd.service) is not shipped with the same AmbientCapabilities=CAP_DAC_READ_SEARCH line that the Universal Forwarder package adds to its own unit (SplunkForwarder.service).
That line gives the UF process the Linux capability to bypass discretionary access controls (DAC) and read files such as /var/log/audit/audit.log even when the file is mode 0600 and owned by root.
Enterprise installs simply omit that stanza, so splunkd runs with the default capability set and cannot open the audit log unless you relax the permissions or run Splunk as root (both STIG-failures).
You can alter this behaviour for Splunk Enterprise (Full install) by editing the splunkd.service file:
systemctl edit splunkd.service
[Service] AmbientCapabilities=CAP_DAC_READ_SEARCH
systemctl daemon-reload systemctl restart splunkd.service
After the restart the running splunkd should have the same capability that the UF has and can read /var/log/audit/audit.log without touching file permissions or adding ACLs.
The override should not be overwritten with Splunk package upgrades, but always verify after an upgrade that its still in place.
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing
UF explicitly supports adding Linux capabilities via the AmbientCapabilities=CAP_DAC_READ_SEARCH setting. But full Splunk Enterprise instance does not utilize AmbientCapabilities, so it lacks these elevated per-file read permissions.
So your options to consider is,
-Use the Universal Forwarder on Splunk server hosts for audit log collection and keep Splunk Enterprise running as non-root.
-Run Splunkd as root (least preferred).
So my recommendation is If strict STIG compliance is essential, the best approach is to install the Universal Forwarder (UF) on your Splunk and use it solely for audit log collection.
Regards,
Prewin
Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!
Hi @ewok
The Splunk Enterprise systemd unit (splunkd.service) is not shipped with the same AmbientCapabilities=CAP_DAC_READ_SEARCH line that the Universal Forwarder package adds to its own unit (SplunkForwarder.service).
That line gives the UF process the Linux capability to bypass discretionary access controls (DAC) and read files such as /var/log/audit/audit.log even when the file is mode 0600 and owned by root.
Enterprise installs simply omit that stanza, so splunkd runs with the default capability set and cannot open the audit log unless you relax the permissions or run Splunk as root (both STIG-failures).
You can alter this behaviour for Splunk Enterprise (Full install) by editing the splunkd.service file:
systemctl edit splunkd.service
[Service] AmbientCapabilities=CAP_DAC_READ_SEARCH
systemctl daemon-reload systemctl restart splunkd.service
After the restart the running splunkd should have the same capability that the UF has and can read /var/log/audit/audit.log without touching file permissions or adding ACLs.
The override should not be overwritten with Splunk package upgrades, but always verify after an upgrade that its still in place.
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing