Skip to content

Commit 1330add

Browse files
authored
Merge pull request github#27223 from github/push-protection-web-ui
Add secret scanning push protection web UI section
2 parents feed7d5 + ff4b168 commit 1330add

8 files changed

+45
-7
lines changed
91.9 KB
Loading
37.7 KB
Loading
251 KB
Loading
-5.93 KB
Loading

content/code-security/secret-scanning/protecting-pushes-with-secret-scanning.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,40 @@ If {% data variables.product.prodname_dotcom %} blocks a secret that you believe
7676

7777
If you confirm a secret is real and that you intend to fix it later, you should aim to remediate the secret as soon as possible. For example, you might revoke the secret and remove the secret from the repository's commit history. For more information, see "[Removing sensitive data from a repository](/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)."
7878

79-
When you allow a secret to be pushed, an alert is created in the "Security" tab. The alert is closed and no notifications are sent if you specify that the secret is a false positive or used only in tests. If you specify that the secret is real and that you will fix it later, the security alert remains open and notifications are sent to the author of the commit and repository administrators. For more information, see "[Managing alerts from secret scanning](/code-security/secret-scanning/managing-alerts-from-secret-scanning)."
79+
{% data reusables.secret-scanning.push-protection-allow-secrets-alerts %}
8080

8181
1. Visit the URL returned by {% data variables.product.prodname_dotcom %} when your push was blocked.
8282
![Screenshot showing form with options for unblocking the push of a secret](/assets/images/help/repository/secret-scanning-unblock-form.png)
83-
2. Choose the option that best describes why you should be able to push the secret.
84-
- If the secret is only used in tests and poses no threat, click **It's used in tests**.
85-
- If the detected string is not a secret, click **It's a false positive**.
86-
- If the secret is real but you intend to fix it later, click **I'll fix it later**.
87-
3. Click **Allow me to push this secret**.
88-
4. Reattempt the push on the command line within three hours. If you have not pushed within three hours, you will need to repeat this process.
83+
{% data reusables.secret-scanning.push-protection-choose-allow-secret-options %}
84+
1. Click **Allow me to push this secret**.
85+
2. Reattempt the push on the command line within three hours. If you have not pushed within three hours, you will need to repeat this process.
86+
87+
{% if secret-scanning-push-protection-web-ui %}
88+
## Using secret scanning as a push protection from the web UI
89+
90+
When you use the web UI to attempt to commit a supported secret to a repository or organization with secret scanning as a push protection enabled, {% data variables.product.prodname_dotcom %} will block the commit. You will see a banner at the top of the page with information about the secret's location, and the secret will also be underlined in the file so you can easily find it.
91+
92+
![Screenshot showing commit in web ui blocked because of secret scanning push protection](/assets/images/help/repository/secret-scanning-push-protection-web-ui-commit-blocked-banner.png)
93+
94+
{% data variables.product.prodname_dotcom %} 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, {% data variables.product.prodname_dotcom %} will not block that secret.
95+
96+
You can remove the secret from the file using the web UI. Once you remove the secret, the banner at the top of the page will change and tell you that you can now commit your changes.
97+
98+
![Screenshot showing commit in web ui allowed after secret fixed](/assets/images/help/repository/secret-scanning-push-protection-web-ui-commit-allowed.png)
99+
100+
### Bypassing push protection for a secret
101+
102+
If {% data variables.product.prodname_dotcom %} blocks a secret that you believe is safe to push, you can allow the secret and specify the reason why it should be allowed. If you confirm a secret is real and that you intend to fix it later, you should aim to remediate the secret as soon as possible.
103+
104+
{% data reusables.secret-scanning.push-protection-allow-secrets-alerts %}
105+
106+
If you confirm a secret is real and that you intend to fix it later, you should aim to remediate the secret as soon as possible.
107+
108+
1. In the banner that appeared at the top of the page when {% data variables.product.prodname_dotcom %} blocked your commit, click **Bypass protection**.
109+
{% data reusables.secret-scanning.push-protection-choose-allow-secret-options %}
110+
111+
![Screenshot showing form with options for unblocking the push of a secret](/assets/images/help/repository/secret-scanning-push-protection-web-ui-allow-secret-options.png)
112+
113+
1. Click **Allow secret**.
114+
115+
{% endif %}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Reference: #6788.
2+
# Documentation for secret scanning as a push protection in the web ui (as opposed to command line)
3+
versions:
4+
ghes: '>=3.6'
5+
ghae: 'issue-6788'
6+
ghec: '*'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
When you allow a secret to be pushed, an alert is created in the "Security" tab. {% data variables.product.prodname_dotcom %} closes the alert and doesn't send a notification if you specify that the secret is a false positive or used only in tests. If you specify that the secret is real and that you will fix it later, {% data variables.product.prodname_dotcom %} keeps the security alert open and sends notifications to the author of the commit, as well as to repository administrators. For more information, see "[Managing alerts from secret scanning](/code-security/secret-scanning/managing-alerts-from-secret-scanning)."
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2. Choose the option that best describes why you should be able to push the secret.
2+
- If the secret is only used in tests and poses no threat, click **It's used in tests**.
3+
- If the detected string is not a secret, click **It's a false positive**.
4+
- If the secret is real but you intend to fix it later, click **I'll fix it later**.

0 commit comments

Comments
 (0)