Repository navigation
fix: replace AWS SDK with native REST API and SigV4 signing (#25) - #25
Merged
Merged
Conversation
- Replace STS AssumeRoleWithWebIdentity with unsigned REST call + XML parsing - Replace KMS Decrypt with REST call + AWS SigV4 signing - Extract shared SigV4 utility (providers/sigv4.ts) - Convert sync command to use REST + SigV4 instead of KMSClient - Remove @aws-sdk/client-sts and @aws-sdk/client-kms (~200 transitive deps) - Zero runtime SDK dependencies — all clouds use native fetch Tests: 189 passing, tsc clean
- SHA256 hash correctness - Authorization header format validation (regex) - Deterministic signatures for same inputs - Different signatures for different bodies - Security token inclusion/exclusion 195 tests passing
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
PR Description: Security & Architectural Gaps Remediation
This PR resolves several key security and resiliency gaps identified in the
@lutfi.gr/vaultCLI architecture. All enhancements are implemented on the branchimprove/gaps-remediationand verified with standard unit tests.🛠️ Summary of Changes
1. Cryptographic & OTP Hardening (Vault Sharing)
crypto_pwhash_OPSLIMIT_SENSITIVEandcrypto_pwhash_MEMLIMIT_SENSITIVE).2. V8 Memory Zeroing (Secure Erase)
_sodium.memzero(plaintext)) on raw decrypted secrets insrc/core/envelope.tsto prevent sensitive environmental data from lingering in the V8 garbage-collector-managed heap.3. KMS Local Sync Portability (GCP & Azure)
src/features/sync/index.tsto support dynamic, OIDC-independent cloud provider decryption via local developer credentials. If dynamic OIDC tokens are absent, the CLI falls back to:gcloudCLI (gcloud auth application-default print-access-token).azCLI (az account get-access-token --resource https://vault.azure.net).4. Destructive Write Resiliency (Atomic Vault Writes)
writeVaultAtomicinsrc/core/vault-file.ts:.env.vaultconfiguration to a backup file (.env.vault.bak)..env.vault.[random].tmp).fs.renameSync).createLocalVault,addCommand,initCommand) to utilize the new atomic flow.🧪 Testing & Verification
npm test).test/core/vault-file.test.tsto assert thatwriteVaultAtomicbehaves correctly in nested directories, creates.bakrollback files upon overwriting, and atomic renames succeed cleanly.run.test.tsandshare.test.tsto reflect atomic temporary filename patterns and Argon2id sensitive parameter validations.📦 Commits Included in this PR