On this page
  1. OpenSSF Scorecard
  2. Allstar
  3. Legitify
  4. Putting it together
  5. References

Hardening a GitHub organization by hand works once. Keeping it hardened across hundreds of repositories, new teams and configuration drift needs measurement. Three open source tools cover most of the ground:

  • OpenSSF Scorecard scores individual repositories against supply-chain practices: branch protection, token permissions, pinned dependencies, dangerous workflows and more.
  • Allstar continuously checks repositories against policies you define and opens issues or fixes settings when they drift.
  • Legitify analyzes organization-level settings (members, Actions policies, runner groups) as well as repositories, and reports misconfigurations with remediation steps.

This guide shows how to run each one, what to look at in the results, and how to fit them into a recurring review. It assumes you have worked through the controls in the other guides, starting with the organization baseline.

OpenSSF Scorecard

Scorecard runs a set of checks against a repository and gives each a score from 0 to 10, plus an aggregate score weighted by risk. It reads everything through the GitHub API, so it needs a token. For an internal audit, a fine-grained read-only token or a GitHub App token is enough for most checks; some checks (branch protection details, for example) need admin read access to show complete results.

Run it from the command line

shell
export GITHUB_AUTH_TOKEN=...   # read-only token

# Using the container image
docker run --rm -e GITHUB_AUTH_TOKEN gcr.io/openssf/scorecard:stable \
  --repo=github.com/ACME/payments-api --show-details

# Only the checks you care about, as JSON
docker run --rm -e GITHUB_AUTH_TOKEN gcr.io/openssf/scorecard:stable \
  --repo=github.com/ACME/payments-api \
  --checks=Branch-Protection,Token-Permissions,Pinned-Dependencies,Dangerous-Workflow,Code-Review \
  --format=json > payments-api.scorecard.json

Loop over the organization's repositories with gh repo list ACME --limit 1000 --json name --jq '.[].name' and collect the JSON outputs for a fleet view.

The checks that map to this guide

CheckWhat it looks forRelated guide
Branch-ProtectionRequired reviews, status checks, force push and deletion blockedRulesets and CODEOWNERS
Code-ReviewWhether recent changes were reviewed before mergeRulesets and CODEOWNERS
Token-PermissionsWorkflows declaring read-only top-level permissionsActions security
Pinned-DependenciesActions pinned by SHA, container images by digest, pinned installs in scriptsActions security
Dangerous-WorkflowUntrusted checkout in pull_request_target, script injectionpull_request_target
Dependency-Update-ToolDependabot or Renovate configuredDependabot
VulnerabilitiesOpen known vulnerabilities in dependenciesDependabot
SASTCode scanning on commitsDependabot and CodeQL
Security-PolicyA SECURITY.md with a reporting process
Binary-ArtifactsChecked-in executables

Read the details, not just the number. A low Pinned-Dependencies score often comes from curl | bash in a Dockerfile or unpinned pip install lines, which are real risks, while a low Code-Review score on a repository maintained by one person may be an accepted risk.

Run it continuously with the Scorecard action

yaml
name: scorecard
on:
  push:
    branches: [main]
  schedule:
    - cron: "30 4 * * 1"
permissions: read-all
jobs:
  analysis:
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      id-token: write
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0
        with:
          results_file: results.sarif
          results_format: sarif
          publish_results: true
      - uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
        with:
          sarif_file: results.sarif

Findings appear as code scanning alerts in the repository's Security tab. publish_results: true (public repositories) publishes the result to the OpenSSF API and enables the Scorecard badge; it is what uses the id-token: write permission. Set it to false for private repositories.

Allstar

Scorecard tells you what is wrong. Allstar keeps it from going wrong again: it watches repositories in an organization and acts when a repository violates a policy, by logging, opening an issue in the repository, or fixing the setting directly for policies that support it.

