MSBA-299 · Lesson 5 of 12 · 21 min

Domain review: secure development and compliance

▶ Video coming soon A video version of this lesson is on the way.

Saturday morning, November 14, began with numbers. "Domain 3 is between a quarter and nearly a third of your exam," Wren said, "so it gets two sessions. Today is policies, rulesets, audit logging and the security features. Tuesday is tokens and apps." Priya had a head start on half of it: she had watched Freya Abernathy-Oduya's security team roll out secret scanning, push protection and CodeQL across Skerry's repositories. What she lacked was the administrator's map of which setting lived where.

Domain 3, Implement secure software development and compliance, is weighted 25 to 30 percent, the largest in the outline. It has three objective groups: configure security policies and rulesets; enable repository security features; and manage API access and integrations. This lesson covers the first two. Lesson 6 covers the third. The material was taught in MSBA-290 lessons 8 and 9 and MSBA-291 lessons 1, 2, 8 and 9, with the security features themselves in MSBA-161 and, in depth, in MSBA-360 and MSBA-361.

Enterprise and organization policies

The first bullet asks you to define organization and enterprise policies. An enterprise policy is set by an enterprise owner and applies to every organization in the enterprise. For most policies the owner can either enforce a value or choose no policy, which leaves the decision to each organization's owners. An organization can never loosen an enforced enterprise policy; where the enterprise allows a choice, the organization can restrict further. The same pattern repeats from organization to repository. Exam options that "override the enterprise policy at organization level" are wrong by construction.

Three nested layers labelled enterprise, organization and repository. Arrows down show that each level can only restrict what the level above allows. Beside the layers, two columns: policies, where an enterprise owner either enforces a value or chooses no policy, and rulesets, where enterprise, organization and repository rulesets all apply together and the most restrictive rule wins. A note at the bottom says bypass lists apply only to the ruleset that defines them.
Policies cascade down and can only be tightened. Rulesets from every level apply together, and the most restrictive rule wins.
Policy areaExamples of settingsWhy administrators care
Repository managementBase permissions; who can create repositories and with which visibility; who can change visibility, delete, transfer or fork; whether members can invite outside collaboratorsStops private code becoming public by mistake and keeps access deliberate
ActionsWhich organizations can use Actions; allowed actions and reusable workflows; SHA pinning; fork pull request settings; default token permissions; retentionCovered in lesson 7
Codespaces and other productsWhich organizations can use them; machine types; idle timeoutsCost and data control
Security featuresSecurity configurations and their enforcement; who may bypass push protectionConsistent protection across repositories
Personal access tokensWhether classic and fine-grained tokens are allowed; approval; maximum lifetimeCovered in lesson 6

Rulesets

Rulesets protect branches, tags and, for private and internal repositories, pushes. They can be defined at enterprise, organization and repository level. Unlike policies, rulesets at different levels do not replace one another: every applicable ruleset is evaluated, and when two rules overlap the most restrictive wins. Each ruleset has a target, such as default branches, branch name patterns or repositories selected by name or by custom property; an enforcement status of active, evaluate or disabled; and a bypass list naming roles, teams, enterprise teams or apps that may bypass it, either always or only through pull requests. Evaluate mode, which records what would have been blocked without blocking it, is available for organization and enterprise rulesets on GitHub Enterprise.

Rulesets are the modern answer to most "enforce a standard across many repositories" questions. A branch protection rule must be created repository by repository; an organization ruleset targeting repositories with the custom property data-classification set to confidential covers every such repository now and in future. Skerry's design from MSBA-291 is a good model to remember: an enterprise baseline ruleset for default branches, an organization ruleset for confidential code chosen by property, a push ruleset blocking sensitive file types, and a bypass list holding only the platform-oncall enterprise team, through pull requests.

Worked problem

Policy or ruleset?

An enterprise wants three things: no organization may allow members to change repository visibility; every repository whose custom property says confidential must require two approvals before merging to main; and nobody may push files with a .pem extension to private repositories. What should be used for each?

Show solution
  1. Visibility changes are a repository management policy; enforce it at enterprise level.
  2. Two approvals on main for repositories chosen by property is a branch ruleset at enterprise or organization level, targeting by custom property.
  3. Blocking a file extension on push is a push ruleset, available for private and internal repositories.
  4. Bypass lists should be short and named, ideally a team through pull requests only.

Answer: An enforced enterprise policy for visibility changes; a branch ruleset targeting the confidential property; a push ruleset restricting the file extension.

Security posture and data protection

The bullet on strengthening the enterprise security posture and data protection collects several settings. An IP allow list limits access to enterprise resources to listed addresses; with managed users and OIDC, Skerry used Entra Conditional Access for the same purpose, since GitHub can apply the identity provider's IP conditions. Requiring SSO and 2FA belongs here too, from lesson 3. SSH certificate authorities let an enterprise issue short-lived certificates instead of managing individual keys. Restricting email notifications to verified domains keeps notifications about private code inside the company. Repository policies that prevent forking private repositories into personal accounts and restrict visibility changes protect data from accidental exposure. And the security configurations described below make protection the default for new repositories.

Audit logging and reporting

The enterprise audit log records actions across the enterprise: who did what, when and where. Events have names such as org.add_member, repo.create or protected_branch.update, and the log can be searched with qualifiers for action, actor, organization, repository and date, viewed in the web interface, queried through the REST API and exported. Most events are kept for 180 days, while Git events such as pushes and clones are kept for seven days and must be included specifically in an export. Owners can choose to show source IP addresses for events, and can opt in to logging API request events.

Retention is the reason for audit log streaming. An enterprise owner can stream events to Amazon S3, Azure Blob Storage, Azure Event Hubs, Datadog, Google Cloud Storage or Splunk, and can stream Copilot agent session events to Microsoft Purview. Streaming is delivered at least once, so consumers must handle duplicates. If a stream is paused for up to seven days, GitHub buffers the events; GitHub checks stream health every 24 hours and the owner has a few days to fix a broken stream before events are lost. Skerry streams to Event Hubs and keeps raw events for 13 months in its SIEM, which is what Ottoline Brisbane-Teale, the internal audit lead, needed for an annual audit.

NeedTool
Find who changed a ruleset last weekSearch the audit log with an action qualifier
Keep a year of evidence for auditorsStream to storage or a SIEM; built-in retention is 180 days
Investigate clones of a repository over the last monthGit events are kept only seven days; a stream must already have been capturing them
Show the auditors GitHub's own controlsThe compliance reports in enterprise settings, such as SOC reports and ISO 27001 certificates

Repository security features

The second objective group asks you to configure security alerts, secret scanning and CodeQL; manage Dependabot and security advisories; and define and implement a security response plan. The administrator's view of these features is about enablement, scope and who acts on alerts, not about writing queries.

FeatureWhat it doesProduct needed for private repositories
Secret scanningFinds credentials in the repository history, issues and pull requests and raises alertsGitHub Secret Protection
Push protectionBlocks pushes that contain recognised secrets, with bypass reasons and optional delegated bypassGitHub Secret Protection
Code scanning with CodeQLFinds vulnerabilities in code; default setup or advanced setup with a workflowGitHub Code Security
Dependency reviewShows vulnerable dependency changes in pull requests and can block themGitHub Code Security
Dependabot alerts and security updatesAlert on vulnerable dependencies and open pull requests to update themIncluded for all repositories
Dependabot version updatesKeep dependencies current on a schedule from a configuration fileIncluded for all repositories
Repository security advisoriesPrivately discuss, fix and publish a vulnerability, and request a CVEIncluded; private vulnerability reporting lets outsiders report

At scale, features are enabled through security configurations rather than repository by repository. GitHub provides a recommended configuration, and organizations and enterprises can create their own, attach them to repositories, set one as the default for new repositories, and since September 2026 choose whether to enforce a configuration so that repository owners, or repository and organization owners, cannot change it. The security manager role lets a security team manage alerts and settings across an organization without being owners. Skerry runs an enterprise baseline configuration everywhere, a Code Security configuration on confidential and restricted repositories, and a stricter organization configuration in skerry-stores with delegated bypass for push protection.

A security response plan

The newest bullet in this group asks you to define and implement a security response plan. On the exam this means knowing the steps and who owns each one. A plan says how vulnerabilities and leaks are reported, how alerts are triaged and by whom, how fast each severity must be handled, how credentials are revoked and rotated, how evidence is kept and how lessons feed back into configuration.

A circular flow of six steps: report or detect, with SECURITY.md, private vulnerability reporting and alerts; triage, with severity, an owner and a deadline; contain, by revoking or rotating credentials and blocking merges; fix, through a pull request, a Dependabot update or an advisory; record, by closing the alert with a reason and keeping audit evidence; and review, changing configuration such as delegated bypass or required properties. An arrow returns from review to detect.
The steps of a security response plan and the GitHub features behind each one.

