About push protection in the GitHub UI
When you upload, create, or edit files from the GitHub UI, push protection prevents you from accidentally committing secrets to a repository by blocking commits containing supported secrets.
GitHub will also block the commit if you attempt to upload files containing supported secrets.
メモ
Web UI のファイルのアップロードに対するプッシュ保護は現在 パブリック プレビュー 段階にあり、変更される可能性があります。
You should either:
- Remove the secret from the commit. For more information, see Resolving a blocked commit.
- Review the instructions in the dialog box to see what options are available to you to allow the push. For more information, see Bypassing push protection and Requesting bypass privileges.
GitHub will only display one detected secret at a time in the web UI. If a particular secret has already been detected in the repository and an alert already exists, GitHub will not block that secret.
Organization owners can provide a custom link that will be displayed when a push is blocked. This custom link can contain resources and advice specific to your organization. For example, the custom link can point to a README file with information about the organization's secret vault, which teams and individuals to escalate questions to, or the organization's approved policy for working with secrets and rewriting commit history.
Resolving a blocked commit
Web UI を使用して、サポートされているシークレットをプッシュ保護によって保護されたリポジトリにコミットしようとすると、GitHub によってコミットがブロックされます。
シークレットの場所に関する情報と、シークレットをプッシュできるオプションを含むダイアログ ボックスが表示されます。 簡単に見つけられるように、ファイルではシークレットに下線も引かれています。
To resolve a blocked commit in the web UI, you need to remove the secret from the file. Once you remove the secret, you will be able to commit your changes.
メモ
To learn how to resolved a blocked push on the command line, see Working with push protection from the command line.
Bypassing push protection
If GitHub blocks a secret that you believe is safe to commit, you may be able to bypass the block by specifying a reason for allowing the secret.
シークレットのプッシュを許可すると、 [セキュリティ] タブにアラートが作成されます。シークレットが擬陽性かテスト用のみであれば、GitHub によってアラートが閉じられ、通知が送信されません。 シークレットが実際のものであり、後で修正することを指定した場合、GitHub はセキュリティ アラートを開いたままにし、コミットの作成者とリポジトリ管理者に通知を送信します。 詳しくは、「シークレット スキャンからのアラートの管理」をご覧ください。
共同作成者がシークレットのプッシュ保護ブロックをバイパスすると、GitHub は、メール通知にオプトインした organization 所有者、セキュリティ マネージャー、リポジトリ管理者にもメール アラートを送信します。
-
In dialog box that appeared when GitHub blocked your commit, review the name and location of the secret.
-
シークレットをプッシュできる理由を最もよく表しているオプションを選択します。
- シークレットがテストでのみ使用され、脅威がない場合は、 [テストで使用されます] をクリックします。
- 検出された文字列がシークレットでない場合は、 [誤検知です] をクリックします。
- シークレットが本物で、後で修正する予定の場合は、 [後で修正します] をクリックします。
-
Click Allow secret.
If you don't see the option to bypass the block, the repository administrator or organization owner has configured tighter controls around push protection. Instead, you should remove the secret from the commit, or submit a request for "bypass privileges" in order to push the blocked secret. For more information, see Requesting bypass privileges.
Requesting bypass privileges
If your commit has been blocked by push protection, you can request permission to bypass the block. The request is sent to a designated group of reviewers, who will either approve or deny the request.
Requests expire after 7 days.
- In dialog box that appeared when GitHub blocked your commit, review the name and location of the secret.
- Click Start request. The request will open in a new tab.
- [バイパス特権を要求する] で、コメントを追加します。 たとえば、シークレットがプッシュしても安全だと考える理由や、ブロックをバイパスする要求に関するコンテキストを提供する理由を説明できます。
- [要求の送信] をクリックします
- メール通知で要求への応答を確認します。
要求が確認されると、決定を通知する電子メールが届きます。
If your request is approved, you can commit the changes containing the secret to the file. You can also commit any future changes that contain the same secret.
If your request is denied, you will need to remove the secret from the file before you can commit your changes.