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

[binatmi/schema-registry] Add support for Amazon MSK IAM auth #74014

Closed
wants to merge 1 commit into from

Conversation

bpesics
Copy link

@bpesics bpesics commented Oct 28, 2024

Description of the change

Add Amazon MSK IAM authentication support.

Benefits

Allows Schema Registry to use AWS IAM for authentication and authorization against Amazon MSK clusters that have AWS IAM enabled as an authentication mechanism. This is obviously more desired than no authentication or plain text with static credentials.

Possible drawbacks

N/A

Applicable issues

Additional information

As a side issue, this image insisted on mounting a keystore file for any SECURITY_PROTOCOL which includes SSL or SASL, presumably for TLS client authentication.
In order to avoid breaking the existing behaviour I added SCHEMA_REGISTRY_KAFKASTORE_CLIENT_AUTH_DISABLED to provide a way to disable validation when mounting keystore files isn't really necessary.

@github-actions github-actions bot added schema-registry triage Triage is needed labels Oct 28, 2024
@github-actions github-actions bot requested a review from carrodher October 28, 2024 16:44
@carrodher carrodher added verify Execute verification workflow for these changes in-progress labels Oct 28, 2024
@github-actions github-actions bot removed the triage Triage is needed label Oct 28, 2024
@github-actions github-actions bot removed the request for review from carrodher October 28, 2024 16:54
@github-actions github-actions bot requested a review from migruiz4 October 28, 2024 16:54
@migruiz4
Copy link
Member

Hi @bpesics,

Thank you very much for your contribution! Before I can accept this feature, I would need to ask you about the following information:

  • Could you please provide Schema Registry documentation where support for AWS MSK is mentioned?
  • What would be compatibility restrictions between the AWS MSK jar and Schema registry versions?

I'm sorry but without that information, this would need to remain as a customization on users' side.

@migruiz4
Copy link
Member

We could accept adding support for the SCHEMA_REGISTRY_KAFKASTORE_* environment variables, but we need the information requested in order to add the AWS_MSK jar file to the source image.

@bpesics
Copy link
Author

bpesics commented Nov 4, 2024

@migruiz4

Hi @bpesics,

Thank you very much for your contribution! Before I can accept this feature, I would need to ask you about the following information:

  • Could you please provide Schema Registry documentation where support for AWS MSK is mentioned?

I think the support of additional authentication mechanisms is an implicit consequence of SASL support.

SASL (Simple Authentication Security Layer) is a framework that provides developers of applications and shared libraries with mechanisms for authentication, data integrity-checking, and encryption.

The SASL mechanism can be selected by kafkastore.sasl.mechanism as documented here. This interface is a native feature of the Java Kafka client used by Schema Registry and other Kafka related Confluent and non-Confluent products. AWS_MSK_IAM implements this interface org.apache.kafka.common.security.auth.AuthenticateCallbackHandler and the library itself is supported by Amazon.

I'd also point out that I think the users of this Bitnami image most probably aren't subscribers of the Confluent platform (otherwise they'd use the image confluentinc/cp-schema-registry) and this change makes this image a lot more useful.

  • What would be compatibility restrictions between the AWS MSK jar and Schema registry versions?

As AWS_MSK_IAM depends on Interface AuthenticateCallbackHandler, the current Kafka (client) major version 3.x should provide compatibility for the foreseeable future and there are no other restrictions.

@bpesics
Copy link
Author

bpesics commented Nov 18, 2024

@migruiz4 @carrodher is there anything more I can do to get this merged?

@michalmisiewicz
Copy link
Contributor

michalmisiewicz commented Nov 18, 2024

I encountered a similar issue with Google Cloud Managed Kafka and proposed a provider-agnostic solution in #74972. I believe the best way to support additional sasl.mechanism is by providing a configuration file specified in SCHEMA_REGISTRY_CONF_FILE.

@bpesics
Copy link
Author

bpesics commented Nov 26, 2024

I encountered a similar issue with Google Cloud Managed Kafka and proposed a provider-agnostic solution in #74972. I believe the best way to support additional sasl.mechanism is by providing a configuration file specified in SCHEMA_REGISTRY_CONF_FILE.

@michalmisiewicz Nice, thanks for the heads-up! Your PR addressed what I refer to here as "client authentication" issue.

I encountered a similar issue with Google Cloud Managed Kafka and proposed a provider-agnostic solution in #74972. I believe the best way to support additional sasl.mechanism is by providing a configuration file specified in SCHEMA_REGISTRY_CONF_FILE.

Thanks! Your PR addressed what I referred to here as "client authentication" issue, that should simplify things.

On the other hand, SCHEMA_REGISTRY_CONF_FILE is a read-only variable and the only way to pass in configuration from outside is mounting a file with the same relative path as SCHEMA_REGISTRY_CONF_FILE via SCHEMA_REGISTRY_MOUNTED_CONF_DIR. Using this injected file pretty much disables most of the configuration processing of this image, rendering it not too useful (ie. the config variables are ignored). In addition to that, the Amazon MSK Library still has to be baked in somehow. So I still think adding the support would benefit others.

Copy link

This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.

@github-actions github-actions bot added the stale 15 days without activity label Dec 12, 2024
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot added stale 15 days without activity and removed stale 15 days without activity labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema-registry solved stale 15 days without activity verify Execute verification workflow for these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants