Openpanel-dev / Openpanel-dev/openpanel

feat(kafka): support TLS and SASL authentication for external Kafka brokers

Open
#507 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7k
Forks
481
Avg merge
1d 3h
Merged PRs (30d)
21

Description

Problem

When KAFKA_BROKERS is configured, OpenPanel creates its KafkaJS client without passing ssl or sasl options. This prevents connections to common managed or secured Kafka deployments that require TLS and SASL authentication.

Affected code

packages/queue/src/kafka.ts, in getKafka().

Expected behavior

Preserve the current unauthenticated connection behavior when no security-related environment variables are configured. When configured, support these common modes:

  • TLS only
  • SASL/PLAIN over TLS
  • SASL/SCRAM-SHA-256 over TLS
  • SASL/SCRAM-SHA-512 over TLS

Suggested configuration

KAFKA_SASL_USERNAME=...
KAFKA_SASL_PASSWORD=...
KAFKA_SASL_MECHANISM=scram-sha-512

Suggested behavior:

  • If neither username nor password is configured, preserve the existing behavior.
  • If only one is configured, fail fast with a clear configuration error.
  • Default the mechanism to scram-sha-512 when SASL credentials are present.
  • Reject unsupported mechanisms before creating the Kafka client.
  • Do not log credential values.

Why this matters

TLS/SASL is a common requirement for managed Kafka and production Kafka installations. Supporting it through environment configuration would make the Kafka integration usable without requiring source changes or a custom image.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/queue/src/kafka.ts at getKafka(), and inspect how KAFKA_BROKERS and related environment variables are currently read. Implement the four requested TLS/SASL modes while preserving unauthenticated connections, validating incomplete credentials and unsupported mechanisms before client creation, and ensuring credentials are not logged.

Written by the indexing model from the issue text.

Assessment

Tech stack
kafka, typescript
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.