Add KMIP to test suite, containerized PyKMIP tests#28
Add KMIP to test suite, containerized PyKMIP tests#28cipherboy wants to merge 2 commits intoopenbao:mainfrom
Conversation
Signed-off-by: Alexander Scheel <ascheel@gitlab.com>
PyKMIP only supports AES keys at the moment. Signed-off-by: Alexander Scheel <ascheel@gitlab.com>
|
Hum, EOF can have many reasons. Most of the time it's ther server rejecting the client tls certs. How did you generate the certificates ? Do you have some PyKMIP logs ? |
|
Using this script https://github.com/OpenKMIP/PyKMIP/blob/6cd44b572b0ca55adf01a8a12078b2284602e64c/bin/create_certificates.py helped a lot |
|
Could also be a TLS cipher mismatch. I didn't recall exactly if you should get a specific error message or just EOF in that case, but PyKMIP logs would have more details. I'll give it a try |
|
@cipherboy I've been playing withit, here's what I did to make it work :
|
|
FYI, you can save the created key id in a var easily by appending to your command Then you'll need to activate the key with |
|
Alternatively you can easily script the key creation with the following snippet kmipClient, err := kmipclient.Dial(
os.Getenv("BAO_KMIP_ENDPOINT"),
kmipclient.WithClientCertFiles(os.Getenv("BAO_KMIP_CLIENT_CERT"), os.Getenv("BAO_KMIP_CLIENT_KEY")),
kmipclient.WithServerName(os.Getenv("BAO_KMIP_SERVER_NAME")),
kmipclient.WithRootCAFile(os.Getenv("BAO_KMIP_CA_CERT")),
kmipclient.WithTlsCipherSuiteNames(strings.Split(os.Getenv("BAO_KMIP_TLS12_CIPHERS", ","))),
)
if err != nil {
t.Fatalf("err : %s", err)
}
defer kmipClient.Close()
keyID := kmipClient.Create().
AES(256, kmip.CryptographicUsageEncrypt|kmip.CryptographicUsageDecrypt).
WithName("bao_seal_key").MustExec().UniqueIdentifier
kmipClient.Activate(keyID).MustExec() |
Currently this fails with:
In particular, it looks like something is wrong with the OVH KMIP CLI config.. perhaps?
cc: @phsym