Merged
Conversation
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).
There was a problem hiding this comment.
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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: readat the workflow level in.github/workflows/npm.ymland.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, andn8ninstallers were using.includes('https://github.com/')to check the output ofgit 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 silencesjs/incomplete-url-substring-sanitization.fix(grafanactl): redact secrets in runConfig errors (alert #4, error severity)runConfigembedded the full joined args in its thrownErrormessage — soconfig set contexts.X.grafana.password <value>leaked the plaintext password intoerror.message, which the outer catch handler then logged. Added aredactSensitiveArgshelper that replaces any value whose preceding key matches.token/.password/.secret/.apikeywith<redacted>before building the error message. This silencesjs/clear-text-logging.Test plan
npm run lintpassesnpm run check-formatpasses