You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/04/07 09:49:42 UTC

[camel] branch main updated: Azure Key Vault: Security docs

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 8afd5f6ee1c Azure Key Vault: Security docs
8afd5f6ee1c is described below

commit 8afd5f6ee1cc31e87e2bda6da07a768978415e4d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 7 11:49:23 2022 +0200

    Azure Key Vault: Security docs
---
 docs/user-manual/modules/ROOT/pages/security.adoc | 97 +++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/docs/user-manual/modules/ROOT/pages/security.adoc b/docs/user-manual/modules/ROOT/pages/security.adoc
index 159771bad4c..b681da76846 100644
--- a/docs/user-manual/modules/ROOT/pages/security.adoc
+++ b/docs/user-manual/modules/ROOT/pages/security.adoc
@@ -66,6 +66,7 @@ The following _Vaults_ are supported by Camel:
 * xref:components::aws-secrets-manager-component.adoc[AWS Secrets Manager]
 // TODO: Enable link when website build works again
 // * xref:components::google-secret-manager-component.adoc[Google Secret Manager]
+// * xref:components::azure-key-vault-component.adoc[Azure Key Vault]
 
 ==== Using AWS Vault
 
@@ -271,3 +272,99 @@ NOTE: For the moment we are not considering the rotation function, if any will b
 
 The only requirement is adding `camel-google-secret-manager` JAR to your Camel application.
 
+==== Using Azure Key Vault
+
+To use this function you'll need to provide credentials to Azure Key Vault Service as environment variables:
+
+[source,bash]
+----
+export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId
+export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId
+export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret
+export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
+----
+
+You can also configure the credentials in the `application.properties` file such as:
+
+[source,properties]
+----
+camel.vault.azure.tenantId = accessKey
+camel.vault.azure.clientId = clientId
+camel.vault.azure.clientSecret = clientSecret
+camel.vault.azure.vaultName = vaultName
+----
+
+At this point you'll be able to reference a property in the following way:
+
+[source,xml]
+----
+<camelContext>
+    <route>
+        <from uri="direct:start"/>
+        <to uri="{{azure:route}}"/>
+    </route>
+</camelContext>
+----
+
+Where route will be the name of the secret stored in the Azure Key Vault Service.
+
+You could specify a default value in case the secret is not present on Azure Key Vault Service:
+
+[source,xml]
+----
+<camelContext>
+    <route>
+        <from uri="direct:start"/>
+        <to uri="{{azure:route:default}}"/>
+    </route>
+</camelContext>
+----
+
+In this case if the secret doesn't exist, the property will fallback to "default" as value.
+
+Also you are able to get particular field of the secret, if you have for example a secret named database of this form:
+
+[source,bash]
+----
+{
+  "username": "admin",
+  "password": "password123",
+  "engine": "postgres",
+  "host": "127.0.0.1",
+  "port": "3128",
+  "dbname": "db"
+}
+----
+
+You're able to do get single secret value in your route, like for example:
+
+[source,xml]
+----
+<camelContext>
+    <route>
+        <from uri="direct:start"/>
+        <log message="Username is {{azure:database/username}}"/>
+    </route>
+</camelContext>
+----
+
+Or re-use the property as part of an endpoint.
+
+You could specify a default value in case the particular field of secret is not present on Azure Key Vault:
+
+[source,xml]
+----
+<camelContext>
+    <route>
+        <from uri="direct:start"/>
+        <log message="Username is {{azure:database/username:admin}}"/>
+    </route>
+</camelContext>
+----
+
+In this case if the secret doesn't exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value.
+
+For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done.
+
+The only requirement is adding the camel-azure-key-vault jar to your Camel application.
+