You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix auditd watchdog Json response format break by invalid control character issue (#22709)
Fix auditd watchdog Json response format break by invalid control character issue
Why I did it
auditd watchdog some time return an invalid Json response, which will break test case:
E Failed: Invalid JSON response from auditd watchdog: {
E "auditd_conf":"FAIL (sha1 = efcce7fdf80e5ef917c40d60a2b6de55c9cfb466 -, expected = 7cdbd1450570c7c12bdc67115b46d9ae778cbd76)",
E "syslog_conf":"FAIL (syslog.conf does not contain 'active = yes': Command 'nsenter --target 1 --pid --mount --uts --ipc --net grep '^active = yes' /etc/audit/plugins.d/syslog.conf' failed with status 1: )",
E "auditd_rules":"FAIL (rules sha1 = 93e0a1416d3c3e12c2a708abe20e58c55c8d6d62 -, expected 77e0d8ff297ab3089b234fcd97a20e1c05380f3e)",
E "auditd_service":"FAIL (auditd.service does not contain 'CPUQuota=10%': Command 'nsenter --target 1 --pid --mount --uts --ipc --net grep '^CPUQuota=10%' /lib/systemd/system/auditd.service' failed with status 1: )",
E "auditd_active":"OK",
E "rate_limit":"FAIL (rate_limit: enabled 1
E failure 1
E pid 109644
E rate_limit 2000
E backlog_limit 8192
E lost 0
E backlog 0
E backlog_wait_time 60000
E backlog_wait_time_actual 0
E loginuid_immutable 0 unlocked
E mismatch with config file setting: 1000)"
E } exception: Invalid control character at: line 7 column 44 (char 760)
Work item tracking
Microsoft ADO 32313402
How I did it
Escape result before build Json response:
How to verify it
Pass all test case.
Manually verify format issue fixed:
{
"auditd_conf":"FAIL (sha1 = efcce7fdf80e5ef917c40d60a2b6de55c9cfb466 -)",
"syslog_conf":"FAIL (syslog.conf does not contain 'active = yes': Command 'nsenter --target 1 --pid --mount --uts --ipc --net grep '^active = yes' /etc/audit/plugins.d/syslog.conf' failed with status 1: )",
"auditd_rules":"FAIL (rules sha1 = da39a3ee5e6b4b0d3255bfef95601890afd80709 -, expected f88174f901ec8709bacaf325158f10ec62909d13)",
"auditd_service":"FAIL (auditd.service does not contain 'CPUQuota=10%': Command 'nsenter --target 1 --pid --mount --uts --ipc --net grep '^CPUQuota=10%' /lib/systemd/system/auditd.service' failed with status 1: )",
"auditd_active":"OK",
"auditd_reload":"OK",
"rate_limit":"FAIL (rate_limit: enabled 1\nfailure 1\npid 332282\nrate_limit 2000\nbacklog_limit 8192\nlost 0\nbacklog 0\nbacklog_wait_time 60000\nbacklog_wait_time_actual 0\nloginuid_immutable 0 unlocked\n mismatch with config file setting: 1000)"
}
0 commit comments