Skip to content

Exclude .vscode-test/** from OneBranch SDL/CodeQL scans#5457

Merged
andyleejordan merged 2 commits intomainfrom
fix/codeql-exclude-vscode-test-artifacts
Apr 8, 2026
Merged

Exclude .vscode-test/** from OneBranch SDL/CodeQL scans#5457
andyleejordan merged 2 commits intomainfrom
fix/codeql-exclude-vscode-test-artifacts

Conversation

@TravisEz13
Copy link
Copy Markdown
Member

@TravisEz13 TravisEz13 commented Apr 8, 2026

Summary

This pull request makes a small update to the pipeline configuration to improve security scan accuracy. It excludes the .vscode-test/ directory—where VS Code Insiders binaries are downloaded for testing—from CodeQL scans, preventing false positives and unnecessary scan noise.

Root Cause

The @vscode/test-electron\ package downloads VS Code Insiders binaries into .vscode-test/\ when \Invoke-Build Test\ runs during the OneBranch pipeline. The directory is already in .gitignore\ but is present on disk when the async SDL/CodeQL scanner runs after the test step.

The CodeQL SM04514 'Weak hashes' alert fires against \cliProcessMain.js\ inside .vscode-test/vscode-win32-x64-archive-insiders/resources/app/out/vs/code/node/\ — this is VS Code's own bundled JavaScript, not PowerShell code. The PowerShell team has no ownership of or ability to fix hash usage inside VS Code's CLI runtime.

Fix

Adds \ob_sdl_codeql_pathsToExclude: .vscode-test/**\ to the OneBranch job variables, preventing the CodeQL scanner from analyzing downloaded VS Code test binaries.

Why this is safe

  • .vscode-test/\ contains third-party binary artifacts (VS Code), not PowerShell source code
  • The directory is already .gitignore'd — it is ephemeral test infrastructure
  • No PowerShell-authored code is excluded by this change

The @vscode/test-electron package downloads VS Code Insiders binaries
into .vscode-test/ at test time for extension integration tests. This
directory is already in .gitignore but is present on disk when the
OneBranch async SDL scanner runs after 'Invoke-Build Test'.

The CodeQL SM04514 'Weak hashes' alert (S360/ADO #35101062) fires
against VS Code's own cliProcessMain.js inside this directory — code
that the PowerShell team has no ownership of or ability to fix.

Adding ob_sdl_codeql_pathsToExclude prevents future false-positive
alerts from third-party VS Code binary artifacts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TravisEz13 TravisEz13 requested a review from a team as a code owner April 8, 2026 18:08
Copilot AI review requested due to automatic review settings April 8, 2026 18:08
Clarified comment regarding exclusion of VS Code test binaries from CodeQL scans.
@andyleejordan
Copy link
Copy Markdown
Member

@TravisEz13 the OneBranch team promised months ago that they would exlcude that folder by default, since it's not us it's the VS Code team's test package. I'll take this, but it is frustrating they didn't follow through.

@andyleejordan andyleejordan merged commit c5824e4 into main Apr 8, 2026
8 checks passed
@andyleejordan andyleejordan deleted the fix/codeql-exclude-vscode-test-artifacts branch April 8, 2026 18:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the OneBranch pipeline configuration to prevent CodeQL from scanning the locally-downloaded VS Code Insiders test binaries under .vscode-test/, avoiding an SDL false-positive.

Changes:

  • Adds an ob_sdl_codeql_pathsToExclude variable to exclude .vscode-test/** from CodeQL analysis.
  • Documents why the exclusion is needed (directory is populated by @vscode/test-electron during test execution and is not project-owned source).

@andyleejordan andyleejordan added the Issue-Bug A bug to squash. label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants