Skip to content

feat: add ima-parser crate#1

Merged
hyperfinitism merged 1 commit intomainfrom
feature/initial
Apr 18, 2026
Merged

feat: add ima-parser crate#1
hyperfinitism merged 1 commit intomainfrom
feature/initial

Conversation

@hyperfinitism
Copy link
Copy Markdown
Owner

Changes

  • Add ima-parser library crate, which includes type definitions and parsers of IMA policy and IMA eventlog (both ASCII and binary)
  • Add integration tests for the library crate
  • Add example binaries (CLI tools)
  • Add comprehensive CI workflows (build, test, lint, docs, spdx)

@hyperfinitism hyperfinitism self-assigned this Apr 18, 2026
@hyperfinitism hyperfinitism added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 18, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/log/ascii.rs
Comment thread README.md Outdated
Comment thread src/log/event.rs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/log/ascii.rs Outdated
Comment thread src/log/event.rs Outdated
Comment on lines +84 to +85
let computed = self.calculate_template_hash(algo);
computed == self.template_hash
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@hyperfinitism hyperfinitism force-pushed the feature/initial branch 2 times, most recently from a64e366 to 9b90a0d Compare April 18, 2026 12:14
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>
@hyperfinitism hyperfinitism merged commit 1e76787 into main Apr 18, 2026
50 checks passed
@hyperfinitism hyperfinitism deleted the feature/initial branch April 18, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant