Skip to content

Release JavaScript GCP KMS Storage v1.0.0#874

Open
stas-schaller wants to merge 15 commits intomasterfrom
release/storage/javascript/gcp-kms/v1.0.0
Open

Release JavaScript GCP KMS Storage v1.0.0#874
stas-schaller wants to merge 15 commits intomasterfrom
release/storage/javascript/gcp-kms/v1.0.0

Conversation

@stas-schaller
Copy link
Contributor

@stas-schaller stas-schaller commented Nov 21, 2025

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:

  • @keeper-security/secrets-manager-core v17.3.0
  • @google-cloud/kms v4.5.0

Closes https://keeper.atlassian.net/browse/KSM-704

satish-metron and others added 6 commits November 21, 2025 12:23
* Bump version

* fix: resolve DOM Clobbering CVE-2024-43788 (#689)

* fix: resolve DOM Clobbering CVE-2024-43788

* Upgrade JavaScript tests GHA to use Node 20

* fixed moduleResolution in tsconfig
updated all dependencies

* Added GCP KMS support to KSM Javascript SDK

* Added RAW_Encrypt functionality

* Revert "Added RAW_Encrypt functionality"

This reverts commit f6616be.

* * Fixed issues related to writing to file even when encryption failed
* Added support for GCP Raw Encrypt Decrypt type of key

---------

Co-authored-by: Ivan Dimov <78815270+idimov-keeper@users.noreply.github.com>
Co-authored-by: satish_chandra <metron_satish@safebreach.com>
Co-authored-by: Ayush Asati <ayush.asati@metronlabs.com>
Comment on lines +19 to +38
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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 4 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
Suggested changeset 1
.github/workflows/test.javascript.storage.gcp.kms.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/test.javascript.storage.gcp.kms.yml b/.github/workflows/test.javascript.storage.gcp.kms.yml
--- a/.github/workflows/test.javascript.storage.gcp.kms.yml
+++ b/.github/workflows/test.javascript.storage.gcp.kms.yml
@@ -1,4 +1,6 @@
 name: Test JavaScript Storage - GCP KMS
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: Test JavaScript Storage - GCP KMS
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@stas-schaller stas-schaller marked this pull request as ready for review November 24, 2025 21:28
Comment on lines +78 to +106
needs: generate-sbom
if: ${{ github.event.inputs.publish == 'true' }}
environment: prod
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./sdk/javascript/packages/gcp

steps:
- name: Get the source code
uses: actions/checkout@v3

- name: Retrieve secrets from KSM
id: ksmsecrets
uses: Keeper-Security/ksm-action@master
with:
keeper-secret-config: ${{ secrets.KSM_KSM_CONFIG }}
secrets: |
NScQiZwrHJFCPv1gL8TX6Q/field/password > env:NPM_TOKEN

- name: Install dependencies
run: npm install

- name: Build package
run: npm run build

- name: Publish package
run: npm publish

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

In general, the fix is to explicitly set permissions for the GITHUB_TOKEN at either the workflow level or per job, restricting them to the minimum required (typically contents: read for workflows that only need to fetch code). Since this workflow only checks out code and runs local build/publish tooling, and does not interact with GitHub resources in a write-capacity, contents: read is sufficient. No existing functionality relies on broader permissions.

The best, least-invasive fix here is to add a top-level permissions block just under name: (or under on:), so it applies to both generate-sbom and publish-npm without duplicating configuration. Specifically, in .github/workflows/publish.npm.storage.gcp.kms.yml, after line 1 (name: Publish GCP Storage to NPM), insert:

permissions:
  contents: read

This documents the workflow’s requirement and ensures that even if the repo/org default changes or the workflow is copied elsewhere, the GITHUB_TOKEN used by both jobs will be limited to read-only access to repository contents. No new imports, tools, or additional methods are needed.

Suggested changeset 1
.github/workflows/publish.npm.storage.gcp.kms.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/publish.npm.storage.gcp.kms.yml b/.github/workflows/publish.npm.storage.gcp.kms.yml
--- a/.github/workflows/publish.npm.storage.gcp.kms.yml
+++ b/.github/workflows/publish.npm.storage.gcp.kms.yml
@@ -1,4 +1,6 @@
 name: Publish GCP Storage to NPM
+permissions:
+  contents: read
 on:
   workflow_dispatch:
     inputs:
EOF
@@ -1,4 +1,6 @@
name: Publish GCP Storage to NPM
permissions:
contents: read
on:
workflow_dispatch:
inputs:
Copilot is powered by AI and may make mistakes. Always verify output.
- Updates @google-cloud/kms from 4.5.0 to 5.2.1
- Updates jws from 4.0.0 to 4.0.1 (via google-auth-library)
- Resolves HIGH severity vulnerability (CVSS 7.5)
- Fixes improper HMAC signature verification in auth0/node-jws
Comment on lines +13 to +86
runs-on: ubuntu-latest
steps:
- name: Get the source code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install package dependencies
run: npm install
working-directory: ./sdk/javascript/packages/gcp

- name: Install Syft
run: |
echo "Installing Syft v1.18.1..."
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /tmp/bin v1.18.1
echo "/tmp/bin" >> $GITHUB_PATH

- name: Install Manifest CLI
run: |
echo "Installing Manifest CLI v0.18.3..."
curl -sSfL https://raw.githubusercontent.com/manifest-cyber/cli/main/install.sh | sh -s -- -b /tmp/bin v0.18.3

- name: Create Syft configuration
run: |
cat > syft-config.yaml << 'EOF'
package:
search:
scope: all-layers
cataloger:
enabled: true
java:
enabled: false
python:
enabled: false
nodejs:
enabled: true
EOF

- name: Generate and upload SBOM
env:
MANIFEST_API_KEY: ${{ secrets.MANIFEST_TOKEN }}
run: |
JAVASCRIPT_SDK_DIR="./sdk/javascript"

# Get version from package.json
echo "Detecting GCP Storage version..."
if [ -f "${JAVASCRIPT_SDK_DIR}/packages/gcp/package.json" ]; then
VERSION=$(grep -o '"version": "[^"]*"' "${JAVASCRIPT_SDK_DIR}/packages/gcp/package.json" | cut -d'"' -f4)
echo "Detected version: ${VERSION}"
else
VERSION="1.0.0"
echo "Could not detect version, using default: ${VERSION}"
fi

echo "Generating SBOM with Manifest CLI..."
/tmp/bin/manifest sbom "${JAVASCRIPT_SDK_DIR}/packages/gcp" \
--generator=syft \
--name=keeper-secrets-manager-javascript-storage-gcp-kms \
--version=${VERSION} \
--output=spdx-json \
--file=gcp-storage-sbom.json \
--api-key=${MANIFEST_API_KEY} \
--publish=true \
--asset-label=application,sbom-generated,nodejs,gcp-storage \
--generator-config=syft-config.yaml

echo "SBOM generated and uploaded successfully: gcp-storage-sbom.json"
echo "---------- SBOM Preview (first 20 lines) ----------"
head -n 20 gcp-storage-sbom.json

publish-npm:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

In general, the fix is to define an explicit permissions: block that restricts the GITHUB_TOKEN to the minimal scopes required. Since this workflow only checks out code and runs commands, it only needs read access to repository contents. We can apply this at the root level so it covers all jobs, unless a job requires additional scopes (none are apparent here).

The best minimal fix without changing existing behavior is to add a workflow‑level permissions: block right after the name: (or after on:) that sets contents: read. This will apply to both generate-sbom and publish-npm, and does not interfere with publishing to NPM because that uses an explicit NPM_TOKEN, not GITHUB_TOKEN. Concretely, edit .github/workflows/publish.npm.storage.gcp.kms.yml to insert:

permissions:
  contents: read

near the top, leaving all jobs and steps unchanged.

Suggested changeset 1
.github/workflows/publish.npm.storage.gcp.kms.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/publish.npm.storage.gcp.kms.yml b/.github/workflows/publish.npm.storage.gcp.kms.yml
--- a/.github/workflows/publish.npm.storage.gcp.kms.yml
+++ b/.github/workflows/publish.npm.storage.gcp.kms.yml
@@ -8,6 +8,9 @@
         default: true
         type: boolean
 
+permissions:
+  contents: read
+
 jobs:
   generate-sbom:
     runs-on: ubuntu-latest
EOF
@@ -8,6 +8,9 @@
default: true
type: boolean

permissions:
contents: read

jobs:
generate-sbom:
runs-on: ubuntu-latest
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants