Skip to content

feat(security): add codeql.yml for SAST scanning#100

Merged
don-petry merged 1 commit intomainfrom
claude/issue-39-20260408-2242
Apr 8, 2026
Merged

feat(security): add codeql.yml for SAST scanning#100
don-petry merged 1 commit intomainfrom
claude/issue-39-20260408-2242

Conversation

@don-petry
Copy link
Copy Markdown
Contributor

Summary

  • Adds the required codeql.yml CodeQL Analysis workflow to resolve compliance finding Compliance: missing-codeql.yml #39
  • Scans the actions ecosystem (required for repos with .github/workflows/*.yml per the CI standard)
  • Triggers: push/PR to main + weekly Friday scan (12:00 PM EST)
  • codeql-action pinned to v4.35.1 SHA per the Action Pinning Policy

Notes

  • Job name Analyze (actions) matches the Analyze (<lang>) pattern required for branch protection checks
  • permissions: {} top-level with least-privilege per-job scopes (actions: read, security-events: write, contents: read)
  • All actions SHA-pinned; Dependabot will keep them updated

Closes #39

Generated with Claude Code

Copilot AI review requested due to automatic review settings April 8, 2026 22:44
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 58 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 58 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3709bf6c-7caa-48b0-baa2-8ca6ca384684

📥 Commits

Reviewing files that changed from the base of the PR and between b1e410a and 2c2701a.

📒 Files selected for processing (1)
  • .github/workflows/codeql.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-39-20260408-2242

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

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 GitHub CodeQL Analysis workflow to bring the repository into compliance with the org CI standard and enable SAST scanning for the GitHub Actions ecosystem.

Changes:

  • Introduces .github/workflows/codeql.yml to run CodeQL on pushes/PRs to main and on a weekly schedule.
  • Configures CodeQL to scan the actions language with least-privilege permissions and SHA-pinned actions.

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

@don-petry
Copy link
Copy Markdown
Contributor Author

Self-review complete — one action item for @don-petry

The workflow is correct and all checks pass except Analyze (actions), which fails with:

Code Scanning could not process the submitted SARIF file:
CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled

This is a repository settings conflict: GitHub's Default Setup for CodeQL is still enabled. When an advanced configuration (codeql.yml) and the default setup both try to upload SARIF results, GitHub rejects the advanced one.

To fix (one-time settings change):

  1. Go to Settings → Security → Code scanning
  2. Under CodeQL analysis, click Switch to advanced (or disable Default setup)
  3. Once switched, re-run the failed Analyze (actions) check — it will pass

This is the same fix noted in the PR #84 comment history. The workflow file itself is correct; it just cannot coexist with Default Setup.

After disabling Default Setup and re-running the check, this PR is ready to merge. @don-petry please review and merge when CI is green.

Adds the required CodeQL Analysis workflow for the .github repository.
Scans the `actions` ecosystem (per standard: repos with .github/workflows/*.yml
must scan `actions`). Uses codeql-action@v4.35.1 pinned to SHA per the
Action Pinning Policy.

Closes #39

Co-authored-by: don-petry <don-petry@users.noreply.github.com>
@don-petry don-petry force-pushed the claude/issue-39-20260408-2242 branch from 32dd787 to 2c2701a Compare April 8, 2026 22:58
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 8, 2026

@don-petry don-petry merged commit 497c2b7 into main Apr 8, 2026
18 checks passed
@don-petry don-petry deleted the claude/issue-39-20260408-2242 branch April 8, 2026 23:01
don-petry added a commit that referenced this pull request Apr 9, 2026
… setup

The org standard previously required every repo to carry a codeql.yml
workflow file. In practice the fleet used a minimal advanced configuration
that added maintenance overhead (SHA pinning, Dependabot bumps, manual
language matrix) without providing anything GitHub's managed default setup
doesn't already cover.

This commit:
- Rewrites ci-standards.md §2 to make default setup the standard
- Deletes .github/workflows/codeql.yml from this repo (added in #100)
- Updates compliance-audit.sh: replaces codeql.yml file existence check
  with code-scanning/default-setup API probe, and flags stray codeql.yml
  files as drift
- Updates apply-rulesets.sh: derives the `CodeQL` required-status-check
  context from the default-setup API instead of workflow file parsing
- Updates apply-repo-settings.sh: adds apply_codeql_default_setup()
  so `--all` runs enable default setup fleet-wide

Repos with a concrete need for advanced setup (custom query packs, path
filters, compiled-language build modes) may opt out by filing a standards
PR documenting the exception.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
don-petry added a commit that referenced this pull request Apr 9, 2026
… setup

The org standard previously required every repo to carry a codeql.yml
workflow file. In practice the fleet used a minimal advanced configuration
that added maintenance overhead (SHA pinning, Dependabot bumps, manual
language matrix) without providing anything GitHub's managed default setup
doesn't already cover.

This commit:
- Rewrites ci-standards.md §2 to make default setup the standard
- Deletes .github/workflows/codeql.yml from this repo (added in #100)
- Updates compliance-audit.sh: replaces codeql.yml file existence check
  with code-scanning/default-setup API probe, and flags stray codeql.yml
  files as drift
- Updates apply-rulesets.sh: derives the `CodeQL` required-status-check
  context from the default-setup API instead of workflow file parsing
- Updates apply-repo-settings.sh: adds apply_codeql_default_setup()
  so `--all` runs enable default setup fleet-wide

Repos with a concrete need for advanced setup (custom query packs, path
filters, compiled-language build modes) may opt out by filing a standards
PR documenting the exception.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
don-petry added a commit that referenced this pull request Apr 9, 2026
* feat(security): replace per-repo CodeQL workflows with GitHub default setup

The org standard previously required every repo to carry a codeql.yml
workflow file. In practice the fleet used a minimal advanced configuration
that added maintenance overhead (SHA pinning, Dependabot bumps, manual
language matrix) without providing anything GitHub's managed default setup
doesn't already cover.

This commit:
- Rewrites ci-standards.md §2 to make default setup the standard
- Deletes .github/workflows/codeql.yml from this repo (added in #100)
- Updates compliance-audit.sh: replaces codeql.yml file existence check
  with code-scanning/default-setup API probe, and flags stray codeql.yml
  files as drift
- Updates apply-rulesets.sh: derives the `CodeQL` required-status-check
  context from the default-setup API instead of workflow file parsing
- Updates apply-repo-settings.sh: adds apply_codeql_default_setup()
  so `--all` runs enable default setup fleet-wide

Repos with a concrete need for advanced setup (custom query packs, path
filters, compiled-language build modes) may opt out by filing a standards
PR documenting the exception.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address review comments from Copilot and CodeRabbit on #103

- Replace placeholder #<this-pr> with #103 in compliance-audit.sh
- Fix apply-repo-settings.sh: docstring now matches behavior (warn and
  continue on failure, not hard fail); add CODEQL_ADVANCED_EXCEPTIONS
  list so approved advanced-setup repos are skipped
- Fix apply-rulesets.sh: distinguish API probe errors from explicit
  "not-configured" state — probe failures now exit nonzero instead of
  silently omitting CodeQL from required checks
- Fix ci-standards.md: remove misleading "coverage" wording from Python
  section; fix MD028 blank line inside blockquote (Lint failure)
- Update github-settings.md: CodeQL check name is now `CodeQL` (default
  setup context), not `Analyze` / `Analyze (<language>)`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: trigger CodeQL default setup scan on PR

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Compliance: missing-codeql.yml

2 participants