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/how-tos/secure-your-secrets/prevent-future-leaks/enabling-push-protection-for-your-repository.md
To enable push protection for a repository, you must first enable {% ifversion ghas-products %}{% data variables.product.prodname_secret_protection %}{% else %}{% data variables.product.prodname_secret_scanning %}{% endif %}. You can then enable push protection in the repository's "{% data variables.product.UI_advanced_security %}" settings page following the steps outlined in this article.
You can additionally enable push protection for your own personal account, which prevents you from pushing secrets to _any_ public repository on {% data variables.product.github %}. For more information, see [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/push-protection-for-users).
26
-
27
-
{% endif %}
28
-
29
-
{% ifversion security-configurations %}
30
-
31
-
If you're an organization owner, you can enable push protection for multiple repositories at a time using {% data variables.product.prodname_security_configurations %}. For more information, see [AUTOTITLE](/code-security/securing-your-organization/introduction-to-securing-your-organization-at-scale/about-enabling-security-features-at-scale).
32
-
33
-
{% else %}
34
-
35
-
If you're an organization owner, you can enable push protection for multiple repositories at a time. For more information, see [AUTOTITLE](/code-security/getting-started/quickstart-for-securing-your-organization#enabling-security-features-in-your-organization).
36
-
37
-
{% endif %}
38
-
39
-
Organization owners, security managers, and repository administrators can also enable push protection for {% data variables.product.prodname_secret_scanning %} via the API. For more information, see [AUTOTITLE](/rest/repos#update-a-repository) and expand the "Properties of the `security_and_analysis` object" section.
If your organization is owned by an enterprise account, an enterprise owner can also enable push protection at the enterprise level. For more information, see [AUTOTITLE](/admin/managing-code-security/securing-your-enterprise/creating-a-custom-security-configuration-for-your-enterprise).
44
-
45
-
{% elsif ghes < 3.16 %}
46
-
47
-
If your organization is owned by an enterprise account, an enterprise owner can also enable push protection at the enterprise level. For more information, see [AUTOTITLE](/admin/managing-code-security/managing-github-advanced-security-for-your-enterprise/managing-github-advanced-security-features-for-your-enterprise).
48
-
49
-
{% endif %}
50
-
51
-
## Enabling push protection for a repository
52
-
53
19
{% data reusables.repositories.navigate-to-repo %}
54
20
{% data reusables.repositories.sidebar-settings %}
55
21
{% data reusables.repositories.navigate-to-code-security-and-analysis %}{% ifversion ghas-products %}
56
-
1. Under "{% data variables.product.prodname_secret_protection %}", to the right of "Push Protection", click **Enable**.{% else %}
22
+
1. If you have not already enabled {% data variables.product.prodname_secret_protection %}, to the right of "{% data variables.product.prodname_secret_protection %}", click **Enable**.
23
+
1. In the "{% data variables.product.prodname_secret_protection %}" section, to the right of "Push protection", click **Enable**.{% else %}
57
24
{% data reusables.repositories.navigate-to-ghas-settings %}
58
25
{% data reusables.advanced-security.secret-scanning-push-protection-repo %}{% endif %}
0 commit comments