ci: add CodeQL workflow analysis and Dependabot for GitHub Actions - #1004
ci: add CodeQL workflow analysis and Dependabot for GitHub Actions#1004mgarbs wants to merge 1 commit into
Conversation
- Add a CodeQL workflow (language: actions) that scans the repository's GitHub Actions workflow files on push and pull_request to master and on a weekly schedule. Top-level permissions are read-only; security-events: write is granted only at the job level. - Add .github/dependabot.yml so that SHA-pinned action versions receive weekly update PRs. - Remove the 'sast' entry from .scorecard.yml since a SAST tool now runs on this repository. OpenSSF Scorecard checks affected: SAST (0 -> 10 once the workflow runs on PRs). Signed-off-by: Michael Garber <michael.garber@hashgraph.com>
|
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:
For more information about GitHub Code Scanning, check out the documentation. |
|
Some context on the intent behind this PR: it's part of a coordinated effort to raise the OpenSSF Scorecard scores across the hiero-ledger org. Scorecard is an automated 0–10 rating of a repository's supply-chain security practices — workflow token permissions, dependency pinning, SAST coverage, committed binaries, fuzzing, and similar checks — and it's what the org's security dashboard tracks. The checks this PR moves (measured with The CodeQL job (actions language) already ran green on this PR. |
Description:
Raise the repository's OpenSSF Scorecard score by adding static analysis of the GitHub Actions workflows. The repo already scores 10 on Token-Permissions, Pinned-Dependencies, Binary-Artifacts and Dangerous-Workflow; SAST is currently 0 because no analysis tool runs on any commit.
The only language GitHub reports for this repo is Shell (a git hook), so the CodeQL matrix is limited to the
actionslanguage, which analyses the workflow YAML in.github/workflows/for injection, unpinned-action and permission issues. This is applicable even for a docs-only repo, sincegitbook-auto-signoff.ymlruns withcontents: writeand force-pushes tomaster.Changes:
SAST
.github/workflows/codeql.yml(languageactions, build-modenone) triggered onpush/pull_requesttomasterand a weekly schedule. Runs onhl-docs-lin-mdlikelink-check.yml, uses the sameharden-runner(v2.20.0) andactions/checkout(v4.2.2) SHA pins already used in this repo, and pinsgithub/codeql-actionto v4.37.9. Top-levelpermissionsiscontents: read;security-events: writeis granted only at job level.sastfrom thenot-applicableannotation in.scorecard.yml, since a SAST tool now runs here. Thepackaging,signed-releasesandfuzzingannotations are unchanged.Dependency freshness
.github/dependabot.ymlfor thegithub-actionsecosystem (weekly) so the SHA pins in the workflows keep receiving update PRs.scorecard --local)Intentionally not changed:
link-check.ymldownloads alycheerelease tarball withcurland executes it; scorecard does not flag this asdownloadThenRun, so it is left as is. Pinning the tarball to a checksum could be a follow-up.harden-runnerv2.12.0 / v2.20.0,checkoutv4.2.2) are left alone; Dependabot will propose bumps..github/audits/rules.md(Exception 2) records that a Dependabot configuration is not required here because the repo only contains bash scripts. Thedependabot.ymladded in this PR covers only thegithub-actionsecosystem, i.e. the SHA pins in the three workflow files, so that exception becomes moot once this merges. I have not editedrules.md; if you would rather keep the exception as recorded, dropdependabot.ymlfrom this PR and the CodeQL change stands on its own.Related issue(s):
N/A
Notes for reviewer:
Verification:
actionlint .github/workflows/codeql.ymlreports only the pre-existing "unknown self-hosted labelhl-docs-lin-md" notice, same aslink-check.yml.scorecard --local . --checks Token-Permissions,Pinned-Dependencies,Binary-Artifacts,Dangerous-Workflow,SAST,Fuzzinggives the table above.CodeQL / Analyze (actions)check on this PR is the first run of the new workflow.Checklist