This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
модуль_selinux [2024/08/23 08:59] val [Установка типов (доменов) контекста безопасности для файловой системы] |
модуль_selinux [2026/07/21 13:47] (current) val [Добавление сетевых портов к типу (домену) контекста безопасности] |
||
|---|---|---|---|
| Line 8: | Line 8: | ||
| * [[https://habr.com/ru/companies/otus/articles/460387/|Руководство для начинающих по SELinux]] | * [[https://habr.com/ru/companies/otus/articles/460387/|Руководство для начинающих по SELinux]] | ||
| * [[https://www.opennet.ru/base/sec/selinux_setup.txt.html|Настройка и использование SELinux (selinux limit security linux mac acl)]] | * [[https://www.opennet.ru/base/sec/selinux_setup.txt.html|Настройка и использование SELinux (selinux limit security linux mac acl)]] | ||
| - | * [[https://www.ibm.com/developerworks/ru/library/l-se_linux_01/index.html|Часть 1. SELinux - история появления, архитектура и принципы работы]] | ||
| * [[https://www.server-world.info/en/note?os=CentOS_7&p=selinux&f=11|SELinux : Use sesearch]] | * [[https://www.server-world.info/en/note?os=CentOS_7&p=selinux&f=11|SELinux : Use sesearch]] | ||
| Line 40: | Line 39: | ||
| # yum install policycoreutils-python-utils | # yum install policycoreutils-python-utils | ||
| - | # semanage fcontext -l | grep '/var/www' | + | # semanage fcontext -l | grep '/var/www/html' |
| # restorecon -v /var/www/html/index.html | # restorecon -v /var/www/html/index.html | ||
| Line 50: | Line 49: | ||
| ===== Добавление сетевых портов к типу (домену) контекста безопасности ===== | ===== Добавление сетевых портов к типу (домену) контекста безопасности ===== | ||
| - | * [[Сервис Firewall#CentOS]] firewalld (для демонстрации темы можно отключить) | + | * [[Сервис Firewall#CentOS, AlmaLinux]] firewalld (для демонстрации темы можно отключить) |
| * [[https://access.redhat.com/documentation/ru-ru/red_hat_enterprise_linux/5/html/deployment_guide/rhlcommon-section-0085|50.2.11. Running a Command in a Specific Security Context]] | * [[https://access.redhat.com/documentation/ru-ru/red_hat_enterprise_linux/5/html/deployment_guide/rhlcommon-section-0085|50.2.11. Running a Command in a Specific Security Context]] | ||
| Line 56: | Line 55: | ||
| <code> | <code> | ||
| - | # ps axZ | grep ssh | + | # ps axZ | grep [s]sh |
| - | # ss -tupanZ | grep ssh | + | # ss -tupanZ | grep [s]sh |
| # runcon -t sshd_t -r system_r -u system_u /usr/sbin/sshd -p 2222 -d | # runcon -t sshd_t -r system_r -u system_u /usr/sbin/sshd -p 2222 -d | ||