Skip to content
  • There are no suggestions because the search field is empty.

GitHub CODEOWNERS file exists

Checks that the branch of every selected GitHub repository has a CODEOWNERS file in .github/, the root or docs/, optionally without errors.

GitHub CODEOWNERS file exists

This check verifies that every selected GitHub repository has a CODEOWNERS file, which names who must review changes to which code. Without it, a rule that asks for a review by the code owners has nothing to enforce. It answers the question an auditor asks: is it clear who owns your sensitive code, and can you show that you keep checking?

In short: ISOPlanner reads where the CODEOWNERS file of your repositories is through the ISOPlanner for GitHub - code app, which an owner of your organization installs with read-only permissions. A branch passes when .github/, the root or docs/ holds a CODEOWNERS file that is not empty and, when you ask for it, has no errors. When one repository fails, the run is rejected and a task is created that names per repository what to fix on GitHub. Every scheduled run is kept as evidence and is linked to the controls named below. The check is one of the six checks of the GitHub app in the Store, and the only one that uses the code app.

What the check verifies

For each branch a rule names, the check looks for the file where GitHub does: in .github/, the root, then docs/. A branch passes when the file is there and not empty. With The file must be valid on, errors GitHub reports in it, such as an owner that does not exist, fail it too. ISOPlanner reads where the file is, its size and the errors; it never keeps the file. The run is accepted when every evaluated repository passes.

FrameworkControls this check gives evidence for
ISO 27001:2022A.8.4 Access to source code, A.8.25 Secure development life cycle
SOC 2CC8.1 Change management
NIS2 Quality Mark (Substantial and High)6.1 Access to the source code, 6.3 Developing secure software

When you add the check, ISOPlanner links it to the controls in this table of the frameworks your organization uses, and to the controls of your other frameworks that are related to them. A framework you add later is linked the same way. The NIS2 Quality Mark has three levels (Basic, Substantial and High) and your organization uses one of them; each NIS2 row names the levels it applies to. You can change the links. The check is evidence for these controls; it does not cover them completely.

Before you start

  • Automated control monitoring is part of the Business and Premium subscriptions of ISOPlanner.
  • The check belongs to the GitHub app. Add the app first: go to Administration > Store, click More info on the GitHub tile and then Start free trial. The trial takes 30 days and renews into a paid subscription unless you cancel it. If your organization already uses another GitHub check, this check is already there.
  • You need a licensed manager or administrator role in ISOPlanner to add the app and to set up the check.
  • An organization on GitHub.com: personal accounts and GitHub Enterprise Server are not supported. The check works on every GitHub plan.
  • An owner of the GitHub organization installs the GitHub code app and connects it in ISOPlanner; anyone else is refused.
  • To make a failing repository pass, somebody with write access adds or corrects the CODEOWNERS file.

The code app asks for read access only, and only this check uses it:

PermissionWhy
Repository: Contents (read)Finds the CODEOWNERS file and reads the errors GitHub reports in it. Needed by this check only.
Repository: Metadata (read)Lists the repositories granted to the code app.

Contents read gives access to the code of the granted repositories, which is why it is a separate app. You may grant it only the repositories whose CODEOWNERS file you want checked.

1. Connect GitHub

You connect once. This check has a connection of its own, the GitHub code app; the other five GitHub checks share the ISOPlanner GitHub App.

  1. Go to Administration > Settings > Automation, open the tab Control monitoring and click the card GitHub CODEOWNERS file exists.
  2. Under Authorization click Connect GitHub code app, then Continue to GitHub.
  3. Sign in on GitHub as an owner. If the code app is not installed yet, choose the organization and the repositories, and approve the read permissions.
  4. GitHub returns you to ISOPlanner, and the dialog says that it is connected to your GitHub organization.

The Connect the GitHub code app dialog with the read permissions the code app asks for

Finish on GitHub within 15 minutes. ISOPlanner stores no password or token, only the installation. To change which repositories the code app sees, or to remove it, click Manage on GitHub; Reconnect GitHub code app connects again.

2. Set the options

Repositories

Click Test under Test and manage results, then Repositories.

OptionWhat it does
All repositories granted to the appThe default. Every repository the app can see, also one you grant it later.
Repositories to leave outWith all repositories: names not checked, one per line, at most 100.
Only the repositories named belowOnly the names under Repository names, 1 to 100.
Include archived repositoriesOff by default.
Include forksOff by default.

Options

Click Options. The default branch rules hold for every repository without rules of its own; Add branch rule adds one, at most 10.

OptionWhat it does
BranchEmpty by default: the default branch of each repository. Or the name of a branch.
The file must be validOff by default. On: a file with errors fails.
A checklist item per repositoryOn by default. Off: one checklist item lists the repositories that do not comply.

For rules of their own, select repositories in the result and click Repository settings (at most 200 repositories); Use default rules undoes it. A rule names a branch, not a pattern such as release/*. A run evaluates at most 200 repositories and makes at most 1,500 calls to GitHub.

3. Test and read the result

The test starts when you open the dialog; Run starts it again after you change the repositories or the rules. A test shows the result and stores nothing.

ColumnWhat it shows
RepositoryThe repository; (own rules) when it has rules of its own.
RuleThe branch: default branch, or its name.
FoundWhere the file is, for example .github/CODEOWNERS, with the number of errors and the first ones; missing; or why the rule fails.

Above the table the result reads Compliant or Not compliant, with the number of repositories evaluated and failing. An icon marks each row that passes or fails.

4. Schedule and switch on

  1. In the test dialog choose the Incident response template: the task template ISOPlanner uses when a run is rejected. Give the template an assignee.
  2. Under Set a schedule click Schedule. The check can run daily at most.
  3. Under Status switch the check to Active.

From then on every run stores Evidence Accepted or Evidence Rejected. A rejected run creates a task from the template with one checklist item per failing repository: what was found and where to change it. How the results show in the annual plan, on dashboards and on the controls is in Automated Control Monitoring.

The statuses at a glance

CODEOWNERS file per branch

FoundMeaningWhat to do
The path of the fileIt passes.Nothing.
The path with (errors: n)Errors, listed under it. It fails only when the file must be valid.Fix those lines on GitHub.
There is no CODEOWNERS fileIt fails.Add .github/CODEOWNERS naming the owners of sensitive code.
The CODEOWNERS file is emptyIt names no owner. It fails.Add at least one line with an owner.
The CODEOWNERS file has errorsOnly when the file must be valid. It fails.Fix the errors on GitHub.
The branch does not exist.It fails.Correct the branch name of the rule.
The repository does not exist or is not granted to the ISOPlanner for GitHub - code app.It fails.Grant it to the code app on GitHub, or correct the selection.

The outcome of a run and the status of the check

StatusMeaning
Evidence AcceptedEvery evaluated repository passed.
Evidence RejectedAt least one repository failed, no repository was left to evaluate, or not every repository could be read.
ActiveThe check runs on its schedule.
Needs AttentionThe check is switched on but the GitHub connection is not authorized, for example because the app was removed or suspended, or a new permission was not accepted.
DisabledThe check does not run. This is the status right after you add the app.

Questions and troubleshooting

The file is there, but the check says it is missing

The check looks on the branch of the rule, in .github/, the root and docs/ only. A file in another folder or on another branch does not count.

The repositories are granted, but there is no repository to evaluate

They are granted to the ISOPlanner GitHub App, not to the code app. Grant them to the code app on GitHub; the two apps have their own repository lists.

Only an owner of the GitHub organization can connect it to ISOPlanner.

A member can only request the installation. An owner approves it on GitHub and clicks Connect GitHub code app.

The app was installed on a personal GitHub account.

Install it on your organization instead.

This GitHub installation could not be matched to your request.

The steps on GitHub took over 15 minutes or were started by someone else. Click Connect GitHub code app again.

The app is no longer installed, is suspended, or asks for a permission that was not accepted

The check shows Needs Attention. An owner fixes it on GitHub (Open on GitHub in the dialog), then tests the connection again.

No repository to evaluate

None of the repositories granted to the code app fits the selection. Grant repositories on GitHub or widen the selection.

Not every repository was evaluated

The selection holds more repositories or branches than one run reads, so every run is rejected. Narrow the selection.

I cannot delete the check

A check of an app you subscribe to cannot be removed, only switched to Disabled. To stop paying for the GitHub app, cancel it in the Store. Both GitHub apps stay installed until an owner uninstalls them on GitHub (organization Settings > GitHub Apps).

Related articles