<?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: Want to confine splunk process running on servers as required by our audit. How to achieve? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Want-to-confine-splunk-process-running-on-servers-as-required-by/m-p/418728#M173531</link>
    <description>&lt;P&gt;Background on how things working on Linux:&lt;/P&gt;

&lt;P&gt;1.All processes and files are labeled. SELinux policy rules define how processes interact with files, as well as how processes interact with each other. Access is only allowed if an SELinux policy rule exists that specifically allows it.&lt;/P&gt;

&lt;P&gt;2.Fine-grained access control. Stepping beyond traditional UNIX permissions that are controlled at user discretion and based on Linux user and group IDs, SELinux access decisions are based on all available information, such as an SELinux user, role, type, and, optionally, a security level.&lt;BR /&gt;
SELinux policy is administratively-defined and enforced system-wide.&lt;/P&gt;

&lt;P&gt;What is the meaning of confining a process? Explain confined.&lt;BR /&gt;
*  When a process is confined, it runs in its own domain. If a confined process is compromised by an attacker, depending on SELinux policy configuration, an attacker's access to resources and the possible damage they can do is limited&lt;/P&gt;

&lt;P&gt;For those who are interested to know more about SElinux(confined/unconfed process) please read &lt;A href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/chap-security-enhanced_linux-targeted_policy#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes" target="_blank"&gt;https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/chap-security-enhanced_linux-targeted_policy#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Solution :&lt;BR /&gt;
I tried below steps to confine Splunk process. Please find the before and after output below. I tried the exact steps listed below. For information about the commands used below use 'man command' or read &lt;A href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/chap-security-enhanced_linux-targeted_policy#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes" target="_blank"&gt;https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/chap-security-enhanced_linux-targeted_policy#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Before: &lt;BR /&gt;
[root@selinux_policy_for_splunk-master]# ps -eZ| grep splunk &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 5039 ? 1-04:37:17 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 5041 ? 00:03:15 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 5285 ? 00:33:43 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 13110 ? 00:00:00 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 13111 ? 00:00:00 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 13112 ? 00:00:00 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 13114 ? 00:00:00 splunkd &lt;BR /&gt;
[root@selinux_policy_for_splunk-master]# semodule -i splunk.pp &lt;BR /&gt;
[root@sselinux_policy_for_splunk-master]# restorecon -R /opt/splunk &lt;BR /&gt;
[root@sselinux_policy_for_splunk-master]# restorecon /etc/init.d/splunk &lt;BR /&gt;
[root@selinux_policy_for_splunk-master]# /etc/init.d/splunk restart &lt;BR /&gt;
Restarting splunk (via systemctl): [ OK ] &lt;/P&gt;

&lt;P&gt;After: &lt;BR /&gt;
[root@selinux_policy_for_splunk-master]# ps -eZ| grep splunk &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13521 ? 00:00:11 splunkd &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13524 ? 00:00:00 splunkd &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13725 ? 00:00:00 mongod &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13821 ? 00:00:00 python &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13828 ? 00:00:00 python &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13847 ? 00:00:00 splunkd &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13861 ? 00:00:01 python &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13863 ? 00:00:19 java &lt;BR /&gt;
system_u:system_r:splunk_t:s0 14074 ? 00:00:00 splunkd &lt;BR /&gt;
system_u:system_r:splunk_t:s0 14075 ? 00:00:00 splunkd &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:52:45 GMT</pubDate>
    <dc:creator>sdubey_splunk</dc:creator>
    <dc:date>2020-09-29T22:52:45Z</dc:date>
    <item>
      <title>Want to confine splunk process running on servers as required by our audit. How to achieve?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Want-to-confine-splunk-process-running-on-servers-as-required-by/m-p/418727#M173530</link>
      <description>&lt;P&gt;Issue:&lt;BR /&gt;
Splunk is running as unconfiged daemon&lt;/P&gt;

&lt;H1&gt;ps -eZ | egrep "initrc" | egrep -vw "tr|ps|egrep|bash|awk" | tr ':' ' ' | awk '{ print $NF }'&lt;/H1&gt;

