ghtier

Run an assessment

ghtier-assess checks your GitHub organization against the checklist and lists who holds Tier 0 and Tier 1 access. It runs 25 checks on your own machine with a token you create, only reads, and writes two files next to it. ghtier never sees the results.

Before you start

  • The GitHub CLI (gh), jq and Node.js 18 or newer.
  • An organization owner account. Most settings are only visible to owners.
  • Or let an AI agent run it for you: see AI. It follows the same steps.

Choose what to assess

The GitHub parts run by default and need only the token below. Azure is optional: it needs read access in Entra ID, in Azure, or both, and is a separate step (see Azure and Entra ID). The runner's start screen offers the same choice.

Click a box to add or remove it. A box builds on the one above it, so it switches off with it.

You get

  • Pass, fail or review for each checklist item, with the evidence
  • A severity for each item that fails
  • Who holds Tier 0 and Tier 1: owners, organization roles, installed Apps, outside collaborators, deploy keys, secrets, runners and rulesets
  • The people, credentials and outsiders that can reach Tier 0, step by step
  • The fixes that cut the most paths, marked on the checklist after an import
  • What each job's GITHUB_TOKEN and secrets reach
  • Triggers such as pull_request_target where an outsider can start a path
  • Which repositories ask for OIDC tokens
  • Outsider paths confirmed where zizmor reports template injection in that workflow

You miss

  • Azure through OIDC: Paths stop at the OIDC token; what it unlocks in Azure is not shown. Also off: Entra ID, Azure resources.

Access you need

  • the read-only token
  • zizmor installed on your machine; it runs offline, with no token

Commands

node assess.mjs --org <org>

1. Create a read-only token

Use a fine-grained personal access token instead of your normal gh login. That login usually carries the T0repo scope, and on an owner account that reaches everything the owner can do. The runner never needs more than read.

Type your organization name to get a link that opens GitHub's token page with everything below filled in. GitHub does not let a link create the token, so you still check the form and click Generate.

Type the name to get the link.
  1. Resource owner: the organization you assess. The link sets it from the name you typed.
  2. Repository access: all repositories. The page selects it already. Leave it: choosing another option clears the repository permissions the link filled in.
  3. Expiration: 7 days.
  4. Repository permissions, each set to Read-only: Actions, Administration, Contents, Metadata.
  5. Organization permissions, each set to Read-only: Administration, Custom organization roles, Custom properties, Custom repository roles, Members, Secrets, Self-hosted runners, Webhooks.
  6. If the organization approves fine-grained tokens, approve the request as an owner.
  7. Keep the token in your own shell. Never paste it into a chat or a file you share.

Without the link, create it by hand at github.com/settings/personal-access-tokens/new with the settings above.

A read-only token cannot see who can bypass a ruleset (GitHub only shows it to a token with write access to the ruleset) or SSO credential authorizations. Those parts show as error or review in the results. If you need them, a classic token with admin:org, read:org and repo reads everything, but it can also write, so revoke it straight after.

2. Run it

Download these into an empty folder:

Check them, then run the assessment. It asks for the token and hides what you paste; set GH_TOKEN to skip the question, or add --gh-login to use your gh login instead. In a terminal it then shows what it will read and roughly how many API calls each part makes; choose with the arrow keys and space, and start with enter (--yes skips that screen):

shasum -a 256 -c --ignore-missing SHA256SUMS
node verify.mjs
node assess.mjs --org <org>

Large organizations: per-repository checks cover the first 200 repositories; add --max-repos N for more. Run node assess.mjs --help for every option, including --pin to refuse any data file that changed.

What it reads and writes

  • Every request is gh api --method GET. It sends no POST, PUT, PATCH or DELETE, and no GraphQL.
  • Check paths come from checklist.json, and only paths inside the organization you name are called.
  • It also reads who you are (/user), your role in the organization, and the access inventory: owners, organization roles, installed Apps, outside collaborators, runners and deploy keys.
  • It downloads the checklist and tier data from this site, and writes ghtier-assessment-<org>.json and ghtier-report-<org>.html in the folder you run it from. Nothing is sent anywhere else.
