MSBA-361 · Lesson 8 of 12 · 18 min

Security configurations for organizations

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

None of the 712 in-scope repositories had been switched on by hand. Every one of them had code scanning because a security configuration said so. The eighth session went back to the configurations that MSBA-291 had set up for governance and MSBA-360 had used for secret scanning, and looked at them from the code security side: what they control, how inheritance and enforcement work, and how to change them without surprising anyone.

What a security configuration is

A security configuration is a named collection of security settings that can be applied to many repositories at once. Instead of enabling secret scanning, push protection, Dependabot, dependency graph and code scanning repository by repository, an administrator defines a configuration once and attaches it to repositories. When the configuration changes, every attached repository changes with it.

A hierarchy diagram. At the top, enterprise configurations: Skerry baseline and Skerry code security, both enforced. Below, organization configuration Stores restricted in skerry-stores. Below that, groups of repositories attached to each configuration, chosen by custom property values. A side panel lists organization global settings that apply regardless of configuration.
Skerry's configurations and how they attach to repositories.

Configurations exist at two levels. Organization configurations are created by organization owners and security managers and apply within one organization. Enterprise configurations are created by enterprise owners and can be applied to repositories across the organizations in the enterprise. GitHub also offers a GitHub-recommended configuration, maintained by GitHub, which enables the features GitHub suggests for most repositories and changes when GitHub's recommendations change.

Kinds of security configuration.
Configuration typeWho manages itWhen to use it
GitHub-recommendedGitHubSmall organizations that want sensible defaults without maintenance
Custom organization configurationOrganization owners and security managersSettings specific to one organization
Enterprise configurationEnterprise ownersConsistent settings across all organizations

What a configuration controls

A configuration sets, for each feature, whether it is enabled, disabled or left as it is. For code security, the relevant settings are the following.

Settings in a configuration that matter for code security. Names in the product can differ slightly.
SettingEffectSkerry code security configuration
GitHub Code SecurityWhether the repository uses a Code Security licenseEnabled
Code scanning default setupTurns on CodeQL default setupEnabled
Dependency graph and automatic dependency submissionBuilds the graph Dependabot and dependency review needEnabled
Dependabot alerts and security updatesAlerts on vulnerable dependencies and fix pull requestsEnabled
GitHub Secret Protection, secret scanning, push protectionThe features from MSBA-360Enabled
Private vulnerability reportingLets outside researchers report vulnerabilities privately (public repositories)Not applicable to private repositories
EnforcementWhether lower levels can change the settingsEnforced

When a configuration enables Code Security or Secret Protection, the page shows an estimate of how many additional active committers would be billed if it were applied to the selected repositories. Lorcan made that estimate a required check before any configuration change at Skerry, because attaching a paid configuration to a few hundred general repositories by mistake would have added hundreds of committers to the bill.

Attaching configurations

A configuration does nothing until it is attached to repositories. Owners and security managers can attach configurations to selected repositories, to all repositories, or to repositories that match a filter, and can set a configuration as the default for new repositories of each visibility, so that a repository created tomorrow is protected from its first commit.

Skerry attached configurations by custom property. Repositories with data-classification set to confidential or restricted got Skerry code security; all others got Skerry baseline, which included Secret Protection only where MSBA-360's rules required it and free features otherwise. In skerry-stores, restricted repositories got the organization configuration Stores restricted, which added delegated bypass for push protection and delegated alert dismissal for code scanning.

One gap appeared in practice. When a developer changed a repository's data classification from general to confidential, the configuration did not change by itself; attaching is an action, not a rule that keeps running. Eight repositories had slipped through that way before the coverage view in lesson 6 showed them. Amadou Ferrand-Bakari wrote a small GitHub App that listened for custom property changes and reapplied the right configuration within minutes, using the configurations API.

Attaching a configuration to a repository with the REST API. The configuration ID and repository ID are placeholders; check the API reference.
gh api -X POST /orgs/skerry/code-security/configurations/{configuration_id}/attach \
  -f scope=selected \
  -F "selected_repository_ids[]=123456789"

Enforcement

By default, a repository administrator can change security settings on their own repository even if a configuration set them. Enforcing a configuration prevents that: repository administrators cannot change the enforced settings, and the repository cannot be detached from the configuration except by the people who manage it. Since September 2026, enterprise configurations can also be enforced so that organization owners cannot change or detach them, which closed a gap where an organization owner could override an enterprise decision.

What enforcement prevents.
Enforcement levelWho can change the settings on a repository
Not enforcedRepository administrators, organization owners, security managers
Enforced for repositoriesOrganization owners and security managers, not repository administrators
Enforced for repositories and organizations (enterprise configurations)Enterprise owners only

Skerry enforced both enterprise configurations at the strongest level. The decision had one cost: when a repository genuinely could not run default setup, such as the firmware repositories, nobody below the enterprise could switch default setup off to replace it with an advanced workflow. The platform team created a small enterprise configuration, Skerry code security advanced, identical to the main one except that it left code scanning default setup unset, and attached it to the 57 advanced setup repositories by a custom property value, codeql-setup set to advanced.

Organization global settings

Some settings are not part of any configuration but apply across the organization. These global settings include, for code scanning, whether Copilot Autofix is enabled, whether default setup recommends the extended query suite, which runners default setup uses, and whether agentic autofix is enabled, subject to the enterprise policy from lesson 4. For secret scanning they include custom links shown in push protection messages and bypass settings, which MSBA-360 covered.

Global settings at Skerry.
Global settingSkerry's choice
Copilot Autofix for CodeQLOn, except in the firmware repositories' organization-level exclusion
Extended query suite in default setupOff for most; on for skerry-stores
Runner for default setupStandard hosted runners; labeled self-hosted runners in skerry-stores
Agentic autofixOnly in skerry-sandbox during the pilot
Custom push protection linkThe internal guide to handling a blocked secret

Changing a configuration safely

Because a configuration change reaches every attached repository, it deserves the same care as a ruleset change in MSBA-291. Skerry used a short procedure.

Skerry's configuration change procedure.
StepAction
1Write down the change, the reason and the affected repository count from the configuration page
2Check the license estimate if Code Security or Secret Protection is involved
3Copy the configuration, apply the change to the copy, and attach the copy to a pilot set of repositories
4Watch coverage, tool status and alert counts for a week
5Apply the change to the main configuration and detach the copy
6Record the change in the governance repository

The procedure caught one problem in November. Switching default setup to the extended suite in a copy attached to forty commerce repositories doubled their alerts in a week, most of them medium severity in test helpers. The team kept the default suite for commerce and paired the change with a path exclusion before trying again.

Configurations on GitHub Enterprise Server

Security configurations also exist on GitHub Enterprise Server in recent versions, with differences in timing and availability. The GH-500 administration domain asks candidates to understand that features can differ between Enterprise Cloud and Enterprise Server. Skerry no longer ran Enterprise Server after the store systems migration in MSBA-291, but Freya kept a note that any customer of Skerry's software running its own appliance would need to check its version's documentation.

Tidewater's single configuration

Priya's view from Tidewater was simpler. On GitHub Team, Tidewater used one organization configuration based on the GitHub-recommended configuration, with push protection, Dependabot and code scanning default setup, applied to every repository and set as the default for new ones. Because TrailCheck was public, code scanning cost nothing; the private guidebook repository used only the free features. One configuration was enough, and she wrote down the reason so that the next administrator would not complicate it without cause.

Worked problem

Fixing a configuration gap

A repository holding restricted payment data has code scanning disabled, even though Skerry code security is enforced. Its data-classification property says general. What happened, and what should change?

Show solution
  1. Recognize that configurations are attached by action, not continuously re-evaluated from properties.
  2. Correct the custom property to restricted.
  3. Attach the correct configuration, or let the property-watching app do it.
  4. Check the coverage view for other repositories whose property and configuration disagree, and make the property required with no default.

Answer: The property was wrong, so the wrong configuration was attached. Fix the property, attach Skerry code security, and audit coverage for similar mismatches.

Designing the set of configurations