&lt;P&gt;splunkd&lt;BR /&gt;
(Truncated output, I am interested in confining Splunk Process)&lt;/P&gt;

&lt;P&gt;We have an audit requirement to confine Splunk process. How to achieve?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jan 2019 08:53:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Want-to-confine-splunk-process-running-on-servers-as-required-by/m-p/418727#M173530</guid>
      <dc:creator>sdubey_splunk</dc:creator>
      <dc:date>2019-01-19T08:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Want to confine splunk process running on servers as required by our audit. How to achieve?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Want-to-confine-splunk-process-running-on-servers-as-required-by/m-p/418728#M173531</link>
      <description>&lt;P&gt;Background on how things working on Linux:&lt;/P&gt;

&lt;P&gt;1.All processes and files are labeled. SELinux policy rules define how processes interact with files, as well as how processes interact with each other. Access is only allowed if an SELinux policy rule exists that specifically allows it.&lt;/P&gt;

&lt;P&gt;2.Fine-grained access control. Stepping beyond traditional UNIX permissions that are controlled at user discretion and based on Linux user and group IDs, SELinux access decisions are based on all available information, such as an SELinux user, role, type, and, optionally, a security level.&lt;BR /&gt;
SELinux policy is administratively-defined and enforced system-wide.&lt;/P&gt;

&lt;P&gt;What is the meaning of confining a process? Explain confined.&lt;BR /&gt;
*  When a process is confined, it runs in its own domain. If a confined process is compromised by an attacker, depending on SELinux policy configuration, an attacker's access to resources and the possible damage they can do is limited&lt;/P&gt;

&lt;P&gt;For those who are interested to know more about SElinux(confined/unconfed process) please read &lt;A href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/chap-security-enhanced_linux-targeted_policy#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes" target="_blank"&gt;https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/chap-security-enhanced_linux-targeted_policy#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Solution :&lt;BR /&gt;
I tried below steps to confine Splunk process. Please find the before and after output below. I tried the exact steps listed below. For information about the commands used below use 'man command' or read &lt;A href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/chap-security-enhanced_linux-targeted_policy#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes" target="_blank"&gt;https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/chap-security-enhanced_linux-targeted_policy#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Before: &lt;BR /&gt;
[root@selinux_policy_for_splunk-master]# ps -eZ| grep splunk &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 5039 ? 1-04:37:17 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 5041 ? 00:03:15 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 5285 ? 00:33:43 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 13110 ? 00:00:00 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 13111 ? 00:00:00 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 13112 ? 00:00:00 splunkd &lt;BR /&gt;
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 13114 ? 00:00:00 splunkd &lt;BR /&gt;
[root@selinux_policy_for_splunk-master]# semodule -i splunk.pp &lt;BR /&gt;
[root@sselinux_policy_for_splunk-master]# restorecon -R /opt/splunk &lt;BR /&gt;
[root@sselinux_policy_for_splunk-master]# restorecon /etc/init.d/splunk &lt;BR /&gt;
[root@selinux_policy_for_splunk-master]# /etc/init.d/splunk restart &lt;BR /&gt;
Restarting splunk (via systemctl): [ OK ] &lt;/P&gt;

&lt;P&gt;After: &lt;BR /&gt;
[root@selinux_policy_for_splunk-master]# ps -eZ| grep splunk &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13521 ? 00:00:11 splunkd &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13524 ? 00:00:00 splunkd &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13725 ? 00:00:00 mongod &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13821 ? 00:00:00 python &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13828 ? 00:00:00 python &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13847 ? 00:00:00 splunkd &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13861 ? 00:00:01 python &lt;BR /&gt;
system_u:system_r:splunk_t:s0 13863 ? 00:00:19 java &lt;BR /&gt;
system_u:system_r:splunk_t:s0 14074 ? 00:00:00 splunkd &lt;BR /&gt;
system_u:system_r:splunk_t:s0 14075 ? 00:00:00 splunkd &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:52:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Want-to-confine-splunk-process-running-on-servers-as-required-by/m-p/418728#M173531</guid>
      <dc:creator>sdubey_splunk</dc:creator>
      <dc:date>2020-09-29T22:52:45Z</dc:date>
    </item>
  </channel>
</rss>

