Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate an “Org MFA required” finding for GitHub using the GitHub web console, you need both:
  1. Turn on 2FA for each user.
  2. Enforce “Require two-factor authentication” at the organization level.

1. Enable 2FA for your own GitHub account

Each member must do this individually.
  1. Sign in to GitHub: https://github.com/
  2. Click your profile picture (top-right) → Settings.
  3. In the left menu, go to Password and authentication (or Account security, depending on UI).
  4. Under Two-factor authentication, click Enable two-factor authentication.
  5. Choose at least one method (recommended: authenticator app):
    • Set up using an app: scan the QR code with an authenticator (e.g., 1Password, Authy).
    • Or Set up using SMS (less secure, but available).
  6. Save or securely store your recovery codes.
  7. Confirm and complete the setup.
Repeat for all organization members/owners who do not yet have 2FA.

2. Require 2FA for the GitHub Organization

You must be an organization owner to do this.
  1. Sign in to GitHub and ensure your account already has 2FA enabled (owners without 2FA cannot enable enforcement).
  2. Click your profile picture (top-right) → Your organizations.
  3. Click the target organization.
  4. In the org view, click Settings (top menu).
  5. In the left sidebar, go to SecurityAuthentication security (or Organization security depending on UI).
  6. Find Two-factor authentication or Require members to use two-factor authentication.
  7. Check Require two-factor authentication for everyone in this organization (or similar toggle).
  8. Carefully review the warning:
    • Any members, outside collaborators, or bot accounts without 2FA will be removed from the organization after a grace period / immediately (per current GitHub behavior shown in the dialog).
  9. Click Save / Enforce / Enable and confirm.

3. Clean up and verify

  1. Notify all members before enforcing, and provide them with the steps in section 1.
  2. After enforcing, go to:
    • OrgPeople (or Members)
      and verify:
    • All members/owners show as having 2FA enabled.
  3. Re-invite any removed users after they enable 2FA on their accounts.
This will remediate the “Org MFA required” issue for GitHub IAM through the GitHub console.
Below is how to enforce org‑wide MFA and clean up non‑compliant accounts using GitHub CLI (gh).Assumptions:
  • You are an org owner.
  • gh is already installed and authenticated with sufficient rights.

1. Set your org name


2. See if MFA is already required

  • true = already enforced
  • false = not enforced (this is what you must remediate)

3. Identify members without MFA

Save them if needed:

Example (manual step, not via API):
  • Send them non_mfa_members.txt or copy the logins.
  • Instruct them to enable 2FA:
    GitHub → Settings → Password and authentication → “Enable two-factor authentication”.

5. Enforce MFA for the organization

WARNING: Any member without MFA will immediately lose access when you flip this setting.
Verify:

6. Re-check for non‑MFA accounts

Now the list should normally be empty:
No output = compliant.

7. (If needed) Remove or audit any remaining non‑MFA members

In rare cases (API timing issues), you can explicitly remove non‑compliant users:

These steps remediate the “Org MFA required” control for GitHub by enforcing org‑wide 2FA and cleaning up non‑MFA members strictly via GitHub CLI.
To remediate “Org MFA required” for GitHub using Python, you need to enforce 2FA for your GitHub organization and optionally clean up users who don’t comply.Below is a concise, step‑by‑step outline plus working Python examples using the GitHub REST API.

1. Prerequisites

  1. You must be an Owner of the GitHub organization.
  2. Create a Personal Access Token (PAT) with scopes:
    • admin:org (required)
    • read:org (to list members)
  3. Note:
    • Once 2FA is enforced, members without 2FA are removed from the org automatically (they can rejoin after enabling 2FA).

2. Enforce 2FA at Organization Level (Python)

GitHub API endpoint:
  • PATCH /orgs/{org}
    Body: { "two_factor_requirement_enabled": true }
This is the core “remediation” step for the “Org MFA required” control.

3. (Optional) Audit Members Without 2FA Before Enforcing

You may want to identify who will be affected before turning it on.GitHub API:
  • GET /orgs/{org}/members?filter=2fa_disabled

4. (Optional) Remove Members Without 2FA via Script

If you’d rather explicitly remove members who don’t have 2FA (instead of letting GitHub do it automatically when you flip the switch):
  • DELETE /orgs/{org}/members/{username}

5. High-Level Remediation Steps Summary

  1. Audit: Optionally list members without 2FA (GET /orgs/{org}/members?filter=2fa_disabled).
  2. Communicate: Notify affected users to enable 2FA.
  3. Enforce: Use the Python script (PATCH /orgs/{org} with two_factor_requirement_enabled: true).
  4. Verify: Check org settings in GitHub UI → SettingsOrganization security → “Require members to enable two-factor authentication”.
If you tell me whether you use GitHub Enterprise Cloud or Server, I can adapt the endpoint/base URL accordingly.
This change updates the existing organization settings in-place (no resource replacement), but it has immediate access impact as noted above.Verification: terraform plan should show two_factor_requirement_enabled changing from false (or null) to true on github_organization_settings.this.