-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Switch to ABAC authorization from AllowAll #24210
Conversation
@kubernetes/kube-iam I don't have any experience with GCP. Is there a sane way for someone to administer this file? |
The only way to administer the current ABAC setup is by editing the policy file and then restarting the apiserver. Authorization is done as a union of plugins, so as long as we have This may bite somebody who is minting their own client certs with different CNs, or is manually adding tokens to known_tokens.csv. |
@@ -27,6 +27,7 @@ is_push=$@ | |||
|
|||
readonly KNOWN_TOKENS_FILE="/srv/salt-overlay/salt/kube-apiserver/known_tokens.csv" | |||
readonly BASIC_AUTH_FILE="/srv/salt-overlay/salt/kube-apiserver/basic_auth.csv" | |||
readonly ABAC_POLICY_FILE="/srv/salt-overlay/salt/kube-apiserver/policy.jsonl" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for heads-up. I will make a change for our stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is jsonl? list? i haven't seen that before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON lines: http://jsonlines.org/
I hadn't heard of it before this.
This seems like a safe change. Possibly breaking for uncommon cases, but okay.
Looks good to me, but I'd like @mikedanese to just take one look too. |
@@ -1354,3 +1356,8 @@ function ssh-to-node { | |||
function prepare-e2e() { | |||
detect-project | |||
} | |||
|
|||
# Writes configure-vm.sh to a temporary location with comments stripped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should expand this comment a bit to explain why we are doing this (because otherwise we are going to overflow the size of a single metadata field). This is the simplest minification that we can do and reduces the number of bytes by about a third.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
LGTM |
Updated the PR to add the policy file to source control. Also clarified the title (it isn't just changing GCP). |
LGTM |
/srv/kubernetes/basic_auth.csv: | ||
file.managed: | ||
- source: salt://kube-apiserver/basic_auth.csv | ||
- user: root | ||
- group: root | ||
- mode: 600 | ||
/srv/kubernetes/abac-authz-policy.jsonl: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a newline before the definition for the new managed file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
GCE e2e build/test passed for commit 3253739. |
Re-adding LGTM. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 3253739. |
Automatic merge from submit-queue |
Switch from AllowAll to ABAC. All existing identities (that are created by deployment scripts) are given full permissions through ABAC. Manually created identities will need policies added to the
policy.jsonl
file on the master.