Skip to content

ci: harden GitHub Actions workflows#44

Merged
flavorjones merged 9 commits intomainfrom
harden-github-actions
Mar 20, 2026
Merged

ci: harden GitHub Actions workflows#44
flavorjones merged 9 commits intomainfrom
harden-github-actions

Conversation

@flavorjones
Copy link
Copy Markdown
Member

Summary

  • Add zizmor and actionlint CI job
  • Configure dependabot with batched updates and cooldown periods
  • Pin all GitHub Actions to SHA hashes
  • Fix zizmor findings (dangerous-triggers, bot-conditions, cache-poisoning, excessive-permissions, artipacked, template-injection)
  • Scope all permissions to job-level
  • Fix actionlint shellcheck finding

Test plan

  • CI passes (lint-actions job runs clean)
  • Existing test/build jobs unaffected

🤖 Generated with Claude Code

flavorjones and others added 8 commits March 20, 2026 15:14
Adds actionlint and zizmor checks to the CI workflow, placed
alongside the existing lint job.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Groups all GitHub Actions updates into a single PR and adds
cooldown periods to both gomod and github-actions ecosystems.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ensures exact version comments match pinned SHAs across all
workflow files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Suppress dangerous-triggers on ai-labeler and sensitive-change-gate
  (both only call reusable workflows, no PR code checked out)
- Fix bot-conditions in dependabot-auto-merge with dual actor check
- Move release.yml permissions to job-level (excessive-permissions)
- Suppress cache-poisoning on setup-go in release (branch-isolated)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix ref-version-mismatch: update create-github-app-token comment
  from v2 to v3.0.0 to match pinned SHA
- Move security.yml permissions to job-level (excessive-permissions)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add persist-credentials: false to all checkout steps to prevent
credential leakage through artifacts (artipacked).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set permissions: {} at workflow level and declare per-job permissions
for ci.yml, test.yml, ai-labeler.yml, dependabot-auto-merge.yml,
direct-push-alert.yml, sensitive-change-gate.yml, and scorecard.yml.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use ./*.test glob pattern to avoid filenames with dashes being
interpreted as options (SC2035).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 20, 2026 20:26
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

Sensitive Change Detection (shadow mode)

This PR modifies control-plane files:

  • .github/workflows/ai-labeler.yml
  • .github/workflows/ci.yml
  • .github/workflows/dependabot-auto-merge.yml
  • .github/workflows/direct-push-alert.yml
  • .github/workflows/release.yml
  • .github/workflows/scorecard.yml
  • .github/workflows/security.yml
  • .github/workflows/sensitive-change-gate.yml
  • .github/workflows/test.yml

Shadow mode — this check is informational only. When activated, changes to these paths will require approval from a maintainer.

@github-actions github-actions bot added the bug Something isn't working label Mar 20, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 10 files

Copy link
Copy Markdown

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

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

This PR hardens the repository’s GitHub Actions and dependency automation configuration by reducing default token permissions, SHA-pinning actions, and adding workflow auditing.

Changes:

  • Set workflow-level permissions: {} and scope required permissions at the job level across workflows.
  • SHA-pin GitHub Actions usage and disable persisted checkout credentials where applicable.
  • Add an Actions audit job (actionlint + zizmor) and update Dependabot configuration (grouping/cooldown).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/test.yml Scopes job permissions and hardens checkout usage in CI/test workflow.
.github/workflows/sensitive-change-gate.yml Removes broad workflow permissions and relies on job-scoped permissions for reusable workflow call.
.github/workflows/security.yml Scopes permissions per job and pins actions for security scanning workflows.
.github/workflows/scorecard.yml Restricts token permissions and pins actions for Scorecard analysis.
.github/workflows/release.yml Restricts workflow permissions, pins actions, and hardens release steps.
.github/workflows/direct-push-alert.yml Removes workflow-level broad permissions and scopes permissions for reusable workflow call.
.github/workflows/dependabot-auto-merge.yml Scopes permissions and strengthens Dependabot bot condition checks; pins metadata action.
.github/workflows/ci.yml Scopes permissions across CI jobs; pins actions; adds actionlint/zizmor audit job.
.github/workflows/ai-labeler.yml Removes workflow-level permissions and scopes job permissions for reusable workflows under pull_request_target.
.github/dependabot.yml Adds grouping and cooldown configuration for Dependabot updates.

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

Copilot AI review requested due to automatic review settings March 20, 2026 21:14
Address Copilot review feedback:
- Verify gitleaks tarball with SHA256 checksum before extracting
- Pin govulncheck to v1.1.4 instead of @latest for reproducibility

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@flavorjones flavorjones force-pushed the harden-github-actions branch from 03bdc74 to db78d31 Compare March 20, 2026 21:16
@github-actions github-actions bot added enhancement New feature or request and removed bug Something isn't working labels Mar 20, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/security.yml">

<violation number="1" location=".github/workflows/security.yml:28">
P1: The checksum is retrieved from the same remote source as the binary, which weakens supply-chain integrity verification. Keep the expected digest pinned in-repo (or verify a signed checksum) so tampering of release assets cannot satisfy the check.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


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

@flavorjones flavorjones merged commit ac95fbe into main Mar 20, 2026
27 checks passed
@flavorjones flavorjones deleted the harden-github-actions branch March 20, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants