Fix Python subprocess signing bug + add binding CI#22
Merged
Conversation
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>
NAAb Governance Report
See Security > Code scanning alerts tab for inline annotations on affected lines. Generated by NAAb Governance Engine v4.0 |
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>
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.
Summary
_subprocess_scan()wrote temp config files that lacked Ed25519.sigfiles, causingINTEGRITY BLOCKwhen trusted keys are installed. Added--config-stringflag tonaab-gov checkCLI that passes config inline vialoadFromString()(no file-based signature needed). Updated Python binding to use it..github/workflows/bindings.ymlbuilds 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.--config/--config-stringmutually exclusive, documented threat model, fixed tautological test assertions, wrapped Java double-close in try/catch, added config enforcement test.Test plan
Bindingsworkflow passes (Go, Rust, Java, C#, Python jobs)Build & Testworkflow passes (existing tests unaffected)naab-govCLI tests: 11/11 pass locally🤖 Generated with Claude Code