Skip to content

[codex] Add GitHub Actions hardening audit#163

Merged
grnbtqdbyx-create merged 1 commit into
mainfrom
codex/actions-audit
Jun 1, 2026
Merged

[codex] Add GitHub Actions hardening audit#163
grnbtqdbyx-create merged 1 commit into
mainfrom
codex/actions-audit

Conversation

@grnbtqdbyx-create
Copy link
Copy Markdown
Owner

Summary

  • add contextforge actions-audit for GitHub Actions hardening proof
  • emit Markdown and SARIF for CI artifacts and code scanning
  • dogfood the audit by pinning this repo's workflows to full action SHAs and least-privilege permissions
  • document the workflow in README, GitHub Action docs, launch artifacts, and research notes

Closes #162.

Why

Agent-authored repos increasingly need proof that release workflows are not silently weakened by mutable actions, broad permissions, pull_request_target patterns, or direct script interpolation of untrusted GitHub contexts.

Research anchors:

Validation

  • pnpm build
  • pnpm typecheck
  • pnpm test
  • node dist/cli.js actions-audit --summary contextforge-actions-audit.md --sarif contextforge-actions.sarif -> pass, 100/100
  • node dist/cli.js workflow-audit --summary contextforge-workflow-audit.md --sarif contextforge-workflow.sarif -> pass, 100/100
  • node dist/cli.js security-benchmark -> pass, 4/4
  • node dist/cli.js audit --min-context-score 70 --min-cache-score 70 --min-security-score 70 --output contextforge-audit.json --report contextforge-report.html -> pass, 100/100 / 100/100 / 100/100
  • node dist/cli.js publish-readiness --summary contextforge-publish-readiness.md -> warn only for human npm setup
  • npm pack --dry-run --json -> contextforge@0.69.0
  • git diff --check

CodeRabbit agent auth was checked but is not authenticated in this environment.

@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@grnbtqdbyx-create grnbtqdbyx-create merged commit 0a4912d into main Jun 1, 2026
7 checks passed
@grnbtqdbyx-create grnbtqdbyx-create deleted the codex/actions-audit branch June 1, 2026 04:40
Copy link
Copy Markdown

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

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: e93cd671d7

ℹ️ 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".


function findActionsRisks(file: string, content: string): Finding[] {
const findings: Finding[] = [];
const hasPermissions = PERMISSIONS_PATTERN.test(content);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Detect only top-level workflow permissions

In workflows that define permissions: only under one job, this check treats the whole file as having explicit workflow permissions and skips actions-missing-permissions. Any other job in the same workflow still runs under the repository/org default token permissions, so the audit can report no missing top-level least-privilege setting even though the new docs say it flags missing top-level workflow permissions. Please distinguish top-level permissions: from job-level blocks before suppressing this finding.

Useful? React with 👍 / 👎.

const action = match[1];
const ref = match[2] ?? '';
if (action.startsWith('./') || action.startsWith('../') || action.startsWith('docker://')) continue;
if (!ref || !FULL_SHA_PATTERN.test(ref)) {
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 Accept quoted SHA-pinned action refs

For valid YAML such as uses: "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd", the regex captures the trailing quote as part of ref, so this full 40-character pin fails FULL_SHA_PATTERN.test(ref) and is incorrectly reported as unpinned. Repositories that quote scalar values in workflows will get false warnings/failures from actions-audit despite using immutable refs.

Useful? React with 👍 / 👎.

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.

Add GitHub Actions hardening audit

2 participants