Repository navigation
Support SSL, mTLS and SASL for Kafka status events - #11
Merged
Merged
Conversation
The Kafka status-event producer always connected with PLAINTEXT and exposed no way to change it. Producer settings can now be passed through under conductor.message-publisher.kafka.producer.*, which enables SSL, mTLS, SASL_SSL and SASL_PLAINTEXT with PKCS12 or PEM files. - Settings are validated at startup: invalid values, unreadable keystore/truststore files and inline PEM certificates fail startup; unknown keys are logged as a warning. Serializers can't be overridden. - The producer is per service instance and closed on shutdown. - kafka-clients stays at 3.9.1. - Container tests run each mode end to end against apache/kafka:3.9.1 with per-run keytool certificates, plus rejection cases. - Documents the modes in kafka/README.md and records the decision in adr/0001-kafka-status-producer-security.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
KafkaProducer.close() waits indefinitely for unsent records, so a Kafka outage during shutdown could hold up Conductor for up to delivery.timeout.ms. Before the producer was closed on shutdown this could not happen, so bound the wait to keep shutdown behaviour as it was. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The Kafka producer that publishes task and workflow status events (
conductor.message-publisher.type=kafka) always connected withPLAINTEXT, and there was no setting to change it. Status events, including task input and output, crossed the network unencrypted and the broker could not authenticate Conductor.This PR passes Kafka producer settings through from
conductor.message-publisher.kafka.producer.*, which enables:security.protocol=SSL+ truststoresecurity.protocol=SSL+ truststore + keystoresecurity.protocol=SASL_SSL,sasl.mechanism,sasl.jaas.config+ truststoresecurity.protocol=SASL_PLAINTEXT,sasl.mechanism,sasl.jaas.configKeystores and truststores can be PKCS12 or PEM files.
kafka-clientsstays at 3.9.1, which already supports all of this.Example (mTLS with PEM files):
Changes
KafkaProperties: newproducermap (Map<String, String>, so dotted keys likesecurity.protocolstay intact).KafkaEventServiceImpl:acks=all,client.id), then user settings, thenbootstrapServers, then the serializers (which can't be overridden).ssl.keystore.key,ssl.keystore.certificate.chain,ssl.truststore.certificates) fail startup; unknown keys are logged as a warning. Secret values are never logged.staticfield to an instance field and is closed on shutdown, waiting at most 10 seconds so a Kafka outage can't hold up shutdown.producer.*settings, behaviour is unchanged.kafka/README.md: new "Kafka Status Events" section with examples per mode, PEM notes andopensslconversion commands.adr/: new directory for architecture decision records; ADR-0001 records this decision and the alternatives considered.Testing
KafkaEventServiceImplTest: 19 unit tests for settings building and validation.KafkaSecurityContainerTest: 10 tests against a realapache/kafka:3.9.1broker with one listener per mode (Testcontainers; skipped when Docker isn't available). Certificates are generated per run withkeytool, so no keys are committed../gradlew :conductor-kafka:spotlessCheck :conductor-kafka:test: all 53 module tests pass locally.Not covered
KAFKA_PUBLISHsystem task and thekafka-event-queuemodule build their own Kafka clients and are unchanged.🤖 Generated with Claude Code