Skip to content

Commit 24e6698

Browse files
Merge pull request #3 from GitHubSecurityLab/sylwia-budzynska-patch-1
Update fork instructions
2 parents d2b3b9f + af00522 commit 24e6698

File tree

1 file changed

+52
-5
lines changed

1 file changed

+52
-5
lines changed

2/challenge-1/instructions.md

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Challenge 1 - add the Code Scanning GitHub action to a repository
2-
In this challenge, we will enable code scanning on a fork of this repository and observe what vulnerabilities CodeQL finds. The repository contains several intentionally vulnerable code snippets.
2+
In this challenge, we will enable code scanning on a fork of this repository and observe what vulnerabilities CodeQL finds. The repository contains several intentionally vulnerable code snippets, which should be found by code scanning. Follow Instructions-option A to enable code scanning on the fork.
33

4-
If you prefer, you can choose another open source project, make a fork of it on your personal GitHub account and then enable Code Scanning on it. You can also choose one of your own public projects instead. If you encounter problems, see documentation for [enabling code scanning](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#configuring-code-scanning-automatically).
4+
If you prefer, you can choose another open source project for this challenge. In that case, you can either fork it (Instructions-option B) or clone and upload to a new repository on your account (Instructions—option C).
5+
6+
You can also choose one of your own public projects instead. If you encounter problems, see documentation for [enabling code scanning](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#configuring-code-scanning-automatically).
57

68
Hint: If you can’t find a project, use the GitHub search functionality, e.g. type in the GitHub search bar “language:python stars:>100 type:repositories
79

8-
## Instructions:
10+
## Instructions-option A—fork this repository and enable code scanning
11+
12+
1. Fork this repository
13+
Note: If any of the steps below do not work or look different, check out the [documentation](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#configuring-code-scanning-automatically).
914

10-
1. Fork this repository.
11-
Note: If anyone of the steps below do not work or look different, check out the [documentation](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#configuring-code-scanning-automatically).
1215
2. Go to the 'Security' tab > click 'Set up code scanning' button.
1316
![image](https://user-images.githubusercontent.com/102833689/236031191-09a7fc6e-cc6c-4001-853d-170d87c18a88.png)
1417

@@ -21,6 +24,50 @@ Note: If anyone of the steps below do not work or look different, check out the
2124

2225
5. Wait a few minutes for the scan to complete. Go to 'Security' tab and see the alerts that have been triggered.
2326

27+
## Instructions—option B—fork another open source repository and enable code scanning
28+
Some open source projects will have their own Actions workflows defined. If you fork a repository with existing workflows, these workflows will be disabled by default. This is a security measure to protect you from potentionally [malicious workflows](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/), to prevent errors and lower Actions minutes usage.
29+
30+
That's why before you enable code scanning, it's better if you first delete all actions workflows from your fork (generally they can be found in the `.github/workflows` folder), then go to the Actions tab and make sure that Actions are enabled.
31+
32+
1. Fork an open source project. When forking, select the option `Copy the main branch only`.
33+
34+
2. Check if the `.github/workflows` folder exists and if it does, delete it from your fork.
35+
36+
3. Go to the Actions tab and make sure that Actions are enabled (if they are disabled, a big pop up will show up).
37+
38+
4. Go to the 'Security' tab > click 'Set up code scanning' button.
39+
![image](https://user-images.githubusercontent.com/102833689/236031191-09a7fc6e-cc6c-4001-853d-170d87c18a88.png)
40+
41+
5. You'll be moved to another page. Now in 'Code scanning' section click 'Set up' button, then 'Default'.
42+
![image](https://user-images.githubusercontent.com/102833689/236031570-fd77279c-bb4f-422b-847c-f9d790929b1e.png)
43+
44+
6. A pop up should appear. Click 'Enable CodeQL'
45+
46+
![image](https://user-images.githubusercontent.com/102833689/236031879-815c0e57-d2d2-4d3d-bb4b-d7553c76de94.png)
47+
48+
7. Wait a few minutes for the scan to complete. Go to 'Security' tab and see the alerts that have been triggered.
49+
50+
## Instructions—option C—clone another open source project and upload to a new repository on your account
51+
52+
In a similar way as in option B, we don't want unknown Actions workflows running on your account.
2453
The code for this challenge has shamelessly been copied from the [CodeQL examples](https://github.com/github/codeql/blob/main/python/ql/src/Security/CWE-089/examples/sql_injection.py).
2554

55+
1. Create a new repository on your account.
56+
57+
2. Duplicate an open source repository following the instructions [here](https://docs.github.com/en/repositories/creating-and-managing-repositories/duplicating-a-repository). Make sure to check if the `.github/workflows` folder exists and if it does, delete it from your copy of the repository.
58+
59+
3. Go to the Actions tab and make sure that Actions are enabled (if they are disabled, a big pop up will show up).
60+
61+
4. Go to the 'Security' tab > click 'Set up code scanning' button.
62+
![image](https://user-images.githubusercontent.com/102833689/236031191-09a7fc6e-cc6c-4001-853d-170d87c18a88.png)
63+
64+
5. You'll be moved to another page. Now in 'Code scanning' section click 'Set up' button, then 'Default'.
65+
![image](https://user-images.githubusercontent.com/102833689/236031570-fd77279c-bb4f-422b-847c-f9d790929b1e.png)
66+
67+
6. A pop up should appear. Click 'Enable CodeQL'
68+
69+
![image](https://user-images.githubusercontent.com/102833689/236031879-815c0e57-d2d2-4d3d-bb4b-d7553c76de94.png)
70+
71+
7. Wait a few minutes for the scan to complete. Go to 'Security' tab and see the alerts that have been triggered.
72+
2673
Congrats on completing challenge 1! 🎉

0 commit comments

Comments
 (0)