-
Notifications
You must be signed in to change notification settings - Fork 3
feat(update): add auto-update system with verification and validation… #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
GitHub Runner Execution ResultsPR: #423 - feat(update): add auto-update system with verification and validation… ❌ python-bindings.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ test-on-pr.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ ci-optimized.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ vm-execution-tests.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ ci-native.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ✅ Powered by terraphim-github-runner |
Code Review: Auto-Update System ImplementationOverviewThis PR introduces a comprehensive auto-update system for Terraphim AI binaries. The implementation is well-structured with ~12,000 additions across 38 files, primarily adding the ✅ Strengths1. Excellent Architecture & Modularity
2. Comprehensive Documentation
3. Security Considerations
4. Testing
|
- Update @types/node to 24.10.5 to match available versions - Update CI check script to expect Node.js 20 instead of 18 - Resolves npm install failures in CI
GitHub Runner Execution ResultsPR: #423 - feat(update): add auto-update system with verification and validation… ❌ ci.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ ci-optimized.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ test-on-pr.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ ci-native.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ vm-execution-tests.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ✅ Powered by terraphim-github-runner |
Implement actual cryptographic signature verification for auto-update system using zipsign-api (Ed25519 signatures), replacing the placeholder implementation. **Changes:** **Dependencies:** - Add zipsign-api v0.1 for signature verification - Add base64 v0.22 for public key decoding **Signature Verification (crates/terraphim_update/src/signature.rs):** - Implement verify_archive_signature() using zipsign-api - Signatures are embedded in .tar.gz archives (GZIP comment), not separate files - Add get_embedded_public_key() placeholder for public key storage - Update verify_signature_detailed() to use new verification API - Re-export ZipsignError for error handling **Key Generation (scripts/generate-zipsign-keypair.sh):** - Create key pair generation script using zipsign CLI - Instructions for secure private key storage (1Password) - Public key embedding workflow **Key Decisions:** - Chose zipsign-api over minisign-verify because: - Already integrated with self_update crate (signatures feature) - Designed for .tar.gz archives (exact use case) - Embeds signatures in archives (no separate .sig files needed) - Uses Ed25519 (modern, secure, fast) **Security:** - Placeholder public key returns Valid for development - Actual verification will reject invalid/tampered signatures - Fail-on-invalid approach for security-critical updates **Related:** - Issue #421 - CRITICAL: Implement actual signature verification - RESEARCH-SIGNATURE-VERIFICATION.md - Research document - DESIGN-SIGNATURE-VERIFICATION.md - Implementation plan **Next Steps:** - Generate real Ed25519 key pair - Integrate verification into update flow - Create signing script for release pipeline - Add comprehensive test suite Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implement Option A (manual download + verify + install) for secure updates with Ed25519 signature verification using zipsign-api. Changes: - Add update_with_verification() method for secure update flow - Add helper methods: get_latest_release_info(), download_release_archive(), install_verified_archive(), extract_zip(), extract_tarball(), get_target_triple() - Update check_and_update() to use signature verification by default - Add dependencies: flate2, tar, zip, tempfile - Rewrite signature.rs test module for new API (107 tests passing) Security: Updates are now rejected if signature is invalid, missing, or verification encounters an error. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ipeline Add automated signing infrastructure for release archives using zipsign Ed25519 signatures. Changes: - Create scripts/sign-release.sh for signing release archives - Integrate sign_binaries() into scripts/release.sh - Add signing step after package creation in release pipeline - Update SIGNATURE_VERIFICATION_PROGRESS.md Features: - Signs all .tar.gz and .tar.zst archives with Ed25519 signatures - Verifies signatures after signing - Skips already-signed archives - Graceful handling if signing key unavailable - Comprehensive error checking and colored output Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add complete test coverage for signature verification functionality. Changes: - Create crates/terraphim_update/tests/signature_test.rs - Add 15 tests covering unit, integration, edge cases, property, and performance - Update SIGNATURE_VERIFICATION_PROGRESS.md Test Coverage: - Unit tests: placeholder key behavior, error handling, validation - Edge cases: corrupted archives, custom keys, non-file paths - Integration: signed archive verification, wrong key rejection, tamper detection - Property-based: deterministic behavior, no-panic guarantee - Performance: small archive and batch verification benchmarks All 15 tests passing. Integration tests are gated behind integration-signing feature (requires zipsign CLI). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Step 9 of signature verification implementation: - Generate Ed25519 key pair using zipsign - Embed real public key in signature.rs (placeholder replaced) - Update all tests to reflect correct security behavior (reject unsigned) - Add key fingerprint to documentation - Add keys/ directory to .gitignore - Create secure key storage instructions (keys/README.md) Public Key (v1.0): - Base64: 1uLjooBMO+HlpKeiD16WOtT3COWeC8J/o2ERmDiEMc4= - Fingerprint: 1c78db3c8e1afa3af4fcbaf32ccfa30988c82f9e7d383dfb127ae202732b631a Security Improvements: - All 107 lib tests updated to reject unsigned archives - All 15 integration tests updated to reject unsigned archives - Placeholder key behavior completely removed - Private key storage instructions provided for 1Password Test Results: - cargo test -p terraphim_update --lib: 107/107 passing - cargo test -p terraphim_update --test signature_test: 15/15 passing - Tests verify rejection of unsigned/corrupted archives (correct behavior) Next Steps: - Store private.key in 1Password vault "TerraphimPlatform" - Delete private.key from filesystem using shred - Configure GitHub Actions secret ZIPSIGN_PRIVATE_KEY Related: #421 Co-Authored-By: Terraphim AI
… embedded Updated progress tracking: - Step 9 marked complete (90% of implementation done) - All 10 success criteria now met - Ready for final security audit (Step 10) Next: Store private key in 1Password and perform security audit Co-Authored-By: Terraphim AI
- Update scripts/sign-release.sh with 1Password CLI integration - Add get_key_from_op() function to retrieve signing key from 1Password - Support ZIPSIGN_OP_ITEM environment variable for item ID - Support ZIPSIGN_PRIVATE_KEY=op:// to trigger 1Password retrieval - Add automatic cleanup of temporary key files with shred - Update usage documentation with 1Password examples - Update scripts/release.sh to prefer 1Password over file-based keys - Detect 1Password CLI availability in sign_binaries() - Use ZIPSIGN_OP_ITEM=jbhgblc7m2pluxe6ahqdfr5b6a when 1Password available - Fall back to file-based keys when 1Password CLI not found - Fix sign_cmd variable usage in execute call - Update keys/README.md with 1Password item reference - Document item ID: jbhgblc7m2pluxe6ahqdfr5b6a - Add three methods for using the signing key - Update GitHub Actions integration examples - Include 1Password Action configuration This completes the secure storage requirement for the Ed25519 signing key. The private key is now stored in 1Password vault TerraphimPlatform and all signing scripts have been updated to retrieve it securely. Note: Pre-commit hook flagged 'private_key' variable names as potential secrets, but these are just variable assignments with no hardcoded secrets. Ref: #421 Step 9-10 Co-Authored-By: Terraphim AI
GitHub Runner Execution ResultsPR: #423 - feat(update): add auto-update system with verification and validation… ❌ python-bindings.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ test-on-pr.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ ci-optimized.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ vm-execution-tests.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ❌ ci-native.ymlExecution failed: VM allocation failed: Allocation failed with status: 429 Too Many Requests ✅ Powered by terraphim-github-runner |
Documentation PreviewYour documentation changes have been deployed to: This preview will be available until the PR is closed. |
… reports