Skip to content

Prefixed * ACL Pattern Causes Metadata Fetch Failures and UI Loading Issues β€” Validation or Documentation NeededΒ #1617

@kuldeep0508

Description

@kuldeep0508

🧠 Problem Statement:

Using Kafka ACLs with --resource-pattern-type prefixed and resource name"*"does not act as a wildcard.
Kafka accepts this ACL silently, but it matches no actual topic because no topic name begins with *.
When other topic-specific ACLs are added, the UI or client loses visibility β€” showing that the prefixed * ACL is ineffective and misleading.

πŸ›  Reproducible Scenario:

Kafka cluster: AWS MSK with mTLS
Client cert: CN=.kafka.mtls.sbcp.io, O=o-m61xxxx
Client: Kafka UI deployed in Kubernetes via Istio using mTLS cert

Steps:

  1. Baseline (No ACLs):

Kafka UI shows all topics β€” MSK default (allow.everyone.if.no.acl.found=true)

  1. Apply Literal * ACL with wrong principal (missing O=):

      kafka-acls.sh --add --allow-principal "User:CN=*.kafka.msk.sbcp.io" --operation All --topic "*" --resource-pattern-type literal

    πŸ”΄ Kafka UI shows no topics
    βœ… Root cause: Principal mismatch (full DN not matched)

  2. Apply Prefixed * ACL with same principal:

      kafka-acls.sh --add --allow-principal "User:CN=*.kafka.msk.sbcp.io" --operation All --topic "*" --resource-pattern-type prefixed

    ⚠️ False sense of success β€” MSK fallback still letting UI fetch open topics
    🟑 Kafka UI temporarily shows topics

  3. Add topic-specific ACL for different principal:

       kafka-acls.sh --add --allow-principal "User:User:CN=*.dotk-4.msk.sbcp.io" --operation All --topic "dotk-4_" --resource-pattern-type prefixed

    πŸ”΄ Kafka UI no longer sees any dotk-4_ topics
    πŸ’₯ At this point, MSK enforces ACLs strictly β†’ only matching ACLs apply
    πŸ’₯ The prefixed * from earlier fails to apply (no topic starts with *)

  4. Add Literal ACL for single topic to different principal

        kafka-acls.sh --add --allow-principal "User:User:CN=*.dotk-3.msk.sbcp.io" --operation All --topic "dotk-3_sample-topic" 

    πŸ”΄ Kafka UI cannot see dotk-4_sample-topic either
    πŸ“Œ Confirms that CN=*.kafka.mtls.sbcp.io, O=o-m61xxxx principal has no effective access, and prefixed * ACL does not apply.

  5. Apply proper ACL with full DN and Literal* :

     kafka-acls.sh --add --allow-principal "User:CN=*.kafka.mtls.sbcp.io, O=o-m61xxxx" --operation All --topic "*" --resource-pattern-type literal

    🟒 Kafka UI shows all topics again
    βœ… Works as expected β€” Literal * correctly applies wildcard access to all topics

  6. Apply proper ACL with full DN and Prefixed * :
    bash kafka-acls.sh --add --allow-principal "User:CN=*.kafka.mtls.sbcp.io, O=o-m61xxxx" --operation All --topic "*" --resource-pattern-type prefixed
    πŸ”΄ Kafka UI became unresponsive β€” stuck in infinite loading state.
    πŸ’₯ Prefixed * pattern does not match any real topic (because no topic name starts with *).
    πŸ’₯ Kafka UI keeps retrying metadata fetching (due to 0 authorized topics), resulting in an infinite loading spinner.

Based on the behavior observed, it appears that using --resource-pattern-type prefixed with a resource name "*" does not function as a wildcard and results in no actual resource match (since no Kafka topic can start with *).

Could you please confirm:

  1. Is --resource-pattern-type prefixed --topic "*" is a valid wildcard pattern in Kafka ACL configuration ?
  2. If not invalid, under what specific scenario would Prefixed * be expected to match resources?
  3. Can documentation be updated clearly to warn about the ineffectiveness of Prefixed * to prevent production misconfiguration risks?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions