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

Filter camel properties to camelMain #1640

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

seanshi007
Copy link

Previously all properties are first put into camelProperties and then logged (after filter out sensitive keys defined in Camel core). When producer or consumer is overridden, e.g. when "producer.override.sasl.jaas.config" is set, which will not be filtered out and hence being logged and causing potential secret exposure.

This change will filter out non-camel properties as they will not be used by camel core anyway.

@davsclaus davsclaus requested a review from valdar May 19, 2024 07:39
Copy link
Member

@valdar valdar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanshi007 First of all thanks a lot for the contribution!
Please see my inline comments.

@@ -227,7 +229,10 @@ public CamelKafkaConnectMain build(CamelContext camelContext) {
camelMain.configure().setDumpRoutes(Boolean.TRUE.toString());

Properties camelProperties = new Properties();
camelProperties.putAll(props);
Map<String, String> camelProps = props.entrySet().stream()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that, theoretically (since it is not explicitly tested in tests, would be possible to add properties not starting with camel. as a way to configure some other useful stuff like factories for some camel components i.e. as in https://github.com/apache/camel-kafka-connector/blob/main/connectors/camel-kafka-connector-fix-dependencies.properties#L25 what about having a specific property say camel.kafkaconnector.filtered.props as a comma separated list of sensitive properties that one may want to explicitly filter?

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.

2 participants