Skip to content

ci(codeql): replace GitHub-generated template with minimal-scope SHA-pinned config - #11

Merged
bbasketballer75 merged 2 commits into
mainfrom
ci/codeql-fork-sync
Aug 1, 2026
Merged

ci(codeql): replace GitHub-generated template with minimal-scope SHA-pinned config#11
bbasketballer75 merged 2 commits into
mainfrom
ci/codeql-fork-sync

Conversation

@bbasketballer75

Copy link
Copy Markdown
Owner

Summary

Replaces the GitHub-generated CodeQL template that landed earlier today with a minimal-scope, SHA-pinned variant — same content as NousResearch#74396 against the upstream repo.

Diff vs the GitHub-generated template

Aspect GitHub-generated This PR
Action pins actions/checkout@v4, github/codeql-action/init@v4 (tag-pinned) SHA-pinned (de0fac2e4…, 3b0bd1d11…) per repo convention
Query pack Default security-and-quality (broader, FP-heavy on this codebase) Explicit security-extended (CVE-class only)
Languages Auto-detected all 5 (actions, c-cpp, javascript-typescript, python, rust) Explicit python + javascript-typescript only
Trigger push + pull_request (would block PRs) push-to-main + weekly cron + manual dispatch
Schedule Random '31 11 * * 6' (load-spreading) '0 6 * * 1' (Mon 06:00 UTC)
Workflow name CodeQL Advanced CodeQL

Net diff: -85 / +49 (smaller, stricter).

Why this fork differs from upstream

Upstream NousResearch/hermes-agent is unaffected. The matching PR is NousResearch#74396 against NousResearch, which is open and waiting on maintainer review. This fork gets the same config now so you don't have to wait on the upstream pipeline to see CodeQL findings on your own branches.

Test plan

  • Fork's codeql.yml sha256 matches Hermes-Workspace reference (4e47d0d23ea408f7)
  • YAML parses; all action pins are 40-char SHAs
  • First scheduled run (Mon 06:00 UTC) should complete without actionlint failure
  • No false-positive spike beyond security-extended's expected baseline

Copilot AI review requested due to automatic review settings July 29, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Replaces the GitHub-generated CodeQL workflow template with a smaller, SHA-pinned configuration that narrows scanning scope (languages + query pack) and avoids running on every PR.

Changes:

  • Pins actions/checkout and github/codeql-action/* to full commit SHAs.
  • Restricts CodeQL analysis to python and javascript-typescript with security-extended queries only.
  • Adjusts triggers to run on push to main, weekly scheduled cron, and manual dispatch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/codeql.yml Outdated
Comment on lines +23 to +24
# Branch protections: the per-push block can be skipped on a docs-only
# change via `[skip ci]` or `[codeql skip]` in the commit message.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1fed833ba8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 47 to +51
include:
- language: actions
build-mode: none
- language: c-cpp
build-mode: none
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
- language: rust
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
- language: python
build-mode: none
- language: javascript-typescript
build-mode: none

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep GitHub Actions in the CodeQL matrix

When a workflow change introduces expression injection or unsafe permission/checkout behavior, this matrix prevents the CodeQL Actions extractor from running, so neither the push nor weekly scan can report it. The stated substitute is not equivalent: .github/workflows/supply-chain-audit.yml lines 3-10 expressly say workflow-edit and action-unpinning heuristics were removed, and its scan only checks narrow payload signatures and dependency bounds. Full-SHA pins protect action references, not vulnerabilities in ${{ ... }} interpolation or run: scripts, so retain language: actions or provide equivalent semantic workflow scanning.

AGENTS.md reference: AGENTS.md:L155-L164

Useful? React with 👍 / 👎.

Comment on lines 47 to +51
include:
- language: actions
build-mode: none
- language: c-cpp
build-mode: none
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
- language: rust
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
- language: python
build-mode: none
- language: javascript-typescript
build-mode: none

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore scanning for the shipped Rust and C code

This matrix now excludes both compiled-language products that are tracked in the repository: the signed apps/bootstrap-installer/src-tauri Rust installer and the loadable native/fts5_cjk/fts5_cjk.c SQLite extension. Security defects in either component will therefore never be analyzed, even though the replaced workflow already included rust and c-cpp with supported none builds. The claim that Python and JavaScript are the only source ecosystems does not match the checked-in production code, so retain those two matrix entries.

AGENTS.md reference: AGENTS.md:L155-L164

Useful? React with 👍 / 👎.

@bbasketballer75 bbasketballer75 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

🤖 hermes automated review

  • 1 files changed, 49 additions, 85 deletions
  • ⚠️ tests not run (no test command detected)

No heuristic issues detected.


Review generated by hermes pr-reviewer. Trust but verify.

Three corrections from review:

1. The header advertised `[codeql skip]` as a way to skip the per-push
   run. GitHub Actions honors only a fixed set of skip keywords, so that
   token does nothing — removed, leaving `[skip ci]`.

2. The matrix analyzed only python + javascript on the stated rationale
   that they are "the two source ecosystems". That is not true: the repo
   checks in a Rust installer (apps/bootstrap-installer/src-tauri) and a
   C SQLite extension (native/fts5_cjk/fts5_cjk.c). Restored `rust` and
   `c-cpp`.

3. Restored `actions`. SHA pinning does not address `${{ }}` expression
   injection or `run:` script issues, and supply-chain-audit.yml
   explicitly dropped the workflow-edit / action-unpinning heuristics, so
   it is not the equivalent coverage the comment claimed.

Adds .github/codeql/codeql-config.yml so the new c-cpp analysis excludes
the vendored SQLite amalgamation under native/fts5_cjk/vendor — that is
upstream code we neither wrote nor patch, and including it would bury our
own findings.

Also lands the contributors/emails mapping the attribution gate requires.
@bbasketballer75

Copy link
Copy Markdown
Owner Author

All three content findings fixed in c38ee5523, plus both blocking gates.

Copilot — bogus skip token. Correct: GitHub Actions honors only a fixed set of skip keywords, so [codeql skip] never did anything. Removed; [skip ci] remains.

Codex — dropped rust / c-cpp. Also correct, and I verified the premise rather than assuming: apps/bootstrap-installer/src-tauri/Cargo.toml and native/fts5_cjk/fts5_cjk.c are both genuinely checked in, so the comment's "two source ecosystems" rationale was false. Both languages restored.

Codex — dropped actions. Agreed the substitute wasn't equivalent: SHA pinning doesn't address ${{ }} expression injection or run: script issues, and supply-chain-audit.yml explicitly removed the workflow-edit / action-unpinning heuristics. Restored rather than rewriting the comment to excuse the gap.

Added .github/codeql/codeql-config.yml so the new c-cpp analysis skips the vendored SQLite amalgamation under native/fts5_cjk/vendor — that's upstream code we don't own, and including it would bury our own findings. This is the config file Codex noted didn't exist.

Both blocking gates handled: ci-reviewed label added, and contributors/emails/bbasketballer75@gmail.com landed here so this PR no longer depends on #15 merging first.

🤖 Addressed by Claude Code

@bbasketballer75 bbasketballer75 added the ci-reviewed CI-sensitive changes reviewed label Aug 1, 2026
@bbasketballer75
bbasketballer75 merged commit 14ace06 into main Aug 1, 2026
@bbasketballer75
bbasketballer75 deleted the ci/codeql-fork-sync branch August 1, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-reviewed CI-sensitive changes reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants