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.
Hinweis
Der Pushschutz für Dateiuploads in der Webbenutzeroberfläche befindet sich derzeit in öffentliche Vorschau und kann geändert werden.
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
Wenn Sie über die Webbenutzeroberfläche versuchen, ein unterstütztes Geheimnis an ein Repository zu committen, das über Pushschutz verfügt, blockiert GitHub den Commit.
Es wird ein Dialogfeld mit Informationen zum Speicherort des Geheimnisses sowie Optionen zum Pushen des Geheimnisses angezeigt. Das Geheimnis wird auch in der Datei unterstrichen, damit du es einfacher finden kannst.
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.
Hinweis
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.
Wenn du das Pushen eines Geheimnisses zulässt, wird auf der Registerkarte Sicherheit eine Warnung erstellt. GitHub schließt diese Warnung und sendet keine Benachrichtigung, wenn du angibst, dass das Geheimnis ein False Positive ist oder nur in Tests verwendet wird. Wenn du angibst, dass das Geheimnis echt ist und das Problem später behoben wird, lässt GitHub die Sicherheitsbenachrichtigung offen und sendet Benachrichtigungen an dendie Autorin des Commits sowie an die Repositoryadministrator*innen. Weitere Informationen finden Sie unter Verwalten von Warnungen aus der Geheimnisüberprüfung.
Wenn eine mitwirkende Person einen Pushschutzblock für ein Geheimnis umgeht, sendet GitHub auch eine E-Mail-Warnung an die Organisationsbesitzenden, Sicherheitsmanagende und die Repositoryadmins, die sich für E-Mail-Benachrichtigungen angemeldet haben.
-
In dialog box that appeared when GitHub blocked your commit, review the name and location of the secret.
-
Wähle die Option aus, die am besten beschreibt, warum du in der Lage sein solltest, den geheimen Schlüssel zu pushen.
-
Wenn das Geheimnis nur in Tests verwendet wird und keine Bedrohung darstellt, klicke auf It's used in tests (Wird in Tests verwendet).
-
Wenn die erkannte Zeichenfolge kein Geheimnis ist, klicke auf It's a false positive (Es handelt sich um einen False Positive).
-
Wenn das Geheimnis echt ist, du es jedoch später beheben möchtest, klicke auf I'll fix it later (Problem wird später behoben).
Hinweis
Du musst einen Grund für die Umgehung des Pushschutzes angeben, wenn das Repository die Geheimnisüberprüfung aktiviert hat.
Beim Pushen in ein öffentliches Repository, für das die Geheimnisüberprüfung nicht aktiviert ist, sind Sie dank Pushschutz für Benutzer, der standardmäßig für Ihr Benutzerkonto aktiviert ist, weiterhin vor versehentlichem Pushen von Geheimnissen geschützt.
Mit dem Pushschutz für Benutzer blockiert GitHub automatisch Pushvorgänge in öffentliche Repositorys, wenn diese Pushvorgänge unterstützte Geheimnisse enthalten, aber Sie müssen keinen Grund für die Zulassung des Geheimnisses angeben, und GitHub generiert keine Warnung. Weitere Informationen finden Sie unter Push protection for users.
-
-
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.
- Fügen Sie unter „Oder Überbrückungsberechtigungen anfordern“ einen Kommentar hinzu. Sie können z. B. erklären, warum Sie glauben, dass die Weitergabe des Geheimnisses sicher ist, oder den Kontext der Anforderung zur Überbrückung der Sperre erläutern.
- Klicken Sie auf Anforderung übermitteln.
- Prüfen Sie Ihre E-Mail-Benachrichtigungen auf eine Antwort auf Ihre Anforderung.
Nachdem Ihre Anforderung überprüft wurde, erhalten Sie eine E-Mail, die Sie über die Entscheidung informiert.
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.