@@ -17,7 +17,13 @@ This tutorial with use CodeQL Analysis with Code Scanning in order to search for
17
17
<p >
18
18
19
19
Begin by [ forking this repo] ( https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo ) .
20
+
21
+ Make sure you uncheck "Copy the main branch only"
22
+
23
+ <img src =" images/17-fork-repo.png " width =" 70% " />
24
+
20
25
</p >
26
+
21
27
</details >
22
28
23
29
<details >
@@ -198,6 +204,46 @@ Click on the security alert and notice that it details when the fix was made, by
198
204
199
205
</p >
200
206
</details >
207
+
208
+ <details >
209
+ <summary >Introduce a Security Vulnerability in a PR</summary >
210
+ <p >
211
+
212
+ Now let's explore the typical developer view when introducing a vulnerability.
213
+
214
+ A branch called ` new-feature ` introduces a new feature but also security vulnerabilities. Open a Pull Request comparing ` new-feature ` to ` main ` :
215
+
216
+ 1 . Go to the Pull Request tab
217
+ 2 . Select "New Pull Request"
218
+ 3 . Create the PR with ` base: main ` and ` compare: new-feature `
219
+
220
+ <img src =" images/18-create-vulnerable-pr.png " width =" 80% " />
221
+
222
+ #### Pull Request Status Check
223
+
224
+ In the Pull Request, you will notice that the CodeQL Analysis has started as a status check again. Wait until it completes.
225
+
226
+ #### Security Alert Details
227
+
228
+ After the Workflow has completed click on ` Details ` by the ` Code Scanning Results / CodeQL ` status check.
229
+
230
+ #### Security Alert
231
+
232
+ Notice that Code Scanning has detected that this Pull Request will introduce 2 medium-severity vulnerabilties
233
+
234
+ <img src =" images/19-vulnerabiltliy-detail.png " width =" 80% " />
235
+
236
+ ### 'Files Changed' tab
237
+
238
+ Click on the "Files Changed" tab of the PR. Scroll down and notice the Advanced Security annotations for new vulnerabilities.
239
+
240
+ You have the ability to dismiss, dive deeper into, or comment on these alerts directly from here.
241
+
242
+ <img src =" images/20-files-changed-vulnerabilities.png " width =" 80% " />
243
+
244
+ As a developer, this is where you would be interacting with Code Scanning
245
+
246
+ </details >
201
247
202
248
## Next Steps
203
249
0 commit comments