-
Notifications
You must be signed in to change notification settings - Fork 12
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
Github Trust Levels #46
Comments
This comment explains the implementation I was thinking of, and the problems I ran into. At a high level, So far so good, back to The problem is what to do about Perhaps, we could get rid of the Ideas and thoughts are welcome! |
Or maybe we remove actions / cron from the jobs key:
(really stretching here) |
Thanks for filing this and all the initial thinking through! I have some thoughts! A few high level comments first:
I agree that we should avoid forks -- the benefits of completely self serve twigs / working branches are high enough that unless there are very strong reasons that we can't make this happen, we should strive for it. (And it may even be the case that other stakeholders may shoot down the idea of forks altogether.)
I think this sounds very reasonable. It's notable that the uses cases for PRs and branches are different (branches are usually much more long lived, and may want additional things such as updates enabled), but I don't think that changes anything from a permissions/scopes standpoint.
I assume that "branch config" in this context is something in ci-config (and that we wouldn't be leaving the repo in control of this?).
We'd also need something like And this might simply be necessarily complexity at this point...so maybe we shouldn't shy away from it? I'm struggling to come up with any other ideas that would allow actions and cron to be tied to branches and PRs. |
Thanks for the comments!
I agree, it doesn't seem insurmountable.. but we should have buy in and SecOps approval before we go ahead with implementation. I wonder what the current plan is for twigs (if any).. I'll touch base with glob.
Yeah, so in
Of course Taskgraph also needs to know what level a branch is, so it will need a duplicate copy of this in |
[Hal thinks some of his thoughts on terminology also apply here.] |
Another interesting case came up in mozilla/translations#375 where we want everything that L3 implies when it comes to scriptworkers (eg: CoT verification), but due to Translations needing live logs and interactive tasks enabled, @hwine/SecOps are not comfortable calling the production workers "level 3". We've been talking about using L2 for this, and we may consider other options as well (especially since it conflicts with the idea of L2 being proposed here). |
I think we need to step back and agree on what In my mind, levels are just a way to distinguish different degrees of trust. E.g, the L3 of one project could actually be less secure than the L1 of another. What's important is that within the project, there's a distinction between all the levels. But it sounds like to @hwine I can see why there is value to both these definitions, but I'm not sure we can re-use the same nomenclature here. Maybe we can invent some new terminology for this (e.g security-rating?) |
Or split it into two: Heh, this is complicated |
This is why we need some clarification. In my head, the whole "level" concept evolved from CVS's "commit level", which was a cross-project standard for how operations would be handled. I agree that there are also varying impacts of operations within a project. Which does lead to a matrix of environments that a CI system may want to provide. Maybe one way to frame our discussion is that we're looking at minimally-confusing name for the index into that matrix (please, let's keep it 2-dimensional 😄). |
I had a reread of this issue and #45 and I think we're all closer in agreement than we might've thought. The main thing that there's a difference of opinion on is what a "level" implies, but I'm not sure there's any disagreement on any the implications?
This is a list of the ways we can group together a set of permissions/scopes, this is not the list of sets of permissions that we need to be able to grant, which I think is what @hwine might be looking for? If we flip this on its head, and make a list of all of the restrictions and/or security properties we're talking about, it might help clarify things. Here's a mapping of what I think our current restrictions/levels are:
Note the main difference between L2 & L3 being the involvement of end user artifacts. I think this table is largely congruent with @ahal's proposal at the top of this issue:
One quibble I would make is that I don't think that a branch being protected necessarily makes it L3 - branches could be protected for reasons other than being used to build end user artifacts. However, anything running on L3 workers must be from a protected branch (I wonder if we this is something verify as part of chain of trust, even?). One case that I know will not be congruent with the existing levels and above table is mozilla/translations#375 - where we are building things that will ship to users (granted they are language models, not binaries), but require live logs & interactive tasks. This may necessitate a 4th set of restricted actions. However, that 4th set would end up being the superset of what's current level 2 and 3...which doesn't sound terribly productive to me. I have a slightly different idea further down.
I don't know if it will work out, but I think this is an excellent time to consider a nomenclature change, as it's not clear to me that there will be strict hierarchy (at least not an obvious one) between all sets of restrictions we come up with. It's worth noting that if we come up with a system that doesn't have a hierarchy, that may have implications for how cached tasks work - specifically whether or not we can re-use cached tasks across "levels" (or whatever we end up calling them). With the above two things in mind, here is a new table, with slightly tweaked restricted actions and a purge of the "level" nomenclature:
(I'm not sure "executables" is the right word here - what I'm trying to spell out it that there's a difference between shipping executable code and/or interpreters to users and shipping other things. Examples of the latter are things like the translations language models, but could conceivably encompass other things as well.) I don't have any great ideas as a replacement for "level", but I'm also not as convinced that we need to replace it after reviewing all of this (but still open to it). |
In Github we only use two trust levels:
L1 for
github-pull-request
(and also everything else if the overall project is level 1)L3 for
github-push
,action
andcron
L2 is unused. There are some problems with this setup.
First, there are actually four levels of trust in our Github projects:
These don't get differentiated with the level system, which means we need to be careful in our
ci-config
grants as we can't rely on the level to provide security guarantees. For example, we must only grant secrets to thepull-request:trusted
job and notpull-request:untrusted
. Messing this up could leak a secret.A more pressing factor is the Gecko migration to Github and what to do about project twigs. We could simply create a separate fork for each twig and assign the overall project as level 2 (like we do now), but it would be more convenient if folks could simply create their own branches on the main repo and have them default to level 2. I.e, the project would have per-branch levels instead of a project wide level.
So my ideal end state here is the following:
When working through the implementation, I ran into some troubles, so I'm hoping we can hash out what the implementation might look like and decide whether an RFC for this is feasible or not.
The text was updated successfully, but these errors were encountered: