Introduction
Other than regular secrets, the vault is also capable of storing certificates in the KV-v2 secret engine. However, the certificates cannot be uploaded directly thus they need to be converted into base64 format and then they can be uploaded to the KV secret engine.
Steps for uploading the ".JKS" file to KV
- Suppose our certificate file name is myservice.jks
- Convert the file to base64 using:
cat myservice.jks | base64
- Create a JSON file with the JKS cert e.g certificate.json as given below:
{
"certificate":"/u3+7QAAAAIAAAAEAAAAAgAEamFjawAAASm7DvHyAAVYLjUwOQAAAvowggL2MIICX6ADAgECAgkA9qs6c/ASQqUwDQYJKoZIhvcNAQEFBQAwgYoxCzAJBgNVBAYTAkxLMRAwDgYDVQQIEwdXZXN0ZXJuMRAwDgYDVQQHEwdDb2xvbWJvMRYwFAYDVQQKEw1Tb2Z0d2FyZSBWaWV3MREwDwYDVQQLEwhUcmFpbmluZzEsMCoGA1UEAxMjU29mdHdhcmUgVmlldyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTAwNzEwMDYzMzE4WhcNMjQwMzE4MDYzMzE4WjByMQswCQYDVQQGEwJMSzEQMA4GA1UECBMHV2VzdGVybjEQMA4GA1UEBxMHQ29sb21ibzEWMBQGA1UEChMNU29mdHdhcmUgVmlldzERMA8GA1UECxMIVHJhaW5pbmcxFDASBgNVBAMTC0phY2sgRGFuaWVsMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCoAixeu7aRbM1eJ2uDJqkNvsZ2aFTA0XHWs6KYPK7ZGsk32wi/RmLYHQqnXFJCIE9Zptdu23fAHUvNLY/X20wL4xbsFNjPSZGDif29Khr6ZMncRrr+/hb3trvTUFIQ6VPHKxWW2qA74PeAP241WmOII2Nc/cWVevDjhoOdfCZ7ewIDAQABo3sweTAJBgNVHRMEAjAAMB0GA1UdDgQWBBQOn6lt5dAeZiK5sNy0Xxv4LiDpXTAfBgNVHSMEGDAWgBTWt2JoQzuwTsG1KpmFNZP1Oqf1FDAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2V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GxuPp4XBGTFmacVRdfSyhmSWmRvg/T0ivwgqvJklazxKa415AIXAgMBAAGjezB5MAkGA1UdEwQCMAAwHQYDVR0OBBYEFO23I9G5OSEknr7injBvzdss5A3vMB8GA1UdIwQYMBaAFNa3YmhDO7BOwbUqmYU1k/U6p/UUMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTANBgkqhkiG9w0BAQUFAAOBgQBn1hHAfzJAFGW34WWtsxqzWAD1Lzo7yLiuG0dQE3BjDEmi7qNGlrUFrjUYLbRbi8lBHDDT08hew/6HvjygtZYTJRavgqGfJpjlVUSi+eTQkx4ZlDLYPaxKbAoAquExsrBEZt7NBKMhGgA05ZkclpGeGinR6TpaxonLJDZYHMo7pnlsI818wifToBG2+eaHZetxNl3J"
}
- Upload the file using the following command:
vault kv put kv/secret @certificate.jks
Steps to retrieve the ".JKS" file from KV
Secret can be retrieved from the vault manually or using annotation:
Retrieve certificate manually:
- You can retrieve the secret from the vault console or run the following command:
vault kv get kv/secret
- Convert the secret to the original format:
base64 -d <<< /u3+7QAAAAIAAAAEAAAAAgAEamFjawAAASm7DvHyAAVYLjUwOQAAAvowggL2MIICX6ADAgECAgkA9qs6c/ASQqUwDQYJKoZIhvcNAQEFBQAwgYoxCzAJBgNVBAYTAkxLMRAwDgYDVQQIEwdXZXN0ZXJuMRAwDgYDVQQHEwdDb2xvbWJvMRYwFAYDVQQKEw1Tb2Z0d2FyZSBWaWV3MREwDwYDVQQLEwhUcmFpbmluZzEsMCoGA1UEAxMjU29mdHdhcmUgVmlldyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTAwNzEwMDYzMzE4WhcNMjQwMzE4MDYzMzE4WjByMQswCQYDVQQGEwJMSzEQMA4GA1UECBMHV2VzdGVybjEQMA4GA1UEBxMHQ29sb21ibzEWMBQGA1UEChMNU29mdHdhcmUgVmlldzERMA8GA1UECxMIVHJhaW5pbmcxFDASBgNVBAMT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lcnRpZmljYXRlIEF1dGhvcml0eTAeFw0xMDA3MTAwNjMzMTFaFw0yNDAzMTgwNjMzMTFaMHUxCzAJBgNVBAYTAkxLMRAwDgYDVQQIEwdXZXN0ZXJuMRAwDgYDVQQHEwdDb2xvbWJvMRYwFAYDVQQKEw1Tb2Z0d2FyZSBWaWV3MREwDwYDVQQLEwhUcmFpbmluZzEXMBUGA1UEAxMOSm9obm5pZSBXYWxrZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKwnSUJXcL5GUDuW5zpZGsL+kXU83+/jVcgJKJXoIyQY5KPogU3OTP5cISqtww5xtt62Wfj9FGk6AP+kWhKlKUt6OC5C6DnUQEeeaW3/aNpfElyKDdhhZb2U+GxuPp4XBGTFmacVRdfSyhmSWmRvg/T0ivwgqvJklazxKa415AIXAgMBAAGjezB5MAkGA1UdEwQCMAAwHQYDVR0OBBYEFO23I9G5OSEknr7injBvzdss5A3vMB8GA1UdIwQYMBaAFNa3YmhDO7BOwbUqmYU1k/U6p/UUMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTANBgkqhkiG9w0BAQUFAAOBgQBn1hHAfzJAFGW34WWtsxqzWAD1Lzo7yLiuG0dQE3BjDEmi7qNGlrUFrjUYLbRbi8lBHDDT08hew/6HvjygtZYTJRavgqGfJpjlVUSi+eTQkx4ZlDLYPaxKbAoAquExsrBEZt7NBKMhGgA05ZkclpGeGinR6TpaxonLJDZYHMo7pnlsI818wifToBG2+eaHZetxNl3J > muyservice.jks
Retrieve secrets using Annotations:
You can apply the below annotation to retrieve and decode the secret
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/agent-inject-secret-sec: "kv/secret"
vault.hashicorp.com/tls-skip-verify: "true"
vault.hashicorp.com/role: "webapp"
vault.hashicorp.com/agent-inject-file-sec: "myservice.jks"
vault.hashicorp.com/agent-pre-populate-only: "true"
vault.hashicorp.com/agent-inject-template-sec:"{{- with secret \"kv/secret\" -}}{{ base64Decode .Data.data.apigeeenvcertificate }}{{- end }}"