chore(governance): add CI/CD governance baseline#10
Conversation
📝 WalkthroughWalkthroughThis PR introduces GitHub Actions workflows and configuration files for secrets management, governance enforcement, adversarial review, identity onboarding validation, 1Password secret rotation audits, and credential scanning controls. Includes seven new files totaling 178 lines of configuration and workflow definitions without behavioral code changes. Changes
Possibly related issues
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08b2148e7a
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.github/workflows/adversarial-review.yml (1)
5-46: Reduce repeated bot comments onsynchronizeevents.Current trigger + unconditional comment step will post repeatedly on every PR update. Consider gating comment creation to
opened/reopened/ready_for_review(or dedupe existing bot comment).Proposed patch
- name: Trigger Bot Review Comments + if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'ready_for_review' }} uses: actions/github-script@v7 with: script: |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/adversarial-review.yml around lines 5 - 46, The workflow unconditionally posts a bot comment on every synchronize event; update the "Trigger Bot Review Comments" step to first check context.payload.action (or call github.rest.issues.listComments to dedupe) and only call github.rest.issues.createComment when action is one of opened, reopened, or ready_for_review (or when no existing bot comment from the same actor/body exists); locate the "Trigger Bot Review Comments" step and adjust the inline script to perform the action check or existing-comment lookup before creating the comment, using the existing variables (context.payload.pull_request.number, owner, repo) and the same comment body if the gate passes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/secret-catalog.json:
- Around line 3-28: The secret OP_SERVICE_ACCOUNT_TOKEN used by the workflow
onepassword-rotation-audit.yml (referenced on Line 17) is missing from the
secret catalog; add an entry to .github/secret-catalog.json with "name":
"OP_SERVICE_ACCOUNT_TOKEN", an appropriate "op_ref" pointing to the OnePassword
item for the service account, a "rotation_days" value consistent with other
tokens (e.g., 30), and "owner": "platform-security" so the token is governed and
automatically audited/rotated.
In @.github/workflows/governance-gates.yml:
- Line 10: The workflow at governance-gates.yml references a non-existent
reusable workflow via "uses: ./.github/workflows/reusable-governance-gates.yml";
fix by either adding a reusable workflow file named
reusable-governance-gates.yml under .github/workflows that exposes the expected
inputs/outputs, or update the "uses" line to point to an existing reusable
workflow in the repo (or a remote action) so the "uses" reference resolves
correctly and actionlint passes.
In @.github/workflows/onepassword-rotation-audit.yml:
- Around line 50-51: The workflow sets body="$(cat
reports/secret-rotation/latest.md)" which will fail the job if latest.md is
missing and prevent creating the GitHub issue; update the
onepassword-rotation-audit workflow to safely read the report by checking for
the file or using a fallback (e.g., if [ -f reports/secret-rotation/latest.md ]
then body="$(cat ...)" else body="Report missing: audit failed before report
generation" fi) before computing existing, so the body variable always contains
a string and the subsequent issue creation logic (the existing variable
computation and gh issue create/close steps) still runs reliably.
- Around line 19-40: Replace the mutable version tags with full 40-character
commit SHAs for the referenced actions: change actions/checkout@v4,
1password/install-cli-action@v1, and actions/upload-artifact@v4 to their
corresponding pinned SHAs; update the workflow step entries for the
actions/checkout, 1password/install-cli-action, and actions/upload-artifact uses
to the exact commit SHAs (found from each action's GitHub repository) so the
.github/workflows/onepassword-rotation-audit.yml steps are immutably pinned.
---
Nitpick comments:
In @.github/workflows/adversarial-review.yml:
- Around line 5-46: The workflow unconditionally posts a bot comment on every
synchronize event; update the "Trigger Bot Review Comments" step to first check
context.payload.action (or call github.rest.issues.listComments to dedupe) and
only call github.rest.issues.createComment when action is one of opened,
reopened, or ready_for_review (or when no existing bot comment from the same
actor/body exists); locate the "Trigger Bot Review Comments" step and adjust the
inline script to perform the action check or existing-comment lookup before
creating the comment, using the existing variables
(context.payload.pull_request.number, owner, repo) and the same comment body if
the gate passes.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.github/allowed-workflow-secrets.txt.github/secret-catalog.json.github/workflows/adversarial-review.yml.github/workflows/governance-gates.yml.github/workflows/identity-context-onboarding.yml.github/workflows/onepassword-rotation-audit.yml.gitleaks.toml
Automated governance baseline remediation from org control loop.
Summary by CodeRabbit
Release Notes
New Features
Chores