Skip to main content

Triage and Remediation

Remediation

Using Console

Below are step‑by‑step instructions to remediate the issue of an Outside Collaborator having Admin access in GitHub using only the GitHub web console (GUI).

1. Confirm who the outside collaborator is

  1. Sign in to GitHub.
  2. Go to your Organization:
    https://github.com/organizations → click your org.
  3. In the org, click People (top menu).
  4. Click the Outside collaborators tab.
    • This shows all users who are not organization members but have access to one or more repos.

2. Check and adjust their repository permissions

  1. In Outside collaborators, find the user in question.
  2. On the right of their row, click (three dots) → Manage access
    (or click their name, then Repositories under their profile within the org).
  3. You will see list of repositories they can access and their permission level for each (Read / Triage / Write / Maintain / Admin).
For each repository where they have Admin:
  1. Click the dropdown showing Admin.
  2. Choose one of:
    • Write (if they still need contribute rights), or
    • Read (if they only need to view), or
    • Remove from repository (to revoke access completely).
Repeat for every repository where that outside collaborator has Admin.

3. (Preferred) Convert them to an organization member, then restrict

If the person is trusted and should be an ongoing collaborator, it is safer to:
  1. In the organization, go to PeopleOutside collaborators.
  2. Find the user → click Convert to member.
  3. Choose:
    • A Team that gives them appropriate least‑privilege access, or
    • No default access, and then grant repo access explicitly with only the permissions they need (not Admin, unless absolutely required).

4. Remove outside collaborator status if not needed

If they should no longer have any access:
  1. In PeopleOutside collaborators, find the user.
  2. Click Remove from organization (or Revoke access depending on UI version).
  3. Confirm removal.
    • This removes all of their repository access within the organization.

5. Optional: Prevent overuse of Admin via repository settings

For each high‑value repository:
  1. Go to the repo → SettingsCollaborators and teams (or Manage access).
  2. Review all collaborators:
    • Downgrade any Admin users who do not truly need full control to Maintain, Write, or Read.
  3. Consider using teams instead of individual Admin roles and limit who can be Admin at the org level.

If you tell me whether the collaborator should keep some access or be fully removed, I can give you a minimal‑change set of clicks tailored to that scenario.
Below are concise, step‑by‑step remediation options using the GitHub CLI (gh) to fix an outside collaborator with admin access.Assumptions:
  • You’re an org owner or have admin rights on the repo.
  • gh is already installed.

1. Authenticate GitHub CLI (if not already)


2. Identify outside collaborators with admin access on a repo

Replace ORG, REPO with your values.
This returns outside collaborators with admin permissions on that repo.

3. Option A – Downgrade their permissions on the repo

Example: change from adminmaintain (or push for write only).
Other valid values: pull, triage, push, maintain, admin.Repeat for each user/repo combination where you find admin access.

4. Option B – Completely remove them from the repo


5. (Optional) Remove them as an outside collaborator at org level

If you want to revoke all access they have as an outside collaborator:

List all outside collaborators in the org

Remove a user as an outside collaborator


6. Verify remediation

Re-check permissions on the repo:
Ensure no outside collaborator has "admin": true anymore.
Below is a concise, step‑by‑step way to remediate “outside collaborator as admin” in GitHub using Python (via the GitHub REST API or PyGithub).Assumptions:
  • You have a GitHub Personal Access Token (classic or fine‑grained) with admin:org and repo scopes.
  • You know:
    • ORG_NAME – your GitHub org
    • REPO_NAME – the affected repo
    • COLLAB_USERNAME – the outside collaborator currently with admin rights

1. High‑Level Remediation Plan

  1. Detect outside collaborators with admin access.
  2. For each:
    • Either:
      • Convert them to org member (invite to org) and lower repo permission (e.g., to push or pull), or
      • Remove them from the repo entirely.
  3. Enforce that no outside collaborator has admin permission going forward.

2.1. Install and set up


2.2. Detect if user is an outside collaborator with admin


2.3. Option A – Downgrade permission (keep as outside collaborator, but not admin)


2.4. Option B – Invite to org, then set appropriate permission


2.5. Option C – Remove from repo entirely


3. Bulk Remediation for All Repos / All Outside Collaborators


4. Using Raw REST API with requests (if you don’t want PyGithub)

Install:

4.1. Check if user is org member

4.2. Check collaborator permission on a repo

4.3. Downgrade permission

4.4. Remove collaborator

4.5. Invite user to org


If you tell me your target policy (remove vs downgrade vs convert to member), I can give you a single ready‑to‑run Python script that applies it across your entire org.
This change is in-place (no repository replacement), but GitHub will downgrade the collaborator’s access on apply.For verification, terraform plan should show the github_repository_collaborator (or the existing one for this user/repo) changing permission from "admin"/"push" to "pull".