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

[WIP] AUTH-509: add unauth grp restore #75133

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
163 changes: 163 additions & 0 deletions modules/restore-unauthenticated-group-bindings.adoc
@@ -0,0 +1,163 @@
// Module included in the following assemblies:
//
// * authentication/???.adoc
// * post_installation_configuration/???.adoc
Copy link
Author

Choose a reason for hiding this comment

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

Not sure, where to add it or if I should create entries completely. I would assume it would make sense to have it in authenticadtion / post_installation_configuration.


:_mod-docs-content-type: PROCEDURE
[id="restoring-bindings-unauthenticated-groups_{context}"]
= Restoring Cluster Role Bindings for Unauthenticated Groups

If you are a cluster administrator and have noticed that unauthenticated groups are not included in certain role bindings in newly created clusters, and this configuration does not meet your operational requirements, this documentation provides steps to add these groups. These instructions guide you through the process to configure your OpenShift clusters as needed.

.Prerequisites
* Ensure that you have `cluster-admin` permissions.
* Access to the command line interface (CLI) tool `oc` is required.

.Context
With recent changes in security configurations, some cluster role bindings no longer include unauthenticated groups in new cluster deployments. This leads to an operational regression compared to previous cluster setups where such access was configured. This documentation helps in manually adding these groups back where necessary.

[id="overview-of-affected-cluster-role-bindings_{context}"]
== Overview of Affected Cluster Role Bindings

In new deployments, unauthenticated groups are no longer included in cluster role bindings that would grant them the following roles:

* `system:scope-impersonation`
* `system:webhook`
* `system:oauth-token-deleter`
* `self-access-reviewer`

[id="adding-unauthenticated-groups-to-cluster-role-bindings_{context}"]
== Adding Unauthenticated Groups to Cluster Role Bindings

To add unauthenticated groups to each of these cluster role bindings, create individual YAML files and apply them using the `oc` CLI tool. The following sections provide the YAML content and commands needed for this configuration.

[NOTE]
====
Applying these configurations will allow unauthenticated groups to access specific resources as configured. It is essential to consider the security implications of such changes and ensure they align with your organizational security policies.
====

[IMPORTANT]
====
Always verify compliance with your organization's security standards when modifying role bindings, particularly when including unauthenticated access.
====


[id="add-scope-impersonation_{context}"]
=== Adding Unauthenticated Groups to Scope Impersonation

.Add Unauthenticated Groups to the Scope Impersonation Cluster Role
. Create a file named `add-scope-impersonation-unauth.yaml` and add the following content:
+
[source,yaml]
----
ibihim marked this conversation as resolved.
Show resolved Hide resolved
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
name: restore-scope-impersonation-unauth
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:scope-impersonation
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:unauthenticated
----
. Apply the configuration:
+
[source,bash]
----
oc apply -f add-scope-impersonation-unauth.yaml
----

[id="add-webhooks_{context}"]
=== Adding Unauthenticated Groups to Webhooks

.Add Unauthenticated Groups to the Webhooks Cluster Role
. Create a file named `add-webhooks-unauth.yaml` and add the following content:
+
[source,yaml]
----
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
name: restore-webhooks-unauth
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:webhook
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:unauthenticated
----
. Apply the configuration:
+
[source,bash]
----
oc apply -f add-webhooks-unauth.yaml
----

[id="add-oauth-token-deletion_{context}"]
=== Adding Unauthenticated Groups to OAuth Token Deletion

.Add Unauthenticated Groups to the OAuth Token Deletion Cluster Role
. Create a file named `add-oauth-token-deletion-unauth.yaml` and add the following content:
+
[source,yaml]
----
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
name: restore-oauth-token-deleters-unauth
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:oauth-token-deleter
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:unauthenticated
----
. Apply the configuration:
+
[source,bash]
----
oc apply -f add-oauth-token-deletion-unauth.yaml
----

[id="add-self-access-review_{context}"]
=== Adding Unauthenticated Groups to Self Access Review Role

.Add Unauthenticated Groups to `self-access-review` Cluster Role
. Create a file named `add-self-access-review-unauth.yaml` and add the following content:
+
[source,yaml]
----
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
name: restore-self-access-reviewers-unauth
roleRef:
apiGroup: rbac.authorization.k8s.io
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.CaseSensitiveTerms: Use 'Kubernetes' rather than 'k8s'. For more information, see RedHat.CaseSensitiveTerms.

kind: ClusterRole
name: self-access-reviewer
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:unauthenticated
----
. Apply the configuration:
+
[source,bash]
----
oc apply -f add-self-access-review-unauth.yaml
----