API、Webhook、委任ワークフロー向けシークレットスキャン改善
GitHubはシークレットスキャン機能のAPI、Webhook、委任ワークフローを改善し、新たな除外フィルター、アラート位置への直接リンク追加、委任閉鎖時のコメント表示、バグ修正などを提供した。
キーポイント
新たな除外フィルターのAPI導入
シークレットスキャンアラートAPIにexclude_secret_typesクエリパラメータを追加し、特定のシークレットタイプを結果から除外できるようになった。
アラート位置への直接リンク提供
REST APIとWebhookペイロードのアラート位置詳細にhtml_urlフィールドを追加し、GitHub上のコンテンツへの直接リンクを提供する。
委任ワークフローの改善
委任バイパスメールに有効期限表示を追加し、開発者が却下リクエスト送信時に確認メールを受信するよう改善した。
API/Webhookでの閉鎖リクエストコメント表示
委任閉鎖のアラートペイロードに、リクエスターのコメント、レビュアーのコメント、レビュアーのユーザー名が表示されるようになった。
バグ修正
委任閉鎖承認を通じてアラートが閉じられた際に、resolution_commentがnullにならないバグを修正した。
影響分析・編集コメントを表示
影響分析
この改善は、GitHubのシークレットスキャン機能を利用する組織のセキュリティワークフローを効率化する。特に大規模なコードベースを持つ企業では、アラート管理の自動化が容易になり、セキュリティチームの負荷軽減と迅速な対応が可能になる。開発者体験の向上を通じて、セキュリティプラクティスの普及促進にも寄与する。
編集コメント
開発者向けの実用的な改善がまとめられており、セキュリティ自動化を実装しているチームには即時的な価値がある。業界全体を変えるような革新ではないが、日常的なセキュリティ運用の効率化に貢献する堅実なアップデート。
今週、API、ウェブフック、および委任ワークフローに対していくつかの改善を導入します。これらの改善は、シークレットスキャン機能の開発者エクスペリエンスへの継続的な投資を強化するものです。開発者によって、開発者のために構築されています。
変更点
シークレットスキャンに、新しいAPIフィルター、より充実したウェブフックペイロード、委任アラートワークフローの改善が加わりました:
- 新しい
exclude_secret_typesフィルター: GitHub UIで既に利用可能だった除外フィルタリング (-secret-type:) が、REST APIでも利用可能になりました。 - アラートロケーションの
html_url: アラートロケーションの詳細に、GitHub上のコンテンツへの直接リンクが含まれるようになりました。これはREST APIとウェブフックの両方で利用できます。 - 委任バイパスメールの改善: レビュー担当者はリクエストメールに有効期限を確認できるようになり、開発者は却下リクエストを送信した際に確認メールを受け取るようになりました。
- API/ウェブフックでのクロージャーリクエストコメント: 委任クロージャーに対するアラートペイロードに、リクエスターのコメント、レビュー担当者のコメント、およびレビュー担当者のユーザー名が表示されるようになりました。
- バグ修正: 委任クロージャー承認を通じてアラートが閉じられた場合、
resolution_commentがnullにならなくなりました。
新しい exclude_secret_types APIフィルター
GitHubには新しいシークレットタイプが頻繁に追加されるため、レポートおよび修復スクリプトで包含ベースのフィルターを使用している組織は、定期的に新しいパターンを手動で確認し追加する必要がありました。除外フィルターを使用すると、対象外とするタイプを単純に除外でき、新しいタイプが追加された際に自動的に取得できます。
シークレットスキャンアラートAPIが exclude_secret_types クエリパラメータをサポートするようになり、結果から特定のシークレットタイプを除外できるようになりました。これにより、すべてのタイプを列挙する必要がなくなります。これは以下の3つのリストエンドポイントすべてで利用できます:
GET /repos/{owner}/{repo}/secret-scanning/alertsGET /orgs/{org}/secret-scanning/alertsGET /enterprises/{enterprise}/secret-scanning/alerts
カンマ区切りのシークレットタイプスラッグのリストを渡して、結果からそれらを除外できます。同じリクエストで secret_type と exclude_secret_types の両方を使用すると、422エラーが返されます。
アラートロケーション html_url フィールド
REST APIおよびウェブフックペイロード内のシークレットスキャンアラートロケーションの詳細オブジェクトに、html_url フィールドが含まれるようになりました。以前は、ロケーション詳細はAPI URL(例: /repos/{owner}/{repo}/issues/comments/{id})のみを返していたため、ウェブフックイベントを処理したり、ロケーションAPIを基に自動化を構築したりする場合、実際にクリックしたり通知に含めたりできるリンクを取得するために、追加のAPI呼び出しが必要でした。現在では、ユーザー向けのURLが直接含まれています。
このフィールドは、コミット、Issue、プルリクエスト、およびレビューのロケーションをカバーします:
| ロケーションタイプ | html_url の例 |
|---|---|
| コミット | /{owner}/{repo}/blob/{sha}/{path}#L5-L5 |
| イシュータイトル / イシューボディ | /{owner}/{repo}/issues/{number} |
| イシューコメント | /{owner}/{repo}/issues/{number}#issuecomment-{id} |
| プルリクエストタイトル / プルリクエストボディ | /{owner}/{repo}/pull/{number} |
| プルリクエストコメント | /{owner}/{repo}/pull/{number}#issuecomment-{id} |
| プルリクエストレビュー | /{owner}/{repo}/pull/{number}#pullrequestreview-{id} |
| プルリクエストレビューコメント | /{owner}/{repo}/pull/{number}#discussion_r{id} |
既存のすべてのURLフィールドは保持されています。html_url は追加のみです。このフィールドは、REST API(例: GET /repos/{owner}/{repo}/secret-scanning/alerts/{number}/locations)およびウェブフックペイロードの両方で利用できます。
委任バイパスリクエストのメール通知
委任バイパスワークフロー中に送信されるメール通知に、2つの改善を追加しました:
- 有効期限の通知: バイパスおよび却下リクエストのメール通知に、リクエストの有効期限(リクエストタイプに応じて7日、30日、または1年)が含まれるようになりました。これにより、レビュー担当者はリクエストが自動的に閉じられる前にアクションを取れる時間を把握できます。リクエストタイプによって有効期限は異なります(例: プッシュ保護バイパスは7日で期限切れ、コードスキャン却下は1年間有効)。以前は、メールだけからは確認する方法がありませんでした。
- 開発者への確認メール: 開発者はアラート却下リクエストを送信した際にメールを受け取るようになり、レビュー待ちであることを知らせます。以前は、リクエストが作成されたときにレビュー担当者のみが通知され、送信した開発者は承認または拒否されるまで一切のフィードバックを受け取りませんでした。
アラートAPIおよびウェブフックでのクロージャーリクエストコメント
委任クロージャー(却下)リクエストがあるシークレットスキャンアラートのペイロードに、3つの新しいフィールドが利用可能になりました:
closure_request_comment: アラートを閉じたい理由を説明するリクエスターのコメント。closure_request_reviewer_comment: レビュー担当者の応答コメント。closure_request_reviewer: レビュー担当者のユーザーオブジェクト。
これらのフィールドは、既存のプッシュ保護バイパスフィールド(例: push_protection_bypass_request_comment, push_protection_bypass_request_reviewer_comment)と同じモデルに従います。委任アラートクロージャー周りの自動化(例: アラートが却下された理由の追跡、レビュー担当者の決定の監査、外部チケットシステムとの同期)を構築している場合、このデータを個別に検索する必要なく、APIおよびウェブフックペイロードで直接利用できるようになりました。
バグ修正: 委任クロージャーの resolution_comment
委任アラートクロージャー承認フローを通じて閉じられたアラートで、resolution_comment がnullになるバグを修正しました。リクエスターのコメントは免除リクエストに保存されていましたが、リクエストが承認された際にアラートに反映されていませんでした。現在では、コメントがアラートの resolution_comment フィールドに正しく渡され、REST APIを介した直接却下の動作と一致するようになりました。
詳細情報
シークレットスキャンおよびシークレットスキャンREST APIについての詳細は、ドキュメントをご覧ください。これらの改善は、皆様からのフィードバックによって形作られました。コミュニティディスカッションでご意見をお聞かせください。
この投稿「Secret scanning improvements to alert APIs, webhooks, and delegated workflows」は、The GitHub Blogで最初に公開されました。
原文を表示
This week, we’re rolling out several improvements to our APIs, webhooks, and delegated workflows. These improvements strengthen our continued investment in the developer experience of our secret scanning features. Built by developers, for developers.
What’s changing
Secret scanning has new API filters, richer webhook payloads, and improvements to delegated alert workflows:
New exclude_secret_types filter: Exclusion filtering already available in the GitHub UI (-secret-type:) is now available in the REST API.
html_url on alert locations: Alert location details now include a direct link to the content on GitHub, in both the REST API and webhooks.
Delegated bypass email improvements: Reviewers now see expiry deadlines in request emails, and developers get a confirmation email when they submit a dismissal request.
Closure request comments in API/webhooks: The requester’s comment, reviewer’s comment, and reviewer’s username are now surfaced on alert payloads for delegated closures.
Bug fix: resolution_comment is no longer null when an alert is closed through delegated closure approval.
New exclude_secret_types API filter
New secret types are frequently added to GitHub, which means organizations using inclusion-based filters in their reporting and remediation scripts have to manually check for and add new patterns on a regular basis. With exclusion filters, you can simply filter out the types you don’t care about and automatically pick up new ones as they’re added.
The secret scanning alerts API now supports an exclude_secret_types query parameter, allowing you to exclude specific secret types from results rather than having to enumerate every type. This is available on all three list endpoints:
GET /repos/{owner}/{repo}/secret-scanning/alerts
GET /orgs/{org}/secret-scanning/alerts
GET /enterprises/{enterprise}/secret-scanning/alerts
You can pass a comma-separated list of secret type slugs to exclude them from results. Using both secret_type and exclude_secret_types in the same request returns a 422 error.
Alert location html_url field
Secret scanning alert locations in the REST API and webhook payloads now include an html_url field in the details object. Previously, location details only returned API URLs (e.g., /repos/{owner}/{repo}/issues/comments/{id}), so if you were processing webhook events or building automation on top of the locations API, you had to make additional API calls just to get a link you could actually click on or include in a notification. Now the user-facing URL is included directly.
The field covers commit, issue, pull request, and review locations:
Location type
Example html_url
commit
/{owner}/{repo}/blob/{sha}/{path}#L5-L5
issue_title / issue_body
/{owner}/{repo}/issues/{number}
issue_comment
/{owner}/{repo}/issues/{number}#issuecomment-{id}
pull_request_title / pull_request_body
/{owner}/{repo}/pull/{number}
pull_request_comment
/{owner}/{repo}/pull/{number}#issuecomment-{id}
pull_request_review
/{owner}/{repo}/pull/{number}#pullrequestreview-{id}
pull_request_review_comment
/{owner}/{repo}/pull/{number}#discussion_r{id}
All existing URL fields are preserved; html_url is additive only. This field is available in both the REST API (i.e., GET /repos/{owner}/{repo}/secret-scanning/alerts/{number}/locations) and webhook payloads.
Email notifications for delegated bypass requests
We’ve added two improvements to the email notifications sent during delegated bypass workflows:
Expiry notice: Email notifications for bypass and dismissal requests now include the request’s expiration period (7 days, 30 days, or 1 year depending on the request type), so reviewers know how long they have to act before the request is automatically closed. Different request types have different expiration periods (e.g., push protection bypasses expire in 7 days, while code scanning dismissals last a year). Previously there was no way to tell from the email alone.
Developer confirmation email: Developers now receive an email when they submit an alert dismissal request, letting them know it’s pending review. Previously, only reviewers were notified when a request was created—the developer who submitted it received no feedback at all until it was approved or denied.
Closure request comments in alert API and webhooks
Three new fields are now available on secret scanning alert payloads for alerts with a delegated closure (dismissal) request:
closure_request_comment: The requester’s comment explaining why they want to close the alert.
closure_request_reviewer_comment: The reviewer’s response comment.
closure_request_reviewer: The reviewer user object.
These fields follow the same model as the existing push protection bypass fields (i.e., push_protection_bypass_request_comment, push_protection_bypass_request_reviewer_comment). If you’re building automation around delegated alert closures—such as tracking why alerts were dismissed, auditing reviewer decisions, or syncing with external ticketing systems—this data is now available directly in the API and webhook payloads without needing to look it up separately.
Bug fix: resolution_comment for delegated closures
Fixed a bug where resolution_comment was null on alerts closed through the delegated alert closure approval flow. The requester’s comment was being stored on the exemption request but was not forwarded to the alert when the request was approved. The comment is now correctly passed through to the alert’s resolution_comment field, matching the behavior of direct dismissals via the REST API.
Learn more
Learn more about secret scanning and the secret scanning REST API in our documentation. These improvements were shaped by your feedback. Let us know what you think in the community discussion.
The post Secret scanning improvements to alert APIs, webhooks, and delegated workflows appeared first on The GitHub Blog.
関連記事
米軍が GPS を利用し、20 年間にわたり暗号化ネットワークの「ナンバーステーション」として機能させていた可能性を示す証拠
情報セキュリティ研究者のスティーブン・マーチャード氏によると、米軍は約 20 年にわたり、公衆用の GPS 衛星を利用して暗号化ネットワークのコードを放送し、各衛星を隠れた「ナンバーステーション」として活用してきた可能性が高い。
スキル.sh API の提供開始
Vercel が、オープンソースエコシステムから 60 万種以上のスキル情報を検索・取得できる「skills.sh API」を正式に公開した。プロジェクトごとの OIDC トークンによる認証で利用可能となる。
BGP AS_PATH の最初の AS を強制する仕組みの導入
Cloudflare は、Spamhaus が報告したルート乗っ取り事案を踏まえ、不正なアクターが未使用の自律システム番号(ASN)を利用して偽の AS_PATH を作成しトラフィックを誤誘導する手口に対処するため、BGP の経路情報において最初の AS 番号の検証を強化する措置を発表した。