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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

kafka authentication methods #620

Merged
merged 1 commit into from Aug 4, 2021
Merged

kafka authentication methods #620

merged 1 commit into from Aug 4, 2021

Conversation

iwpnd
Copy link
Contributor

@iwpnd iwpnd commented Aug 3, 2021

Hi! 馃憢

in #615 we added authentication with SASL and shortly after the release I noticed that we did take care of the authentication but forgot about SSL in the process. As a result SASL authentication currently does only work if the connection to the broker is not encrypted (SASL PLAIN). This is because Tile38 does not allow for the verification to be skipped in the sarama config.

I created an example for the case at iwpnd/tile-kafka-sasl and tested SASL auth without SSL successfully.

Now with this PR I want to fix this introducing a new auth flow to support TLS, SASL, SASL/SSL and no-auth as follows:

tile38-kafka-config

SASL PLAIN
?auth=sasl&sha512=true is using using credentials from the env KAFKA_PASSWORD / KAFKA_USERNAME

SASL/SSL
?auth=sasl&ssl=true&sha512=true&cacert=/path/to/cert is is using using credentials from the env KAFKA_PASSWORD / KAFKA_USERNAME. This now also validates the given root certificate accordingly.

TLS
?auth=tls&cacert=/path/to/cacert&cert=/path/to/user.crt&key=/path/to/user.key works as it had before #615. As TLS authenfication requires SSL, the additional ssl=true is obsolete and will be ignored.

Additional authentication methods can now be added as they're needed (SASL GSSAPI, PLAIN).

SASL/SSL has now been tested in a production environment with this fork iwpnd/ben38 successfully.

What do you think?

@tidwall
Copy link
Owner

tidwall commented Aug 4, 2021

LGTM

@iwpnd
Copy link
Contributor Author

iwpnd commented Aug 9, 2021

Hey @tidwall, when do you plan on releasing the next version?

@tidwall
Copy link
Owner

tidwall commented Aug 9, 2021

The target is early this week.

@tidwall
Copy link
Owner

tidwall commented Aug 11, 2021

Just released !!!

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

Successfully merging this pull request may close these issues.

None yet

2 participants