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-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,7 +18,7 @@ category:
18
18
19
19
## What is push protection?
20
20
21
-
Push protection is a {% data variables.product.prodname_secret_scanning %} feature designed to prevent sensitive information, such as secrets or tokens, from ever being pushed to your repository. Unlike {% data variables.product.prodname_secret_scanning %}, which detects secrets after they have been committed, push protection proactively scans your code for secrets during the push process, then blocks the push if any are detected.
21
+
Push protection is a {% data variables.product.prodname_secret_scanning %} feature designed to prevent hardcoded credentials, such as secrets or tokens, from ever being pushed to your repository. Rather than alerting you to credential leaks after the fact, push protection blocks pushes that contain secrets _before_ they reach your repository.
22
22
23
23
## How push protection works
24
24
@@ -74,9 +74,9 @@ If you want greater control over which contributors can bypass push protection a
74
74
75
75
## Benefits of push protection
76
76
77
-
***Preventative security:** Push protection acts as a frontline defense mechanism by scanning code for secrets at the time of the push. This preventative approach helps to catch potential issues before they are merged into a repository.
77
+
***Preventative security:** Push protection acts as a frontline defense mechanism by scanning code for hardcoded secrets at the time of the push. This preventative approach helps prevent credential leaks before they become ingrained in the repository's history, making it easier to address and remediate threats.
78
78
***Immediate feedback:** Developers receive instant feedback if a potential secret is detected during a push attempt. This immediate notification allows for quick remediation, reducing the likelihood of sensitive information being exposed.
79
-
***Reduced risk of data leaks:** By blocking commits that contain sensitive information, push protection significantly reduces the risk of accidental data leaks. This helps in safeguarding against unauthorized access to your infrastructure, services, and data.
79
+
***Reduced risk of credential leaks:** By blocking commits that contain hardcoded credentials, push protection significantly reduces the risk of accidental credential leaks and secret sprawl. This helps in safeguarding against potential breaches and maintaining the integrity of the codebase.
80
80
***Efficient secret management:** Instead of retrospectively dealing with exposed secrets, developers can address issues at the source. This makes secret management more efficient and less time-consuming.
81
81
***Bypass functionality for flexibility:** For cases where false positives occur or when certain patterns are necessary, you can bypass push protection for users, and designated users can use the delegated bypass feature to bypass push protection for repositories. {% ifversion push-protection-org-enterprise-exemptions %}Additionally, you can exempt trusted actors {% ifversion push-protection-repo-exemptions %}{% else %}at the organization and enterprise levels {% endif %}from push protection entirely. {% endif %}This provides flexibility without compromising overall security.
82
82
***Ability to detect custom patterns (for repositories in organizations):** Organizations can define custom patterns for detecting secrets unique to their environment. This customization ensures that push protection can effectively identify and block even non-standard secrets.
Copy file name to clipboardExpand all lines: content/code-security/concepts/secret-security/about-secret-scanning.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
@@ -19,7 +19,7 @@ category:
19
19
- Protect your secrets
20
20
---
21
21
22
-
When credentials like API keys and passwords are committed to repositories, they become targets for unauthorized access. {% data variables.product.prodname_secret_scanning_caps %} automatically detects these exposed secrets so you can secure them before they're exploited.
22
+
When credentials like API keys and passwords are committed to repositories as hardcoded secrets, they become targets for unauthorized access. {% data variables.product.prodname_secret_scanning_caps %} automatically detects credential leaks so you can secure them before they're exploited.
23
23
24
24
{% ifversion secret-risk-assessment %}
25
25
@@ -32,15 +32,15 @@ When credentials like API keys and passwords are committed to repositories, they
32
32
33
33
## How secret scanning protects your code
34
34
35
-
{% data variables.product.prodname_secret_scanning_caps %} scans your entire Git history on all branches of your repository for API keys, passwords, tokens, and other known secret types. {% data variables.product.github %} also periodically rescans repositories when new secret types are added.
35
+
{% data variables.product.prodname_secret_scanning_caps %} scans your entire Git history on all branches of your repository for hardcoded credentials, including API keys, passwords, tokens, and other known secret types. This helps you identify secret sprawl, the uncontrolled proliferation of credentials across repositories, before it becomes a security risk. {% data variables.product.github %} also periodically rescans repositories when new secret types are added.
36
36
37
37
{% data variables.product.github %} also automatically scans:
38
38
39
39
{% data reusables.secret-scanning.what-is-scanned %}
40
40
41
41
### {% data variables.product.prodname_secret_scanning_caps %} alerts and remediation
42
42
43
-
When {% data variables.product.prodname_secret_scanning %} finds a potential secret, {% data variables.product.github %} generates an alert on your repository's **{% data variables.product.prodname_security_and_quality_tab %}** tab with details about the exposed credential.
43
+
When {% data variables.product.prodname_secret_scanning %} detects a credential leak, {% data variables.product.github %} generates an alert on your repository's **{% data variables.product.prodname_security_and_quality_tab %}** tab with details about the exposed credential.
44
44
45
45
When you receive an alert, rotate the affected credential immediately to prevent unauthorized access. While you can also remove secrets from your Git history, this is time-intensive and often unnecessary if you've already revoked the credential.
Copy file name to clipboardExpand all lines: content/code-security/concepts/secret-security/about-secret-security-with-github.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ category:
14
14
- Protect your secrets
15
15
---
16
16
17
-
Exposed secrets in your repositories can lead to unauthorized access, data breaches, and significant costs to your organization. For details about these risks and how to protect against them, see [AUTOTITLE](/code-security/concepts/secret-security/secret-leakage-risks).
17
+
Hardcoded credentials in your repositories can lead to credential leaks, unauthorized access, data breaches, and significant costs to your organization. For details about these risks and how to protect against them, see [AUTOTITLE](/code-security/concepts/secret-security/secret-leakage-risks).
18
18
19
19
{% data variables.product.github %} provides tools to help you understand and address your organization's exposure to leaked secrets:
20
20
@@ -23,7 +23,7 @@ Exposed secrets in your repositories can lead to unauthorized access, data breac
23
23
24
24
## Secret risk assessment
25
25
26
-
The secret risk assessment provides organization owners and security managers with a free point-in-time scan of their organization's repositories to identify leaked secrets like API keys, tokens, and passwords.
26
+
The secret risk assessment provides organization owners and security managers with a free point-in-time scan of their organization's repositories to identify hardcoded credentials like API keys, tokens, and passwords, and understand the extent of secret sprawl across your organization.
27
27
28
28
{% data variables.secret-scanning.secret-risk-assessment-cta-product %}
While the {% data variables.product.prodname_secret_risk_assessment %} provides a point-in-time view of your organization's current secret exposure, {% data variables.product.prodname_GH_secret_protection %}:
53
53
54
54
***Implements continuous monitoring** and expands scanned surfaces beyond code to include pull requests, issues, wikis, and discussions
55
-
***Prevents secret leaks** by blocking commits containing secrets before they are saved to {% data variables.product.github %}
55
+
***Prevents credential leaks** by blocking commits containing hardcoded secrets before they are saved to {% data variables.product.github %}
56
56
***Creates actionable alerts** that can be grouped into campaigns and assigned to team members for remediation
57
57
***Meets your specific needs** by scanning for patterns unique to your organization and unstructured secrets like passwords
58
58
***Supports governance at scale** with settings dictating who can bypass protections and dismiss alerts
59
59
***Surfaces key analytics** through a view dedicated to your organization's secret security
60
60
61
-
Through these features, {% data variables.product.prodname_GH_secret_protection %} provides complete coverage for your organization, reducing the risk of costly secret leaksand high-effort remediation processes.
61
+
Through these features, {% data variables.product.prodname_GH_secret_protection %} provides complete coverage for your organization, reducing the risk of costly credential leaks, secret sprawl, and high-effort remediation.
62
62
63
63
For more information about the specific features of {% data variables.product.prodname_GH_secret_protection %}, see [AUTOTITLE](/code-security/getting-started/github-security-features#available-with-github-secret-protection).
Copy file name to clipboardExpand all lines: content/code-security/concepts/secret-security/secret-leakage-risks.md
+51-57Lines changed: 51 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,96 +9,90 @@ versions:
9
9
contentType: concepts
10
10
---
11
11
12
-
## Secrets and credentials
12
+
## What are secrets?
13
13
14
-
Secrets are credentials that grant access to sensitive systems and data, including API keys, passwords, authentication tokens, certificates, and encryption keys. When secrets are committed to repositories, they become part of your Git history and remain accessible even after being removed from the latest commit.
14
+
Secrets are credentials that grant access to sensitive systems and data. Common examples include:
15
15
16
-
Secrets in code repositories can be discovered by automated scanning tools and unauthorized users. Public repositories are particularly vulnerable, but leaked credentials from private repositories can also spread through forks, CI/CD logs, or third-party integrations.
16
+
* API keys and tokens used to authenticate with external services
17
+
* Database passwords and connection strings
18
+
* Cloud provider credentials and service account tokens
19
+
* Certificates and encryption keys
17
20
18
-
## Security impact of exposed secrets
21
+
When secrets are committed to repositories, they become **hardcoded credentials** that are embedded directly in your source code or configuration files. These hardcoded secrets become part of your Git history and remain accessible even after being removed from the latest commit. This means that addressing a credential leak requires more than deleting the file; you must also revoke and replace the credential to prevent unauthorized access.
19
22
20
-
Exposed secrets can lead to several types of security incidents:
23
+
## How secrets get exposed
21
24
22
-
**Unauthorized access and usage**
23
-
* Leaked cloud provider credentials can be used to provision infrastructure or services on your account
24
-
* Database credentials allow access to sensitive customer or organizational data
25
-
* Service account tokens provide entry points to production systems
25
+
**Secret sprawl** occurs when credentials proliferate across repositories, teams, and systems without centralized management or visibility. This makes it difficult to track which secrets exist, where they're used, and whether they've been exposed. Secrets typically enter repositories through several common patterns.
26
26
27
-
**Operational and compliance issues**
28
-
* Infrastructure can be modified or deleted using leaked credentials
29
-
* Data breaches from exposed secrets may result in regulatory penalties under GDPR, CCPA, and other frameworks
30
-
* Organizations face costs for incident response, credential rotation, and system remediation
27
+
### Development workflows
31
28
32
-
**Organizational risk**
33
-
* Public disclosure of leaked secrets affects customer trust and organizational reputation
34
-
* Exposed package registry tokens can be used to publish malicious versions of your software
35
-
* Proprietary API keys or service credentials may be exploited
29
+
* Hardcoded credentials added during local testing and inadvertently committed
30
+
* Secrets in configuration files such as `.env` files or infrastructure-as-code templates
31
+
* Example credentials containing real API keys or tokens in documentation, wikis, or README files
36
32
37
-
##Financial impact of exposed secrets
33
+
### Repository management
38
34
39
-
Secret leakage can result in direct and indirect costs to your organization, ranging from immediate expenses to long-term business consequences.
35
+
* Legacy repositories containing forgotten but still-active credentials
36
+
* Secrets shared in {% data variables.product.github %} issues, pull request comments, discussions, or gists
37
+
* Credentials introduced by external contributors or contractors
40
38
41
-
**Immediate costs**
42
-
* Unauthorized cloud resource usage from leaked API keys can generate charges for compute instances, storage, or data transfer
43
-
* Cryptocurrency mining operations on compromised accounts can result in substantial infrastructure bills
44
-
* Emergency incident response requires resources for forensic investigation, security audits, and credential rotation across systems
39
+
### Version control propagation
45
40
46
-
**Data breach costs**
47
-
* Regulatory fines for data protection violations can reach millions of dollars under GDPR, CCPA, and industry-specific regulations
48
-
* Legal costs include investigation, notification requirements, and potential litigation
49
-
* Credit monitoring and identity protection services for affected customers
41
+
* Secrets persist in Git history even after removal from current code.
42
+
* Credentials propagate to forked repositories, backup systems, and CI/CD logs.
43
+
* Public repositories with exposed secrets are indexed by search engines and specialized scanning services.
50
44
51
-
**Operational impact**
52
-
* Service disruptions from compromised infrastructure result in lost revenue and productivity
53
-
* Engineering time spent responding to security incidents diverts resources from product development
54
-
* Increased security tooling and monitoring costs following incidents
45
+
## Security risks
55
46
56
-
**Long-term business impact**
57
-
* Customer churn following public disclosure of security incidents
58
-
* Increased insurance premiums for cyber liability coverage
59
-
* Lost business opportunities due to failed security assessments or compliance audits
47
+
Exposed secrets can lead to several types of security incidents.
60
48
61
-
##Common secret leakage scenarios
49
+
### Unauthorized access
62
50
63
-
Secrets typically enter repositories through several common patterns:
51
+
Credential leaks give unauthorized users direct access to your systems. Once exposed, hardcoded secrets can be exploited to:
64
52
65
-
**Development workflows**
66
-
* Credentials hardcoded during local testing and inadvertently committed
67
-
* Secrets in configuration files like `.env` files or infrastructure-as-code templates
68
-
* Example credentials containing real tokens in documentation, wikis, or README files
53
+
* Provision infrastructure or services on your account using leaked cloud provider credentials
54
+
* Access sensitive customer or organizational data through compromised database credentials
55
+
* Gain entry to production systems via exposed service account tokens
69
56
70
-
**Repository management**
71
-
* Legacy repositories containing forgotten but still-active credentials
72
-
* Secrets shared in GitHub issues, pull request comments, discussions, or gists
73
-
* Credentials introduced by external contributors or contractors
57
+
### Data breaches
58
+
59
+
Credential leaks give unauthorized users direct access to your systems, leading to data breaches. Once attackers gain access using exposed credentials, they can exfiltrate sensitive data, modify or delete critical information, and compromise customer trust. Data breaches require immediate incident response, including credential revocation, system remediation, and assessment of the breach's scope and impact.
74
60
75
-
**Version control challenges**
76
-
* Secrets persist in Git history even after removal from current code
77
-
* Credentials propagate to forked repositories, backup systems, and logs
78
-
* Public repositories with exposed secrets are indexed by search engines and specialized scanning services
61
+
### Supply chain attacks
62
+
63
+
Exposed package registry tokens can be used to publish malicious versions of your software, affecting downstream users and organizations that depend on your packages.
64
+
65
+
## Financial impact
66
+
67
+
Exposed secrets can cost your organization money in several ways.
68
+
69
+
***Unexpected cloud bills**: Leaked API keys let attackers use your cloud resources. They can run compute instances, store data, or mine cryptocurrency on your account, generating large bills.
70
+
***Incident response**: Investigating breaches, rotating credentials, and auditing systems takes significant engineering time and resources.
71
+
***Legal costs**: Data breaches can result in fines, legal fees, and notification expenses.
72
+
***Long-term damage**: Lost customers, higher insurance costs, and missed business opportunities after security incidents become public.
79
73
80
74
## Secret security with {% data variables.product.github %}
81
75
82
76
{% data variables.product.github %} provides tools to help you prevent, detect, and remediate secret leakage:
83
77
84
-
### 1. Prevent new secrets from being leaked
78
+
### 1. Prevent new secrets from being committed
85
79
86
-
Enable **push protection for repositories** to scan code during `git push` operations and block commits containing detected secrets. This prevents credentials from entering your repositories while providing real-time feedback to developers.
80
+
Enable **Push protection** to scan code during `git push` operations and block commits containing detected secrets before they enter your repository. This prevents hardcoded credentials from being added to your codebase and provides real-time feedback to developers at the point of risk, covering both provider patterns for known services and non-provider patterns such as private keys and generic API keys.
87
81
88
-
Encourage your contributors to enable push protection for their personal accounts (the feature is referred to as "push protection for users") to protect all their pushes to their repositories, forks, and any repositories they contribute to across {% data variables.product.github %}. This allows individual developers to prevent secret leakage without waiting for organization-level policies.
82
+
Encourage individual developers to enable push protection for their personal accounts to protect all their pushes across {% data variables.product.github %}, regardless of organization policies. This helps prevent secret sprawl by catching leaked credentials before they reach your repositories.
89
83
90
84
### 2. Detect existing secrets
91
85
92
-
Use **{% data variables.product.prodname_secret_scanning %}** to continuously monitor repositories for committed secrets and receive alerts when credentials are detected. This enables you to revoke and rotate compromised credentials quickly.
86
+
Use **{% data variables.product.prodname_secret_scanning %}** to continuously monitor your repositories for hardcoded secrets and generate alerts when credentials are detected, enabling you to revoke and rotate compromised credentials quickly. Beyond default detection of provider patterns, you can expand scanning to non-provider patterns and define custom patterns for organization-specific secrets. This helps you gain visibility into secret sprawl across your organization.
93
87
94
88
## Next steps
95
89
96
-
To protect your organization from secret leakage:{% ifversion secret-risk-assessment %}
97
-
1. Run a free secretriskassessment to understand your current exposure.
98
-
{% data variables.secret-scanning.secret-risk-assessment-cta-product %}
90
+
To protect your organization from secret leakage:
91
+
{% ifversion secret-risk-assessment %}
92
+
1. Run a free secret risk assessment to understand your current exposure. {% data variables.secret-scanning.secret-risk-assessment-cta-product %}
99
93
{% endif %}
100
94
1. Enable push protection to prevent new secrets from being committed.
101
-
1. Enable {% data variables.product.prodname_secret_scanning %} with a click to begin detecting secret leaks.
95
+
1. Enable {% data variables.product.prodname_secret_scanning %} to begin detecting existing secret leaks.
102
96
1. Establish secure credential management practices for your development teams.
0 commit comments