{"id":199202,"date":"2013-11-11T12:30:03","date_gmt":"2013-11-11T08:30:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=199202"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=199202","title":{"rendered":"<span class=\"post_title\">\u0413\u043e\u0442\u043e\u0432\u0438\u043c NSA SELinux<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/cfa\/80e\/805\/cfa80e80563336b6fec88c41a29c85ca.png\" alt=\"NSA logo\" align=\"left\"\/>\u041f\u0440\u0438\u0432\u0435\u0442 \u0425\u0430\u0431\u0440! \u0414\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u0441\u0442\u043e\u043c \u044f \u0445\u043e\u0447\u0443 \u043d\u0435\u043c\u043d\u043e\u0436\u043d\u043e \u043e\u0442\u0432\u043b\u0435\u0447\u044c \u043c\u043d\u043e\u0433\u043e\u0443\u0432\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043e\u0442 \u043f\u0435\u0440\u0435\u0441\u0443\u0434 \u043d\u0430 \u0442\u0435\u043c\u0443 \u0410\u041d\u0411, \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u0435\u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443 \u00ab\u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435 SELinux\u00bb \u0438 \u00ab\u043f\u043e\u0441\u0432\u044f\u0442\u0438\u0442\u0435 \u0435\u043c\u0443 \u043b\u0443\u0447\u0448\u0438\u0435 \u0433\u043e\u0434\u044b \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043c\u0430\u043b\u0443\u044e \u0447\u0430\u0441\u0442\u044c\u00bb. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u0431\u0435 \u044d\u0442\u0438 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0434\u0430\u043b\u0435\u043a\u0438 \u043e\u0442 \u043f\u0440\u0430\u0432\u0434\u044b \u2014 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430, \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u0430 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c \u043e\u0431 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0443\u043a\u0432, \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0437\u043a\u043e\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438, \u0442.\u043a. \u043d\u0438\u0436\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u0430\u0432\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 SELinux, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u043b\u0438 \u0441 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u043e\u0434\u0441\u0442\u0443\u043f\u0438\u0442\u044c\u0441\u044f \u2014 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441. \u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u0430\u0432\u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0437\u043d\u0430\u0435\u0442\u0435 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0435, \u0442\u043e \u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u044d\u0442\u043e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u041d\u0443 \u0430 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u044b \u043f\u043e \u0418\u0411 \u0441 \u043c\u0438\u0440\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u043c\u043e\u0433\u0443\u0442 \u0441\u043c\u0435\u043b\u043e \u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u043d\u0435\u0446 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438\u0433\u0440\u0430\u0442\u044c, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u043d\u044b \u043d\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \ud83d\ude42<br \/>  \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0430\u0441\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0410\u041d\u0411 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c RSA, \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u043a\u043e\u0439 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043c\u0435\u0434\u0438\u0439\u043d\u044b\u043c\u0438 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u043c\u0438 \u2014 no hype, no FUD, only technology. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0432\u043b\u0435\u0437\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432 \u0441\u0430\u043c\u043e \u0441\u0435\u0440\u0434\u0446\u0435 MLS, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0435\u0434\u0440\u044f\u044f \u0441\u0432\u043e\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 (\u043c\u044b \u0442\u043e\u0436\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438), \u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e <s>\u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0432\u0437\u043b\u0435\u0442\u0435\u0442\u044c<\/s> \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u0442\u0435\u0441\u0442\u044b. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0447\u0442\u043e \u0438 \u043a\u0430\u043a, \u0430 \u0432\u044b \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 SELinux \u043a\u0430\u043a \u043d\u0430 \u043d\u0435\u0432\u0435\u0434\u043e\u043c\u0443 \u0437\u0432\u0435\u0440\u0443\u0448\u043a\u0443 \u0438 \u043e\u0431\u0438\u0442\u0435\u043b\u044c \u0437\u043b\u0430 \u043e\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430, \u0430 \u0441\u043c\u0435\u043b\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0432\u043e \u0431\u043b\u0430\u0433\u043e. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u0443\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432\u043e \u0432\u0441\u0435\u0445 \u0432\u0430\u0448\u0438\u0445 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430\u0445 (&gt;4.3) \u0438 \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445.<br \/>  \u0418\u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0432\u0441\u0435 \u0435\u0449\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0438 \u0432\u044b \u043d\u0435 \u0431\u043e\u0438\u0442\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u0434\u0435\u043b\u044e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u0432, \u0442\u043e<a name=\"habracut\"><\/a><\/p>\n<h4>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0442\u0435\u043d\u0438\u044f<\/h4>\n<p>\u042f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Linux \u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u043c \u043e\u0431\u044a\u0451\u043c\u0435, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0432\u043e\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u042f \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Debian, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0435\u0448\u0438\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0441\u0435\u0439 \u043f\u0443\u0442\u044c, \u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e (\u0438 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u043d\u0443\u0436\u043d\u043e) \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0438 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0435 \u2014 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435 \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043c\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e. \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043a\u0430\u043a \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u043b\u044e\u0431\u043e\u0439 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0439 \u043c\u043e\u0433 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c. \u0422\u0430\u043a \u0436\u0435 \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e, \u0447\u0442\u043e \u0432\u0430\u0441 \u043d\u0435 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e SELinux \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u0430\u043b\u043e.<\/p>\n<h5>\u041e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/h5>\n<p>\u0412\u043e\u043a\u0440\u0443\u0433 SELinux \u0432\u0435\u0440\u0442\u0438\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u0443\u0445\u043e\u0432, \u0447\u0442\u043e \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u044b, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u043e \u043e\u0431\u044a\u0435\u043c\u0443 \u0443 \u043d\u0430\u0441 \u0432\u0432\u043e\u0434\u043d\u0430\u044f, \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u0441\u0441\u044b\u043b\u043a\u0438:<\/p>\n<ol>\n<li><a href=\"https:\/\/access.redhat.com\/site\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/6\/html\/Security-Enhanced_Linux\/\">RH Guide<\/a>: \u0435\u0441\u043b\u0438 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432 \u043d\u0435\u043c. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0442\u0430\u0431\u0435, \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/li>\n<li><a href=\"http:\/\/billauer.co.il\/selinux-policy-module-howto.html\">\u041a\u043e\u043d\u0441\u043f\u0435\u043a\u0442<\/a> \u043b\u0435\u043a\u0446\u0438\u0438 Eli Billauer: \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0439\u0442\u0435 \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043d\u0438\u043a \u0444\u0430\u043a\u0442\u043e\u0432. \u041f\u043e \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u043a \u0447\u0435\u043c\u0443, \u0438 \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0443 \u0433\u0443\u0433\u043b\u0430. <\/li>\n<li><a href=\"http:\/\/www.lurking-grue.org\/writingselinuxpolicyHOWTO.html\">\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a<\/a>. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u043d\u044e\u044e \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u0432 \u043d\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 SELinux, \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u043a\u043e\u0432\u044b\u0440\u044f\u0442\u044c.<\/li>\n<\/ol>\n<p>  \u042d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043a \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044e <i>\u0434\u043e<\/i> \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435, \u0438\u043d\u0430\u0447\u0435 \u0432\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u0442\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u0438\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c. \u0415\u0441\u0442\u044c <a href=\"http:\/\/www.nsa.gov\/research\/selinux\/\">\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e<\/a> <a href=\"http:\/\/selinuxproject.org\">\u0434\u0440\u0443\u0433\u0438\u0445<\/a> <a href=\"https:\/\/wiki.gentoo.org\/wiki\/Project:SELinux\">\u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/a>, \u043d\u043e \u0432\u044b \u0434\u043e \u043d\u0438\u0445 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0439\u0434\u0435\u0442\u0435, \u0435\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\/\u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u043b\u0435\u0432\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438, \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 unconfined_t\/unconfined_u, \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 SELinux \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430 \u043d\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c?<\/li>\n<li>\u0427\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c, MLS \u0438\u043b\u0438 MCS?<\/li>\n<li>\u0427\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f *.te \u043e\u0442 *.if \u043e\u0442 *.fc?<\/li>\n<\/ol>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u0432\u0435\u0442\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<ol>\n<li>\u041d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d\/\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u0421 \u0442\u0430\u043a\u0438\u043c-\u0436\u0435 \u0443\u0441\u043f\u0435\u0445\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c SELinux \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435.<\/li>\n<li>MCS. MLS == MCS \u043f\u0440\u0438 MLS_SENS=1.<\/li>\n<li>\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u2014 \u043d\u0438\u0447\u0435\u043c. \u0425\u043e\u0442\u044c \u0432 txt \u043f\u0438\u0448\u0438\u0442\u0435, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 Makefile \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435.<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u043c \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u043c\u043e\u0436\u0435\u043c \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430: <\/p>\n<ul>\n<li>\u0425\u043e\u0442\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c SELinux MLS (\u0440\u0430\u0437 \u0443\u0436 \u0432\u0437\u044f\u043b\u0438\u0441\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443, \u0430 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <s>next-&gt;next-&gt;agree<\/s>);<\/li>\n<li>\u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0445\u043e\u0442\u0438\u043c \u0432\u0437\u044f\u0442\u044c <a href=\"http:\/\/oss.tresys.com\/projects\/refpolicy\/\">RefPolicy<\/a>;<\/li>\n<li>\u041d\u0443 \u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c worst case scenario \u2014 \u043d\u0430\u0441 \u043f\u043e\u043b\u043e\u043c\u0430\u043b\u0438, \u0438 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u043e\u043c\u0430\u043b\u0438, \u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 UID=0, \u0434\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438, \u0430 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c shell \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c, \u0430 root \u043c\u044b \u043d\u0430 user_u \u043f\u0435\u0440\u0435\u043c\u0430\u043f\u0438\u0442\u044c \u0442\u043e \u0438 \u0437\u0430\u0431\u044b\u043b\u0438. \u042f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u044e \u0440\u044f\u0434 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0438\u0445\u0443\u0434\u0448\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439;<\/li>\n<li>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440, \u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0441\u0442\u0430\u0442\u044c\u044f, \u0430 \u0441\u0430\u0433\u0430 \u043e \u043f\u044f\u0442\u0438\u0441\u0442\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445;<\/li>\n<\/ul>\n<h5>\u0421\u0435\u0440\u0432\u0435\u0440<\/h5>\n<p>\u0421 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u044f, \u0443\u0431\u0435\u0440\u0443 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440. YMMV, \u0443 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u043d\u0435 Debian, \u0434\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432 KVM \u043d\u0438\u0447\u0435\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f. \u041f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u2014 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u2014 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u0435\u0442\u0430\u043b\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\u041e\u0431\u044b\u0447\u043d\u0430\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Debian, \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043d\u044e\u0430\u043d\u0441\u044b:<\/p>\n<ul>\n<li>\u0420\u0430\u0437\u0431\u0438\u0432\u043a\u0430 \u0434\u0438\u0441\u043aa (\u0446\u0435\u043b\u044b\u0445 4GB!):\n<ul>\n<li>\/dev\/vda1 64MB as \/boot, ext2.<\/li>\n<li>rest as LUKS: aes256:cbc-essiv:passphrase, \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/li>\n<li>\u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u0430 \u2014 \u0432\u0441\u0435 \u043f\u043e\u0434 LVM.<\/li>\n<\/ul>\n<\/li>\n<li> \u0412\u043e\u0442 \u0441\u0440\u0430\u0437\u0443 fstab\n<pre><code class=\"bash\">root@sandbox:~# cat \/etc\/fstab # \/etc\/fstab: static file system information. # &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt; \/dev\/vda1               \/boot   ext2    defaults        0       2 \/dev\/mapper\/vg0-root    \/       btrfs   defaults        0       1 \/dev\/mapper\/vg0-usr     \/usr    btrfs   defaults        0       2 \/dev\/mapper\/vg0-var     \/var    btrfs   defaults        0       2 \/dev\/mapper\/vg0-tmp     \/tmp    btrfs   defaults        0       2 \/dev\/mapper\/vg0-rhome   \/root   btrfs   defaults        0       2 \/dev\/mapper\/vg0-swap    none    swap    sw              0       0 <\/code><\/pre>\n<\/li>\n<li>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/li>\n<li>\u0421\u0442\u0430\u0432\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 SSH-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e.<\/li>\n<li>\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0448\u0435\u043b\u043b, \u0438 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u043a\u043b\u044e\u0447 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:\n<pre><code class=\"bash\">root@sandbox:~# ssh-keygen -l -f \/etc\/ssh\/ssh_host_ecdsa_key 256 f6:9b:ad:dd:93:cb:3d:c2:83:76:45:c3:02:e8:6a:1d  root@sandbox (ECDSA) <\/code><\/pre>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e ssh, \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0435\u0440\u0441\u0438\u0438, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">sed -i 's\/wheezy\/jessie\/g' \/etc\/apt\/sources.list  # that's no bloody enterprise aptitude update && aptitude dist-upgrade -VR # let's go testing, it's stable enough aptitude install vim bash-completion deborphan -VR # a little comfort couldn't hurt aptitude install policycoreutils auditd setools selinux-basics -VR # last is just helper scripts, optional vim \/etc\/network\/interfaces # make interfaces static aptitude purge isc-dhcp-client console-setup console-setup-linux kbd iproute module-init-tools $(deborphan) <\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u044e\u0447\u0438 \u0434\u043b\u044f ssh, \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u043b\u044f root:<\/p>\n<pre><code class=\"bash\">@local$ ssh-keygen -b 521 -t ecdsa -f selinux-test @remote# mkdir \/root\/.ssh && cat selinux-test.pub &gt; \/root\/.ssh\/authorized_keys2 && chown && chmod <\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u043f\u043e\u0434 \u0437\u0430\u043d\u0430\u0432\u0435\u0441, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0432\u043e\u0435 \u044f\u0434\u0440\u043e \u2014 \u043c\u044b \u0436\u0435 \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438, \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u0430\u0442\u0447\u0430\u043c\u0438 PaX \u0438 GRSecurity (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0441\u0442\u0430\u0442\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0443\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 SELinux, \u043d\u043e \u044d\u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437 \u043e\u043f\u0438\u0448\u0443). \u0412 \u043e\u0431\u0449\u0435\u043c, vanilla kernel \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435. \u0414\u0430, \u0433\u043e\u043b\u043e\u0441 \u0438\u0437 \u0437\u0430\u043b\u0430, \u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0438\u0439 \u043f\u0440\u043e Debian way, \u044f \u0442\u0435\u0431\u044f \u0441\u043b\u044b\u0448\u0443 \u2014 \u043d\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0443\u0442\u044c \u0441\u0430\u043c\u0443\u0440\u0430\u044f \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0440\u0430\u043c\u043a\u0430\u043c\u0438. \u0412 \u044d\u0442\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u043c\u044b \u043f\u043e\u043a\u0430 \u0435\u0449\u0435 UID=0 \u0431\u0435\u0437 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439, \u0438 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0432\u0441\u0435, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u043c. \u0418\u0442\u0430\u043a, \u043d\u0430\u0433\u0440\u0435\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u0410\u0440\u0438\u0437\u043e\u043d\u0443 (\u0438\u043b\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0443):<\/p>\n<pre><code class=\"bash\">mkdir src && cd src && wget -c http:\/\/kernel.org\/pub\/linux\/kernel\/v3.0\/linux-3.10.18.tar.bz2 && tar jxf linux*tar.bz2 && cd linux* &&  make menuconfig && make -j$((2* $(grep processor \/proc\/cpuinfo  | wc -l))) deb-pkg && make clean <\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, <b>\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c SELinux<\/b> (yes, this pun is intended!):<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/805\/546\/6c2\/8055466c2f7ad7696341b7ad95e6d541.png\" alt=\"selinux kernel opts, sorry for imageshack, habrastorage is not ok with my id\"\/><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">.config<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\"># if you are lazy to configure yourself, here's my .config, usable on KVM+libvirt wget -O - $aboveimage | dd bs=1 skip=3991 | xzcat  <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>\u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0433\u043e\u0442\u043e\u0432\u0430.  <\/p>\n<h5>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u043e\u043b\u0438\u0442\u0438\u043a<\/h5>\n<p>\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0438 \u0432 \u0432\u0438\u0434\u0435 deb-\u043f\u0430\u043a\u0435\u0442\u0430 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u043e\u0448\u0435\u043b \u043f\u043e \u043f\u0443\u0442\u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">up&#39;n&#39;enter style<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">wget http:\/\/oss.tresys.com\/files\/refpolicy\/refpolicy-2.20130424.tar.bz2 tar jxf refpolicy-2.20130424.tar.bz2 cp -rp refpolicy custom #all our modifications asroot# mkdir \/usr\/share\/selinux\/custom # so we can 'make install' here asroot# mkdir \/etc\/selinux\/custom asroot# chown $USER:$USER \/etc\/selinux\/custom \/usr\/share\/selinux\/custom asroot# touch \/etc\/selinux\/custom\/setrans.conf && chown $USER:$USER \/etc\/selinux\/custom\/setrans.conf # we'll need it later asroot# aptitude install selinux-utils python-selinux policycoreutils checkpolicy # these are for policy build <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash # sample deb build for custom selinux policy # harvests policy from local system  version='0.0.1' name='selinux-policy-custom' description='Custom MLS SELinux policy' cf=&quot;${name}-control&quot; cc=&quot;${name}-Copyright&quot; # depends and conflicts shamessly ripped from selinux-policy-mls read -d '' cheader &lt;&lt; EOF Section: non-free Priority: optional Homepage: http:\/\/selinux\/ Standards-Version: 3.9.2 Package: ${name} Version: ${version} Maintainer: secadm_r &lt;here.can+be@your.email&gt; Pre-Depends: Depends: policycoreutils (&gt;= 2.1.0), libpam-modules (&gt;= 0.77-0.se5), python, libselinux1 (&gt;= 2.0.35), libsepol1 (&gt;= 2.1.0) Conflicts: cron (&lt;= 3.0pl1-87.2sel), fcron (&lt;= 2.9.3-3), logrotate (&lt;= 3.7.1-1), procps (&lt;= 1:3.1.15-1), selinux-policy-refpolicy-strict, selinux-policy-refpolicy-targeted, sysvinit (&lt;= 2.86.ds1-1.se1) Architecture: all Copyright: .\/selinux-policy-custom-Copyright Description: ${description}  EOF read -d '' postinst &lt;&lt; &quot;EOF&quot; File: postinst 755  #!\/bin\/sh -e  set -e  if [ &quot;$1&quot; = configure ]; then         \/usr\/sbin\/semodule -s custom -b \/usr\/share\/selinux\/custom\/base.pp $(find \/usr\/share\/selinux\/custom\/ -type f ! -name base.pp | xargs -r -n1 echo -n &quot; -i&quot;)  fi  #DEBHELPER#  exit 0 EOF  function make_policy() {         cd custom         make clean         rm -rf \/usr\/share\/selinux\/custom\/*         make install         cd .. }  function make_files() {         echo 'SELinux custom policy copyright:TODO' &gt; ${cc}         echo -e &quot;$cheader&quot; &gt; ${cf}         echo -e &quot;$postinst&quot; &gt;&gt; ${cf}         echo -en &quot;\\nFiles:  &quot; &gt;&gt; ${cf}         # our setrans file         echo -e &quot; \/etc\/selinux\/custom\/setrans.conf \/etc\/selinux\/custom&quot; &gt;&gt; ${cf}         # \/etc\/selinux dir         find \/etc\/selinux\/custom -type f ! -name \\*LOCK | xargs -r -n1 -If -- sh -c 'echo &quot; f $(dirname f)&quot;' &gt;&gt; ${cf}         # \/usr\/share\/selinux\/custom dir         find \/usr\/share\/selinux\/custom -type f | xargs -r -n1 -If -- sh -c 'echo &quot; f $(dirname f)&quot;' &gt;&gt; ${cf} }  function cleanup() {         rm -f ${cc} ${cf} }  function build_deb() {         equivs-build ${cf}         [ $? -eq 0 ] && cleanup }  rm .\/${name}*deb # glob is ok make_policy make_files build_deb  scp -P 22 -i ~\/.ssh\/selinux-test selinux*deb root@selinux:\/tmp\/ <\/code><\/pre>\n<p>\u0412\u0440\u0435\u043c\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c ~30 \u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0431\u0440\u0430\u043d \u043e\u0431\u0449\u0438\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u2014 \u00ab\u0432 \u043b\u043e\u0431\u00bb, \u0447\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u044f \u0434\u0443\u043c\u0430\u044e, \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 rpm \u0442\u0440\u0443\u0434\u0430 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442:<\/p>\n<ul>\n<li>\u0427\u0438\u0441\u0442\u0438\u043c \u0432\u0441\u0435 (make clean)<\/li>\n<li>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 (make install)<\/li>\n<li>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u0441\u0435, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e\u0441\u044c (\u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0433\u0434\u0435 \u0438\u0441\u043a\u0430\u0442\u044c), \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442<\/li>\n<li>\u0417\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \/tmp<\/li>\n<li>\u0412 postinst \u043e\u043d \u0443\u0436\u0435 \u0441\u0430\u043c \u043d\u0430\u0439\u0434\u0435\u0442 \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u043e\u0441\u044c, \u0434\u0435\u0440\u043d\u0435\u0442 semodule \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h4>SELinux, \u043f\u0435\u0440\u0432\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e.<\/h4>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0433\u043e\u0442\u043e\u0432, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0433\u043e\u0442\u043e\u0432\u0430, reference policy \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430, <i>\u0432\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c<\/i> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443. (\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435, \u043e\u0446\u0435\u043d\u0438\u0432 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043c \u0441\u0442\u0430\u0442\u044c\u0438, \u0437\u0430\u043a\u0440\u0430\u043b\u0430\u0441\u044c \u043a\u0440\u0430\u043c\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u044b\u0441\u043b\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0435 \u043d\u0430 <s>2<\/s>5 :-).<br \/>  \u0414\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0442\u0430\u043a\u0438\u0435:<\/p>\n<pre><code class=\"bash\">$ sed '\/^#\/d;\/^$\/d' build.conf   TYPE = mls NAME = custom DISTRO = debian UNK_PERMS = reject DIRECT_INITRC = n MONOLITHIC = n UBAC = y CUSTOM_BUILDOPT = MLS_SENS = 4 MLS_CATS = 32 MCS_CATS = 32 QUIET = n <\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u0430\u043f\u0441\u0442\u0440\u0438\u043c\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b: \u0432\u043a\u043b\u044e\u0447\u0435\u043d MLS (\u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 policy\/mls \u0438 config\/appconfig-mls); \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0434\u0438\u0441\u0442\u0440\u043e-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0434\u043b\u044f debian, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e; \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432 \u044f\u0434\u0440\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043d\u0435 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0435 \u2014 \u0432\u0434\u0440\u0443\u0433 \u0443 \u043d\u0430\u0441 \u044f\u0434\u0440\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u0435\u0435; \u043d\u0443 \u0438 \u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043d\u0438\u0437\u0438\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u2014 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u043e 4 \u0443\u0440\u043e\u0432\u043d\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u0441\u0442\u0438, \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u043e 32 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438. \u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0430\u043c \u044d\u0442\u043e\u0433\u043e \u0445\u0432\u0430\u0442\u0438\u0442. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0443\u0442\u044c \u043d\u0443\u043c\u0435\u0440\u043e \u0443\u043d\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c MONOLITHIC = y \u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443, \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u0435\u0435 \u2014 make policy. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 policy.conf, \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438. \u0412\u043e\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0443\u0442, \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043b\u044e\u0431\u0435\u0437\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u043c m4 \u0438\u0437 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432, \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044c SELinux. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 (Warning: bad analogy time!): \u0435\u0441\u043b\u0438 secadm_r \u044d\u0442\u043e \u043d\u0430\u0432\u0440\u043e\u0434\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0438\u043a\u0430 \u0421\u0411, \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0449\u0438\u0439 \u0443\u0440\u043e\u0432\u043d\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0434\u043e\u043f\u0443\u0441\u043a\u0438, \u0442\u043e SELinux \u044d\u0442\u043e \u0440\u044f\u0434\u043e\u0432\u043e\u0439 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u043e\u0445\u0440\u0430\u043d\u044b, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0439 \u044d\u0442\u0438 \u0441\u043f\u0438\u0441\u043a\u0438, \u0430 \u0432 policy.conf, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043f\u0438\u0441\u043a\u0438 \u0441 \u043f\u043e\u043b\u044f\u043c\u0438:<br \/>   1. \u043a\u0442\u043e(scontext) \u2014 \u043a\u0443\u0434\u0430(tcontext) \u2014 \u043a \u043a\u043e\u043c\u0443(class) \u2014 \u0437\u0430\u0447\u0435\u043c(call) (\u043f\u043b\u044e\u0441, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 MLS: \u043f\u043e\u043a\u0430\u0436\u0438\u0442\u0435-\u043a\u0430 \u0435\u0449\u0435 \u0438 \u0432\u0430\u0448 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0434\u043e\u043f\u0443\u0441\u043a\u0430, \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e, \u044f \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u044e.)<\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b: <b>make conf<\/b>. \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u0430\u0432\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043c \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0439\u0441\u044f <i>policy\/modules.conf<\/i> \u2014 \u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b (modulename=off) \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 contrib. \u041f\u043b\u044e\u0441 \u2014 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0441\u0431\u043e\u0440\u043a\u0430, \u043c\u0435\u043d\u044c\u0448\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u041c\u0438\u043d\u0443\u0441 \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u043d\u0435\u0434\u043e\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432. \u041f\u043e\u044f\u0441\u043d\u044e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<ul>\n<li>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \/dev\/xconsole, \u0445\u043e\u0442\u044c \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043a \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 xserver;<\/li>\n<li>\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0432 \u0435\u0433\u043e, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u043b \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \/dev\/;<\/li>\n<li>\u0418 \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0435, \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \/dev\/xconsole, \u0438 \u0431\u044b\u043b\u043e \u0443\u0447\u0442\u0435\u043d\u043e \u0432 RefPolicy, \u0442\u0443\u0442 \u0436\u0435 \u0441\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c. \u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u2014 \u043d\u0430 \u0432\u0430\u0448 \u0432\u044b\u0431\u043e\u0440: \u043b\u0438\u0431\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c xserver, \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u0432\u043e\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435.<\/li>\n<\/ul>\n<div class=\"spoiler\"><b class=\"spoiler_title\">contrib_off<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">grep -A5 contrib policy\/modules.conf | grep &quot;= module$&quot; | wc -l # total number grep -A5 contrib policy\/modules.conf | grep &quot;= module$&quot; | sed 's\/ = module\/\/' | xargs -r -n1 -I__n -- sh -c 'sed -i &quot;s\/^__n = module$\/__n = off\/&quot; policy\/modules.conf' # kekeke # turn some servicess off too (xserver + postgresql) # turn _on_ logrotate,mta,postfix,ulogd, and whatever you think you need <\/code><\/pre>\n<\/div>\n<\/div>\n<p>\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u0442\u044c <i>modules.conf<\/i>, \u043c\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u0442\u043e\u0447\u043a\u0443 \u043d\u0435\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b <i>\u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c<\/i>, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0438 \u043f\u043e\u0447\u0435\u043c\u0443. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u043d\u0435\u0434\u043e\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u2014 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043d\u0430\u0448\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0443.<br \/>  \u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434 \u0441\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 <i>audit2allow<\/i>: \u043e\u043d\u0430 \u043a\u0443\u0448\u0430\u0435\u0442 audit.log, \u0438 \u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 -Rev) \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0430\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0435, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043b\u043e\u0433\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c.\u0422\u0430\u043a \u0432\u043e\u0442, \u0435\u0441\u043b\u0438 \u0432\u044b \u0433\u0434\u0435-\u043b\u0438\u0431\u043e (\u0430 \u044d\u0442\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0435\u0437\u0434\u0435) \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044e<\/p>\n<pre><code class=\"bash\">grep something-something \/var\/log\/audit\/audit.log | audit2allow -M mymegamodule semodule -i mymegamodule <\/code><\/pre>\n<p>\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0442\u0434\u0430\u0435\u0442\u0435 \u0441\u0435\u0431\u0435 \u043e\u0442\u0447\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u043e\u0442\u0432\u043e\u0440\u0438\u0442\u0435 \u2014 \u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e SELinux \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044c <b>\u0432\u0441\u0435<\/b>, \u0434\u043e \u0447\u0435\u0433\u043e (\u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0436\u0430\u0434\u043d\u043e\u0435) something-something \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u043e \u0434\u043e\u0441\u0442\u0443\u043f, \u0438 \u0434\u0430\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0435. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 MLS \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u2014 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 MLS \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u043b \u0432\u0441\u0435\u043c \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u043c \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0440\u0430\u0432\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b \u0447\u0438\u0441\u0442\u043e\u0441\u0435\u0440\u0434\u0435\u0447\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043d\u0438\u044e: \u00ab\u0434\u0430, \u044f \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0445\u043e\u0447\u0443 \u0434\u0443\u043c\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u043e\u0439, \u043c\u043d\u0435 \u043f\u0440\u043e\u0449\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0441\u0435\u00bb. \u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0438\u0437 \u0441\u0432\u043e\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b <a href=\"http:\/\/en.wikipedia.org\/wiki\/Security_theater\">\u0442\u0435\u0430\u0442\u0440<\/a>, \u0438 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u0451\u0442\u0435 SELinux \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u2014 \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0447\u0442\u043e \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043d\u0430 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0435 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0438\u0445 \u0432 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <b>make install<\/b>, \u0438 \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u0442\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0448 \u043f\u0430\u043a\u0435\u0442 \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n<pre><code class=\"bash\">dpkg -i \/tmp\/selinux-policy-custom*deb sed -i 's\/^SELINUX=.*$\/SELINUX=enforcing\/;s\/^SELINUXTYPE=.*$\/SELINUXTYPE=custom\/' \/etc\/selinux\/config  selinux-activate # if you installed helper package selinux-basics # if not: touch \/.autorelabel # add 'selinux=1 security=selinux' to cmdline reboot # let's rock! <\/code><\/pre>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0435 (<i>\/etc\/selinux\/custom\/contexts\/files\/*<\/i>), \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u0435\u0449\u0435 \u0440\u0430\u0437 \u0438 \u043b\u044e\u0431\u0435\u0437\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0437\u0430\u0439\u0442\u0438.<\/p>\n<h4>When is rocking \u00abrocking\u00bb and when is it \u00abshaking\u00bb *<\/h4>\n<p>\u0428\u0435\u0444, \u0432\u0441\u0435 \u043f\u0440\u043e\u043f\u0430\u043b\u043e. \u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041c\u044b \u0434\u0430\u0436\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0439\u0442\u0438 \u043f\u043e ssh \u2014 connection closed by host. \u0417\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c, SELinux. \u041a\u0430\u043a \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b Eli Billauer:<\/p>\n<blockquote><p>What is SELinux?<br \/>  In a nutshell: a machine that tells you permission is denied.<\/p><\/blockquote>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0445\u043e\u0440\u043e\u0448\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430. \u042d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, <i>\u043f\u043e\u0447\u0435\u043c\u0443<\/i> \u043d\u0430\u0441 \u043d\u0435 \u043f\u0443\u0441\u043a\u0430\u0435\u0442.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0443\u0442\u044c \u043d\u0443\u043c\u0435\u0440\u043e \u0434\u0443\u043e, \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0431\u0435\u0437 \u043f\u043b\u043e\u0445\u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0438\u0442\u0430\u043b\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439:<\/p>\n<ol>\n<li>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 DAC. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e, \u0442\u043e \u0434\u043e SELinux \u0434\u0435\u043b\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0434\u043e\u0439\u0434\u0435\u0442, permission denied \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0439, \u044e\u043d\u0438\u043a\u0441\u043e\u0432\u044b\u0439, \u0432\u0441\u0435\u043c \u043d\u0430\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430\u043c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e-\u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 *nix \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439.<\/li>\n<li>\u041f\u043e\u0442\u043e\u043c MAC. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430, permission denied \u0431\u0443\u0434\u0435\u0442 \u0443\u0436\u0435 \u043e\u0442 SELinux. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 (RH)\u0432 \u043b\u043e\u0433\u0430\u0445 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 &quot;<i>SELinux is preventing<\/i>&quot;, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442, \u043d\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u0431\u0443\u0434\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432 audit.log.<\/li>\n<\/ol>\n<p>\u0418\u0442\u043e\u0433\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 RefPolicy \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u0447\u0435\u0433\u043e-\u0442\u043e, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0439\u0434\u0435\u043c \u044d\u0442\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c.<\/p><\/div>\n<\/div>\n<p>\u0410\u0445 \u0434\u0430, \u0437\u0430\u0431\u044b\u043b \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e ssh, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0411\u043b\u0430\u0433\u043e, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c VNC\/<a href=\"http:\/\/en.wikipedia.org\/wiki\/SPICE_%28protocol%29\">SPICE<\/a>\/etc (\u0441\u0441\u044b\u043b\u043a\u0430 \u0441\u043f\u0435\u0446\u043e\u043c \u0434\u043b\u044f \u0424\u0421\u041a\u041d). \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u0439\u0442\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u2014 \u043d\u0435 \u043f\u0443\u0441\u043a\u0430\u0435\u0442. \u041e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u0437 \u043d\u0435\u0435 <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c<\/b><\/p>\n<div class=\"spoiler_text\">\n<ol>\n<li>Don&#8217;t panic.<\/li>\n<li>\u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u0441\u044f \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0441\u043b\u0430\u0432 Ctrl+Alt+Del, acpid \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430 \u043d\u0430\u0441.<\/li>\n<li>\u041b\u043e\u0432\u0438\u043c grub \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043c\u0435\u043d\u044f\u0435\u043c selinux=1 \u043d\u0430 selinux=0<\/li>\n<li>\u0413\u0440\u0443\u0437\u0438\u043c\u0441\u044f, \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u0434 root.<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435, audit.log \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0432\u0441\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b <s>\u043d\u0430\u0448\u0438\u0445 \u043d\u0435\u0443\u0434\u0430\u0447<\/s>, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u0439\u0442\u0438. \u0422.\u043a. \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438\u0441\u044c \u0441 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c SELinux, \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c audit.log \u0441 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0432\u0435\u0434\u044c \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u043c SELinux \u0443 \u043d\u0430\u0441 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<pre><code class=\"bash\">cp \/var\/log\/audit\/audit.log \/root wc -l \/root\/audit.log 195 <\/code><\/pre>\n<p>\u041c\u0430\u0441\u0448\u0442\u0430\u0431 \u0431\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0434\u0432\u0435\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u043a. \u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0441\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0441 \u0433\u043e\u0440\u044b:<\/p>\n<ul>\n<li>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u043a \u0447\u0438\u0442\u0430\u0442\u044c \u043b\u043e\u0433\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">type=DAEMON_START msg=audit(1383338997.597:1957): auditd start, ver=2.3.2 format=raw kernel=3.10.17-vm-slnx auid=4294967295 pid =1319 subj=system_u:system_r:auditd_t:s3:c0.c31 res=success <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0436\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e auditd \u0443\u0441\u043f\u0435\u0448\u043d\u043e (res) \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f, \u043f\u0440\u0438\u0447\u0435\u043c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 system_u, \u0440\u043e\u043b\u0438 system_r, \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 auditd_t, \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u043e \u0432\u0441\u0435\u043c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c (c0.c31) \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f (s3). \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"http:\/\/en.wikipedia.org\/wiki\/Bell%E2%80%93LaPadula_model\">BLP<\/a>, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441 \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u043b\u0430\u043f\u044b auditd (write up), \u0430 \u0441\u0430\u043c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f (read down). \u0415\u0441\u043b\u0438 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0442\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c, <a href=\"http:\/\/www.nsa.gov\">\u043a\u0435\u043c<\/a> \u044d\u0442\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0430\u0441\u044c, \u0438 \u0447\u0442\u043e \u043e\u043d\u0438 \u0438\u043c\u0435\u043b\u0438 \u0432\u0432\u0438\u0434\u0443 \u043f\u043e\u0434 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u2014 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 (\u043a\u0442\u043e \u043f\u0438\u0448\u0435\u0442) \u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044e (\u043a\u0443\u0434\u0430\/\u043a\u043e\u043c\u0443 \u043f\u0438\u0448\u0435\u0442). \u0418 \u0442\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u0438 \u043c\u0435\u0441\u0442\u0430 \u2014 \u0443\u0440\u043e\u0432\u0435\u043d\u044c Top Secret \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0443\u0440\u043e\u0432\u0435\u043d\u044c Secret (\u0442.\u0435. \u0432\u043d\u0438\u0437, down) \u2014 \u043e\u043d\u0438 \u0441\u0442\u0430\u043d\u0443\u0442 \u0441\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u043e\u0442\u0441\u044e\u0434\u0430 &quot;<b>no write down<\/b>&quot;. \u041f\u0440\u043e &quot;<b>read up<\/b>&quot;, \u043d\u0430\u0434\u0435\u044e\u044c, \u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e. \u0422\u0430\u043a \u0436\u0435 \u0432 MLS \u0435\u0441\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c <s>\u043c\u0435\u043d\u044f \u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043c\u043e\u043b\u0447\u0430\u0442\u044c<\/s> \u0434\u0430\u043b\u0435\u0435.<\/p>\n<pre><code class=\"bash\">type=SYSCALL msg=audit(1383338997.620:219): arch=40000003 syscall=102 success=no exit=-13 a0=3 a1=afbe1c10 a2=a779b000 a3=ffffffc8 items=0 ppid=1338 pid=1346 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=&quot;acpid&quot; exe=&quot;\/usr\/sbin\/acpid&quot; subj=system_u:system_r:initrc_t:s0-s3:c0.c31 key=(null) <\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043c\u043e\u043d acpid, \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0435\u0433\u0430\u043b\u0438\u044f\u043c\u0438 (uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0), \u0440\u0443\u0442 \u0440\u0443\u0442\u043e\u0432 \u0438 \u0431\u043e\u0444\u0445 \u0441\u0438\u0441\u043e\u043f\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 initrc_t (\u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b) \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0441\u044f (type=SYSCALL) \u043a \u0441\u043e\u043a\u0435\u0442\u0443 (syscall=102), \u0438 (<i>\u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e<\/i>) \u0431\u044b\u043b \u043d\u0435 \u043e\u043f\u043e\u0437\u043d\u0430\u043d, \u043d\u0435 \u0437\u0432\u0430\u043d, \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043f\u043e\u0441\u043b\u0430\u043d (success=no exit=-13). \u0425\u043e\u0442\u044f, \u044d\u0442\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0443\u0434\u0438\u0432\u043b\u044f\u0442\u044c, \u0432\u0435\u0434\u044c \u043c\u044b \u0432\u0441\u0435 \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0432 Linux root \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0433\u043b\u0430\u0432\u043d\u044b\u0439, \u0435\u0441\u0442\u044c \u0438 \u043f\u043e\u0432\u0430\u0436\u043d\u0435\u0435 \ud83d\ude42<br \/>  \u0417\u0430\u0433\u0430\u0434\u043a\u0430 \u0434\u043b\u044f \u043f\u044b\u0442\u043b\u0438\u0432\u044b\u0445 \u0443\u043c\u043e\u0432 \u2014 \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u0441\u043e\u043a\u0435\u0442\u0443 \u043e\u043d \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0441\u044f?*  <\/p>\n<pre><code class=\"bash\">type=AVC msg=audit(1383338997.810:233): avc:  denied  { search } for  pid=1470 comm=&quot;restorecond&quot; name=&quot;\/&quot; dev=&quot;tmpfs&quot; ino=376 scontext=system_u:system_r:restorecond_t:s0-s3:c0.c31 tcontext=system_u:object_r:var_run_t:s3:c0.c31 tclass=dir <\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0442\u0440\u0435\u0442\u044c\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443, \u0438\u0437 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u043a\u0438. \u041b\u043e\u0433\u0438 AVC (Access Vector Cache) \u044d\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0441 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u0412\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0435 \u043d\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a (scontext) c \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u043e\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 restorecond_t, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u043f\u043e\u0438\u0441\u043a ({search} \u0438 tclass=dir) \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 c \u043d\u043e\u043c\u0435\u0440\u043e\u043c inode=376 \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c var_run_t. \u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0447\u0435\u0433\u043e? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, no read up. \u0427\u0435\u0433\u043e \u0438\u0441\u043a\u0430\u043b? \u041d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e\u0442\u0432\u0435\u0442\u0438\u0442 <b>find \/var\/run -inum 376<\/b>. \u041a\u0430\u043a \u0440\u0430\u0437 \u0438\u0437 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 audit2allow \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e.<\/p>\n<p>  \u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043d\u0435\u0442 \u0432 \u044d\u0442\u0438\u0445 \u043b\u043e\u0433\u0430\u0445 \u043d\u0435\u0442. SELinux \u044d\u0442\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e <i>\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e<\/i>, \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e <i>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e<\/i>, \u0438 \u043f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u043d\u0435\u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e. \u041e\u043f\u044f\u0442\u044c-\u0436\u0435, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0431\u0438\u0442\u044c \u043e\u0431\u0435\u0437\u043b\u0438\u0447\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0433\u0443\u0433\u043b \u0438\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c <a href=\"http:\/\/selinuxproject.org\/page\/Main_Page\">\u0442\u0443\u0442<\/a>.\u0418\u0442\u0430\u043a, \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0447\u0442\u043e \u043c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u043c\u0435\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043b\u043e\u0433\u0438.<\/p>\n<p>  * \u041e\u0442\u0433\u0430\u0434\u043a\u0443 \u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u044b. <\/p><\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u043a \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c<\/b><\/p>\n<div class=\"spoiler_text\">\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f:<\/p>\n<ul>\n<li>\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/li>\n<li>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430<\/li>\n<\/ul>\n<p>\u041e\u043d\u0438 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 90% \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 permission denied, \u0438 \u0432 \u043d\u0438\u0445 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 audit2allow. \u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0432\u044b\u0431\u043e\u0440, <i>\u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e<\/i> \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0438\u043b\u0438 \u0432\u0442\u043e\u0440\u044b\u043c, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0432\u0430\u043c\u0438.<br \/>  \u0422\u0440\u0435\u0442\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0440\u0435\u0434\u043a\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u044b\u0439 \u043d\u043e \u0441\u0430\u043c\u044b\u0435 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439, \u044d\u0442\u043e \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 MLS (policy constrain violation), \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043b\u0435\u0437\u0442\u044c \u0432 \u0441\u0430\u043c\u043e\u0435 \u0441\u0435\u0440\u0434\u0446\u0435 MLS \u0438 \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f. \u0412\u043e\u0442 \u0442\u0443\u0442 \u0443\u0436\u0435 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c, <i>\u0437\u0430\u0447\u0435\u043c<\/i> \u043e\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0438 <i>\u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e<\/i> \u043e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c. \u0411\u0435\u0437\u0434\u0443\u043c\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0441\u043d\u0438\u0437\u044f\u0442 \u0432\u0430\u043c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. You have been warned (again).<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043b\u043e\u0442\u043d\u0430 \u043f\u0440\u043e \u043f\u0440\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043f\u043e\u0434\u043a\u0430\u0442 \u0432 \u043f\u043e\u0434\u043a\u0430\u0442\u0435 \u0432\u0432\u0438\u0434\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0430:<\/p>\n<ul>\n<li>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"bash\">root@sandbox:~# ls -laZ \/lib\/systemd\/systemd-udevd  -rwxr-xr-x. 1 root root system_u:object_r:bin_t:s0 210380 Sep 23 12:24 \/lib\/systemd\/systemd-udevd @local$ grep systemd-udevd custom\/policy\/ -R custom\/policy\/modules\/system\/udev.fc:\/usr\/lib\/systemd\/systemd-udevd -- gen_context(system_u:object_r:udev_exec_t,s0) <\/code><\/pre>\n<p>\u0412 \u0434\u0435\u0431\u0438\u0430\u043d\u0435 \/lib, \u0432 RefPolicy \/usr\/lib. \u041f\u0440\u0430\u0432\u0438\u043c:<\/p>\n<pre><code class=\"bash\">root@sandbox:~# semanage fcontext -m -t udev_exec_t \/lib\/systemd\/systemd-udevd # try to modify \/usr\/sbin\/semanage: File context for \/lib\/systemd\/systemd-udevd is not defined root@sandbox:~# semanage fcontext -a -t udev_exec_t \/lib\/systemd\/systemd-udevd # ok, add root@sandbox:~# grep udev  \/etc\/selinux\/custom\/contexts\/files\/file_contexts.local \/lib\/systemd\/systemd-udevd    system_u:object_r:udev_exec_t:s0 <\/code><\/pre>\n<p><b>semanage<\/b> \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e, \u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 (\u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0439 <i>\/etc\/selinux\/custom\/contexts\/files\/file_contexts.local<\/i>). \u0414\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0443 \u0441\u0435\u0431\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443, \u043d\u0430\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u043c (\u0438 \u0437\u0430\u043e\u0434\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443).<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0432\u043e\u0442 \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0443, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"bash\">type=AVC msg=audit(1383338997.860:251): avc:  denied  { module_request } for  pid=1524 comm=&quot;sshd&quot; kmod=&quot;net-pf-10&quot; scontext=system_u:system_r:sshd_t:s0-s3:c0.c31 tcontext=system_u:system_r:kernel_t:s3:c0.c31 tclass=system <\/code><\/pre>\n<p>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u043b\u043e\u0433\u0430 \u043f\u0440\u043e\u0441\u0442\u0430, \u043d\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0437\u0430\u043d\u044f\u0442\u0438\u0435 \u044d\u0442\u0438\u043c \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0443\u0442\u043e\u043c\u043b\u044f\u0435\u0442. \u0421\u043a\u0438\u043d\u0435\u043c \u0435\u0435 \u0432 log, \u0438 \u043f\u0443\u0441\u0442\u044c \u0437\u0430 \u043d\u0430\u0441 \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0430\u0448\u0438\u043d\u0430:<\/p>\n<pre><code class=\"bash\">root@sandbox:~# audit2allow -Rev -i \/root\/log  require {         type kernel_t;         type sshd_t;         class system module_request; }  #============= sshd_t ============== # audit(1383338997.860:251): #  scontext=&quot;system_u:system_r:sshd_t:s0-s3:c0.c31&quot; tcontext=&quot;system_u:system_r:kernel_t:s3:c0.c31&quot; #  class=&quot;system&quot; perms=&quot;module_request&quot; #  comm=&quot;sshd&quot; exe=&quot;&quot; path=&quot;&quot; #  message=&quot;type=AVC msg=audit(1383338997.860:251): avc:  denied  { #   module_request } for  pid=1524 comm=&quot;sshd&quot; kmod=&quot;net-pf-10&quot; #   scontext=system_u:system_r:sshd_t:s0-s3:c0.c31 #   tcontext=system_u:system_r:kernel_t:s3:c0.c31 tclass=system &quot; allow sshd_t kernel_t:system module_request; <\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0443\u0442 \u0443\u0436\u0435, \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0434\u0443\u043c\u0430\u0442\u044c \u2014 \u0437\u0430\u0434\u0430\u0435\u043c \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/p>\n<ul>\n<li>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442? sshd \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u044f\u0434\u0440\u043e. \u041e\u043a, net-pf-10 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u0435\u043d, \u0442.\u043a. ipv6 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442.<\/li>\n<li>\u0427\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438? \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u0443 sshd_t \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u044f\u0434\u0440\u043e. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043c\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043c, \u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0410 \u0435\u0441\u043b\u0438 \u043e\u043d \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0440\u0430\u0436\u0435\u0441\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c?<\/li>\n<li>\u0427\u0442\u043e \u043f\u0438\u0448\u0443\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445? <a href=\"https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=669047\">\u0425\u0435-\u0445\u0435<\/a>. \u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u043d\u043e \u043d\u0435\u0442, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0431\u0443\u043b\u0435\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043d\u0430\u043c \u0442\u043e\u0436\u0435 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e.<\/li>\n<li>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c? \u0414\u0430 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c sshd \u043f\u043e\u043f\u0440\u043e\u0448\u0430\u0439\u043d\u0438\u0447\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u043f\u0443\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043b\u0438. \u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f ipv6, \u043c\u044b \u0435\u0433\u043e \u0441\u0430\u043c\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c, \u0435\u0449\u0435 \u0434\u043e \u0441\u0442\u0430\u0440\u0442\u0430 ssh.<\/li>\n<\/ul>\n<p>\u0420\u0435\u0448\u0430\u0435\u043c \u043f\u0443\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0438\u043d\u0438\u043c\u043e\u0434\u0443\u043b\u044f, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0427\u0438\u0442\u0430\u0435\u043c <a href=\"http:\/\/selinuxproject.org\/page\/NB_RefPolicy#Source_Layout\">\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/a> \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0417\u0430\u043e\u0434\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u0440\u043a\u0430\u0441 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e):<\/p>\n<pre><code class=\"bash\">mkdir policy\/modules\/local && cd policy\/modules\/local echo '&lt;summary&gt;Local layer -- differences from reference policy.&lt;\/summary&gt;' &gt; metadata.xml echo '## &lt;summary&gt;sshd local policy&lt;\/summary&gt;' &gt; sshd_local.if echo '## no file contexts redefined here' &gt; sshd_local.fc cat &gt; sshd_local.te &lt;&lt;EOF &gt; policy_module(sshd_local, 0.0.1) &gt; ################################################################## &gt; require { &gt;         type kernel_t; &gt;         type sshd_t; &gt;         class system module_request; &gt; } &gt; #============= sshd_t ============== &gt; # dont audit requests for module load &gt; # NOTE: this may hide some denials in the future &gt; dontaudit sshd_t kernel_t:system module_request; &gt;  &gt; EOF <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043c\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u043d\u0430 <b>dontaudit sshd_t kernel_t:system module_request;<\/b> \u2014 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c, \u0438 \u0432 \u043b\u043e\u0433 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c. \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 \u0432 \u043b\u043e\u0433\u0435 \u043f\u0443\u0441\u0442\u043e, \u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u0430\u0432\u0438\u043b\u043e dontaudit. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0431\u0435\u0437 \u043d\u0438\u0445: <b>semodule -DB<\/b>, \u0438 \u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435\u0441\u044c \u043a \u043f\u043e\u0442\u043e\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043b\u043e\u0433.<br \/>  \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 modules.conf, c\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443, \u0437\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0441\u043c\u043e\u0442\u0440\u0438\u043c:<\/p>\n<pre><code class=\"bash\">root@sandbox:\/tmp# sesearch --allow -s sshd_t -t kernel_t | grep system root@sandbox:\/tmp# sesearch --dontaudit -s sshd_t -t kernel_t | grep system root@sandbox:\/tmp# dpkg -i selinux-policy-custom_0.0.1_all.deb  (Reading database ... 20371 files and directories currently installed.) Preparing to replace selinux-policy-custom 0.0.1 (using selinux-policy-custom_0.0.1_all.deb) ... Unpacking replacement selinux-policy-custom ... Setting up selinux-policy-custom (0.0.1) ... root@sandbox:\/tmp# sesearch --dontaudit -s sshd_t -t kernel_t | grep system    dontaudit sshd_t kernel_t : system module_request ;  root@sandbox:\/tmp# semodule -l | grep sshd_local sshd_local      0.0.1 <\/code><\/pre>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c, \u043c\u043e\u0434\u0443\u043b\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d. \u0421\u043b\u043e\u0436\u043d\u043e? \u0414\u0430 \u043d\u0443. \u0414\u043e\u043b\u0433\u043e \u0438 \u043c\u0443\u0442\u043e\u0440\u043d\u043e? \u041e \u0434\u0430.<\/p><\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 MLS<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 (the level of spoilers is over nine thousand!!1one):<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">the problem<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">type=AVC msg=audit(1383338997.630:221): avc:  denied  { sendto } for  pid=1351 comm=&quot;acpid&quot; path=&quot;\/dev\/log&quot; scontext=system_u:system_r:initrc_t:s0-s3:c0.c31 tcontext=system_u:system_r:syslogd_t:s3:c0.c31 tclass=unix_dgram_socket type=SYSCALL msg=audit(1383338997.630:221): arch=40000003 syscall=102 success=no exit=-13 a0=3 a1=afbe15d0 a2=a779b000 a3=ffffffc8 items=0 ppid=1 pid=1351 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=&quot;acpid&quot; exe=&quot;\/usr\/sbin\/acpid&quot; subj=system_u:system_r:initrc_t:s0-s3:c0.c31 key=(null) <\/code><\/pre>\n<\/div>\n<\/div>\n<p>\u0412\u043e\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">the decription<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">root@sandbox:~# audit2allow -Rev -i \/tmp\/x   require {         type syslogd_t;         type initrc_t;         class unix_dgram_socket sendto; }  #============= initrc_t ============== # audit(1383338997.630:221): #  scontext=&quot;system_u:system_r:initrc_t:s0-s3:c0.c31&quot; tcontext=&quot;system_u:system_r:syslogd_t:s3:c0.c31&quot; #  class=&quot;unix_dgram_socket&quot; perms=&quot;sendto&quot; #  comm=&quot;acpid&quot; exe=&quot;&quot; path=&quot;&quot; #  message=&quot;type=AVC msg=audit(1383338997.630:221): avc:  denied  { sendto } for #   pid=1351 comm=&quot;acpid&quot; path=&quot;\/dev\/log&quot; #   scontext=system_u:system_r:initrc_t:s0-s3:c0.c31 #   tcontext=system_u:system_r:syslogd_t:s3:c0.c31 tclass=unix_dgram_socket &quot;#!!!! This avc is a constraint violation.  You will need to add an attribute to either the source or target type to make it work. #Constraint rule:  #       Possible cause source context and target context 'level' differ allow initrc_t syslogd_t:unix_dgram_socket sendto; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>\u0412\u043e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">the sesearch<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">root@sandbox:~# sesearch --allow -s initrc_t -t syslogd_t -c unix_dgram_socket Found 2 semantic av rules:    allow initrc_t syslogd_t : unix_dgram_socket sendto ;     allow unconfined_domain_type domain : unix_dgram_socket { ioctl read write create getattr setattr lock relabelfrom relabelto append bind connect listen accept getopt setopt shutdown recvfrom sendto recv_msg send_msg name_bind } ; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435 \u0432 MLS \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0431\u044b\u043b \u0431\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">offtopic<\/b><\/p>\n<div class=\"spoiler_text\">\u0417\u0430\u043e\u0434\u043d\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u044e \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c unconfined \u0434\u043e\u043c\u0435\u043d\u0430. \u041c\u043e\u0436\u043d\u043e \u0432\u0441\u0435, \u043d\u0430 \u0442\u043e \u043e\u043d \u0438 \u00ab\u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u00bb. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 SELinux \u043d\u0430 \u0447\u0435\u043c-\u0442\u043e, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u043c \u043e\u0442 strict, \u0441\u043c\u044b\u0441\u043b\u0430 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442. \u0418 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 strict, \u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u2014 unconfined, \u0442\u043e, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0432\u044b\u0432\u043e\u0434\u044b \u043e \u043d\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438 SELinux \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u043d\u043e\u0432\u0430\u0442\u043e, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c-\u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \ud83d\ude42<\/div>\n<\/div>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435. \u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0438\u0441\u043a\u043e\u043c\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435, \u0447\u0438\u0442\u0430\u0435\u043c:<\/p>\n<pre><code class=\"bash\">mlsconstrain unix_dgram_socket sendto     (( l1 eq l2 ) or     (( t1 == mlsnetwriteranged ) and ( l1 dom l2 ) and ( l1 domby h2 )) or     (( t1 == mlsnetwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or     ( t1 == mlsnetwrite ) or     ( t2 == mlstrustedobject )); # scontext=system_u:system_r:initrc_t:s0-s3:c0.c31 # tcontext=system_u:system_r:syslogd_t:s3:c0.c31 <\/code><\/pre>\n<p>\u0418\u0442\u043e\u0433\u043e, sendto \u0432 \u0441\u043e\u043a\u0435\u0442 (t1 \u043f\u0438\u0448\u0435\u0442 \u0432 t2) \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0435\u0441\u043b\u0438:<\/p>\n<ul>\n<li>\u043d\u0438\u0436\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 t1 \u0440\u0430\u0432\u0435\u043d \u0442\u0430\u043a\u043e\u0432\u043e\u043c\u0443 \u0443 t2 (s0 != s3), \u0438\u043b\u0438<\/li>\n<li>t1 \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u043a\u0430\u043a mlsnetwriteranged (\u043d\u0435\u0442, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a <i>seinfo -amlsnetwriteranged -x<\/i>), \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0443\u0436\u0435 \u043d\u0435 \u0432\u0430\u0436\u043d\u044b, \u0438\u043b\u0438<\/li>\n<li>t1 \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u043a\u0430\u043a mlsnetwritetoclr (\u043d\u0435\u0442, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e), \u0438\u043b\u0438<\/li>\n<li>t1 \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u043a\u0430\u043a mlsnetwrite (\u043d\u0435\u0442, \u0442\u0430\u043a\u043e\u0439 \u0442\u043e\u043b\u044c\u043a\u043e setrans_t), \u0438\u043b\u0438<\/li>\n<li>t2 \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u043a\u0430\u043a mlstrustedobject (\u043d\u0435\u0442, syslogd_t \u0442\u0430\u043c \u043d\u0435\u0442, \u043d\u043e \u0435\u0441\u0442\u044c devlog_t)<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u041a\u0441\u0442\u0430\u0442\u0438, \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u044b audit2allow \u043e\u043d\u0430 \u043d\u0430\u043c \u0441\u0430\u043c\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u0442 \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u0441\u0435 \u043c\u0435\u0442\u043a\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043d\u0430 \u043f\u0440\u0430\u0432\u0434\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c \u0444\u0430\u0439\u043b \/dev\/log:<\/p>\n<pre><code class=\"bash\">root@sandbox:~# ls -laZ \/dev\/log  srw-rw-rw-. 1 root root system_u:object_r:devlog_t:s3:c0.c31 0 Nov  1 23:06 \/dev\/log <\/code><\/pre>\n<p>\u00abWTF?!\u00bb \u2014 \u0441\u043a\u0430\u0436\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c. \u0412 \u043b\u043e\u0433\u0435 \u0436\u0435 tcontext~syslogd_t, \u0430 \u0443 \u0444\u0430\u0439\u043b\u0430 devlog_t? \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c ps:<\/p>\n<pre><code class=\"bash\">root@sandbox:~# ps -auxZ  | grep [r]syslog system_u:system_r:syslogd_t:s3:c0.c31 root 1338 0.0  0.3  30784   972 ?        Ssl  Nov01   0:00 \/usr\/sbin\/rsyslogd <\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u0440\u0443\u043a\u0430\u043c\u0438: rsyslog, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b\u0439 \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 syslogd_t, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 <i>\u0441\u043e\u043a\u0435\u0442<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0435\u0433\u043e \u0434\u043e\u043c\u0435\u043d, \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \/dev\/log; \u043d\u043e <i>\u0444\u0430\u0439\u043b<\/i> \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \/dev\/log \u0438\u043c\u0435\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 devlog_t \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u043c \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043c\u044b sendto \u043d\u0435 \u0432 \u0444\u0430\u0439\u043b \u0434\u0435\u043b\u0430\u0435\u043c, \u0430 \u0432 \u0441\u043e\u043a\u0435\u0442, \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f. <a href=\"http:\/\/www.spinics.net\/lists\/selinux\/msg10746.html\">\u0412\u043e\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e<\/a> \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e\u0442\u0432\u0435\u0442\u0438\u043b \u0430\u0432\u0442\u043e\u0440 SELinux, Stephen Smalley. \u0410 <a href=\"http:\/\/www.spinics.net\/lists\/selinux\/msg10839.html\">\u0432\u043e\u0442<\/a> \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0441\u0440\u0430\u0437\u0443 \u0441 \u043f\u0430\u0442\u0447\u0430\u043c\u0438. \u0410 \u0432\u043e\u0442 <a href=\"http:\/\/oss.tresys.com\/pipermail\/refpolicy\/2010-November\/003444.html\">\u0442\u0443\u0442<\/a> \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043c\u0435\u043d\u0430 syslogd_t \u043a\u0430\u043a mlstrustedobject, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \/proc\/`pidof rsyslog`\/ \u0442\u043e\u0436\u0435 \u0441\u0442\u0430\u043d\u0443\u0442 mlstrustedobject. \u041d\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u0432 Fedora \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u044d\u0442\u043e \u0438 \u0440\u0435\u0448\u0438\u043b\u0438. \u0427\u0442\u043e\u0436, \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u2014 \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 <i>\u043a\u0430\u043a<\/i> \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u0435, \u0430 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u044c\u0441\u044f \u0434\u0435\u0442\u0430\u043b\u0438 \u043c\u044b \u0438 \u0442\u0430\u043a \u043c\u043e\u0436\u0435\u043c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0443, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u044f \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0432\u043e\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0432\u043e\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code class=\"bash\">$ grep '' syslogd_local.* syslogd_local.fc:# no file contexts redefined here syslogd_local.if:## &lt;summary&gt;syslogd local policy&lt;\/summary&gt; syslogd_local.te:policy_module(syslogd_local, 0.0.1) syslogd_local.te:################################################################## syslogd_local.te:require { syslogd_local.te:       type syslogd_t; syslogd_local.te:} syslogd_local.te: syslogd_local.te:#============= syslogd_t ============== syslogd_local.te:# mark syslogd_t as mlstrustedobject syslogd_local.te:# this is possible security hole, TODO: get some heavy brain augmentation and investigate syslogd_local.te:mls_trusted_object(syslogd_t); <\/code><\/pre>\n<p>\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430 \u043d\u0430\u0441. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 modules.conf \u043f\u0435\u0440\u0435\u0434 \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438.<\/p><\/div>\n<\/div>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0427\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0441\u0435 \u0447\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0443 \u0432\u0430\u0441 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041d\u0430\u043f\u0435\u0440\u0432\u043e, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c permissive (\/etc\/selinux\/config), \u0438 \u0434\u043e\u0431\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b audit.log c \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0430\u043c \u0432\u0445\u043e\u0434, newrole, ssh. \u041f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u0432 enforcing, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u043a. \u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b auditd \u043b\u043e\u0433 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0432\u0445\u043e\u0434\u0430 \u043f\u043e ssh:<\/p>\n<pre><code class=\"bash\">root@sandbox:~# sestatus  SELinux status:                 enabled SELinuxfs mount:                \/sys\/fs\/selinux SELinux root directory:         \/etc\/selinux Loaded policy name:             custom Current mode:                   enforcing Mode from config file:          enforcing Policy MLS status:              enabled Policy deny_unknown status:     denied Max kernel policy version:      28 root@sandbox:~# cat \/var\/log\/audit\/audit.log  type=DAEMON_START msg=audit(1383360996.062:2774): auditd start, ver=2.3.2 format=raw kernel=3.10.17-vm-slnx auid=4294967295 pid=1278 subj=system_u:system_r:auditd_t:s3:c0.c31 res=success type=CONFIG_CHANGE msg=audit(1383360996.180:20): audit_backlog_limit=320 old=64 auid=4294967295 ses=4294967295  subj=system_u:system_r:auditctl_t:s0-s3:c0.c31 res=1 type=LOGIN msg=audit(1383361036.430:21): login pid=1568 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=1 type=LOGIN msg=audit(1383361038.410:22): login pid=1571 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=2 root@sandbox:~# id -Z root:secadm_r:secadm_t:s0-s3:c0.c31 <\/code><\/pre>\n<p>\u0412\u0441\u0435, \u0447\u0442\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c, \u044f \u0432\u044b\u043b\u043e\u0436\u0443 \u043f\u0430\u0442\u0447\u0435\u043c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443, \u0442\u0430\u043a \u043a\u0430\u043a, \u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u043d\u043e\u0433\u043e\u0432\u0430\u0442\u043e, \u0438 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u0430\u043c\u0438. \u041d\u0435 \u043f\u043e\u0436\u0430\u043b\u0435\u0435\u0442\u0435.<\/p><\/div>\n<\/div>\n<\/li>\n<\/ul>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 enforcing. \u041a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0431\u0435\u0433\u043b\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438, \u0438\u0441\u043a\u0440\u0435\u043d\u043d\u0435 \u043b\u044e\u0431\u0438\u0442 (\u0438\u043b\u0438 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0438\u0441\u043a\u0440\u0435\u043d\u043d\u0435 \u043d\u0435\u043d\u0430\u0432\u0438\u0434\u0438\u0442) \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 m4, \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0443 NSA, \u0437\u043d\u0430\u0435\u0442 \u0434\u0432\u0430 \u0434\u0435\u0441\u044f\u0442\u043a\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e SELinux \u0438 \u0434\u044e\u0436\u0438\u043d\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u0438\u043c\u0435\u043d\u043d\u043e.<br \/>  \u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043b\u0435\u0437\u0442\u044c \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0433\u043b\u0443\u0431\u0436\u0435, \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044e, \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0445.<\/p>\n<h4>MLS<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0432\u0441\u044f\u043a\u0438\u043c\u0438 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Common_Criteria\">\u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c\u0438<\/a> <a href=\"http:\/\/en.wikipedia.org\/wiki\/Trusted_Computer_System_Evaluation_Criteria\">\u043e\u0446\u0435\u043d\u043a\u0438<\/a> <a href=\"http:\/\/en.wikipedia.org\/wiki\/ITSEC\">\u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/a>, \u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0438\u0445, \u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0440\u0435\u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e (c <a href=\"http:\/\/www.commoncriteriaportal.org\/files\/ppfiles\/lspp.pdf\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438<\/a>(PDF) <a href=\"http:\/\/www.commoncriteriaportal.org\/files\/ppfiles\/lspp.pdf\">\u043f\u0440\u043e\u0444\u0438\u043b\u044f\u043c\u0438<\/a>(PDF), \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043e\u043a\u043e\u043b\u043e\u0432\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438), \u0438 \u0447\u0442\u043e \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <a href=\"http:\/\/en.wikipedia.org\/wiki\/Evaluation_Assurance_Level\">\u043d\u0435\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u0443\u0433\u0430\u0435\u0432<\/a>, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0435\u0435 \u0436\u0435\u0441\u0442\u043a\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438. <a href=\"http:\/\/en.wikipedia.org\/wiki\/Multilevel_security\">MLS<\/a> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c SELinux \u0435\u0449\u0435 \u0434\u0432\u0430 \u0443\u0440\u043e\u0432\u043d\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 (levels) \u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 (categories). \u041f\u0435\u0440\u0432\u044b\u0439 \u2014 \u044d\u0442\u043e \u043d\u0438 \u0447\u0442\u043e \u0438\u043d\u043e\u0435 \u043a\u0430\u043a \u00ab\u0434\u043e\u043f\u0443\u0441\u043a\u0438\u00bb, \u0433\u0434\u0435 \u0432\u044b\u0448\u0435\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0434\u043e\u043f\u0443\u0441\u043a \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u0436\u0435\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 (\u00ab\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u00bb \u043c\u043e\u0436\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441 \u0433\u0440\u0438\u0444\u043e\u043c \u00ab\u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u00bb), \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e-\u0436\u0435 \u0443\u0440\u043e\u0432\u043d\u044f, \u0433\u0434\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435.<br \/>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0431\u0430 \u044d\u0442\u0438\u0445 \u0443\u0440\u043e\u0432\u043d\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u043b\u044e\u0431\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 SELinux, \u0442\u043e \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0435\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, TopSecret -&gt; Secret -&gt; Unclassified, \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0435\u0441\u0442\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 flask;<\/li>\n<li>\u041c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u043a\u0430\u043a \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u0430\u043a \u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 \u0411\u0414;<\/li>\n<li>\u041f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0443\u0442\u0435\u0447\u043a\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 \u043d\u0438\u0437\u043b\u0435\u0436\u0430\u0449\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043f\u0440\u0430\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435;<\/li>\n<li>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 root), \u0441 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0440\u0430\u0437\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u043e\u043b\u0435\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/li>\n<li>\u0418 \u043f\u0440\u043e\u0447\u0438\u0439 \u043e\u0432\u0435\u0440\u043a\u0438\u043b\u043b \u0434\u043b\u044f 99% \u0441\u0438\u0441\u0442\u0435\u043c.<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432\u0441\u0435 \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0438\u043d\u0430\u0447\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u043d\u0438\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441 \u0433\u0440\u0438\u0444\u043e\u043c \u00abTop Secret\u00bb \u043f\u043e \u0438\u043d\u0441\u0442\u0430\u0433\u0440\u0430\u043c\u043c\u0430\u043c \ud83d\ude42<br \/>  \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438:<\/p>\n<pre><code class=\"bash\">root@sandbox:~# cat \/etc\/selinux\/custom\/setrans.conf Domain=Playbox  # levels s0=SystemLow s3:c0.c31=SystemHigh s0-s3:c0.c31=SystemLow-SystemHigh  s1=Confidential s2=Secret  # employee categories s1.c0=Ninjas s1.c1=Pirates s1.c2=Jesuses # secret stuff s2.c0=Aliens s2.c1=BigBrother <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043d\u0430\u0448 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0431\u044b \u043e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0442.\u0435. \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 s1 (Confidential). \u042d\u0442\u043e \u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, IPSec \u0438 \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0438\u043d\u0430\u0447\u0435 \u043d\u0438\u043a\u0442\u043e \u0435\u0433\u043e \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043d\u0430\u0441 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e ssh, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 RefPolicy:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">nginx<\/b><\/p>\n<div class=\"spoiler_text\">\u0412 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445 \u0435\u0441\u0442\u044c <a href=\"https:\/\/github.com\/simple10\/selinux-nginx\/tree\/master\/nginx\">\u043c\u043e\u0434\u0443\u043b\u044c<\/a> \u0434\u043b\u044f nginx, \u043d\u043e \u043e\u043d \u043d\u0430\u043c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0434\u043b\u044f MCS (\u0442\u043e\u043b\u044c\u043a\u043e s0). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0447\u0435\u0441\u0430\u0442\u044c NIH \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u043d\u0443\u043b\u044f. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u0441\u044f \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <b>dpkg -L<\/b> \u0438 <b>lsof<\/b>, \u044f \u043e\u0442\u043e\u0431\u0440\u0430\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435:<\/p>\n<pre><code class=\"bash\">\/usr\/sbin\/nginx         --      gen_context(system_u:object_r:nginx_exec_t,s1:c0.c2) \/etc\/init.d\/nginx               gen_context(system_u:object_r:nginx_initrc_exec_t,s1:c0.c2) \/etc\/nginx(\/.*)?                gen_context(system_u:object_r:nginx_etc_t,s1:c0.c2) \/var\/log\/nginx(\/.*)?            gen_context(system_u:object_r:nginx_var_log_t,s1:c0.c2) \/var\/run\/nginx(\/.*)?            gen_context(system_u:object_r:nginx_var_run_t,s1:c0.c2) \/var\/www(\/.*)?                  gen_context(system_u:object_r:nginx_var_www_t,s1:c0.c2) \/var\/lib\/nginx(\/.*)?            gen_context(system_u:object_r:nginx_var_lib_t,s1:c0.c3) <\/code><\/pre>\n<p>\u0412\u0441\u0435, \u0447\u0442\u043e \u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u043e \u0441\u044e\u0434\u0430, \u043d\u043e \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u0430\u043a\u0435\u0442\u0443 (\u0434\u043e\u043a\u0438, \u043c\u0430\u043d\u044b, \u0438 \u0442.\u043f.), \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432. \u0421\u0430\u043c \u0436\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 s1 (Confidential), \u0438 \u0432 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u0445 \u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043e \u0442\u0440\u0435\u0442\u044c\u044e. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u0441\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443. \u0421\u043f\u0435\u0440\u0432\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b, \u043c\u0435\u043d\u044f\u0435\u043c \u0440\u043e\u043b\u044c (<b>newrole -r secadm_r<\/b>), \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 premissive \u0440\u0435\u0436\u0438\u043c (<b>setenforce 0<\/b>), \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 \u0438 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b (<b>restorecon -RFvv \/<\/b>), \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u043c nginx \u0438\u0437 \u043f\u043e\u0434 sysadm_r (<b>run_init \/etc\/init.d\/nginx start<\/b>). \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0432 audit.log \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430. \u041c\u043e\u0436\u043d\u043e \u0438\u0445 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432 modname.if, \u0441\u043e\u0437\u0434\u0430\u0432 \u043a\u0430\u0440\u043a\u0430\u0441, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0433\u0435\u043d\u0435\u0440\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u044d\u0442\u043e \u00ab\u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439\u00bb \u0441\u043f\u043e\u0441\u043e\u0431:<\/p>\n<pre><code class=\"bash\">template(`web_server_template',`        type $1_t, web_server;        allow blah blah;        # so we can call web_server_template(nginxN) in modname.te ') <\/code><\/pre>\n<p>\u0410 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c modname.if \u043f\u0443\u0441\u0442\u044b\u043c \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e \u043c\u0435\u0440\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u044d\u0442\u043e \u00ab\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439\u00bb \u0441\u043f\u043e\u0441\u043e\u0431. \u042f \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0448\u0435\u043b \u0432\u0442\u043e\u0440\u044b\u043c \u043f\u0443\u0442\u0435\u043c. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u0442\u0438\u043f\u044b, \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u043e\u0431\u0432\u0435\u0448\u0430\u0432 \u0438\u0445 \u0441\u0430\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u043c\u0438, \u044d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u043d\u0430\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0430\u0432\u0438\u043b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c:<\/p>\n<pre><code class=\"bash\">root@sandbox:~# cat nginx_local.te policy_module(nginx_local, 0.0.1) ################################################################## type nginx_t; type nginx_exec_t; type nginx_initrc_exec_t; type nginx_etc_t; type nginx_var_log_t; type nginx_var_run_t; type nginx_var_www_t; type nginx_var_lib_t;  corecmd_executable_file(nginx_exec_t); init_script_file(nginx_initrc_exec_t) files_type(nginx_etc_t) logging_log_file(nginx_var_log_t) files_pid_file(nginx_var_run_t) files_type(nginx_var_www_t) files_type(nginx_var_lib_t)  init_ranged_daemon_domain(nginx_t, nginx_exec_t, s1:c0.c2) <\/code><\/pre>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 corecommands.if, \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u043e \u0447\u0442\u043e \u043e\u043d\u0438 \u0440\u0430\u0441\u043a\u0440\u043e\u044e\u0442\u0441\u044f. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u2014 \u043c\u0430\u043a\u0440\u043e\u0441, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 MLS, \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 nginx \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043b\u0435\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0438\u043d\u0438\u0442\u043e\u043c \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u043b\u043e\u0433\u0443, \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b (grep nginx \/var\/log\/audit\/audit.log | grep &#8216;sysctl&#8217;), \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044f \u0438\u0445 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f sysctl:<\/p>\n<pre><code class=\"bash\"># \/read kernel sysctl values require {      type sysctl_kernel_t;      class dir { search };      class file { open read }; } allow nginx_t sysctl_kernel_t:dir { search }; allow nginx_t sysctl_kernel_t:file { open read }; <\/code><\/pre>\n<p>\u0414\u043b\u044f socket:<\/p>\n<pre><code class=\"bash\"># socket bind require {      type node_t;      type http_port_t;      class tcp_socket { name_bind setopt bind create listen node_bind };      class capability { net_bind_service setuid setgid }; } allow nginx_t http_port_t:tcp_socket { name_bind }; allow nginx_t node_t:tcp_socket { node_bind }; allow nginx_t self:tcp_socket { bind create setopt listen }; allow nginx_t self:capability { net_bind_service setuid setgid }; <\/code><\/pre>\n<p>\u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0411\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u0442 audit2allow, \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u0430\u0436\u0435 \u0434\u0430\u0435\u0442 \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0441 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0439 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 MLS. \u042f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u043f\u0438\u0448\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0431\u043b\u043e\u043a require \u043f\u0435\u0440\u0435\u0434 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043f\u043e\u0440\u0446\u0438\u0435\u0439 \u043f\u0440\u0430\u0432\u0438\u043b, \u043c\u043d\u0435 \u0442\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b. \u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435, \u0443 \u0432\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0442\u0430\u043a\u043e\u0433\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">policy_module(nginx_local, 0.0.1) ################################################################## type nginx_t; type nginx_exec_t; type nginx_initrc_exec_t; type nginx_etc_t; type nginx_var_log_t; type nginx_var_run_t; type nginx_var_www_t; type nginx_var_lib_t;  corecmd_executable_file(nginx_exec_t); init_script_file(nginx_initrc_exec_t) files_type(nginx_etc_t) logging_log_file(nginx_var_log_t) files_pid_file(nginx_var_run_t) files_type(nginx_var_www_t) files_type(nginx_var_lib_t)  init_ranged_daemon_domain(nginx_t, nginx_exec_t, s1:c0.c2)  # rules # \/sys and \/sys\/devices\/systemcpu\/online require {         type sysfs_t;         class dir { search };         class file { read open }; } allow nginx_t sysfs_t:dir { search }; allow nginx_t sysfs_t:file { read open }; # \/read kernel sysctl values require {         type sysctl_kernel_t;         type sysctl_t;         class dir { search };         class file { open read }; } allow nginx_t sysctl_kernel_t:dir { search }; allow nginx_t sysctl_kernel_t:file { open read }; allow nginx_t sysctl_t:dir search; # self configs and symlinks require {         type nginx_etc_t;         class dir { open read search };         class file { open read getattr };         class lnk_file { read }; } allow nginx_t nginx_etc_t:dir { open read search }; allow nginx_t nginx_etc_t:file { open read getattr }; allow nginx_t nginx_etc_t:lnk_file { read }; # \/etc\/localtime, \/etc\/passwc, etc (no pun intended) require {         type locale_t;         type etc_t;         class file { read open getattr }; } allow nginx_t locale_t:file { read open getattr }; allow nginx_t etc_t:file { read open getattr }; # pid file require {         type var_run_t;         class dir { search write add_name remove_name } ;         class file { write read create open unlink }; } allow nginx_t var_run_t: dir { search }; allow nginx_t nginx_var_run_t: file { read write create open unlink }; allow nginx_t nginx_var_run_t: dir { search write add_name remove_name }; # libs require {         type var_lib_t;         class dir { search getattr }; } allow nginx_t var_lib_t:dir search; allow nginx_t nginx_var_lib_t: dir { search getattr }; # socket bind require {         type node_t;         type http_port_t;         class tcp_socket { name_bind setopt bind create listen node_bind };         class capability { net_bind_service setuid setgid }; } allow nginx_t http_port_t:tcp_socket { name_bind }; allow nginx_t node_t:tcp_socket { node_bind }; allow nginx_t self:tcp_socket { bind create setopt listen }; allow nginx_t self:capability { net_bind_service setuid setgid }; # socket accept require {         class tcp_socket { read write accept }; } allow nginx_t self:tcp_socket { read write accept }; # logs require {         type var_log_t;         class dir { search };         class file { open append }; } allow nginx_t var_log_t:dir { search }; allow nginx_t nginx_var_log_t:dir { search }; allow nginx_t nginx_var_log_t:file { open append }; # www require {         class dir { search getattr };         class file { read getattr open }; } allow nginx_t nginx_var_www_t:dir { search getattr }; allow nginx_t nginx_var_www_t:file { read getattr open }; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>, \u0447\u0442\u043e \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0435\u0439 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e.<\/p><\/div>\n<\/div>\n<p> \u0417\u0430\u0432\u043e\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0440\u043e\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">root\/sysadm_r@sandbox:~# adduser alice ...skipped... root\/sysadm_r@sandbox:~# adduser bob ...skipped... root\/secadm_r@sandbox:~# semanage user -a -R user_r -L s1 -r s1-s1:c0 ninjas root\/secadm_r@sandbox:~# semanage user -a -R user_r -L s2 -r s2-s2:c0 aliens root\/secadm_r@sandbox:~# semanage login -a -s ninjas alice root\/secadm_r@sandbox:~# semanage login -a -s aliens bob # or, ninjas to supervise alice root\/secadm_r@sandbox:~# restorecon -RFvv \/home\/ # thats all, folks. <\/code><\/pre>\n<p>\u0418\u0442\u043e\u0433\u043e, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\u043e\u0431\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043d\u0438\u0436\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f;<\/li>\n<li>\u043e\u0431\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432\u044b\u0448\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0434\u043e\u043f\u0443\u0441\u043a\u0430;<\/li>\n<li>\u043e\u0431\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0441\u0432\u043e\u0435\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0435\u0439. \u041f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u044e\u0449\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u043e\u043d\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u044b \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0435\u0439 c0;<\/li>\n<li>root \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442;<\/li>\n<li>\u0435\u0441\u043b\u0438 \u0443 \u0431\u043e\u0431\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0442-\u0436\u0435 SELinux ID, \u0447\u0442\u043e \u0438 \u0443 alice, \u043e\u043d \u0441\u043c\u043e\u0436\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0435 \u0444\u0430\u0439\u043b\u044b (\u0435\u0441\u043b\u0438 DAC \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442) \u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u0435\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b;<\/li>\n<li>\u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0438\u043a\u0443\u0434\u0430, \u043a\u0440\u043e\u043c\u0435 \u0441\u0432\u043e\u0438\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u044f\u0442 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c core \u2014 \u0443 \u043d\u0430\u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432 s0, \u0430 \u043e\u043d \u2014 s1.<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>Funky time<\/h4>\n<p>\u041d\u0443 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c, \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e, \u0431\u0443\u0434\u0443\u0442 \u0441\u043b\u0430\u0439\u0434\u044b. \u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u044f \u043a\u0443\u043f\u0438\u043b \u043f\u043e\u0434 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0432\u043f\u0441\u043a\u0443, \u0440\u044f\u0434\u044b\u0448\u043a\u043e\u043c \u0441 \u0410\u041d\u0411, \u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0435 \u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b \u043d\u0430 \u043d\u0435\u0439. \u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 SELinux, \u0437\u0430\u0439\u0442\u0438 \u043f\u043e\u0434 \u0440\u0443\u0442\u043e\u043c \u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u0431\u0440\u0430\u0442\u044c rm -rf \/* \u0432\u0441\u0435\u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u0435\u0439\u0448\u0435, \u043f\u043e\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u044f\u043a\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\/\u0441\u043f\u043b\u043e\u0439\u0442\u043e\u0432 \u0438 \u0440\u0443\u0442\u043a\u0438\u0442\u043e\u0432, \u0432 \u043e\u0431\u0449\u0435\u043c, \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u0438\u043c \u0410\u041d\u0411 \u043a\u0443\u0437\u044c\u043a\u0438\u043d\u0443 \u043c\u0430\u0442\u044c. \u041d\u043e \u043f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u0432\u044b \u0437\u0430\u0439\u043c\u0435\u0442\u0435\u0441\u044c \u044d\u0442\u0438\u043c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043a\u0430\u043a \u043f\u043e \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f\u043c, \u0442\u0430\u043a \u0438 \u043f\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c: <\/p>\n<h5>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043a\u0443\u0440\u0441\u0430, \u043c\u044b:<\/h5>\n<ul>\n<li>\u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e root \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043a\u0442\u043e-\u0443\u0433\u043e\u0434\u043d\u043e.<\/li>\n<li>\u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e ssh \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 shell.<\/li>\n<li>\u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e root \u0443 \u043d\u0430\u0441 \u043d\u0435\u0437\u0430\u043c\u0430\u043f\u043b\u0435\u043d \u043d\u0430 user_u, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b Russell Coker \u0432 \u0441\u0432\u043e\u0435\u0439 <a href=\"http:\/\/www.coker.com.au\/selinux\/play.html\">play machine<\/a>. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0432 production (\u043a\u0430\u043a \u0438 \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e-\u0436\u0435 \ud83d\ude42<\/li>\n<li>\u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u044f\u0434\u0440\u043e (\u043d\u0435\u0442 grsec, \u044d\u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u0442\u0435\u0441\u0442\u044b)<\/li>\n<li>\u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435\u0442 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0430.<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0438 \u0435\u0441\u0442\u044c \u0432 \u0418\u0411 \u0442\u0435\u0440\u043c\u0438\u043d \u0434\u043b\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u00ab\u0440\u0430\u0437\u0434\u0432\u0438\u0433\u0430\u0442\u044c\u00bb \u0438 \u00ab\u0431\u0443\u043b\u043a\u0438\u00bb, \u0442\u043e \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u043e. \u0412\u0441\u0435, \u0447\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0442 \u043f\u043e\u043b\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0430\u0446\u0438\u0438, \u044d\u0442\u043e SELinux. \u041a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0430\u0446\u0438\u044f \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u0430, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0437\u0430 \u043a\u0430\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<h5>\u041d\u043e \u0442\u0430\u043a-\u0436\u0435, \u0435\u0441\u0442\u044c \u0442\u043e, \u0434\u043b\u044f \u0447\u0435\u0433\u043e SELinux \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0441\u043d\u0430\u0447\u0435\u043d, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/h5>\n<ul>\n<li>SELinux \u044d\u0442\u043e \u043d\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041e\u043d \u043d\u0435 \u0441\u043f\u0430\u0441\u0435\u0442 \u043e\u0442 <b>:(){ :|:&#038; };:<\/b>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 fork bombs, \u043d\u043e \u0432\u0441\u0435-\u0436\u0435 \u2014 \u043d\u0435 \u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435; \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u0430\u0441 \u043a\u0438\u043a\u043d\u0435\u0442 \u0438 \u0432\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0439\u0442\u0438, \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u2014 \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0442\u044c \u0443\u043f\u0440\u0441\u0442\u0432\u043e \u2014 \u0442\u043e \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0439\u0442\u0438, \u043f\u043e\u043a\u0430 \u044f \u0432\u0441\u0435 \u043d\u0435 \u043f\u043e\u0447\u0438\u0449\u0443.<\/li>\n<li>SELinux \u044d\u0442\u043e \u043d\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0430\u0442\u0430\u043a \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043d\u0430\u0440\u0443\u0436\u0443 \u0441 \u0434\u0435\u043c\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0432\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435 SELinux \u0438\u043b\u0438 iptables \u2014 \u0432\u044b \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u043e\u043b\u043e\u0434\u0435\u0446, \u043d\u043e \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f \u044d\u0442\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u043b\u044e. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043a\u043e\u0441\u044f\u043a \u043d\u0435 SELinux, \u0430 \u043c\u043e\u0439 \ud83d\ude42<\/li>\n<li>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0442\u0430\u043c \u043d\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432\/\u0434\u0435\u0431\u0430\u0433\u0435\u0440\u043e\u0432 \u0438 \u0432\u0441\u0435\u0433\u043e \u0442\u043e\u0433\u043e, \u0447\u0435\u0433\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 \u043f\u0440\u043e\u0434\u0435 \u0438\u0442\u0430\u043a \u043d\u0435 \u0431\u044b\u0432\u0430\u0435\u0442. \u0412\u0435\u0440\u0441\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 MLS Play Machine \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u044f \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443 \u044d\u0442\u043e \u043d\u0435 \u043d\u0430 VPS, \u0430 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435. \u0417\u0430\u0442\u043e \u0435\u0441\u0442\u044c scp \u2014 \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/li>\n<li>\u0418 \u0434\u0430, \u0432 \u043b\u0443\u0447\u0448\u0438\u0445 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u044f\u0445 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0432\u0448\u0435\u0439 SELinux, \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0437\u0430\u043e\u0434\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0430\u043d\u0441\u043e\u0432 \ud83d\ude42 \u0410 \u0442\u043e \u0441\u0430\u043c\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, NSA, \u0410\u0440\u0438\u0437\u043e\u043d\u0430, Area51 \u043d\u0435\u0434\u0430\u043b\u0435\u043a\u043e, \u0430 \u0442\u0443\u0442 \u0440\u0443\u0442\u043e\u0432\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f. \u041d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c, \u0432\u0434\u0440\u0443\u0433 \u043c\u043d\u0435 \u0442\u0443\u0434\u0430 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u043f\u043e\u043d\u0430\u043f\u0438\u0445\u0430\u044e\u0442 \u0432\u0430\u0433\u043e\u043d. \u0421\u043d\u0438\u043c\u0435\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u044c \u2014 \u0432\u044b \u0442\u043e\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u043e\u043b\u043e\u0434\u0435\u0446, \u0438 \u0442\u043e\u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438.<\/li>\n<li>0day \u2014 \u043d\u0430 \u0432\u0430\u0448\u0435 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0432\u0441\u043f\u043b\u044b\u0432\u0435\u0442, \u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0431\u0443\u0434\u0443 \u043f\u043e\u043b\u044c\u0449\u0435\u043d. \u0425\u043e\u0442\u044f, \u043a\u043e\u043c\u0443 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \ud83d\ude42<\/li>\n<\/ul>\n<p>  \u0414\u043e\u043c\u0435\u043d \u044f \u043d\u0435 \u0437\u0430\u0432\u043e\u0434\u0438\u043b, \u044d\u0442\u043e \u0434\u043b\u044f \u0438\u0433\u0440\u0443\u0448\u043a\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 0.0.2. \u0412\u0435\u0440\u0441\u0438\u044f 0.0.1<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0442\u0443\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0435 \u0434\u0430\u044e: http:\/\/162.213.198.69<\/div>\n<\/div>\n<p>\u0418 \u0434\u0430, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0441\u044c\u0431\u0430 \u2014 please behave. \u041d\u0435 \u043d\u0430\u0434\u043e \u0443\u0431\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0443\u0442\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u043c\u0435\u0448\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u2014 \u043e\u0434\u0438\u043d \u043d\u0430 \u0432\u0441\u0435\u0445.  <\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f<\/h4>\n<p> * \u00a9 Tim Minchin, Lullaby    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/199202\/\"> http:\/\/habrahabr.ru\/post\/199202\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/cfa\/80e\/805\/cfa80e80563336b6fec88c41a29c85ca.png\" alt=\"NSA logo\" align=\"left\"\/>\u041f\u0440\u0438\u0432\u0435\u0442 \u0425\u0430\u0431\u0440! \u0414\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u0441\u0442\u043e\u043c \u044f \u0445\u043e\u0447\u0443 \u043d\u0435\u043c\u043d\u043e\u0436\u043d\u043e \u043e\u0442\u0432\u043b\u0435\u0447\u044c \u043c\u043d\u043e\u0433\u043e\u0443\u0432\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043e\u0442 \u043f\u0435\u0440\u0435\u0441\u0443\u0434 \u043d\u0430 \u0442\u0435\u043c\u0443 \u0410\u041d\u0411, \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u0435\u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443 \u00ab\u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435 SELinux\u00bb \u0438 \u00ab\u043f\u043e\u0441\u0432\u044f\u0442\u0438\u0442\u0435 \u0435\u043c\u0443 \u043b\u0443\u0447\u0448\u0438\u0435 \u0433\u043e\u0434\u044b \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043c\u0430\u043b\u0443\u044e \u0447\u0430\u0441\u0442\u044c\u00bb. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u0431\u0435 \u044d\u0442\u0438 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0434\u0430\u043b\u0435\u043a\u0438 \u043e\u0442 \u043f\u0440\u0430\u0432\u0434\u044b \u2014 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430, \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u0430 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c \u043e\u0431 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0443\u043a\u0432, \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0437\u043a\u043e\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438, \u0442.\u043a. \u043d\u0438\u0436\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u0430\u0432\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 SELinux, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u043b\u0438 \u0441 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u043e\u0434\u0441\u0442\u0443\u043f\u0438\u0442\u044c\u0441\u044f \u2014 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441. \u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u0430\u0432\u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0437\u043d\u0430\u0435\u0442\u0435 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0435, \u0442\u043e \u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u044d\u0442\u043e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u041d\u0443 \u0430 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u044b \u043f\u043e \u0418\u0411 \u0441 \u043c\u0438\u0440\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u043c\u043e\u0433\u0443\u0442 \u0441\u043c\u0435\u043b\u043e \u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u043d\u0435\u0446 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438\u0433\u0440\u0430\u0442\u044c, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u043d\u044b \u043d\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \ud83d\ude42<br \/>  \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0430\u0441\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0410\u041d\u0411 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c RSA, \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u043a\u043e\u0439 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043c\u0435\u0434\u0438\u0439\u043d\u044b\u043c\u0438 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u043c\u0438 \u2014 no hype, no FUD, only technology. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0432\u043b\u0435\u0437\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432 \u0441\u0430\u043c\u043e \u0441\u0435\u0440\u0434\u0446\u0435 MLS, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0435\u0434\u0440\u044f\u044f \u0441\u0432\u043e\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 (\u043c\u044b \u0442\u043e\u0436\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438), \u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e <s>\u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0432\u0437\u043b\u0435\u0442\u0435\u0442\u044c<\/s> \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u0442\u0435\u0441\u0442\u044b. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0447\u0442\u043e \u0438 \u043a\u0430\u043a, \u0430 \u0432\u044b \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 SELinux \u043a\u0430\u043a \u043d\u0430 \u043d\u0435\u0432\u0435\u0434\u043e\u043c\u0443 \u0437\u0432\u0435\u0440\u0443\u0448\u043a\u0443 \u0438 \u043e\u0431\u0438\u0442\u0435\u043b\u044c \u0437\u043b\u0430 \u043e\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430, \u0430 \u0441\u043c\u0435\u043b\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0432\u043e \u0431\u043b\u0430\u0433\u043e. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u0443\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432\u043e \u0432\u0441\u0435\u0445 \u0432\u0430\u0448\u0438\u0445 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430\u0445 (&gt;4.3) \u0438 \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445.<br \/>  \u0418\u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0432\u0441\u0435 \u0435\u0449\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0438 \u0432\u044b \u043d\u0435 \u0431\u043e\u0438\u0442\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u0434\u0435\u043b\u044e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u0432, \u0442\u043e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-199202","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/199202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=199202"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/199202\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=199202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=199202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=199202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}