The 23 API paths the checks use
  • GET /orgs/{org}
  • GET /orgs/{org}/actions/permissions
  • GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval
  • GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos
  • GET /orgs/{org}/actions/permissions/workflow
  • GET /orgs/{org}/actions/runner-groups?per_page=100
  • GET /orgs/{org}/actions/runners/downloads
  • GET /orgs/{org}/actions/runners?per_page=100
  • GET /orgs/{org}/actions/secrets?per_page=100
  • GET /orgs/{org}/custom-repository-roles
  • GET /orgs/{org}/installations?per_page=100
  • GET /orgs/{org}/members?role=admin&per_page=100
  • GET /orgs/{org}/organization-roles
  • GET /orgs/{org}/properties/schema
  • GET /orgs/{org}/settings/immutable-releases
  • GET /repos/{org}/.github/contents/.github/SECURITY.md
  • GET /repos/{org}/.github/contents/SECURITY.md
  • GET /repos/{org}/.github/contents/docs/SECURITY.md
  • GET /repos/{owner}/{repo}/branches/{default_branch}/protection
  • GET /repos/{owner}/{repo}/codeowners/errors
  • GET /repos/{owner}/{repo}/immutable-releases
  • GET /repos/{owner}/{repo}/rules/branches/{default_branch}
  • GET /repos/{owner}/{repo}/rulesets?includes_parents=true&per_page=100

Optional: Azure and Entra ID

A workflow that asks for an OIDC token can act as an identity in Azure, with no secret. To follow attack paths there, azure.mjs reads which identities trust GitHub and what they can do, with your Azure CLI login, and writes a file the assessment reads. It is a separate step on purpose: the GitHub runner never touches your Azure login, and your cloud team can make the file and hand it over.

PartRead-only roleWhereAssigned by
Entra IDGlobal ReaderThe directorya Privileged Role Administrator or Global Administrator
Azure resourcesReaderthe Tenant Root Group, or each subscription in scopean Owner or User Access Administrator on the Tenant Root Group
  1. Get Global Reader in Entra ID (skip with --no-entra). An administrator opens Microsoft Entra admin center › Identity › Roles & admins › Global Reader › Add assignments and adds you. Microsoft's steps.
  2. Get Reader on the Tenant Root Group (skip with --no-azure). Its ID is the tenant ID. An administrator runs:
    az role assignment create --assignee <you@example.com> --role Reader \
      --scope /providers/Microsoft.Management/managementGroups/<tenant-id>
    To cover only some subscriptions, assign Reader on each and add --subscription <id,id>. A Global Administrator who holds neither role can elevate access, assign it, and turn elevation off again.
  3. Run azure.mjs, then the assessment with its file:
    az login --tenant <tenant-id>
    node azure.mjs --github-org <org>
    node assess.mjs --org <org> --cloud cloud-trust-<tenant-id>.json
  4. Remove the access when you are done. With Privileged Identity Management, make both assignments eligible instead, and activate them for the run.
  • Every call is a GET to Microsoft Graph or Azure Resource Manager. It never reads secret values, blobs or keys. Whatever the login cannot read is listed in the file and the report, not guessed.
  • The report shows which repository, branch or environment reaches each identity. It puts first any credential that lets many repositories, or any branch or pull request, act as an identity, ranked by what that identity holds: everyone who can push there holds it too. It also lists credentials to clean up: ones that trust a repository that was deleted, renamed or archived, or another organization. It reads both subject formats, including the one with owner and repository IDs that GitHub uses for repositories created since July 15, 2026.

How cloud access is tiered

A role is tiered by what its actions allow and where it is assigned; the highest row it matches wins. Tags and labels play no part.

Can doSubscription and aboveResource group or resource
Grant access
Can give any role, including its own, on the scope.
Tier 0Tier 1
Run code as, or take over, a managed identity
Code that runs as a managed identity gets everything that identity holds, anywhere.
Tier 0Tier 0
Tier 1 when no managed identity there holds rights elsewhere
Change Azure Policy
A deployIfNotExists or modify policy deploys resources with its assignment's managed identity, so changing one runs a deployment with that identity's rights.
Tier 0Tier 1
Full control
Can change every resource in the scope, including what runs as their managed identities and the access policies of their vaults.
Tier 0Tier 0
Tier 1 when no managed identity there holds rights elsewhere
Key Vault secrets or keys
Reads secret values or uses keys, or can give itself that access.
Tier 0Tier 1
Storage and other data roles
Reads or changes the data in the scope.
Tier 1Tier 1
Write on some resource types
Changes some resources in the scope.
Tier 1Tier 2
Read only
Sees configuration, where secrets are sometimes left (deployment parameters, some resource properties). AzTier rates Reader Tier 1 for that reason; ghtier keeps it at Tier 2 because it cannot read Key Vault or storage data on its own.
Tier 2Tier 2
The actions that run code as a managed identity

