-
Notifications
You must be signed in to change notification settings - Fork 2.1k
security: harden credential handling, add observability and CI workflows #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
100rabhkr
wants to merge
8
commits into
NVIDIA:main
from
100rabhkr:security/harden-credentials-and-observability
Closed
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
55db811
security: harden credential handling, add observability and CI workflows
100rabhkr 5e00c7c
fix: address credential exposure and signal handler review feedback
100rabhkr b2d78e0
fix: address eng review — rollback safety, test coverage, code quality
100rabhkr caf2713
fix: add message to successful validation, mark flaky test
100rabhkr b47fae0
fix: handle spawnSync errors in validateApiKey explicitly
100rabhkr 37bb222
fix: improve ENOENT messaging, clean up inline require and empty catch
100rabhkr 44970dc
fix: remove unused exports, restore stripped comments, clean up style
100rabhkr bb38862
fix: correct release tag glob, chain jobs, deterministic test
100rabhkr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # CodeQL security scanning — runs on PRs and weekly schedule. | ||
|
|
||
| name: codeql | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| schedule: | ||
| - cron: "0 6 * * 1" # Every Monday at 06:00 UTC | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| analyze: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: [javascript-typescript, python] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
|
|
||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@v3 | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 | ||
| with: | ||
| category: "/language:${{ matrix.language }}" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Automated release pipeline: runs tests, publishes to npm, creates GitHub Release | ||
| # with changelog generated from conventional commits. | ||
| # | ||
| # Triggered by pushing a semver tag (e.g., v0.2.0). | ||
|
|
||
| name: release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v[0-9]+.[0-9]+.[0-9]+*" | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
| cache: npm | ||
|
|
||
| - name: Install root dependencies | ||
| run: npm install | ||
|
|
||
| - name: Install and build TypeScript plugin | ||
| working-directory: nemoclaw | ||
| run: | | ||
| npm install | ||
| npm run build | ||
|
|
||
| - name: Run unit tests | ||
| run: node --test test/*.test.js | ||
|
|
||
| - name: Run TypeScript unit tests | ||
| working-directory: nemoclaw | ||
| run: npx vitest run | ||
|
|
||
| publish-npm: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
| registry-url: "https://registry.npmjs.org" | ||
|
|
||
| - name: Install and build | ||
| run: | | ||
| npm install | ||
| cd nemoclaw && npm install && npm run build && cd .. | ||
|
|
||
| - name: Publish to npm | ||
| run: npm publish --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| github-release: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Generate changelog from conventional commits | ||
| id: changelog | ||
| run: | | ||
| # Find the previous tag | ||
| PREV_TAG=$(git tag --sort=-version:refname | head -2 | tail -1) | ||
| if [ -z "$PREV_TAG" ] || [ "$PREV_TAG" = "${{ github.ref_name }}" ]; then | ||
| PREV_TAG=$(git rev-list --max-parents=0 HEAD) | ||
| fi | ||
|
|
||
| echo "## What's Changed" > /tmp/changelog.md | ||
| echo "" >> /tmp/changelog.md | ||
|
|
||
| # Group commits by type | ||
| for type_label in "feat:Features" "fix:Bug Fixes" "docs:Documentation" "chore:Maintenance" "refactor:Refactoring" "test:Tests" "ci:CI/CD" "perf:Performance"; do | ||
| type="${type_label%%:*}" | ||
| label="${type_label##*:}" | ||
| commits=$(git log "${PREV_TAG}..HEAD" --pretty=format:"- %s (%h)" --grep="^${type}" 2>/dev/null || true) | ||
| if [ -n "$commits" ]; then | ||
| echo "### ${label}" >> /tmp/changelog.md | ||
| echo "$commits" >> /tmp/changelog.md | ||
| echo "" >> /tmp/changelog.md | ||
| fi | ||
| done | ||
|
|
||
| echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${{ github.ref_name }}" >> /tmp/changelog.md | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| body_path: /tmp/changelog.md | ||
| draft: false | ||
| prerelease: ${{ contains(github.ref_name, '-') }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| // Debug logger for verbose/diagnostic output. | ||
| // Usage: | ||
| // LOG_LEVEL=debug nemoclaw onboard | ||
| // nemoclaw --verbose onboard | ||
|
|
||
| const LOG_LEVELS = { silent: 0, error: 1, warn: 2, info: 3, debug: 4 }; | ||
|
|
||
| let currentLevel = LOG_LEVELS.info; | ||
|
|
||
| function setLevel(level) { | ||
| const resolved = LOG_LEVELS[level]; | ||
| if (resolved !== undefined) { | ||
| currentLevel = resolved; | ||
| } | ||
| } | ||
|
|
||
| function debug(...args) { | ||
| if (currentLevel >= LOG_LEVELS.debug) { | ||
| console.error(" [debug]", ...args); | ||
| } | ||
| } | ||
|
|
||
| // Initialize from environment | ||
| const envLevel = (process.env.LOG_LEVEL || process.env.NEMOCLAW_LOG_LEVEL || "").toLowerCase(); | ||
| if (envLevel && LOG_LEVELS[envLevel] !== undefined) { | ||
| setLevel(envLevel); | ||
| } | ||
|
|
||
| module.exports = { LOG_LEVELS, setLevel, debug }; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.