A configuration is easy to create and hard to retire, because every attached repository depends on it. Skerry's rule was to keep the set small and to name each configuration for who it serves, not for what it contains. By November, Skerry had four: the enterprise configurations Skerry baseline, Skerry code security and Skerry code security advanced, and the organization configuration Stores restricted in skerry-stores. Each had a clear audience, and each was attached by custom property values rather than by hand.

Deciding whether a new configuration variant is justified.
QuestionIf yesIf no
Does the difference change a security feature's setting?Consider a variantHandle it in the repository, not in a configuration
Will more than a handful of repositories need it?A variant is worth maintainingUse a documented exception instead
Can a custom property describe which repositories need it?Attach by property so new repositories follow automaticallyReconsider; manual attachment drifts

The firmware team asked for a fifth configuration with Autofix off. It failed the first test: Autofix is controlled by a repository and organization setting, not by the configuration, so the request was handled with the repository setting and a note in the governance repository instead.

Exceptions

Some repositories will always need something different, and pretending otherwise leads to people detaching configurations quietly. Skerry's exception process was a short issue in the governance repository stating the repository, the setting that would differ, the reason, the owner and a review date. Ottoline wanted every exception to have a review date of no more than six months. In November there were five exceptions, three of them for the legacy point-of-sale repositories that ran the CodeQL CLI on their own build servers and uploaded results.

Checking attachment over time

Configurations drift as repositories are created, transferred and archived. The weekly coverage check from lesson 6 caught repositories that were not analyzed, and Amadou's GitHub App reapplied configurations when properties changed. Seraphine added one more check to the monthly scorecard: a count of in-scope repositories with no configuration attached. In the first month it found eight, all created by a script that bypassed the organization default by setting properties after creation; the script was changed to set properties in the creation call.

Configurations and the exam

The GH-500 administration domain asks candidates to know how security configurations are created, attached and enforced at organization and enterprise level, how they interact with organization global settings, and what happens to new repositories. Priya's notes listed the points she expected to be tested: GitHub-recommended and custom configurations; attaching by selection or by default for new repositories; enforcement that stops repository administrators changing the settings a configuration controls; global settings, such as Autofix and the handling of some secret scanning options, that sit outside configurations; and the enterprise-level configurations that organizations can use but not edit. She added one warning to herself about wording: when a question asks who can change an enforced setting, read carefully whether it means a repository administrator, an organization owner or an enterprise owner, because the answers differ.

Common mistakes

  • MistakeEnabling features repository by repository.

    InsteadUse configurations so settings are consistent and changes apply everywhere.

  • MistakeAssuming configurations follow property changes automatically.

    InsteadReattach after property changes, or automate it.

  • MistakeAttaching a paid configuration without checking the license estimate.

    InsteadRead the committer estimate before applying.

  • MistakeEnforcing a configuration that some repositories cannot meet.

    InsteadProvide a variant configuration for justified exceptions, such as advanced setup repositories.

Summary and key terms

  • Security configurations apply a named set of security settings to many repositories at once.
  • They exist at organization and enterprise level, plus a GitHub-recommended configuration.
  • Configurations can be attached by selection, filter or as defaults for new repositories.
  • Enforcement stops repository administrators, and for enterprise configurations organization owners, changing settings.
  • Global settings cover organization-wide options such as Autofix, query suite recommendations and runners.
  • The license estimate shows the committer impact of enabling paid products.
  • Change configurations through copies and pilots, and record the change.
Security configuration
A named collection of security settings applied to many repositories.
GitHub-recommended configuration
A configuration maintained by GitHub with its suggested settings.
Enterprise configuration
A security configuration created at enterprise level for use across organizations.
Enforced configuration
A configuration whose settings cannot be changed at lower levels.
Global settings
Organization-wide security options that apply regardless of the attached configuration.
Default for new repositories
A configuration automatically attached to repositories as they are created.

Practice problems

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

  1. What does enforcing a configuration prevent?

    Show answer

    Repository administrators, and for enterprise-enforced configurations organization owners, changing or detaching its settings.

  2. Why did Skerry create a separate configuration for advanced setup repositories?

    Show answer

    The enforced main configuration turned on default setup, which those repositories needed to replace with a workflow.

  3. What should be checked before attaching a configuration that enables Code Security?

    Show answer

    The estimate of additional active committers that would be billed.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz