Skip to content

Commit 78998e7

Browse files
author
Admin-02 SecW01
authored
Merge pull request #4 from ghuwsec1953/josh-lab-updates
Josh lab updates
2 parents 690c34d + 69db2b2 commit 78998e7

File tree

9 files changed

+152
-114
lines changed

9 files changed

+152
-114
lines changed

_labs/images/lab-4-2-1.png

27.4 KB
Loading

_labs/images/lab-4-2-2.png

155 KB
Loading

_labs/images/lab-4-2-3.png

-206 KB
Binary file not shown.

_labs/images/lab-5-1-2.png

142 KB
Loading

_labs/lab1.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This lab covers parts of the following exam domains:
1212

1313
We need to provision our working copy of the repository in order to begin the labs!
1414

15-
1. Navigate to URL: [https://github.com/ghuwsec1953/juice-shop-ghas-workshop](https://github.com/ghuwsec1953/juice-shop-ghas-workshop)
15+
1. Navigate to URL: [https://github.com/ghuwsec1953/juice-shop-ghas-workshop](https://github.com/ghuwsec1953/juice-shop-ghas-workshop)
1616
2. Click on the **Use this template ▾** button and select **Create a new repository**.
1717
3. Make sure you have the **ghuwsec1953** organization selected as the **Owner**.
1818
4. Name the repository **YOUR_USERNAME-juice-shop-ghas-workshop**.
@@ -21,17 +21,24 @@ We need to provision our working copy of the repository in order to begin the la
2121

2222
Once the repository is created, you will be automatically redirected to it. Continue on to Exercise 2.
2323

24+
> [!TIP]
25+
> We recommend opening up two browser windows, one with the lab and one with the working copy of your repo!
26+
2427
## Exercise 2: Enabling the security settings
2528

2629
In this exercise, you will be guided through the process of enabling the remaining GHAS features. Then you will be shown how to use the features to secure your code.
2730

2831
### Exercise 2.1: Enable Dependabot
2932

33+
Although Dependabot isn't part of the GitHub Advanced Security product suite, it is still an important tool to discuss from an overall security posture.
34+
3035
1. We first want to turn on the security settings for the repository. Navigate to the **Settings** tab (the icon of the gear) in the repo.
3136
2. Click on the **Code security** section.
32-
3. Although Dependabot isn't part of the GitHub Advanced Security product suite, it is still an important tool to discuss from an overall security posture. To enable Dependabot, we first have to enable the Dependency Graph. If it's not already enabled, enable the **Dependency Graph**. This allows Dependabot to ingest your package manifest files.
37+
3. Click the **Enable** button next to the **Dependency Graph** setting. To enable Dependabot, we first have to enable the Dependency Graph. This allows Dependabot to ingest your package manifest files.
3338
4. Click the **Enable** button next to the **Dependabot alerts** setting. This feature will create alerts for vulnerable dependencies found in your repository.
34-
5. Optionally, enable Dependabot security updates. This will automatically create pull requests to update your vulnerable dependencies (if there is a non-vulnerable version to upgrade to). Note: there is a [maximum number of pull requests that this feature will create (10)](https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors#dependabot-cannot-open-any-more-pull-requests).
39+
5. Click the **Enable** button next to the **Dependabot security updates** setting.
40+
- This will automatically create pull requests to update your vulnerable dependencies (if there is a non-vulnerable version to upgrade to).
41+
- Note: there is a [maximum number of pull requests that this feature will create (10)](https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors#dependabot-cannot-open-any-more-pull-requests).
3542

3643
<details>
3744
<img src="images/lab-1-1-1.png"/>
@@ -40,16 +47,19 @@ In this exercise, you will be guided through the process of enabling the remaini
4047
### Exercise 2.2: Enable Code Scanning
4148

4249
1. Next, let's enable **Code Scanning with CodeQL**. These settings are also under the **Code security** settings page.
43-
2. Click the **Enable** button next to GitHub Advanced Security if it is not enabled. If prompted, then click the **Enable GitHub Advanced Security for this repository** button.
44-
3. Underneath the GitHub Advanced Security | Code Scanning heading, click the **Set up** button in the **CodeQL analysis** row.
45-
4. There are two options: **Default** and **Advanced**. For this lab, we will use the **Default** setup which creates a workflow behind the scenes (i.e. you will not see it committed to the repo). You can use the Advanced option to manage your code scanning workflow as a GitHub Actions workflow YAML file committed to the repo.
46-
5. Select the **Default** option and review the settings. By default, we will scan the JavaScript code (it may suggest Python as well), use the default CodeQL queries (for highest precision), and scan the default branch on push, pull request, and on a weekly schedule.
50+
2. Click the **Enable** button next to GitHub Advanced Security.
51+
3. A prompt will confirm that you want to **Enable GitHub Advanced Security for this repository** - click the button.
52+
- The prompt tells you how many GitHub Advanced Security licenses you would consume by enabling this feature - which is useful if you are an organization owner and want to ensure you have enough licenses for your organization.
53+
4. Underneath the GitHub Advanced Security | Code Scanning heading, click the **Set up** button in the **CodeQL analysis** row.
54+
5. There are two options: **Default** and **Advanced**. Select the **Default** option and review the settings.
55+
- For this lab, we will use the **Default** setup which creates a managed Actions workflow (i.e. you will not see a file committed to the repo). You can use the Advanced option to manage your code scanning workflow as a GitHub Actions workflow YAML file committed to the repo. The **Default** option is a great option to get started quickly to enable code scanning in a repository without needing to commit any additional code.
56+
- By default, it will scan the JavaScript code, use the default CodeQL queries (for highest precision), and scan the default branch on push, pull request, and on a weekly schedule.
4757

4858
<details>
4959
<img src="images/lab-1-2-1.png"/>
5060
</details>
5161

52-
5. Click the **Enable CodeQL** button to save the settings and enable Code Scanning.
62+
6. Click the **Enable CodeQL** button to save the settings and enable Code Scanning.
5363

5464
<details>
5565
<img src="images/lab-1-2-2.png"/>
@@ -61,19 +71,21 @@ In this exercise, you will be guided through the process of enabling the remaini
6171
<img src="images/lab-1-2-3.png"/>
6272
</details>
6373

64-
8. Optionally, configure the **Check runs failure threshold** - by default, a pull request will be blocked if there are any high or higher security alerts.
65-
6674
> [!NOTE]
6775
> You don't need a Copilot license in order to use the Copilot features with GitHub Advanced Security. However, Copilot can certainly be helpful in resolving issues in your IDE by using Copilot chat to explain the vulnerability and how to fix it.
6876
77+
7. Optionally, configure the **Check runs failure threshold** - by default, a pull request will be blocked if there are any high or higher security alerts.
78+
6979
### Exercise 2.3: Enable Secret Scanning
7080

71-
1. If it's not already enabled, click on the **Enable** button to enable Secret Scanning.
81+
1. Click on the **Enable** button to enable Secret Scanning.
7282
2. Check the box to **Scan for generic secrets**. This feature uses AI to find secrets/passwords that may be in your code that don't correspond to a known provider pattern.
73-
3. Click the **Enable** button next to the **Validity checks** setting. This feature checks if the secret is still valid for [specific partners](https://docs.github.com/en/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#high-confidence-patterns), such as AWS and, of course, GitHub. As an example, you can use this feature to check if a GitHub personal access token found in the repo is still valid and needs to be revoked.
83+
3. Click the **Enable** button next to the **Validity checks** setting. This feature checks if the secret is still valid for [specific partners](https://docs.github.com/en/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#high-confidence-patterns), such as Azure, AWS, and, of course, GitHub. As an example, you can use this feature to check if a GitHub personal access token found in the repo is still valid and needs to be revoked.
7484
4. Click the **Enable** button next to the **Non-provider patterns** setting. This scans for patterns that don't correspond to partners but still have a common syntax, such as a MySQL or MongoDB connection string.
7585
5. Click the **Enable** button next to the "Push protection" setting. This feature will block pushes that contain high-precision secrets. You can use this [chart](https://docs.github.com/en/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets) to determine which types of secrets would be blocked with secret scanning push protection enabled.
76-
6. Optionally, configure **Who can bypass push protection for secret scanning**. To not potentially interrupt developers' workflows, by default anyone with write access to the repository can manually bypass a blocked push that contains secrets (administrators will be notified of this, and it is also captured in the audit logs). You can change this to only allow select users/teams (or no one) to bypass secret scanning push protection.
86+
6. Optionally, configure **Who can bypass push protection for secret scanning**.
87+
- By default, as to not interrupt developers' workflows, anyone with write access to the repository can manually bypass a blocked push that contains secrets (administrators will be notified of this, and it is also captured in the audit logs).
88+
- You can change this to only allow select users/teams (or no one) to bypass secret scanning push protection.
7789
7. Note that you can define your own **Custom patterns** from this page to scan for secrets that don't correspond to a known provider pattern.
7890

7991
<details>
@@ -83,3 +95,5 @@ In this exercise, you will be guided through the process of enabling the remaini
8395
## Summary
8496

8597
Congrats! You have successfully enabled all of the security settings on your repository. In the next lab, we will review the alerts that have been created and how to manage them.
98+
99+
➡️ Head back to the [labs](README.md) page to continue on to the next lab.

0 commit comments

Comments
 (0)