ci(security): add CodeQL code scanning for TypeScript and Python - #50
Merged
Merged
Conversation
Rounds 14 and 15 of the maintenance log both recommended a static-analysis
baseline and neither landed it. Dependabot's two halves (alerts + version
updates) and the `pnpm audit --prod --audit-level high` gate all read the
dependency graph; nothing in the CI set reads the code we wrote.
Scope is the two languages that dominate the tree — 66 TypeScript and 21 Python
files. Python additionally picks up the extensionless shebang'd scripts under
packages/vision/vlm/scripts/, which are Python in everything but name. C/C++ is
left out deliberately: the repository holds exactly one `.cpp`, and a CodeQL
C/C++ database that expects a build would need a full ROS2 Jazzy toolchain
(rclcpp, rviz_rendering) on the runner to extract anything useful.
Two choices worth stating, both to avoid a check that is red for reasons
unrelated to the change:
- Dependabot PRs are skipped. They get a read-only GITHUB_TOKEN, so the SARIF
upload cannot succeed ("Resource not accessible by integration") and the
check would go red on every dependency PR — six are open right now. The
push-to-main run analyses the merged result instead.
- `queries: security-extended` rather than the quality suite: this baseline is
for vulnerabilities, not style.
`analyze` reports to the Security tab and does not fail the build on findings,
so it cannot block a legitimate merge.
No `pnpm install` and no build step: both extractors are static, which keeps the
job fast and independent of the pnpm workspace layout.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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.
Why
The maintenance log recommended a static-analysis baseline in round 14 and again in round 15; neither landed. Today's CI reads the dependency graph and nothing else:
pnpm audit --prod --audit-level highgh api repos/StvLi/dsh-ros2/code-scanning/alertscurrently returns404 no analysis found.Scope
66 TypeScript files, 21 Python files. Python also picks up the extensionless shebang'd scripts under
packages/vision/vlm/scripts/(vlm_node,vlm_bridge_node,vision_bringup, …) — they are Python in everything but name and start with#!/usr/bin/env python3.C/C++ is out of scope on purpose: the repository holds exactly one
.cpp(packages/vision/offscreen/src/rviz_offscreen_node.cpp), and a CodeQL C/C++ database that expects a build would need a full ROS2 Jazzy toolchain (rclcpp,rviz_rendering) on the runner. Revisit if that surface grows.Two deliberate choices
Dependabot PRs are skipped. They receive a read-only
GITHUB_TOKEN, so the SARIF upload cannot succeed (Resource not accessible by integration) and the check would fail on every dependency PR — six are open right now. Thepush: mainrun analyses the merged result instead.queries: security-extended, not the quality suite. This is a vulnerability baseline, not a style gate.analyzereports to the Security tab and does not fail the build on findings, so it cannot block a legitimate merge.Cost
No
pnpm installand no build step — both extractors are static, so the job stays fast and does not depend on the pnpm workspace. Weeklyschedulere-scans unchanged code so a newly published query can still find something.github/codeql-action@v4is a mutable major tag, anddependabot.ymlalready watches thegithub-actionsecosystem at/, so it will be kept current automatically.Verification
if/ permissions)Once this is merged, the baseline shows up under Security → Code scanning.