vault icon indicating copy to clipboard operation
vault copied to clipboard

exportable=true option does not work for /transit/keys secrets engine

Open RohanKurane opened this issue 8 years ago • 2 comments

@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

RohanKurane avatar Mar 06 '18 07:03 RohanKurane

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 avatar Mar 07 '18 12:03 daniyalsuri

@daniyalsuri is correct, you need to use the export path.

jefferai avatar Mar 08 '18 18:03 jefferai