You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/guided-workshop/exercises/1-code-scanning.md
+24-18Lines changed: 24 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,17 +16,20 @@ Security is important in every application. By detecting potential vulnerabiliti
16
16
17
17
## Dependabot
18
18
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.
20
20
21
21
### Configuring Dependabot
22
22
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.
24
24
25
25
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
+

31
+
32
+
1. Select **Enable** next to **Dependabot security updates** to configure Dependabot to create PRs to resolve alerts.
30
33
31
34
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.
32
35
@@ -40,11 +43,11 @@ Regardless of the reason, even seemingly innocuous tokens can create a security
40
43
41
44
Let's enable Secret scanning to detect any potential keys.
42
45
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
+

48
51
49
52
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.
50
53
@@ -58,17 +61,20 @@ There is a direct relationship between the amount of code an organization create
58
61
59
62
Let's enable Code scanning to detect vulnerabilities in our source code.
60
63
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
+

68
+
69
+
1. On the **CodeQL default configuration** dialog, select **Enable CodeQL**.
70
+
71
+

66
72
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).
68
74
69
75
## Summary and next steps
70
76
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.
0 commit comments