Bird
0
0

Given this Kafka client configuration snippet:

medium📝 Predict Output Q13 of 15
Kafka - Security
Given this Kafka client configuration snippet:
props.put("security.protocol", "SASL_SSL");
props.put("sasl.mechanism", "SCRAM-SHA-256");
props.put("sasl.jaas.config", "org.apache.kafka.common.security.scram.ScramLoginModule required username=\"user1\" password=\"pass1\";");

What will happen when the client tries to connect?
AClient connects using PLAINTEXT mechanism
BClient connects but without encryption
CClient fails due to missing SSL configuration
DClient connects securely using SCRAM-SHA-256 with encrypted channel
Step-by-Step Solution
Solution:
  1. Step 1: Analyze security.protocol setting

    Setting security.protocol to SASL_SSL means the client uses SASL authentication over SSL encrypted connection.
  2. Step 2: Check SASL mechanism and JAAS config

    The mechanism is SCRAM-SHA-256 with proper JAAS config providing username and password, so authentication will succeed if credentials are correct.
  3. Final Answer:

    Client connects securely using SCRAM-SHA-256 with encrypted channel -> Option D
  4. Quick Check:

    SASL_SSL + SCRAM = secure auth [OK]
Quick Trick: SASL_SSL means secure auth with encryption [OK]
Common Mistakes:
  • Assuming SASL_SSL means no encryption
  • Ignoring JAAS config for credentials
  • Confusing SCRAM with PLAINTEXT

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes