| 1 |
Host Security Settings Conflicts with KIWI |
| 2 |
========================================== |
| 3 |
|
| 4 |
.. note:: **Abstract** |
| 5 |
|
| 6 |
This page provides further information on how to solve |
| 7 |
image build problems caused by `selinux` security |
| 8 |
policies. |
| 9 |
|
| 10 |
Linux systems are protected against write/read or other |
| 11 |
operations depending on the application that wants to |
| 12 |
access or modify data. The rules for this protection are |
| 13 |
provided in security policies. There are several applications |
| 14 |
enforcing these security settings, e.g. `apparmor` or `selinux`. |
| 15 |
In this troubleshooting chapter, the focus is on `selinux`. |
| 16 |
|
| 17 |
Protecting files, process groups, kernel filesystems, device |
| 18 |
nodes and more from unauthorized access and restricting it to |
| 19 |
a certain set of applications is a nice concept. However, if |
| 20 |
taken seriously, no other application except the ones configured |
| 21 |
in the security policy will function properly. |
| 22 |
|
| 23 |
When building an appliance, the appliance builder has to have |
| 24 |
access to a wide range of services. It must be able to |
| 25 |
create a new package database elsewhere in the system. It must |
| 26 |
be able to create, read and write device nodes, create filesystems, |
| 27 |
partitions, bootloader configurations, etc. The list is very |
| 28 |
long and no security policy could cover this in a way that it |
| 29 |
would not be open to everything, which in the end leads to a |
| 30 |
pointless exercise and no security at all. |
| 31 |
|
| 32 |
This means for users who would like to keep the security settings |
| 33 |
of the system enforced and unchanged, the only way to allow {kiwi} |
| 34 |
to do its job is to run it through `boxbuild` as explained in |
| 35 |
:ref:`self_contained`. |
| 36 |
|
| 37 |
For users who can afford to open the system security policy, |
| 38 |
the following procedure will allow {kiwi} to work: |
| 39 |
|
| 40 |
.. code:: bash |
| 41 |
|
| 42 |
sudo setenforce 0 |
| 43 |
|
| 44 |
This action disables selinux temporarily. To disable selinux |
| 45 |
permanently, perform the following steps: |
| 46 |
|
| 47 |
1. Open the SELinux configuration file: :file:`/etc/selinux/config` |
| 48 |
2. Locate the following line: `SELINUX=enforcing` |
| 49 |
3. Change the value to disabled: |
| 50 |
|
| 51 |
.. code:: bash |
| 52 |
|
| 53 |
SELINUX=disabled |
| 54 |
|
| 55 |
4. On the next reboot, SELinux is permanently disabled. |
| 56 |
|
| 57 |
.. note:: |
| 58 |
|
| 59 |
Similar instructions apply to other application security |
| 60 |
subsystems like `apparmor`. Due to the complexity of these |
| 61 |
systems, this article only mentions the most common issue |
| 62 |
people run into when building images on systems protected |
| 63 |
by `selinux`. |