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

[v17] Add doc on new field request.kubernetes_resources #48653

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,73 @@ Requesting access to a Kubernetes Namespace allows you to access all resources
in that namespace but you won't be able to access any other supported resources
in the cluster.

##### Restrict Access Requests to specific Kubernetes resource kinds

The `request.kubernetes_resources` field allows you to restrict what kinds of Kubernetes
resources a user can request access to. Configuring this field to any value will disallow
requesting access to the entire Kubernetes cluster.

If the `request.kubernetes_resources` field is not configured, then a user can request access
to any Kubernetes resources, including the entire Kubernetes cluster.

The following role allows users to request access to Kubernetes namespaces.
Requests for Kubernetes resources other than `namespace` will not be allowed.

```yaml
kind: role
metadata:
name: requester-kube-access
version: v7
spec:
allow:
request:
search_as_roles:
- "kube-access"
kubernetes_resources:
- kind: "namespace"
```

The following role allows users to request access only to Kubernetes namespaces and/or pods.

```yaml
kind: role
metadata:
name: requester-kube-access
version: v7
spec:
allow:
request:
search_as_roles:
- "kube-access"
kubernetes_resources:
- kind: "namespace"
- kind: "pod"
```

The following role allows users to request access to any specific Kubernetes resources.

```yaml
kind: role
metadata:
name: requester-kube-access
version: v7
spec:
allow:
request:
search_as_roles:
- "kube-access"
kubernetes_resources:
- kind: "*"
```

See related section about [Kubernetes Resources](../../../enroll-resources/kubernetes-access/controls.mdx#kubernetes_resources)
to see a list of supported `kind` values.

The `request.kubernetes_resources` field only restricts what `kinds` of Kubernetes resource requests are allowed.
To control Kubernetes access to these resources see
[Preventing unintended access to Kubernetes resources](#preventing-unintended-access-to-kubernetes-resources)
section for more details.

#### `db`

You can restrict access to searching `db` resources by assigning values to the
Expand Down
7 changes: 7 additions & 0 deletions docs/pages/includes/role-spec.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ spec:
# resources accessible by the listed roles (enterprise-only)
search_as_roles: ['access']

# 'kubernetes_resources' restricts what kinds of Kubernetes resources
# a user can request access to. In the below example, users can
# request only Kubernetes namespaces. Default (when nothing is defined) allows
# access requests to any Kubernetes resource or the entire cluster.
kubernetes_resources:
- kind: "namespace"

# thresholds specifies minimum amount of approvers and deniers,
# defaults to 1 for both (enterprise-only)
thresholds:
Expand Down
Loading