Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ima-parser crate, which provides type definitions and parsers for Linux Integrity Measurement Architecture (IMA) event logs and policies. The implementation supports both binary and ASCII log formats and includes logic for recomputing and verifying template hashes. Feedback identifies a bug in the unescape_filename function regarding multi-byte UTF-8 handling and recommends that calculate_template_hash return a Result or Option instead of panicking for unsupported algorithms to improve API safety. Additionally, the README.md contains duplicated content that should be consolidated.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e40e5ff798
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let computed = self.calculate_template_hash(algo); | ||
| computed == self.template_hash |
There was a problem hiding this comment.
Accept IMA violation markers in template-hash verification
verify_template_hash only returns true when the recomputed digest exactly matches self.template_hash, but IMA logs can encode integrity-violation entries with all-zeros/all-ones marker hashes. Those marker events will always be reported as invalid by this implementation, which creates false negatives during real log validation even though the method contract already states marker hashes should be treated as valid.
Useful? React with 👍 / 👎.
a64e366 to
9b90a0d
Compare
Adds a new Rust crate `ima-parser` with core parsing and hashing functionality for Linux IMA artifacts (IMA policy files and IMA log files), with example binaries (parse_ascii_log, parse_binary_log, parse_policy) and integration tests. Prepares GitHub Actions workflows (build, test, lint, docs, spdx). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Takuma IMAMURA <209989118+hyperfinitism@users.noreply.github.com>
9b90a0d to
79a03fd
Compare
Changes
ima-parserlibrary crate, which includes type definitions and parsers of IMA policy and IMA eventlog (both ASCII and binary)