Skip to content

Commit e9fa904

Browse files
authored
feat: Draft migrate to issue-based flow
1 parent 352db82 commit e9fa904

16 files changed

+435
-561
lines changed

.github/steps/-step.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/steps/0-welcome.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/steps/1-enable-codeql.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,38 @@
1-
<!--
2-
<<< Author notes: Step 1 >>>
3-
Choose 3-5 steps for your course.
4-
The first step is always the hardest, so pick something easy!
5-
Link to docs.github.com for further explanations.
6-
Encourage users to open new tabs for steps!
7-
TBD-step-1-notes.
8-
-->
9-
101
## Step 1: Enable CodeQL
112

12-
👋 Hello! Welcome to the GitHub Skills course: Enable code scanning!
3+
In this first step, we'll be learning more about CodeQL and how to use it to secure your source code.
4+
5+
### What is GitHub code scanning?
136

14-
Let's get started!
7+
[Code scanning](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning) is a capability that allows development teams to integrate security testing tools into the software development process. This is done using GitHub Actions. With code scanning, you can integrate many different types of tools including SAST, container, and infrastructure as code security tools.
158

16-
In this first step, we'll be learning more about CodeQL and how to use it to secure your source code.
9+
### What is CodeQL?
1710

18-
**What is GitHub code scanning**: _[Code scanning](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning)_ is a capability that allows development teams to integrate security testing tools into the software development process. This is done using GitHub Actions. With code scanning, you can integrate many different types of tools including SAST, container, and infrastructure as code security tools.
11+
[CodeQL](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql) is a static analysis testing tool that helps you identify security weaknesses such as SQL injection, cross-site scripting, and code injection issues.
1912

20-
**What is CodeQL**: _[CodeQL](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql)_ is a static analysis testing tool that helps you identify security weaknesses such as SQL injection, cross-site scripting, and code injection issues.
13+
### ⌨️ Activity: Enable code scanning with CodeQL
2114

22-
### :keyboard: Activity: Enable code scanning with CodeQL
23-
2415
First, we will enable code scanning with CodeQL in our repository.
2516