3. Read the results

  • pass, partial (a share of repositories) or fail: the check decided.
  • review: it ran, but a person has to decide, for example whether each installed App is wanted.
  • error: the token could not read it. The detail says which call failed.

Open the HTML report in a browser and print it to PDF if you need to share it. To work through the gaps, import the JSON file on the checklist, and compare it with a later run there to see what changed. Items without an automated check still need a person to answer them.

To build the report again from the JSON file, for example with a newer report.html, run node assess.mjs --report-from ghtier-assessment-<org>.json. It makes no GitHub calls and needs no token.

How the scores are calculated

The report opens with two scores from 0 to 100. They answer different questions, so the report keeps them in separate parts: posture is how the organization is configured, security is how far someone gets who is not an owner.

Posture score

How well the organization is configured against the checklist, weighted by how much each item protects. Each checked item counts with its value: pass is 100, partial its percentage, fail 0. Results a person has to review, or that could not be read, are left out, and the report says how many checks the score is based on. When checks holding more than a tenth of the weight could not be read, the report shows the number with "insufficient coverage" instead of a grade. Weight by severity: T0 4, T1 3, T2 2, T3 1, no severity 1.

Security score

How far someone gets who is not an owner: anyone on GitHub, a member, a developer with write, or someone holding a leaked credential. Each starting point earns its weight times the points for the highest tier it reaches. A starting point is measured only when everything it needs was read in full; one that already reaches Tier 0 in what was read counts anyway, since more data cannot make it better. A starting point that was not measured is left out and the others count for the full 100, and then the report shows the number with "insufficient coverage" instead of a grade. Points by the highest tier reached: Tier 0 0%, Tier 1 33%, Tier 2 67%, Tier 3 100%, nothing above Tier 3 100%.

Starting pointWeightMeasured by
Anyone on GitHub35The highest tier anyone with a GitHub account reaches, through workflows in public repositories. Needs: repositories and who has access to them, workflow files.
Organization member25The highest tier every member reaches, through the base permission, internal repositories and their workflows. Needs: repositories and who has access to them, the base permission, workflow files.
Developer with write25For each active repository, the highest tier write access to it leads to; the points are the average over all of them. Needs: repositories and who has access to them, workflow files.
Leaked credential15The highest tier any credential the run found reaches: deploy keys, installed Apps, and tokens and keys authorized for SAML SSO. Needs: repositories and who has access to them, deploy keys, installed github apps, credentials authorized for saml sso.

Grades: A from 90 (strong), B from 75 (good), C from 60 (fair), D from 40 (weak), E from 0 (poor).

Attack paths in your org

The first page of the report answers one question: who can reach Tier 0, through which chain, and which single change cuts the most of those chains. "Can reach" means it is possible with the access held today, not that anyone did it.

  • Starting points are people (members and outside collaborators) and credentials (deploy keys with write access, installed Apps, and on SAML organizations the tokens and SSH keys authorized for single sign-on). Approved fine-grained tokens are not included: only a GitHub App can list them.
  • Each step is one rule from the list below, seen in your organization's data. A chain stops at the first Tier 0 it reaches, at any length; the report folds chains longer than 6 steps.
  • Tier 0 is what ghtier tiers as Tier 0, such as Owner or All-repository admin. Tiers come only from what each grant allows; nothing depends on labels or custom properties you would have to set.
  • A step the token could not confirm is assumed, never left out, and marked with a dashed arrow and the reason. So is a step that rests on judgement instead of GitHub's documentation.
  • A fix counts as removing someone's reach only when they have no other way to Tier 0. --no-reach skips this part, --anonymize replaces logins with labels in both files, and --full-graph also writes everything collected to a third file.
  • It also reads each repository's workflow files (default branch, up to --max-repos): which jobs ask for OIDC tokens and for which subject, which secrets they use, who can start them, and the reviewers of their environments. On public repositories that includes anyone with a GitHub account, through triggers such as pull_request_target. A file in YAML it does not read (anchors, for example) is listed as not parsed, never guessed.
  • If zizmor is installed it runs offline on those files, with no token, and confirms which outsider-triggered jobs run untrusted input. --zizmor results.json reads your own zizmor run instead, --no-zizmor skips it and --no-workflows skips the workflow files.

The rules behind each step

4. Afterwards

  • Revoke the token, or let it expire.
  • Treat the two files as confidential: they list your owners, Apps and security gaps.