Skip to main content
Version: 0.8

GitHub Settings

This is the individual plugin for polling github settings for organizations and repositories to test for configuration flags that are going to fail compliance checks.

It authenticates to a GitHub organization with a personal access token or as a GitHub App installation (see GitHub App authentication). In the future it should query security plans & repositories for specific settings

This page is for operators who run the plugin-github-settings plugin with the CCF Agent, and for developers who write policies for it. It documents v0.8.0 and is generated from the plugin's README at v0.8.0.

How it works​

Usage​

You can use this plugin by passing it to the compliance agent

agent --plugin=[PATH_TO_YOUR_BINARY]

Requirements​

Prerequisites​

  • GoReleaser https://goreleaser.com/install/
  • A Github Fine Grain Personal Access Token, or a GitHub App with the equivalent read-only organization permissions (Administration, Members), with the following scopes:
    • read:org for the organization to be queried. Note - you might need to be an administrator of the GH Org to work correctly
    • read:members to be able to read teams

IP allow-list data​

GitHub organization IP allow-list collection is disabled by default. Enable it only when the plugin is configured with a Classic Personal Access Token with organization administrator permissions. Classic PATs are broad credentials, so prefer leaving collect_ip_allow_list set to false unless IP allow-list policies are required.

Fine-grained Personal Access Tokens and GitHub App installation tokens may be able to read other organization settings, but GitHub does not currently allow them to query organization.ipAllowListEntries through GraphQL.

If IP allow-list data cannot be fetched, the plugin continues with partial data and policies that depend on ip_allow_list should report a skip reason instead of evaluating incomplete evidence.

Configuration​

Plugin Configuration​

The plugin configuration must be created and managed by the agent, but expects the following configuration keys to be set, otherwise it will fail.

Plugins read their configuration from environment variables, when the path matches the yaml structure.

In the example above, setting an empty token, and an environment variable CCF_PLUGINS_GITHUB_CONFIG_TOKEN will use the environment variable.

export CCF_PLUGINS_GITHUB_CONFIG_TOKEN="github_pat_1234..."
export CCF_PLUGINS_GITHUB_CONFIG_COLLECT_IP_ALLOW_LIST="false"
---
plugins:
github:
config:
token: "" # Will be read from the CCF_PLUGINS_GITHUB_CONFIG_TOKEN environment variable
organization: test-org # The name of the organization
collect_ip_allow_list: false # Set to true only when using a Classic PAT and IP allow-list evidence is required

GitHub App authentication​