2617
1. Open a new browser tab, and work on the steps in your second tab while you read the instructions in this tab.
27-
2. Navigate to the **Settings** tab at the top of your newly created repository.
28-
3. Under the **Security** section on the left side, select **Code security and analysis**.
29-
4. Scroll down to the section titled **Code scanning**. For the purpose of this course, we will focus on CodeQL analysis.
30-
5. Click on the **Set up** dropdown menu and choose **Default**.
31-
![enable-code-scanning-default.png](/images/enable-code-scanning-default.png)
32-
33-
Let's take a look at the configuration options in the modal:
34-
35-
- **Languages to analyze:** These are the languages that will be scanned by CodeQL. In this case, we will be scanning in `Python`.
36-
- **Query suites:** CodeQL [queries](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql#about-codeql-queries) are packaged in bundles called "suites". This section allows you to choose which query suite to use. We'll leave this set as **Default** for this exercise. For more information, see "[About CodeQL queries](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql#about-codeql-queries)."
37-
- **Events:** This section tells CodeQL when to scan. In this case, it's set to scan on any pull request to the `main` branch.
38-
39-
![codeql-default-configuration-box.png](/images/codeql-default-configuration-box.png)
40-
41-
6. Click **Enable CodeQL**
42-
7. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
18+
19+
1. Navigate to the **Settings** tab at the top of your newly created repository.
20+
21+
1. Under the **Security** section on the left side, select **Code security and analysis**.
22+
23+
1. Scroll down to the section titled **Code scanning**. For the purpose of this exercise, we will focus on CodeQL analysis.
24+
25+
1. Click on the **Set up** dropdown menu and choose **Default**.
26+
![enable-code-scanning-default.png](/images/enable-code-scanning-default.png)
27+
28+
Let's take a look at the configuration options in the modal:
29+
30+
- **Languages to analyze:** These are the languages that will be scanned by CodeQL. In this case, we will be scanning in `Python`.
31+
- **Query suites:** CodeQL [queries](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql#about-codeql-queries) are packaged in bundles called "suites". This section allows you to choose which query suite to use. We'll leave this set as **Default** for this exercise. For more information, see "[About CodeQL queries](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql#about-codeql-queries)."
32+
- **Events:** This section tells CodeQL when to scan. In this case, it's set to scan on any pull request to the `main` branch.
33+
34+
![codeql-default-configuration-box.png](/images/codeql-default-configuration-box.png)
35+
36+
1. Click **Enable CodeQL**
37+
38+
1. With CodeQL now enabled, Mona will check your progress and share the next steps.
Lines changed: 52 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,53 @@
1-
<!--
2-
<<< Author notes: Step 2 >>>
3-
Start this step by acknowledging the previous step.
4-
Define terms and link to docs.github.com.
5-
TBD-step-2-notes.
6-
-->
7-
81
## Step 2: Review and Triage CodeQL Alerts
92

10-
_Way to go! You got CodeQL running! :tada:_
3+
Now we will review the CodeQL scan results, triage an alert, and create a GitHub issue to track an alert.
4+
5+
### What is GitHub Actions
6+
7+
GitHub Actions is the automation and CI/CD platform within GitHub. We use GitHub Actions to orchestrate and execute security scans with code scanning. GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. For more information on GitHub Actions, see "[Understanding GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions)."
118

12-
In this exercise, we'll review the CodeQL scan results, triage an alert, and create a GitHub issue to track an alert.
9+
### What is CWE
1310

14-
**What is GitHub Actions**: GitHub Actions is the automation and CI/CD platform within GitHub. We use GitHub Actions to orchestrate and execute security scans with code scanning. GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. For more information on GitHub Actions, see "[Understanding GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions)."
11+
Common Weakness Enumeration (CWE) is a category system for hardware and software weaknesses and vulnerabilities. Think of it as a way to describe and categorize security issues in an application's source code. For more information on CWEs, see the Wikipedia article "[Common Weakness Enumeration](https://en.wikipedia.org/wiki/Common_Weakness_Enumeration)."
1512

16-
**What is CWE**: Common Weakness Enumeration (CWE) is a category system for hardware and software weaknesses and vulnerabilities. Think of it as a way to describe and categorize security issues in an application's source code. For more information on CWEs, see the Wikipedia article "[Common Weakness Enumeration](https://en.wikipedia.org/wiki/Common_Weakness_Enumeration)."
13+
### ⌨️ Activity: View the status of a CodeQL scan
1714

18-
### :keyboard: Activity 1: View the status of a CodeQL scan
15+
In this activity, we'll explore GitHub Actions to view the status of a CodeQL scan.
1916

20-
In this activity, we'll explore GitHub Actions to view the status of a CodeQL scan.
2117
1. In your new repository, go to your Actions page by selecting **Actions** from the top navigation bar. If the CodeQL Action run is still executing, you will see a yellow spinner indicating the scan is still in progress. This typically takes about 4 minutes to complete.
22-
2. Select the run by clicking on **CodeQL Setup**.
2318

24-
![codeql-setup](/images/codeql-setup.png)
19+
1. Select the run by clicking on **CodeQL Setup**.
20+
21+
![codeql-setup](/images/codeql-setup.png)
22+
23+
Notice that more information is available inside the Actions run. Feel free to explore this section to view information such as the CodeQL logs, duration, status, and artifacts generated by CodeQL.
2524

26-
Notice that more information is available inside the Actions run. Feel free to explore this section to view information such as the CodeQL logs, duration, status, and artifacts generated by CodeQL.
25+
Once the scan is complete, a green check will show next to the execution.
2726

28-
Once the scan is complete, a green check will show next to the execution.
29-
30-
### :keyboard: Activity 2: View all CodeQL Alerts
27+
### ⌨️ Activity: View all CodeQL Alerts
3128

32-
In this activity, we will view the CodeQL findings in the Security page of your repository. The Security page is where all security related information is displayed.
29+
In this activity, we will view the CodeQL findings in the Security page of your repository. The Security page is where all security related information is displayed.
3330

34-
1. Navigate to the **Security** tab in the top navigation bar of your repository.
35-
2. Select **Code scanning** under the "Vulnerability alerts" heading in left-side navigation bar.
31+
1. Navigate to the **Security** tab in the top navigation bar of your repository.
3632

37-
This screen will contain all the vulnerabilities identified by CodeQL inside this repository's codebase. Explore the different filters and search capabilities in this page. These filtering capabilities become very helpful when you're working with many findings!
33+
1. Select **Code scanning** under the "Vulnerability alerts" heading in left-side navigation bar.
3834

35+
This screen will contain all the vulnerabilities identified by CodeQL inside this repository's codebase. Explore the different filters and search capabilities in this page. These filtering capabilities become very helpful when you're working with many findings!
3936

40-
### :keyboard: Activity 3: Review an Alert
37+
### ⌨️ Activity 3: Review an Alert
4138

42-
In this activity, we will explore the alert UI. We'll review the data flow of the vulnerability, indentify what part of the code the alert impacts, and get more information about the alert.
39+
In this activity, we will explore the alert UI. We'll review the data flow of the vulnerability, identify what part of the code the alert impacts, and get more information about the alert.
4340

4441
**Alert status:** This section displays the current alert status (open or closed), identifies the branch where the scan detected the alert, and shows the timestamp of the alert.
45-
42+
4643
![alert-status](/images/alert-status.png)
4744

48-
**Location information:** This section describes which part of the code is vulnerable.
49-
45+
**Location information:** This section describes which part of the code is vulnerable.
46+
5047
![location-information](/images/location-information.png)
5148

52-
**Paths:** Clicking on "Show paths" will give you additional insights into the alert's data flow. The modal shows us where the user input (we call that a "source") flows through the application until it's acted on (we call this the "sink"). This visualizes the flow of data through your application.
53-
49+
**Paths:** Clicking on "Show paths" will give you additional insights into the alert's data flow. The modal shows us where the user input (we call that a "source") flows through the application until it's acted on (we call this the "sink"). This visualizes the flow of data through your application.
50+
5451
**Recommendations:** This section provides a quick overview of the tool (CodeQL in this case), Rule ID, and even allows you to view the CodeQL query used to find this vulnerability. You can view the query by clicking **View source**. Additionally, this pane includes recommendations for fixing this vulnerability. Click **Show more** to view the full recommendation.
5552

5653
![recommendations](/images/recommendations.png)
@@ -62,27 +59,38 @@ In this activity, we will explore the alert UI. We'll review the data flow of th
6259
**Alert triage:** Use the buttons at the top right of the alert to triage or create a new issue for the alert. Don't do anything yet. We'll get into these buttons in a moment. 😄
6360

6461
**Additional info:** Finally, the right-side panel contains information such as tags, CWE information, and the severity of the alert
65-
![additional-information.png](/images/additiona-information.png)
62+
![additional-information.png](/images/additiona-information.png)
6663

64+
### ⌨️ Activity: Dismiss an Alert
6765

68-
### :keyboard: Activity 4: Dismiss an Alert
6966
Now that we're familiar with the alert layout, let's work through the process of closing one.
7067

7168
1. Inside this same alert, click **Dismiss alert**, choose any reason for dismissal, and add a short note.
72-
2. Click **Dismiss alert**.
73-
3. At this point, the alert will change its state to "Dismissed". You can now see the change you made in the audit trail at the bottom of the alert.
74-
4. Navigate back to **Security** > **Code scanning alerts**. You'll see that you only have 1 alert listed.
75-
5. Click **1 Closed**. This will bring you to the closed alerts where you can view the alert you just closed.
69+
70+
1. Click **Dismiss alert**.
71+
72+
1. At this point, the alert will change its state to "Dismissed". You can now see the change you made in the audit trail at the bottom of the alert.
73+
74+
1. Navigate back to **Security** > **Code scanning alerts**. You'll see that you only have 1 alert listed.
75+
76+
1. Click **1 Closed**. This will bring you to the closed alerts where you can view the alert you just closed.
77+
7678
![one-closed-alert.png](/images/one-closed-alert.png)
7779

78-
7. (Optional) You can also reopen the alert by opening it, then selecting **Reopen alert**.
80+
1. (Optional) You can also reopen the alert by opening it, then selecting **Reopen alert**.
81+
82+
### ⌨️ Activity: Create a GitHub Issue for an Alert
7983

80-
### :keyboard: Activity 5: Create a GitHub Issue for an Alert
8184
This last step will show you how to create a GitHub Issue to track the work that goes into resolving a vulnerability. Issues provide a space for collaboration for a security problem and can be assigned to people or teams.
82-
85+
8386
1. Open one of the open alerts that CodeQL identified from the scan.
84-
2. Click the green **Create issue** button at the top right of the alert. If you don't see this button, check the status of the alert to make sure it's an open alert.
85-
3. Add any details you would like to include in the new issue form.
86-
4. Click **Submit new issue**.
87-
5. To view the your issue, click **Issues** in the top navigation bar of your repository.
88-
6. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
87+
88+
1. Click the green **Create issue** button at the top right of the alert. If you don't see this button, check the status of the alert to make sure it's an open alert.
89+
90+
1. Add any details you would like to include in the new issue form.
91+
92+
1. Click **Submit new issue**.
93+
94+
1. To view the your issue, click **Issues** in the top navigation bar of your repository.
95+
96+
1. With the new issue opened for managing the fix, Mona will check your progress and share the next steps.

0 commit comments

Comments
 (0)