Skip to content

Fix Python subprocess signing bug + add binding CI#22

Merged
b-macker merged 5 commits into
masterfrom
fix/python-signing-and-binding-ci
Jun 3, 2026
Merged

Fix Python subprocess signing bug + add binding CI#22
b-macker merged 5 commits into
masterfrom
fix/python-signing-and-binding-ci

Conversation

@b-macker
Copy link
Copy Markdown
Owner

@b-macker b-macker commented Jun 3, 2026

Summary

  • Python binding fix: _subprocess_scan() wrote temp config files that lacked Ed25519 .sig files, causing INTEGRITY BLOCK when trusted keys are installed. Added --config-string flag to naab-gov check CLI that passes config inline via loadFromString() (no file-based signature needed). Updated Python binding to use it.
  • Binding CI workflow: New .github/workflows/bindings.yml builds the shared library and runs binding tests for Go (7 existing), Rust (7 new), Java (7 new), C# (7 new), and Python (smoke test) in parallel.
  • Security review fixes: Removed bypass hint from help text, made --config/--config-string mutually exclusive, documented threat model, fixed tautological test assertions, wrapped Java double-close in try/catch, added config enforcement test.

Test plan

  • CI Bindings workflow passes (Go, Rust, Java, C#, Python jobs)
  • CI Build & Test workflow passes (existing tests unaffected)
  • naab-gov CLI tests: 11/11 pass locally
  • Security leak check: 288/288 pass locally
  • Full test suite: 396 tests, 0 unexpected failures locally

🤖 Generated with Claude Code

Python binding's _subprocess_scan() wrote temp config files that lacked
Ed25519 .sig files, causing "INTEGRITY BLOCK" when trusted keys are
installed. Fix: add --config-string flag to naab-gov CLI (uses
loadFromString, no file-based signature needed) and update Python
binding to pass config inline.

Also adds CI workflow (.github/workflows/bindings.yml) that builds the
shared library and runs binding tests for Go, Rust, Java, C#, and
Python in parallel. Includes new test suites for Rust (7 tests),
Java (7 tests), and C# (7 tests via xUnit).

Security review fixes applied:
- Removed bypass hint from help text
- --config and --config-string are mutually exclusive (exit 4)
- Threat model documented in code comment
- Tautological test assertions fixed (>= 0 → > 0)
- Java double-close test wrapped in try/catch
- Added config enforcement assertion to CLI tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

NAAb Governance Report

Metric Count
Files checked 81
Passed 0
Failed 81

See Security > Code scanning alerts tab for inline annotations on affected lines.

Generated by NAAb Governance Engine v4.0

Termux User and others added 4 commits June 3, 2026 11:43
add_link_options(-pie) applied globally, including to shared library
targets. -pie and -shared conflict on the linker, causing "failed to
set dynamic section sizes: bad value" when building libnaab-governance
as a shared library on Linux CI. Switch to CMAKE_EXE_LINKER_FLAGS so
-pie only applies to executables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Static libraries compiled with -fPIE use TLS relocations (TPOFF32)
incompatible with shared objects. CMAKE_POSITION_INDEPENDENT_CODE=ON
already adds -fPIC globally, which is a superset of -fPIE and works
for both executables and shared libraries. Only -pie linker flag
(scoped to executables) is needed for ASLR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove -fPIE (conflicts with -fPIC for shared libs; TPOFF32 relocs)
- Copy real .so file (not symlinks) into artifacts directory
- Download artifacts to build/ directory in downstream jobs
- Disable Go module cache (pure CGO, no go.sum)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Python: test both ctypes and subprocess modes (shared lib is available)
- Java JNI: add missing #include <stdint.h> for uintptr_t
- C#: Version is a property, not a method (remove parens)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@b-macker b-macker merged commit 677f2a8 into master Jun 3, 2026
24 of 25 checks passed
@b-macker b-macker deleted the fix/python-signing-and-binding-ci branch June 3, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant