diff --git a/multi/multi__client_side_usage.html b/multi/multi__client_side_usage.html index 13254c88..67aac053 100644 --- a/multi/multi__client_side_usage.html +++ b/multi/multi__client_side_usage.html @@ -13,7 +13,7 @@ the test cases). Example Maven configuration:
Example 3.6. bootstrap.yml with AppRole authentication properties
spring.cloud.vault: authentication: APPROLE app-role: - role-id: bde2076b-cccb-3cf0-d57e-bca7b1e83a52
The following scenarios are supported along the required configuration details:
Table 3.1. Configuration
Method | RoleId | SecretId | RoleName | Token |
Provided RoleId/SecretId | Provided | Provided | ||
Provided RoleId without SecretId | Provided | |||
Provided RoleId, Pull SecretId | Provided | Provided | Provided | Provided |
Pull RoleId, provided SecretId | Provided | Provided | Provided | |
Full Pull Mode | Provided | Provided | ||
Wrapped | Provided | |||
Wrapped RoleId, provided SecretId | Provided | Provided | ||
Provided RoleId, wrapped SecretId | Provided | Provided |
Table 3.2. Pull/Push/Wrapped Matrix
RoleId | SecretId | Supported |
Provided | Provided | ✅ |
Provided | Pull | ✅ |
Provided | Wrapped | ✅ |
Provided | Absent | ✅ |
Pull | Provided | ✅ |
Pull | Pull | ✅ |
Pull | Wrapped | ❌ |
Pull | Absent | ❌ |
Wrapped | Provided | ✅ |
Wrapped | Pull | ❌ |
Wrapped | Wrapped | ✅ |
Wrapped | Absent | ❌ |
![]() | Note |
|---|---|
You can use still all combinations of push/pull/wrapped modes by providing a configured |
Example 3.7. bootstrap.yml with all AppRole authentication properties
spring.cloud.vault: + role-id: bde2076b-cccb-3cf0-d57e-bca7b1e83a52
The following scenarios are supported along the required configuration details:
Table 3.1. Configuration
Method | RoleId | SecretId | RoleName | Token |
Provided RoleId/SecretId | Provided | Provided | ||
Provided RoleId without SecretId | Provided | |||
Provided RoleId, Pull SecretId | Provided | Provided | Provided | Provided |
Pull RoleId, provided SecretId | Provided | Provided | Provided | |
Full Pull Mode | Provided | Provided | ||
Wrapped | Provided | |||
Wrapped RoleId, provided SecretId | Provided | Provided | ||
Provided RoleId, wrapped SecretId | Provided | Provided |
Table 3.2. Pull/Push/Wrapped Matrix
RoleId | SecretId | Supported |
Provided | Provided | ✅ |
Provided | Pull | ✅ |
Provided | Wrapped | ✅ |
Provided | Absent | ✅ |
Pull | Provided | ✅ |
Pull | Pull | ✅ |
Pull | Wrapped | ❌ |
Pull | Absent | ❌ |
Wrapped | Provided | ✅ |
Wrapped | Pull | ❌ |
Wrapped | Wrapped | ✅ |
Wrapped | Absent | ❌ |
![]() | Note |
|---|---|
You can use still all combinations of push/pull/wrapped modes by providing a configured |
![]() | Important |
|---|---|
AppRole authentication is limited to simple pull mode using reactive infrastructure. Full pull mode is not yet supported. Using Spring Cloud Vault with the Spring WebFlux stack enables Vault’s reactive auto-configuration which can be disabled by setting |
Example 3.7. bootstrap.yml with all AppRole authentication properties
spring.cloud.vault: authentication: APPROLE app-role: role-id: bde2076b-cccb-3cf0-d57e-bca7b1e83a52 @@ -69,7 +69,7 @@ does not require first-deploying, or provisioning security-sensitive credentials (tokens, username/password, client certificates, etc.). Instead, it treats AWS as a Trusted Third Party and uses the cryptographically signed dynamic metadata information that uniquely -represents each EC2 instance.Example 3.8. bootstrap.yml using AWS-EC2 Authentication
spring.cloud.vault: +represents each EC2 instance.AWS-EC2 authentication enables nonce by default to follow the Trust On First Use (TOFU) principle. Any unintended party that gains access to the PKCS#7 identity metadata can authenticate @@ -80,10 +80,10 @@ party does not have the nonce and can raise an alert in Vault for further investigation.
The nonce is kept in memory and is lost during application restart. You can configure a static nonce with
spring.cloud.vault.aws-ec2.nonce.AWS-EC2 authentication roles are optional and default to the AMI. You can configure the authentication role by setting the -
spring.cloud.vault.aws-ec2.roleproperty.Example 3.9. bootstrap.yml with configured role
spring.cloud.vault: +spring.cloud.vault.aws-ec2.roleproperty.Example 3.9. bootstrap.yml with configured role
spring.cloud.vault: authentication: AWS_EC2 aws-ec2: - role: application-serverExample 3.10. bootstrap.yml with all AWS EC2 authentication properties
spring.cloud.vault: + role: application-serverExample 3.10. bootstrap.yml with all AWS EC2 authentication properties
spring.cloud.vault: authentication: AWS_EC2 aws-ec2: role: application-server @@ -104,8 +104,8 @@ will use the IAM role assigned to the ECS task of the running container. If you are running your application naked on top of an EC2 instance then the IAM role used will be the one assigned to the EC2 instance.When using the AWS-IAM authentication you must create a role in Vault and assign it to your IAM role. An empty
roledefaults to -the friendly name the current IAM role.Example 3.11. bootstrap.yml with required AWS-IAM Authentication properties
spring.cloud.vault: - authentication: AWS_IAMExample 3.12. bootstrap.yml with all AWS-IAM Authentication properties
spring.cloud.vault: +the friendly name the current IAM role.Example 3.11. bootstrap.yml with required AWS-IAM Authentication properties
spring.cloud.vault: + authentication: AWS_IAMExample 3.12. bootstrap.yml with all AWS-IAM Authentication properties
spring.cloud.vault: authentication: AWS_IAM aws-iam: role: my-dev-role @@ -113,7 +113,7 @@ the friendly name the current IAM role.
rolesets the name of the role against which the login is being attempted. This should be bound to your IAM role. If one is not supplied then the friendly name of the current IAM user will be used as the vault role.aws-pathsets the path of the AWS mount to useserver-idsets the value to use for theX-Vault-AWS-IAM-Server-IDheader preventing certain types of replay attacks.AWS-IAM requires the AWS Java SDK dependency (
com.amazonaws:aws-java-sdk-core) as the authentication implementation uses AWS SDK types for credentials and request signing.The
certauth backend allows authentication using SSL/TLS client certificates that are either signed by a CA or self-signed.To enable
certauthentication you need to:
- Use SSL, see Chapter 9, Vault Client SSL configuration
- Configure a Java
Keystorethat contains the client -certificate and the private key- Set the
spring.cloud.vault.authenticationtoCERTExample 3.13. bootstrap.yml
spring.cloud.vault: +certificate and the private keySet the spring.cloud.vault.authenticationtoCERTExample 3.13. bootstrap.yml
spring.cloud.vault: authentication: CERT ssl: key-store: classpath:keystore.jks @@ -123,16 +123,16 @@ workflow. Cubbyhole authentication uses tokens as primary login method. An ephemeral token is used to obtain a second, login VaultToken from Vault’s Cubbyhole secret backend. The login token is usually longer-lived and used to interact with Vault. The login token will be retrieved from a wrapped -response stored at/cubbyhole/response.Creating a wrapped token
Note Response Wrapping for token creation requires Vault 0.6.0 or higher.
Example 3.14. Creating and storing tokens
$ vault token-create -wrap-ttl="10m" +response stored at/cubbyhole/response.Creating a wrapped token
Note Response Wrapping for token creation requires Vault 0.6.0 or higher.
Example 3.14. Creating and storing tokens
$ vault token-create -wrap-ttl="10m" Key Value --- ----- wrapping_token: 397ccb93-ff6c-b17b-9389-380b01ca2645 wrapping_token_ttl: 0h10m0s wrapping_token_creation_time: 2016-09-18 20:29:48.652957077 +0200 CEST -wrapped_accessor: 46b6aebb-187f-932a-26d7-4f3d86a68319Example 3.15. bootstrap.yml
spring.cloud.vault: +wrapped_accessor: 46b6aebb-187f-932a-26d7-4f3d86a68319Example 3.15. bootstrap.yml
spring.cloud.vault: authentication: CUBBYHOLE token: 397ccb93-ff6c-b17b-9389-380b01ca2645See also:
Kubernetes authentication mechanism (since Vault 0.8.3) allows to authenticate with Vault using a Kubernetes Service Account Token. -The authentication is role based and the role is bound to a service account name and a namespace.
A file containing a JWT token for a pod’s service account is automatically mounted at
/var/run/secrets/kubernetes.io/serviceaccount/token.Example 3.16. bootstrap.yml with all Kubernetes authentication properties
spring.cloud.vault: +The authentication is role based and the role is bound to a service account name and a namespace.A file containing a JWT token for a pod’s service account is automatically mounted at
/var/run/secrets/kubernetes.io/serviceaccount/token.Example 3.16. bootstrap.yml with all Kubernetes authentication properties
spring.cloud.vault: authentication: KUBERNETES kubernetes: role: my-dev-role diff --git a/multi/multi_vault.config.backends.database-backends.html b/multi/multi_vault.config.backends.database-backends.html index 62014206..18b6c9b3 100644 --- a/multi/multi_vault.config.backends.database-backends.html +++ b/multi/multi_vault.config.backends.database-backends.html @@ -9,11 +9,11 @@ backend in the configuration and thespring-cloud-vault-co dependency.Vault ships since 0.7.1 with a dedicated
databasesecret backend that allows database integration via plugins. You can use that specific backend by using the generic database backend. Make sure to specify the appropriate -backend path, e.g.spring.cloud.vault.mysql.role.backend=database.Example 5.1. pom.xml
<dependencies> +backend path, e.g.spring.cloud.vault.mysql.role.backend=database.Example 5.1. pom.xml
<dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-vault-config-databases</artifactId> - <version>2.0.1.BUILD-SNAPSHOT</version> + <version>2.1.0.BUILD-SNAPSHOT</version> </dependency> </dependencies>