-
Notifications
You must be signed in to change notification settings - Fork 3
Add docs for AuthenticationClass and TLS #10
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cbfca22
Add docs for AuthenticationClass and TLS
sbernauer 4a0898e
Update docs/modules/ROOT/pages/tls.adoc
sbernauer 4564179
Update docs/modules/ROOT/pages/tls.adoc
sbernauer c667c69
Add --- to every yaml file
sbernauer 7369cba
Merge branch 'docs/authN' of github.com:stackabletech/commons-operato…
sbernauer 3ba71ad
Apply suggestion for docs
sbernauer c84fc6d
Add plantuml diagram for AuthenticationClass
sbernauer 8547139
Merge branch 'main' into docs/authN
sbernauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/modules/ROOT/examples/authenticationclass-ldap-full.yaml
This file contains hidden or 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,30 @@ | ||
| --- | ||
| apiVersion: authentication.stackable.tech/v1alpha1 | ||
| kind: AuthenticationClass | ||
| metadata: | ||
| name: ldap-full | ||
| spec: | ||
| provider: | ||
| ldap: | ||
| hostname: my.ldap.server # <1> | ||
| port: 389 # <2> | ||
| searchBase: ou=users,dc=example,dc=org # <3> | ||
| searchFilter: (memberOf=cn=myTeam,ou=teams,dc=example,dc=org) # <4> | ||
| ldapFieldNames: # <5> | ||
| uid: uid | ||
| group: memberof | ||
| givenName: givenName | ||
| surname: sn | ||
| email: mail | ||
| bindCredentials: | ||
| secretClass: ldap-full-bind # <6> | ||
| scope: # <7> | ||
| pod: true | ||
| node: false | ||
| services: | ||
| - ldap-full | ||
| tls: # <8> | ||
| verification: | ||
| server: | ||
| caCert: | ||
| secretClass: ldap-full-ca-cert |
33 changes: 33 additions & 0 deletions
33
docs/modules/ROOT/examples/authenticationclass-ldap-openldap-simple.yaml
This file contains hidden or 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,33 @@ | ||
| --- | ||
| apiVersion: authentication.stackable.tech/v1alpha1 | ||
| kind: AuthenticationClass | ||
| metadata: | ||
| name: openldap-simple | ||
| spec: | ||
| provider: | ||
| ldap: | ||
| hostname: my.openldap.server | ||
| port: 1389 | ||
| searchBase: ou=users,dc=example,dc=org | ||
| bindCredentials: | ||
| secretClass: openldap-simple-bind # <1> | ||
| --- | ||
| apiVersion: secrets.stackable.tech/v1alpha1 | ||
| kind: SecretClass | ||
| metadata: | ||
| name: openldap-simple-bind # <2> | ||
| spec: | ||
| backend: | ||
| k8sSearch: | ||
| searchNamespace: | ||
| pod: {} # <3> | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: openldap-simple-bind # <4> | ||
| labels: | ||
| secrets.stackable.tech/class: openldap-simple-bind # <5> | ||
| stringData: | ||
| user: cn=admin,dc=example,dc=org | ||
| password: admin |
11 changes: 11 additions & 0 deletions
11
docs/modules/ROOT/examples/authenticationclass-ldap-simple.yaml
This file contains hidden or 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 @@ | ||
| --- | ||
| apiVersion: authentication.stackable.tech/v1alpha1 | ||
| kind: AuthenticationClass | ||
| metadata: | ||
| name: ldap-simple | ||
| spec: | ||
| provider: | ||
| ldap: | ||
| hostname: my.ldap.server # <1> | ||
| port: 389 # <2> | ||
| searchBase: ou=users,dc=example,dc=org # <3> |
This file contains hidden or 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,5 @@ | ||
| --- | ||
| tls: | ||
| verification: | ||
| mutual: | ||
| certSecretClass: openldap-tls |
This file contains hidden or 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,4 @@ | ||
| --- | ||
| tls: | ||
| verification: | ||
| none: {} |
6 changes: 6 additions & 0 deletions
6
docs/modules/ROOT/examples/tls-server-verification-custom-ca.yaml
This file contains hidden or 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,6 @@ | ||
| --- | ||
| tls: | ||
| verification: | ||
| server: | ||
| caCert: | ||
| secretClass: openldap-tls-ca |
6 changes: 6 additions & 0 deletions
6
docs/modules/ROOT/examples/tls-server-verification-webpki.yaml
This file contains hidden or 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,6 @@ | ||
| --- | ||
| tls: | ||
| verification: | ||
| server: | ||
| caCert: | ||
| webPki: {} |
This file contains hidden or 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,5 @@ | ||
| --- | ||
| # [...] | ||
| tls: | ||
| verification: | ||
| none: {} |
This file contains hidden or 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,27 @@ | ||
| allowmixing | ||
|
|
||
| database LDAP | ||
|
|
||
| map "Secret openldap-simple-bind" as secret_openldap_simple_bind { | ||
| user => cn=admin,dc=example,dc=org | ||
| password => admin | ||
| } | ||
|
|
||
| map "Secret openldap-simple-ca" as secret_openldap_simple_ca { | ||
| caCert => <ca certificate content> | ||
| } | ||
|
|
||
| map "SecretClass openldap-simple-bind" as secret_class_openldap_simple_bind { | ||
| k8sSearch *-> secret_openldap_simple_bind | ||
| } | ||
|
|
||
| map "SecretClass openldap-simple-ca" as secret_class_openldap_simple_ca { | ||
| k8sSearch *-> secret_openldap_simple_ca | ||
| } | ||
|
|
||
| map "AuthenticationClass openldap-simple" as authentication_class_openldap_simple { | ||
| ldapHost *--> LDAP | ||
| tlsServerVerification *--> secret_class_openldap_simple_ca | ||
| bindCredentials *--> secret_class_openldap_simple_bind | ||
| ldapSearchBase => ou=users,dc=example,dc=org | ||
| } |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -3,4 +3,5 @@ | |
| * xref:usage.adoc[] | ||
| * Concepts | ||
| ** xref:authenticationclass.adoc[] | ||
| ** xref:tls.adoc[] | ||
| ** xref:reloader.adoc[] | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,55 @@ | ||
| = `AuthenticationClass` | ||
|
|
||
| TODO | ||
| `AuthenticationClass` is a CRD describing a generic authentication method like LDAP or Kerberos. | ||
| Multiple operators use this CRD as a way to express the authentication of the product. | ||
|
|
||
| At the moment the following Authentication providers are supported: | ||
|
|
||
| * <<LDAP>> | ||
|
|
||
| == LDAP | ||
| A very simple `AuthenticationClass` with LDAP Authentication looks like this: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| include::example$authenticationclass-ldap-simple.yaml[] | ||
| ---- | ||
| <1> The hostname of the LDAP server without any protocol or port | ||
| <2> The port of the LDAP server. If TLS is used it defaults to `636` otherwise to `389` | ||
| <3> An optional searchBase where the users should be searched | ||
|
|
||
| === OpenLDAP | ||
| Here is an example that is tuned for an OpenLDAP LDAP server and is configured to read bind user credentials from a secret: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| include::example$authenticationclass-ldap-openldap-simple.yaml[] | ||
| ---- | ||
| <1> The name of the xref:secret-operator::secretclass.adoc[] providing the bind credentials (username and password). Must match the name of the xref:secret-operator::secretclass.adoc[] in this example in ② | ||
| <2> The name of the xref:secret-operator::secretclass.adoc[] we are creating that is referred to by ➀. See xref:secret-operator::secretclass.adoc[] | ||
| <3> This determines the namespace in which the referenced `Secret` will be looked for. In this case it searches for a `Secret` in the same namespace as the product runs in. See xref:secret-operator::secretclass.adoc#backend-k8ssearch[the documentation of SecretClass] | ||
| <4> The `Secret` containing the actual bind credentials. Please keep in mind that the `Secret` needs to be in the same namespace as the product | ||
| <5> The name of the xref:secret-operator::secretclass.adoc[] that wants to refer to this `Secret`. Must match the name of the xref:secret-operator::secretclass.adoc[] in this example in ② | ||
|
|
||
| The following diagram describes the relationship between the created CRDs | ||
|
|
||
| [plantuml] | ||
| ---- | ||
| include::image$authenticationclass.plantuml[] | ||
| ---- | ||
|
|
||
| === All possible attributes | ||
| The following example shows all possible attributes: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| include::example$authenticationclass-ldap-full.yaml[] | ||
| ---- | ||
| <1> The hostname of the LDAP server without any protocol or port | ||
| <2> The port of the LDAP server. If TLS is used defaults to `636` otherwise to `389` | ||
| <3> The searchBase where the users should be searched | ||
| <4> Additional filter that filters the allowed users | ||
| <5> The name of the corresponding field names in the LDAP objects | ||
| <6> The name of the xref:secret-operator::secretclass.adoc[] providing the bind credentials (username and password) | ||
| <7> The xref:secret-operator::scope.adoc[] of the xref:secret-operator::secretclass.adoc[] | ||
| <8> xref:tls.adoc[] connection to the LDAP server | ||
This file contains hidden or 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
This file contains hidden or 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,57 @@ | ||
| = TLS | ||
|
|
||
| A TLS section is part of Stackable CRDs and describes how to connect to a TLS enabled system like LDAP or S3. | ||
|
|
||
| If the `tls` attribute is set to `null` (or is not specifed) no TLS will be used for the connection. | ||
|
|
||
| A simple TLS section looks like this: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| include::example$tls-simple.yaml[] | ||
| ---- | ||
|
|
||
| == Verification | ||
| The parties participating at an TLS connection can be verified using certificates. | ||
| At the moment the following verification methods are supported | ||
|
|
||
| * <<No verification>> | ||
| * <<Server verification>> | ||
| * <<Mutual verification>> | ||
|
|
||
| === No verification | ||
| This example will use TLS but not perform any checks on the certificate presented by the server or present a client certificate if asked for one by the server. | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| include::example$tls-no-verification.yaml[] | ||
| ---- | ||
|
|
||
| === Server verification | ||
| This example will use TLS and verify the server using the ca certificates that are trusted by common web browsers. | ||
|
soenkeliebau marked this conversation as resolved.
|
||
| This can be useful when you e.g. use public AWS S3 or other public available services. | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| include::example$tls-server-verification-webpki.yaml[] | ||
| ---- | ||
|
|
||
| This example will use TLS and verify the server using the provided ca certificate. | ||
| For this to work you need to create a xref:secret-operator::secretclass.adoc[] that - at least - contains the ca certificate. | ||
| Note that a SecretClass does not need to have a key but can also work with just a ca cert. | ||
| So if you got provided with a ca cert but don't have access to the key you can still use this method. | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| include::example$tls-server-verification-custom-ca.yaml[] | ||
| ---- | ||
|
|
||
| === Mutual verification | ||
| This example will use TLS and verify both - the server and the client using certificates. | ||
| For this to work you need to create a xref:secret-operator::secretclass.adoc[] containing the ca certificate and a key to create new client-certificates. | ||
| The xref:secret-operator::index.adoc[] will automatically provide the product with a `ca.crt`, `tls.crt` and `tls.key` so that the product can authenticate the server and it can authenticate itself at the server. | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| include::example$tls-mutual-verification.yaml[] | ||
| ---- | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.