davsclaus opened a new pull request, #31031:
URL: https://github.com/apache/camel/pull/31031

   JIRA: https://issues.apache.org/jira/browse/CAMEL-27683
   
   ## What was wrong
   
   A Slack incoming-webhook URL (`https://hooks.slack.com/services/...`) is 
itself the credential: whoever has it can post
   to the channel. The `webhookUrl` option of `SlackEndpoint` and 
`SlackComponent` was not a secret option, so the URL was
   shown in clear text in endpoint URIs, in logs, in the dev consoles and in 
tooling, while the endpoint `token` was masked.
   The `token` option of the component was not secret either.
   
   ## What changed
   
   - `SlackEndpoint.webhookUrl`: `label = "producer,security", secret = true`.
   - `SlackComponent.webhookUrl` and `SlackComponent.token`: `secret = true`, 
and the `security` label added next to the
     existing `webhook` / `token` labels (the relabelling of these component 
options is left to CAMEL-27681).
   - `webhookurl` added to `SENSITIVE_KEYS` and `SENSITIVE_PATTERN` of 
`SensitiveUtils` and to the catalog
     `main/sensitive-keys.json`, in the place and format that the 
`update-sensitive-helper` goal generates, so
     `URISupport.sanitizeUri` masks it and camel-main treats 
`camel.component.slack.webhookUrl` as sensitive. No other
     component has a `webhookUrl` option.
   - Regenerated the component JSON (+ catalog copy), 
`SlackEndpointUriFactory`, and the endpoint and component DSL.
   
   ## Tests
   
   New `SlackSecretOptionsTest` (4 tests): `URISupport.sanitizeUri` masks 
`webhookUrl` (plain and `RAW()`), the endpoint
   `toString()` does not show the URL, and `webhookUrl` is in the secret 
property names of the endpoint URI factory and a
   sensitive key. All 4 fail without the fix and pass with it. The whole 
camel-slack module passes, and the
   `SensitiveUtilsTest` / `URISupportTest` of camel-util too.
   
   ## Upgrade guide
   
   New entry `camel-slack - webhookUrl is a secret option` in the 4.24 upgrade 
guide: the URL is now masked, the options
   move to the `security` group in docs/tooling, and 
`camel.security.secretPolicy` now reports a plain-text `webhookUrl`
   (a warning by default, a startup failure with `camel.main.profile=prod`).
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to