Skip to content

Commit cf1516e

Browse files
authored
Merge pull request #75173 from cbippley/OSDOCS-10363
[DOCS] AUTH-509 Reducing permissions for unauthenticated users for apiserver access
2 parents 4ac6b1e + 415f756 commit cf1516e

12 files changed

+170
-1
lines changed

authentication/impersonating-system-admin.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ include::modules/authentication-api-impersonation.adoc[leveloffset=+1]
1111
include::modules/impersonation-system-admin-user.adoc[leveloffset=+1]
1212

1313
include::modules/impersonation-system-admin-group.adoc[leveloffset=+1]
14+
15+
include::modules/unauthenticated-users-cluster-role-binding.adoc[leveloffset=+1]

authentication/managing-oauth-access-tokens.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ include::modules/oauth-view-details-tokens.adoc[leveloffset=+1]
1616

1717
// Deleting user-owned OAuth access tokens
1818
include::modules/oauth-delete-tokens.adoc[leveloffset=+1]
19+
20+
// Adding unauthenticated groups to ClusterRoleBindings
21+
include::modules/unauthenticated-users-cluster-role-binding.adoc[leveloffset=+1]

authentication/tokens-scoping.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ include::_attributes/common-attributes.adoc[]
77
toc::[]
88

99
include::modules/tokens-scoping-about.adoc[leveloffset=+1]
10+
11+
include::modules/unauthenticated-users-cluster-role-binding.adoc[leveloffset=+1]

authentication/using-rbac.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ endif::openshift-rosa[]
4242
ifdef::openshift-dedicated[]
4343
include::modules/osd-grant-admin-privileges.adoc[leveloffset=+1]
4444
endif::openshift-dedicated[]
45+
46+
include::modules/unauthenticated-users-cluster-role-binding-con.adoc[leveloffset=+1]

cicd/builds/triggering-builds-build-hooks.adoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ include::modules/builds-triggers.adoc[leveloffset=+1]
1212

1313
include::modules/builds-webhook-triggers.adoc[leveloffset=+2]
1414

15+
include::modules/unauthenticated-users-system-webhook.adoc[leveloffset=+3]
16+
17+
[role="_additional-resources"]
18+
.Additional resources
19+
20+
* xref:../../authentication/using-rbac.adoc#unauthenticated-users-cluster-role-bindings-concept_using-rbac[Cluster role bindings for unauthenticated groups]
21+
1522
include::modules/builds-using-github-webhooks.adoc[leveloffset=+3]
1623

1724
include::modules/builds-using-gitlab-webhooks.adoc[leveloffset=+3]
@@ -34,4 +41,4 @@ include::modules/builds-build-hooks.adoc[leveloffset=+1]
3441

3542
include::modules/builds-configuring-post-commit-build-hooks.adoc[leveloffset=+2]
3643

37-
include::modules/builds-using-cli-post-commit-build-hooks.adoc[leveloffset=+2]
44+
include::modules/builds-using-cli-post-commit-build-hooks.adoc[leveloffset=+2]

modules/builds-using-bitbucket-webhooks.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ The payload URL is returned as the Bitbucket Webhook URL by the `oc describe` co
2424
https://<openshift_api_host:port>/apis/build.openshift.io/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/bitbucket
2525
----
2626

27+
.Prerequisites
28+
29+
* `system:unauthenticated` has access to the `system:webhook` role in the required namespaces. Or, `system:unauthenticated` has access to the `system:webhook` cluster role.
30+
2731
.Procedure
2832

2933
. Configure a Bitbucket Webhook.

modules/builds-using-github-webhooks.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ https://<openshift_api_host:port>/apis/build.openshift.io/v1/namespaces/<namespa
3535
.Prerequisites
3636

3737
* Create a `BuildConfig` from a GitHub repository.
38+
* `system:unauthenticated` has access to the `system:webhook` role in the required namespaces. Or, `system:unauthenticated` has access to the `system:webhook` cluster role.
3839
3940
.Procedure
4041

