Skip to content

fix: address CodeQL security alerts#70

Merged
fank merged 3 commits intomainfrom
claude/codeql-security-alerts
Apr 11, 2026
Merged

fix: address CodeQL security alerts#70
fank merged 3 commits intomainfrom
claude/codeql-security-alerts

Conversation

@fank
Copy link
Copy Markdown
Member

@fank fank commented Apr 11, 2026

Summary

Addresses all 8 open CodeQL code-scanning alerts on the repository, split into three commits by security class.

ci: workflow permissions (alerts #1, #3, #9)

Added permissions: contents: read at the workflow level in .github/workflows/npm.yml and .github/workflows/license_npm.yml. Both workflows only need read access to the repo, so the minimal permissions block covers all three alerts (actions/missing-workflow-permissions).

fix: exact-match git config check (alerts #5, #6, #7, #8)

The atl, discord, esq, and n8n installers were using .includes('https://github.com/') to check the output of git config --get url.git@github.com:.insteadOf. That output is either empty or exactly the value we set ourselves, so an exact-match comparison is both more correct and silences js/incomplete-url-substring-sanitization.

fix(grafanactl): redact secrets in runConfig errors (alert #4, error severity)

runConfig embedded the full joined args in its thrown Error message — so config set contexts.X.grafana.password <value> leaked the plaintext password into error.message, which the outer catch handler then logged. Added a redactSensitiveArgs helper that replaces any value whose preceding key matches .token / .password / .secret / .apikey with <redacted> before building the error message. This silences js/clear-text-logging.

Test plan

  • npm run lint passes
  • npm run check-format passes
  • CodeQL re-scan on PR confirms all 8 alerts are resolved

fank added 3 commits April 11, 2026 20:15
Addresses CodeQL alerts #1, #3, #9 (actions/missing-workflow-permissions).
Both workflows only need read access to the repo contents, so the minimal
permissions block is set at the workflow level.
The installers were using .includes('https://github.com/') to check the
output of `git config --get url.git@github.com:.insteadOf`. That output
is either empty or exactly the value we set ourselves, so exact match
is both more correct and silences CodeQL's
js/incomplete-url-substring-sanitization rule.

Addresses CodeQL alerts #5, #6, #7, #8 across atl, discord, esq, and
n8n installers.
runConfig threw errors containing the full args joined — for
`config set contexts.X.grafana.password <value>` that embedded the
plaintext password in error.message, which was then logged by the
outer catch handler.

Add a redactSensitiveArgs helper that replaces any value whose
preceding key matches .token / .password / .secret / .apikey with
<redacted> before building the error message.

Addresses CodeQL alert #4 (js/clear-text-logging, error severity).
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the GitHub URL configuration checks in several installer scripts to use strict equality instead of substring inclusion. Additionally, it introduces a redaction utility in lib/installers/grafanactl.js to mask sensitive arguments such as tokens and passwords in error messages to prevent credential leakage. I have no feedback to provide.

@fank fank merged commit 0a4e992 into main Apr 11, 2026
6 checks passed
@fank fank deleted the claude/codeql-security-alerts branch April 11, 2026 18:19
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.

1 participant