Skip to content

Commit 7de0233

Browse files
mchammer01Copilotlecoursen
authored
Code scanning alerts link to GitHub issues to facilitate collaboration and work management [Public Preview] (#60609)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Laura Coursen <lecoursen@github.com>
1 parent 06f5b58 commit 7de0233

File tree

11 files changed

+128
-1
lines changed

11 files changed

+128
-1
lines changed

content/code-security/concepts/code-scanning/about-code-scanning-alerts.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ If you configure {% data variables.product.prodname_code_scanning %} using {% da
6868

6969
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_caps %} 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.
7070

71+
{% data reusables.code-scanning.track-alert-in-issue %}
72+
7173
### About alerts from multiple configurations
7274

7375
You can run multiple configurations of code analysis on a repository, using different tools and targeting different languages or areas of the code. Each configuration of {% data variables.product.prodname_code_scanning %} generates a unique set of alerts. For example, an alert generated using the default {% data variables.product.prodname_codeql %} analysis with {% data variables.product.prodname_actions %} comes from a different configuration than an alert generated externally and uploaded via the {% data variables.product.prodname_code_scanning %} API.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Code scanning alert tracking using issues
3+
shortTitle: Alert tracking with issues
4+
intro: Connect security findings to your team's workflow by linking {% data variables.product.prodname_code_scanning %} alerts to issues for tracking and collaboration.
5+
permissions: People with write access for the repository can link {% data variables.product.prodname_code_scanning %} alerts to issues.
6+
versions:
7+
feature: code-scanning-link-alert-to-issue
8+
contentType: concepts
9+
category:
10+
- Find and fix code vulnerabilities
11+
---
12+
13+
{% data reusables.code-scanning.alert-tracking-with-issues-preview-note %}
14+
15+
{% data reusables.code-scanning.enterprise-enable-code-scanning %}
16+
17+
## How alert-to-issue linking works
18+
19+
When {% data variables.product.prodname_code_scanning %} identifies a vulnerability in your code, you can link the alert to a {% data variables.product.prodname_dotcom %} **issue** to track remediation work. This brings security fixes into your existing planning and project management workflow, making vulnerabilities visible in sprint planning, project boards, and team backlogs.
20+
21+
Each alert can link to a single issue, while each issue can track up to 50 different alerts. This flexibility lets you group related vulnerabilities or track them individually, depending on your team's workflow.
22+
23+
You can link alerts to issues in any repository where you have access and {% data variables.product.prodname_github_issues %} is enabled, not just the repository where the alert was found. This is useful when you track work in a central repository or use a separate issue tracker for security fixes.
24+
25+
## Understanding synchronization behavior
26+
27+
**Alert and issue statuses are not automatically synchronized.** Changes you make to an alert do not update the linked issue, and vice versa. This means:
28+
29+
* When you fix the vulnerability and the alert automatically closes, the linked issue remains open until you manually close it.
30+
* When you close or reopen an issue, the alert status stays unchanged.
31+
* When you delete an issue, the link is removed from the alert page and alert list, but the alert itself remains open.
32+
33+
## Best practices for managing linked alerts and issues
34+
35+
**Track remediation progress clearly.** When you commit a fix, add a comment to the linked issue noting that the code is updated. After the next {% data variables.product.prodname_code_scanning %} run confirms the alert is closed, manually close the issue.
36+
37+
**Use labels to show status.** Create issue labels like "code-fixed-awaiting-scan" or use project fields to indicate when a vulnerability is fixed but the issue is waiting for final verification and closure.
38+
39+
**Assign responsibility.** Use issue assignees to make it clear who owns the remediation work, especially when security and development teams need to coordinate.

content/code-security/concepts/code-scanning/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ children:
1717
- /setup-types
1818
- /about-integration-with-code-scanning
1919
- /sarif-files
20+
- /code-scanning-alert-tracking-using-issues
2021
- /merge-protection
2122
- /multi-repository-variant-analysis
2223
- /codeql

content/code-security/how-tos/manage-security-alerts/manage-code-scanning-alerts/assessing-code-scanning-alerts-for-your-repository.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ By default, the {% data variables.product.prodname_code_scanning %} alerts page
2525
{% data reusables.repositories.navigate-to-repo %}
2626
{% data reusables.repositories.sidebar-security %}
2727
{% data reusables.repositories.sidebar-code-scanning-alerts %}
28-
1. Optionally, use the free text search box or the dropdown menus to filter alerts. For example, you can filter by the tool that was used to identify alerts.
28+
1. Optionally, use the free text search box or the dropdown menus to filter alerts. For example, you can filter by the tool that was used to identify alerts.{% ifversion code-scanning-link-alert-to-issue %} Linked {% data variables.product.prodname_dotcom %} issues appear alongside their corresponding alerts in the list view.{% endif %}
2929

3030
![Screenshot of {% data variables.product.prodname_code_scanning %} alerts page. The search box and filter dropdown menus are outlined in dark orange.](/assets/images/help/repository/filter-code-scanning-alerts.png)
3131

content/code-security/how-tos/manage-security-alerts/manage-code-scanning-alerts/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ redirect_from:
1212
children:
1313
- assessing-code-scanning-alerts-for-your-repository
1414
- triaging-code-scanning-alerts-in-pull-requests
15+
- linking-code-scanning-alerts-to-github-issues
1516
- resolving-code-scanning-alerts
1617
- enabling-delegated-alert-dismissal-for-code-scanning
1718
- disabling-autofix-for-code-scanning
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: Linking code scanning alerts to GitHub issues
3+
shortTitle: Track alerts in issues
4+
intro: Create or connect {% data variables.product.github %} issues to {% data variables.product.prodname_code_scanning %} alerts to track security fixes in your team's workflow.
5+
permissions: People with write access for the repository can link {% data variables.product.prodname_code_scanning %} alerts to issues.
6+
versions:
7+
feature: code-scanning-link-alert-to-issue
8+
contentType: how-tos
9+
category:
10+
- Find and fix code vulnerabilities
11+
---
12+
13+
{% data reusables.code-scanning.alert-tracking-with-issues-preview-note %}
14+
15+
{% data reusables.code-scanning.enterprise-enable-code-scanning %}
16+
17+
When {% data variables.product.prodname_code_scanning %} identifies a vulnerability, you can link it to a new or existing {% data variables.product.github %} issue. This makes security fixes visible in your planning and project boards alongside your team's regular development work. For more information about how alert tracking works, see [AUTOTITLE](/code-security/concepts/code-scanning/code-scanning-alert-tracking-using-issues).
18+
19+
## Creating an issue from an alert
20+
21+
Create a new issue directly from a {% data variables.product.prodname_code_scanning %} alert, pre-populated with vulnerability details.
22+
23+
{% data reusables.repositories.navigate-to-repo %}
24+
{% data reusables.repositories.sidebar-security %}
25+
{% data reusables.repositories.sidebar-code-scanning-alerts %}
26+
{% data reusables.code-scanning.explore-alert %}
27+
1. On the right of the alert page, click **Tracking**.
28+
1. From the dropdown list, select **Create issue**.
29+
* Select the repository to create the issue in.
30+
* If applicable, select the template to use for your new issue.
31+
1. Fill in the issue, providing as much detail as possible.
32+
1. Optionally, assign the issue to a team member, add labels, or add it to a project.
33+
1. Click **Create**.
34+
35+
The newly created issue automatically links to the alert. View it by clicking the issue icon below the alert name.
36+
37+
## Linking an alert to an existing issue
38+
39+
Connect an existing issue to a {% data variables.product.prodname_code_scanning %} alert.
40+
41+
{% data reusables.repositories.navigate-to-repo %}
42+
{% data reusables.repositories.sidebar-security %}
43+
{% data reusables.repositories.sidebar-code-scanning-alerts %}
44+
{% data reusables.code-scanning.explore-alert %}
45+
1. On the right of the alert page, click **Tracking**.
46+
1. From the dropdown list, select **Add existing {% data variables.product.github %} issue**.
47+
1. Search by issue number or title, or select a different repository by clicking the Back icon.
48+
1. Click the issue you want to link.
49+
50+
You can link to issues in different repositories, as long as you have access and {% data variables.product.prodname_github_issues %} is enabled.
51+
52+
## Viewing linked issues
53+
54+
Once you link an issue to an alert, you can view the linked issue in two places:
55+
56+
* **On the alert detail page**: Click the issue icon below the alert name to navigate to the full issue details.
57+
* **In the list of {% data variables.product.prodname_code_scanning %} alerts**: Linked issues appear alongside their corresponding alerts in the main alerts list view.
58+
59+
## Changing or unlinking a linked issue
60+
61+
{% data reusables.repositories.navigate-to-repo %}
62+
{% data reusables.repositories.sidebar-security %}
63+
{% data reusables.repositories.sidebar-code-scanning-alerts %}
64+
{% data reusables.code-scanning.explore-alert %}
65+
1. On the right of the alert page, click **Tracking**.
66+
1. Click **Change or remove issue**.
67+
68+
When you unlink an issue from an alert, the link is removed from the alert page and alert list. The issue itself remains unchanged.

content/code-security/how-tos/manage-security-alerts/manage-code-scanning-alerts/resolving-code-scanning-alerts.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ Within 30 seconds, {% data variables.product.prodname_copilot_short %} will open
8080

8181
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 [AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/triaging-code-scanning-alerts-in-pull-requests).
8282

83+
{% data reusables.code-scanning.track-alert-in-issue %}
84+
8385
You can use the free text search or the filters to display a subset of alerts and then in turn mark all matching alerts as closed.
8486

8587
Alerts may be fixed in one branch but not in another. You can use the "branch" filter, on the summary of alerts, to check whether an alert is fixed in a particular branch.

content/code-security/how-tos/manage-security-alerts/manage-code-scanning-alerts/triaging-code-scanning-alerts-in-pull-requests.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ You can comment on any {% data variables.product.prodname_code_scanning %} alert
7171

7272
You can choose to require all conversations in a pull request, including those on {% data variables.product.prodname_code_scanning %} alerts, to be resolved before a pull request can be merged. For more information, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-conversation-resolution-before-merging).
7373

74+
{% data reusables.code-scanning.track-alert-in-issue %}
75+
7476
## Fixing an alert on your pull request
7577

7678
Anyone with push access to a pull request can fix a {% data variables.product.prodname_code_scanning %} alert that's identified on that 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.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Reference: #20489 - Code scanning alerts link to GitHub issues to facilitate collaboration and work management
2+
versions:
3+
fpt: '*'
4+
ghec: '*'
5+
ghes: '>3.21'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> [!NOTE]
2+
> {% data variables.product.prodname_code_scanning_caps %} alert tracking using {% data variables.product.github %} issues is currently in {% data variables.release-phases.public_preview %} and subject to change.

0 commit comments

Comments
 (0)