A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.github.com/en/code-security/secret-scanning/introduction/about-push-protection below:

About push protection - GitHub Docs

Push protection blocks contributors from pushing secrets to a repository and generates an alert whenever a contributor bypasses the block. Push protection can be applied at the repository, organization, and user account level.

Who can use this feature?

Push protection is available for the following repository types:

About push protection

Push protection is a secret scanning feature that is designed to prevent sensitive information, such as secrets or tokens, from being pushed to your repository in the first place. Unlike secret scanning, which detects secrets after they have been committed, push protection proactively scans your code for secrets during the push process and blocks the push if any are detected.

Push protection helps you avoid the risks associated with exposed secrets, like unauthorized access to resources or services. With this feature, developers get immediate feedback and can address potential issues before they become a security concern.

You can enable push protection:

Tip

Regardless of the enablement status of push protection, organizations on GitHub Team and GitHub Enterprise can run a free report to scan the code in the organization for leaked secrets. The report also tells you how many secret leaks in your organization could have been prevented by push protection. See About the secret risk assessment.

For information about the secrets and service providers supported by push protection, see Supported secret scanning patterns.

Push protection has some limitations. For more information, see Troubleshooting secret scanning.

How push protection works

Push protection blocks secrets detected in:

Once enabled, if push protection detects a potential secret during a push attempt, it will block the push and provide a detailed message explaining the reason for the block. You will need to review the code in question, remove any sensitive information, and reattempt the push.

By default, anyone with write access to the repository can choose to bypass push protection by specifying one of the bypass reasons outlined in the table. If a contributor bypasses a push protection block for a secret, GitHub:

This table shows the behavior of alerts for each way a user can bypass a push protection block.

Bypass reason Alert behavior It's used in tests GitHub creates a closed alert, resolved as "used in tests" It's a false positive GitHub creates a closed alert, resolved as "false positive" I'll fix it later GitHub creates an open alert

If you want greater control over which contributors can bypass push protection and which pushes containing secrets should be allowed, you can enable delegated bypass for push protection. Delegated bypass lets you configure a designated group of reviewers to oversee and manage requests to bypass push protection from contributors pushing to the repository. For more information, see About delegated bypass for push protection.

You can also bypass push protection using the REST API. For more information, see REST API endpoints for secret scanning.

About the benefits of push protection

Every user across GitHub can also enable push protection for themselves within their individual settings. Enabling push protection for your user account means that your pushes are protected whenever you push to a public repository on GitHub, without relying on that repository to have push protection enabled. For more information, see Push protection for users.

Customizing push protection

Once push protection is enabled, you can customize it further:

Configure push protected patterns

Customize which secret patterns are included in push protection at the enterprise or organization level. See Configuring additional secret scanning settings for your enterprise and Configuring global security settings for your organization.

Define custom patterns

Define custom patterns that push protection can use to identify secrets and block pushes containing these secrets. For more information, see Defining custom patterns for secret scanning.

Configure delegated bypass

Define contributors who can bypass push protection and add an approval process for other contributors. For more information, see About delegated bypass for push protection.

Further reading

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4