Skip to content

Commit 87fea5c

Browse files
authored
Lab2 public to private changes mostly for secret scanning behaviors
1 parent 1f0505e commit 87fea5c

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

_labs/lab2.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,31 +143,36 @@ Now that we have all of the security feature enabled, let's review the security
143143
144144
## Exercise 3: Reviewing Secret Scanning alerts
145145

146-
1. Since this is a brand new fork of a public repo, you will not have any secrets detected. The next few steps we will review what you would see if we had any secrets detected (optional steps in Lab 5.)
147-
148-
2. Under the **Security** tab in the repo, click on the **Secret scanning** view. This will show all of the secret scanning alerts. (This should be empty for you.)
149-
150-
<details>
151-
![image](images/lab-2-3-1.png)
152-
</details>
153-
154-
3. Viewing a secret scanning alert shows details about the leak
146+
1. Under the **Security** tab in the repo, click on the **Secret scanning** --> **Default** option. This will show all of the default secret scanning alerts.
147+
2. You should see a number of alerts. For example, there should be a **GitHub Personal Access token alert**. Click it.
155148
- This page shows where in the code the secret was discovered (if there were multiple locations, it would list them all).
156149
- If a secret is found in the code, we would want to revoke manually in the designated service.
157150
- It's recommended to revoke the secret instead of rewriting history because the secret was exposed and you don't know who may have seen it.
158151
- If you re-write history, the secret will still be valid and could be used by an attacker. Also, re-writing history modifies commit hashes and can make traceability more difficult.
159152

160153
<details>
161-
![image](images/lab-2-3-4.png)
154+
![image](images/lab-2-3-1.png)
162155
</details>
163156

164-
4. If you view an alert and choose **Verify secret** and this time, it says **secret inactive**. This is a good candidate to **Close as** --> **Revoked**.
157+
3. You can click on **Verify secret**. It will say it's not currently valid on `github.com`, but that doesn't mean it doesn't come from another GitHub instance (such as GitHub Enterprise Server).
158+
4. Go back to list of secret scanning alerts. Click on the **Google API key** alert.
159+
5. Click on **Verify secret** again. This time, it should say **secret inactive**. This is a good candidate to **Close as** --> **Revoked** (click the **Close as** button in the upper right to do so). Do this.
165160
- Unlike Dependabot alerts and Code Scanning alerts, secret scanning alerts are not automatically closed when the secret is removed from the code - whether by a new commit or by re-writing history. This is because the secret was exposed and you don't know who may have seen it. So, you have to manually close the alert once you revoke the token.
161+
6. Navigate back to the **Default** secret alerts list.
162+
7. We can click **1 Closed** to see the alert we just closed.
166163

167164
<details>
168165
![image](images/lab-2-3-2.png)
169166
</details>
170167

168+
8. Click on the **Experimental** secret scanning alerts option. This will show all of the alerts that are not high confidence, such as generic passwords, keys, and things such as HTTP bearer authentication header tokens found in the code.
169+
9. Let's click into one of the **Password** alerts.
170+
171+
<details>
172+
![image](images/lab-2-3-3.png)
173+
</details>
174+
175+
10. Just like high confidence secret scanning alerts, it shows where the secret was found in the code. The secret was found with AI, so it may or may not be a real secret or password. If it's not, we can close it manually and mark it as a false positive.
171176

172177
## Summary
173178

0 commit comments

Comments
 (0)