User Tools

Site Tools


модуль_selinux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
модуль_selinux [2020/07/16 08:50]
val
модуль_selinux [2020/07/16 14:55]
val [Управление разрешениями с использованием boolean]
Line 18: Line 18:
 <​code>​ <​code>​
 # sestatus # sestatus
 +
 +# id -Z
 </​code>​ </​code>​
  
Line 47: Line 49:
 ===== Добавление сетевых портов к типу (домену) контекста безопасности ===== ===== Добавление сетевых портов к типу (домену) контекста безопасности =====
  
-  * [[Сервис Firewall#​CentOS]] firewalld+  * [[Сервис Firewall#​CentOS]] firewalld ​(для демонстрации темы можно отключить) 
 +  * [[https://​blog.tinned-software.net/​change-ssh-port-in-centos-with-selinux/​|Change SSH port in CentOS with SELinux]]
  
 <​code>​ <​code>​
 # ps axZ | grep ssh # ps axZ | grep ssh
-yum install setools-console + 
-sesearch ​--allow | grep sshd_t | grep port+ss -tupanZ | grep ssh 
 + 
 +runcon ​-t sshd_t ​-r system_r -u system_u /​usr/​sbin/​sshd -p 2222 -d 
 + 
 +# semanage port -l | grep ssh
  
 # semanage port -a -t ssh_port_t -p tcp 2222 # semanage port -a -t ssh_port_t -p tcp 2222
-# yum install policycoreutils-devel +
-# sepolicy network -a /​usr/​sbin/​sshd+
 # semanage port -d -t ssh_port_t -p tcp 22 # semanage port -d -t ssh_port_t -p tcp 22
 </​code>​ </​code>​
  
-  * [[Сервис XINETD]] +===== Управление разрешениями с использованием boolean ===== 
-  * [[Средства программирования shell#Web сервер на shell]]+ 
 +  * [[http://​itstickers.besthw.net/​zabbix-server-is-not-running-the-information-displayed-may-not-be-current/​|Zabbix server is not running: the information displayed may not be current]]
  
 <​code>​ <​code>​
-# runcon -t inetd_child_t -r system_r -u system_u cat /​etc/​passwd +# semanage boolean -l | grep zabbix
-# runcon -t httpd_t -r system_r -u system_u cat /​etc/​passwd +
-</​code><​code>​ +
-# semanage boolean -l+
 ... ...
-httpd_can_connect_ldap+ 
 +или 
 + 
 +# getsebool -a | grep zabbix
 ... ...
 +
 +# setsebool -P httpd_can_connect_zabbix on
 </​code>​ </​code>​
 ===== Разработка модулей ===== ===== Разработка модулей =====
модуль_selinux.txt · Last modified: 2024/04/26 14:33 by val