Skip to content

Commit a63dfe3

Browse files
hyperfinitismclaude
andcommitted
feat: add ima-parser crate
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>
1 parent 596e251 commit a63dfe3

37 files changed

Lines changed: 4618 additions & 2 deletions

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto eol=lf

‎.github/workflows/build.yml‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.rs'
7+
- '**/Cargo.toml'
8+
- '**/Cargo.lock'
9+
- '.github/workflows/build.yml'
10+
push:
11+
paths:
12+
- '**/*.rs'
13+
- '**/Cargo.toml'
14+
- '**/Cargo.lock'
15+
- '.github/workflows/build.yml'
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
build:
27+
runs-on: ${{ matrix.runner }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
toolchain:
32+
- "1.88.0"
33+
- stable
34+
os-arch:
35+
- ubuntu-24.04-x86_64
36+
- ubuntu-24.04-aarch64
37+
- macos-x86_64
38+
- macos-aarch64
39+
- windows-x86_64
40+
include:
41+
- os-arch: ubuntu-24.04-x86_64
42+
runner: ubuntu-24.04
43+
target: x86_64-unknown-linux-gnu
44+
- os-arch: ubuntu-24.04-aarch64
45+
runner: ubuntu-24.04-arm
46+
target: aarch64-unknown-linux-gnu
47+
- os-arch: macos-x86_64
48+
runner: macos-26-intel
49+
target: x86_64-apple-darwin
50+
- os-arch: macos-aarch64
51+
runner: macos-26
52+
target: aarch64-apple-darwin
53+
- os-arch: windows-x86_64
54+
runner: windows-2025
55+
target: x86_64-pc-windows-gnu
56+
steps:
57+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
58+
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
59+
with:
60+
toolchain: ${{ matrix.toolchain }}
61+
target: ${{ matrix.target }}
62+
- run: cargo build --locked --workspace --all-targets --all-features --target ${{ matrix.target }}

‎.github/workflows/docs.yml‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Docs
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.rs'
7+
- '**/Cargo.toml'
8+
- '**/Cargo.lock'
9+
- '.github/workflows/docs.yml'
10+
push:
11+
paths:
12+
- '**/*.rs'
13+
- '**/Cargo.toml'
14+
- '**/Cargo.lock'
15+
- '.github/workflows/docs.yml'
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
rdme:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
31+
with:
32+
toolchain: stable
33+
- uses: taiki-e/install-action@58e862542551f667fa44c8a2a4a1d64ad477c96a # v2.75.17
34+
with:
35+
tool: cargo-rdme
36+
- run: cargo rdme --check
37+
- run: cargo doc --locked --no-deps --lib --examples

‎.github/workflows/lint.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.rs'
7+
- '**/Cargo.toml'
8+
- '**/Cargo.lock'
9+
- '.github/workflows/lint.yml'
10+
push:
11+
paths:
12+
- '**/*.rs'
13+
- '**/Cargo.toml'
14+
- '**/Cargo.lock'
15+
- '.github/workflows/lint.yml'
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
rustfmt:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
31+
with:
32+
toolchain: stable
33+
components: rustfmt
34+
- run: cargo fmt --all -- --check
35+
36+
clippy:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
40+
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
41+
with:
42+
toolchain: stable
43+
components: clippy
44+
- run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings

‎.github/workflows/spdx.yml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: SPDX License Check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.rs'
7+
- ".github/workflows/spdx.yml"
8+
push:
9+
paths:
10+
- '**/*.rs'
11+
- ".github/workflows/spdx.yml"
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
spdx:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
- uses: enarx/spdx@d4020ee98e3101dd487c5184f27c6a6fb4f88709
27+
with:
28+
licenses: Apache-2.0

‎.github/workflows/test.yml‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/*.rs'
7+
- '**/Cargo.toml'
8+
- '**/Cargo.lock'
9+
- '.github/workflows/test.yml'
10+
pull_request:
11+
paths:
12+
- '**/*.rs'
13+
- '**/Cargo.toml'
14+
- '**/Cargo.lock'
15+
- '.github/workflows/test.yml'
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
env:
26+
CARGO_TERM_COLOR: always
27+
28+
jobs:
29+
test:
30+
runs-on: ${{ matrix.runner }}
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
toolchain:
35+
- "1.88.0"
36+
- stable
37+
os-arch:
38+
- ubuntu-24.04-x86_64
39+
- ubuntu-24.04-aarch64
40+
- macos-x86_64
41+
- macos-aarch64
42+
- windows-x86_64
43+
include:
44+
- os-arch: ubuntu-24.04-x86_64
45+
runner: ubuntu-24.04
46+
target: x86_64-unknown-linux-gnu
47+
- os-arch: ubuntu-24.04-aarch64
48+
runner: ubuntu-24.04-arm
49+
target: aarch64-unknown-linux-gnu
50+
- os-arch: macos-x86_64
51+
runner: macos-26-intel
52+
target: x86_64-apple-darwin
53+
- os-arch: macos-aarch64
54+
runner: macos-26
55+
target: aarch64-apple-darwin
56+
- os-arch: windows-x86_64
57+
runner: windows-2025
58+
target: x86_64-pc-windows-gnu
59+
60+
steps:
61+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
62+
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
63+
with:
64+
toolchain: ${{ matrix.toolchain }}
65+
target: ${{ matrix.target }}
66+
- run: cargo test --locked --all-targets --target ${{ matrix.target }}

0 commit comments

Comments
 (0)