Skip to content

fix: address OpenSSF Scorecard findings - #21

Merged
don-petry merged 4 commits into
mainfrom
scorecard-fixes
Mar 28, 2026
Merged

fix: address OpenSSF Scorecard findings#21
don-petry merged 4 commits into
mainfrom
scorecard-fixes

Conversation

@don-petry

@don-petry don-petry commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #16, #17, #18, #19, #20

Test plan

  • Verify CI passes on this PR
  • Verify CodeQL runs
  • Verify no workflow permission errors

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Hardened CI by setting stricter default workflow permissions and adding explicit job-level permissions where required.
    • Renamed an action input key in a CI step and pinned Dependabot-related action versions for more stable automation.
  • New Features

    • Added automated CodeQL security analysis to the CI pipeline for continuous vulnerability scanning.
  • Documentation

    • Added a SECURITY policy with reporting instructions, required report details, and response timelines.

- Add SECURITY.md (#16)
- Scope workflow token permissions to least privilege (#17)
- Pin all GitHub Action dependencies to commit SHAs (#18)
- Add CodeQL SAST workflow for all commits (#19)
- Broaden CI pull_request trigger to cover all branches (#20)

Closes #16, #17, #18, #19, #20

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 27, 2026 20:45
@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1ade1790-e8b4-4c90-8e63-511ce8f0bd84

📥 Commits

Reviewing files that changed from the base of the PR and between 85eeff8 and ba0ac97.

📒 Files selected for processing (1)
  • .github/workflows/claude.yml

📝 Walkthrough

Walkthrough

Added a new CodeQL workflow, introduced workflow-level empty permissions and corresponding job-level permissions in multiple GitHub Actions workflows, renamed an action input in the Claude workflow, pinned a couple of actions to commit SHAs, and added a SECURITY.md with reporting instructions and timelines.

Changes

Cohort / File(s) Summary
Claude workflow
.github/workflows/claude.yml
Added workflow-level permissions: {}; renamed action input from anthropic_api_key to claude_code_oauth_token (still sourcing secrets.CLAUDE_CODE_OAUTH_TOKEN).
Dependabot workflow
.github/workflows/dependabot-automerge.yml
Replaced workflow-level permissions with permissions: {} and added job-level permissions; pinned dependabot/fetch-metadata and actions/create-github-app-token to specific commit SHAs.
SonarCloud workflow
.github/workflows/sonarcloud.yml
Replaced workflow-level permissions with permissions: {} and added explicit job-level permissions for the SonarCloud job.
New CodeQL workflow
.github/workflows/codeql.yml
Added CodeQL workflow (push/pull_request on main + weekly cron) with analyze job using github/codeql-action/init (languages: actions, build-mode: none) and github/codeql-action/analyze.
Security policy
SECURITY.md
Added SECURITY.md describing supported versions, private reporting channels (email and GitHub private report), required report contents, and response timelines (acknowledge 48h, assess 1 week, critical resolution 30 days).

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive The PR includes workflow permission scoping and CodeQL workflow addition beyond the single linked issue #16, representing scope expansion beyond stated objectives. While changes like workflow permission scoping and CodeQL addition align with OpenSSF Scorecard improvements, only issue #16 is formally linked; clarify whether other changes are within intended scope.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: address OpenSSF Scorecard findings' is directly relevant and accurately summarizes the main objective of the changeset.
Linked Issues check ✅ Passed The PR addresses issue #16 by adding SECURITY.md file, which satisfies the requirement to add a security policy file to resolve the Scorecard Security-Policy check.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch scorecard-fixes

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

Comment thread .github/workflows/claude.yml Fixed
Comment thread .github/workflows/codeql.yml Fixed
Comment thread .github/workflows/dependabot-automerge.yml Fixed
Comment thread .github/workflows/sonarcloud.yml Fixed
The repo contains HTML and Groovy, not JavaScript. CodeQL supports
analyzing GitHub Actions workflows via the 'actions' language.

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

Copilot AI 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.

Pull request overview

This PR addresses several OpenSSF Scorecard findings by adding a security policy, tightening GitHub Actions token permissions, pinning Actions to commit SHAs, adding a CodeQL workflow, and broadening some workflow triggers.

Changes:

  • Add SECURITY.md to document a security policy and reporting process.
  • Update existing workflows to scope GITHUB_TOKEN permissions and pin uses: dependencies to commit SHAs.
  • Add a CodeQL SAST workflow.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
SECURITY.md Adds a security policy and vulnerability reporting guidance.
.github/workflows/sonarcloud.yml Adjusts trigger scope and refactors permissions placement; pins Actions.
.github/workflows/dependabot-automerge.yml Pins Actions; refactors permissions for Dependabot automation.
.github/workflows/codeql.yml Introduces CodeQL workflow with pinned dependencies and scoped permissions.
.github/workflows/claude.yml Adds workflow-level default permissions (job already declares explicit permissions).

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

Comment thread .github/workflows/dependabot-automerge.yml Outdated
Comment thread .github/workflows/claude.yml Outdated
Comment thread .github/workflows/codeql.yml
Comment thread .github/workflows/sonarcloud.yml Outdated

@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: 5

🧹 Nitpick comments (1)
SECURITY.md (1)

5-8: Use concrete supported versions instead of latest.

latest is ambiguous for security support and can age poorly; listing concrete release lines/branches is clearer.

As per coding guidelines, "**/*.md: Focus on documentation quality ... and proper heading hierarchy. Flag ... ambiguous instructions."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@SECURITY.md` around lines 5 - 8, Replace the ambiguous "latest" entry in the
SECURITY.md support table with explicit, concrete supported release lines (e.g.,
"v2.x", "v1.9") and their end-of-life or support status; locate the table
containing the "Version" header and the cell with the string "latest" and update
it to list each supported version row-by-row with clear support markers and
dates, and ensure the document headings around the table follow proper hierarchy
(e.g., use H2/H3 consistently) for clarity.
🤖 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/workflows/claude.yml:
- Line 12: The workflow-level permissions line "permissions: read-all" should be
removed or replaced to avoid overly broad defaults; locate the top-level
permissions declaration in the workflow and delete the "permissions: read-all"
entry (or change it to an empty permissions object like "permissions: {}") so
that the job-level permissions defined later (the explicit permissions block
around the jobs) remain the source of truth and least-privilege is preserved.

In @.github/workflows/codeql.yml:
- Line 3: The workflow-level "permissions: read-all" setting is too broad;
remove that top-level "permissions: read-all" entry or replace it with minimal
explicit permissions that match the job-level scopes (e.g., only the specific
permissions used by the workflow), and rely on the job-level permissions already
defined (the explicit permissions block around lines 17-19) to grant necessary
access; ensure no workflow-level wildcard permissions remain so the workflow
follows the least-privilege principle.

In @.github/workflows/dependabot-automerge.yml:
- Line 8: The workflow-level permission "permissions: read-all" is too
broad—replace that top-level "permissions: read-all" entry with minimal explicit
read scopes (e.g., only the specific read permissions your jobs need such as
contents: read and pull-requests: read) so the workflow adheres to
least-privilege; leave the existing job-level permissions (the job-level write
scopes defined later) intact so they continue to override and grant required
write access.

In @.github/workflows/sonarcloud.yml:
- Line 3: Remove the workflow-level permissive entry "permissions: read-all" and
rely on the job-level permissions already declared (e.g., "contents: read" and
"pull-requests: read") so the workflow follows least-privilege; simply delete
the top-level "permissions: read-all" key from the workflow YAML and ensure no
other workflow-level permissions remain that broaden access beyond the job-level
settings.

In `@SECURITY.md`:
- Line 15: The guidance "Instead, please send an email to the maintainers or use
[GitHub's private vulnerability reporting]..." is ambiguous because it omits a
contact address; update SECURITY.md by adding an explicit security contact email
(e.g., security@yourdomain.com) immediately after that sentence so reporters
have a direct channel, and ensure the new line includes clear wording like
"Email security@yourdomain.com to report vulnerabilities" alongside the existing
GitHub advisories link.

---

Nitpick comments:
In `@SECURITY.md`:
- Around line 5-8: Replace the ambiguous "latest" entry in the SECURITY.md
support table with explicit, concrete supported release lines (e.g., "v2.x",
"v1.9") and their end-of-life or support status; locate the table containing the
"Version" header and the cell with the string "latest" and update it to list
each supported version row-by-row with clear support markers and dates, and
ensure the document headings around the table follow proper hierarchy (e.g., use
H2/H3 consistently) for clarity.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6286b251-22fb-4b8a-a5c6-e6945b6188f1

📥 Commits

Reviewing files that changed from the base of the PR and between 8c92be7 and 687cea3.

📒 Files selected for processing (5)
  • .github/workflows/claude.yml
  • .github/workflows/codeql.yml
  • .github/workflows/dependabot-automerge.yml
  • .github/workflows/sonarcloud.yml
  • SECURITY.md

Comment thread .github/workflows/claude.yml Outdated
Comment thread .github/workflows/codeql.yml Outdated
Comment thread .github/workflows/dependabot-automerge.yml Outdated
Comment thread .github/workflows/sonarcloud.yml Outdated
Comment thread SECURITY.md Outdated
DJ and others added 2 commits March 27, 2026 19:27
- Replace permissions: read-all with permissions: {} (deny-by-default)
- Reduce dependabot-automerge job token to read-only (app token handles writes)
- Add actions: read to CodeQL job permissions
- Add concrete security contact email and version target to SECURITY.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The action has separate inputs for API keys vs OAuth tokens.
CLAUDE_CODE_OAUTH_TOKEN is an OAuth token, not an API key.
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit 810718b into main Mar 28, 2026
15 of 16 checks passed
@don-petry
don-petry deleted the scorecard-fixes branch March 28, 2026 13:31
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.

Scorecard: Security-Policy (0/10)

3 participants