Repository navigation
Open
Labels
area/securitySecurity areaenhancementNew feature or requestfollow-up後続 Issue として切り出された follow-uptriage-requiredNeeds owner triage for priority decision
Description
Goal
GitHub App installation token (ghs_) の synthetic fixture / terminology を各 detector テストで手書きし続けることで、文字集合や説明が drift する再発を防ぐ。
PR #2751 のレビューでは、production matcher ghs_[A-Za-z0-9._-]{36,} 自体は正しい一方、behavioral fixture に - が含まれず、- を matcher から誤って落としてもテストが通ることが判明した。PR #2746 では既に -_ を含む synthetic token helper が存在しており、同種実装を個別に再作成したことで coverage が退行している。
同種の detector 対応は #2728 / #2733 / #2734 にも続くため、軽量な共通 fixture contract を用意する。
In Scope
- Python test suite から再利用できる canonical synthetic
ghs_<APP_ID>_<header>.<payload>.<signature>fixture factory または同等の共通 fixture contract を追加する。 - canonical fixture が少なくとも以下を機械的に保証する:
.が正確に2個_を含む-を含む- 全長 >= 520 characters
- 実 credential は一切使用しない deterministic synthetic value
- matcher semantics の用語を揃える:
ghs_[A-Za-z0-9._-]{36,}は new-format 専用ではなく、GitHub が示す current/new format を包含する broad matcher として扱う\\bghs_[A-Za-z0-9]{20,}\\bの20〜35文字 fixture は「classic GitHub token」ではなく、既存 detector semantics を守る short-form legacy detector input として扱う
- precedent attribution を正確にする:
controlled_skill_mutation_exec.pyの先行変更: Issue 実装: 既存 redactor が新形式 GitHub App installation token (ghs_APPID_JWT) を認識しない #2718 / PR fix: 新形式GitHub App installation token(ghs_APPID_JWT)を完全redactする #2722compact_author_result.pyの先行変更: Issue 実装: compact_author_result.py の GitHub token 検出パターンを新形式 ghs_ App installation token に対応させる #2726 / PR fix: compact_author_result.pyのghs_パターンを新形式GitHubトークンに対応させる #2746
- 今後の 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 / 実装: secret_exposure_scanner.py の GitHub token detector パターンを新形式 ghs_ App installation token に対応させる #2733 / 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734 の実装・テストで canonical fixture/contract を参照できるようにする。
Out of Scope
- production secret detector の repo-wide 統合
- JWT/JWS parser の導入
- live credential / canary test
- 新規ハーネスや複雑な security framework の導入
- fix: persist_retrospective_run.py の _TOKEN_PATTERNS を新形式 ghs_ App installation token に対応させる #2751 自体の merge をこの Issue で block すること
Acceptance Criteria
- AC1: canonical synthetic
ghs_fixture factory/contract が1箇所に定義され、.x2 /_/-/ length >= 520 を self-assert する。 - AC2: 少なくとも1つの既存 detector test が canonical fixture を利用し、matcher から
-または_を落とす mutation を想定した場合に coverage が失われないことを確認できる。 - AC3: short-form legacy detector input と実 classic/current installation token の用語がテスト名/docstringで混同されない。
- AC4: 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 / 実装: secret_exposure_scanner.py の GitHub token detector パターンを新形式 ghs_ App installation token に対応させる #2733 / 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734 の実装者が再利用できる参照先を docs または test utility から明確に辿れる。
- AC5: production behavior は変更しない。
Evidence / References
- PR fix: persist_retrospective_run.py の _TOKEN_PATTERNS を新形式 ghs_ App installation token に対応させる #2751 review comment: fix: persist_retrospective_run.py の _TOKEN_PATTERNS を新形式 ghs_ App installation token に対応させる #2751 (comment)
- PR fix: compact_author_result.pyのghs_パターンを新形式GitHubトークンに対応させる #2746: fix: compact_author_result.pyのghs_パターンを新形式GitHubトークンに対応させる #2746
- PR fix: 新形式GitHub App installation token(ghs_APPID_JWT)を完全redactする #2722: fix: 新形式GitHub App installation token(ghs_APPID_JWT)を完全redactする #2722
- Related open follow-ups: 実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728, 実装: secret_exposure_scanner.py の GitHub token detector パターンを新形式 ghs_ App installation token に対応させる #2733, 実装: check_session_recording_runtime_safety.py の ghs_ redaction パターンを新形式トークンに対応させる #2734
Priority
optional_follow_up。#2751 のマージブロッカーではない。今後の同種 detector 実装で同じ fixture/terminology drift を繰り返さないための品質改善。
Metadata
Metadata
Assignees
Labels
area/securitySecurity areaenhancementNew feature or requestfollow-up後続 Issue として切り出された follow-uptriage-requiredNeeds owner triage for priority decision
Activity