Kafka MCQs – Kafka Security

21.) Where are Kafka credentials stored for PLAIN or SCRAM mechanisms?

A) In ZooKeeper encrypted files
B) In the Kafka producer file
C) In the JAAS configuration
D) In server.properties

Answer: Option C

Explanation: Credentials like username and password are specified in JAAS configs.

22.) What is the main purpose of security.inter.broker.protocol?

A) Specify partition assignment algorithm
B) Enable authentication between brokers
C) Define replication lag
D) Set up log retention

Answer: Option B

Explanation: This setting controls the protocol used for broker-to-broker communication.

23.) What type of encryption does Kafka use for SSL?

A) Block encryption
B) Asymmetric encryption
C) Symmetric encryption with public key
D) TLS (a variant of SSL)

Answer: Option D

Explanation: TLS is used to encrypt data in transit and ensure secure Kafka communication.

24.) What does Principal refer to in Kafka security?

A) A Java thread
B) A broker hostname
C) An authenticated user identity
D) A security certificate

Answer: Option C

Explanation: The Principal represents a verified user identity used for access control.

25.) If a Kafka client gets SASLAuthenticationException, what is the likely cause?

A) Wrong topic name
B) Unavailable broker
C) Invalid user credentials
D) Full disk on server

Answer: Option C

Explanation: This exception is usually caused by incorrect username or password.

26.) Which of the following is NOT a valid Kafka SASL mechanism?

A) DIGEST-MD5
B) SCRAM
C) PLAIN
D) GSSAPI

Answer: Option A

Explanation: Kafka does not support the DIGEST-MD5 SASL mechanism.

27.) What is the use of Authorizer class in Kafka?

A) Control broker startup
B) Define ACL verification logic
C) Configure topic retention
D) Assign partitions

Answer: Option B

Explanation: Custom Authorizer classes define how Kafka checks ACLs for access.

28.) Which setting allows Kafka to check the certificate’s common name (CN)?

A) ssl.cn.validation.enable
B) ssl.hostname.verification.enable=true
C) cert.check=true
D) enable.cn.auth=true

Answer: Option B

Explanation: This ensures the hostname in the broker’s certificate matches the expected value.

29.) Kafka client authentication failures are logged in:

A) server.properties
B) Kafka UI dashboard
C) ZooKeeper audit
D) Broker logs

Answer: Option D

Explanation: Kafka logs authentication failures in the broker’s log files.

30.) What is the benefit of enabling SASL_SSL over PLAINTEXT?

A) Faster data transfer
B) Simplified configuration
C) Adds encryption and authentication
D) Reduces latency

Answer: Option C

Explanation: SASL_SSL secures communication with both authentication and SSL encryption.

Leave a Reply

Your email address will not be published. Required fields are marked *