Improve auditd field handling in the SELinux parser - #5182
Merged
joachimmetz merged 1 commit intoAug 2, 2026
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5182 +/- ##
=======================================
Coverage 85.10% 85.10%
=======================================
Files 456 456
Lines 41089 41094 +5
=======================================
+ Hits 34967 34972 +5
Misses 6122 6122 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #5180, as discussed there: the tier 1 auditd attribute changes that were
kept out of that PR, plus a few related field-handling corrections found while
comparing the parser against the linux-audit field dictionary and libauparse.
exeandcommare also stored in a nestedmsgtext_plugins/selinux.pyreadexeandcommonly from the top level of the messagebody, but USER_, SERVICE_, CRED_* and CRYPTO_* records store them inside the nested
single-quoted
msg='…'instead, soexecutableandprocess_namewere not extractedfor those record types at all. Against two captured audit logs of ~400 records each,
executablenow populates on 139 of 139 and 81 of 81 of those records respectively,where it previously populated on none of them, and
process_namelikewise populates onthe service records that carry it.
#5180 added the merged value lookup that makes this a one-line change per attribute;
this PR switches
exeandcommover to it. No record type stores either field inboth places, so there is no ambiguity.
exe,commare "encoded" fieldsPer the linux-audit
field dictionary
both are
encoded, meaning auditd hex-encodes the value when it contains charactersthat would need escaping (
AUPARSE_TYPE_ESCAPEDin libauparse'stypetab.h). They nowgo through the same byte-preserving decode as the other encoded fields.
Field types aligned with libauparse
successtobool— the same normalization applied tooperation_resultinAdd structured execution, file and user fields to the auditd parser #5180. libauparse maps 1 to "yes" and 0 to "no" for
AUPARSE_TYPE_SUCCESS, and thelog format writes
yes/nohere.exit_codetoint—exitisAUPARSE_TYPE_EXIT. The raw numeric value iskept rather than translated, since libauparse renders negative values as errno names
(
-13asEACCES), which is host and architecture specific and better left toanalysis.
audit_login_identifierandaudit_session_identifiermap4294967295toNone. That value is(uint32_t) -1, which libauparse renders as "unset", so it isan absent value rather than a real identifier.
Backward compatibility
No new events and no attribute removed or renamed.
successandexit_codechangetype, and the three attributes above populate on more record types than before. The
verification grammar is unchanged, so the plugin claims exactly the same files.
Testing
Unit tests over the existing RAW and ENRICHED fixtures, with expected values derived
from the
ausearch -ioracle. Validated on Ubuntu with GIFT-PPA dependencies(matching CI): unit tests,
psteal, and the full end-to-end suite including theext4_with_binariesover-claim guard.