Scorecard Governance — 手動設定ガイド

OpenSSF Scorecard が指摘する 5 件のガバナンス項目は、いずれもリポジトリ設定 / 運用変更が必要で、PR では解消できません。各項目の対応コストと手順をまとめます。

対象リポジトリ: killertcell428/aigis

サマリ

項目重要度対応コスト推奨
BranchProtectionerror5分今すぐ設定
Maintainedinfo時間経過放置でOK(90日後に自動解消)
CodeReviewinfo運用変更BranchProtection と一緒に解決
CIIBestPracticesinfo30分〜数時間OSS 公開ならやる価値あり
Fuzzinginfo数日後回しでOK

1. BranchProtection — master ブランチ保護

Scorecard 指摘: branch protection not enabled for branch 'master'

手順(GitHub UI)

  1. Settings → Branches を開く
  2. Add branch protection rule をクリック
  3. Branch name pattern: master
  4. 以下にチェック(推奨セット):
  5. Create をクリック
CLI で設定する場合 (gh)
gh api -X PUT repos/killertcell428/aigis/branches/master/protection \
  -F required_status_checks.strict=true \
  -F 'required_status_checks.contexts[]=Lint & Type Check' \
  -F 'required_status_checks.contexts[]=Test / Python 3.11 (ubuntu-latest)' \
  -F 'required_status_checks.contexts[]=Test / Python 3.12 (ubuntu-latest)' \
  -F 'required_status_checks.contexts[]=Build package' \
  -F enforce_admins=true \
  -F required_pull_request_reviews.required_approving_review_count=1 \
  -F required_pull_request_reviews.dismiss_stale_reviews=true \
  -F restrictions= \
  -F required_linear_history=true \
  -F allow_force_pushes=false \
  -F allow_deletions=false
注意: 1 人開発のリポでも approval=1 を要求するとマージできなくなる場合があります。その場合は approval を 0 にしつつ status checks のみ必須化する、または GitHub の "Allow specified actors to bypass required pull requests" を使ってください。

2. Maintained — リポジトリ作成から90日未満

Scorecard 指摘: Repository was created within the last 90 days

これは「メンテされていることの証拠が不足している」という指摘で、リポジトリが 90 日以上経過して継続的にコミットがあれば自動的に解消されます。対応不要

気になる場合の対応

Scorecard alert を Code scanning UI から Dismiss → Won't fix で消すこともできます(コメント例: "Repo just created; will resolve naturally with time.")。

3. CodeReview — 30 changeset 中 0 件が approved review

Scorecard 指摘: Found 0/30 approved changesets

BranchProtection で Require approvals (1+) を有効化し、今後のマージは PR 経由+承認必須にすれば、徐々に approved changeset が積み上がってスコアが上がります。BranchProtection の設定と同時に解決可能

4. CIIBestPractices — OpenSSF Best Practices バッジ未取得

Scorecard 指摘: no effort to earn an OpenSSF best practices badge detected

手順

  1. bestpractices.dev にアクセス
  2. GET YOUR BADGE NOW → GitHub でログイン
  3. Submit a New Project をクリック
  4. プロジェクト情報入力:
  5. 67 個の質問に回答("passing" レベルなら数十分)。多くは既にこのリポで満たしている内容(README、LICENSE、CI、テストカバレッジ等)
  6. 取得後、バッジを README に貼る(例:)
    [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/<ID>/badge)](https://www.bestpractices.dev/projects/<ID>)

このバッジが README に存在するだけで Scorecard はパスを検出します。

5. Fuzzing — fuzzer 統合なし

Scorecard 指摘: no fuzzer integrations found

このリポの主要コードパス(detector regex / decoder pipeline)はファジング対象として有意義です。ただし統合には数日の作業が必要。

推奨アプローチ: Atheris (Python ネイティブ)

Google の Atheris を使うと、Python 関数を libFuzzer ハーネスで fuzz できます。

  1. fuzz/ ディレクトリ作成
  2. 例: fuzz/fuzz_scan.py
    import atheris
    import sys
    with atheris.instrument_imports():
        from aigis import scan
    
    def TestOneInput(data: bytes):
        try:
            text = data.decode("utf-8", errors="replace")
        except Exception:
            return
        scan(text)
    
    atheris.Setup(sys.argv, TestOneInput)
    atheris.Fuzz()
  3. CI に .github/workflows/cifuzz.yml を追加(OSS-Fuzz の CIFuzz アクション利用が標準)
  4. 本格運用するなら OSS-Fuzz へ申請

後回しでOK。先に他の項目を片付けてから検討。

完了確認

すべて設定後、Scorecard を再実行して結果を確認できます:

# GitHub Actions の Scorecard workflow を手動実行
gh workflow run scorecard.yml -R killertcell428/aigis

# または scorecard CLI(要 GITHUB_AUTH_TOKEN)
docker run -e GITHUB_AUTH_TOKEN=ghp_xxx \
  gcr.io/openssf/scorecard:stable \
  --repo=github.com/killertcell428/aigis

Code scanning UI でアラートが Closed に変わります(次回スキャン後)。


Generated 2026-05-11 — Aigis governance setup guide