This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.

Status

Current state"Under Discussion"

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: KAFKA-7691 

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Currently Delegation token metadata (i.e. token information about "version", "tokenId", "owner", "renewers", "issueTimestamp", "maxTimestamp", "expiryTimestamp") is stored unencrypted in Zookeeper using JSON format. Apache Zookeeper 3.4 does not support SSL/TLS. In case of an insecure Zookeeper deployment, communication between Kafka brokers and a Zookeeper cluster might be intercepted and altered. This can lead to security incidents.

Until a stable Zookeeper release supports SSL/TLS, Kafka brokers could implement a strategy called Encrypt-then-MAC to encrypt sensitive metadata information about delegation tokens and protecting integrity using the master secret key (i.e. delegation.token.master.key) as a shared secret.

Proposed Changes

[0-2]   Three bytes of a known tag value, e.g. ‘D’,’T’,’E’

[3]       One byte of version number, 0x1 for now

[4-19]  Sixteen bytes of salt/IV for PBKDF2/AES-CBC

[20-51] 32 bytes of HMAC

[52-N]  All remaining bytes are encrypted data

Compatibility, Deprecation, and Migration Plan

This is a good practice because newer brokers might create delegation tokens with encrypted metadata that older brokers would not be able to use during the upgrade. If you need to rollback to the older version, and you have not set delegation.token.metadata.encryption.enable to false, brokers will not be able to parse encrypted metadata of new delegation tokens.


Alternatives

Future work