11 Star 1 Fork 33

src-openEuler/selinux-policy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
add-avc-for-systemd-journald.patch 2.45 KB
一键复制 编辑 原始数据 按行查看 历史
From f984d0f1fa193e7f5fdf8bd8aef92b24550eaec4 Mon Sep 17 00:00:00 2001
From: lujie42 <lujie42@huawei.com>
Date: Tue, 21 Dec 2021 17:19:13 +0800
Subject: [PATCH] add avc for systemd-journald
Signed-off-by: lujie42 <lujie42@huawei.com>
---
policy/modules/kernel/kernel.if | 18 ++++++++++++++++++
policy/modules/system/init.te | 5 +++++
policy/modules/system/logging.if | 18 ++++++++++++++++++
3 files changed, 41 insertions(+)
diff --git a/policy/modules/kernel/kernel.if b/policy/modules/kernel/kernel.if
index 62845c1..a2e2750 100644
--- a/policy/modules/kernel/kernel.if
+++ b/policy/modules/kernel/kernel.if
@@ -4245,6 +4245,24 @@ interface(`kernel_read_netlink_audit_socket',`
########################################
## <summary>
+## Access to netlink audit socket
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`kernel_netlink_audit_socket',`
+ gen_require(`
+ type kernel_t;
+ ')
+
+ allow $1 kernel_t:netlink_audit_socket $2;
+')
+
+########################################
+## <summary>
## Execute an unlabeled file in the specified domain.
## </summary>
## <param name="domain">
diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
index 9a4a0d2..0aea278 100644
--- a/policy/modules/system/init.te
+++ b/policy/modules/system/init.te
@@ -731,6 +731,11 @@ auth_rw_lastlog(init_t)
auth_domtrans_chk_passwd(init_t)
auth_manage_passwd(init_t)
+# avc for openEuler
+kernel_netlink_audit_socket(init_t, getattr)
+logging_access_journal(init_t)
+dev_read_kmsg(init_t)
+
ifdef(`distro_redhat',`
# it comes from setupr scripts used in systemd unit files
# has been covered by initrc_t
diff --git a/policy/modules/system/logging.if b/policy/modules/system/logging.if
index 8092f3e..3452bd2 100644
--- a/policy/modules/system/logging.if
+++ b/policy/modules/system/logging.if
@@ -1753,6 +1753,24 @@ interface(`logging_mmap_journal',`
#######################################
## <summary>
+## Access to files in /run/log/journal/ directory.
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`logging_access_journal',`
+ gen_require(`
+ type syslogd_var_run_t;
+ ')
+
+ allow $1 syslogd_var_run_t:file { create rename write };
+')
+
+#######################################
+## <summary>
## Watch the /run/log/journal directory.
## </summary>
## <param name="domain">
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/selinux-policy.git
git@gitee.com:src-openeuler/selinux-policy.git
src-openeuler
selinux-policy
selinux-policy
master

搜索帮助