Skip to content

Release JavaScript AWS KMS Storage v1.0.0#875

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

Release JavaScript AWS KMS Storage v1.0.0#875
stas-schaller wants to merge 18 commits intomasterfrom
release/storage/javascript/aws-kms/v1.0.0

Conversation

@stas-schaller
Copy link
Contributor

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

Release of @keeper-security/secrets-manager-aws v1.0.0

AWS Key Management Service integration for secure storage of Keeper Secrets Manager configuration.

Dependencies:

  • @keeper-security/secrets-manager-core v17.3.0
  • @aws-sdk/client-kms v3.758.0

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

satish-metron and others added 7 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 Support for KSM JS SDK to be able to use a key from AWS to encrypt local config

* Added rimraf to devDependencies.

* Fixed issue with KMS overwriting configuration file even wne encryption failed

---------

Co-authored-by: Ivan Dimov <78815270+idimov-keeper@users.noreply.github.com>
Co-authored-by: satish_chandra <metron_satish@safebreach.com>
Comment on lines +19 to +38
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./sdk/javascript/packages/aws
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/aws/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 resolve the issue, an explicit permissions block should be added to limit the permissions granted to the workflow's jobs. The least-privilege starting point is typically contents: read, which allows jobs to clone and read the repository content but does not permit write operations. This block can be added either at the root level of the workflow, applying to all jobs, or just to the specific job. Since the workflow contains only one job (test), either location is acceptable, but best practice is to place it at the root for future extensibility. The modification involves editing .github/workflows/test.javascript.storage.aws.kms.yml by inserting the following block after the name: and before the on: section:

permissions:
  contents: read

No new imports, methods, or definitions are required beyond adding this block.

Suggested changeset 1
.github/workflows/test.javascript.storage.aws.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.aws.kms.yml b/.github/workflows/test.javascript.storage.aws.kms.yml
--- a/.github/workflows/test.javascript.storage.aws.kms.yml
+++ b/.github/workflows/test.javascript.storage.aws.kms.yml
@@ -1,4 +1,6 @@
 name: Test JavaScript Storage - AWS KMS
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: Test JavaScript Storage - AWS 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/aws

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 declare a permissions block that limits the GITHUB_TOKEN to the least privileges required by the workflow. This can be done at the workflow root (applies to all jobs) or per job. Because both generate-sbom and publish-npm only need to read repository contents (checkout), we can safely set permissions: contents: read at the workflow level. Neither job needs to write to the repo, manage issues/PRs, or interact with other GitHub resources.

The best fix with minimal functional impact is: add a top‑level permissions block just under the name: (and before on: or before jobs:) specifying contents: read. This keeps behavior the same (they already only read contents) while ensuring the token cannot be used to perform unintended write operations against the repository. No other scopes appear necessary: publishing to npm uses NPM_TOKEN from secrets; SBOM generation and upload use MANIFEST_API_KEY, not GITHUB_TOKEN. Concretely, edit .github/workflows/publish.npm.storage.aws.kms.yml to insert:

permissions:
  contents: read

immediately after line 1, or otherwise at the workflow root.

Suggested changeset 1
.github/workflows/publish.npm.storage.aws.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.aws.kms.yml b/.github/workflows/publish.npm.storage.aws.kms.yml
--- a/.github/workflows/publish.npm.storage.aws.kms.yml
+++ b/.github/workflows/publish.npm.storage.aws.kms.yml
@@ -1,4 +1,6 @@
 name: Publish AWS Storage to NPM
+permissions:
+  contents: read
 on:
   workflow_dispatch:
     inputs:
EOF
@@ -1,4 +1,6 @@
name: Publish AWS Storage to NPM
permissions:
contents: read
on:
workflow_dispatch:
inputs:
Copilot is powered by AI and may make mistakes. Always verify output.
…m8vf

- Updates @smithy/config-resolver from 4.1.0 to 4.4.6
- Resolves LOW severity vulnerability (CVSS 3.7)
- Defense-in-depth enhancement for region parameter validation
- Adds npm install step to generate-sbom job
- Ensures Syft scans actual installed dependencies
- Resolves phantom @smithy/config-resolver@4.1.0 detection
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/aws

- 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 AWS Storage version..."
if [ -f "${JAVASCRIPT_SDK_DIR}/packages/aws/package.json" ]; then
VERSION=$(grep -o '"version": "[^"]*"' "${JAVASCRIPT_SDK_DIR}/packages/aws/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/aws" \
--generator=syft \
--name=keeper-secrets-manager-javascript-storage-aws-kms \
--version=${VERSION} \
--output=spdx-json \
--file=aws-storage-sbom.json \
--api-key=${MANIFEST_API_KEY} \
--publish=true \
--asset-label=application,sbom-generated,nodejs,aws-storage \
--generator-config=syft-config.yaml

echo "SBOM generated and uploaded successfully: aws-storage-sbom.json"
echo "---------- SBOM Preview (first 20 lines) ----------"
head -n 20 aws-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 add an explicit permissions: block that grants only the minimal required access for the GITHUB_TOKEN. Since neither job interacts with repository contents in a write fashion (no pushes, releases, PR updates, etc.), we can safely set contents: read only. This both adheres to least privilege and documents the intended permissions.

The single best way here, without changing existing behavior, is to add a workflow‑level permissions: block, right after the name: or on: section. This will apply to all jobs that don’t define their own permissions: block. For this workflow, a minimal and appropriate configuration is:

permissions:
  contents: read

This gives the jobs just enough permission for actions (like actions/checkout) that rely on reading repository contents, while disallowing writes. No imports, methods, or additional YAML keys are needed beyond inserting this permissions mapping into .github/workflows/publish.npm.storage.aws.kms.yml.

Suggested changeset 1
.github/workflows/publish.npm.storage.aws.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.aws.kms.yml b/.github/workflows/publish.npm.storage.aws.kms.yml
--- a/.github/workflows/publish.npm.storage.aws.kms.yml
+++ b/.github/workflows/publish.npm.storage.aws.kms.yml
@@ -1,4 +1,6 @@
 name: Publish AWS Storage to NPM
+permissions:
+  contents: read
 on:
   workflow_dispatch:
     inputs:
EOF
@@ -1,4 +1,6 @@
name: Publish AWS Storage to NPM
permissions:
contents: read
on:
workflow_dispatch:
inputs:
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