From 04748e86d3e20080fa98df81b40cf022f0e4f90c Mon Sep 17 00:00:00 2001 From: aphralG <108004222+aphralG@users.noreply.github.com> Date: Fri, 8 Sep 2023 10:56:30 +0100 Subject: [PATCH] Fix SELinux Policy & Fix SELinux README (#467) * fix selinux policy --- scripts/selinux/README.md | 2 +- scripts/selinux/nginx_agent.pp | Bin 143279 -> 95276 bytes scripts/selinux/nginx_agent.te | 210 ++++++++++++++------------------- 3 files changed, 91 insertions(+), 121 deletions(-) diff --git a/scripts/selinux/README.md b/scripts/selinux/README.md index 5bf83b164..340a7c29a 100644 --- a/scripts/selinux/README.md +++ b/scripts/selinux/README.md @@ -56,7 +56,7 @@ sudo ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR --raw -se nginx_agent ``` Generate new rule based on the errors by using `audit2allow`: ``` -sudo ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR --raw -se nms -ts recent | audit2allow +sudo ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR --raw -se nginx_agent -ts recent | audit2allow ``` Update the `scripts/selinux/nginx_agent.te` file with the output from the `audit2allow` command. diff --git a/scripts/selinux/nginx_agent.pp b/scripts/selinux/nginx_agent.pp index 6834be7e8f2d0374fea104c8f0f2162c83e1fd86..6a2735074973ed8b2583d1fc6ef3fa4af8e92081 100644 GIT binary patch delta 1630 zcmZ8hZA_C_6n;j!234{f*_+Sj;@Yfa7Cw4iAmH>>Q7hYfL3HCU5731dOKP~17^kO z`j3b2KcLN{G+PmLDe#IX3H6?QJmyJ8mnRB)JsDyo-Pw%LmZWQLZnl~aS(?lZjykhD zobr*l)R}_Xb`?JIgk!GvJX(%qK`v9{yBiDS?riN#@ z)!&xQPs-qEqDzU6560j*j>_93L=E-HWJuj?w>31FZ7sHXY-`^Jo491QT`Q`oWIab) zkJfSY5<@Dd&26rCIrrk~vCU!(6+O@BD0h>^+1%LVYI)z>=xTD~x#LBccH$LLM-_Qg zk*s&L*sNx&qj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