Skip to content

Commit 66d6247

Browse files
authored
[2022-04-08]: Secret scanning: add org level dry run for custom patterns (#26545)
* add org level dry run
1 parent 77d6ba2 commit 66d6247

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed
Loading

content/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ Before defining a custom pattern, you must ensure that {% data variables.product
6969
{% data reusables.advanced-security.secret-scanning-new-custom-pattern %}
7070
{% data reusables.advanced-security.secret-scanning-add-custom-pattern-details %}{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-5499 %}
7171
1. When you're ready to test your new custom pattern, to identify matches in the repository without creating alerts, click **Save and dry run**.
72-
1. When the dry run finishes, you'll see a sample of results (up to 1000) from the repository. Review the results and identify any false positive results.
73-
![Screenshot showing results from dry run](/assets/images/help/repository/secret-scanning-publish-pattern.png)
74-
1. Edit the new custom pattern to fix any problems with the results, then click **Save and dry run** to test your changes.
75-
{% indented_data_reference reusables.secret-scanning.beta-dry-runs spaces=3 %}
72+
{% data reusables.advanced-security.secret-scanning-dry-run-results %}
7673
{% endif %}
7774
{% data reusables.advanced-security.secret-scanning-create-custom-pattern %}
7875

@@ -111,18 +108,27 @@ aAAAe9
111108

112109
Before defining a custom pattern, you must ensure that you enable {% data variables.product.prodname_secret_scanning %} for the repositories that you want to scan in your organization. To enable {% data variables.product.prodname_secret_scanning %} on all repositories in your organization, see "[Managing security and analysis settings for your organization](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization)."
113110

111+
{% ifversion ghes < 3.5 or ghae %}
114112
{% note %}
115113

116114
**Note:** As there is no dry-run functionality, we recommend that you test your custom patterns in a repository before defining them for your entire organization. That way, you can avoid creating excess false-positive {% data variables.product.prodname_secret_scanning %} alerts.
117115

118116
{% endnote %}
117+
{% endif %}
119118

120119
{% data reusables.profile.access_org %}
121120
{% data reusables.profile.org_settings %}
122121
{% data reusables.organizations.security-and-analysis %}
123122
{% data reusables.repositories.navigate-to-ghas-settings %}
124123
{% data reusables.advanced-security.secret-scanning-new-custom-pattern %}
125124
{% data reusables.advanced-security.secret-scanning-add-custom-pattern-details %}
125+
{%- if secret-scanning-org-dry-runs %}
126+
1. When you're ready to test your new custom pattern, to identify matches in select repositories without creating alerts, click **Save and dry run**.
127+
1. Search for and select the repositories where you want to perform the dry run. You can select up to 10 repositories.
128+
![Screenshot showing repositories selected for the dry run](/assets/images/help/repository/secret-scanning-dry-run-custom-pattern-select-repo.png)
129+
1. When you're ready to test your new custom pattern, click **Dry run**.
130+
{% data reusables.advanced-security.secret-scanning-dry-run-results %}
131+
{%- endif %}
126132
{% data reusables.advanced-security.secret-scanning-create-custom-pattern %}
127133

128134
After your pattern is created, {% data variables.product.prodname_secret_scanning %} scans for any secrets in repositories in your organization, including their entire Git history on all branches. Organization owners and repository administrators will be alerted to any secrets found and can review the alert in the repository where the secret is found. For more information on viewing {% data variables.product.prodname_secret_scanning %} alerts, see "[Managing alerts from {% data variables.product.prodname_secret_scanning %}](/code-security/secret-security/managing-alerts-from-secret-scanning)."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Issue #6367
2+
# Documentation for the "org level dry runs (Public Beta)" for custom patterns under secret scanning
3+
versions:
4+
ghec: '*'
5+
ghes: '>3.4'
6+
ghae: 'issue-6367'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1. When the dry run finishes, you'll see a sample of results (up to 1000) from the repository. Review the results and identify any false positive results.
2+
![Screenshot showing results from dry run](/assets/images/help/repository/secret-scanning-publish-pattern.png)
3+
1. Edit the new custom pattern to fix any problems with the results, then, to test your changes, click **Save and dry run**.
4+
{% indented_data_reference reusables.secret-scanning.beta-dry-runs spaces=3 %}

0 commit comments

Comments
 (0)