Draft
Conversation
marcoieni
commented
Apr 1, 2025
.github/CODEOWNERS
Outdated
| people/**/*.toml @rust-lang/team-repo-admins @rust-lang/mods @Mark-Simulacrum @pietroalbini @jdno @marcoieni | ||
| repos/**/*.toml @rust-lang/team-repo-admins @rust-lang/mods @Mark-Simulacrum @pietroalbini @jdno @marcoieni | ||
| # Useful for teams without leaders. | ||
| teams/**/*.toml @rust-lang/team-repo-admins @rust-lang/mods @Mark-Simulacrum @pietroalbini @jdno @marcoieni |
Member
Author
There was a problem hiding this comment.
unfortunately with this approach we need to add specific owners in these generic directories, otherwise the team-leads will have the same permissions of team-repo-admins and mods, i.e. they could approve PRs on all these toml files
Dry-run check results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We want to give team leaders permission to approve PRs in this repository, so that they can unblock their teams.
The question is: how much permission can we give them? If you look at the CODEOWNERS file, you can see that anyone with write access can approve PRs in the
/people/reposand/teamsdirectories.But what if an attacker compromises a team-lead's account? They could then approve their own PRs
to remove branch protection rules, kick out team members, or archive all rust-lang repositories.
To prevent this, we want to limit the permissions of team-leads to only the directories they own,
i.e. their
/teamsand the/reposowned by their teams.With this PR, I start by giving team-leads write access to their own
/teamsdirectory.Con of this approach: team-repo-admins and mods will be notified about every change in the
people,teamsandreposdirectory.leads = "write"before this PR, so that team leads have write access