-
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
Add non-resource-request support to ABAC, fix kubectl for namespaced users #16148
Add non-resource-request support to ABAC, fix kubectl for namespaced users #16148
Conversation
c89926d
to
e162b71
Compare
@kubernetes/kube-iam this should give us sufficient authz power to allow API discovery and version negotiation while still constraining users to namespaces. I'd like to update the ABAC file format to a versioned format (falling back to the current JSONL format on deserialize errors for backwards compatibility), but will do that in another PR |
Labelling this PR as size/L |
@liggitt the sticking point last time was whether non-resource access was default allow or default deny. Which did you choose? |
@liggitt LGTM i built and tested the branch, seems to work fine:
|
flakes, only one that looked like it could be relevant (kubectl test) passed locally:
@k8s-bot test this |
maybe... do you care if I squash to a single commit? |
I chose default deny, because default allow seems crazy when a field name typo in the policy file means the rule would be empty, allowing all. Granted, that's how namespace and resource behave now... but I was hoping to avoid propagating that. Thinking further, though, To get this looking the way I want internally, I may bite the bullet and add a versioned schema for ABACPolicy, and start requiring "*" for namespace and resource to match. Something like this:
Deserialize failures on old ABAC files could attempt to read the JSONL format and convert to the versioned form like this:
Before I start on that, any objections from @kubernetes/kube-iam on the approach? |
or, while bullets are being bitten, this:
Being able to grant a user or group permission across namespaces, verbs, and resources in a single rule improves readability quite a bit. Depends on how real we envision this being, and whether we see this as a progression toward dynamic authz. |
No. That makes |
@liggitt: sure, go ahead. |
e162b71
to
e0afd87
Compare
I like default denies and other than allowing both non-resource and resource rules in a single statement, I like the format of #16148 (comment). If you want a new format, would it be easier to simply have a second authorizer to implement it? |
/cc @erictune (This is the kubectl namespacing patch I was talking about) |
28b47c7
to
d393378
Compare
Labelling this PR as size/XXL |
GCE e2e test build/test passed for commit 0ad102799d267992f65df5505a50eea44aa90a56. |
GCE e2e test build/test passed for commit bb20bead6cf93cf3f5faf5adff6ca0c1d6591a97. |
Thank you for humoring me, no more objections here! |
lgtm. Squash and tag at will. |
bb20bea
to
dc4506e
Compare
@lavalamp thinking further, was there a specific reason for making the version |
Yeah-- if we call it v1beta1 then I don't have to be picky about the On Wed, Dec 2, 2015 at 10:37 AM, Jordan Liggitt notifications@github.com
|
GCE e2e test build/test passed for commit dc4506ecd57e2f53a4ec7fad31f9a99914a71e77. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit dc4506ecd57e2f53a4ec7fad31f9a99914a71e77. |
dc4506e
to
2321651
Compare
rebased |
Travis continuous integration appears to have missed, closing and re-opening to trigger it |
GCE e2e test build/test passed for commit 2321651. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 2321651. |
Automatic merge from submit-queue |
…ced_users Auto commit by PR queue bot
Rebased and built on #13667
IsResourceRequest
)IsResourceRequest
to authorize non-resource requests to paths like/swaggerapi
, or/apis
or/healthz
, etc)"user":"*","namespace":"*","resource":"*","apiGroup":"*","nonResourcePath":"*"
to match all (deny by default, rather than grant by default)