Reader small image

You're reading from  SELinux Cookbook

Product typeBook
Published inSep 2014
Publisher
ISBN-139781783989669
Edition1st Edition
Right arrow
Author (1)
Sven Vermeulen
Sven Vermeulen
author image
Sven Vermeulen

Sven Vermeulen (sjvermeu on Twitter) is a long-term contributor to various free software projects and the author of several online guides and resources, including the Gentoo Handbook. He got his first taste of free software in 1997 and never looked back. Within SELinux, Sven contributed several policies to the Reference Policy project, and actively participated in policy development and user space development projects. In his daily job, Sven is an enterprise architect in a European financial institution as well as a self-employed solution engineer and consultant. Prior to this, he graduated with an MSE in computer engineering from Ghent University and an MSc in ICT enterprise architecture from IC Institute.
Read more about Sven Vermeulen

Right arrow

Starting Apache with limited clearance


In the previous chapter, we manipulated the /etc/rc.d/init.d/httpd init script to use runcon in order for the web server to run with a limited clearance. But with the help of mod_selinux, this can be made configurable.

How to do it…

In order to start Apache with limited security clearance, follow the given steps:

  1. Edit the Apache web server configuration file (httpd.conf) and add in the following code:

    <IfModule mod_selinux.c>
      selinuxServerDomain *:s0-s0:c0.c10
    </IfModule>
  2. Undo the changes made to the service script in the previous chapter.

  3. Restart the web server and confirm that it is running with the s0-s0:c0.c10 clearance by issuing the following commands:

    ~# /etc/rc.d/init.d/httpd restart
    ~# ps -efZ | grep httpd
    system_u:system_r:httpd_t:s0-s0:c0.c10 root 2838 1  0 13:14 ?      00:00:00 /usr/sbin/httpd
    system_u:system_r:httpd_t:s0-s0:c0.c10 apache 2840 2838  0 13:14 ? 00:00:00 /usr/sbin/httpd
    

How it works...

As mentioned before, with mod_selinux...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
SELinux Cookbook
Published in: Sep 2014Publisher: ISBN-13: 9781783989669

Author (1)

author image
Sven Vermeulen

Sven Vermeulen (sjvermeu on Twitter) is a long-term contributor to various free software projects and the author of several online guides and resources, including the Gentoo Handbook. He got his first taste of free software in 1997 and never looked back. Within SELinux, Sven contributed several policies to the Reference Policy project, and actively participated in policy development and user space development projects. In his daily job, Sven is an enterprise architect in a European financial institution as well as a self-employed solution engineer and consultant. Prior to this, he graduated with an MSE in computer engineering from Ghent University and an MSc in ICT enterprise architecture from IC Institute.
Read more about Sven Vermeulen