Priya added a real example to these notes the following week. Skerry's incident on Tuesday, November 17 is a compact one. At 10:42 a data engineer bypassed push protection with the reason "fix later" and pushed a production service account key into an internal repository. The same key had sat in an unassigned alert since November 3 because the repository lacked an owning-team property, so nobody was routed the alert. The key was revoked at 11:31, logs showed no misuse, and the alert was closed as revoked that afternoon. The review on Thursday changed configuration rather than blaming a person: delegated bypass for confidential repositories, a required owning-team property, fallback routing for alerts left unassigned for more than a day, and a narrower service account. On the exam, the first action after a leaked credential is always to revoke or rotate it; deleting the commit or rewriting history does not make the secret safe, because it may already have been copied.

Compliance evidence from GitHub

Auditors ask two kinds of question about a GitHub enterprise. The first is about the customer's own controls: who has access, how changes are reviewed, how secrets are handled. The audit log, rulesets, access exports and the response plan answer those. The second is about GitHub's controls as a service provider. For that, enterprise owners can download compliance reports from the enterprise settings, including SOC 1 Type 2 and SOC 2 Type 2 reports, an ISO/IEC 27001:2022 certificate, CSA CAIQ and CSA STAR documents, a PCI DSS attestation of compliance, quarterly bug bounty reports and GitHub's continuity and incident management plan. The exam may ask where to find them or who can download them; the answer is the enterprise's compliance settings, as an enterprise owner.

The split between the two kinds of evidence is a shared responsibility model. GitHub is responsible for running the service securely and proves it with its reports. The customer is responsible for configuring the service well and proves it with its own evidence. A SOC 2 report from GitHub does not show that a customer required reviews on its main branches, and an auditor who asks for that should be shown rulesets, their history in the audit log and examples of pull requests that were blocked.

Worked problem

Answering an auditor

Ottoline asks for evidence that, between August and October, nobody bypassed the enterprise baseline ruleset without a pull request, and that GitHub itself is independently audited. It is now late November. What should the platform team provide?

Show solution
  1. The built-in audit log keeps most events 180 days, so August events are still there, but the SIEM stream is the long-term record and is easier to query.
  2. Search for ruleset bypass events and confirm each was a pull request merged by the platform-oncall team.
  3. Export the ruleset definition and its change history to show the rule was in force throughout.
  4. Download GitHub's SOC 2 Type 2 report from the enterprise's compliance settings.

Answer: Bypass events from the stream, the ruleset definition and history, and GitHub's SOC 2 Type 2 report. The first two are Skerry's evidence; the third is GitHub's.

Common mistakes

  • MistakeOverriding an enforced enterprise policy at organization level.

    InsteadOrganizations can only restrict further; change the enterprise policy or choose no policy there.

  • MistakeExpecting a repository ruleset to switch off an organization ruleset.

    InsteadAll applicable rulesets apply; the most restrictive rule wins.

  • MistakeRelying on the built-in audit log for a year of evidence.

    InsteadMost events are kept 180 days and Git events seven; stream for longer retention.

  • MistakeRewriting history as the first step after a leaked secret.

    InsteadRevoke or rotate the credential first; history rewriting does not undo exposure.

  • MistakeEnabling features repository by repository across hundreds of repositories.

    InsteadUse security configurations, set a default for new repositories and enforce where needed.

Summary and key terms

  • Enterprise policies are enforced or left to organizations; lower levels can only restrict what higher levels allow.
  • Rulesets from every level apply together and the most restrictive rule wins; target by custom property and keep bypass lists short.
  • The audit log keeps most events 180 days and Git events seven; streaming to storage or a SIEM gives longer retention and is delivered at least once.
  • Secret scanning and push protection need Secret Protection, and CodeQL and dependency review need Code Security, for private repositories; security configurations apply them at scale.
  • A response plan covers reporting, triage, containment, fixing, recording and review; revoke or rotate leaked credentials first.
Enterprise policy
A setting an enterprise owner enforces across all organizations, or leaves to them with no policy.
Ruleset
A named set of rules for branches, tags or pushes with targets, enforcement status and a bypass list.
Custom property
Metadata on repositories used to target rulesets and configurations.
Audit log streaming
Continuous delivery of enterprise audit events to an external endpoint.
Security configuration
A reusable set of security feature settings applied to many repositories.
Delegated bypass
A push protection setting that requires approval before a blocked secret can be pushed.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. How long are Git events kept in the built-in audit log?

    Show answer

    Seven days; most other events are kept 180 days.

  2. Two rulesets apply to main: one requires one approval, the other two. How many are needed?

    Show answer

    Two; the most restrictive rule wins.

  3. What is the first step after a credential is pushed to a repository?

    Show answer

    Revoke or rotate the credential.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz