Skip to content

CI: add codeql-actions + secrets-audit scanner workflows - #26

Merged
assisted-by-ai merged 1 commit into
masterfrom
ai
Aug 1, 2026
Merged

CI: add codeql-actions + secrets-audit scanner workflows#26
assisted-by-ai merged 1 commit into
masterfrom
ai

Conversation

@assisted-by-ai

@assisted-by-ai assisted-by-ai commented Jul 31, 2026

Copy link
Copy Markdown

Closes scanner-coverage gaps by byte-identical propagation of consumer workflows from developer-meta-files consumer-templates. Each file verified byte-identical to the master template blob.

  • consumer-codeql-actions.yml -- CodeQL 'actions' language: workflow-YAML security analysis.
  • consumer-secrets-audit.yml -- manual-dispatch secrets surface audit (presence flags only).

Managed files; regenerated on the next propagation pass.

Generated with assistance from Claude Code.

Summary by CodeRabbit

  • Chores
    • Added automated security analysis for code changes submitted to the default branch.
    • Added a manually triggered audit for consumer-facing secret configurations.
    • Configured workflows to cancel outdated runs and use read-only repository access where applicable.

Byte-identical propagation from developer-meta-files
consumer-templates. Closes scanner-coverage gaps
(bandit already present):

- consumer-codeql-actions.yml: CodeQL 'actions' language --
  workflow-YAML security analysis (script-injection, missing
  permissions, unpinned actions).
- consumer-secrets-audit.yml: manual-dispatch secrets surface
  audit (presence flags only, values never emitted).

Managed files -- do not hand-edit; regenerated on the next
propagation pass.

## AI-Assisted

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

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Added CodeQL Actions and secrets-surface audit workflows. Both wrappers use scoped permissions and concurrency cancellation. The CodeQL workflow supports pushes, pull requests, and manual dispatch. The secrets audit workflow supports manual dispatch and inherits repository and organization secrets.

Changes

Security automation workflows

Layer / File(s) Summary
CodeQL Actions workflow
.github/workflows/consumer-codeql-actions.yml
Adds push, pull-request, and manual triggers. The workflow delegates Actions analysis to a shared reusable workflow with read-only contents access and security-events write access.
Secrets surface audit workflow
.github/workflows/consumer-secrets-audit.yml
Adds a manually triggered audit workflow. It delegates to a shared reusable workflow, inherits secrets, and cancels older runs for the same workflow reference.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the addition of CodeQL Actions and secrets-audit CI workflows, which matches the main changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ai

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/consumer-secrets-audit.yml (1)

17-21: 🔒 Security & Privacy | 🔵 Trivial

Lock workflow_dispatch to trusted maintainers.

secrets: inherit passes all available secrets to the reusable workflow. The reusable implementation resolves only presence, but this wrapper still grants that context through workflow_dispatch on the latest @master ref. Require trusted maintainer dispatch before combining secrets: inherit with a branch-controlled reusable workflow.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/consumer-secrets-audit.yml around lines 17 - 21, Restrict
the workflow_dispatch entry point in the consumer secrets audit wrapper to
trusted maintainers before invoking the reusable workflow with secrets: inherit.
Update the dispatch permissions or authorization guard in the workflow so
untrusted users cannot trigger the branch-controlled reusable workflow while
preserving the existing audit invocation for approved maintainers.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/consumer-secrets-audit.yml:
- Line 40: Update the reusable workflow references in
.github/workflows/consumer-secrets-audit.yml:40-40 and
.github/workflows/consumer-codeql-actions.yml:43-43 to replace the mutable
master ref with reviewed, full-length commit SHAs, preserving each workflow’s
existing reusable workflow path.

---

Nitpick comments:
In @.github/workflows/consumer-secrets-audit.yml:
- Around line 17-21: Restrict the workflow_dispatch entry point in the consumer
secrets audit wrapper to trusted maintainers before invoking the reusable
workflow with secrets: inherit. Update the dispatch permissions or authorization
guard in the workflow so untrusted users cannot trigger the branch-controlled
reusable workflow while preserving the existing audit invocation for approved
maintainers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bc04e00a-55a3-45df-b1a5-7decdb3fc1a5

