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

remove default authz ModeAlwaysAllow #61762

Closed
wants to merge 2 commits into from

Conversation

hzxuzhonghu
Copy link
Member

Do not set default ModeAlwaysAllow authorization mode.

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 27, 2018
@k8s-ci-robot k8s-ci-robot requested review from deads2k and liggitt March 27, 2018 10:53
@hzxuzhonghu
Copy link
Member Author

@deads2k Indeed many test case failed just for this, should I fix them or just keep the AlwaysAllow authz mode there?

@deads2k
Copy link
Contributor

deads2k commented Mar 27, 2018

@deads2k Indeed many test case failed just for this, should I fix them or just keep the AlwaysAllow authz mode there?

Is it exposed as a default in the kube-apiserver command? We don't keep defaults in our code to make tests easy, we keep defaults in our code to make "normal" objects match user expectations. If it is only for testing purposes, it should be changed.

@hzxuzhonghu
Copy link
Member Author

OK, got it, will work on fixing test cases.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 28, 2018
@hzxuzhonghu hzxuzhonghu changed the title [WIP] remove default authz ModeAlwaysAllow remove default authz ModeAlwaysAllow Mar 28, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 28, 2018
@hzxuzhonghu
Copy link
Member Author

Is it exposed as a default in the kube-apiserver command?

No, not any words at all.

@hzxuzhonghu
Copy link
Member Author

hzxuzhonghu commented Mar 28, 2018

/retest

flake case

@deads2k
Copy link
Contributor

deads2k commented Mar 28, 2018

hyperkube kube-apiserver --help 2>&1 | grep authorization-mode
      --authorization-mode string                               Ordered list of plug-ins to do authorization on secure port. Comma-delimited list of: AlwaysAllow,AlwaysDeny,ABAC,Webhook,RBAC,Node. (default "AlwaysAllow")

Looks like it may be a default value. How about starting a thread on the mailing list about changing the default to RBAC. It's stable now and used in all our e2e tests.

@hzxuzhonghu
Copy link
Member Author

Looks like it may be a default value

I think you use an old version, newest does not saying that default https://github.com/kubernetes/kubernetes/blob/master/pkg/kubeapiserver/options/authorization.go#L93-L95.

How about starting a thread on the mailing list about changing the default to RBAC.

That's ok.

@liggitt
Copy link
Member

liggitt commented Mar 29, 2018

I think you use an old version, newest does not saying that default

It is the current default. The help text prints the current value of the Modes variable, which is AlwayAllow by default

@hzxuzhonghu
Copy link
Member Author

It is the current default. The help text prints the current value of the Modes variable, which is AlwayAllow by default

Yes, it is the default behavior indeed.

@hzxuzhonghu
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hzxuzhonghu
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: deads2k

Assign the PR to them by writing /assign @deads2k in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2018
@hzxuzhonghu
Copy link
Member Author

/retest

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 8, 2018
@hzxuzhonghu
Copy link
Member Author

ping @liggitt @deads2k

@hzxuzhonghu
Copy link
Member Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 27, 2018
@liggitt
Copy link
Member

liggitt commented Jul 27, 2018

changing default behavior is not something we typically do, especially for something that fundamentally changes the way you interact with a cluster like this.

A good point at which to improve the default behavior would be when we move to starting the apiserver from a config file (proposal in progress), similar to what we did for the kubelet in #59666.

I'd probably recommend the authorization mode be explicitly specified when starting from a config file, rather than defaulting to permissive mode or a particular authorizer.

@hzxuzhonghu
Copy link
Member Author

Thanks @liggitt for your clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants