Skip to content

Commit c3a375d

Browse files
author
Admin-02 SecW01
authored
Merge pull request #5 from ghuwsec1953/add-labs
Add labs
2 parents 7fe2e40 + 65fc1ff commit c3a375d

File tree

11 files changed

+146
-28
lines changed

11 files changed

+146
-28
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,30 @@ This lab will have you utilize Secret Scanning with Push Protection to prevent s
5959

6060
---
6161

62+
### Lab 6 - Hands-on with Security Overview
63+
64+
This lab will teach you how to effectively use the Security Overview to review and alerts and coverage in an organization.
65+
66+
- Get started here - [Lab 6](./_labs/lab6.md)
67+
68+
---
69+
70+
### Extra Credit: Advanced CodeQL Setup
71+
72+
This open-ended extra credit lab will have you switch to the advanced CodeQL setup.
73+
74+
- Get started here - [Extra Credit Lab 1](./_labs/lab7-ec.md)
75+
76+
---
77+
78+
### Extra Credit: Custom Secret Scanning Patterns
79+
80+
This open-ended extra credit lab will have you create a custom secret scanning pattern.
81+
82+
- Get started here - [Extra Credit Lab 2](./_labs/lab8-ec.md)
83+
84+
---
85+
6286
## :book: Resources
6387
- [GitHub Docs - About GitHub Advanced Security](https://docs.github.com/en/get-started/learning-about-github/about-github-advanced-security)
6488
- [GitHub Security Learning Pathway](https://resources.github.com/learn/pathways/security/)

_labs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
3. [Lab 3 - Hands-on with Code Scanning (blocking vulnerable code from entering codebase and Copilot Autofix)](./lab3.md)
66
4. [Lab 4 - Hands-on with Dependency Review (blocking vulnerable dependencies from entering codebase)](./lab4.md)
77
5. [Lab 5 - Hands-on with Secret Scanning (secret scanning with push protections)](./lab5.md)
8+
6. [Lab 6 - Hands-on with Security Overview](./lab6.md)
9+
7. [Extra credit: Advanced CodeQL Setup](./lab7-ec.md)
10+
8. [Extra credit: Custom Secret Scanning Patterns](./lab8-ec.md)

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

86.6 KB
Loading

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

-4.73 KB
Loading

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

-95.3 KB
Binary file not shown.

_labs/lab1.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,14 @@ This lab covers parts of the following exam domains:
88
- Domain 3: Configure and use dependency management
99
- Domain 4: Configure and use code scanning
1010

11-
## Exercise 1: Create the repository
12-
13-
We need to provision our working copy of the repository in order to begin the labs!
14-
15-
1. Navigate to URL: [https://github.com/ghuwsec1953/juice-shop-ghas-workshop](https://github.com/ghuwsec1953/juice-shop-ghas-workshop)
16-
2. Click on the **Use this template ▾** button and select **Create a new repository**.
17-
3. Make sure you have the **ghuwsec1953** organization selected as the **Owner**.
18-
4. Name the repository **YOUR_USERNAME-juice-shop-ghas-workshop**.
19-
5. Set the repository visibility to **Internal**.
20-
6. Click the green **Create repository** button to create the repository.
21-
22-
Once the repository is created, you will be automatically redirected to it. Continue on to Exercise 2.
23-
2411
> [!TIP]
2512
> We recommend opening up two browser windows, one with the lab and one with the working copy of your repo!
2613
27-
## Exercise 2: Enabling the security settings
14+
## Exercise 1: Enabling the security settings
2815

2916
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.
3017

31-
### Exercise 2.1: Enable Dependabot
18+
### Exercise 2: Enable Dependabot
3219

3320
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.
3421

@@ -44,7 +31,7 @@ Although Dependabot isn't part of the GitHub Advanced Security product suite, it
4431
<img src="images/lab-1-1-1.png"/>
4532
</details>
4633

47-
### Exercise 2.2: Enable Code Scanning
34+
### Exercise 3: Enable Code Scanning
4835

4936
1. Next, let's enable **Code Scanning with CodeQL**. These settings are also under the **Code security** settings page.
5037
2. Click the **Enable** button next to GitHub Advanced Security.
@@ -76,7 +63,7 @@ Although Dependabot isn't part of the GitHub Advanced Security product suite, it
7663
7764
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.
7865

79-
### Exercise 2.3: Enable Secret Scanning
66+
### Exercise 4: Enable Secret Scanning
8067

8168
1. Click on the **Enable** button to enable Secret Scanning.
8269
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.

_labs/lab3.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,19 @@ Without a ruleset (GitHub's new version of branch protections), even though Code
9595
1. Give the ruleset a **name** (any name is fine)
9696
2. Change the **enforcement status** to **Active**.
9797
3. Under **target branches**, click **Add target** and select **Include default branch**.
98-
4. Scroll down and check the **Require status checks to pass** box
99-
5. Click on the **+ Add checks ▾** button
100-
6. Search for **CodeQL**. We should see a suggested **CodeQL** check show up with **GitHub Advanced Security** text to the right. Add it.
98+
4. Scroll down and check the **Require code scanning results** box
99+
5. The CodeQL tool should already be there - there's nothing to change
100+
5. Scroll down and click the **Create** button.
101101

102102
<details>
103103
<img src="images/lab-3-2-2.png"/>
104104
</details>
105105

106-
5. Let's also search for **Analyze**. We should see a **Analyze (javascript-typescript)** check show up. Add it.
107-
6. Scroll down and click the **Create** button.
108-
109-
<details>
110-
<img src="images/lab-3-2-3.png"/>
111-
</details>
112-
113106
7. With the ruleset created, both the JavaScript scan has to finish and no vulnerabilities found with CodeQL in order to merge the code.
114107
8. Navigate back to our open PR. The **Merge pull request** button should now be grayed out, preventing us from merging vulnerable code.
115108

116109
<details>
117-
<img src="images/lab-3-2-4.png"/>
110+
<img src="images/lab-3-2-3.png"/>
118111
</details>
119112

120113
9. Review the **Copilot Autofix suggestion** - it offers a similar suggestion to what Copilot in our IDE did!

_labs/lab5.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ This lab covers parts of the following exam domains:
4242
Celebrate 🎉! We just prevented a secret from entering our codebase!
4343

4444
And there you have it. You should now have a good grasp on what GitHub Advanced Security is, how it works, and how to implement it. So get out there and keep your company secured!
45+
46+
➡️ Head back to the [labs](README.md) page to continue on to the next lab.

_labs/lab6.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Lab 6 - Hands-on with Security Overview
2+
3+
We've covered how to review alerts in a single repository, but how is your org or team doing? Next, we'll check out the Security Overview at the organizational level to see how we can get a high-level view of the security posture of our organization.
4+
5+
This lab covers parts of the following exam domains:
6+
7+
- Domain 6: Describe GitHub Advanced Security best practices
8+
9+
## Exercise 1: Navigating to Security Overview
10+
11+
The Security Overview can be used by anyone inside of an organization; it shows repositories that you have access to. If you are an org owner or a security manager, you would see all alerts. If you are a regular org member, you would only see alerts for repositories by default that you have write access to.
12+
13+
> [!NOTE]
14+
> Security alerts for a repository are visible to people with write, maintain, or admin access to the repository and, when the repository is owned by an organization, organization owners. You can give additional teams and people access to the alerts.
15+
16+
1. Navigate to the organization. You can do so by **clicking on the org name** (`ghuwsec1953`) in the repository breadcrumbs in the upper left hand corner.
17+
- You can also navigate to your orgs by clicking on your profile picture and "**Your organizations**"
18+
2. Click on the **Security** tab.
19+
3. Review (and click on!) the different views on the left-hand side:
20+
- Overview: visualize trends in Detection, Remediation, and Prevention of security alerts ([docs](https://docs.github.com/en/enterprise-cloud@latest/code-security/security-overview/viewing-security-insights#about-security-insights))
21+
- Risk: explore the risk from security alerts of all types or focus on a single alert type and identify your risk from specific vulnerable dependencies, code weaknesses, or leaked secrets ([docs](https://docs.github.com/en/enterprise-cloud@latest/code-security/security-overview/assessing-code-security-risk))
22+
- Coverage: assess the adoption of code security features across repositories in the organization ([docs](https://docs.github.com/en/enterprise-cloud@latest/code-security/security-overview/assessing-adoption-code-security))
23+
- Enablement trends: see how quickly different teams are adopting security features
24+
- CodeQL pull request alerts: assess the impact of running CodeQL on pull requests and how development teams are resolving code scanning alerts ([docs](https://docs.github.com/en/enterprise-cloud@latest/code-security/security-overview/viewing-metrics-for-pull-request-alerts))
25+
- Secret scanning: find out which types of secret are blocked by push protection and which teams are bypassing push protection ([docs](https://docs.github.com/en/enterprise-cloud@latest/code-security/security-overview/viewing-metrics-for-secret-scanning-push-protection))
26+
27+
> [!TIP]
28+
> You can export a CSV of nearly from most of these views using the **Export CSV** button in the upper right.
29+
30+
4. Under the **Overview** view, navigate the sub-views, specifically **Detection** and **Remediation**.
31+
- Note the trends - this is useful information to evaluate the security posture of your organization. Are we getting better over time?
32+
- Being secure requires "constant vigilance"
33+
5. Navigate to the **Risk** view.
34+
6. On the right-hand side, click the **Teams ▾** button/dropdown.
35+
7. Click on the **all users** team - this team is only added to a different sample repo, so note how the total alerts changes.
36+
- This can be really useful for a manager, architect, or developer to see which repositories assigned to the teams have security features enabled and how many alerts they are generating.
37+
8. At the bottom of the options on the left, you will see **Security Campaigns**.
38+
- Security campaigns are a new feature designed to help administrators and security managers create targeted campaigns and track remediation progress effectively.
39+
9. ⚠️ Please don't create a new security campaign as to not introduce noise to your fellow attendees ⚠️, but click on the existing campaign here (**SQL injection (CWE-89)**) to check it out!
40+
- How are we doing on our goal?
41+
42+
## Summary
43+
44+
That's the security overview! Use these views to monitor and manage your security posture effectively. By leveraging the detailed insights provided in each section, you can identify potential threats, take proactive measures, and ensure your systems remain secure.
45+
46+
If you want to learn more about the security overview or about what a particular view shows, check out the [docs](https://docs.github.com/en/enterprise-cloud@latest/code-security/security-overview/about-security-overview)!
47+
48+
Congrats, you have finished all of the main labs! 🎉 If you have time or are up for a challenge, try out the extra credit labs!
49+
50+
➡️ Head back to the [labs](README.md) page to try your hand at the extra credit labs.

_labs/lab7-ec.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Extra Credit - Lab 7 - Advanced CodeQL Setup
2+
3+
We set up Code Scanning with CodeQL using the default method. Now, let's try using the **[advanced setup](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning)**!
4+
5+
This extra credit lab covers parts of the following exam domains:
6+
7+
- Domain 4: Configure and use code scanning
8+
- Domain 5: Use code scanning with CodeQL
9+
- Domain 6: Describe GitHub Advanced Security best practices
10+
11+
## Exercise
12+
13+
Why might you want to use the advanced setup? Here are some reasons:
14+
15+
- More control over triggers and schedule
16+
- When pulling in packages from a private feed, you may have to provide instructions on authorizing to the NuGet, NPM, Maven, etc. feed.
17+
- For compiled languages, providing more instructions on how to build the code
18+
- Ability to customize your runners TODO: is this true? i think you can use code-scanning label with default workflow but i cannot remember
19+
- Ability to customize the CodeQL configuration (such as query suites used)
20+
- Manage code scanning settings "as code"
21+
- Utilize 3rd party code scanning tooling
22+
23+
### Assignment
24+
25+
Your assignment here is to switch to the **[advanced setup](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning)**. You can start under the **Settings** --> **Code Security and Analysis** page.
26+
27+
Your goal is to have a CodeQL workflow committed that successfully scans your code. Pay attention to some of the configuration options for the CodeQL scanning action. Refer to the documentation for more details.
28+
29+
TODO: add link
30+
31+
## Summary
32+
33+
TODO: add content
34+
35+
➡️ Head back to the [labs](README.md) page.

0 commit comments

Comments
 (0)