Skip to content

Commit 20790e7

Browse files
authored
Add topic for developers who need to triage code scanning alerts in PRs (#15740)
1 parent 461a74f commit 20790e7

17 files changed

+127
-69
lines changed
90.5 KB
Loading
214 KB
Loading
74.6 KB
Loading

content/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ versions:
1818

1919
You can use {{ site.data.variables.product.prodname_code_scanning }} to find, triage, and prioritize fixes for existing problems in your code. {{ site.data.variables.product.prodname_code_scanning_capc }} also prevents developers from introducing new problems. You can schedule scans for specific days and times, or trigger scans when a specific event occurs in the repository, such as a push.
2020

21-
If {{ site.data.variables.product.prodname_code_scanning }} finds a potential vulnerability or error in your code, {{ site.data.variables.product.prodname_dotcom }} displays an alert in the repository. After you fix the code that triggered the alert, {{ site.data.variables.product.prodname_dotcom }} closes the alert. For more information, see "[Managing alerts from {{ site.data.variables.product.prodname_code_scanning }}](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-alerts-from-code-scanning)."
21+
If {{ site.data.variables.product.prodname_code_scanning }} finds a potential vulnerability or error in your code, {{ site.data.variables.product.prodname_dotcom }} displays an alert in the repository. After you fix the code that triggered the alert, {{ site.data.variables.product.prodname_dotcom }} closes the alert. For more information, see "[Managing {{ site.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)."
2222

2323
To monitor results from {{ site.data.variables.product.prodname_code_scanning }} across your repositories or your organization, you can use the {{ site.data.variables.product.prodname_code_scanning }} API.
2424
For more information about API endpoints, see "[{{ site.data.variables.product.prodname_code_scanning_capc }}](/v3/code-scanning)."

content/github/finding-security-vulnerabilities-and-errors-in-your-code/about-integration-with-code-scanning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ versions:
1111
{{ site.data.reusables.code-scanning.beta }}
1212
{{ site.data.reusables.code-scanning.enterprise-enable-code-scanning }}
1313

14-
As an alternative to running {{ site.data.variables.product.prodname_code_scanning }} within {{ site.data.variables.product.prodname_dotcom }}, you can perform analysis elsewhere and then upload the results. Alerts for {{ site.data.variables.product.prodname_code_scanning }} that you run externally are displayed in the same way as those for {{ site.data.variables.product.prodname_code_scanning }} that you run within {{ site.data.variables.product.prodname_dotcom }}. For more information, see "[Managing alerts from code scanning](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-alerts-from-code-scanning)."
14+
As an alternative to running {{ site.data.variables.product.prodname_code_scanning }} within {{ site.data.variables.product.prodname_dotcom }}, you can perform analysis elsewhere and then upload the results. Alerts for {{ site.data.variables.product.prodname_code_scanning }} that you run externally are displayed in the same way as those for {{ site.data.variables.product.prodname_code_scanning }} that you run within {{ site.data.variables.product.prodname_dotcom }}. For more information, see "[Managing {{ site.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)."
1515

1616
You can use your continuous integration or continuous delivery/deployment (CI/CD) system to run {{ site.data.variables.product.prodname_dotcom }}'s {{ site.data.variables.product.prodname_codeql }} analysis and upload the results to {{ site.data.variables.product.prodname_dotcom }}. This is an alternative to using {{ site.data.variables.product.prodname_actions }} to run {{ site.data.variables.product.prodname_codeql }} analysis. For more information, see "[Running code scanning in your CI system](/github/finding-security-vulnerabilities-and-errors-in-your-code/running-code-scanning-in-your-ci-system)."
1717

content/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning-in-your-ci-system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ If the `autobuild` command can't build your code, you can run the build steps yo
9494

9595
By default, the {{ site.data.variables.product.prodname_codeql_runner }} uploads results from {{ site.data.variables.product.prodname_code_scanning }} when you run the `analyze` command. You can also upload SARIF files separately, by using the `upload` command.
9696

97-
Once you've uploaded the data, {{ site.data.variables.product.prodname_dotcom }} displays the alerts in your repository. For more information, see "[Managing alerts from code scanning](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-alerts-from-code-scanning#viewing-an-alert)."
97+
Once you've uploaded the data, {{ site.data.variables.product.prodname_dotcom }} displays the alerts in your repository. For more information, see "[Managing {{ site.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#viewing-an-alert)."
9898

9999
### {{ site.data.variables.product.prodname_codeql_runner }} command reference
100100

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ After you commit the workflow file or create a pull request, {{ site.data.variab
4545
After you enable {{ site.data.variables.product.prodname_code_scanning }}, you can monitor analysis, view results, and further customize how you scan your code.
4646

4747
- You can view the run status of {{ site.data.variables.product.prodname_code_scanning }} and get notifications for completed runs. For more information, see "[Managing a workflow run](/actions/configuring-and-managing-workflows/managing-a-workflow-run)" and "[Configuring notifications](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#github-actions-notification-options)."
48-
- After a scan completes, you can view alerts from a completed scan. For more information, see "[Managing alerts from {{ site.data.variables.product.prodname_code_scanning }}](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-alerts-from-code-scanning)."
48+
- After a scan completes, you can view alerts from a completed scan. For more information, see "[Managing {{ site.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)."
4949
- You can customize how {{ site.data.variables.product.prodname_code_scanning }} scans the code in your repository. For more information, see "[Configuring code scanning](/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning)."

content/github/finding-security-vulnerabilities-and-errors-in-your-code/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ versions:
1111

1212
{% topic_link_in_list /automatically-scanning-your-code-for-vulnerabilities-and-errors %}
1313
{% link_in_list /about-code-scanning %}
14+
{% link_in_list /triaging-code-scanning-alerts-in-pull-requests %}
1415
{% link_in_list /enabling-code-scanning-for-a-repository %}
15-
{% link_in_list /managing-alerts-from-code-scanning %}
16+
{% link_in_list /managing-code-scanning-alerts-for-your-repository %}
1617
{% link_in_list /configuring-code-scanning %}
1718
{% link_in_list /configuring-the-codeql-workflow-for-compiled-languages %}
1819
{% link_in_list /troubleshooting-the-codeql-workflow %}

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

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Managing code scanning alerts for your repository
3+
shortTitle: Managing alerts
4+
intro: 'You can view, fix, and close alerts for potential vulnerabilities or errors in your project''s code.'
5+
product: '{{ site.data.reusables.gated-features.code-scanning }}'
6+
permissions: 'People with write permission to a repository can manage {{ site.data.variables.product.prodname_code_scanning }} alerts for the repository.'
7+
versions:
8+
free-pro-team: '*'
9+
enterprise-server: '>=2.22'
10+
redirect_from:
11+
- /github/managing-security-vulnerabilities/managing-alerts-from-automated-code-scanning
12+
- /github/finding-security-vulnerabilities-and-errors-in-your-code/managing-alerts-from-code-scanning
13+
---
14+
15+
{{ site.data.reusables.code-scanning.beta }}
16+
{{ site.data.reusables.code-scanning.enterprise-enable-code-scanning }}
17+
18+
### About alerts from {{ site.data.variables.product.prodname_code_scanning }}
19+
20+
You can set up {{ site.data.variables.product.prodname_code_scanning }} to check the code in a repository using the default {{ site.data.variables.product.prodname_codeql }} analysis, a third-party analysis, or multiple types of analysis. When the analysis is complete, the resulting alerts are displayed alongside each other in the security view of the repository. Results from third-party tools or from custom queries may not include all of the properties that you see for alerts detected by {{ site.data.variables.product.company_short }}'s default {{ site.data.variables.product.prodname_codeql }} analysis. For more information, see "[Enabling {{ site.data.variables.product.prodname_code_scanning }} for a repository](/github/finding-security-vulnerabilities-and-errors-in-your-code/enabling-code-scanning-for-a-repository)."
21+
22+
By default, {{ site.data.variables.product.prodname_code_scanning }} analyzes your code periodically on the default branch and during pull requests. For information about managing alerts on a pull request, see "[Triaging {{ site.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)."
23+
24+
### About alerts details
25+
26+
Each alert highlights a problem with the code and the name of the tool that identified it. You can see the line of code that triggered the alert, as well as properties of the alert, such as the severity and the nature of the problem. Alerts also tell you when the issue was first introduced. For alerts identified by {{ site.data.variables.product.prodname_codeql }} analysis, you will also see information on how to fix the problem.
27+
28+
![Example alert from {{ site.data.variables.product.prodname_code_scanning }}](/assets/images/help/repository/code-scanning-alert.png)
29+
30+
If you enable {{ site.data.variables.product.prodname_code_scanning }} using {{ site.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.
31+
32+
When {{ site.data.variables.product.prodname_code_scanning }} reports data-flow alerts, {{ site.data.variables.product.prodname_dotcom }} shows you how data moves through the code. {{ site.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.
33+
34+
### Viewing an alert
35+
36+
Anyone with read permission for a repository can see {{ site.data.variables.product.prodname_code_scanning }} alerts on pull requests. However, you need write permission to view a summary of alerts for repository on the **Security** tab. By default, alerts are shown for the default branch.
37+
38+
{{ site.data.reusables.repositories.navigate-to-repo }}
39+
{{ site.data.reusables.repositories.sidebar-security }}
40+
{{ site.data.reusables.repositories.sidebar-code-scanning-alerts }}
41+
{{ site.data.reusables.code-scanning.click-alert-in-list }}
42+
5. Optionally, if the alert highlights a problem with data flow, click **Show paths** to display the path from the data source to the sink where it's used.
43+
![Example data-flow alert](/assets/images/help/repository/code-scanning-show-paths.png)
44+
45+
### Fixing an alert
46+
47+
Anyone with write permission for a repository can fix an alert by committing a correction to the code. If the repository has {{ site.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 {{ site.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 {{ site.data.variables.product.prodname_code_scanning }}](/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning)" and "[Triaging {{ site.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)."
48+
49+
### Closing an alert
50+
51+
Closing an alert is a way to resolve an alert that you don't think needs to be fixed. {{ site.data.reusables.code-scanning.close-alert-examples }}
52+
53+
{{ site.data.reusables.repositories.navigate-to-repo }}
54+
{{ site.data.reusables.repositories.sidebar-security }}
55+
{{ site.data.reusables.repositories.sidebar-code-scanning-alerts }}
56+
{{ site.data.reusables.code-scanning.click-alert-in-list }}
57+
5. Select the Close drop-down menu and click a reason for closing the alert.
58+
![Choosing reason for closing the alert via the Close drop-down](/assets/images/help/repository/code-scanning-alert-close-drop-down.png)
59+
60+
{{ site.data.reusables.code-scanning.false-positive-fix-codeql }}
61+
62+
### Further reading
63+
64+
- "[Triaging {{ site.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)"
65+
- "[Enabling {{ site.data.variables.product.prodname_code_scanning }} for a repository](/github/finding-security-vulnerabilities-and-errors-in-your-code/enabling-code-scanning-for-a-repository)"
66+
- "[About integration with {{ site.data.variables.product.prodname_code_scanning }}](/github/finding-security-vulnerabilities-and-errors-in-your-code/about-integration-with-code-scanning)"

0 commit comments

Comments
 (0)