MSBA-369 · Lesson 10 of 12 · 20 min
Hands-on practice
▶ Video coming soon A video version of this lesson is on the way.
Freya had one condition for the labs: nothing would touch Skerry's real organizations. "You will be creating alerts on purpose," she said. "Alerts in production organizations page people." So on Tuesday, November 17, Seraphine created a lab space in two parts. For the free features she used a new organization on the GitHub Free plan with public repositories. For the paid features she used two repositories in skerry-sandbox, the organization Skerry keeps for experiments, which already had Secret Protection and Code Security available. Amadou gave her a temporary security manager assignment in skerry-sandbox and set a reminder to remove it on December 18.
This lesson sets out the twelve labs she and Priya worked through over two afternoons. Each is short, each targets the distinctions that the domain reviews flagged, and each ends with a question to answer from what you observed rather than from memory. All of them are defensive: they create alerts from deliberately unsafe sample code and invented tokens in isolated repositories, and none involves attacking anything.
Lab rules
Five rules keep labs safe and useful. Use invented secrets only, in a format defined by your own custom pattern, never a real credential, not even a revoked one. Use sample vulnerable code only in repositories that are never built for production or deployed. Keep labs in a separate organization or a dedicated sandbox, so alerts and notifications reach only you. Record what you observe, including surprises, because the surprises are what the exam tests. And clean up: delete lab repositories and remove temporary roles when you are done.
Secret Protection labs
| Lab | Do this | Answer from what you see |
|---|---|---|
| 1. History scan | Commit an invented token in an old commit, delete it in a later commit, then enable secret scanning | Was an alert raised for a token no longer in the latest commit? |
| 2. Custom pattern and dry run | Define a pattern for your invented token format; dry run it; publish it | How many matches did the dry run show, and did it create alerts? |
| 3. Push protection and bypass | Turn on push protection for the pattern; push a new token three times, bypassing with each reason | Which bypass left an open alert? |
| 4. Delegated bypass | In skerry-sandbox, enable delegated bypass with yourself as reviewer; push from a second account and request a bypass | What could the second account do while the request was pending? |
Seraphine used the prefix lab_ followed by 24 lowercase letters for her invented tokens, defined in a repository-level custom pattern. Lab 1 confirmed the point most candidates know but do not trust: the alert appeared even though the token had been deleted from the latest commit, with the old commit listed as its location. Lab 3 confirmed the bypass rule: the fix later bypass produced an open alert, the other two produced closed ones, and all three showed who bypassed and why.
Lab 4 produced the surprise. While the bypass request was pending, Priya's test account could not push the commit at all; it could only wait or remove the token. When Seraphine approved, the push went through, and the alert recorded the approval. Priya wrote: "Delegated bypass blocks until a human says yes; there is no fix later anymore."
Supply chain labs
| Lab | Do this | Answer from what you see |
|---|---|---|
| 5. Graph and alerts | In a public repository, add a lock file that pins an old version of a package with a published advisory; never run the code | Did the alert show severity, EPSS and a fixed version? |
| 6. Security versus version updates | Enable security updates with no dependabot.yml; then add a dependabot.yml for weekly version updates | Which pull request appeared without the file? |
| 7. Dependency review | Add the dependency review action with fail-on-severity high and a denied license; open a pull request adding the vulnerable package | What did the check show, and what made it fail? |
| 8. SBOM export | Export the SBOM from the dependency graph page | Which format and which packages did it list? |
Lab 6 cleared up Seraphine's baseline error for good. With no dependabot.yml, a security update pull request appeared within minutes for the vulnerable package, raising it to the minimum fixed version and no further. After she added a dependabot.yml with a weekly npm schedule, a second kind of pull request appeared the next morning, moving other packages to their latest versions. Seeing both side by side was worth more than any card.
Lab 8 produced a small surprise for Priya: the SPDX export listed transitive dependencies only because the lab repository had a lock file. In a copy without the lock file, only direct dependencies appeared. That tied the SBOM lab back to the graph accuracy point in the supply chain review.
Code Security labs
| Lab | Do this | Answer from what you see |
|---|---|---|
| 9. Default setup | In lab-code, add a small sample web app with a known unsafe query pattern; enable default setup | Which languages and triggers did default setup choose, and was there a workflow file? |
| 10. Advanced setup and SARIF | Switch to advanced setup with security-extended; upload a second SARIF file from a linter with a category | What happened to default setup, and did the uploads replace each other? |
| 11. Autofix and campaign | Open a pull request adding another unsafe query; then create a small campaign over the existing alerts with yourself as contact | Did Autofix suggest a fix in the pull request, and did the campaign trigger suggestions? |
Seraphine took the sample app from a public collection of intentionally vulnerable training code, cut it down to one service and added a comment at the top of every file saying it must never be deployed. Default setup detected JavaScript and TypeScript, chose pushes, pull requests and a weekly schedule, and created no workflow file. Switching to advanced setup in lab 10 turned default setup off, as expected, and the linter's SARIF upload, sent with its own category, appeared beside CodeQL's alerts instead of replacing them.
In lab 11, Autofix suggested a parameterized query in the pull request within a few minutes. Seraphine deliberately committed a slightly wrong version of the suggestion, to see whether the alert would close; it stayed open, and the next analysis still flagged the line. "Autofix suggests," she said. "Analysis decides."
Administration lab
Lab 12 tied the course together in the skerry-sandbox organization, where Seraphine's temporary role let her work with configurations without touching production.
Worked problem
Lab 12: configuration, defaults, enforcement and roles
Create a security configuration named lab baseline with secret scanning, push protection, Dependabot alerts and code scanning default setup enabled. Apply it to lab-admin only. Set it as the default for new private repositories. Enforce it. Then, from a second account with repository administrator access to lab-admin, try to turn off push protection. Finally, create a custom organization role that can only view code scanning alerts and assign it to the second account.
Show solution
- Creating the configuration showed an estimate of licenses before applying; it was zero new committers because both accounts already committed in the sandbox.
- Applying to lab-admin attached it; security overview's coverage view showed the repository with the configuration name.
- Creating a new private repository showed the configuration attached automatically, confirming the default.
- With enforcement on, the second account saw the push protection setting locked.
- With the custom role, the second account could view alerts across the organization's repositories but had no dismiss button.
Answer: Enforcement locked the setting for a repository administrator; the default covered a new repository; the custom role gave view-only access.
Before enforcing, Seraphine had tried the same change without enforcement. The second account turned push protection off without difficulty, and the coverage view marked lab-admin as no longer matching its configuration. That single observation answered three of her logged level errors.
Recording and cleaning up
Seraphine kept a lab sheet with one row per lab: what she did, what she expected, what she saw, and the one-line lesson. Two rows had a surprise, labs 4 and 11, and both became index cards. When the labs were finished she deleted the lab repositories, archived the free organization's repositories, and asked Amadou to remove her temporary role early, on November 20, instead of waiting for the reminder.
Priya ran the free labs again at Tidewater the following week on a throwaway public repository, because Tidewater has no paid products. She could not do labs 4, 10's paid parts or 12, so she watched Seraphine's screen recording of them instead. For candidates without a sandbox, that is a reasonable substitute: GitHub's documentation and Microsoft Learn modules include guided exercises, and the free features on public repositories cover a large part of the outline.
| Lab | Domain | Distinction it fixes |
|---|---|---|
| 1 to 4 | Secret Protection | History scanning, bypass outcomes, delegated bypass blocking |
| 5 to 8 | Supply chain security | Alerts versus updates, before-merge review, SPDX export |
| 9 to 11 | Code Security | Default versus advanced, categories, Autofix versus analysis |
| 12 | Suite administration | Apply versus default versus enforce; custom roles |
Labs without a sandbox
Not every candidate has access to a sandbox organization with paid products, and Priya's situation is common. The free tier still covers a surprising share of the outline. On a public repository in a free organization, a candidate can run secret scanning with history, push protection with all three bypass reasons, custom patterns at repository level with a dry run, the dependency graph and all three Dependabot features, dependency review with the action, SBOM export, CodeQL default and advanced setup, SARIF uploads with categories, and Copilot Autofix on pull requests. What remains out of reach is mostly organization-level: delegated bypass, security configurations with enforcement, the security manager role and custom roles, and campaigns.
| Lab | Possible on a free public repository? | Substitute if not |
|---|---|---|
| 1 to 3 Secret Protection basics | Yes | None needed |
| 4 Delegated bypass | No | Documentation walkthrough or a recording |
| 5 to 8 Supply chain | Yes | None needed |
| 9 and 10 Code scanning setups and SARIF | Yes | None needed |
| 11 Campaign | No; Autofix part yes | Campaign documentation and screenshots |
| 12 Configurations and roles | Partly; organization settings pages can be viewed in a free organization | Documentation walkthrough or a recording |
For the labs that need paid products, the next best thing is to read the documentation pages for the setting as if you were about to change it: who can see the page, what each option does, what happens to repositories already attached, and what the audit log records. Priya did this for delegated bypass and security configurations, using Seraphine's recording to see the screens. She noted that the documentation, not the recording, was where the exam-relevant facts lived; the recording only made them memorable.
Turning observations into answers
A lab is only useful for the exam if its lesson is written down in exam form. After each lab, Seraphine wrote one original question that the lab would let her answer, in the style of the exam, with the answer and the reason. By the end she had twelve questions of her own, and Priya used several of them in the final timed set. Writing questions has a second benefit: it forces you to think about which wrong options are tempting, which is exactly the skill the exam tests.
Worked problem
A question written from a lab
From lab 3, Seraphine wrote: "A developer is blocked by push protection on a repository without delegated bypass and wants to push a value that is a documented test fixture. Which bypass reason should they choose, and what record results?"
Show solution
- The value has no real access, so it is used in tests.
- Choosing that reason allows the push.
- An alert is created and closed as used in tests, recording the developer and the reason.
Answer: It's used in tests; a closed alert records who bypassed and why.
Freya reviewed the twelve questions and changed two. One had two correct options, and one depended on a Skerry setting rather than a GitHub default. Both fixes were lessons in themselves, and they echoed the common mistakes lesson: answer from defaults, and make sure only one option meets the goal.
Common mistakes
MistakeUsing a real or revoked credential to test secret scanning.
InsteadUse an invented token format and a custom pattern.
MistakeRunning labs in a production organization.
InsteadUse a separate organization or a sandbox so alerts reach only you.
MistakeDeploying or building sample vulnerable code.
InsteadKeep it in an isolated repository, never built for production, and delete it afterwards.
MistakeLeaving temporary roles in place.
InsteadSet an end date and remove lab roles when finished.
Summary and key terms
- Labs turn look-alike knowledge into observation; twelve short labs cover all six domains.
- Use a separate organization or sandbox, invented secrets and never-deployed sample code.
- Secret labs show history scanning, bypass outcomes and delegated bypass blocking.
- Supply chain labs show security updates without a file, version updates with one, dependency review checks and SPDX export.
- Code labs show default setup without a workflow, categories for uploads and Autofix as a suggestion.
- The administration lab shows apply, default and enforce, and a view-only custom role.
- Sandbox organization
- An organization kept for experiments, separate from production.
- Invented token
- A made-up secret in a custom format, used to test detection safely.
- Lab sheet
- A record of each lab's action, expectation, observation and lesson.
- Intentionally vulnerable code
- Training code written with known flaws, used only in isolated repositories.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Why use an invented token format in secret labs?
Show answer
So no real credential is ever exposed, even a revoked one.
What happened to default setup when advanced setup was enabled?
Show answer
Default setup was turned off.
What did enforcement change for a repository administrator?
Show answer
The configured setting was locked.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.