<?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 Execute script on forwarder with privileges in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636123#M108804</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;&lt;EM&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;/EM&gt;&lt;/P&gt;&lt;P&gt;My forwarders boot from splunk user (if change boot to root - script works). Splunk user is in sudoers, it have rights to execute sudo commands, but as far as I understand script must be executed with root user, not anyone else even if it have sudo privileges.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/usr/bin/sudo - nosuid option not&amp;nbsp; set, and file system isn't NFS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried to make owner of script root, and give to it setuid, but still not works.&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;How to make script be executable by splunk user?&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2023 09:49:18 GMT</pubDate>
    <dc:creator>JohnDuatres</dc:creator>
    <dc:date>2023-03-27T09:49:18Z</dc:date>
    <item>
      <title>Execute script on forwarder with privileges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636123#M108804</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;&lt;EM&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;/EM&gt;&lt;/P&gt;&lt;P&gt;My forwarders boot from splunk user (if change boot to root - script works). Splunk user is in sudoers, it have rights to execute sudo commands, but as far as I understand script must be executed with root user, not anyone else even if it have sudo privileges.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/usr/bin/sudo - nosuid option not&amp;nbsp; set, and file system isn't NFS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried to make owner of script root, and give to it setuid, but still not works.&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;How to make script be executable by splunk user?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 09:49:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636123#M108804</guid>
      <dc:creator>JohnDuatres</dc:creator>
      <dc:date>2023-03-27T09:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Execute script on forwarder with privileges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636128#M108805</link>
      <description>&lt;P&gt;Can you share the output of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ls -l /bin/sudo&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sudo needs to have the suid permission set to run as root. Could this have been unset?&lt;/P&gt;&lt;P&gt;Whilst you're there (as the Splunk user), does your sudo command execute properly when ran directly on the CLI (instead of via the scripted input).&lt;/P&gt;&lt;P&gt;Also can you share some more details about the OS please?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 10:29:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636128#M108805</guid>
      <dc:creator>Tom_Lundie</dc:creator>
      <dc:date>2023-03-27T10:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Execute script on forwarder with privileges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636130#M108806</link>
      <description>&lt;P&gt;root@astra:/opt/splunkforwarder/etc/apps/app/bin# ls -l /usr/bin/sudo&lt;BR /&gt;---s--x--x 1 root root 141528 jan 23 2021 /usr/bin/sudo&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;setuid is set&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Whilst you're there (as the Splunk user), does your sudo command execute properly when ran directly on the CLI (instead of via the scripted input).&lt;/EM&gt; - yes it works, if i'm using su splunk, and execute script manually&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;EM&gt;Also can you share some more details about the OS please?&lt;/EM&gt; - it's Astra Linux OS, but same problem I see on RHEL&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Mar 2023 10:42:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636130#M108806</guid>
      <dc:creator>JohnDuatres</dc:creator>
      <dc:date>2023-03-27T10:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Execute script on forwarder with privileges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636136#M108808</link>
      <description>&lt;P&gt;If you're not running this within some docker container, the culprit might be SELinux.&lt;/P&gt;&lt;P&gt;Is SELinux on?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 11:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636136#M108808</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-03-27T11:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Execute script on forwarder with privileges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636138#M108809</link>
      <description>&lt;P&gt;no, commands sestatus and getenforce shows that no such commands&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 11:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636138#M108809</guid>
      <dc:creator>JohnDuatres</dc:creator>
      <dc:date>2023-03-27T11:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Execute script on forwarder with privileges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636159#M108812</link>
      <description>&lt;P&gt;looks like I found the reason of problem&lt;/P&gt;&lt;P&gt;it was set parameter NoNewPrivileges=Yes&amp;nbsp;&lt;/P&gt;&lt;P&gt;in forwarder systemd service&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 14:50:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Execute-script-on-forwarder-with-privileges/m-p/636159#M108812</guid>
      <dc:creator>JohnDuatres</dc:creator>
      <dc:date>2023-03-27T14:50:04Z</dc:date>
    </item>
  </channel>
</rss>

