Skip to content

Commit 5e3377a

Browse files
committed
Update settings for SELinux and Apparmor
1 parent 97a7902 commit 5e3377a

4 files changed

Lines changed: 23 additions & 65 deletions

File tree

source/developersguide/ansible.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,6 @@ For the management server role we create a main.yml task like this:
272272
  template: src=cloudstack.repo.j2 dest=/etc/yum.repos.d/cloudstack.repo
273273

274274

275-
- name: Ensure selinux is in permissive mode
276-
277-
  command: setenforce permissive
278-
279-
280-
- name: Ensure selinux is set permanently
281-
282-
  selinux: policy=targeted state=permissive
283-
284-
285275
-name: Ensure CloudStack packages are installed
286276

287277
yum: name=cloud-client state=present

source/installguide/hypervisor/kvm.rst

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ CloudStack does various things which can be blocked by security
547547
mechanisms like AppArmor and SELinux. These have to be disabled to
548548
ensure the Agent has all the required permissions.
549549

550-
#. Configure SELinux (RHEL, CentOS, SUSE)
550+
#. Configure SELinux (RHEL, CentOS)
551551

552552
#. Check to see whether SELinux is installed on your machine. If not,
553553
you can skip this section.
@@ -560,39 +560,27 @@ ensure the Agent has all the required permissions.
560560
$ rpm -qa | grep selinux
561561
562562
#. Set the SELINUX variable in ``/etc/selinux/config`` to
563-
"permissive". This ensures that the permissive setting will be
563+
"enforcing" or "permissive". This ensures that the setting will be
564564
maintained after a system reboot.
565565

566-
In RHEL or CentOS:
567-
568-
.. parsed-literal::
569-
570-
$ vi /etc/selinux/config
571-
572-
Change the following line
573-
574-
.. parsed-literal::
575-
576-
SELINUX=enforcing
577-
578-
to this
566+
#. Then set SELinux to enforcing or permissive starting immediately, without
567+
requiring a system reboot.
579568

580569
.. parsed-literal::
581570
582-
SELINUX=permissive
571+
$ setenforce enforcing
583572
584-
#. Then set SELinux to permissive starting immediately, without
585-
requiring a system reboot.
573+
#. Set the security driver in ``/etc/libvirt/qemu.conf`` to "none".
586574

587575
.. parsed-literal::
588576
589-
$ setenforce permissive
577+
security_driver="none"
590578
591579
.. note:: In a production environment, selinux should be set to enforcing
592580
and the necessary selinux policies are created to allow the
593581
services to run.
594582

595-
#. Configure Apparmor (Ubuntu)
583+
#. Configure Apparmor (Ubuntu, SUSE)
596584

597585

598586
#. Check to see whether AppArmor is installed on your machine. If
@@ -605,23 +593,23 @@ ensure the Agent has all the required permissions.
605593
606594
$ dpkg --list 'apparmor'
607595
608-
#. Disable the AppArmor profiles for libvirt
596+
In Ubuntu, install package apparmor-utils if not present.
609597

610598
.. parsed-literal::
611599
612-
$ ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
600+
$ apt install apparmor-utils
613601
614-
.. parsed-literal::
615-
616-
$ ln -s /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper /etc/apparmor.d/disable/
602+
#. Then set Apparmor to enforcing mode
617603

618604
.. parsed-literal::
619605
620-
$ apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
606+
$ aa-enforce /etc/apparmor.d/*
607+
608+
#. Set the security driver in ``/etc/libvirt/qemu.conf`` to "none".
621609

622610
.. parsed-literal::
623611
624-
$ apparmor_parser -R /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
612+
security_driver="none"
625613
626614
627615
Configuring the Networking

source/installguide/management-server/_database.rst

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,33 +138,15 @@ MySQL. See :ref:`install-database-on-separate-node`.
138138
rpm -qa | grep selinux
139139
140140
#. Set the SELINUX variable in ``/etc/selinux/config`` to
141-
"permissive". This ensures that the permissive setting will be
141+
"enforcing" or "permissive". This ensures that the setting will be
142142
maintained after a system reboot.
143143

144-
In RHEL or CentOS:
145-
146-
.. parsed-literal::
147-
148-
vi /etc/selinux/config
149-
150-
Change the following line
151-
152-
.. parsed-literal::
153-
154-
SELINUX=enforcing
155-
156-
to this:
157-
158-
.. parsed-literal::
159-
160-
SELINUX=permissive
161-
162-
#. Set SELinux to permissive starting immediately, without requiring
144+
#. Set SELinux to enforcing or permissive starting immediately, without requiring
163145
a system reboot.
164146

165147
.. parsed-literal::
166148
167-
setenforce permissive
149+
setenforce enforcing
168150
169151
.. note:: In a production environment, selinux should be set to enforcing
170152
and the necessary selinux policies are created to allow the

source/quickinstallationguide/qig.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,19 +192,17 @@ SELinux
192192
^^^^^^^
193193

194194
In an ideal environment, selinux should be set to enforcing and the necessary
195-
selinux policies are created to allow the services to run. For this guide,
196-
we will set selinux to permissive mode. This will allow us to install and
197-
configure the services without having to worry about selinux policies.
195+
selinux policies are created to allow the services to run.
198196

199-
To configure SELinux to be permissive in the running system we need to run the
197+
To configure SELinux to be enforcing in the running system we need to run the
200198
following command:
201199

202200
.. parsed-literal::
203201
204-
# setenforce 0
202+
# setenforce 1
205203
206204
To ensure that it remains in that state we need to configure the file
207-
/etc/selinux/config to reflect the permissive state, as shown in this example:
205+
/etc/selinux/config to reflect the enforcing state, as shown in this example:
208206

209207
.. parsed-literal::
210208
@@ -213,7 +211,7 @@ To ensure that it remains in that state we need to configure the file
213211
# enforcing - SELinux security policy is enforced.
214212
# permissive - SELinux prints warnings instead of enforcing.
215213
# disabled - No SELinux policy is loaded.
216-
SELINUX=permissive
214+
SELINUX=enforcing
217215
# SELINUXTYPE= can take one of these two values:
218216
# targeted - Targeted processes are protected,
219217
# mls - Multi Level Security protection.

0 commit comments

Comments
 (0)