Commit 8384ca1
🐛 normalize -k flag into fields array in audtid (#6933)
* fix(auditd): normalize -k flag into fields array
The audit rule parser stored -k (key name) only in the 'keyname' field
of auditd.rule.syscall, but did not add it to the 'fields' array.
This meant -k and -F key= produced different resource representations
despite being semantically identical (per auditctl(8), -k is shorthand
for -F key=).
Policy queries that check fields.where(key == "key") would only match
rules using -F key=value, silently missing rules using -k value. Since
-k is the standard form used in CIS benchmark remediation steps and
most audit rule examples, this caused false failures on correctly
configured systems.
Fix: when the parser encounters -k, also append "key="+value to
rawFields so it appears in the fields array alongside other -F entries.
The keyname field is still set for backward compatibility.
* chore(os): bump provider version to 13.2.2
* 🟢 add test for -k flag normalization into fields
Add a regression test verifying that the -k flag is normalized into the
fields array as key=<value>, so queries don't need to check both
representations. Update the test recording to match.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Tim Smith <tsmith84@proton.me>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent def874e commit 8384ca1
File tree
3 files changed
+21
-0
lines changed- providers-sdk/v1/testutils/testdata
- providers/os/resources
3 files changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1757 | 1757 | | |
1758 | 1758 | | |
1759 | 1759 | | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
1760 | 1765 | | |
1761 | 1766 | | |
1762 | 1767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
306 | 309 | | |
307 | 310 | | |
308 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
75 | 88 | | |
76 | 89 | | |
77 | 90 | | |
| |||
0 commit comments