# Ensure secret scanning is enabled to detect sensitive data

- Source: https://support.icompaas.com/support/solutions/articles/a_1790019232383529-ensure-secret-scanning-is-enabled-to-detect-sensitive-data
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [Version Control System (VCS)](https://support.icompaas.com/support/solutions/c_1781179095087930) › [GitHub](https://support.icompaas.com/support/solutions/folders/f_1781179116560328)
- Last updated: 2026-10-26
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

Description:

This control ensures that secret scanning is enabled for the repository. Secret scanning detects credentials such as API keys, tokens, and private keys committed to the repository and generates alerts so they can be revoked. Push protection, when enabled, blocks pushes that contain supported secrets before they reach the repository.

  

Rationale:

Secrets committed to source code can be discovered and abused by attackers to access cloud resources, third-party services, and internal systems. Secret scanning alerts the organization to exposed secrets so they can be revoked and rotated, while push protection prevents new secrets from being committed in the first place.

  

Impact:

-   Detected secrets generate alerts in the repository’s Security tab.
    
-   With push protection enabled, pushes containing supported secrets are blocked until the secret is removed or the block is bypassed with a stated reason.
    
-   Private and internal repositories require a GitHub Secret Protection (or GitHub Advanced Security) license.
    
-   Reduces the risk of credential leaks and unauthorized access.
    

  

Default Value:

-   Disabled by default for private and internal repositories. Repository administrators or organization owners must explicitly enable Secret Protection.
    

  

Remediation:

Secret scanning can be enabled at the organization level using a security configuration, which applies to many repositories at once, or at the repository level. Complete the section that matches how the organization manages security settings. The control is met if secret scanning is enabled on the repository by either method.

  

Organization Settings:

Test Plan:

1.  Sign in to GitHub as an organization owner or security manager.
    
2.  Click your profile picture in the upper-right corner, select Organizations, and select the target organization.
    
3.  Select Settings.
    
4.  In the Security section of the sidebar, select Advanced Security → Configurations.
    
5.  Verify that a security configuration exists with Secret Protection set to Enabled and Push protection set to Enabled.
    

6.  If no such configuration exists, or it is not applied to the repositories in scope, follow the Implementation Steps below to remediate the issue and repeat the test.
    

  

Implementation Steps:

1.  Sign in to GitHub as an organization owner or security manager.
    
2.  Click your profile picture in the upper-right corner, select Organizations, and select the target organization.
    
3.  Select Settings.
    
4.  In the Security section of the sidebar, select Advanced Security → Configurations.
    

5.  Click New configuration, or use the GitHub recommended configuration.
    
6.  Enter a name and description for the configuration.
    
7.  Under Secret Protection, select Enabled, and set Push protection to Enabled.
    
8.  Configure any other security features as required by organizational policy.
    
9.  Click Save configuration.
    
10.  Next to the configuration, open the Apply to dropdown and select All repositories (or All repositories without configurations).
     
11.  In the confirmation dialog, choose to apply the configuration to newly created repositories by default.
     

12.  Review the license usage summary and click Apply.
     

13.  Review existing secret scanning alerts in each repository’s Security tab and revoke or rotate any exposed secrets.
     

  

Backout Plan:

1.  Sign in to GitHub as an organization owner or security manager.
    
2.  Click your profile picture in the upper-right corner, select Organizations, and select the target organization.
    
3.  Select Settings.
    
4.  In the Security section of the sidebar, select Advanced Security → Configurations.
    
5.  Edit the applicable configuration and set Push protection or Secret Protection to Disabled, or apply a different configuration to the affected repositories.
    
6.  Click Save configuration and confirm the change.
    
7.  Verify that secret scanning no longer runs on the affected repositories according to the updated configuration.
    

  

Repository Settings:

Test Plan:

1.  Sign in to GitHub with administrative access to the repository.
    
2.  Navigate to the target repository and select Settings.
    
3.  In the Security section of the sidebar, select Advanced Security.
    
4.  Verify that Secret Protection is enabled, and that Push protection is enabled where required by organizational policy.
    
5.  Select the repository’s Security tab and confirm that the Secret scanning alerts view is available.
    

6.  If Secret Protection is not enabled, follow the Implementation Steps below to remediate the issue and repeat the test.
    

  

Implementation Steps:

1.  Sign in to GitHub with administrative access to the repository.
    
2.  Navigate to the target repository.
    
3.  Select Settings.
    
4.  In the Security section of the sidebar, select Advanced Security.
    

5.  Under Secret Protection, click Enable.
    

6.  Under Secret Protection, to the right of Push protection, click Enable.
    

7.  Review existing secret scanning alerts in the Security tab and revoke or rotate any exposed secrets.
    

  

Backout Plan:

1.  Sign in to GitHub with administrative access to the repository.
    
2.  Navigate to the target repository.
    
3.  Select Settings.
    
4.  In the Security section of the sidebar, select Advanced Security.
    
5.  Under Secret Protection, click Disable next to Push protection, or disable Secret Protection entirely.
    
6.  Verify that secret scanning no longer runs according to the updated configuration.
    

  

References:

-   [About Secret Scanning](https://docs.github.com/en/code-security/secret-scanning/introduction/about-secret-scanning)
    
-   [About Push Protection](https://docs.github.com/en/code-security/secret-scanning/introduction/about-push-protection)
    
-   [Enabling Push Protection for Your Repository](https://docs.github.com/en/code-security/secret-scanning/enabling-secret-scanning-features/enabling-push-protection-for-your-repository)
    
-   [Applying a Custom Security Configuration](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/establish-complete-coverage/applying-a-custom-security-configuration)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
