Outside Collaborator MFA required
More Info:
MFA should be enabled and enforced for all outside collaborators of an organization.
Risk Level
High
Address
Security
Compliance Standards
Remediation
Using Console
To remediate the “Outside Collaborator MFA required” misconfiguration on GitHub using the GitHub console, follow these steps:
-
Log in to your GitHub account and navigate to the repository with the misconfiguration.
-
Click on the “Settings” tab in the repository menu.
-
Scroll down to the “Collaborators & teams” section and click on “Manage access.”
-
Locate the outside collaborator in the list of collaborators and click on their name.
-
In the “Outside collaborator” section, click on the “Require two-factor authentication” checkbox.
-
Click “Save changes” to apply the changes.
This will require the outside collaborator to set up two-factor authentication on their GitHub account before they can access the repository. This will help to ensure that their account is secure and that they are who they say they are when accessing the repository.
Using CLI
To remediate the “Outside Collaborator MFA required” misconfiguration in GitHub using GitHub CLI, follow these steps:
-
Install GitHub CLI by following the instructions provided in the GitHub CLI documentation.
-
Open your terminal and authenticate to GitHub using the command
gh auth login
. -
Once you are authenticated, run the following command to check if any outside collaborator is missing MFA:
Replace
{org}
with your organization name and{your_username}
with your GitHub username. -
This command will return a list of outside collaborators who are missing MFA. Reach out to each collaborator and ask them to enable MFA.
-
Once all the outside collaborators have enabled MFA, run the following command to verify that all outside collaborators now have MFA enabled:
This command should not return any results, indicating that all outside collaborators now have MFA enabled.
-
You have now remediated the “Outside Collaborator MFA required” misconfiguration for GitHub using GitHub CLI.
Using Python
To remediate the “Outside Collaborator MFA required” misconfiguration in GitHub using Python, you can use the PyGithub library. Here are the step-by-step instructions:
- Install the PyGithub library using the following command:
-
Create a GitHub API token with the necessary permissions to access the organization and repositories that you want to remediate.
-
Use the following Python code to check if the “Require two-factor authentication” setting is enabled for outside collaborators:
- If the above code prints any users who do not have two-factor authentication enabled, you can use the following code to enable it:
- Run the above code and verify that all outside collaborators now have two-factor authentication enabled.