I've been going through Vault documentation and I'm still not sure if I understand it correctly on which approach to take for my problem.
Imagine having an entity called Example. It has multiple fields, such as name, created, etc. and amongst these fields which are sensitive, such as password, secret_key.
@Entity
@Table(name = "example")
public class Example {
private String name;
private Date created;
...
@Convert(converter = SomeConverter.class)
private String password;
@Convert(converter = SomeConverter.class)
private String secretKey;
}
This entity is stored in an SQL database (e.g. PostgreSQL). Now my goal is to have the password secure (hence the converter class), but the rest of the data not.
Is it possible to store entity data in DB, while keeping the sensitive data stored in Vault (in whatever storage behind it)? So when I'd be loading the entity both entity data would be loaded from DB and sensitive data from Vault.
Or would the correct (and only viable) approach be to just use the encryption/decryption converter from Vault and store it in the same database? And limit this with authentication with Vault.
I'm just confused if Vault in general should only be used for static secrets in this case.