Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New check: Do contributors and maintainers have 2fa enabled? #7

Closed
kimsterv opened this issue Oct 14, 2020 · 12 comments · Fixed by #3784
Closed

New check: Do contributors and maintainers have 2fa enabled? #7

kimsterv opened this issue Oct 14, 2020 · 12 comments · Fixed by #3784
Labels
kind/new-check New check for scorecard
Projects
Milestone

Comments

@kimsterv
Copy link
Contributor

Do all contributors have 2 factor authentication enabled on their accounts?

@kimsterv kimsterv added the kind/new-check New check for scorecard label Oct 14, 2020
@inferno-chromium inferno-chromium changed the title Do contributors and maintainers have 2fa enabled? New check: Do contributors and maintainers have 2fa enabled? Nov 5, 2020
@naveensrinivasan
Copy link
Member

I think the more practical would be "Do top 5/10contributors have 2FA enabled"?

@laurentsimon
Copy link
Contributor

laurentsimon commented May 4, 2021

I think the more practical would be "Do top 5/10contributors have 2FA enabled"?

probably depends on how many contributors the project has?
We could also check that reviewers have 2FA. A compromised contributor may try to push bad code but would be detected by reviewers. Having a score instead of a binary pass/fail check would also help in general. It would encourage developers to make incremental improvements towards a long-term goal.

In terms of scoring, it could be:

  1. Find all contributors that have 2FA, and compute the percentage of the code they have contributed to. That would be the score.
  2. Alternatively, find the reviewers that have 2FA and compute the percentage of code they reviewed.

Not sure this is possible with a reasonable number of API calls, though. We cannot go back in history too much either, so this may be done over the last n months, for example.

@laurentsimon
Copy link
Contributor

API for org https://docs.github.com/en/rest/reference/orgs#members. May require special permission to use.

@laurentsimon laurentsimon added this to the milestone v5 milestone Feb 15, 2022
@ristomcgehee
Copy link
Contributor

API for org https://docs.github.com/en/rest/reference/orgs#members. May require special permission to use.

This API allows querying for users in your organization that do not have 2FA enabled. It wouldn't fit our needs of being able to tell if an arbitrary user has 2FA enabled. I would be surprised if Github ever published an API allowing querying whether arbitrary users have 2FA enabled. I think a lot of people wouldn't be comfortable with it being public knowledge that they don't use 2FA. We might not ever be able to do this issue.

@laurentsimon
Copy link
Contributor

laurentsimon commented Feb 17, 2022

if we could query the list of maintainers for a repo/org, we could then cross-check which maintainers don't have 2FA enabled. I've not looked closely at the API, though.

We don't really need all users, we mostly need maintainers of the project, or devs that can reviews PRs, etc

@azeemshaikh38
Copy link
Contributor

A side note - might be a good fit for AllStar i.e an AllStar policy can check all org members have 2fa enabled and bring this to the org's attention (in a private manner). @jeffmendoza fyi.

@ristomcgehee
Copy link
Contributor

if we could query the list of maintainers for a repo/org, we could then cross-check which maintainers don't have 2FA enabled.

It looks like this API is only available if you are the owner of that organization, so I don't think it would be useful in Scorecard. It might work for AllStar; that's a good idea, Azeem.

@laurentsimon
Copy link
Contributor

laurentsimon commented Feb 18, 2022

ok, yes allstar works well too. I'm adding these issues in scorecard repo first and allstar is the fallback solution in my mind, since allstar is for orgs but scorecard can be more broadly used. Here's another one that I would like to have in scorecard, but may only be viable for allstar #1655 :/

@justaugustus justaugustus added this to To do in Scorecard Feb 22, 2022
@david-a-wheeler
Copy link
Contributor

It looks like this API is only available if you are the owner of that organization, so I don't think it would be useful in Scorecard.

We already have another (experimental) measure in Scorecard that requires this. So I think it is appropriate to add it, and only measure it when it's possible. Also, Scorecard isn't limited to GitHub; we're adding GitLab, and more may follow (I hope). Just include some sort of marker indicating in a machine-processable way that "we could not get this data" in those cases.

@afmarcum
Copy link
Contributor

GitHub is requiring MFA for all contributors by the end of 2023 and project documentation states limitations in creating this check with a strong recommendation for using MFA generally so this issue can probably be closed.

If there is no feedback in the next 7 days to the contrary, then this issue will be closed.

@david-a-wheeler
Copy link
Contributor

afmarcum : I don't think it's required for GitLab though.

@afmarcum
Copy link
Contributor

afmarcum commented Jan 8, 2024

@raghavkaul found this bug on GitLab: https://forum.gitlab.com/t/retrieving-mfa-status-via-api/89759/4

It looks like this is not available in normal means via GitLab [except for GitLab instance admins].

raghavkaul added a commit that referenced this issue Jan 10, 2024
Update docs on 2FA

Closes #7

Signed-off-by: Raghav Kaul <8695110+raghavkaul@users.noreply.github.com>
spencerschrock pushed a commit that referenced this issue Jan 10, 2024
Update docs on 2FA

Closes #7

Signed-off-by: Raghav Kaul <8695110+raghavkaul@users.noreply.github.com>
Scorecard automation moved this from To do to Done Jan 10, 2024
step-security-bot pushed a commit to step-security-bot/scorecard that referenced this issue May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/new-check New check for scorecard
Projects
Development

Successfully merging a pull request may close this issue.

7 participants