Custom Secure Storage
Custom Secure Storage allows organizations to integrate their own proprietary or third-party key vault solutions with AMT Java. This option provides flexibility for environments that use specialized security infrastructure not directly supported by the built-in vault types.
Configuring Custom Secure Storage
To use a custom vault implementation, you must first create a Java class that implements the AmtVaultAPI
interface. This class will handle the connection logic and secret retrieval from your chosen secure storage
solution.
Implementing AmtVaultAPI
Your custom vault class must implement the following interface:
package com.avanade.ltcoe.amt.secure.storage;
public interface AmtVaultAPI {
void initialize(Map<String, String> vaultConfiguration)
throws AmtVaultInitializationException;
String getSecret(String key);
}The implementation should:
- Provide a public no-argument constructor
- Handle initialization logic in the
initialize()method using configuration from the YAML file - Retrieve secrets in the
getSecret()method, returningnullif the key is not found
For reference examples, see the built-in implementations such as AmtSimpleVault,
AmtAzureVault, or AmtHashiCorpVault in the secure storage API package.
Updating Secure Storage Configuration
After creating your custom vault implementation, update the Control Center or Application configuration file to reference your custom class:
secureStorages:
- id: custom
vaultType: Custom
vaultClass: com.example.mycompany.MyCustomVault
vaultConfiguration:
# Add your custom configuration key-value pairs here
customSetting1: value1
customSetting2: value2Configuration Parameters:
id- A unique identifier for this vault instancevaultType- Must be set toCustomvaultClass- The fully qualified class name of your custom vault implementationvaultConfiguration- Key-value pairs passed to your vault'sinitialize()method
| Important |
|---|
If the class specified in vaultClass cannot be found on the classpath, the runtime will
fail to start with a VaultClassNotFoundException. |
Deployment Requirements
Your custom vault implementation must:
- Include a dependency on the AMT secure storage API:
<dependency> <groupId>com.avanade.ltcoe.amt</groupId> <artifactId>platform-api-secure-storage</artifactId> <version>${amt.version}</version> <scope>provided</scope> </dependency> - Be packaged as a JAR and added as a dependency to your runtime project
- Be available on the classpath when AMT Java starts
| Good to know |
|---|
Your custom vault implementation has access to all configuration values specified in
vaultConfiguration, allowing you to pass connection strings, credentials, or any other
settings your vault needs. |
