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

prevent privilege escalation #1051

Merged
merged 1 commit into from
Feb 20, 2015

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Feb 17, 2015

Prevent a user who has rights to modify role bindings from binding a user to a role that has more power than the granting user has.

/cc @liggitt

@deads2k
Copy link
Contributor Author

deads2k commented Feb 18, 2015

@smarterclayton comments up to "prevent escalation" addressed.

@deads2k
Copy link
Contributor Author

deads2k commented Feb 18, 2015

@smarterclayton created a rolebinding.Registry to abstract out the ugly from rolebinding/rest.go. It felt more registry-like. If you agree with the approach, I'll fill in unit tests.

@deads2k
Copy link
Contributor Author

deads2k commented Feb 18, 2015

Plumbed kapi.Context through the authorizer. I think it really hurts readability, especially in places where there is logically more than one context in play and in places where only part of the context is used. It ends up reading like a magic container.

@liggitt Your thoughts on the "plumb context through authorizer" commit?

@deads2k
Copy link
Contributor Author

deads2k commented Feb 18, 2015

@smarterclayton I think I made it through all the comments. The only one I don't feel good about is plumbing context through the authorizer. It feels like I've gone from a way of passing arguments that allows the compiler to ensure that I'm passing the correct data where its required and I've replaced with with a way of passing through a data object that is mostly blackblox, that sometimes needs certain fields and sometimes needs others, and destroys the compiler's ability to help me write valid code without having runtime failures.

@deads2k
Copy link
Contributor Author

deads2k commented Feb 18, 2015

[test]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_openshift3/1122/)

@smarterclayton
Copy link
Contributor

If the authorizer is making nested calls it needs to be using the context of the person who called it. A context is the thread that ties an incoming request from the client across all the backend systems that fulfill it. See https://godoc.org/golang.org/x/net/context and http://research.google.com/pubs/pub36356.html for why we use contexts.

----- Original Message -----

@smarterclayton I think I made it through all the comments. The only one I
don't feel good about is plumbing context through the authorizer. It feels
like I've gone from a way of passing arguments that allows the compiler to
ensure that I'm passing the correct data where its required and I've
replaced with with a way of passing through a data object that is mostly
blackblox, that sometimes needs certain fields and sometimes needs others,
and destroys the compiler's ability to help me write valid code without
having runtime failures.


Reply to this email directly or view it on GitHub:
#1051 (comment)

@smarterclayton
Copy link
Contributor

You can hide the context underneath your getters if necessary - it doesn't have to be a field on the object. It just has to be preserved.

----- Original Message -----

Plumbed kapi.Context through the authorizer. I think it really hurts
readability, especially in places where there is logically more than one
context in play and in places where only part of the context is used. It
ends up reading like a magic container.

@liggitt Your thoughts on the "plumb context through authorizer" commit?


Reply to this email directly or view it on GitHub:
#1051 (comment)

@deads2k
Copy link
Contributor Author

deads2k commented Feb 19, 2015

jenkins failed in test-integration on TestSimpleImageChangeBuildTrigger. re[test]?

@jwforres jwforres added this to the 0.4.0 (beta2) milestone Feb 19, 2015
@smarterclayton
Copy link
Contributor

Squash and you'll get a merge.

@deads2k
Copy link
Contributor Author

deads2k commented Feb 20, 2015

squashed.

@smarterclayton
Copy link
Contributor

Hope I don't regret this... LGTM [merge]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_openshift3/987/) (Image: devenv-fedora_852)

@openshift-bot
Copy link
Contributor

Evaluated for origin up to e72c121

openshift-bot pushed a commit that referenced this pull request Feb 20, 2015
@openshift-bot openshift-bot merged commit a291bce into openshift:master Feb 20, 2015
@deads2k deads2k deleted the deads-prevent-escalation branch February 23, 2015 16:27
jpeeler added a commit to jpeeler/origin that referenced this pull request Feb 1, 2018
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

4 participants