Elffuss BraidHub

kikocis/EDC public

Branch: main
cc2a9ff178c4 fix: return StsClient from create() (#4479) Paul Latzelsperger,
..
src/
README.md3.7 KiB
build.gradle.kts987 B

README.md

HashiCorp Vault Extension


Please note: Using the HashiCorp vault it is possible to define multiple data entries per secret. Other vaults might allow only one entry per secret (e.g. Azure Key Vault).

Therefore, the HashiCorp vault extension only checks the 'content' data entry! Please use this knowledge when creating secrets the EDC should consume.


Configuration

KeyDescriptionMandatoryDefault
edc.vault.hashicorp.urlURL to connect to the HashiCorp VaultX
edc.vault.hashicorp.tokenValue for Token Authentication with the vaultX
edc.vault.hashicorp.timeout.secondsRequest timeout in seconds when contacting the vault30
edc.vault.hashicorp.health.check.enabledEnable health checks to ensure vault is initialized, unsealed and activetrue
edc.vault.hashicorp.health.check.standby.okSpecifies if a vault in standby is healthy. This is useful when Vault is behind a non-configurable load balancerfalse
edc.vault.hashicorp.api.secret.pathPath to the secret api/v1/secret
edc.vault.hashicorp.api.health.check.pathPath to the health api/v1/sys/health

Health Check

The HashiCorp Vault Extension is able to run health checks. A health check is successful when the vault is initialized, active and unsealed. Successful health checks are logged with level FINE. Unsuccessful health checks will be logged with level WARNING.


Health Checks

If your project uses the Tractus-X HashiCorp Vault please set edc.vault.hashicorp.health.check.standby.ok to true. Otherwise, the health check would fail if the Vault is in standby.

# Logs of successful check with standby vault
[2022-08-01 14:48:37] [FINE   ] HashiCorp Vault HealthCheck successful. HashicorpVaultHealthResponsePayload(isInitialized=true, isSealed=false, isStandby=true, isPerformanceStandby=false, replicationPerformanceMode=disabled,replicationDrMode=disabled, serverTimeUtc=1659365317, version=1.9.2, clusterName=vault-cluster-4b193c26, clusterId=83fabd45-685d-7f8d-9495-18fab6f50d5e)

Example: Create & Configure an OAuth2 private key

Insert private key into HashiCorp Vault

cat << EOF | /bin/vault kv put secret/my-private-key content=-
        -----BEGIN PRIVATE KEY-----
        <PRIVATE KEY CONTENT>
        EOF

Configure key in the EDC

EDC_OAUTH_PRIVATE_KEY_ALIAS: my-private-key

or

edc.oauth.private.key.alias=my-privatekey

Example

#########
# Vault #
#########
edc.vault.hashicorp.url=https://vault.demo.tractus-x.net
# or even better configure token as k8 secret
edc.vault.hashicorp.token=<token>
edc.vault.hashicorp.api.secret.path=/v1/<tenant>/
edc.vault.hashicorp.health.check.standby.ok=true