k3s/pkg
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
..
admission Fix usage of shared informer in namespace admission controllers 2016-08-01 13:40:34 -04:00
api interesting changes to add tokenreviews endpoint to implement webhook 2016-08-03 08:37:45 -04:00
apimachinery Merge pull request #28431 from brendandburns/thirdparty2 2016-07-22 09:41:58 -07:00
apis Merge pull request #29930 from ericchiang/rbac-validation-dont-mix-non-resource-urls-and-resources 2016-08-04 04:52:51 -07:00
apiserver fix a wrong word in the comment 2016-07-27 09:13:34 +08:00
auth Merge pull request #28281 from nhlfr/authorize-return-bool 2016-07-18 21:40:26 -07:00
capabilities Use Go canonical import paths 2016-07-16 13:48:21 -04:00
client Merge pull request #29796 from deads2k/token-review 2016-08-03 20:48:31 -07:00
cloudprovider - Updated vmware/govmomi godep (Needs for vsan support) 2016-08-03 16:37:56 -07:00
controller Merge pull request #29889 from janetkuo/deployment-e2e-test-fix 2016-08-04 00:43:41 -07:00
conversion Use Go canonical import paths 2016-07-16 13:48:21 -04:00
credentialprovider Merge pull request #28539 from derekwaynecarr/credential_provider_timeout 2016-07-22 18:01:41 -07:00
dns Merge pull request #29523 from fraenkel/service_names_rfc1035 2016-08-02 10:33:16 -07:00
fieldpath Use Go canonical import paths 2016-07-16 13:48:21 -04:00
fields Use Go canonical import paths 2016-07-16 13:48:21 -04:00
genericapiserver Merge pull request #29861 from xiangpengzhao/verify-secure-insecure-port-equal 2016-08-03 23:28:50 -07:00
healthz fixes the wrong doc in package healthz 2016-07-18 22:46:09 +08:00
httplog Use Go canonical import paths 2016-07-16 13:48:21 -04:00
hyperkube Use Go canonical import paths 2016-07-16 13:48:21 -04:00
kubectl Merge pull request #29500 from lixiaobing10051267/masterFound 2016-08-03 20:05:15 -07:00
kubelet Merge pull request #29925 from ronnielai/container-gc 2016-08-04 04:20:02 -07:00
kubemark Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
labels Print/log pointers of structs with %#v instead of %+v 2016-08-01 22:27:56 +02:00
master interesting changes to add tokenreviews endpoint to implement webhook 2016-08-03 08:37:45 -04:00
metrics Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
probe Merge pull request #27562 from 7ing/ipt 2016-08-02 08:02:32 -07:00
proxy Print/log pointers of structs with %#v instead of %+v 2016-08-01 22:27:56 +02:00
quota Merge pull request #28611 from deads2k/union-quota-regsitry 2016-08-01 09:32:44 -07:00
registry interesting changes to add tokenreviews endpoint to implement webhook 2016-08-03 08:37:45 -04:00
runtime Merge pull request #29042 from dims/fixup-imports 2016-07-18 07:23:38 -07:00
security Merge pull request #29356 from smarterclayton/init_containers 2016-07-27 16:09:34 -07:00
securitycontext Remove pod mutation for PVs with supplemental GIDs 2016-07-22 17:41:44 -04:00
serviceaccount Check for valid serviceaccount JWT token before inspecting claims 2016-07-06 14:25:15 -04:00
ssh Revert "Add a customized ssh dialer that will timeout" 2016-07-14 08:48:24 +02:00
storage Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04:00
types Use Go canonical import paths 2016-07-16 13:48:21 -04:00
ui Use Go canonical import paths 2016-07-16 13:48:21 -04:00
util Merge pull request #30036 from caesarxuchao/README-to-doc 2016-08-03 23:28:55 -07:00
version Use Go canonical import paths 2016-07-16 13:48:21 -04:00
volume - Updated vmware/govmomi godep (Needs for vsan support) 2016-08-03 16:37:56 -07:00
watch Use Go canonical import paths 2016-07-16 13:48:21 -04:00
OWNERS Remove bgrant from pkg/OWNERS and pkg/kubectl/OWNERS since he has plenty to do. 2016-06-16 08:21:27 -07:00