Skip to content

Commit

Permalink
Merge branch '43934-dev-2.0.0' into combine_chain_certs
Browse files Browse the repository at this point in the history
  • Loading branch information
joevanwanzeeleKF committed Jun 21, 2023
2 parents 2440362 + 7f9eecb commit 6f56a64
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -34,13 +26,8 @@ The Keyfactor Universal Orchestrator may be installed on either Windows or Linux
|Supports Renrollment| | |
|Supports Inventory|✓ |✓ |





---


<!-- add integration specific information below -->

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.
Expand Down
9 changes: 7 additions & 2 deletions hashicorp-vault-orchestrator/HcvKeyValueClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -84,7 +86,8 @@ public async Task<CurrentInventoryItem> GetCertificate(string key)
Dictionary<string, object> certData;
Secret<SecretData> res;
var fullPath = _storePath + key;

var relativePath = fullPath.Substring(_storePath.Length);

try
{
try
Expand All @@ -101,6 +104,7 @@ public async Task<CurrentInventoryItem> GetCertificate(string key)
catch (Exception ex)
{
logger.LogError($"Error getting certificate {fullPath}", ex);

return null;
}

Expand Down Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion hashicorp-vault-orchestrator/HcvKeyfactorClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task<CurrentInventoryItem> GetCertificate(string key)
req.Method = WebRequestMethods.Http.Get;
var res = await req.GetResponseAsync();
CertResponse content = JsonConvert.DeserializeObject<CertResponse>(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);
Expand Down Expand Up @@ -90,6 +90,7 @@ public async Task<CurrentInventoryItem> GetCertificate(string key)
catch (Exception ex)
{
logger.LogWarning($"Error getting certificate \"{fullPath}\" from Vault", ex);

return null;
}
}
Expand Down

0 comments on commit 6f56a64

Please sign in to comment.