-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OCPBUGS979 Implementing BYOB OIDC Keys
- Loading branch information
Daniel Chadwick
committed
Jan 15, 2025
1 parent
94d55da
commit a5d56d2
Showing
3 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
authentication/identity_providers/implementing-byo-oidc-keys.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
:_mod-docs-content-type: ASSEMBLY | ||
include::_attributes/common-attributes.adoc[] | ||
[id="implementing-byo-oidc-keys"] | ||
= Implementing Bring Your Own OIDC Keys | ||
:context: implementing-byo-oidc-keys | ||
|
||
toc::[] | ||
|
||
Integrating OpenShift with an external identity provider using OpenID Connect (OIDC) can significantly enhance your security and streamline user authentication across platforms. The "Bring Your Own OIDC Keys" feature in [{roduct-title}] allows you to inject your own service account signing key and specify the serviceAccountIssuer, enabling a seamless setup with any identity provider that supports the OIDC Discovery mechanism. | ||
|
||
include::modules/using-byo-oidc-keys.adoc[leveloffset=+1] |
83 changes: 83 additions & 0 deletions
83
...orking/networking_operators/aws_load_balancer_operator/using-byo-oidc-keys.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * networking/networking_operators/implementing-byo-oidc-keys.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="using-byo-oidc-keys_{context}"] | ||
= Implementing Bring Your Own OIDC Keys | ||
|
||
The following procedure describes how to implement the Bring Your Own OIDC Key feature in {product-title}. Ensure your environment meets the following prerequisites before starting the procedure. | ||
|
||
.Prerequisites | ||
|
||
* Access to the OpenShift cluster with necessary administrative privileges. | ||
* The `ccoctl` tool installed. | ||
* The AWS STS environment setup if using AWS for the installation. | ||
.Procedure | ||
|
||
. Generate Service Account Signing Key: | ||
|
||
Use the following command to generate a service account signing key: | ||
|
||
[source,terminal] | ||
---- | ||
$ openssl genpkey -algorithm RSA -out service-account-signing-key.pem -pkeyopt rsa_keygen_bits:2048 | ||
---- | ||
|
||
. Create Secret for Signing Key: | ||
|
||
Create a secret in the OpenShift cluster to store the signing key: | ||
[source,terminal] | ||
---- | ||
$ oc create secret generic service-account-signing-key-secret --from-file=service-account-signing-key.pem -n openshift-config | ||
---- | ||
|
||
. Update Authentication Configuration: | ||
|
||
Modify the `Authentication` custom resource to reference the new service account issuer and signing key: | ||
[source,yaml] | ||
---- | ||
apiVersion: config.openshift.io/v1 | ||
kind: Authentication | ||
metadata: | ||
name: cluster | ||
spec: | ||
serviceAccountIssuer: "https://issuer.example.com" | ||
serviceAccountPublicKeys: | ||
- name: "service-account-signing-key.pem" | ||
key: | | ||
-----BEGIN PUBLIC KEY----- | ||
YOUR_PUBLIC_KEY_HERE | ||
-----END PUBLIC KEY----- | ||
---- | ||
. Patch the Cluster Authentication Operator: | ||
Apply the patch to the cluster authentication operator to include the new configuration: | ||
[source,terminal] | ||
---- | ||
$ oc patch authentication.operator.openshift.io/cluster --type=merge --patch '{ | ||
"spec": { | ||
"serviceAccountIssuer": "https://issuer.example.com", | ||
"serviceAccountPublicKeys": [{ | ||
"name": "service-account-signing-key.pem", | ||
"key": "-----BEGIN PUBLIC KEY-----\nYOUR_PUBLIC_KEY_HERE\n-----END PUBLIC KEY-----" | ||
}] | ||
} | ||
}' | ||
---- | ||
. Validate the Configuration: | ||
Ensure the new configuration is applied successfully: | ||
[source,terminal] | ||
---- | ||
$ oc get authentication.operator.openshift.io/cluster -o yaml | ||
---- | ||
. Set Up OIDC Integration: | ||
Configure your identity provider to use the new OIDC setup. Follow your identity provider's documentation on integrating with OpenID Connect. |