-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KafkaSinkCluster: authorize_scram_over_mtls
- Loading branch information
Showing
9 changed files
with
604 additions
and
50 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
70 changes: 70 additions & 0 deletions
70
shotover-proxy/tests/test-configs/kafka/cluster-sasl-scram-over-mtls/docker-compose.yaml
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,70 @@ | ||
networks: | ||
cluster_subnet: | ||
name: cluster_subnet | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 172.16.1.0/24 | ||
gateway: 172.16.1.1 | ||
|
||
services: | ||
kafka0: | ||
image: &image 'bitnami/kafka:3.6.1-debian-11-r24' | ||
networks: | ||
cluster_subnet: | ||
ipv4_address: 172.16.1.2 | ||
environment: &environment | ||
KAFKA_CFG_NODE_ID: 0 | ||
KAFKA_CFG_PROCESS_ROLES: "controller,broker" | ||
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "0@kafka0:9093,1@kafka1:9093,2@kafka2:9093" | ||
KAFKA_CFG_LISTENERS: "BROKER://:9092,CONTROLLER://:9093,SHOTOVER_MTLS://:9094" | ||
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:SSL,BROKER:SASL_SSL,SHOTOVER_MTLS:SSL" | ||
KAFKA_CFG_ADVERTISED_LISTENERS: "BROKER://172.16.1.2:9092,SHOTOVER_MTLS://172.16.1.2:9094" | ||
KAFKA_CFG_DELEGATION_TOKEN_MASTER_KEY: THE_MASTER_KEY | ||
KAFKA_CLIENT_USERS: "user" | ||
KAFKA_CLIENT_PASSWORDS: "password" | ||
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER" | ||
KAFKA_CFG_SASL_MECHANISM_CONTROLLER_PROTOCOL: "PLAIN" | ||
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: "BROKER" | ||
KAFKA_CFG_SASL_MECHANISM_INTER_BROKER_PROTOCOL: "SCRAM-SHA-256" | ||
KAFKA_INTER_BROKER_USER: "controller_user" | ||
KAFKA_INTER_BROKER_PASSWORD: "controller_password" | ||
KAFKA_CERTIFICATE_PASSWORD: "password" | ||
KAFKA_KRAFT_CLUSTER_ID: "abcdefghijklmnopqrstuv" | ||
# TODO: Does this enable MTLS auth for the SCRAM connection as well? | ||
# If so, we need to be careful that kafka doesnt elevate our token'd SCRAM credentials to super user. | ||
# I dont yet know how it would actually behave. | ||
# If so, a possible solution could be seperate certificates for the token'd connections | ||
KAFKA_TLS_CLIENT_AUTH: required | ||
KAFKA_CFG_AUTHORIZER_CLASS_NAME: "org.apache.kafka.metadata.authorizer.StandardAuthorizer" | ||
# Give the following super user access: | ||
# * the user named `user` | ||
# * any clients connected via a TLS certificate of `O=ShotoverTestCertificate,CN=Generic-Cert` | ||
KAFKA_CFG_SUPER_USERS: "User:user;User:O=ShotoverTestCertificate,CN=Generic-Cert" | ||
volumes: &volumes | ||
- type: tmpfs | ||
target: /bitnami/kafka | ||
- type: bind | ||
source: "../tls/certs" | ||
target: "/opt/bitnami/kafka/config/certs" | ||
kafka1: | ||
image: *image | ||
networks: | ||
cluster_subnet: | ||
ipv4_address: 172.16.1.3 | ||
environment: | ||
<<: *environment | ||
KAFKA_CFG_ADVERTISED_LISTENERS: "BROKER://172.16.1.3:9092,SHOTOVER_MTLS://172.16.1.3:9094" | ||
KAFKA_CFG_NODE_ID: 1 | ||
volumes: *volumes | ||
kafka2: | ||
image: *image | ||
networks: | ||
cluster_subnet: | ||
ipv4_address: 172.16.1.4 | ||
environment: | ||
<<: *environment | ||
KAFKA_CFG_ADVERTISED_LISTENERS: "BROKER://172.16.1.4:9092,SHOTOVER_MTLS://172.16.1.4:9094" | ||
KAFKA_CFG_NODE_ID: 2 | ||
volumes: *volumes |
26 changes: 26 additions & 0 deletions
26
shotover-proxy/tests/test-configs/kafka/cluster-sasl-scram-over-mtls/topology-single.yaml
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,26 @@ | ||
--- | ||
sources: | ||
- Kafka: | ||
name: "kafka" | ||
listen_addr: "127.0.0.1:9192" | ||
chain: | ||
- DebugPrinter | ||
- KafkaSinkCluster: | ||
shotover_nodes: | ||
- address: "127.0.0.1:9192" | ||
rack: "rack0" | ||
broker_id: 0 | ||
first_contact_points: ["172.16.1.2:9092"] | ||
authorize_scram_over_mtls: | ||
mtls_port_contact_points: ["172.16.1.2:9094"] | ||
tls: | ||
certificate_authority_path: "tests/test-configs/kafka/tls/certs/localhost_CA.crt" | ||
certificate_path: "tests/test-configs/kafka/tls/certs/localhost.crt" | ||
private_key_path: "tests/test-configs/kafka/tls/certs/localhost.key" | ||
verify_hostname: true | ||
connect_timeout_ms: 3000 | ||
tls: | ||
certificate_authority_path: "tests/test-configs/kafka/tls/certs/localhost_CA.crt" | ||
certificate_path: "tests/test-configs/kafka/tls/certs/localhost.crt" | ||
private_key_path: "tests/test-configs/kafka/tls/certs/localhost.key" | ||
verify_hostname: true |
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
Oops, something went wrong.