0
0
Kafkadevops~10 mins

Encryption at rest in Kafka - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Encryption at rest
Data Written to Kafka
Kafka Broker Receives Data
Encrypt Data on Disk
Store Encrypted Data
Data at Rest is Encrypted
Authorized Read Requests
Decrypt Data Before Sending
Send Plain Data to Consumer
Data sent to Kafka is encrypted before saving on disk and decrypted only when authorized consumers read it.
Execution Sample
Kafka
props.put("security.inter.broker.protocol", "SSL");
props.put("ssl.keystore.location", "/path/to/keystore.jks");
props.put("ssl.keystore.password", "password");
props.put("ssl.key.password", "password");
// Data is encrypted on disk using SSL keys
This code configures Kafka brokers to encrypt data in transit using SSL certificates.
Process Table
StepActionData StateResult
1Data sent to Kafka brokerPlain textData received by broker
2Broker applies encryptionEncryptedData ready to store
3Data stored on diskEncryptedData saved securely
4Consumer requests dataEncryptedBroker prepares to decrypt
5Broker decrypts dataPlain textData ready to send
6Data sent to consumerPlain textConsumer receives readable data
7EndPlain textProcess complete
💡 Process ends after data is decrypted and sent to authorized consumer.
Status Tracker
VariableStartAfter Step 2After Step 3After Step 5Final
data_statePlain textEncryptedEncryptedPlain textPlain text
Key Moments - 3 Insights
Why is data encrypted before storing on disk?
Data is encrypted before storing (see Step 2 in execution_table) to protect it from unauthorized access if disk is compromised.
When does data become readable again?
Data is decrypted just before sending to the consumer (Step 5), so only authorized users see plain text.
Is data encrypted during transmission between client and broker?
Encryption at rest focuses on disk storage; transmission encryption uses SSL/TLS separately, not shown in this flow.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the data state after Step 3?
AEncrypted
BPlain text
CDecrypted
DCorrupted
💡 Hint
Check the 'Data State' column for Step 3 in the execution_table.
At which step does the broker decrypt the data?
AStep 4
BStep 5
CStep 2
DStep 6
💡 Hint
Look for the step where 'Broker decrypts data' in the 'Action' column.
If encryption was skipped, how would the 'data_state' variable change after Step 3?
AIt would become 'Corrupted'
BIt would become 'Encrypted'
CIt would remain 'Plain text'
DIt would be 'Decrypted'
💡 Hint
Refer to variable_tracker and consider what happens if encryption is not applied.
Concept Snapshot
Encryption at rest in Kafka means data is encrypted before saving on disk.
Kafka brokers use SSL keys to encrypt and decrypt data.
Data stays encrypted on disk to protect from unauthorized access.
Decryption happens only when authorized consumers read data.
This ensures data security even if storage is compromised.
Full Transcript
Encryption at rest in Kafka protects data by encrypting it before storing on disk. When data is sent to the Kafka broker, it is initially plain text. The broker encrypts the data before saving it to disk, so the stored data is secure. When a consumer requests the data, the broker decrypts it and sends the readable data to the consumer. This process ensures that data remains protected while stored and only authorized users can read it. The execution table shows each step from data reception, encryption, storage, decryption, and delivery. The variable tracker follows the data state changes from plain text to encrypted and back to plain text. Key moments clarify why encryption is done before storage and when data becomes readable again. The visual quiz tests understanding of these steps and data states.