Skip to content

Fix auditd watchdog Json response format break by invalid control character issue #22709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions dockers/docker-auditd-watchdog/watchdog/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dockers/docker-auditd-watchdog/watchdog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ edition = "2021"

[dependencies]
regex = "1.11.1"
serde_json = "1.0.140"
28 changes: 14 additions & 14 deletions dockers/docker-auditd-watchdog/watchdog/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,24 +176,24 @@ fn main() {
println!("Received request: {}", req_str);
}

let conf_result = check_auditd_conf();
let syslog_result = check_syslog_conf();
let rules_result = check_auditd_rules();
let srvc_result = check_auditd_service();
let srvc_active = check_auditd_active();
let reload_result = check_auditd_reload_status();
let rate_limit_result = check_auditd_rate_limit_status();
let conf_result = serde_json::to_string(&check_auditd_conf()).unwrap();
let syslog_result = serde_json::to_string(&check_syslog_conf()).unwrap();
let rules_result = serde_json::to_string(&check_auditd_rules()).unwrap();
let srvc_result = serde_json::to_string(&check_auditd_service()).unwrap();
let srvc_active = serde_json::to_string(&check_auditd_active()).unwrap();
let reload_result = serde_json::to_string(&check_auditd_reload_status()).unwrap();
let rate_limit_result = serde_json::to_string(&check_auditd_rate_limit_status()).unwrap();

// Build a JSON object
let json_body = format!(
r#"{{
"auditd_conf":"{}",
"syslog_conf":"{}",
"auditd_rules":"{}",
"auditd_service":"{}",
"auditd_active":"{}",
"auditd_reload":"{}",
"rate_limit":"{}"
"auditd_conf":{},
"syslog_conf":{},
"auditd_rules":{},
"auditd_service":{},
"auditd_active":{},
"auditd_reload":{},
"rate_limit":{}
}}"#,
conf_result,
syslog_result,
Expand Down
Loading