<?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 How to change the user Splunk runs scripts as? in Security</title>
    <link>https://community.splunk.com/t5/Security/How-to-change-the-user-Splunk-runs-scripts-as/m-p/278253#M7486</link>
    <description>&lt;P&gt;We've been using the functionality in Splunk to have it kick off a script when certain search criteria is met. However, we noticed Splunk is executing those scripts as root. How can we change the user it runs scripts as? Note, that Splunk itself is not running from the root user, but a Splunk user.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Feb 2016 16:14:45 GMT</pubDate>
    <dc:creator>Myelin</dc:creator>
    <dc:date>2016-02-10T16:14:45Z</dc:date>
    <item>
      <title>How to change the user Splunk runs scripts as?</title>
      <link>https://community.splunk.com/t5/Security/How-to-change-the-user-Splunk-runs-scripts-as/m-p/278253#M7486</link>
      <description>&lt;P&gt;We've been using the functionality in Splunk to have it kick off a script when certain search criteria is met. However, we noticed Splunk is executing those scripts as root. How can we change the user it runs scripts as? Note, that Splunk itself is not running from the root user, but a Splunk user.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 16:14:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-change-the-user-Splunk-runs-scripts-as/m-p/278253#M7486</guid>
      <dc:creator>Myelin</dc:creator>
      <dc:date>2016-02-10T16:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the user Splunk runs scripts as?</title>
      <link>https://community.splunk.com/t5/Security/How-to-change-the-user-Splunk-runs-scripts-as/m-p/278254#M7487</link>
      <description>&lt;P&gt;Splunk should be running scripts as the user which splunkd runs as as far as I am aware - do you have the scripts in the $SPLUNK_HOME/bin/scripts directory? or are they part of a custom app?&lt;/P&gt;

&lt;P&gt;What sort of scripts are we talking about? Shell, VBS, Powershell?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 16:20:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-change-the-user-Splunk-runs-scripts-as/m-p/278254#M7487</guid>
      <dc:creator>LewisWheeler</dc:creator>
      <dc:date>2016-02-10T16:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the user Splunk runs scripts as?</title>
      <link>https://community.splunk.com/t5/Security/How-to-change-the-user-Splunk-runs-scripts-as/m-p/278255#M7488</link>
      <description>&lt;P&gt;The scripts are in fact in the $SPLUNK_HOME/bin/scripts directory and these are shell scripts.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 16:27:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-change-the-user-Splunk-runs-scripts-as/m-p/278255#M7488</guid>
      <dc:creator>Myelin</dc:creator>
      <dc:date>2016-02-10T16:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the user Splunk runs scripts as?</title>
      <link>https://community.splunk.com/t5/Security/How-to-change-the-user-Splunk-runs-scripts-as/m-p/278256#M7489</link>
      <description>&lt;P&gt;If your scripts run as root then modify your scripts to "&lt;CODE&gt;su - desired_user -c commands&lt;/CODE&gt;".&lt;/P&gt;

&lt;P&gt;There are actually two ways to go about that.&lt;/P&gt;

&lt;P&gt;If your script is short and has let's say one command in it to run as another user then you could change this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;some_command_or_script_to_run
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;su - desired_user -c some_command_or_script_to_run
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or if your script is quite long with many different commands in it then you could make a wrapper script that had a line in it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;su - desired_user -c that_long_script_ with_too_many_lines_to_edit
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Feb 2016 17:46:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-change-the-user-Splunk-runs-scripts-as/m-p/278256#M7489</guid>
      <dc:creator>lycollicott</dc:creator>
      <dc:date>2016-02-10T17:46:23Z</dc:date>
    </item>
  </channel>
</rss>

