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

Add RFD 183: Access Request Kube Resource Allow List #46691

Merged
merged 7 commits into from
Nov 15, 2024

Conversation

kimlisa
Copy link
Contributor

@kimlisa kimlisa commented Sep 17, 2024

rendered

part of: #46742

@github-actions github-actions bot added rfd Request for Discussion size/md labels Sep 17, 2024
Copy link

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

1 similar comment
Copy link

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@kimlisa kimlisa marked this pull request as draft September 17, 2024 20:05
@kimlisa kimlisa added the no-changelog Indicates that a PR does not require a changelog entry label Sep 17, 2024
@kimlisa kimlisa force-pushed the rfd/0183-access-request-kube-resource-allow-list branch 2 times, most recently from cbe54dd to f697513 Compare September 17, 2024 20:21
@kimlisa kimlisa requested review from r0mant and tigrato September 17, 2024 20:23
@kimlisa kimlisa marked this pull request as ready for review September 17, 2024 20:23
@github-actions github-actions bot requested a review from timothyb89 September 17, 2024 20:24
@r0mant
Copy link
Collaborator

r0mant commented Sep 17, 2024

@klizhentas @xinding33 Can you review this when you get a chance?

@smallinsky smallinsky self-requested a review September 18, 2024 16:24
@kimlisa kimlisa force-pushed the rfd/0183-access-request-kube-resource-allow-list branch from a750979 to 26d187f Compare September 19, 2024 21:44
@kimlisa kimlisa requested a review from r0mant September 19, 2024 21:50
@kimlisa kimlisa force-pushed the rfd/0183-access-request-kube-resource-allow-list branch from 460cff6 to 4e7ad75 Compare October 2, 2024 17:56
Comment on lines 167 to 207
```yaml
kind: role
metadata:
name: requester
spec:
options:
request_mode:
# Can request only pods or namespaces
kubernetes_resources:
- kind: namespace
- kind: pod
```
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why we have this under spec.options.request_mode.kubernetes_resources instead of, say, spec.allow.request.kubernetes_resources. Basically why is it a role option and not under spec.allow.request where most other access request configuration is? And what is the effect if the option is set differently in multiple roles the user has?

I haven't really thought about it hard enough to say one of those options is definitively better, I'm just wondering if there's a reason or it just seemed like the default way to do it

Copy link
Contributor

Choose a reason for hiding this comment

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

After slightly more thought, I think this doesn't really make sense as a role option, and an allow/deny rule would be better

Here's my mental model of role options (I'm sure there are exceptions to this but i think it's mostly accurate). Usually, role options are coalesced across all roles a user has to result in a single value, and usually that value ends up encoded in the user's certificate. For example, the forward_agent option is combined from all roles the user has, and it's encoded in the SSH cert when the user logs in. The same for many other options. Even when not encoded in the cert, usually you compute a single value from the user's entire role set.

If instead you want one role to allow the user to request certain kubernetes namespaces with certain target roles, and another role to allow the user to request kubernetes clusters with a different target role, and another role can deny the user requesting a specific namespace, I think this would be better as an allow/deny rule under spec.allow.request

Copy link
Contributor Author

@kimlisa kimlisa Oct 24, 2024

Choose a reason for hiding this comment

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

@nklaassen updated RFD to reflect field change

rendered

@kimlisa kimlisa requested review from nklaassen and r0mant October 24, 2024 07:35
Copy link
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

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

@kimlisa lgtm with one syntactic comment

spec:
allow:
request:
mode:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need "mode" sub-field at all here then? Sounds like something like this would be slightly cleaner:

spec:
  allow:
    request:
      kubernetes_resources:
      - kind: "*"

@kimlisa kimlisa force-pushed the rfd/0183-access-request-kube-resource-allow-list branch from dc9c7b5 to 93f98d5 Compare October 25, 2024 08:47
@kimlisa kimlisa force-pushed the rfd/0183-access-request-kube-resource-allow-list branch from 495c630 to b64659f Compare November 5, 2024 08:38
@kimlisa kimlisa added this pull request to the merge queue Nov 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2024
@kimlisa kimlisa added this pull request to the merge queue Nov 15, 2024
Merged via the queue into master with commit 9356889 Nov 15, 2024
39 of 40 checks passed
@kimlisa kimlisa deleted the rfd/0183-access-request-kube-resource-allow-list branch November 15, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry rfd Request for Discussion size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants