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

[Merged by Bors] - Consolidate encryption and auth #366

Closed
wants to merge 21 commits into from
Closed
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 30 additions & 20 deletions deploy/crd/druidcluster.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
spec:
properties:
brokers:
description: Configuration of the broker role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -355,22 +356,27 @@ spec:
- roleGroups
type: object
clusterConfig:
description: Common cluster wide configuration that can not differ or be overriden on a role or role group level
description: Common cluster wide configuration that can not differ or be overridden on a role or role group level
properties:
authentication:
description: Authentication class settings for Druid like TLS authentication or LDAP
nullable: true
properties:
tls:
description: TLS based client authentication (mutual TLS)
nullable: true
properties:
authenticationClass:
type: string
required:
- authenticationClass
type: object
type: object
default: []
description: List of Authentication classes using like TLS or LDAP to authenticate users
items:
properties:
authenticationClass:
description: |-
The AuthenticationClass <https://docs.stackable.tech/home/nightly/concepts/authenticationclass.html> to use.

## TLS provider

Only affects client connections. This setting controls: - If clients need to authenticate themselves against Druid via TLS - Which ca.crt to use when validating the provided client certs

Please note that the SecretClass used to authenticate users needs to be the same as the SecretClass used for internal communication.
type: string
required:
- authenticationClass
type: object
type: array
authorization:
description: Authorization settings for Druid like OPA
nullable: true
Expand Down Expand Up @@ -667,15 +673,15 @@ spec:
type: object
tls:
default:
secretClass: tls
description: TLS encryption settings for Druid
serverAndInternalSecretClass: tls
description: TLS encryption settings for Druid. This setting only affects server and internal communication. It does not affect client tls authentication, use `clusterConfig.authentication` instead.
nullable: true
properties:
secretClass:
description: 'Only affects client connections. This setting controls: - If TLS encryption is used at all - Which cert the servers should use to authenticate themselves against the client Important: This will activate encrypted internal druid communication as well!'
serverAndInternalSecretClass:
default: tls
description: 'This setting controls client as well as internal tls usage: - If TLS encryption is used at all - Which cert the servers should use to authenticate themselves against the clients - Which cert the servers should use to authenticate themselves among each other'
nullable: true
type: string
required:
- secretClass
type: object
zookeeperConfigMapName:
description: ZooKeeper discovery ConfigMap
Expand All @@ -686,6 +692,7 @@ spec:
- zookeeperConfigMapName
type: object
coordinators:
description: Configuration of the coordinator role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -1018,6 +1025,7 @@ spec:
- roleGroups
type: object
historicals:
description: Configuration of the historical role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -1507,6 +1515,7 @@ spec:
type: string
type: object
middleManagers:
description: Configuration of the middle managed role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -1839,6 +1848,7 @@ spec:
- roleGroups
type: object
routers:
description: Configuration of the router role
properties:
cliOverrides:
additionalProperties:
Expand Down
50 changes: 30 additions & 20 deletions deploy/helm/druid-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spec:
spec:
properties:
brokers:
description: Configuration of the broker role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -357,22 +358,27 @@ spec:
- roleGroups
type: object
clusterConfig:
description: Common cluster wide configuration that can not differ or be overriden on a role or role group level
description: Common cluster wide configuration that can not differ or be overridden on a role or role group level
properties:
authentication:
description: Authentication class settings for Druid like TLS authentication or LDAP
nullable: true
properties:
tls:
description: TLS based client authentication (mutual TLS)
nullable: true
properties:
authenticationClass:
type: string
required:
- authenticationClass
type: object
type: object
default: []
description: List of Authentication classes using like TLS or LDAP to authenticate users
items:
properties:
authenticationClass:
description: |-
The AuthenticationClass <https://docs.stackable.tech/home/nightly/concepts/authenticationclass.html> to use.

## TLS provider

Only affects client connections. This setting controls: - If clients need to authenticate themselves against Druid via TLS - Which ca.crt to use when validating the provided client certs

Please note that the SecretClass used to authenticate users needs to be the same as the SecretClass used for internal communication.
type: string
required:
- authenticationClass
type: object
type: array
authorization:
description: Authorization settings for Druid like OPA
nullable: true
Expand Down Expand Up @@ -669,15 +675,15 @@ spec:
type: object
tls:
default:
secretClass: tls
description: TLS encryption settings for Druid
serverAndInternalSecretClass: tls
description: TLS encryption settings for Druid. This setting only affects server and internal communication. It does not affect client tls authentication, use `clusterConfig.authentication` instead.
nullable: true
properties:
secretClass:
description: 'Only affects client connections. This setting controls: - If TLS encryption is used at all - Which cert the servers should use to authenticate themselves against the client Important: This will activate encrypted internal druid communication as well!'
serverAndInternalSecretClass:
default: tls
description: 'This setting controls client as well as internal tls usage: - If TLS encryption is used at all - Which cert the servers should use to authenticate themselves against the clients - Which cert the servers should use to authenticate themselves among each other'
nullable: true
type: string
required:
- secretClass
type: object
zookeeperConfigMapName:
description: ZooKeeper discovery ConfigMap
Expand All @@ -688,6 +694,7 @@ spec:
- zookeeperConfigMapName
type: object
coordinators:
description: Configuration of the coordinator role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -1020,6 +1027,7 @@ spec:
- roleGroups
type: object
historicals:
description: Configuration of the historical role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -1509,6 +1517,7 @@ spec:
type: string
type: object
middleManagers:
description: Configuration of the middle managed role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -1841,6 +1850,7 @@ spec:
- roleGroups
type: object
routers:
description: Configuration of the router role
properties:
cliOverrides:
additionalProperties:
Expand Down
50 changes: 30 additions & 20 deletions deploy/manifests/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
spec:
properties:
brokers:
description: Configuration of the broker role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -358,22 +359,27 @@ spec:
- roleGroups
type: object
clusterConfig:
description: Common cluster wide configuration that can not differ or be overriden on a role or role group level
description: Common cluster wide configuration that can not differ or be overridden on a role or role group level
properties:
authentication:
description: Authentication class settings for Druid like TLS authentication or LDAP
nullable: true
properties:
tls:
description: TLS based client authentication (mutual TLS)
nullable: true
properties:
authenticationClass:
type: string
required:
- authenticationClass
type: object
type: object
default: []
description: List of Authentication classes using like TLS or LDAP to authenticate users
items:
properties:
authenticationClass:
description: |-
The AuthenticationClass <https://docs.stackable.tech/home/nightly/concepts/authenticationclass.html> to use.

