Skip to content

Commit bfc480f

Browse files
am-steadmchammer01
andauthored
Security campaigns with Copilot Autofix [GA] #16444 (#55094)
Co-authored-by: mc <[email protected]>
1 parent 110f7c0 commit bfc480f

17 files changed

+351
-185
lines changed
173 KB
Loading
311 KB
Loading
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
title: Best practices for participating in a security campaign
3+
shortTitle: Best practices for campaigns
4+
intro: 'Learn how you can successfully take part in a security campaign and how it can benefit your career as well as your code.'
5+
allowTitleToDifferFromFilename: true
6+
permissions: '{% data reusables.permissions.code-scanning-all-alerts %}'
7+
product: '{% data reusables.gated-features.security-campaigns %}'
8+
type: how_to
9+
versions:
10+
feature: security-campaigns
11+
topics:
12+
- Code Security
13+
- Code scanning
14+
- Alerts
15+
- Repositories
16+
---
17+
18+
## What is a security campaign
19+
20+
A security campaign is a group of security alerts, detected in the default branches of repositories, chosen by an organization owner or security manager for remediation.
21+
22+
You can take part in a security campaign by fixing one or more of the alerts included in the campaign.
23+
24+
## What are the benefits of participating in a campaign
25+
26+
In addition to the benefit of removing an important security problem from your organization's codebase, alerts in a security campaign have several other benefits compared with fixing another alert in your repository.
27+
28+
* You have a campaign manager on the security team to collaborate with and a specific contact link for discussing campaign activities.
29+
* You know that you are fixing a security alert that is important to the company.
30+
* Potentially, you may have access to targeted training materials.{% ifversion security-campaigns-autofix %}
31+
* You don't need to request a {% data variables.product.prodname_copilot_autofix %} suggestion, it is already available as a starting point.{% endif %}{% ifversion copilot %}
32+
* If you have access to {% data variables.product.prodname_copilot_chat %}, you can ask questions about the alert and the suggested fix.{% endif %}
33+
* You are improving and demonstrating your knowledge of secure coding.
34+
35+
Adopting a few key best practices can help you participate successfully in a campaign.
36+
37+
## Stay informed
38+
39+
### Notification settings
40+
41+
To receive email updates about security campaigns in repositories you have write access to, make sure that you:
42+
43+
* **Watch** all repositories that you have write access to.
44+
* **Subscribe** to notifications for "All activity" or "Security alerts".
45+
46+
### View campaign details
47+
48+
When you open the **Security** tab for a repository with one or more campaign alerts, you can see the campaign name in the sidebar of the view. Click the campaign name to see the list of alerts included in the campaign and summary information on how the campaign is progressing.
49+
50+
### Campaign-generated {% data variables.product.prodname_github_issues %}
51+
52+
Some campaigns automatically create {% data variables.product.prodname_github_issues %} for each repository which details the campaign managers, contact URL, and due date.
53+
54+
You can use this issue to plan and track campaign work as part of your usual workflows, such as:
55+
56+
* Adding the issue to project boards
57+
* Adding assignees
58+
* Creating sub-issues or tasklists
59+
60+
## Seek context
61+
62+
Your security team may provide you with specific training ahead of participating in a campaign, so that you feel equipped to address the alerts included in the campaign.
63+
64+
If no formal training program is available, you can request that the campaign manager shares information on:
65+
66+
* Types of security vulnerabilities included in the campaign
67+
* Examples of how to fix them
68+
* How to test the fixes
69+
70+
In addition, there are external resources for understanding common security issues:
71+
72+
* The **OWASP Foundation** provides many resources for learning about the most common vulnerabilities, see [About the OWASP Foundation](https://owasp.org/about/).
73+
* The **MITRE Corporation** maintains a detailed list of common weaknesses, see [About CWE](https://cwe.mitre.org/about/index.html).
74+
75+
## Group similar alerts
76+
77+
When fixing security alerts as part of a campaign, it may be helpful to group and fix similar alerts together. By doing so, you can develop a deeper understanding of the underlying issue. As you gain confidence and efficiency in resolving a specific type of alert, it makes it easier and faster for you to resolve subsequent alerts.
78+
79+
{% ifversion copilot %}
80+
81+
## Leverage {% data variables.product.prodname_copilot_short %}
82+
83+
{% ifversion code-scanning-autofix %}
84+
85+
### {% data variables.product.prodname_copilot_autofix_short %}
86+
87+
{% data variables.product.prodname_copilot_autofix_short %} is automatically triggered for alerts that are included in a campaign, meaning that where possible, fixes are automatically generated for you. You can commit the suggested fix to resolve the alert and then verify that continuous integration testing (CI) for the codebase is still passing. See [AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/fixing-alerts-in-security-campaign).
88+
89+
### {% data variables.product.prodname_copilot_chat_short %}
90+
91+
{% endif %}
92+
93+
You can ask {% data variables.product.prodname_copilot_chat_short %} for help in understanding the vulnerability, the suggested fix, and how to test that the fix is comprehensive. To access {% data variables.product.prodname_copilot_chat_short %}, navigate to https://github.com/copilot.
94+
95+
Alternatively, when viewing a specific alert, in the top right corner of the page, click the {% data variables.product.prodname_copilot_chat_short %} icon ({% octicon "copilot" aria-hidden="true" %}) to open a chat window, and ask {% data variables.product.prodname_copilot_short %} questions about the alert.
96+
97+
For example:
98+
99+
```text copy
100+
101+
Explain how this alert introduces a vulnerability into the code.
102+
103+
```
104+
105+
If you don't already have access to {% data variables.product.prodname_copilot_chat_short %} through your organization{% ifversion ghec %} or enterprise{% endif %}, you can sign up to {% data variables.product.prodname_copilot_free %}. For more information, see [AUTOTITLE](/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/managing-copilot-free/accessing-github-copilot-free).
106+
107+
{% endif %}
108+
109+
## Ask questions
110+
111+
A security campaign will generally include a contact URL, which might link you to the campaign manager, an open forum (such as a {% data variables.product.github %} Discussion), or a website of resources. You should use this space to ask questions about the campaign or specific alerts, find useful resources, and share knowledge.
112+
113+
To find the contact URL:
114+
115+
1. Open the **Security** tab for your repository.
116+
1. On the left sidebar, click the name of the campaign you are participating in.
117+
1. On the campaign tracking page, to the right of the campaign manager's name, click **{% octicon "comment" aria-hidden="true" %}**.
118+
119+
## Next steps
120+
121+
* [AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/fixing-alerts-in-security-campaign)

content/code-security/code-scanning/managing-code-scanning-alerts/fixing-alerts-in-security-campaign.md

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Fixing alerts in a security campaign
33
shortTitle: Fix alerts in campaign
4-
intro: 'Learn how you can take part in a security campaign and how it can benefit your career as well as your code.'
4+
intro: 'Learn how to find and fix alerts in a security campaign.'
55
allowTitleToDifferFromFilename: true
66
permissions: '{% data reusables.permissions.code-scanning-all-alerts %}'
77
product: '{% data reusables.gated-features.security-campaigns %}'
@@ -14,32 +14,14 @@ topics:
1414
- Alerts
1515
- Repositories
1616
---
17-
{% data reusables.security-campaigns.preview-note %}
18-
19-
## What is a security campaign
20-
21-
A security campaign is a group of security alerts, detected in the default branches of repositories, chosen by an organization owner or security manager for remediation. When a security campaign is created with alerts in repositories that you have write access to, you are notified if you subscribe to email notifications for "All activity" or "Security alerts". In addition, when you open the **Security** tab for a repository with one or more campaign alerts, you can see the campaign name in the sidebar of the view.
22-
23-
You can take part in a security campaign by fixing one or more of the alerts chosen for the campaign.
24-
25-
## What are the benefits of fixing alerts in a campaign
26-
27-
In addition to the benefit of removing an important security problem from your code, alerts in a security campaign have several other benefits compared with fixing another alert in your repository.
28-
29-
* You have a campaign manager on the security team to collaborate with and a specific contact link for discussing campaign activities.
30-
* You know that you are fixing a security alert that is important to the company.
31-
* Potentially, you may have access to targeted training materials.{% ifversion security-campaigns-autofix %}
32-
* You don't need to request a {% data variables.product.prodname_copilot_autofix %} suggestion, it is already available as a starting point.{% endif %}{% ifversion copilot %}
33-
* If you have access to {% data variables.product.prodname_copilot_chat %}, you can ask questions about the alert and the suggested fix.{% endif %}
34-
* You are improving and demonstrating your knowledge of secure coding.
3517

3618
## Viewing alerts in a security campaign
3719

3820
When a campaign targets security alerts in a repository that you have write access to, you can navigate to the list of repository alerts in the campaign.
3921

40-
* Display the **Security** tab for the repository and click one of the campaigns under the "Campaigns" title in the sidebar.
22+
* Display the **Security** tab for the repository and click one of the campaigns under "Campaigns" in the sidebar.
4123
* If you have enabled email notifications for "All activity" or "Security alerts" in the repository, click **View security campaign** in the campaign email.
42-
* If you have write access to more than one repository in the organization, display the **Security** tab for the organization and click one of the campaigns under the "Campaigns" title in the sidebar.
24+
* If you have write access to more than one repository in the organization, display the **Security** tab for the organization and click one of the campaigns under "Campaigns" in the sidebar.
4325

4426
This view shows the alerts in the current repository for a campaign called "SQL injection (CWE-89)" (highlighted gray) that is managed by "octocat" (outlined in dark orange).
4527

@@ -69,10 +51,6 @@ If you want to see the code that triggered the security alert and the suggested
6951

7052
If you have access to {% data variables.product.prodname_copilot_chat_short %} then you can ask the AI questions about the vulnerability, the suggested fix, and how to test that the fix is comprehensive.
7153

72-
To get the most out of {% data variables.product.prodname_copilot_chat_short %} when you're working with alerts, you should explicitly ask {% data variables.product.prodname_copilot_chat_short %} to use the {% data variables.product.prodname_GH_advanced_security %} skill to answer your questions.
73-
74-
For example: "Use the {% data variables.product.prodname_GH_advanced_security %} skill to explain how this alert introduces a vulnerability into the code."
75-
7654
> [!TIP]
7755
> {% data reusables.copilot.semantic-index-info %}
7856

content/code-security/code-scanning/managing-code-scanning-alerts/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ children:
1717
- /disabling-autofix-for-code-scanning
1818
- /assessing-code-scanning-alerts-for-your-repository
1919
- /resolving-code-scanning-alerts
20+
- /best-practices-for-participating-in-a-security-campaign
2021
- /fixing-alerts-in-security-campaign
2122
- /triaging-code-scanning-alerts-in-pull-requests
2223
- /tracking-code-scanning-alerts-in-issues-using-task-lists

content/code-security/securing-your-organization/fixing-security-alerts-at-scale/about-security-campaigns.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ topics:
1515

1616
Once you have identified security alerts in the default branches of your repositories, the next step is to identify the most urgent alerts and get them fixed. Security campaigns are a way to group alerts and share them with developers, so you can collaborate to remediate vulnerabilities in the code.
1717

18-
{% data reusables.security-campaigns.preview-note %}
19-
2018
## Security campaigns in your day-to-day work
2119

2220
You can use security campaigns to support many of your aims as a security leader.
@@ -30,14 +28,16 @@ You can use security campaigns to support many of your aims as a security leader
3028

3129
A security campaign has many benefits over other ways of encouraging developers to remediate security alerts. In particular,
3230

33-
* Developers are notified about any security campaigns taking place in repositories they work in or subscribe to (by email during the {% data variables.release-phases.public_preview %}).
31+
* Developers are notified about any security campaigns taking place in repositories they work in or subscribe to by email.
3432
* Developers can see the alerts you've highlighted for remediation without leaving their normal workflows.
3533
* Each campaign has a named point of contact for questions, reviews, and collaboration. {% ifversion security-campaigns-autofix %}
3634
* {% data variables.product.prodname_copilot_autofix %} is automatically triggered to suggest a resolution for each security alert. {% endif %}
3735

38-
In addition, you can use one of the templates to select a group of closely related alerts for a campaign. This allows developers to build on the knowledge gained by resolving one alert and use it to fix several more, providing them with an incentive to fix multiple alerts.
36+
You can use one of the templates to select a group of closely related alerts for a campaign. This allows developers to build on the knowledge gained by resolving one alert and use it to fix several more, providing them with an incentive to fix multiple alerts.
37+
38+
{% data reusables.code-scanning.campaigns-api %}
3939

4040
## Next steps
4141

4242
* [AUTOTITLE](/code-security/securing-your-organization/fixing-security-alerts-at-scale/best-practice-fix-alerts-at-scale)
43-
* [AUTOTITLE](/code-security/securing-your-organization/fixing-security-alerts-at-scale/creating-tracking-security-campaigns)
43+
* [AUTOTITLE](/code-security/securing-your-organization/fixing-security-alerts-at-scale/creating-managing-security-campaigns)

content/code-security/securing-your-organization/fixing-security-alerts-at-scale/best-practice-fix-alerts-at-scale.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ topics:
1212
- Organizations
1313
- Security
1414
---
15-
{% data reusables.security-campaigns.preview-note %}
1615

1716
## Elements of a successful security campaign
1817

@@ -47,6 +46,10 @@ For example, if you have many alerts for cross-site scripting vulnerabilities, y
4746

4847
When you select alerts to include in a security campaign, you can use any of the filters on the security alerts page to define a subset of alerts. Alternatively, you can choose a campaign template to use one of the pre-defined filters for common needs, for example: "Cross-site scripting (CWE-79)."
4948

49+
### Draft campaigns
50+
51+
It can be useful to create a draft campaign first, which lists the alerts that are set to be included in the campaign and the campaign details, so that you can collaborate on the scope of the campaign prior to publishing it. For guidance on creating a draft campaign, see [AUTOTITLE](/code-security/securing-your-organization/fixing-security-alerts-at-scale/creating-managing-security-campaigns#create-a-campaign).
52+
5053
### Limitations on security campaigns
5154

5255
The following limitations are intended to encourage you to take a balanced and measured approach to remediating alerts in your code. An iterative approach, addressing a few targeted sets of alerts at a time, is likely to lead to a sustainable and long-term change in security posture.
@@ -66,6 +69,12 @@ The names of the campaign managers are visible to developers when they take part
6669

6770
If you want to increase the remediation rate for alerts and scale the knowledge of the security team, this is a key opportunity to build collaborative relationships with developers. Ideally, the campaign managers are available to answer questions and collaborate on difficult fixes via the contact link. Campaign managers should also be available to review pull requests for fixes over the whole course of the campaign.
6871

72+
## Creating issues for a campaign
73+
74+
When you create a campaign, you can choose to automatically open a {% data variables.product.github %} Issue in every repository involved in the campaign. This means that the work can be much more easily tracked, assigned, and managed on team project boards. What's more, when you update the details of the campaign, such as the contact link or due date, the issue body gets automatically updated with the latest information. When a campaign reaches its due date, or gets deleted or closed, a comment is automatically posted on the issue.
75+
76+
This can aid developer engagement by providing clear, up-to-date context directly within developers' existing workflows. For information on how to automate issue creation for campaigns, see [AUTOTITLE](/code-security/securing-your-organization/fixing-security-alerts-at-scale/creating-managing-security-campaigns#create-a-campaign).
77+
6978
## Combining security training with a security campaign
7079

7180
If your security team already provides training for developers on secure coding, creating a campaign with alerts chosen to allow developers to use the skills from the training session is a great way to reinforce their learning. Even if you don't have a formal training program, it makes sense to provide information on the types of security vulnerabilities included in the campaign, examples of how to fix them, and how to test the fixes. This will simplify the role of the campaign manager as they will be able to direct developers to these resources for answers to basic questions.
@@ -80,8 +89,6 @@ The OWASP Foundation provides many resources for learning about the most common
8089

8190
{% data variables.product.prodname_copilot %} is an important tool for developers who have questions about secure coding, how to fix security alerts, and test their fix. Check that all developers in your organization have access to {% data variables.product.prodname_copilot_short %} in both their IDE and {% data variables.product.github %}, see [AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization).
8291

83-
> [!TIP] The {% data variables.product.prodname_GH_advanced_security %} skill provides {% data variables.product.prodname_copilot_chat_short %} with additional context to answer questions about security alerts.
84-
8592
{% endif %}
8693

8794
## Considerations in starting a security campaign and defining a deadline
@@ -90,4 +97,4 @@ As with any other project, it's important to define realistic timescales to avoi
9097

9198
## Next steps
9299

93-
* [AUTOTITLE](/code-security/securing-your-organization/fixing-security-alerts-at-scale/creating-tracking-security-campaigns)
100+
* [AUTOTITLE](/code-security/securing-your-organization/fixing-security-alerts-at-scale/creating-managing-security-campaigns)

0 commit comments

Comments
 (0)