The OpenSSF-hosted Allstar app has been retired, so you run it yourself: create your own GitHub App with the permissions listed in the operator documentation, then run Allstar either as a scheduled GitHub Action (least infrastructure) or as a long-running service.

Configure it with a .allstar repository

Allstar reads its configuration from a repository named .allstar in the organization. The organization file turns Allstar on and chooses opt-out (all repositories covered unless excluded) or opt-in:

yaml
# .allstar/allstar.yaml
optConfig:
  optOutStrategy: true
  optOutRepos:
    - sandbox-experiments
issueLabel: allstar

Each policy then has its own file. For example, enforcing branch protection and outside collaborator limits:

yaml
# .allstar/branch_protection.yaml
optConfig:
  optOutStrategy: true
action: issue
yaml
# .allstar/outside.yaml
optConfig:
  optOutStrategy: true
action: issue

Available policies include Branch Protection, Binary Artifacts, CODEOWNERS, Outside Collaborators, SECURITY.md, Secret Scanning, Dangerous Workflow, GitHub Actions, Repository Administrators and a generic Scorecard policy that turns any Scorecard check into an Allstar policy. Each policy file also accepts policy-specific settings (for example the required approval count for branch protection); see the policy documentation for the exact fields.

Start with action: log or issue. Switch to fix only for policies where automatic remediation is safe and well understood, because Allstar will then change repository settings on its own.

Opening issues in the repository puts the finding in front of the team that owns it, which tends to work better than a central report nobody reads. Use issueRepo in allstar.yaml instead if you want all findings in one tracking repository.

Legitify

Scorecard and Allstar focus on repositories. Legitify, from Legit Security, also analyzes the organization itself: two-factor enforcement, default repository permissions, member privileges, stale admins, Actions settings, runner groups and webhooks.

Run it

Legitify needs a classic token with broad read access to see organization settings (it does not support fine-grained tokens). Create a dedicated, short-lived classic token for the audit with admin:org, read:enterprise, admin:org_hook, read:org, repo and read:repo_hook, run the analysis, and delete the token afterwards. If your organization restricts classic tokens as recommended in the PAT guide, run the audit from an owner account in a short, documented exception window.

shell
export SCM_TOKEN=...   # temporary classic token, deleted after the run

# Organization and member settings only
legitify analyze --org ACME --namespace organization,member

# Everything, as SARIF for code scanning or JSON for a report
legitify analyze --org ACME \
  --namespace organization,actions,member,repository,runner_group \
  --output-format sarif --output-file legitify.sarif

Namespaces map to scopes: organization (2FA, SSO, default permissions, webhooks), actions (allowed actions, default workflow permissions, whether Actions can approve pull requests), member (stale and over-privileged members and admins), repository (branch protection, vulnerability alerts, forking, stale repositories) and runner_group (runner groups open to public repositories or all repositories, see self-hosted runners). Use --enterprise to include enterprise-level checks.

Each finding comes with a severity and remediation steps. Many correspond one to one with settings from the organization baseline, which makes Legitify a good way to verify that baseline.

Putting it together

A practical cadence:

  • On every repository, continuously: the Scorecard action on public repositories (results in code scanning), and Allstar with issue actions for the policies you have standardized.
  • Monthly, centrally: a Scorecard CLI run across all repositories and a Legitify run across the organization, compared with the previous month. New findings get tickets; fixed findings confirm progress.
  • After any major change (a new organization, an acquisition, an SSO migration): a full Legitify run before and after.
  • Always: audit log alerts for the settings these tools check, so that a regression between scans still raises a signal.

Treat the scores as a way to find work, not as a target. A repository can score well and still have an owner who approves every pull request without reading it; the tools measure configuration, and the guides in this set explain why each setting matters.

References

Tags:auditingsupply-chainorganization

Written by

Florian Amette, Security Engineer & Editor

Security engineer writing practical hardening guides for GitHub organizations, repositories and CI/CD pipelines, with a focus on software supply-chain security.