Skip to content

Commit 1652960

Browse files
authored
[DSP, already shipped] Use conditioning to revert the dismiss/delete alert changes on GHES (#16211)
* Use conditioning to revert dismiss/delete alert changes on GHES * Add new dotcom version text that is also good for GHES * Reinstate original subheading for GHES 2.22
1 parent be89bb3 commit 1652960

4 files changed

Lines changed: 38 additions & 6 deletions

File tree

content/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-code-scanning-alerts-for-your-repository.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Managing code scanning alerts for your repository
33
shortTitle: Managing alerts
4-
intro: 'You can view, fix, dismiss, or delete alerts for potential vulnerabilities or errors in your project''s code.'
4+
intro: 'You can view, fix, {% if currentVersion == "enterprise-server@2.22" %}or close{% else %}dismiss, or delete{% endif %} alerts for potential vulnerabilities or errors in your project''s code.'
55
product: '{% data reusables.gated-features.code-scanning %}'
66
permissions: 'People with write permission to a repository can manage {% data variables.product.prodname_code_scanning %} alerts for the repository.'
77
versions:
@@ -28,7 +28,7 @@ Each alert highlights a problem with the code and the name of the tool that iden
2828

2929
If you enable {% data variables.product.prodname_code_scanning %} using {% data variables.product.prodname_codeql %}, this can also detect data-flow problems in your code. Data-flow analysis finds potential security issues in code, such as: using data insecurely, passing dangerous arguments to functions, and leaking sensitive information.
3030

31-
When {% data variables.product.prodname_code_scanning_capc %} reports data-flow alerts, {% data variables.product.prodname_dotcom %} shows you how data moves through the code. {% data variables.product.prodname_code_scanning_capc %} allows you to identify the areas of your code that leak sensitive information, and that could be the entry point for attacks by malicious users.
31+
When {% data variables.product.prodname_code_scanning %} reports data-flow alerts, {% data variables.product.prodname_dotcom %} shows you how data moves through the code. {% data variables.product.prodname_code_scanning_capc %} allows you to identify the areas of your code that leak sensitive information, and that could be the entry point for attacks by malicious users.
3232

3333
### Viewing an alert
3434

@@ -48,12 +48,20 @@ Anyone with read permission for a repository can see {% data variables.product.p
4848

4949
Anyone with write permission for a repository can fix an alert by committing a correction to the code. If the repository has {% data variables.product.prodname_code_scanning %} scheduled to run on pull requests, it's best to raise a pull request with your correction. This will trigger {% data variables.product.prodname_code_scanning %} analysis of the changes and test that your fix doesn't introduce any new problems. For more information, see "[Configuring {% data variables.product.prodname_code_scanning %}](/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning)" and "[Triaging {% data variables.product.prodname_code_scanning %} alerts in pull requests](/github/finding-security-vulnerabilities-and-errors-in-your-code/triaging-code-scanning-alerts-in-pull-requests)."
5050

51-
If you have write permission for a repository, you can view fixed alerts by viewing the summary of alerts and clicking **Closed**. For more information, see "[Viewing an alert](#viewing-an-alert)." The "Closed" list shows fixed alerts and alerts that users have dismissed.
51+
If you have write permission for a repository, you can view fixed alerts by viewing the summary of alerts and clicking **Closed**. For more information, see "[Viewing an alert](#viewing-an-alert)." The "Closed" list shows fixed alerts and alerts that users have {% if currentVersion == "enterprise-server@2.22" %}closed{% else %}dismissed{% endif %}.
5252

5353
Alerts may be fixed in one branch but not in another. You can use the "Branch" drop-down menu, on the summary of alerts, to check whether an alert is fixed in a particular branch.
5454

5555
![Filtering alerts by branch](/assets/images/help/repository/code-scanning-branch-filter.png)
5656

57+
{% if currentVersion == "enterprise-server@2.22" %}
58+
59+
### Closing an alert
60+
61+
Closing an alert is a way to resolve an alert that you don't think needs to be fixed. {% data reusables.code-scanning.close-alert-examples %}
62+
63+
{% else %}
64+
5765
### Dismissing or deleting alerts
5866

5967
There are two ways of closing an alert. You can fix the problem in the code, or you can dismiss the alert. Alternatively, if you have admin permissions for the repository, you can delete alerts. Deleting alerts is useful in situations where you have enabled a {% data variables.product.prodname_code_scanning %} tool and then decided to remove it, or where you have enabled {% data variables.product.prodname_codeql %} analysis with a larger set of queries than you want to continue using, and you've then removed some queries from the tool. In both cases, deleting alerts allows you to clean up your {% data variables.product.prodname_code_scanning %} results. You can delete alerts from the summary list within the **Security** tab.
@@ -77,9 +85,19 @@ When you delete an alert:
7785

7886
To dismiss or delete alerts:
7987

88+
{% endif %}
89+
8090
{% data reusables.repositories.navigate-to-repo %}
8191
{% data reusables.repositories.sidebar-security %}
8292
{% data reusables.repositories.sidebar-code-scanning-alerts %}
93+
{% if currentVersion == "enterprise-server@2.22" %}
94+
{% data reusables.code-scanning.click-alert-in-list %}
95+
1. Select the **Close** drop-down menu and click a reason for closing the alert.
96+
![Choosing reason for closing the alert via the Close drop-down](/assets/images/help/repository/code-scanning-alert-close-drop-down.png)
97+
98+
{% data reusables.code-scanning.false-positive-fix-codeql %}
99+
100+
{% else %}
83101

84102
1. If you have admin permissions for the repository, and you want to delete alerts for this {% data variables.product.prodname_code_scanning %} tool, select some or all of the check boxes and click **Delete**.
85103

@@ -104,6 +122,8 @@ To dismiss or delete alerts:
104122

105123
If a project has multiple alerts that you want to dismiss for the same reason, you can bulk dismiss them from the summary of alerts. Typically, you'll want to filter the list and then dismiss all of the matching alerts. For example, you might want to dismiss all of the current alerts in the project that have been tagged for a particular Common Weakness Enumeration (CWE) vulnerability.
106124

125+
{% endif %}
126+
107127
### Further reading
108128

109129
- "[Triaging {% data variables.product.prodname_code_scanning %} alerts in pull requests](/github/finding-security-vulnerabilities-and-errors-in-your-code/triaging-code-scanning-alerts-in-pull-requests)"

content/github/finding-security-vulnerabilities-and-errors-in-your-code/triaging-code-scanning-alerts-in-pull-requests.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ versions:
1515

1616
In repositories where {% data variables.product.prodname_code_scanning %} is configured as a pull request check, {% data variables.product.prodname_code_scanning %} checks the code in the pull request. By default, this is limited to pull requests that target the default branch or protected branches, but you can change this configuration within {% data variables.product.prodname_actions %} or in a third-party CI/CD system. If merging the changes would introduce new {% data variables.product.prodname_code_scanning %} alerts to the target branch, these are reported as check results in the pull request. The alerts are also shown as annotations in the **Files changed** tab of the pull request. If you have write permission for the repository, you can see any existing {% data variables.product.prodname_code_scanning %} alerts on the **Security** tab. For information about repository alerts, see "[Managing {% data variables.product.prodname_code_scanning %} alerts for your repository](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-code-scanning-alerts-for-your-repository)."
1717

18-
If {% data variables.product.prodname_code_scanning %} has any results with a severity of `error`, the check fails and the error is reported in the check results. If all the results found by {% data variables.product.prodname_code_scanning %} have lower severities, the alerts are treated as warnings or notices and the check succeeds. If your pull request targets a protected branch, and the repository owner has configured required status checks, then you must either fix or dismiss all error alerts before the pull request can be merged. For more information, see "[About required status checks](/github/administering-a-repository/about-required-status-checks)."
18+
If {% data variables.product.prodname_code_scanning %} has any results with a severity of `error`, the check fails and the error is reported in the check results. If all the results found by {% data variables.product.prodname_code_scanning %} have lower severities, the alerts are treated as warnings or notices and the check succeeds. If your pull request targets a protected branch, and the repository owner has configured required status checks, then you must either fix or {% if currentVersion == "enterprise-server@2.22" %}close{% else %}dismiss{% endif %} all error alerts before the pull request can be merged. For more information, see "[About required status checks](/github/administering-a-repository/about-required-status-checks)."
1919

2020
![Failed {% data variables.product.prodname_code_scanning %} check on a pull request](/assets/images/help/repository/code-scanning-check-failure.png)
2121

@@ -39,10 +39,18 @@ In the detailed view for an alert, some {% data variables.product.prodname_code_
3939

4040
![Alert description and link to show more information](/assets/images/help/repository/code-scanning-pr-alert.png)
4141

42-
### Fixing an alert on your pull request
42+
### {% if currentVersion == "enterprise-server@2.22" %}Resolving{% else %}Fixing{% endif %} an alert on your pull request
4343

4444
Anyone with write permission for a repository can fix a {% data variables.product.prodname_code_scanning %} alert that's identified on a pull request. If you commit changes to the pull request this triggers a new run of the pull request checks. If your changes fix the problem, the alert is closed and the annotation removed.
4545

46+
{% if currentVersion == "enterprise-server@2.22" %}
47+
48+
If you don't think that an alert needs to be fixed, you can close the alert manually. {% data reusables.code-scanning.close-alert-examples %} The **Close** button is available in annotations and in the alerts view if you have write permission for the repository.
49+
50+
{% data reusables.code-scanning.false-positive-fix-codeql %}
51+
52+
{% else %}
53+
4654
### Dismissing an alert on your pull request
4755

4856
An alternative way of closing an alert is to dismiss it. You can dismiss an alert if you don't think it needs to be fixed. {% data reusables.code-scanning.close-alert-examples %} If you have write permission for the repository, the **Dismiss** button is available in code annotations and in the alerts summary. When you click **Dismiss** you will be prompted to choose a reason for closing the alert.
@@ -54,3 +62,5 @@ An alternative way of closing an alert is to dismiss it. You can dismiss an aler
5462
{% data reusables.code-scanning.false-positive-fix-codeql %}
5563

5664
For more information about dismissing alerts, see "[Managing {% data variables.product.prodname_code_scanning %} alerts for your repository](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-code-scanning-alerts-for-your-repository#dismissing-or-deleting-alerts)."
65+
66+
{% endif %}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1. Under "Code scanning," click the alert you'd like to explore.
2+
![List of alerts from {% data variables.product.prodname_code_scanning %}](/assets/images/help/repository/code-scanning-click-alert.png)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
If you dismiss a {% data variables.product.prodname_codeql %} alert as a false positive result, for example because the code uses a sanitization library that isn't supported, consider contributing to the {% data variables.product.prodname_codeql %} repository and improving the analysis. For more information about {% data variables.product.prodname_codeql %}, see "[Contributing to {% data variables.product.prodname_codeql %}](https://github.com/github/codeql/blob/main/CONTRIBUTING.md)."
1+
If you {% if currentVersion == "enterprise-server@2.22" %}close{% else %}dismiss{% endif %} a {% data variables.product.prodname_codeql %} alert as a false positive result, for example because the code uses a sanitization library that isn't supported, consider contributing to the {% data variables.product.prodname_codeql %} repository and improving the analysis. For more information about {% data variables.product.prodname_codeql %}, see "[Contributing to {% data variables.product.prodname_codeql %}](https://github.com/github/codeql/blob/main/CONTRIBUTING.md)."

0 commit comments

Comments
 (0)