You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/code-security/concepts/secret-security/about-delegated-bypass-for-push-protection.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,10 +18,10 @@ redirect_from:
18
18
contentType: concepts
19
19
---
20
20
21
-
## About delegated bypass for push protection
22
-
23
21
{% data reusables.secret-scanning.push-protection-delegate-bypass-beta-note %}
24
22
23
+
## About delegated bypass for push protection
24
+
25
25
When push protection is enabled for a repository, users with write access can bypass push protection and push a secret if they provide a reason and the bypass is approved.
26
26
27
27
With delegated bypass for push protection, you can:
@@ -33,7 +33,7 @@ With delegated bypass for push protection, you can:
33
33
34
34
To set up delegated bypass, organization owners or repository administrators create a list of users with bypass privileges. This designated list of users can then:
35
35
* Bypass push protection, by specifying a reason for bypassing the block.
36
-
* Manage (approve or deny) bypass requests coming from all other contributors. These requests are located in the "Push protection bypass" page in the **Security** tab of the repository.
36
+
* Manage (approve or deny) bypass requests coming from all other contributors. These requests are located in the "Push protection bypass" page in the **Security** tab of the repository, and will expire after 7 days.
37
37
38
38
The following types of users can always bypass push protection without having to request bypass privileges:
intro: Understand how {% data variables.product.github %} uses push protection to prevent secret leaks from the command line.
5
+
permissions: '{% data reusables.permissions.push-protection-resolve-block %}'
6
+
versions:
7
+
fpt: '*'
8
+
ghes: '*'
9
+
ghec: '*'
10
+
topics:
11
+
- Secret scanning
12
+
- Secret Protection
13
+
- Alerts
14
+
- Repositories
15
+
contentType: concepts
16
+
---
17
+
18
+
Push protection prevents you from accidentally committing secrets to a repository by blocking pushes containing supported secrets.
19
+
20
+
When you attempt to push a supported secret from the command line to a repository secured by push protection, {% data variables.product.prodname_dotcom %} will block the push.
21
+
22
+
You should either:
23
+
24
+
***Remove** the secret from your branch. For more information, see [Resolving a blocked push](/code-security/how-tos/secure-your-secrets/work-with-leak-prevention/working-with-push-protection-from-the-command-line#resolving-a-blocked-push).
25
+
***Follow a provided URL** to see what options are available to you to allow the push. For more information, see [Bypassing push protection](/code-security/how-tos/secure-your-secrets/work-with-leak-prevention/working-with-push-protection-from-the-command-line#bypassing-push-protection) and [Requesting bypass privileges](/code-security/how-tos/secure-your-secrets/work-with-leak-prevention/working-with-push-protection-from-the-command-line#requesting-bypass-privileges).
26
+
27
+
Up to five detected secrets will be displayed at a time on the command line. 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.
28
+
29
+
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. Real secrets that have been exposed must be revoked to avoid unauthorized access. You might consider first rotating the secret before revoking it. For more information, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository).
30
+
31
+
{% data reusables.secret-scanning.push-protection-multiple-branch-note %}
Copy file name to clipboardExpand all lines: content/code-security/how-tos/secure-your-secrets/work-with-leak-prevention/working-with-push-protection-from-the-command-line.md
Push protection prevents you from accidentally committing secrets to a repository by blocking pushes containing supported secrets.
23
-
24
-
When you attempt to push a supported secret from the command line to a repository secured by push protection, {% data variables.product.prodname_dotcom %} will block the push.
25
-
26
-
You should either:
27
-
28
-
***Remove** the secret from your branch. For more information, see [Resolving a blocked push](#resolving-a-blocked-push).
29
-
***Follow a provided URL** to see what options are available to you to allow the push. For more information, see [Bypassing push protection](#bypassing-push-protection) and [Requesting bypass privileges](#requesting-bypass-privileges).
30
-
31
-
Up to five detected secrets will be displayed at a time on the command line. 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.
32
-
33
-
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. Real secrets that have been exposed must be revoked to avoid unauthorized access. You might consider first rotating the secret before revoking it. For more information, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository).
34
-
35
-
{% data reusables.secret-scanning.push-protection-multiple-branch-note %}
36
-
37
20
## Resolving a blocked push
38
21
39
22
To resolve a blocked push, you must remove the secret from all of the commits it appears in.
40
23
* If the secret was introduced by your latest commit, see [Removing a secret introduced by the latest commit on your branch](#removing-a-secret-introduced-by-the-latest-commit-on-your-branch).
41
24
* If the secret appears in earlier commits, see [Removing a secret introduced by an earlier commit on your branch](#removing-a-secret-introduced-by-an-earlier-commit-on-your-branch).
42
25
43
-
>[!NOTE] To learn how to resolved a blocked commit in the {% data variables.product.prodname_dotcom %} UI, see [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-in-the-github-ui#resolving-a-blocked-commit).
44
-
45
26
### Removing a secret introduced by the latest commit on your branch
46
27
47
-
If the blocked secret was introduced by the latest commit on your branch, you can follow the guidance below.
48
-
49
28
1. Remove the secret from your code.
50
29
1. To commit the changes, run `git commit --amend --all`. This updates the original commit that introduced the secret instead of creating a new commit.
51
30
1. Push your changes with `git push`.
52
31
53
32
### Removing a secret introduced by an earlier commit on your branch
54
33
55
-
You can also remove the secret if the secret appears in an earlier commit in the Git history. To do so, you will need to identify which commit first introduced the secret and modify the commit history with an interactive rebase.
56
-
57
34
1. Examine the error message that displayed when you tried to push your branch, which lists all of the commits that contain the secret.
58
35
59
36
```text
@@ -121,13 +98,7 @@ You can also remove the secret if the secret appears in an earlier commit in the
121
98
122
99
## Bypassing push protection
123
100
124
-
If {% data variables.product.prodname_dotcom %} blocks a secret that you believe is safe to push, you may be able to bypass the block by specifying a reason for allowing the secret to be pushed.
125
-
126
-
{% data reusables.secret-scanning.push-protection-allow-secrets-alerts %}
127
-
128
-
{% data reusables.secret-scanning.push-protection-allow-email %}
129
-
130
-
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](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-command-line#requesting-bypass-privileges).
101
+
> [!NOTE] If you don't see the option to bypass a block, you should remove the secret from the commit, or submit a request for "bypass privileges" in order to push the blocked secret. See [Requesting bypass privileges](#requesting-bypass-privileges).
131
102
132
103
{% data reusables.secret-scanning.push-protection-visit-URL %}
133
104
{% data reusables.secret-scanning.push-protection-choose-allow-secret-options %}
@@ -137,22 +108,13 @@ If you don't see the option to bypass the block, the repository administrator or
137
108
138
109
## Requesting bypass privileges
139
110
140
-
{% data reusables.secret-scanning.push-protection-delegate-bypass-beta-note %}
141
-
142
-
If your push has been blocked by push protection and you believe the secret is safe to push, you can request permission to bypass the block. Your request is sent to a designated group of reviewers, who will either approve or deny the request.
143
-
144
-
Requests expire after 7 days.
145
-
146
111
{% data reusables.secret-scanning.push-protection-visit-URL %}
147
112
{% data reusables.secret-scanning.push-protection-bypass-request-add-comment %}
148
113
{% data reusables.secret-scanning.push-protection-submit-bypass-request %}
149
-
{% data reusables.secret-scanning.push-protection-bypass-request-check-email %}
150
-
151
-
{% data reusables.secret-scanning.push-protection-bypass-request-decision-email %}
152
-
153
-
If your request is approved, you can push the commit (or commits) containing the secret to the repository, as well as any future commits that contain the same secret.
114
+
{% data reusables.secret-scanning.push-protection-bypass-request-check-email %} {% data reusables.secret-scanning.push-protection-bypass-request-decision-email %}
154
115
155
-
If your request is denied, you will need to remove the secret from all commits containing the secret before pushing again. For information on how to remove a blocked secret, see [Resolving a blocked push](#resolving-a-blocked-push).
116
+
* If your request is **approved**, you can push the commit (or commits) containing the secret to the repository, as well as any future commits that contain the same secret.
117
+
* If your request is **denied**, you need to remove the secret from all commits before pushing again. For information on how to remove a blocked secret, see [Resolving a blocked push](#resolving-a-blocked-push).
0 commit comments