Commit Graph

16 Commits (39e3c986cc448b42892b6d66dca0cdae9909f455)

Author SHA1 Message Date
deads2k 8c788233e7 change rbac roleref type 2016-09-09 09:55:51 -04:00
Kubernetes Submit Queue bf9a62035d Merge pull request #31289 from deads2k/remove-cast-utilities
Automatic merge from submit-queue

remove cast utilities from rbac

Casting functions like these are a source of pain in OpenShift.  We should eliminate them to avoid drift problems like we've had downstream.

@kubernetes/sig-auth 

@ericchiang ptal
2016-09-08 08:23:01 -07:00
deads2k da32d31aac remove cast utilities from rbac 2016-08-30 09:55:34 -04:00
Kris e87edf9bd5 Split path validation into a separate library 2016-08-26 08:05:20 -07:00
Kubernetes Submit Queue 16454277aa Merge pull request #29930 from ericchiang/rbac-validation-dont-mix-non-resource-urls-and-resources
Automatic merge from submit-queue

rbac validation: rules can't combine non-resource URLs and regular resources

This PR updates the validation used for RBAC to prevent rules from mixing non-resource URLs and regular resources.

For example the following is no longer valid

```yml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: admins
rules:
  - apiGroups: ["*"]
    resources: ["*"]
    verbs: ["*"]
    nonResourceURLs: ["*"]
```

And must be rewritten as so.

```yml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: admins
rules:
  - apiGroups: ["*"]
    resources: ["*"]
    verbs: ["*"]
  - nonResourceURLs: ["*"]
    verbs: ["*"]
``` 

It also:
* Mandates non-zero length arrays for required resources.
* Mandates non-resource URLs only be used for ClusterRoles (not namespaced Roles).
* Updates the swagger validation so `verbs` are the only required field in a rule. Further validation is done by the server.

Also, do we need to bump the API version?

Discussed by @erictune and @liggitt  in #28304

Updates kubernetes/features#2

cc @kubernetes/sig-auth 

Edit:
* Need to update the RBAC docs if this change goes in.
2016-08-04 04:52:51 -07:00
Eric Chiang 93947663d9 RBAC: don't allow rules to mix non-resource URLs and resources 2016-08-02 13:33:34 -07:00
lixiaobing10051267 be8d081539 Check all places to break the loop when object found 2016-07-23 13:49:04 +08:00
albatross0 d1b14e2fae Fix RBAC authorizer of ServiceAccount
RBAC authorizer assigns a role to a wrong service account.
2016-07-21 01:50:08 +09:00
Eric Chiang addc4b166c rbac authorizer: support non-resource urls with stars ("/apis/*") 2016-07-12 10:01:53 -07:00
Eric Chiang 411922f66c rbac authorizer: include verb in non-resource url requests 2016-07-12 10:01:53 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Eric Chiang d13e351028 add unit and integration tests for rbac authorizer 2016-06-14 11:07:48 -07:00
Eric Chiang 88119903e5 pkg/apis/rbac: make apiversion optional for subjects and fix validation 2016-06-13 15:02:48 -07:00
Eric Chiang e3604e2590 add validation to rbac group and apply small cleanups 2016-05-25 14:19:04 -07:00
Tim Hockin 152c86ab06 Make name validators return string slices 2016-05-18 00:48:01 -07:00
Eric Chiang 6a1f46895e pkg/apis: rbac types added 2016-05-11 12:01:06 +02:00