Skip to content

ci: add CodeQL advanced setup workflow#62

Merged
jcardozo-eth merged 4 commits intomainfrom
ci/codeql-advanced-setup
Mar 24, 2026
Merged

ci: add CodeQL advanced setup workflow#62
jcardozo-eth merged 4 commits intomainfrom
ci/codeql-advanced-setup

Conversation

@jcardozo-eth
Copy link
Copy Markdown
Member

@jcardozo-eth jcardozo-eth commented Mar 24, 2026

Summary

  • Adds CodeQL security scanning via an Advanced Setup workflow (.github/workflows/codeql.yml)
  • Scans all 3 languages: actions, java-kotlin (manual build with Maven), and python
  • Runs on push to main, PRs targeting main, weekly schedule (Monday 06:30 UTC), and manual dispatch

Why CodeQL

CodeQL is GitHub's static analysis engine that automatically finds security vulnerabilities and coding errors in source code. For this project it provides:

  • Supply chain protection — the generated Java models use jackson-databind for deserialization, which has a history of CVEs. CodeQL detects unsafe deserialization patterns, injection vulnerabilities, and other issues that Dependabot (which only checks dependency versions) would miss.
  • CI/CD hardening — the actions scanner catches security misconfigurations in our GitHub Actions workflows, such as injection of untrusted input into run: steps or overly permissive permissions.
  • Continuous coverage — the weekly scheduled scan catches newly disclosed vulnerability patterns in existing code, even when no new commits are pushed.
  • PR-level feedback — CodeQL annotates pull requests with any new security findings, so issues are caught before they reach main.

Since this is a library published to GitHub Packages and TestPyPI, ensuring the generated models are free of known vulnerability patterns adds a layer of trust for downstream consumers.

Why Advanced Setup (not Default Setup)

CodeQL Default Setup (configured via the GitHub UI) doesn't grant security-events: write to Dependabot PRs. This means CodeQL can't upload SARIF results for the PR branch, so GitHub can't compare them against the main baseline. Every Dependabot PR shows a warning like:

Code scanning cannot determine the alerts introduced by this pull request, because 3 configurations present on refs/heads/main were not found

By switching to an Advanced Setup workflow checked into the repository, we explicitly declare security-events: write at the job level. GitHub trusts this because the workflow file lives on the base branch (main), so even Dependabot PRs get the permission they need to upload results.

What CodeQL covers

Language Build mode What it scans
actions none GitHub Actions workflow YAML files for security misconfigurations
java-kotlin manual Generated Java models from jsonschema2pojo + test code — deserialization patterns, jackson-databind usage, etc.
python none Python sources in src/data_archive/ — common security issues in generated Pydantic models

Pre-requisite

Before merging, disable CodeQL Default Setup in repo settings:
Settings > Code security and analysis > Code scanning > CodeQL analysis > switch to "Not configured"

Test plan

Replace CodeQL Default Setup with an explicit workflow to fix
the "configurations not found" warning on Dependabot PRs.
The key fix is granting security-events: write permission.

Scans actions, java-kotlin (with manual build), and python.
@jcardozo-eth jcardozo-eth self-assigned this Mar 24, 2026
@eth-library eth-library deleted a comment from Copilot AI Mar 24, 2026
@jcardozo-eth
Copy link
Copy Markdown
Member Author

@copilot review — focus on correctness: permissions, build configuration, and trigger logic.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@jcardozo-eth I've opened a new pull request, #65, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 24, 2026 10:26
ci: fix CodeQL workflow permissions, build conditions, and trigger scope
@jcardozo-eth jcardozo-eth merged commit 5e9add6 into main Mar 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants