fix(toolkit): honor HTTPS_PROXY when installing the CLI; docs: close three documentation gaps - #272
Merged
Merged
Conversation
…O CLI Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This was referenced Jul 28, 2026
…ment variable is not a valid URL
There was a problem hiding this comment.
Pull request overview
This PR fixes MSDO CLI installation behind egress proxies by explicitly honoring HTTPS_PROXY/NO_PROXY when downloading from NuGet, and updates documentation to remove an inaccurate “latest tools” claim and fill gaps around SARIF upload and tool selection behavior.
Changes:
- Add proxy-aware HTTPS agents (via
@actions/http-clientproxy resolution +tunnel) for NuGet metadata and package downloads in the toolkit’s NuGet client. - Update README wording to clarify bundled tool versions track the installed MSDO CLI release.
- Document the
existingFilenameinput and explain how tool selection works (including thecontainer-mappingexception).
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Clarifies tool version pinning, documents existingFilename, and explains tool-selection behavior including container-mapping. |
| node_modules/@microsoft/security-devops-actions-toolkit/msdo-nuget-client.js | Ensures HTTPS downloads during CLI install can route through configured proxies by setting an appropriate agent on requests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sourabhsy
approved these changes
Jul 29, 2026
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.
Addresses four open issues: one behavioral fix and three documentation gaps.
fix(toolkit): honorHTTPS_PROXYandNO_PROXYwhen downloading the MSDO CLIFixes #61.
resolveRequestOptionsinmsdo-nuget-client.jsreturned request options with noagent, and bothhttps.requestcall sites — the NuGet service-index/metadata lookup and the.nupkgdownload — inherited that. Node'shttpsdoes not read proxy environment variables on its own, so on a runner behind an egress proxy the install reached out directly and hung or failed, regardless ofHTTPS_PROXYbeing set.This adds
resolveProxyAgent(url), which reuses@actions/http-client'sgetProxyUrlfor env-var andNO_PROXYresolution and builds atunnelagent, then assigns it at both call sites. Behavior is unchanged when no proxy is configured —getProxyUrlreturnsundefinedandoptions['agent']stays unset, so requests take exactly the path they take today. A proxy environment variable that is not a valid URL (HTTPS_PROXY=10.0.0.5:3128, no scheme) also falls back to a direct connection rather than failing the install.Both
@actions/http-clientandtunnelare already present and committed undernode_modules/, so the newrequires resolve without a dependency change.Caveat.
msdo-nuget-client.jslives undernode_modules/but is committed — only five toolkit files are tracked — so this is effective at runtime. It will be lost on the next bump of@microsoft/security-devops-actions-toolkit. The same fix needs to land upstream inmicrosoft/security-devops-actions-toolkit, where@actions/http-clientandtunnelshould also be declared dependencies rather than relying on the consumer's tree. The upstream fix would also cover the equivalent Azure DevOps task reports.docs: bundled tool versions track the MSDO CLI releaseFixes #267.
The README claimed MSDO "installs the latest versions of static analysis tools". It does not — third-party tool binaries ship as redist packages pinned to a CLI release, so a version published upstream is only picked up once a CLI release bundling it exists. The claim set an expectation the action cannot meet. Reworded, with an explicit note under the tools table.
docs: documentexistingFilenameFixes #36.
existingFilenamehas been declared inaction.ymlsince the input was added and maps toupload --file, but appears in zero markdown files, so the "can I publish SARIF from another tool?" question had no discoverable answer. Documents it, including that it short-circuits the analyzer run and does not set thesarifFileoutput.docs: explain tool selection and thecontainer-mappingexceptionFixes #135.
Adds a "How tools are selected" section covering the
tools-set vstools-unset paths and thecontainer-mappingasymmetry: it is implemented by this action'spre/poststeps rather than by the CLI, is filtered out of--toolinsrc/v1/msdo.ts, and its pre/post steps run on every use of the action regardless oftools. The content-based selection logic itself lives in the closed-source CLI, and the section says so rather than guessing at per-tool trigger conditions.Validation
npm run buildAndTestcould not be run in the authoring environment — devDependencies are not installed and the npm registry fails the TLS handshake there. Nosrc/v1/*.tsfile is touched, so the committedlib/does not need regenerating; CI covers the build.For the JS change:
node --checkonmsdo-nuget-client.js— passes.requires resolve from the toolkit directory.resolveProxyAgentexercised directly against the real vendoredtunneland@actions/http-client/lib/proxy, 11/11 cases: no proxy env (returnsundefined, direct);HTTPS_PROXYover http; lowercasehttps_proxy;HTTPS_PROXYover https (httpsOverHttps); proxy with credentials (proxyAuthpopulated);NO_PROXYmatching the target host (bypass);NO_PROXYnot matching (proxied);HTTP_PROXYalone correctly ignored for an https target; malformedHTTPS_PROXY(direct); scheme-lessHTTPS_PROXY(direct); proxy URL without an explicit port.