modules/builds-using-gitlab-webhooks.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ The payload URL is returned as the GitLab Webhook URL by the `oc describe` comma
2424
https://<openshift_api_host:port>/apis/build.openshift.io/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/gitlab
2525
----
2626

27+
.Prerequisites
28+
29+
* `system:unauthenticated` has access to the `system:webhook` role in the required namespaces. Or, `system:unauthenticated` has access to the `system:webhook` cluster role.
30+
2731
.Procedure
2832

2933
. Configure a GitLab Webhook.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * authentication/using-rbac.adoc
4+
// * post_installation_configuration/preparing-for-users.adoc
5+
6+
:_mod-docs-content-type: CONCEPT
7+
[id="unauthenticated-users-cluster-role-bindings-concept_{context}"]
8+
= Cluster role bindings for unauthenticated groups
9+
10+
[NOTE]
11+
====
12+
Before {product-title} 4.16, unauthenticated groups were allowed access to some cluster roles. Clusters updated from versions before {product-title} 4.16 retain this access for unauthenticated groups.
13+
====
14+
15+
For security reasons {product-title} {product-version} does not allow unauthenticated groups to have default access to cluster roles.
16+
17+
There are use cases where it might be necessary to add `system:unauthenticated` to a cluster role.
18+
19+
Cluster administrators can add unauthenticated users to the following cluster roles:
20+
21+
* `system:scope-impersonation`
22+
* `system:webhook`
23+
* `system:oauth-token-deleter`
24+
* `self-access-reviewer`
25+
26+
[IMPORTANT]
27+
====
28+
Always verify compliance with your organization's security standards when modifying unauthenticated access.
29+
====
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * authentication/impersonating-system-admin.adoc
4+
// * authentication/tokens-scoping.adoc
5+
// * authentication/managing-oauth-access-tokens.adoc
6+
// * post_installation_configuration/preparing-for-users.adoc
7+
8+
:_mod-docs-content-type: PROCEDURE
9+
[id="unauthenticated-users-cluster-role-bindings_{context}"]
10+
= Adding unauthenticated groups to cluster roles
11+
12+
As a cluster administrator, you can add unauthenticated users to the following cluster roles in {product-title} by creating a cluster role binding. Unauthenticated users do not have access to non-public cluster roles. This should only be done in specific use cases when necessary.
13+
14+
You can add unauthenticated users to the following cluster roles:
15+
16+
* `system:scope-impersonation`
17+
* `system:webhook`
18+
* `system:oauth-token-deleter`
19+
* `self-access-reviewer`
20+
21+
[IMPORTANT]
22+
====
23+
Always verify compliance with your organization's security standards when modifying unauthenticated access.
24+
====
25+
26+
.Prerequisites
27+
28+
* You have access to the cluster as a user with the `cluster-admin` role.
29+
* You have installed the OpenShift CLI (`oc`).
30+
31+
.Procedure
32+
33+
. Create a YAML file named `add-<cluster_role>-unauth.yaml` and add the following content:
34+
+
35+
[source,yaml]
36+
----
37+
apiVersion: rbac.authorization.k8s.io/v1
38+
kind: ClusterRoleBinding
39+
metadata:
40+
annotations:
41+
rbac.authorization.kubernetes.io/autoupdate: "true"
42+
name: <cluster_role>access-unauthenticated
43+
roleRef:
44+
apiGroup: rbac.authorization.k8s.io
45+
kind: ClusterRole
46+
name: <cluster_role>
47+
subjects:
48+
- apiGroup: rbac.authorization.k8s.io
49+
kind: Group
50+
name: system:unauthenticated
51+
----
52+
. Apply the configuration by running the following command:
53+
+
54+
[source,terminal]
55+
----
56+
$ oc apply -f add-<cluster_role>.yaml
57+
----

0 commit comments

Comments
 (0)