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.

A diagram of the lab space. A free organization holds two public repositories: lab-secrets and lab-deps. The skerry-sandbox organization holds two private repositories: lab-code and lab-admin, with Secret Protection and Code Security, a temporary security manager assignment and a lab security configuration. Rules listed underneath: invented tokens only, sample code never deployed, delete when finished.
The lab space: free features in public repositories, paid features in a sandbox organization, and strict rules.

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

Secret Protection labs. Use an invented token format with a distinctive prefix.
LabDo thisAnswer from what you see
1. History scanCommit an invented token in an old commit, delete it in a later commit, then enable secret scanningWas an alert raised for a token no longer in the latest commit?
2. Custom pattern and dry runDefine a pattern for your invented token format; dry run it; publish itHow many matches did the dry run show, and did it create alerts?
3. Push protection and bypassTurn on push protection for the pattern; push a new token three times, bypassing with each reasonWhich bypass left an open alert?
4. Delegated bypassIn skerry-sandbox, enable delegated bypass with yourself as reviewer; push from a second account and request a bypassWhat 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

Supply chain labs. Use a public repository for the free features.
LabDo thisAnswer from what you see
5. Graph and alertsIn a public repository, add a lock file that pins an old version of a package with a published advisory; never run the codeDid the alert show severity, EPSS and a fixed version?
6. Security versus version updatesEnable security updates with no dependabot.yml; then add a dependabot.yml for weekly version updatesWhich pull request appeared without the file?
7. Dependency reviewAdd the dependency review action with fail-on-severity high and a denied licence; open a pull request adding the vulnerable packageWhat did the check show, and what made it fail?
8. SBOM exportExport the SBOM from the dependency graph pageWhich 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

Code Security labs. The sample app is never built for production or deployed.
LabDo thisAnswer from what you see
9. Default setupIn lab-code, add a small sample web app with a known unsafe query pattern; enable default setupWhich languages and triggers did default setup choose, and was there a workflow file?
10. Advanced setup and SARIFSwitch to advanced setup with security-extended; upload a second SARIF file from a linter with a categoryWhat happened to default setup, and did the uploads replace each other?
11. Autofix and campaignOpen a pull request adding another unsafe query; then create a small campaign over the existing alerts with yourself as contactDid 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
  1. Creating the configuration showed an estimate of licences before applying; it was zero new committers because both accounts already committed in the sandbox.
  2. Applying to lab-admin attached it; security overview's coverage view showed the repository with the configuration name.
  3. Creating a new private repository showed the configuration attached automatically, confirming the default.
  4. With enforcement on, the second account saw the push protection setting locked.
  5. 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.

What each group of labs is for.
LabDomainDistinction it fixes
1 to 4Secret ProtectionHistory scanning, bypass outcomes, delegated bypass blocking
5 to 8Supply chain securityAlerts versus updates, before-merge review, SPDX export
9 to 11Code SecurityDefault versus advanced, categories, Autofix versus analysis
12Suite administrationApply 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.

Which labs a candidate can run without paid products.
LabPossible on a free public repository?Substitute if not
1 to 3 Secret Protection basicsYesNone needed
4 Delegated bypassNoDocumentation walkthrough or a recording
5 to 8 Supply chainYesNone needed
9 and 10 Code scanning setups and SARIFYesNone needed
11 CampaignNo; Autofix part yesCampaign documentation and screenshots
12 Configurations and rolesPartly; organization settings pages can be viewed in a free organizationDocumentation 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
  1. The value has no real access, so it is used in tests.
  2. Choosing that reason allows the push.
  3. 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.

  1. Why use an invented token format in secret labs?

    Show answer

    So no real credential is ever exposed, even a revoked one.

  2. What happened to default setup when advanced setup was enabled?

    Show answer

    Default setup was turned off.

  3. 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.

Take the quiz