📥 Commits

Reviewing files that changed from the base of the PR and between f0478e7 and 32cb7a2.

📒 Files selected for processing (2)
  • .github/workflows/consumer-codeql-actions.yml
  • .github/workflows/consumer-secrets-audit.yml


jobs:
audit:
uses: org-ai-assisted/developer-meta-files/.github/workflows/reusable-secrets-audit.yml@master

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

files=(
  .github/workflows/consumer-secrets-audit.yml
  .github/workflows/consumer-codeql-actions.yml
)

if rg -nP '@(?:master|main|latest|v\d+(?:\.\d+)*)\s*(?:#.*)?$' "${files[@]}"; then
  echo "Mutable workflow reference found" >&2
  exit 1
fi

Repository: org-ai-assisted/security-misc

Length of output: 488


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '--- workflow headers and relevant uses entries ---\n'
git ls-files .github/workflows | sed -n '1,120p'
printf '\n--- consumer-secrets-audit.yml relevant section ---\n'
cat -n .github/workflows/consumer-secrets-audit.yml | sed -n '1,80p'
printf '\n--- consumer-codeql-actions.yml relevant section ---\n'
cat -n .github/workflows/consumer-codeql-actions.yml | sed -n '1,90p'

printf '\n--- reusable action refs in workflows ---\n'
rg -n 'uses:\s*[^#]+@([^#\n]+)' .github/workflows .github/workflows/consumer-secrets-audit.yml .github/workflows/consumer-codeql-actions.yml || true

Repository: org-ai-assisted/security-misc

Length of output: 258


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- workflow files ---'
git ls-files .github/workflows | sed -n '1,160p'

printf '%s\n' ''
printf '%s\n' '--- consumer-secrets-audit.yml relevant section ---'
cat -n .github/workflows/consumer-secrets-audit.yml | sed -n '1,90p'

printf '%s\n' ''
printf '%s\n' '--- consumer-codeql-actions.yml relevant section ---'
cat -n .github/workflows/consumer-codeql-actions.yml | sed -n '1,90p'

printf '%s\n' ''
printf '%s\n' '--- reusable workflow refs in workflows ---'
rg -n 'uses:\s*[^#]+@([^#\n]+)' .github/workflows || true

Repository: org-ai-assisted/security-misc

Length of output: 6061


Pin the reusable workflow references to reviewed commit SHAs.

Both consumer workflows call org-ai-assisted/developer-meta-files reusable workflows with the mutable master branch. Reusable workflows can run untrusted steps, and this changes the trusted content of the workflow itself. Pin both uses entries to reviewed full-length commit SHAs.

  • .github/workflows/consumer-secrets-audit.yml#L40-L40
  • .github/workflows/consumer-codeql-actions.yml#L43-L43
🧰 Tools
🪛 zizmor (1.28.0)

[warning] 40-40: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow

(secrets-inherit)

📍 Affects 2 files
  • .github/workflows/consumer-secrets-audit.yml#L40-L40 (this comment)
  • .github/workflows/consumer-codeql-actions.yml#L43-L43
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/consumer-secrets-audit.yml at line 40, Update the reusable
workflow references in .github/workflows/consumer-secrets-audit.yml:40-40 and
.github/workflows/consumer-codeql-actions.yml:43-43 to replace the mutable
master ref with reviewed, full-length commit SHAs, preserving each workflow’s
existing reusable workflow path.

@assisted-by-ai
assisted-by-ai merged commit e59019a into master Aug 1, 2026
12 checks passed
assisted-by-ai pushed a commit that referenced this pull request Aug 12, 2026
Absorb upstream + fork-trunk work (merged PRs #23/#26, CI-workflow
propagation, changelog bump) so the PR diff carries only our own commits.
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