semanage.conf(5) Linux System Administration semanage.conf(5)
NAME
semanage.conf - глобальный файл конфигурации для библиотеки управления
SELinux
DESCRIPTION
Файл semanage.conf обычно расположен в директории /etc/selinux и используется
для настройки во время выполнения поведения библиотеки управления SELinux.
Каждая строка должна содержать параметр конфигурации, за которым следует
знак равенства ("="), а затем значение конфигурации для этого параметра.
Всё, что следует за символом "#", игнорируется, аналогично пустым строкам.
Допускаются следующие параметры:
module-store
Указывает, как библиотека управления SELinux должна
взаимодействовать с хранилищем политик SELinux. Если
установлено значение "direct", библиотека управления
SELinux записывает напрямую в хранилище модулей
политики SELinux (это значение по умолчанию).
В противном случае можно использовать путь к сокету
или имя сервера. Если аргумент начинается с "/"
(как в "/foo/bar"), он представляет собой путь к
именованному сокету, который следует использовать
для подключения к серверу управления политикой.
Если аргумент не начинается с "/" (как в
"example.com:4242"), он должен интерпретироваться
как имя удалённого сервера управления политикой для
использования через TCP-соединение (порт по
умолчанию — 4242, если не указано иное после имени
сервера с использованием двоеточия для разделения
полей).
root Указывает альтернативный корневой путь для хранилища.
Значение по умолчанию — "/"
store-root
Указывает альтернативный путь store_root для
использования. Значение по умолчанию —
"/var/lib/selinux"
compiler-directory
Указывает альтернативную директорию, содержащую
компиляторы HLL в CIL. Значение по умолчанию —
"/usr/libexec/selinux/hll".
ignore-module-cache
Определяет, игнорировать ли кеш модулей CIL,
скомпилированных из HLL. Может быть установлено на
"true" или "false" и по умолчанию установлено на
"false". Если кеш игнорируется, то все модули CIL
пересобираются из их модулей HLL.
policy-version
При генерации политики semanage по умолчанию
устанавливает версию политики в
POLICYDB_VERSION_MAX, как определено в
<sepol/policydb/policydb.h>. Измените эту настройку,
если требуется установить другую версию для
политики.
target-platform
Целевая платформа для генерации политик. Допустимые
значения — "selinux" и "xen", и по умолчанию
установлено на "selinux".
expand-check
Определяет, проверять ли правила "neverallow" при
выполнении всех команд semanage. Может быть
установлено на "0" (отключено) или "1" (включено) и
по умолчанию включено. Это может значительно
увеличить время выполнения, если опция включена.
file-mode
По умолчанию режим разрешений для файлов политики
во время выполнения устанавливается в 0644.
save-previous
Управляет тем, сохраняется ли предыдущая
директория модулей после успешной фиксации в
хранилище политики, и может быть установлено на
"true" или "false". По умолчанию установлено на
"false" (предыдущая версия удаляется).
save-linked
Управляет тем, сохраняется ли ранее связанный
модуль (с именем "base.linked") после успешной
фиксации в хранилище политики. Может быть
установлено на "true" или "false" и по умолчанию
установлено на "false" (предыдущий модуль
удаляется).
ignoredirs
Список, разделённый ";", директорий, которые
следует игнорировать при настройке домашних
директорий пользователей. Некоторые дистрибутивы
используют это для предотвращения маркировки /root
как домашней директории.
usepasswd
Определяет, использовать ли getpwent() для получения
списка домашних директорий для маркировки. Может
быть установлено на "true" или "false" и по
умолчанию установлено на "true".
disable-genhomedircon
Управляет тем, выполняется ли функция genhomedircon
при использовании команды semanage, и может быть
установлено на "false" или "true". По умолчанию
функциональность genhomedircon включена (эквивалентно
установке этой опции на "false").
handle-unknown
Эта опция переопределяет поведение ядра для
обработки разрешений, определённых в ядре, но
отсутствующих в фактической политике. Может быть
установлено на "deny", "reject" или "allow". По
умолчанию берётся настройка из политики.
bzip-blocksize
Должно быть в диапазоне 0-9. Значение 0 означает
отсутствие сжатия. По умолчанию размер блока bzip
установлен на 9 (фактическое значение размера блока
получается после умножения на 100000).
bzip-small
Если установлено на "true", алгоритм bzip попытается
уменьшить использование системной памяти. Может быть
установлено на "true" или "false" и по умолчанию
установлено на "false".
remove-hll
Если установлено на "true", файлы HLL будут
удалены после компиляции в CIL. Чтобы удалить уже
скомпилированные файлы HLL в CIL, модули придётся
пересобрать с опцией ignore-module-cache,
установленной на 'true', или используя опцию
ignore-module-cache с semodule. Опция remove-hll
может быть установлена на "true" или "false" и по
умолчанию установлена на "false".
Обратите внимание, что поскольку эта опция удаляет
все файлы HLL, обновлённый компилятор HLL не сможет
пересобрать оригинальный файл HLL в CIL. Чтобы
скомпилировать оригинальный файл HLL в CIL, тот же
файл HLL потребуется переустановить.
optimize-policy
Если установлено на "true", политика ядра будет
оптимизирована при перестроении. Может быть
установлено на "true" или "false" и по умолчанию
установлено на "true".
multiple-decls
Если установлено на "true", будут разрешены
дублирующиеся объявления типов, атрибутов типов и
ролей. Может быть установлено на "true" или "false"
и по умолчанию установлено на "true".
Для некоторых задач библиотека управления SELinux использует внешние
команды. Для следующих команд можно переопределить путь и аргументы:
load_policy
Команда для загрузки политики ядра. Не требует
аргументов. По умолчанию — /sbin/load_policy без
аргументов.
setfiles
Команда для проверки определений контекстов файлов.
Требует два аргумента: путь к политике ядра и путь
к файлу определения контекстов файлов. По умолчанию
— /sbin/setfiles с аргументами '-q -c $@ $<'.
sefcontext_compile
Команда для компиляции файла определения контекстов
файлов. Требует один аргумент: путь к файлу
определения контекстов файлов, который нужно
скомпилировать. По умолчанию — /sbin/sefcontext_compile
с аргументом '$@'.
Можно опустить либо путь, либо аргументы. Строка аргументов
должна содержать '$@' для первого требуемого аргумента и '$<'
для второго. Синтаксис для переопределения свойства внешней
команды:
[name]
path = /path/to/command
args = --flag
[end]
Пример
[sefcontext_compile]
path = /usr/sbin/sefcontext_compile
args = -r $@
[end]
Опционально библиотека управления SELinux может вызывать
внешние команды для проверки исходных модулей (verify module),
связанных модулей (verify linked) и политик ядра (verify
kernel). Синтаксис идентичен переопределениям команд выше.
Программа должна завершаться с кодом 0 при успешном выполнении
и ненулевым кодом при ошибке.
SEE ALSO
semanage(8)
AUTHOR
Эта страница руководства была написана Guido Trentalancia <guido@trentalan‐
cia.com>.
Библиотека управления SELinux была написана Tresys Technology LLC и
Red Hat Inc.
semanage.conf September 2011 semanage.conf(5)
semanage.conf(5) Linux System Administration semanage.conf(5)
NAME
semanage.conf - global configuration file for the SELinux Management
library
DESCRIPTION
The semanage.conf file is usually located under the directory
/etc/selinux and it is used for run-time configuration of the behavior
of the SELinux Management library.
Each line should contain a configuration parameter followed by the
equal sign ("=") and then followed by the configuration value for that
parameter. Anything after the "#" symbol is ignored similarly to empty
lines.
The following parameters are allowed:
module-store
Specify how the SELinux Management library should inter‐
act with the SELinux policy store. When set to "direct",
the SELinux Management library writes to the SELinux pol‐
icy module store directly (this is the default setting).
Otherwise a socket path or a server name can be used for
the argument. If the argument begins with "/" (as in
"/foo/bar"), it represents the path to a named socket
that should be used to connect the policy management
server. If the argument does not begin with a "/" (as in
"example.com:4242"), it should be interpreted as the name
of a remote policy management server to be used through a
TCP connection (default port is 4242 unless a different
one is specified after the server name using the colon to
separate the two fields).
root Specify an alternative root path to use for the store.
The default is "/"
store-root
Specify an alternative store_root path to use. The de‐
fault is "/var/lib/selinux"
compiler-directory
Specify an alternative directory that contains HLL to CIL
compilers. The default value is
"/usr/libexec/selinux/hll".
ignore-module-cache
Whether or not to ignore the cache of CIL modules com‐
piled from HLL. It can be set to either "true" or "false"
and is set to "false" by default. If the cache is ig‐
nored, then all CIL modules are recompiled from their HLL
modules.
policy-version
When generating the policy, by default semanage will set
the policy version to POLICYDB_VERSION_MAX, as defined in
<sepol/policydb/policydb.h>. Change this setting if a
different version needs to be set for the policy.
target-platform
The target platform to generate policies for. Valid val‐
ues are "selinux" and "xen", and is set to "selinux" by
default.
expand-check
Whether or not to check "neverallow" rules when executing
all semanage command. It can be set to either "0" (dis‐
abled) or "1" (enabled) and by default it is enabled.
There might be a large penalty in execution time if this
option is enabled.
file-mode
By default the permission mode for the run-time policy
files is set to 0644.
save-previous
It controls whether the previous module directory is
saved after a successful commit to the policy store and
it can be set to either "true" or "false". By default it
is set to "false" (the previous version is deleted).
save-linked
It controls whether the previously linked module is saved
(with name "base.linked") after a successful commit to
the policy store. It can be set to either "true" or
"false" and by default it is set to "false" (the previous
module is deleted).
ignoredirs
List, separated by ";", of directories to ignore when
setting up users homedirs. Some distributions use this
to stop labeling /root as a homedir.
usepasswd
Whether or not to enable the use getpwent() to obtain a
list of home directories to label. It can be set to ei‐
ther "true" or "false". By default it is set to "true".
disable-genhomedircon
It controls whether or not the genhomedircon function is
executed when using the semanage command and it can be
set to either "false" or "true". By default the genhome‐
dircon functionality is enabled (equivalent to this op‐
tion set to "false").
handle-unknown
This option overrides the kernel behavior for handling
permissions defined in the kernel but missing from the
actual policy. It can be set to "deny", "reject" or "al‐
low". By default the setting from the policy is taken.
bzip-blocksize
It should be in the range 0-9. A value of 0 means no com‐
pression. By default the bzip block size is set to 9 (ac‐
tual block size value is obtained after multiplication by
100000).
bzip-small
When set to "true", the bzip algorithm shall try to re‐
duce its system memory usage. It can be set to either
"true" or "false" and by default it is set to "false".
remove-hll
When set to "true", HLL files will be removed after com‐
pilation into CIL. In order to delete HLL files already
compiled into CIL, modules will need to be recompiled
with the ignore-module-cache option set to 'true' or us‐
ing the ignore-module-cache option with semodule. The re‐
move-hll option can be set to either "true" or "false"
and by default it is set to "false".
Please note that since this option deletes all HLL files,
an updated HLL compiler will not be able to recompile the
original HLL file into CIL. In order to compile the
original HLL file into CIL, the same HLL file will need
to be reinstalled.
optimize-policy
When set to "true", the kernel policy will be optimized
upon rebuilds. It can be set to either "true" or "false"
and by default it is set to "true".
multiple-decls
When set to "true", duplicate type, type attribute, and
role declarations will be allowed. It can be set to ei‐
ther "true" or "false" and by default it is set to
"true".
For certain tasks the SELinux Management library resorts to running ex‐
ternal commands. For the following commands their path and arguments
can be overridden:
load_policy
Command to load a kernel policy. Requires no ar‐
gument. Defaults to /sbin/load_policy with no ar‐
guments.
setfiles
Command to verify file context definitions. Re‐
quires two arguments, the path to the kernel pol‐
icy and the path to the file context definition
file. Defaults to /sbin/setfiles with the argu‐
ments '-q -c $@ $<'.
sefcontext_compile
Command to compile a file context definition file.
Requires one argument, the path to the to be com‐
piled file context definition file. Defaults to
/sbin/sefcontext_compile with the argument '$@'.
Either path or args can be omitted. The argument string must
contain '$@' for the first required argument, and '$<' for the
second one. The syntax for overriding an external command prop‐
erty is:
[name]
path = /path/to/command
args = --flag
[end]
Example
[sefcontext_compile]
path = /usr/sbin/sefcontext_compile
args = -r $@
[end]
Optionally the SELinux Management library can invoke external
commands to verify source modules (verify module), linked mod‐
ules (verify linked), and kernel policies (verify kernel). The
syntax is identical to the above command overrides. The program
should exit with a value of 0 on success, and non zero on fail‐
ure.
SEE ALSO
semanage(8)
AUTHOR
This manual page was written by Guido Trentalancia <guido@trentalan‐
cia.com>.
The SELinux management library was written by Tresys Technology LLC and
Red Hat Inc.
semanage.conf September 2011 semanage.conf(5)