<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Privilege checks for Script in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709720#M21422</link>
    <description>&lt;P&gt;Yes, am getting output for below commands,&lt;/P&gt;&lt;PRE&gt;sudo /usr/bin/crictl ps -a&lt;/PRE&gt;&lt;PRE&gt;splunk cmd sudo /usr/bin/crictl ps -a &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2025 16:08:31 GMT</pubDate>
    <dc:creator>msmadhu</dc:creator>
    <dc:date>2025-01-24T16:08:31Z</dc:date>
    <item>
      <title>Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709681#M21410</link>
      <description>&lt;P&gt;Hello, team&lt;/P&gt;&lt;P&gt;I've made script, which uses the sudo command. I've deployed it on my forwarders and I get the error:&lt;/P&gt;&lt;P&gt;message from "/opt/splunkforwarder/etc/apps/app/bin/script.sh" sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?&lt;/P&gt;&lt;P&gt;Please help to fix this issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 13:44:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709681#M21410</guid>
      <dc:creator>msmadhu</dc:creator>
      <dc:date>2025-01-24T13:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709710#M21417</link>
      <description>&lt;P&gt;And did you check what sudo told you? Does your sudo work at all?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 15:33:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709710#M21417</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-01-24T15:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709718#M21420</link>
      <description>&lt;P&gt;Yes, my script is working with sudo only&lt;BR /&gt;below script for reference&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;# Set the working directory to the script's directory&lt;/P&gt;&lt;P&gt;cd "$(dirname "$0")" || exit 1&lt;/P&gt;&lt;P&gt;# Full paths for commands&lt;/P&gt;&lt;P&gt;CRICTL_PATH="/usr/bin/crictl"&amp;nbsp; # Adjust the path if necessary&lt;/P&gt;&lt;P&gt;# Get container list&lt;/P&gt;&lt;P&gt;container_list=$(sudo "$CRICTL_PATH" ps -a)&lt;/P&gt;&lt;P&gt;echo "$container_list" | sed '1s/POD ID/POD_ID/g'&lt;/P&gt;&lt;P&gt;IFS=$'\n'&lt;/P&gt;&lt;P&gt;for container_info in $(echo "$container_list" | tail -n +2); do&lt;/P&gt;&lt;P&gt;container_id=$(echo "$container_info" | awk '{print $1}')&lt;/P&gt;&lt;P&gt;&amp;nbsp;container_name=$(echo "$container_info" | awk '{print $4}')&lt;/P&gt;&lt;P&gt;done&lt;BR /&gt;&lt;BR /&gt;##############&lt;BR /&gt;&lt;SPAN&gt;cat /etc/sudoers.d/splunk&lt;BR /&gt;splunk ALL=(ALL) NOPASSWD: /usr/bin/crictl,/usr/bin/podman&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 15:56:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709718#M21420</guid>
      <dc:creator>msmadhu</dc:creator>
      <dc:date>2025-01-24T15:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709719#M21421</link>
      <description>&lt;P&gt;OK. So first steps to debug such issue would be to:&lt;/P&gt;&lt;P&gt;1) Run (as splunk user)&lt;/P&gt;&lt;PRE&gt;sudo /usr/bin/crictl&lt;/PRE&gt;&lt;P&gt;I'm assuming you already checked that&lt;/P&gt;&lt;P&gt;2) Run (again - as splunk user)&lt;/P&gt;&lt;PRE&gt;splunk cmd sudo /usr/bin/crictl&lt;/PRE&gt;&lt;P&gt;(the actual parameters for crictl are not important here, we just want to see if the command will be properly spawned at all).&lt;/P&gt;&lt;P&gt;Having said that - I'm not a very big fan of escalating privileges that way from splunk. As I understand, this is a scripted input. I'd rather have a script spawned by cron and capture its output and then ingest that output file with a normal monitor input.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:02:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709719#M21421</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-01-24T16:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709720#M21422</link>
      <description>&lt;P&gt;Yes, am getting output for below commands,&lt;/P&gt;&lt;PRE&gt;sudo /usr/bin/crictl ps -a&lt;/PRE&gt;&lt;PRE&gt;splunk cmd sudo /usr/bin/crictl ps -a &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:08:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709720#M21422</guid>
      <dc:creator>msmadhu</dc:creator>
      <dc:date>2025-01-24T16:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709722#M21423</link>
      <description>&lt;P&gt;Hmm...&lt;/P&gt;&lt;P&gt;And if you run your whole script with `splunk cmd`?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:33:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709722#M21423</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-01-24T16:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709803#M21437</link>
      <description>&lt;P&gt;Yes, script is woking with "splunk cmd" also&lt;BR /&gt;&lt;BR /&gt;splunk cmd ./crio_simple_ps.sh&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 05:27:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709803#M21437</guid>
      <dc:creator>msmadhu</dc:creator>
      <dc:date>2025-01-27T05:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709815#M21439</link>
      <description>&lt;P&gt;Thay is puzzling there because assuming that you're running it with the same user as your forwarder runs with you should be having the same environment.&lt;/P&gt;&lt;P&gt;The things I'd check would be:&lt;/P&gt;&lt;P&gt;1) selinux alerts (if anything which should work doesn't it's often selinux ;-))&lt;/P&gt;&lt;P&gt;2) dump the environment to a file at the beginning of your script and compare the version you get from running it with "splunk cmd" with the output from when it's actually run by thr forwarder.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 10:54:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709815#M21439</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-01-27T10:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709819#M21440</link>
      <description>&lt;P&gt;Selinux alerts is disabled and not getting on second point.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;But when i comment #&lt;SPAN&gt;NoNewPrivileges=Yes line from file&amp;nbsp;/etc/systemd/system/SplunkForwarder.service. It will work. But not sure why Splunk service privilege is stoping this.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 11:29:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709819#M21440</guid>
      <dc:creator>msmadhu</dc:creator>
      <dc:date>2025-01-27T11:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709833#M21444</link>
      <description>&lt;P&gt;Makes sense&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html" target="_blank" rel="noopener"&gt;https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html&lt;/A&gt;&lt;/P&gt;&lt;H2&gt;Security&lt;/H2&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;NoNewPrivileges=&lt;/SPAN&gt;&lt;P&gt;Takes a boolean argument. If true, ensures that the service process and all its children can never gain new privileges through execve() (e.g. via setuid or setgid bits, or filesystem capabilities). This is the simplest and most effective way to ensure that a process and its children can never elevate privileges again. Defaults to false. In case the service will be run in a new mount namespace anyway and SELinux is disabled, all file systems are mounted with MS_NOSUID flag. Also see &lt;A class="" href="https://docs.kernel.org/userspace-api/no_new_privs.html" target="_top"&gt;No New Privileges Flag&lt;/A&gt;.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Jan 2025 13:36:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/709833#M21444</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-01-27T13:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742476#M21952</link>
      <description>&lt;P&gt;Hi, i have same case also, but now it's solved, bellow my workaround :&lt;/P&gt;&lt;P&gt;1. Add splunk user to &lt;STRONG&gt;/etc/sudoers&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;splunk-user ALL=(ALL) NOPASSWD: ALL&lt;/LI-CODE&gt;&lt;P&gt;2. Add&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;!requiretty &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;splunk user&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Defaults:splunk-user    !requiretty&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For point no. 2,&amp;nbsp;&lt;SPAN&gt;basically splunk running script on &lt;STRONG&gt;non-interactive&lt;/STRONG&gt; environment by defaults, so we need add permission to pass it. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Running manual the command in CLI is interactive, thats why we don't need &lt;STRONG&gt;!requiretty&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Mar 2025 18:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742476#M21952</guid>
      <dc:creator>muhammad_luthfi</dc:creator>
      <dc:date>2025-03-23T18:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742477#M21953</link>
      <description>&lt;P&gt;Continuoing last reply :&lt;/P&gt;&lt;P&gt;Bellow my error during troubleshoot :&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;&lt;SPAN&gt;sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' &amp;nbsp;-&amp;gt; &lt;STRONG&gt;Because splunk running as a root user, &lt;/STRONG&gt;i have&amp;nbsp;change back splunk to non-root user and see bellow error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;sudo: sorry, you must have a tty to run sudo -&amp;gt; &lt;STRONG&gt;Required&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;!requiretty permission on /etc/sudoers&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for me Splunk is powerfull tools, since i got this workaround, Ansible task can be done with splunk directly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Mar 2025 19:16:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742477#M21953</guid>
      <dc:creator>muhammad_luthfi</dc:creator>
      <dc:date>2025-03-23T19:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742480#M21954</link>
      <description>&lt;P&gt;OMG. Don't do that!&lt;/P&gt;&lt;P&gt;This way you're allowing anyone who has permission to run local programs (and I can think of several ways to do so) effectively do anything with your system. This is like saying "Oh, I solved the problem with my front door lock by leaving the door wide open".&lt;/P&gt;</description>
      <pubDate>Sun, 23 Mar 2025 20:53:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742480#M21954</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-03-23T20:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742482#M21956</link>
      <description>&lt;P&gt;This is exactly like&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;said, never do it like this! You lost all security in your system!&lt;/P&gt;&lt;P&gt;If/when you need that information then better way is to use e.g. cron and export output to some file which are read by splunk. Just give needed access to that file with setfacl. And down use chmod with 777!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Mar 2025 21:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742482#M21956</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2025-03-23T21:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Privilege checks for Script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742488#M21961</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Yes, you are correct, thats solution will be impact to security, i run this for testing purpose on Dev, just to see how splunk works with custom script sudo.&lt;/P&gt;&lt;P&gt;My implementation is read log file based on crontab.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 01:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Privilege-checks-for-Script/m-p/742488#M21961</guid>
      <dc:creator>muhammad_luthfi</dc:creator>
      <dc:date>2025-03-24T01:48:18Z</dc:date>
    </item>
  </channel>
</rss>

