fix(security): secure SSL Bump key wiping via tmpfs#1156
Merged
Conversation
Store SSL Bump CA private keys in tmpfs (memory-only filesystem) when available, ensuring keys never touch persistent disk. When tmpfs is not available (e.g., insufficient permissions), fall back to disk storage. On cleanup, all SSL key material is securely wiped by overwriting with random data before deletion, preventing recovery of sensitive CA keys. - Add mountSslTmpfs/unmountSslTmpfs for memory-only key storage - Add secureWipeFile to overwrite files with random data before unlink - Add cleanupSslKeyMaterial to wipe all SSL files including ssl_db certs - Integrate secure cleanup into docker-manager cleanup lifecycle Fixes #247 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 82.36% | 82.42% | 📈 +0.06% |
| Statements | 82.33% | 82.39% | 📈 +0.06% |
| Functions | 82.75% | 82.60% | 📉 -0.15% |
| Branches | 74.38% | 74.52% | 📈 +0.14% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/ssl-bump.ts |
100.0% → 90.6% (-9.44%) | 100.0% → 90.6% (-9.44%) |
src/docker-manager.ts |
83.1% → 83.6% (+0.49%) | 82.4% → 82.9% (+0.48%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
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
Changes
src/ssl-bump.ts: AddmountSslTmpfs/unmountSslTmpfsfor memory-only storage,secureWipeFilefor secure deletion,cleanupSslKeyMaterialfor comprehensive SSL cleanupsrc/docker-manager.ts: Integrate secure SSL cleanup into the cleanup lifecycle (beforermSync)src/ssl-bump.test.ts: Add tests for secure wipe and cleanup functions, update mocks for tmpfsSecurity
crypto.randomBytes()andfsync'd before unlink, preventing recovery from disk.Test plan
npm run buildpassesnpm testpasses (821 tests)npm run lintpasses (0 errors)secureWipeFile,cleanupSslKeyMaterialFixes #247
🤖 Generated with Claude Code