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

create SCCExecRestriction admission plugin #4755

Merged
merged 1 commit into from Sep 26, 2015

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Sep 22, 2015

This allows users who can create privileged pods to exec into privileged pods. It seems to make sense to relax this restriction.

If SCC moves into origin, then this should change to be our own controller that we include instead of modifying an existing one.

@pweil- is this keeping with you thoughts on SCC?

@deads2k
Copy link
Contributor Author

deads2k commented Sep 22, 2015

@pmorie since I associate the Pauls together

@smarterclayton
Copy link
Contributor

Otherwise it's hard to debug admin controllers

@liggitt
Copy link
Contributor

liggitt commented Sep 22, 2015

Upstream, this admission controller has already changed to limit on three attributes of pods: privileged, host pid, and host IPC.

@pweil-
Copy link
Contributor

pweil- commented Sep 22, 2015

@pweil- is this keeping with you thoughts on SCC?

Yes, ideally, if you can create the pod you should have privs to exec/attach to the pod.

@deads2k
Copy link
Contributor Author

deads2k commented Sep 22, 2015

Upstream, this admission controller has already changed to limit on three attributes of pods: privileged, host pid, and host IPC.

Alright, I'd say that's an argument to keep this as an upstream carry to make sure we stay in sync.

@pweil-
Copy link
Contributor

pweil- commented Sep 22, 2015

This looks fine to me. My only concern is that it's just another upstream patch we're carrying indefinitely.

I would rather see the OpenShift code not register the upstream denial plugin and have a custom exec/attach plugin that first checks if you would have permissions to create the pod and deny based on that. That is significantly more work and (in discussions with @deads2k) also has the risk of drift from upstream.

Ie. pull the pod definition, run it through the constraint plugin's Admit(), accept/deny based on errors.

@liggitt
Copy link
Contributor

liggitt commented Sep 22, 2015

Rather than a carry patch, we could have a function hook for custom allow/deny behavior with a default implementation of using the booleans in the admission controller. That would let us plug in our own allow behavior.

@deads2k
Copy link
Contributor Author

deads2k commented Sep 22, 2015

Rather than a carry patch, we could have a function hook for custom allow/deny behavior with a default implementation of using the booleans in the admission controller. That would let us plug in our own allow behavior.

A plugin for our plugin? Turtles all the way down!

I don't think that helps with staying in sync.

@liggitt
Copy link
Contributor

liggitt commented Sep 22, 2015

just subclass it. oh, wait

@deads2k deads2k changed the title UPSTREAM: <carry>: allow exec into privilege pods for privileged users create SCCExecRestriction admission plugin Sep 23, 2015
@deads2k
Copy link
Contributor Author

deads2k commented Sep 23, 2015

@pweil- updated to new admission controller [test]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/5145/)

pod.Spec.ServiceAccountName = ""
createAttributes := admission.NewAttributesRecord(pod, "pods", a.GetNamespace(), a.GetName(), a.GetResource(), a.GetSubresource(), admission.Create, a.GetUserInfo())
if err := d.constraintAdmission.Admit(createAttributes); err != nil {
return admission.NewForbidden(a, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this will be the most useful error to return though it's a start. I definitely think this locks down any use case where you are trying to exec/attach to a pod that you wouldn't have permissions to create though which I like if everyone agrees that that is the right direction.

And if so, unit tests please 😃

@deads2k
Copy link
Contributor Author

deads2k commented Sep 24, 2015

unit tests added.

@deads2k
Copy link
Contributor Author

deads2k commented Sep 24, 2015

I definitely think this locks down any use case where you are trying to exec/attach to a pod that you wouldn't have permissions to create though which I like if everyone agrees that that is the right direction.

And it allows the ability to exec into pods that you could created (unlike upstream).

Based on comments above in the pull, this looks non-contentious

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to beca326

@pweil-
Copy link
Contributor

pweil- commented Sep 24, 2015

👍 thanks, and e2e test so double 👍 👍

@smarterclayton
Copy link
Contributor

Any further comments?

@pweil-
Copy link
Contributor

pweil- commented Sep 24, 2015

none from me

@deads2k
Copy link
Contributor Author

deads2k commented Sep 25, 2015

none from me

Is that as good as an lgtm?

@pweil-
Copy link
Contributor

pweil- commented Sep 25, 2015

Is that as good as an lgtm?

yes, LGTM

@deads2k
Copy link
Contributor Author

deads2k commented Sep 25, 2015

Cancelling the merge. It would conflict with the rebase.

@deads2k
Copy link
Contributor Author

deads2k commented Sep 25, 2015

[merge] since the rebase already has conflicts.

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/3403/) (Image: devenv-fedora_2405)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to beca326

openshift-bot pushed a commit that referenced this pull request Sep 26, 2015
@openshift-bot openshift-bot merged commit 994d758 into openshift:master Sep 26, 2015
@deads2k deads2k deleted the privileged-pods branch November 5, 2015 15:04
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

Successfully merging this pull request may close these issues.

None yet

5 participants