[ 
https://issues.apache.org/jira/browse/CAMEL-27750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18152249#comment-18152249
 ] 

Claus Ibsen commented on CAMEL-27750:
-------------------------------------

*Recommendation: option 2, with a new category "identifiers of the customer"*

A tenant ID is like a customer ID or an account number: it says which customer 
or organisation you are, but it does not prove that you are them (it can be 
looked up from the domain of the organisation through the OpenID discovery 
endpoint). It should not show in logs, consoles or AI/MCP output, but it is not 
a credential that belongs in a vault.

So Camel would have three kinds of keys:

||Kind||Example||Mask in output||Plain-text secret (prod policy)||
|Credential|{{clientSecret}}, {{password}}, {{accessKey}}|yes|yes|
|Identifier of the customer|{{tenantId}}, {{subscriptionId}}, an AWS account 
ID|yes|no|
|Plain configuration|{{vaultName}}, {{region}}|no|no|

*Why not option 1:* the prod policy should mean "this is a credential". Failing 
a prod startup on a plain-text tenant ID adds friction without security gain, 
makes the plain-text secrets check noisy, and needs an upgrade-guide entry for 
every Azure user of the prod profile. Option 2 only masks more, so nothing 
breaks.

*Implementation sketch:*
* A small, hand-kept list of the identifiers of the customer (masked, not 
secret), starting with {{tenantid}}, generated next to the sensitive keys in 
{{SensitiveUtils}}.
* {{SensitiveUtils.containsSensitive}} also returns true for them, so every 
caller that only masks ({{URISupport}}, {{DefaultMaskingFormatter}}, the 
properties dev console, {{camel get properties}}, the MCP redactor, the Camel 
Main startup summary) picks them up without changes.
* A new check for the plain-text secrets policy that leaves them out, used in 
{{BaseMainSupport.detectSecurityViolations}} (today 
{{MainHelper.containsSensitive}}, which also drives the masking of the startup 
summary, so that use is split).
* The {{tenantId}} options of the Azure components stay not secret.
* {{camel.vault.azure.tenantId}} stays secret as it is today: making it 
mask-only would relax an existing check, which needs an upgrade-guide entry and 
PMC sign-off.
* {{subscriptionid}} is already a full sensitive key, so the prod profile flags 
a plain-text Azure subscription ID today. It belongs in the new category, but 
moving it relaxes an existing check, so leave it out of this ticket.
* Tests: update 
{{SensitiveUtilsTest.componentOptionsWithTheNameOfASecretMainOptionAreNotSensitive}}
 (the tenant ID is now masked) and keep 
{{MainSecurityPolicyTest.testComponentOptionWithTheNameOfASecretVaultOption}} 
passing (a plain-text component tenant ID is still no violation).

_Claude Code on behalf of davsclaus_

> Mask the Azure tenantId as a sensitive key for all components
> -------------------------------------------------------------
>
>                 Key: CAMEL-27750
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27750
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Priority: Major
>             Fix For: 4.25.0
>
>
> The Azure tenant ID (the ID of the Microsoft Entra directory) is sensitive 
> information and should be masked everywhere Camel masks sensitive keys, for 
> every component and not only for {{camel.vault.azure.tenantId}}.
> *Today*
> * {{tenantId}} is on purpose not a sensitive key by name. CAMEL-27049 made it 
> secret only as the whole key {{camel.vault.azure.tenantId}} 
> ({{SENSITIVE_WHOLE_KEYS}} in {{SensitiveUtils}}), and 
> {{SensitiveUtilsTest.componentOptionsWithTheNameOfASecretMainOptionAreNotSensitive}}
>  checks that {{camel.component.azure-storage-datalake.tenantId}} and 
> {{azure-storage-datalake:myaccount?tenantId=mytenant}} are not masked.
> * The {{tenantId}} option of azure-functions, azure-storage-datalake and 
> (since CAMEL-27732) azure-key-vault is not flagged secret, so it is shown in 
> clear text in endpoint URIs, the startup summary of Camel Main, the 
> properties dev console, {{camel get properties}} and the MCP output.
> *What to keep in mind*
> The sensitive keys drive both the masking and the plain-text secrets policy 
> of the prod profile: {{BaseMainSupport.detectSecurityViolations}} uses 
> {{MainHelper.containsSensitive}}. Adding {{tenantid}} to the sensitive keys 
> would therefore also make the prod profile refuse (or warn about) a 
> plain-text {{camel.component.azure-functions.tenantId=...}}. See 
> {{MainSecurityPolicyTest.testComponentOptionWithTheNameOfASecretVaultOption}}.
> *Options*
> # Make {{tenantid}} a sensitive key by name (an extra key in 
> {{UpdateSensitizeHelper}}) and flag the {{tenantId}} options of the Azure 
> components secret. Simple and consistent, but users of the prod profile with 
> a plain-text tenant ID must move it to a placeholder or vault, which needs an 
> upgrade-guide entry.
> # Add a list of keys that are masked but are not counted as plain-text 
> secrets, so the tenant ID is hidden in the output without changing the prod 
> profile.
> Also check the other Azure ID options with the same kind of value 
> ({{clientId}} is already a sensitive key), and other clouds with a similar 
> directory or account ID.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to