Skip to content

Prevent escalating resource access by default #8818

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

Merged

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented May 10, 2016

This prevents scopes from having access to escalating resource by default, but also provides a means to request a role based scope that is escalating by adding :! to the end of the "normal" definition role:<role name>:<effective namespace[:!].

@sgallagher ptal I think this is the last bit required to unblock useful scopes.

@deads2k deads2k mentioned this pull request May 10, 2016
10 tasks
@@ -188,8 +209,59 @@ func (e clusterRoleEvaluator) ResolveRules(scope, namespace string, clusterPolic

rules := []authorizationapi.PolicyRule{}
for _, rule := range role.Rules {
// rules with unbounded access shouldn't be allowed in scopes.
if rule.Verbs.Has(authorizationapi.VerbAll) || rule.Resources.Has(authorizationapi.ResourceAll) || getAPIGroupSet(rule).Has(authorizationapi.APIGroupAll) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the escalating check should apply to these as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the escalating check should apply to these as well

ok

@deads2k deads2k force-pushed the prevent-escalating-resource-access branch from 945081e to 91545d2 Compare May 10, 2016 16:52
@deads2k
Copy link
Contributor Author

deads2k commented May 11, 2016

@stevekuznetsov small. ptal.

// escalatingScopeResources are resources that are considered escalating for scope evaluation
var escalatingScopeResources = []unversioned.GroupResource{
{Group: kapi.GroupName, Resource: "secrets"},
/*imageapi.GroupName*/ {Group: "", Resource: "imagestreams/secrets"},
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really understand why these are comments instead of the actual group names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really understand why these are comments instead of the actual group names

We don't want to introduce a dependency from this package to that one. Authorization should be a clean-ish layer, if possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really buy that, what do we gain from two fewer import statements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really buy that, what do we gain from two fewer import statements?

Can be split out as a separate component. It doesn't care whether various api groups are present.

@deads2k deads2k force-pushed the prevent-escalating-resource-access branch from 91545d2 to 4a849d2 Compare May 11, 2016 19:06
@deads2k
Copy link
Contributor Author

deads2k commented May 11, 2016

[merge]

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2016
@deads2k deads2k force-pushed the prevent-escalating-resource-access branch from 4a849d2 to 25def50 Compare May 11, 2016 19:36
@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 25def50

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 25def50

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2016
@deads2k
Copy link
Contributor Author

deads2k commented May 11, 2016

@danmcp mean anything to you?

fatal: '/data/src/github.com/openshift/origin-web-console-bare' does not appear to be a git repository
fatal: Could not read from remote repository.

@openshift-bot
Copy link
Contributor

openshift-bot commented May 11, 2016

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

@danmcp
Copy link
Contributor

danmcp commented May 11, 2016

@deads2k Yes. It should be fixed shortly.

@openshift-bot
Copy link
Contributor

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

@openshift-bot openshift-bot merged commit 1baf6a2 into openshift:master May 11, 2016
@deads2k deads2k deleted the prevent-escalating-resource-access branch September 6, 2016 17:13
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.

6 participants