Release JavaScript GCP KMS Storage v1.0.0#874
Conversation
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: ./sdk/javascript/packages/gcp | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js 20.x | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| cache: 'npm' | ||
| cache-dependency-path: sdk/javascript/packages/gcp/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run tests | ||
| run: npm test |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 months ago
To address the issue, the workflow YAML should be updated to specify a permissions block at the job or workflow root, stating the minimal necessary privileges. Since this workflow simply checks out code and runs tests — and does not perform write operations to the repository or PRs — the safest default is to set contents: read. This should be added as a new block immediately after the name: directive and before the on: directive (workflow root), or alternatively inside the test job. For clarity and to avoid unexpected privilege inheritance, the recommended location is at the workflow root; this will apply minimal permissions to all jobs.
No new methods or imports are needed to implement this; simply add the following YAML block in the right place:
permissions:
contents: read| @@ -1,4 +1,6 @@ | ||
| name: Test JavaScript Storage - GCP KMS | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
628a3fc to
9b588ed
Compare
8922cf4 to
046814c
Compare
2b58784 to
a2373f6
Compare
a2373f6 to
bdce57f
Compare
Initial release of the GCP Cloud KMS storage backend for the KSM JavaScript SDK with pre-publish bug fixes, CVE remediations, and workflow hardening. Bug fixes: - KSM-858: replace fast-crc32c with @aws-crypto/crc32c - KSM-847: rethrow KMS errors in encryptBuffer/decryptBuffer/saveConfig - KSM-840: fix delete() skipping keys with falsy values - KSM-837: correct in operator usage in contains(); normalize method visibility - fix getKeyDetails() swallowing errors — now propagates to init() - fix getBytes() returning undefined for zero-length Uint8Array Maintenance: - remove package-level publish workflow (superseded by root-level workflow) - upgrade @google-cloud/kms to 5.2.1 (CVE-2025-65945) - upgrade pino to v10 (CVE-2025-57319) - upgrade @isaacs/brace-expansion to 5.0.1 - upgrade axios to 1.7.9 - remove brace-expansion override breaking rimraf on Node 24 - update npm publish workflow: Node.js 24, Syft v1.32.0, new KSM config secret, ksm-action SHA 560d170b
bdce57f to
63e8e6a
Compare
Release of @keeper-security/secrets-manager-gcp v1.0.0
Google Cloud Key Management Service integration for secure storage of Keeper Secrets Manager configuration.
Dependencies:
Bug Fixes
getKeyDetails()silently swallowing errors — the catch block logged but did not rethrow, leaving key metadata (keyType,encryptionAlgorithm,isAsymmetric) uninitialized whengetCryptoKey()fails (bad credentials, non-existent key, network error).init()now propagates the real GCP error. Regression tests for PERMISSION_DENIED and NOT_FOUND scenarios.contains()—key in Object.keys(config)checked numeric array indices and always returnedfalsefor real config keys. Corrected tokey in config. Add regression tests.delete()— truthy checkif (config[key])silently skipped deletion of keys with falsy values ("",0). Corrected toif (key in config). Add regression tests.encryptBuffer()anddecryptBuffer()inutils.tsreturned empty values (Buffer.alloc(0)/"") on GCP KMS failure instead of rethrowing, silently discarding authentication failures, invalid key IDs, and permission errors;saveConfig()also caught and discarded errors without rethrowing; both layers now rethrow, makingsaveString(),saveBytes(),saveObject(), andchangeKey()propagate GCP KMS failures as expected;changeKey()'s rollback path (key and crypto client restoration) is now reachable; removed vestigialblob.length > 0guards insaveConfig()andcreateConfigFileIfMissing(), and deadplaintext.length > 0guard indecryptConfig().getBytes()— falsy checkif (bytesString)treated an empty base64 string ("", produced by saving a zero-lengthUint8Array) as absent, returningundefinedinstead ofUint8Array(0). Corrected toif (bytesString !== undefined). Add regression tests.fast-crc32cwith@aws-crypto/crc32c—fast-crc32cnative C++ addon segfaults on ARM64 and was incorrectly listed indevDependencies, causingMODULE_NOT_FOUNDfor consumers. Replaced with@aws-crypto/crc32c(pure JS, AWS-maintained, no native addon).privatetopublicto match Azure and AWS:contains(),isEmpty(),deleteAll(),readStorage(),saveStorage().Code Quality (KSM-868)
console.warnwiththis.logger.warn()insaveConfig()utils.tserror messagedecryptConfig(),loadConfig())readStorage()null check (config initialized to{}, condition never triggers)OAEP_PADDINgconstant with typo and itscryptoimporteslint.config.mjsglob pattern (src/*.ts}→src/**/*.ts)Documentation (KSM-868)
console.logfrom examples, fix "an GCP" → "a GCP" grammar, replacebankAccountwithpasswordfield type, fix heading indentationMaintenance
axiosfrom 1.13.2 to 1.7.9 to resolve high severity SSRF vulnerability (CVE-2025-27152). One low severity transitive finding remains (@tootallnate/once@2.0.0via@google-cloud/kms) — unfixable without upstream GCP SDK update, accepted as low risk. Grype rescan: 1 low finding.tsconfig.test.jsonwith@types/jesttypes and updatejest.config.jsto pass the test tsconfig to ts-jest, resolving LSP errors in test files.Closes https://keeper.atlassian.net/browse/KSM-704
Closes https://keeper.atlassian.net/browse/KSM-837
Closes https://keeper.atlassian.net/browse/KSM-840
Closes https://keeper.atlassian.net/browse/KSM-847
Closes https://keeper.atlassian.net/browse/KSM-849
Closes https://keeper.atlassian.net/browse/KSM-858
Closes https://keeper.atlassian.net/browse/KSM-867
Closes https://keeper.atlassian.net/browse/KSM-868