exportable=true option does not work for /transit/keys secrets engine
@vishalnayak @joelthompson @chrishoffman Nothing seems to happen if I run the following command curl --header "X-Vault-Token: d522d84b-456c-3ca8-810e-a6680b7232eb" --data @/home/ubuntu/payload.json http://127.0.0.1:8200/v1/transit/keys/my-key
It seems to work If I omit the --data parameter, curl --header "X-Vault-Token: d522d84b-456c-3ca8-810e-a6680b7232eb" http://127.0.0.1:8200/v1/transit/keys/my-key
{"request_id":"cab2a736-8f30-4c51-3207-ba0f44bba08c","lease_id":"","renewable":false,"lease_duration":0,"data":{"allow_plaintext_backup":false,"deletion_allowed":false,"derived":false,"exportable":false,"keys":{"1":1520319120},"latest_version":1,"min_decryption_version":1,"min_encryption_version":0,"name":"my-key","supports_decryption":true,"supports_derivation":true,"supports_encryption":true,"supports_signing":false,"type":"aes256-gcm96"},"wrap_info":null,"warnings":null,"auth":null}
cat payload.json { "exportable": true }
I am hoping to view the encryption key that is generated by the transit secrets engine.
What am I doing wrong here ?
Or is it generating the key and I am misunderstanding the 'exportable' option ? If so, where can I view it ?
My storage backed is a file directory on local disk.
vault status
Key Value
Seal Type shamir Sealed false Total Shares 5 Threshold 3 Version 0.9.5 Cluster Name vault-cluster-7b09b594 Cluster ID e97db638-8867-4456-c515-293d0b6dc0ba
for key export there is a different path which is transit/export/encryption-key/$keyname, while also i can see that you are not using the --request in your curl command to set whether its a GET, POST or any other api call. I hope this will help you.
@daniyalsuri is correct, you need to use the export path.