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

Containers should not be allowed to directly create K8s objects #254

Closed
Ark-kun opened this issue Nov 14, 2018 · 3 comments
Closed

Containers should not be allowed to directly create K8s objects #254

Ark-kun opened this issue Nov 14, 2018 · 3 comments

Comments

@Ark-kun
Copy link
Contributor

Ark-kun commented Nov 14, 2018

Currently our containers are not really isolated. They have full access to network, GCS, other GCP services and can even create, delete and modify other K8s objects as in #231

This was discussed during a design meeting and as far as I remember the consensus was that it's too dangerous and insecure. Worse still, its really hard to put this genie back into the bottle once it's out and people start using this.

As we discussed, all CRDs should be created through the pipelines system backend endpoint or admission controller and the Pod needs to identify itself.

Technical solution:

  • Pod should not be able to directly manipulate K8s in any way.
  • To launch CRD, a Pod should send the CRD to a backend endpoint after identifying itself (e.g. send its name. The Pod should not be able to see any information about other pods and steal their identity).
  • Backend must verify that the Pod's container image is in whitelist (a quick implementation can just check for the gcr.io/ml-pipelines/ container image bucket).
  • Backend must verify that the container is running the intended code: We can check that the entry-point wasn't tampered with - the command property of the container should not be set.
@jlewi
Copy link
Contributor

jlewi commented Nov 19, 2018

Isn't this what RBAC and namespaces are for?

What does it mean to send a CRD to some backend?

Why not just let pipelines run in a user selected namespace with suitable, user controlled RBAC permissions to limit what pipelines can do?

@vicaire
Copy link
Contributor

vicaire commented Nov 19, 2018

+1 on @jlewi's comment.

I am not in favor of containers calling the Pipeline API Server.

I think we have two options:

  • The one @jlewi mentioned
  • Containers could also interact with the outside world only through local files, local ports, and local pipes, which the system would wire appropriately depending on the workflow configuration.

@vicaire
Copy link
Contributor

vicaire commented Mar 27, 2019

Resolving since there is no outstanding item.

@vicaire vicaire closed this as completed Mar 27, 2019
magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this issue Oct 22, 2023
Now that we have knative 0.7 the workaround is no longer needed!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants