davsclaus commented on code in PR #30204:
URL: https://github.com/apache/camel/pull/30204#discussion_r4587656649
##########
tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateSensitizeHelper.java:
##########
@@ -154,13 +157,23 @@ public void execute() throws MojoExecutionException {
boolean isComponent = obj.getMap("component") != null;
boolean isDataFormat = !isComponent &&
obj.getMap("dataformat") != null;
boolean isLanguage = !isComponent && !isDataFormat &&
obj.getMap("language") != null;
+ boolean isBean = !isComponent && !isDataFormat && !isLanguage
&& obj.getMap("bean") != null;
+ boolean isMain =
MAIN_METADATA.equals(file.getFileName().toString());
// only check these kind
- if (!isComponent && !isDataFormat && !isLanguage) {
+ if (!isComponent && !isDataFormat && !isLanguage && !isBean &&
!isMain) {
continue;
}
- if (isComponent) {
+ if (isMain) {
+ // the option names are full keys (such as
camel.server.jwtKeystorePassword)
+ MainModel mm = JsonMapper.generateMainModel(obj);
+ mm.getOptions().forEach(
+ o -> collectSecretOption(o,
o.getName().substring(o.getName().lastIndexOf('.') + 1), secrets));
Review Comment:
Thanks, good catch. Fixed in c37b89303dbd as you suggested: the camel-main
secret options are generated as whole keys (lower case, no dashes, such as
`camel.vault.azure.tenantid`) into a separate set, `SENSITIVE_WHOLE_KEYS`,
which `SensitiveUtils.containsSensitive` checks before the last-part match. The
name list is back to what main has, so
`camel.component.google-pubsub.serviceAccountKey` and
`camel.component.azure-storage-datalake.tenantId` are not sensitive.
`MainSecurityPolicyTest` has two new tests: a prod-profile app with those two
component options starts, and a plain-text `camel.vault.azure.tenantId` still
fails.
`camel.vault.gcp.serviceAccountKey` stays flagged secret, as the value can
be the key itself. The upgrade guide says a file location there is reported
too, and can go behind a property placeholder.
_Claude Code on behalf of davsclaus_
##########
tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateSensitizeHelper.java:
##########
@@ -154,13 +157,23 @@ public void execute() throws MojoExecutionException {
boolean isComponent = obj.getMap("component") != null;
boolean isDataFormat = !isComponent &&
obj.getMap("dataformat") != null;
boolean isLanguage = !isComponent && !isDataFormat &&
obj.getMap("language") != null;
+ boolean isBean = !isComponent && !isDataFormat && !isLanguage
&& obj.getMap("bean") != null;
+ boolean isMain =
MAIN_METADATA.equals(file.getFileName().toString());
// only check these kind
- if (!isComponent && !isDataFormat && !isLanguage) {
+ if (!isComponent && !isDataFormat && !isLanguage && !isBean &&
!isMain) {
continue;
}
- if (isComponent) {
+ if (isMain) {
Review Comment:
Agreed that it is the same root cause. I kept this PR to secrets and filed
[CAMEL-27068](https://issues.apache.org/jira/browse/CAMEL-27068): generate the
camel-main options that have a security category from the metadata, matched by
their whole key, instead of the hand-kept `EXTRA_SECURITY_OPTIONS`. That one
needs its own upgrade-guide entry, as a prod-profile app that enables one of
these four options will then fail at startup.
_Claude Code on behalf of davsclaus_
##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc:
##########
@@ -46,6 +46,18 @@ the route is not yet stopped when the control bus step
returns.
The webhook consumer still logs the body it validates at `DEBUG`, but no
longer the signature from the `X-Signature` header, nor the signature it
calculates.
The `InvalidMessageSignatureException` of a failed check no longer carries the
calculated signature: `getCalculatedSignature()` returns `null` and is
deprecated, as is the constructor that takes it.
+=== camel-main - the server and vault options flagged secret are sensitive keys
+
+The options `camel.server.jwtKeystorePassword`,
`camel.management.jwtKeystorePassword`,
+`camel.vault.azure.eventhubConnectionString`, `camel.vault.azure.tenantId`,
`camel.vault.gcp.serviceAccountKey`,
+`camel.vault.ibm.eventStreamUsername` and
`camel.vault.ibm.eventStreamPassword` are flagged secret, and are now also
+sensitive keys, like the other secret options. The Camel Main
auto-configuration summary shows their value as `xxxxxx`,
+and an endpoint URI parameter with one of these names, such as `tenantId`, is
masked in sanitized URIs.
+
+The `camel.security.secretPolicy` check now also reports these options when
they are configured as plain text,
+including a value set through an environment variable: a warning by default,
and the startup fails with
+`camel.main.profile=prod`. Configure them with a property placeholder or a
vault reference instead.
Review Comment:
With the whole-key matching in c37b89303dbd, component options with the same
name are no longer affected, so there is nothing to add for the Google and
Azure components. The guide now says these options are matched by their whole
key, and that component and endpoint options with the same name, such as
`tenantId` or `serviceAccountKey`, are not affected. The sentence about masking
`tenantId` in sanitized endpoint URIs is gone.
_Claude Code on behalf of davsclaus_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]