Skip to content

Add CodeQL config to exclude .vscode-test/ from analysis (fixes S360 false positive)#5456

Merged
andyleejordan merged 1 commit intoPowerShell:mainfrom
TravisEz13:fix/codeql-exclude-vscode-test
Apr 8, 2026
Merged

Add CodeQL config to exclude .vscode-test/ from analysis (fixes S360 false positive)#5456
andyleejordan merged 1 commit intoPowerShell:mainfrom
TravisEz13:fix/codeql-exclude-vscode-test

Conversation

@TravisEz13
Copy link
Copy Markdown
Member

Summary

Adds a CodeQL analysis config to exclude .vscode-test/ from scanning.

Problem

S360/CodeQL was flagging CodeQL.SM04514 'Weak hashes' in:
.vscode-test/vscode-win32-x64-archive-insiders/resources/app/extensions/ms-vscode.js-debug/src/bootloader.js

This file is not PowerShell source code:

  • .vscode-test/ is populated at CI test runtime by the �scode-test npm package, which downloads a VS Code Insiders binary to run integration tests
  • .vscode-test/ is already excluded from the repo via .gitignore
  • ms-vscode.js-debug/bootloader.js is part of the VS Code JavaScript Debugger extension owned by the VS Code team, not PowerShell

The scanner is picking up runtime artifacts on the CI agent filesystem, not tracked source files.

Fix

Add .github/codeql/codeql-config.yml with paths-ignore to prevent CodeQL from analyzing downloaded test artifacts.

References

  • ADO Bug #34872363: [S360] [CodeQL.SM04514] 'Weak hashes' in .vscode-test/...

@TravisEz13 TravisEz13 requested a review from a team as a code owner April 8, 2026 18:04
Copilot AI review requested due to automatic review settings April 8, 2026 18:04
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

Adds a CodeQL analysis configuration intended to prevent CodeQL from scanning CI-downloaded VS Code test artifacts (not repo source), addressing an S360 false positive originating under .vscode-test/.

Changes:

  • Add .github/codeql/codeql-config.yml with paths-ignore entries for .vscode-test/ and common build/dependency output directories.

Comment on lines +4 to +7
- .vscode-test/ # Downloaded VS Code binaries for integration testing (in .gitignore)
- node_modules/
- out/
- dist/
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

paths-ignore patterns here are very literal; using a bare directory with a trailing slash (e.g. .vscode-test/) may not match all nested files depending on the CodeQL runner’s path matching rules. Consider switching to an explicit glob like .vscode-test/** (and similarly node_modules/**, out/**, dist/**) to ensure everything under those directories is excluded.

Suggested change
- .vscode-test/ # Downloaded VS Code binaries for integration testing (in .gitignore)
- node_modules/
- out/
- dist/
- .vscode-test/** # Downloaded VS Code binaries for integration testing (in .gitignore)
- node_modules/**
- out/**
- dist/**

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
# CodeQL analysis configuration for vscode-powershell.
# Excludes runtime-downloaded artifacts that are not part of the repository source.
paths-ignore:
- .vscode-test/ # Downloaded VS Code binaries for integration testing (in .gitignore)
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This repo already has a root CodeQL.yml that classifies .vscode-test as library. I couldn’t find any in-repo workflow/pipeline step explicitly pointing CodeQL at .github/codeql/codeql-config.yml; if the scanner you’re using doesn’t auto-discover this location, the new ignore list won’t take effect and the false positive will remain. Either (1) update the existing CodeQL.yml with the ignore config expected by your scanner, or (2) add/adjust the CodeQL invocation to reference this config file explicitly (and document which config file is authoritative).

Copilot uses AI. Check for mistakes.
The .vscode-test/ directory is populated at CI test runtime by the
vscode-test npm package, which downloads a VS Code binary to run
integration tests. This directory is already in .gitignore and
contains third-party VS Code/extension code (not PowerShell source).

S360/CodeQL was flagging CodeQL.SM04514 'Weak hashes' in:
  .vscode-test/.../ms-vscode.js-debug/src/bootloader.js

That file belongs to the VS Code JavaScript Debugger extension
(ms-vscode.js-debug), owned by the VS Code team. Adding a CodeQL
paths-ignore config prevents the scanner from analyzing runtime
artifacts that are outside PowerShell's ownership and control.

Resolves: ADO #34872363

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@andyleejordan andyleejordan force-pushed the fix/codeql-exclude-vscode-test branch from c8e3362 to 19750cb Compare April 8, 2026 18:26
@andyleejordan andyleejordan enabled auto-merge (squash) April 8, 2026 18:30
@andyleejordan andyleejordan disabled auto-merge April 8, 2026 18:30
@andyleejordan andyleejordan merged commit d7d8f01 into PowerShell:main Apr 8, 2026
4 checks passed
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