diff --git a/CHANGELOG.md b/CHANGELOG.md index fc49f36..f67f1d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,5 +17,4 @@ * **Breaking Change**: the cert store types are now: * **HCVPKI** for the PKI and Keyfactor secrets engine - * **HCVKV** for the Key-Value secrets engine - + * **HCVKV** for the Key-Value secrets engine \ No newline at end of file diff --git a/README.md b/README.md index 73c6275..d4e5f73 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ The Hashicorp Vault Orchestrator extension allows you store certificates in Hash #### Integration status: Production - Ready for use in production environments. - ## About the Keyfactor Universal Orchestrator Extension This repository contains a Universal Orchestrator Extension which is a plugin to the Keyfactor Universal Orchestrator. Within the Keyfactor Platform, Orchestrators are used to manage “certificate stores” — collections of certificates and roots of trust that are found within and used by various applications. @@ -13,15 +12,8 @@ The Universal Orchestrator is part of the Keyfactor software distribution and is The Universal Orchestrator is the successor to the Windows Orchestrator. This Orchestrator Extension plugin only works with the Universal Orchestrator and does not work with the Windows Orchestrator. - - - - --- - - - ## Platform Specific Notes The Keyfactor Universal Orchestrator may be installed on either Windows or Linux based platforms. The certificate operations supported by a capability may vary based what platform the capability is installed on. The table below indicates what capabilities are supported based on which platform the encompassing Universal Orchestrator is running. @@ -34,13 +26,8 @@ The Keyfactor Universal Orchestrator may be installed on either Windows or Linux |Supports Renrollment| | | |Supports Inventory|✓ |✓ | - - - - --- - This integration for the Keyfactor Universal Orchestrator has been tested against Hashicorp Vault 1.10. It utilizes the **Key/Value** secrets engine to store certificates issues via Keyfactor Command. diff --git a/hashicorp-vault-orchestrator/HcvKeyValueClient.cs b/hashicorp-vault-orchestrator/HcvKeyValueClient.cs index 44bd24c..d7ee988 100644 --- a/hashicorp-vault-orchestrator/HcvKeyValueClient.cs +++ b/hashicorp-vault-orchestrator/HcvKeyValueClient.cs @@ -35,7 +35,9 @@ public class HcvKeyValueClient : IHashiClient private string _storePath { get; set; } private string _mountPoint { get; set; } - private bool _subfolderInventory { get; set; } + private bool _subfolderInventory { get; set; } + + //private VaultClientSettings clientSettings { get; set; } public HcvKeyValueClient(string vaultToken, string serverUrl, string mountPoint, string storePath, bool SubfolderInventory = false) { @@ -84,7 +86,8 @@ public async Task GetCertificate(string key) Dictionary certData; Secret res; var fullPath = _storePath + key; - + var relativePath = fullPath.Substring(_storePath.Length); + try { try @@ -101,6 +104,7 @@ public async Task GetCertificate(string key) catch (Exception ex) { logger.LogError($"Error getting certificate {fullPath}", ex); + return null; } @@ -230,6 +234,7 @@ public async Task PutCertificate(string certName, string contents, string pfxPas streamWriter.Flush(); privateKeyString = Encoding.ASCII.GetString(memoryStream.GetBuffer()).Trim() .Replace("\r", "").Replace("\0", ""); + logger.LogTrace($"Got Private Key String"); memoryStream.Close(); streamWriter.Close(); diff --git a/hashicorp-vault-orchestrator/HcvKeyfactorClient.cs b/hashicorp-vault-orchestrator/HcvKeyfactorClient.cs index 3e7f073..33be1d8 100644 --- a/hashicorp-vault-orchestrator/HcvKeyfactorClient.cs +++ b/hashicorp-vault-orchestrator/HcvKeyfactorClient.cs @@ -55,7 +55,7 @@ public async Task GetCertificate(string key) req.Method = WebRequestMethods.Http.Get; var res = await req.GetResponseAsync(); CertResponse content = JsonConvert.DeserializeObject(new StreamReader(res.GetResponseStream()).ReadToEnd()); - + content.data.TryGetValue("certificate", out object cert); content.data.TryGetValue("ca_chain", out object caChain); content.data.TryGetValue("private_key", out object privateKey); @@ -90,6 +90,7 @@ public async Task GetCertificate(string key) catch (Exception ex) { logger.LogWarning($"Error getting certificate \"{fullPath}\" from Vault", ex); + return null; } }