Replies: 4 comments 7 replies
-
I'm not convinced we need to prevent players deploying tanks. Even if we decide that is a rule it seems easy enough for an admin to run a script that kills all unauthorized pods. |
Beta Was this translation helpful? Give feedback.
-
I think it's a nice pattern and does give more flexibility regarding permissions etc however I too am a bit concerned that it wouldn't be strictly necessary as we could just ask participants not to spin up tanks with a "rules of the game" written on a whiteboard. I'd like to see it but I'd like to see all the other components in place first I think with this as a cherry on the top. For example, do we need to write all the attacks ourselves to prove that everything works in practice? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Attempted to spike an admission webhook here: https://github.com/mplsgrant/warnet/tree/2024-09-05-admission-webhook/resources/admission-webhook Was interesting, but it reached its timebox. |
Beta Was this translation helpful? Give feedback.
-
In the context of war-games, we don't want teams to be able to create more of their own tanks: they start with a fixed set of vulnerable nodes and if the opposing team kills the node, they cannot restart it or create new ones.
However, we do want them to be able to spin up their own commander pods, where a commander packages some sort of attack script. One solution would be tanks in one namespace and commanders in the other. But commanders are just pods, so if we give the user permissions to create pods in namespace x , they could also create tanks in namespace x! There's likely more that could be done here but it feels like barking up the wrong tree to me.
I started looking at CRDs for commanders and this feels like the better approach. Here are some links I've been reading on the subject:
This feels like the right direction to go, imo. This would involve creating the custom resource definition (commander.yaml), creating permissions for creating these resources, and creating a controller. A controller is to a CRD as a scheduler is to a pod. The nice about this is the controller can apply more complex application logic based on the type of resource, e.g., might be a nice fit to model complex start up conditions when deploying a lightning node (future work).
The main benefit I see today is we can more natively use RBACs , where a use can create and delete resource
Commander
but can only get, view, list, etcPods
(we could also modelTank
orBitcoinNode
as a CRD in the future if this pattern seems good). I haven't validated RBAC control on CRDs vs pod in the same namespace, but it seems entirely possible.Opening for discussion by my proposal would be to start with a minimal example of creating a CRD that is essentially a no-op (doesn't even need to create a container or have a controller), but validate that a users permissions can be restricted such that they cannot create pods in a namespace but can create CRDs. If that works, next step would be to write a controller for creating these resources and then package the commander as one. Ideally , the controller can validate that the a CRD is only created with the commander image (looks like this is possible).
cc @mplsgrant since you've been looking at this and @m3dwards since we briefly discussed this off-line.
Beta Was this translation helpful? Give feedback.
All reactions