Skip to content

Commit 1f5466f

Browse files
committed
Updated code scanning
1 parent 1399ffb commit 1f5466f

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

content/guided-workshop/exercises/1-code-scanning.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ Security is important in every application. By detecting potential vulnerabiliti
1616

1717
## Dependabot
1818

19-
Most projects take dependencies on open source and other external libraries. While modern development would seemingly be impossible without these resources, we always need to ensure the dependencies we take are secure. [Dependabot](https://docs.github.com/en/code-security/getting-started/dependabot-quickstart-guide) will look at the dependencies your repository has and raise alerts or even create [pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) to update your dependencies to a secure version.
19+
Most projects take dependencies on open source and other external libraries. While modern development would seemingly be impossible without these resources, we always need to ensure the dependencies we take are secure. [Dependabot](https://docs.github.com/en/code-security/getting-started/dependabot-quickstart-guide) will look at the dependencies your repository has and raise alerts or even create [pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) (PRs) to update your dependencies to a secure version.
2020

2121
### Configuring Dependabot
2222

23-
Let's enable Dependabot for your repository. We'll setup alerts to be raised for potential insecure libraries and have pull requests automatically created when an insecure version is detected.
23+
Public repositories on GitHub automatically have Dependabot alerts. This feature will generate alerts whenever an insecure package is detected, and generate an alert. Let's configure Dependabot to create PRs to update a library's version when an insecure one is detected.
2424

2525
1. Navigate to the repository you created for this workshop.
26-
2. Select the **Security** tab.
27-
3. Select **Enable Dependabot alerts**.
28-
4. Next to **Dependabot alerts**, select **Enable**.
29-
5. Next to **Dependabot security updates**, select **Enable**.
26+
1. Select the **Settings** tab.
27+
1. On the left side, select **Code security and analysis**.
28+
1. Locate the **Dependabot** section towards the middle of the page:
29+
30+
![Screenshot of the dependabot section](./images/1-dependabot.png)
31+
32+
1. Select **Enable** next to **Dependabot security updates** to configure Dependabot to create PRs to resolve alerts.
3033

3134
You have now enabled Dependabot alerts and security updates! Should an insecure library be detected, you will both receive an alert, and Dependabot will create a new pull request to update the version number to a secure version of the library.
3235

@@ -40,11 +43,11 @@ Regardless of the reason, even seemingly innocuous tokens can create a security
4043

4144
Let's enable Secret scanning to detect any potential keys.
4245

43-
1. Navigate to the repository you created for this workshop.
44-
2. Select the **Security** tab.
45-
3. In the **Secret scanning alerts** section, select **Enable in settings**.
46-
4. All the way at the bottom, in the **Secret scanning** section, select **Enable**.
47-
5. Next to **Push protection, select **Enable**.
46+
1. On the same page (**Settings** > **Code security and analysis**), towards the very bottom, locate the **Secret scanning** section.
47+
1. Next to **Receive alerts on GitHub for detected secrets, keys or other tokens**, select **Enable**.
48+
1. Next to **Push protection**, select **Enable** to block pushes to the repository which contain a [supported secret](https://docs.github.com/en/code-security/secret-scanning/secret-scanning-patterns#supported-secrets).
49+
50+
![Screenshot of fully configured secret scanning](./images/1-secret-scanning.png)
4851

4952
You've now enabled secret scanning and push protection. This helps you both block keys from being pushed to your repository and quickly detect when a key has been added to your source code.
5053

@@ -58,17 +61,20 @@ There is a direct relationship between the amount of code an organization create
5861

5962
Let's enable Code scanning to detect vulnerabilities in our source code.
6063

61-
1. Navigate to the repository you created for this workshop.
62-
2. Select the **Security** tab.
63-
3. Select **Setup code scanning**.
64-
4. Under **Code scanning**, in the **Tools** section, select **Set up** > **Default**.
65-
5. On the dialog box, select **Enable CodeQL**.
64+
1. On the same page (**Settings** > **Code security and analysis**), towards the very bottom, locate the **Code scanning** section.
65+
1. Next to **CodeQL analysis**, select **Set up** > **Default**.
66+
67+
![Screenshot of code scanning dropdown menu](./images/1-code-scanning.png)
68+
69+
1. On the **CodeQL default configuration** dialog, select **Enable CodeQL**.
70+
71+
![Screenshot of code scanning dialog](./images/1-code-scanning.png)
6672

67-
You have now enabled code scanning for your repository!
73+
A background process starts, and will configure a workflow for analyzing your code using [CodeQL and code scanning](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning).
6874

6975
## Summary and next steps
7076

71-
Throughout the course of these exercises you enabled GitHub Advanced Security. You enabled Dependabot to check the libraries your project takes dependencies on, secret scanning to look for keys and tokens, and code scanning to examine your source code. These tools help ensure your application is secure. Next it's time to [file an issue](2-issues.md) to add feature requests.
77+
In this exercise, you enabled GitHub Advanced Security. You enabled Dependabot to check the libraries your project takes dependencies on, secret scanning to look for keys and tokens, and code scanning to examine your source code. These tools help ensure your application is secure. Next it's time to [file an issue](2-issues.md) to add feature requests.
7278

7379
### Additional resources
7480

58.9 KB
Loading
79.1 KB
Loading
92.5 KB
Loading
34.5 KB
Loading

0 commit comments

Comments
 (0)