Instead of a token, the plugin can authenticate as a GitHub App installed on the organization. Organizations can govern apps centrally, and the plugin only ever holds short-lived installation tokens, which it renews as they expire.

  1. Create a GitHub App (organization Settings → Developer settings → GitHub Apps) with read-only Administration and Members organization permissions, and generate a private key for it.
  2. Install the app on the organization.
  3. Configure the plugin with the app's ID, the installation's ID (the number at the end of the installation's settings URL) and the private key:
---
plugins:
github:
config:
app_id: "123456"
installation_id: "78901234"
# The PEM file the app's "Generate a private key" downloads (preferred), or
private_key_file: /etc/ccf/github-app.pem
# the key inline, as PEM or base64-encoded PEM, e.g. from
# CCF_PLUGINS_GITHUB_CONFIG_PRIVATE_KEY
# private_key: ""
organization: test-org

A token, when set, takes precedence over the app settings. As noted above, GitHub does not let app installation tokens read IP allow-list entries, so keep collect_ip_allow_list off.

Policy input​

The plugin evaluates one kind of resource, a GitHub organization (the one set in the plugin's organization setting), and a policy receives one document per run as input. There is no separate repository document. The document has five top-level keys: settings, teams, members, sso and ip_allow_list. settings, teams and members are always present; sso and ip_allow_list are null when they could not be collected. The plugin continues with partial data when the teams, members, SSO or IP allow-list requests fail, so a policy should check for an empty or null value before it judges one. Fields of GitHub objects are left out of the document when GitHub does not return them, not null, so test for them with object.get or a default. A bundle is matched by its name, plugin-github-settings-policies. Fields are listed by their path inside the document.

FieldTypeDescription
settingsobjectThe organization as GitHub's GET /orgs/{org} returns it. Every field below is left out when GitHub does not return it, so test with a default.
settings.loginstringOrganization login name.
settings.idintegerNumeric organization ID.
settings.node_idstringGraphQL node ID.
settings.namestringDisplay name.
settings.descriptionstringOrganization description.
settings.companystringCompany name.
settings.blogstringWebsite URL.
settings.locationstringLocation.
settings.emailstringPublic contact email.
settings.twitter_usernamestringTwitter/X username.
settings.billing_emailstringBilling email address.
settings.typestringAccount type, Organization.
settings.html_urlstringWeb URL of the organization.
settings.urlstringAPI URL of the organization.
settings.avatar_urlstringAvatar image URL.
settings.created_atstring (RFC 3339 time)When the organization was created.
settings.updated_atstring (RFC 3339 time)When the organization was last updated.
settings.archived_atstring (RFC 3339 time)When the organization was archived.
settings.public_reposintegerNumber of public repositories.
settings.public_gistsintegerNumber of public gists.
settings.followersintegerNumber of followers.
settings.followingintegerNumber of accounts followed.
settings.total_private_reposintegerTotal private repositories.
settings.owned_private_reposintegerPrivate repositories owned by the organization.
settings.private_gistsintegerNumber of private gists.
settings.disk_usageintegerDisk usage in kilobytes.
settings.collaboratorsintegerNumber of collaborators.
settings.planobjectBilling plan: name (string), space, collaborators, private_repos, filled_seats and seats (integers). Left out unless the token may see billing details.
settings.two_factor_requirement_enabledbooleanWhether members must use two-factor authentication.
settings.is_verifiedbooleanWhether the organization's domains are verified.
settings.has_organization_projectsbooleanWhether organization projects are enabled.
settings.has_repository_projectsbooleanWhether repository projects are enabled.
settings.default_repository_permissionstringBase permission members have on repositories, for example read.
settings.default_repository_branchstringDefault branch name for new repositories.
settings.members_can_create_repositoriesbooleanWhether members may create repositories.
settings.members_can_create_public_repositoriesbooleanWhether members may create public repositories.
settings.members_can_create_private_repositoriesbooleanWhether members may create private repositories.
settings.members_can_create_internal_repositoriesbooleanWhether members may create internal repositories.
settings.members_allowed_repository_creation_typestringWhich repository types members may create: all, private or none.
settings.members_can_fork_private_repositoriesbooleanWhether members may fork private repositories.
settings.members_can_create_pagesbooleanWhether members may publish GitHub Pages.
settings.members_can_create_public_pagesbooleanWhether members may publish public Pages sites.
settings.members_can_create_private_pagesbooleanWhether members may publish private Pages sites.
settings.members_can_create_teamsbooleanWhether members may create teams.
settings.members_can_delete_repositoriesbooleanWhether members may delete repositories.
settings.members_can_change_repo_visibilitybooleanWhether members may change repository visibility.
settings.members_can_invite_outside_collaboratorsbooleanWhether members may invite outside collaborators.
settings.members_can_delete_issuesbooleanWhether members may delete issues.
settings.members_can_view_dependency_insightsbooleanWhether members may view dependency insights.
settings.deploy_keys_enabled_for_repositoriesbooleanWhether repositories may use deploy keys.
settings.web_commit_signoff_requiredbooleanWhether web-based commits must be signed off.
settings.readers_can_create_discussionsbooleanWhether readers may create discussions.
settings.display_commenter_full_name_setting_enabledbooleanWhether commenters' full names are shown.
settings.advanced_security_enabled_for_new_repositoriesbooleanWhether Advanced Security is on for new repositories.
settings.dependabot_alerts_enabled_for_new_repositoriesbooleanWhether Dependabot alerts are on for new repositories.
settings.dependabot_security_updates_enabled_for_new_repositoriesbooleanWhether Dependabot security updates are on for new repositories.
settings.dependency_graph_enabled_for_new_repositoriesbooleanWhether the dependency graph is on for new repositories.
settings.secret_scanning_enabled_for_new_repositoriesbooleanWhether secret scanning is on for new repositories.
settings.secret_scanning_push_protection_enabled_for_new_repositoriesbooleanWhether secret scanning push protection is on for new repositories.
settings.secret_scanning_push_protection_custom_link_enabledbooleanWhether a custom push protection link is shown.
settings.secret_scanning_push_protection_custom_linkstringThe custom push protection link.
settings.secret_scanning_validity_checks_enabledbooleanWhether secret scanning validity checks are on.
teamsarray of objectsEvery team in the organization, all pages collected. An empty array when there are none or when the teams request failed.
teams[].idintegerTeam ID. Left out when GitHub does not return it.
teams[].node_idstringGraphQL node ID. Left out when GitHub does not return it.
teams[].namestringTeam name. Left out when GitHub does not return it.
teams[].slugstringURL slug of the team. Left out when GitHub does not return it.
teams[].descriptionstringTeam description. Left out when GitHub does not return it.
teams[].privacystringsecret or closed. Left out when GitHub does not return it.
teams[].permissionstringDefault repository permission of the team. Left out when GitHub does not return it.
teams[].notification_settingstringTeam notification setting. Left out when GitHub does not return it.
teams[].html_urlstringWeb URL of the team. Left out when GitHub does not return it.
teams[].urlstringAPI URL of the team. Left out when GitHub does not return it.
teams[].members_urlstringAPI URL template for team members. Left out when GitHub does not return it.
teams[].repositories_urlstringAPI URL of the team's repositories. Left out when GitHub does not return it.
teams[].parentobjectParent team, same fields as a team. Left out for a top-level team.
membersarray of objectsOrganization members with the owner/admin role only, all pages collected. An empty array when there are none or when the request failed.
members[].loginstringAccount login. Left out when GitHub does not return it. The other fields GitHub's user list returns, such as gravatar_id and the *_url links, appear the same way.
members[].idintegerAccount ID. Left out when GitHub does not return it. The other fields GitHub's user list returns, such as gravatar_id and the *_url links, appear the same way.
members[].node_idstringGraphQL node ID. Left out when GitHub does not return it. The other fields GitHub's user list returns, such as gravatar_id and the *_url links, appear the same way.
members[].typestringAccount type, User. Left out when GitHub does not return it. The other fields GitHub's user list returns, such as gravatar_id and the *_url links, appear the same way.
members[].site_adminbooleanWhether the user is a GitHub site administrator. Left out when GitHub does not return it. The other fields GitHub's user list returns, such as gravatar_id and the *_url links, appear the same way.
members[].html_urlstringWeb URL of the profile. Left out when GitHub does not return it. The other fields GitHub's user list returns, such as gravatar_id and the *_url links, appear the same way.
members[].urlstringAPI URL of the user. Left out when GitHub does not return it. The other fields GitHub's user list returns, such as gravatar_id and the *_url links, appear the same way.
members[].avatar_urlstringAvatar image URL. Left out when GitHub does not return it. The other fields GitHub's user list returns, such as gravatar_id and the *_url links, appear the same way.
ssoobject or nullSAML single sign-on state. null when the SSO request failed with an error other than not-found, so check for it before reading sso.enabled.
sso.enabledbooleanTrue when the organization has a SAML identity provider. False when GitHub answers 404 or reports none.
sso.sso_urlstringSign-on URL of the identity provider. Empty when SSO is not enabled.
sso.idp_issuerstringIssuer of the identity provider. Empty when SSO is not enabled.
ip_allow_listarray of objects or nullIP allow-list entries. Only collected when collect_ip_allow_list is true; null when it is off or when collection failed, an empty array when collected and the organization has no entries.
ip_allow_list[].allow_list_valuestringIP address or CIDR range.
ip_allow_list[].is_activebooleanWhether the entry is active.
ip_allow_list[].namestringEntry name.

An example input:

{
"settings": {
"login": "acme-example-org",
"id": 90210,
"node_id": "O_kgDOExample1",
"name": "Acme Example Org",
"description": "Fictional organization used for documentation",
"email": "security@acme-example.test",
"billing_email": "billing@acme-example.test",
"type": "Organization",
"html_url": "https://github.com/acme-example-org",
"url": "https://api.github.com/orgs/acme-example-org",
"created_at": "2021-04-12T09:30:00Z",
"updated_at": "2026-02-03T14:05:12Z",
"public_repos": 4,
"total_private_repos": 31,
"owned_private_repos": 31,
"two_factor_requirement_enabled": true,
"is_verified": true,
"default_repository_permission": "read",
"default_repository_branch": "main",
"members_can_create_repositories": false,
"members_can_create_public_repositories": false,
"members_can_create_private_repositories": false,
"members_can_fork_private_repositories": false,
"members_can_delete_repositories": false,
"members_can_invite_outside_collaborators": false,
"web_commit_signoff_required": true,
"dependabot_alerts_enabled_for_new_repositories": true,
"dependency_graph_enabled_for_new_repositories": true,
"secret_scanning_enabled_for_new_repositories": true,
"secret_scanning_push_protection_enabled_for_new_repositories": true
},
"teams": [
{
"id": 4410001,
"node_id": "T_kwDOExample1",
"name": "Platform",
"slug": "platform",
"description": "Platform engineering",
"privacy": "closed",
"permission": "pull",
"notification_setting": "notifications_enabled",
"html_url": "https://github.com/orgs/acme-example-org/teams/platform",
"url": "https://api.github.com/organizations/90210/team/4410001"
}
],
"members": [
{
"login": "octo-admin-example",
"id": 700001,
"node_id": "U_kgDOExample2",
"type": "User",
"site_admin": false,
"html_url": "https://github.com/octo-admin-example",
"url": "https://api.github.com/users/octo-admin-example"
}
],
"sso": {
"enabled": true,
"sso_url": "https://idp.acme-example.test/saml/sso",
"idp_issuer": "https://idp.acme-example.test/saml/metadata"
},
"ip_allow_list": [
{
"allow_list_value": "203.0.113.0/24",
"is_active": true,
"name": "Example office"
}
]
}

Subject templates​

The subject templates this plugin registers. Each example is built from sample data.

github-organization​

A GitHub organization. Title: GitHub Organization: {{ .organization }}. The evidence also carries provider (github) and type (organization) labels that are not part of the identity.

Identity keyDescription
organizationThe GitHub organization login name.

Example:

{
"name": "github-organization",
"type": "component",
"title": "GitHub Organization: acme-example-org",
"description": "GitHub organization acme-example-org",
"purpose": "Represents a GitHub organization being monitored for compliance",
"identityLabels": {
"organization": "acme-example-org"
}
}

Policies​

The policy bundles that work with this plugin, at their newest releases. The controls are the ones the bundle's policies list in their metadata.

BundleLatest versionControls coveredCompatible plugin lines
plugin-github-settings-policiesv0.4.2none listedlatest