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

Improve --requestheader-client-ca-file warning #10093

Conversation

schu
Copy link
Contributor

@schu schu commented Aug 27, 2018

It's important to use a distinct CA (unless you exactly know what you
are doing) but not clear from the current documentation and warning.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 27, 2018
@k8sio-netlify-preview-bot
Copy link
Collaborator

k8sio-netlify-preview-bot commented Aug 27, 2018

Deploy preview for kubernetes-io-master-staging ready!

Built with commit 52509b9

https://deploy-preview-10093--kubernetes-io-master-staging.netlify.com

@Bradamant3 Bradamant3 self-assigned this Aug 27, 2018
@@ -548,7 +548,8 @@ extra:

In order to prevent header spoofing, the authenticating proxy is required to present a valid client
certificate to the API server for validation against the specified CA before the request headers are
checked.
checked. WARNING: make sure to use a distinct CA and do **not** reuse a CA that is used in a different
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's not absolutely necessary to use a different CA, but it is important to be careful about these certificates, no matter how they chain.

I would propose that this warning gets turned into a more general "this client certificate will be able to convey authentication info to the API server, so be careful with it."

And then down in the "--requestheader-allowed-names" description, we can call out that "any Common Name is allowed, which means that any client certificate issued by any CA in the bundle will be allowed."

Copy link
Contributor Author

@schu schu Aug 28, 2018

Choose a reason for hiding this comment

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

As far as I understand, the only way it can be secure with the same CA used for both --client-ca-file and --requestheader-client-ca-file is when absolutely all client traffic goes through the authenticating proxy (i.e. the apiserver is not reachable from other endpoints than the proxy and the --client-ca-file "not used"; I would guess that's a rare setup) or when --requestheader-allowed-names is chosen very carefully in combination with a procedure that makes sure that certificate signing requests with the allowed names are denied in general (i.e. do not kubectl certificate approve ... with a CN that matches one of those in --requestheader-allowed-names).

this client certificate will be able to convey authentication info to the API server, so be careful with it.

I'm worried that this is not clear. Expert users can always choose to make an educated decision against the general recommendation, but to me it seems the only "safe" general recommendation is to use a different CA.

"convey authentication info" is unclear about the actual impact (any client with a valid certificate can effectively escalate privileges to cluster admin). And "be careful" not actionable. What is the recommended, secure default? Where and how do I need to be careful? etc.

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm. Yeah, I see your point. Maybe we can go with the "don't do this" language, and just add a "unless you understand the risks and the mechanisms to protect the CA's usage."

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me, updated.

It's important to use a distinct CA (unless you exactly know what you
are doing) but not clear from the current documentation and warning.
@schu schu force-pushed the schu/more-explicit-requestheader-warning branch from 8e241cd to 52509b9 Compare September 3, 2018 14:22
@cjcullen
Copy link
Member

cjcullen commented Sep 5, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 5, 2018
@tengqm
Copy link
Contributor

tengqm commented Sep 6, 2018

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cjcullen, tengqm

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 6, 2018
@k8s-ci-robot k8s-ci-robot merged commit 949a1ff into kubernetes:master Sep 6, 2018
@schu schu deleted the schu/more-explicit-requestheader-warning branch September 6, 2018 08:04
@schu
Copy link
Contributor Author

schu commented Sep 6, 2018

@cjcullen @tengqm thanks!

bsalamat pushed a commit to bsalamat/kubernetes.github.io that referenced this pull request Sep 7, 2018
It's important to use a distinct CA (unless you exactly know what you
are doing) but not clear from the current documentation and warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

6 participants