SELinux » History » Version 4
Lukas Zapletal, 05/26/2014 01:38 PM
extended docs
1 | 1 | Lukas Zapletal | h1. SELinux |
---|---|---|---|
2 | |||
3 | 4 | Lukas Zapletal | Foreman on RHEL6 and Fedoras fully supports SELinux and this is installed and enabled by default, therefore SELinux in Enforcing mode is recommended. Our policy can be downloaded https://github.com/theforeman/foreman-selinux |
4 | 2 | Lukas Zapletal | |
5 | 1 | Lukas Zapletal | h2. How to report errors |
6 | |||
7 | 4 | Lukas Zapletal | Please open ordinary issues and set component to "SELinux". Also give us information about how to reproduce denials and also paste relevant denials in the comment: |
8 | 1 | Lukas Zapletal | |
9 | grep AVC /var/log/audit/audit.log |
||
10 | |||
11 | 4 | Lukas Zapletal | Also note that we usually need output of this command: |
12 | 1 | Lukas Zapletal | |
13 | 4 | Lukas Zapletal | ps auxwwwZ |
14 | |||
15 | Providing information via foreman-debug command also helps us with investigating because it contains full audit.log (compressed). |
||
16 | |||
17 | h2. Available SELinux booleans |
||
18 | |||
19 | These are booleans which allows you to tune Foreman policy. They can be enabled with |
||
20 | |||
21 | semanage boolean --on boolean_name |
||
22 | |||
23 | or disabled with |
||
24 | |||
25 | semanage boolean --off boolean_name |
||
26 | |||
27 | h3. passenger_run_foreman |
||
28 | |||
29 | On by default. Whether Foreman is running under Phusion Passenger or not. |
||
30 | |||
31 | h3. passenger_run_puppetmaster |
||
32 | |||
33 | On by default. Whether Puppet Master is running under Phusion Passenger or not. |
||
34 | |||
35 | h3. passenger_can_connect_all |
||
36 | |||
37 | Off by default. Foreman can be allowed to access any other port than those defined bellow using this boolean setting. |
||
38 | |||
39 | h2. SELinux ports |
||
40 | |||
41 | Foreman is allowed to connect to the following ports: |
||
42 | |||
43 | * httpd_port_t (80, 81, 443, 488, 8008, 8009, 8443, 9000) |
||
44 | * websm_port_t (9090) |
||
45 | * foreman_proxy_port_t (empty by default) |
||
46 | * postgresql_port_t (5432) |
||
47 | * virt_port_t (16509, 16514) |
||
48 | * ssh_port_t (22) |
||
49 | * vnc_port_t (5900-5999) |
||
50 | |||
51 | h3. Changing Foreman Proxy port |
||
52 | |||
53 | Foreman Proxy is usually configured on port 8443 or 9090, but when needed, any port can be defined: |
||
54 | |||
55 | semanage port -a -t foreman_proxy_port_t -p tcp 9876 |
||
56 | |||
57 | 1 | Lukas Zapletal | h2. Tips for debugging |
58 | |||
59 | If you identify part of code you want to test separatey, you can run a script in passenger_t policy easily |
||
60 | |||
61 | 4 | Lukas Zapletal | <pre> |
62 | 1 | Lukas Zapletal | runcon -u system_u -r system_r -t unconfined_t -- runcon -t passenger_t -- your_script.rb |
63 | 4 | Lukas Zapletal | </pre> |
64 | 1 | Lukas Zapletal | |
65 | To reinitialize selinux use |
||
66 | |||
67 | semodule -B |
||
68 | |||
69 | or |
||
70 | |||
71 | setenforce 1 && setenforce 0 |