feat: add subdomain takeover defense runbook and automated monitor#690
Merged
Merged
Conversation
stretch3 が 2026-05-18 に GitHub Pages サブドメイン乗っ取りを受けた事例を 受けて、smalruby 組織が管理する smalruby.app / smalruby.jp の防御を ドキュメント化し、自動監視を追加。 防御施策自体 (Org level domain verification / 2FA enforcement / HTTPS 強制 / 不要 fork archive / CAA records / ACM 未使用証明書削除) はこの PR の範囲外で 適用済み。本 PR は記録 (Runbook) と継続監視 (自動チェック workflow) を加える。 New files: - docs/security/github-pages-subdomain-takeover.md Threat model、6 層の防御、ドメイン/リポジトリ棚卸し、平常時運用ルール、 定期チェック、緊急時プレイブック。 - .github/workflows/security-monitor.yml 毎日 04:00 JST + workflow_dispatch。13 自動チェック (DNS verification TXT × 2、CAA × 8 entries、Pages 設定 × 5 repo、コンテンツ改竄 × 2 URL) を実行し、異常検知時に security-labeled Issue を自動起票 (重複防止)。 default GITHUB_TOKEN のみ使用 (新規 secret 不要)。 ローカル dry-run で 13 check すべて green を確認済み。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…r.sh レビュー指摘 (PR #690) に対応。インライン bash を独立 script に切り出し、 ローカル実行と CI 実行で完全に同じスクリプトが動くようにする。 変更: - scripts/security-monitor.sh (新規, 実行可能): 13 check ロジック。純 bash、 preflight 依存チェック (gh / dig / curl / jq) と CI/local 両対応の ERROR_FILE 機構を持つ。Local: `./scripts/security-monitor.sh`、 CI: workflow から ERROR_FILE 付きで呼ばれる。 - .github/workflows/security-monitor.yml: 138 行削減。 checkout → dig インストール → script 実行 → 失敗時 Issue 起票、 という薄いオーケストレーションだけを担う。Issue 作成は CI 固有の 関心事として workflow 側に残す。Issue 本文にローカル再現コマンド `./scripts/security-monitor.sh` を含める。 - docs/security/github-pages-subdomain-takeover.md: ローカル手動チェックの 手順と GitHub UI からのオンデマンド実行を「自動化されているチェック」 セクションに追記。 ローカルで `./scripts/security-monitor.sh` 実行 → 13 check すべて green、 exit 0 を確認。ERROR_FILE 機構の動作も確認 (成功時は未書き込み)。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
May 19, 2026
…ity-monitor-subdomain-takeover feat: add subdomain takeover defense runbook and automated monitor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GitHub Pages サブドメイン乗っ取り (stretch3 で 2026-05-18 に発生した事例) に対する Smalruby 側の防御を整備する。
docs/security/github-pages-subdomain-takeover.md).github/workflows/security-monitor.yml)Changes Made
docs/security/github-pages-subdomain-takeover.md(新規, 257 行).github/workflows/security-monitor.yml(新規, 216 行)毎日 19:00 UTC (= 04:00 JST) cron +
workflow_dispatch。13 自動チェック:_github-pages-challenge-smalruby.smalruby.{app,jp}の存在smalruby.appの 6 entry、smalruby.jpの 2 entry すべてhttps_enforcedとprotected_domain_statehttps://smalruby.app//https://smalruby.jp/が HTTP 200 でsmalruby文字列を含むか異常検知時 (cron 実行のみ):
securityラベル付き Issue を自動起票GITHUB_TOKENのみ使用、新規 secret は不要Already applied (PR 範囲外で実施済み、本 PR は記録と監視のみ)
smalruby.app/smalruby.jp)protected_domain_state: "verified"two_factor_requirement_enabled: truesmalruby3-gui,scratch-vm)Test Coverage
security-monitor.ymlの checks ロジックをローカルで dry-run → 13 check すべて greenworkflow_dispatchで手動実行し、cron 起動を待たずに緑確認Related
amazon.com/amazontrust.com/awstrust.com/amazonaws.com)