3 Star 0 Fork 7

ocs-commit/audit

forked from OpenCloudOS Stream/audit 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
c408dd51c3010bef5e92390aa47dbc5e2b9a8391.patch 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
ocs-bot 提交于 2025-01-02 19:57 +08:00 . - [Type] bugfix
From c408dd51c3010bef5e92390aa47dbc5e2b9a8391 Mon Sep 17 00:00:00 2001
From: Steve Grubb <ausearch.1@gmail.com>
Date: Fri, 8 Mar 2024 16:26:10 -0500
Subject: [PATCH] Small fix for MAC_POLICY_LOAD and filesystem list audit rules
in the normalizer
---
auparse/normalize.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/auparse/normalize.c b/auparse/normalize.c
index ff71f1695..e4cc699a4 100644
--- a/auparse/normalize.c
+++ b/auparse/normalize.c
@@ -524,6 +524,13 @@ static int set_program_obj(auparse_state_t *au)
D.thing.primary = set_field(D.thing.primary,
auparse_get_field_num(au));
}
+ } else if (type == AUDIT_MAC_POLICY_LOAD) {
+ if (auparse_find_field(au, "lsm")) {
+ D.thing.primary = set_record(0,
+ auparse_get_record_num(au));
+ D.thing.primary = set_field(D.thing.primary,
+ auparse_get_field_num(au));
+ }
} else if (auparse_find_field(au, "exe")) {
const char *exe = auparse_interpret_field(au);
if ((strncmp(exe, "/usr/bin/python", 15) == 0) ||
@@ -1085,6 +1092,10 @@ const char *find_config_change_object(auparse_state_t *au)
return f;
auparse_first_record(au);
f = auparse_find_field(au, "actions"); // seccomp-logging
+ if (f)
+ return f;
+ auparse_first_record(au);
+ f = auparse_find_field(au, "list"); // If nothing else, the list
if (f)
return f;
@@ -1234,8 +1245,11 @@ static int normalize_compound(auparse_state_t *au)
o = find_simple_object(au, AUDIT_CONFIG_CHANGE);
D.thing.primary = o;
}
- } else
+ } else {
normalize_syscall(au, syscall);
+ if (otype == AUDIT_MAC_POLICY_LOAD)
+ set_program_obj(au);
+ }
}
free((void *)syscall);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-commit/audit.git
git@gitee.com:ocs-commit/audit.git
ocs-commit
audit
audit
master

搜索帮助