Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiencing issue with AWS MSK IAM between Proxy and Brokers, and SASL Plain between Client and Kafka Proxy #173

Open
AnkitMishra3220 opened this issue Jul 29, 2024 · 0 comments

Comments

@AnkitMishra3220
Copy link

AnkitMishra3220 commented Jul 29, 2024

I am using Amazon MSK with IAM enabled and trying to connect to the Kafka Proxy using the SASL Plain authentication mechanism from my Kafka Client.

Screenshot 2024-07-29 at 11 59 15

I am getting an error "using plain connection instead of TLS " in the proxy log while trying to connect from Kafka client.

Getting below error on Kafka Client :

terminated during authentication. This may happen due to any of the following reasons: (1) Authentication failed due to invalid credentials with brokers older than 1.0.0, (2) Firewall blocking Kafka TLS traffic (eg it may only allow HTTPS traffic), (3) Transient network issue. (org.apache.kafka.clients.NetworkClient)

Kafka Proxy Command :

/kafka-proxy server --bootstrap-server-mapping "b-1-XXXX.amazonaws.com:9098,xtssff.com:9000" \
                   --bootstrap-server-mapping "b-2.XXXX.amazonaws.com:9098,xtssff:9001" \
                   --bootstrap-server-mapping "b-3.XXXX.amazonaws.com:9098,xtssff:9003" \
                   --proxy-listener-key-file "server-key.pem" \
                   --proxy-listener-key-password "XXXXXXX" \
                   --proxy-listener-cert-file "server-cert.pem" \
                   --proxy-listener-ca-chain-cert-file "ca.pem" \
                   --proxy-listener-tls-enable \
                   --auth-local-param "--username=abc" \
                   --auth-local-param "--password=XXXX"
                   --sasl-enable \
                   --sasl-method "AWS_MSK_IAM" \
                   --sasl-aws-region "us-east-1" \
                   --log-level debug    

Kafka Client Config File

ssl.truststore.location=/home/ec2-user/kafka_2.13-3.5.1/bin/kafka.client.truststore.jks
sasl.mechanism=SCRAM-SHA-512
security.protocol=SASL_SSL
sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required \
  username="abc" \
  password="XXXX";    

I have used AWS Certificate Manager to generate the certificate and below command to generate kafka.client.truststore.jks file :

/usr/lib/jvm/jre-11-openjdk/bin/keytool -import \
	-trustcacerts \
	-noprompt \
	-alias test \
	-file server-cert.pem \
	-keystore ./kafka.client.truststore.jks \
    -storepass changeit 

Could you please help me in resolving this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant