This repository has been archived by the owner on Mar 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Kafka auth #510
Open
DM-sb
wants to merge
19
commits into
main
Choose a base branch
from
kafka-auth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Kafka auth #510
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b1a7ad3
Adding support for SASL auth in kafka
DM-sb a1d560f
Fix typo in kafka.rs
DM-sb 164a47d
Make auth_required field public for testing
DM-sb 72e098c
Make auth_config field public for testing
DM-sb ca7e56f
librdkafka doesn't accept sasl.jaas.config; replace with correct conf…
DM-sb 0e21af8
Add missing group ID to consumer config
DM-sb 8841dd8
Added docker compose file for testing kafka auth
DM-sb 99aa6e4
Remove print statements and fix formatting
DM-sb 2e0a003
Temporarily downgrade version to git2 to get the CI/CD build to pass
DM-sb c545e61
Change git2 version
DM-sb bd2d96d
Downgrade git2 to 0.12
DM-sb 101f31e
Update the data-collector docs to mention authentication
DM-sb 7e0381a
fix typo
DM-sb 6810714
Update the report-parser docs to mention authentication
DM-sb f17c99e
Update the slack connector docs to mention authentication
DM-sb ecaf3d6
Added the JAAS config file for broker and zookeeper to enable testing…
DM-sb f9d6a6b
Remove pub fields
DM-sb ed25407
Refactored repeated code into closure and added additional tests
DM-sb 40110fd
Format fixes
DM-sb 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
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,13 @@ | ||
KafkaServer { | ||
org.apache.kafka.common.security.plain.PlainLoginModule required | ||
username="admin" | ||
password="admin-secret" | ||
user_admin="admin-secret"; | ||
}; | ||
|
||
Client { | ||
org.apache.zookeeper.server.auth.DigestLoginModule required | ||
username="admin" | ||
password="admin-secret" | ||
user_admin="admin-secret"; | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
version: '2' | ||
services: | ||
zookeeper: | ||
image: wurstmeister/zookeeper | ||
ports: | ||
- "2181:2181" | ||
environment: | ||
SERVER_JVMFLAGS: -Djava.security.auth.login.config=/opt/zookeeper_jaas.conf | ||
-Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider | ||
-Dzookeeper.authProvider.2=org.apache.zookeeper.server.auth.DigestAuthenticationProvider | ||
-DjaasLoginRenew=3600000 | ||
-DrequireClientAuthScheme=sasl | ||
volumes: | ||
- ./zookeeper_jaas.conf:/opt/zookeeper_jaas.conf | ||
|
||
kafka: | ||
image: wurstmeister/kafka | ||
depends_on: | ||
- zookeeper | ||
ports: | ||
- "9092:9092" | ||
hostname: kafka | ||
environment: | ||
KAFKA_ADVERTISED_HOSTNAME: kafka | ||
KAFKA_LISTENERS: "SASL_SSL://kafka:9092" | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: "" | ||
KAFKA_SSL_TLS_VERSION: TLSv1.2 | ||
KAFKA_SSL_PROTOCOL: TLSv1.2 | ||
KAFKA_SSL_ENABLED_PROTOCOLS: TLSv1.2 | ||
KAFKA_SSL_SECURE_RANDOM_IMPLEMENTATION: NativePRNG | ||
KAFKA_SSL_CIPHER_SUITES: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | ||
KAFKA_SSL_KEYSTORE_LOCATION: /tls/kafka.keystore.jks | ||
KAFKA_SSL_KEYSTORE_PASSWORD: password | ||
KAFKA_SSL_KEY_PASSWORD: password | ||
KAFKA_SSL_TRUSTSTORE_LOCATION: /tls/kafka.truststore.jks | ||
KAFKA_SSL_TRUSTSTORE_PASSWORD: password | ||
KAFKA_CREATE_TOPICS: "ToolReports:6:1,DependencyEvents:6:1" | ||
KAFKA_MESSAGE_MAX_BYTES: 10000000 | ||
KAFKA_REPLICA_FETCH_MAX_BYTES: 10000000 | ||
KAFKA_SECURITY_PROTOCOL: SASL_SSL | ||
KAFKA_SASL_ENABLED_MECHANISMS: PLAIN | ||
KAFKA_SECURITY_INTER_BROKER_PROTOCOL: SASL_SSL | ||
KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN | ||
KAFKA_OPTS: "-Djava.security.auth.login.config=/etc/kafka/broker-jaas.conf" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- ./tls:/tls | ||
- ./broker-jaas.conf:/etc/kafka/broker-jaas.conf | ||
data-collector: | ||
depends_on: | ||
- kafka | ||
image: kiln/data-collector:git-latest | ||
ports: | ||
- "8081:8080" | ||
environment: | ||
- KAFKA_BOOTSTRAP_TLS=kafka:9092 | ||
- ENABLE_KAFKA_AUTH=true | ||
- KAFKA_SASL_AUTH_USERNAME=admin | ||
- KAFKA_SASL_AUTH_PASSWORD=admin-secret | ||
- DISABLE_KAFKA_DOMAIN_VALIDATION=true | ||
volumes: | ||
- ./tls:/tls | ||
report-parser: | ||
depends_on: | ||
- kafka | ||
image: kiln/report-parser:git-latest | ||
environment: | ||
- KAFKA_BOOTSTRAP_TLS=kafka:9092 | ||
- ENABLE_KAFKA_AUTH=true | ||
- KAFKA_SASL_AUTH_USERNAME=admin | ||
- KAFKA_SASL_AUTH_PASSWORD=admin-secret | ||
- DISABLE_KAFKA_DOMAIN_VALIDATION=true | ||
volumes: | ||
- ./tls:/tls | ||
slack-connector: | ||
depends_on: | ||
- kafka | ||
image: kiln/slack-connector:git-latest | ||
environment: | ||
- KAFKA_BOOTSTRAP_TLS=kafka:9092 | ||
- RUST_LOG=info | ||
- DISABLE_KAFKA_DOMAIN_VALIDATION=true | ||
- ENABLE_KAFKA_AUTH=true | ||
- KAFKA_SASL_AUTH_USERNAME=admin | ||
- KAFKA_SASL_AUTH_PASSWORD=admin | ||
- OAUTH2_TOKEN | ||
- SLACK_CHANNEL_ID | ||
volumes: | ||
- ./tls:/tls |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At present the CI/CD build for data forwarder fails without this change. Potentially related to this rust-lang/rust#85574