Skip to content

Commit 03ad540

Browse files
committed
add push protection web ui section
1 parent 4125620 commit 03ad540

7 files changed

+40
-7
lines changed
122 KB
Loading
195 KB
Loading
352 KB
Loading

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

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,35 @@ 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+
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.
95+
96+
![Screenshot showing commit in web ui allowed after secret fixed](/assets/images/help/repository/secret-scanning-push-protection-web-ui-commit-allowed.png)
97+
### Bypassing push protection for a secret
98+
99+
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.
100+
101+
1. In the banner that appeared at the top of the page when GitHub blocked your commit, click **Bypass protection**.
102+
{% data reusables.secret-scanning.push-protection-choose-allow-secret-options %}
103+
104+
![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)
105+
106+
1. Click **Allow secret**.
107+
108+
{% data reusables.secret-scanning.push-protection-allow-secrets-alerts %}
109+
110+
{% 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. 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)."
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)