## TLS provider

Only affects client connections. This setting controls: - If clients need to authenticate themselves against Druid via TLS - Which ca.crt to use when validating the provided client certs

Please note that the SecretClass used to authenticate users needs to be the same as the SecretClass used for internal communication.
type: string
required:
- authenticationClass
type: object
type: array
authorization:
description: Authorization settings for Druid like OPA
nullable: true
Expand Down Expand Up @@ -670,15 +676,15 @@ spec:
type: object
tls:
default:
secretClass: tls
description: TLS encryption settings for Druid
serverAndInternalSecretClass: tls
description: TLS encryption settings for Druid. This setting only affects server and internal communication. It does not affect client tls authentication, use `clusterConfig.authentication` instead.
nullable: true
properties:
secretClass:
description: 'Only affects client connections. This setting controls: - If TLS encryption is used at all - Which cert the servers should use to authenticate themselves against the client Important: This will activate encrypted internal druid communication as well!'
serverAndInternalSecretClass:
default: tls
description: 'This setting controls client as well as internal tls usage: - If TLS encryption is used at all - Which cert the servers should use to authenticate themselves against the clients - Which cert the servers should use to authenticate themselves among each other'
nullable: true
type: string
required:
- secretClass
type: object
zookeeperConfigMapName:
description: ZooKeeper discovery ConfigMap
Expand All @@ -689,6 +695,7 @@ spec:
- zookeeperConfigMapName
type: object
coordinators:
description: Configuration of the coordinator role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -1021,6 +1028,7 @@ spec:
- roleGroups
type: object
historicals:
description: Configuration of the historical role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -1510,6 +1518,7 @@ spec:
type: string
type: object
middleManagers:
description: Configuration of the middle managed role
properties:
cliOverrides:
additionalProperties:
Expand Down Expand Up @@ -1842,6 +1851,7 @@ spec:
- roleGroups
type: object
routers:
description: Configuration of the router role
properties:
cliOverrides:
additionalProperties:
Expand Down
13 changes: 5 additions & 8 deletions docs/modules/ROOT/pages/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ TLS encryption is supported for internal cluster communication (e.g. between Bro
spec:
clusterConfig:
tls:
secretClass: tls # <1>
serverAndInternalSecretClass: tls # <1>
----
<1> Name of the `SecretClass` that is used to encrypt internal and external communication.

IMPORTANT: A Stackable Druid cluster is always encrypted per default. In order to disable this default behavior you can set `spec.clusterConfig.tls: null`.
IMPORTANT: A Stackable Druid cluster is always encrypted per default. In order to disable this default behavior you can set `spec.clusterConfig.tls.serverAndInternalSecretClass: null`.

=== Authentication

Expand All @@ -282,13 +282,10 @@ The access to the Druid cluster can be limited by configuring client authenticat
spec:
clusterConfig:
authentication:
tls:
authenticationClass: druid-tls-auth # <1>
- authenticationClass: druid-tls-auth # <1>
----
<1> Name of the `AuthenticationClass` that is used to encrypt and authenticate communication.

IMPORTANT: The TLS `AuthenticationClass` and its respective `SecretClass` will always take precedence over the TLS encryption `SecretClass` (if provided).

The `AuthenticationClass` may or may not have a `SecretClass` configured:
[source,yaml]
----
Expand All @@ -303,10 +300,10 @@ spec:
tls:
clientCertSecretClass: druid-mtls # <1>
# Option 2
tls: null # <2>
tls: {} # <2>
----
<1> If a client `SecretClass` is provided in the `AuthenticationClass` (here `druid-mtls`), these certificates will be used for encryption and authentication.
<2> If no client `SecretClass` is provided in the `AuthenticationClass`, the `spec.clusterConfig.tls.secretClass` will be used for encryption and authentication. It cannot be explicitly set to null in this case.
<2> If no client `SecretClass` is provided in the `AuthenticationClass`, the `spec.clusterConfig.tls.serverAndInternalSecretClass` will be used for encryption and authentication. It cannot be explicitly set to null in this case.

==== LDAP

Expand Down
5 changes: 2 additions & 3 deletions examples/tls/tls-druid-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ spec:
stackableVersion: 0.3.0
clusterConfig:
authentication:
tls:
authenticationClass: druid-mtls-authentication-class
- authenticationClass: druid-mtls-authentication-class
deepStorage:
hdfs:
configMapName: druid-hdfs
Expand All @@ -95,7 +94,7 @@ spec:
host: localhost
port: 1527
tls:
secretClass: tls
serverAndInternalSecretClass: tls
zookeeperConfigMapName: druid-znode
brokers:
roleGroups:
Expand Down
3 changes: 2 additions & 1 deletion rust/crd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ snafu = "0.7"
lazy_static = "1.4"

[dev-dependencies]
serde_yaml = "0.8"
indoc = "1.0"
rstest = "0.16"
serde_yaml = "0.8"
Loading