Skip to content

Commit 8dc2e80

Browse files
author
Admin-01 SecW01
authored
Update lab4.md
1 parent 498a858 commit 8dc2e80

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

_labs/lab4.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ With Dependency Review enabled and configured, we want to block vulnerable packa
44

55
This lab covers parts of the following exam domains:
66

7-
Domain 3: Configure and use dependency management
8-
Domain 6: Describe GitHub Advanced Security best practices
7+
- Domain 3: Configure and use dependency management
8+
- Domain 6: Describe GitHub Advanced Security best practices
99

1010
## Exercise 1: Add the Dependency Review Action
1111

@@ -22,7 +22,7 @@ First, let's add the dependency review action workflow.
2222

2323
5. Review the action and its defaults on line 32-39. This action can also block specific open source license types.
2424
6. In the upper right, click on **Commit changes...**
25-
7. Since we have a ruleset, we have to create a branch and merge this to main via pull request. Create a branch and commit (**propose**) the changes.
25+
7. Since we have a ruleset, we have to create a branch and merge this to main via pull request. Create a branch and commit (**Propose changes**) the changes.
2626

2727
<details>
2828
<img src="images/lab-4-1-2.png"/>
@@ -54,7 +54,7 @@ First, let's add the dependency review action workflow.
5454
<img src="images/lab-4-1-5.png"/>
5555
</details>
5656

57-
17. Save the ruleset.
57+
17. Save the changes to the ruleset.
5858

5959
## Exercise 2: Introduce a dependency vulnerability
6060

@@ -68,21 +68,31 @@ Now, let's attempt to add a vulnerable dependency to the codebase and test out t
6868
</details>
6969

7070
3. Navigate back to the **Code** tab in the repo.
71-
4. Switch to the `lab4/dependency-vulnerability` branch.
71+
4. Click the **package.json** file to open it
72+
5. Click the pencil icon at the top right of the file to go into edit mode
73+
6. Go to the end of line 181 and hit Enter to create a blank line for line 182
74+
7. Add the following code to line 182:
75+
76+
```
77+
"tar": "2.2.2",
78+
```
79+
80+
8. Click the **Commit changes** button.
81+
9. Change the branch name to **lab4/dependency-vulnerability** and click **Propose changes** to start a pull request
82+
10. Switch to the `lab4/dependency-vulnerability` branch.
7283
- You can change to this branch by selecting the **main** dropdown below the repository name when under the **Code** tab.
73-
5. Open up the `package.json` file in the repository root.
74-
6. Navigate to line 182 and review this line - this branch has a change to introduce the `"tar": "2.2.2"` package to the codebase - a package with a known vulnerability.
84+
11. Open up the `package.json` file in the repository root.
85+
12. Navigate to line 182 and review this line - this branch has a change to introduce the `"tar": "2.2.2"` package to the codebase - a package with a known vulnerability.
7586

7687
<details>
7788
<img src="images/lab-4-2-2.png"/>
7889
</details>
7990

8091
7. Create a pull request by navigating the the **Pull requests** tab and clicking on the **New pull request** button.
81-
8. Make sure to select the `lab4/dependency-vulnerability` branch to merge into the `main` branch. Also make sure to use Copilot to generate a PR summary for you
82-
If you scroll down to the status check section of the PR, you should see a note: "This branch is out-of-date with the base branch".
83-
10. Click on the **Update branch** button; this adds in the dependency review workflow you committed in the prior exercise. TODO: verify this works correctly
84-
11. Wait for the dependency review job to finish.
85-
12. It should make a comment to the pull request with a note that it found a vulnerable package dependency. In fact, adding this one vulnerable package would introduce 3 new vulnerabilities to our codebase.
92+
8. Use Copilot to generate a PR summary for you
93+
9. Click the **Create pull request** button
94+
10. Wait for the dependency review job to finish.
95+
11. It should make a comment to the pull request with a note that it found a vulnerable package dependency. In fact, adding this one vulnerable package would introduce 3 new vulnerabilities to our codebase.
8696

8797
<details>
8898
<img src="images/lab-4-2-3.png"/>

0 commit comments

Comments
 (0)