Skip to main content

Triage and Remediation

Remediation

Using Console

Below are step‑by‑step instructions to reduce the number of Owners in a GitHub organization using the GitHub web console (UI).

1. Prerequisites and planning

  1. Ensure you are currently an Owner of the organization.
  2. Decide:
    • Who should remain as Owners (usually 2–3 trusted admins, for redundancy).
    • Which users should be downgraded to:
      • Member, or
      • Team maintainer (via teams) if they only need repo-level admin capabilities.

2. List and review current Owners

  1. Sign in to GitHub: https://github.com.
  2. In the upper-right corner, click your profile picture → Your organizations.
  3. Click the organization name you want to manage.
  4. In the org view, click the People tab.
  5. Filter by role:
    • On the right side (or top filters), use Role filter and select Owner.
    • This shows all current Owners.
Review each Owner and confirm who truly needs org‑wide admin rights (billing, SSO, security policies, app installation, etc.).

3. Change a user from Owner to Member

For each user who should no longer be an Owner:
  1. On the People tab (with Owner filtered), find the specific user.
  2. On the right side of that row, click the (actions) menu.
  3. Click Change role (or similar wording depending on UI version).
  4. In the role selection dialog:
    • Change role from Owner to Member.
  5. Click Save or Update role.
Repeat this for every user you want to downgrade from Owner to Member, ensuring you keep at least one or two Owners.
For users who previously were Owners only to manage repositories:
  1. Still in your organization, click the Teams tab.
  2. Either:
    • Create a new team: New team → give it a name (e.g., org-admins, platform-team) → set appropriate repository access; or
    • Use an existing team.
  3. Add the downgraded users as Maintainers of that team:
    • Open the team → MembersAdd a member.
    • After adding, change their role in the team to Maintainer if they need to manage team members and repo access.
This lets them manage repos and teams without needing full Owner rights.

5. Verify minimum Owners and test

  1. Go back to People → filter by Owner and confirm:
    • Only the intended small set of users remain as Owners.
  2. Validate:
    • Owners can still manage billing, security settings, and org‑level apps.
    • Former Owners (now Members) can still perform their daily tasks via:
      • Repo admin permissions, and/or
      • Team maintainer roles.

These steps fully remediate the “excessive number of owners” issue using the GitHub web console.
Below is a concrete, minimal workflow to reduce excessive GitHub organization owners using the GitHub CLI (gh).

0. Prerequisites

  1. You are currently an organization owner.
  2. You have gh installed and authenticated:

1. Identify all organization owners

Replace ORG_NAME with your org:
Save them for reference:

2. Decide who should remain owner

Manually edit owners.txt into two files:
  • owners_to_keep.txt – minimal set of true owners (e.g., 2–3 people, break-glass account).
  • owners_to_downgrade.txt – everyone else.
Example (bash):

3. (Optional) Validate each user still needs org access

If you want to completely remove some users from the org, list all members:
Create a members_to_remove.txt with logins that should be removed entirely (not just downgraded).

4. Downgrade unnecessary owners to members

This keeps them in the org but removes owner privileges:
Verify:
Ensure only the expected minimal set of owners remains.

5. (Optional) Remove users from the org completely

If some users no longer need any access:

6. Enforce stricter process for new owners (policy level)

Not CLI-enforced, but recommended:
  • Document criteria and approval path for making someone an owner.
  • Restrict changes to owners via change management / tickets.
  • Periodically re-run step 1 and review owners.
Below is a concise, step‑by‑step approach to remediate “excessive number of owners” in a GitHub organization using Python.Assumptions:
  • You’re working with a GitHub organization, and “owners” = members with the admin (owner) role in that org.
  • You have a Personal Access Token (PAT) with at least admin:org scope.
  • You want to enumerate all owners, then demote selected ones to regular members.

1. Plan and prerequisites

  1. Identify which users must remain owners (e.g., 2–3 primary admins, break-glass accounts).
  2. Get a GitHub PAT with:
    • admin:org (Organization members and teams)
  3. Install PyGithub:

2. List all organization owners with Python

Use this to review who currently has owner rights.

3. Define who should stay as owners

Create a Python list of logins that must remain owners (never demote them):

4. Demote excessive owners to members

Notes:
  • org.update_membership(user, role="member") changes a user’s role from owner (admin) to regular member.
  • You must keep at least one owner; GitHub will not allow an org without any owners.

5. Optional: Dry run mode (safety check)

Before actually changing roles, you can run a dry run:

6. Post‑remediation validation

  1. Re‑list owners to confirm:
  2. Ensure:
    • Only the intended minimal set of owners remains.
    • Other users still have appropriate team/repo permissions (e.g., maintain, write) instead of org‑wide owner.

If you share your org name pattern and whether you’re on GitHub.com or GitHub Enterprise Server, I can adjust the script to fit that environment exactly.
Changing role from "admin" to "member" does not force resource replacement; Terraform will plan an in-place update showing role: "admin" => "member" for each demoted user.