-
Notifications
You must be signed in to change notification settings - Fork 4
Merge 3.2.2 to main #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
a225e59
85e3cf0
119503c
5589d33
f796164
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,6 +22,8 @@ | |||||||||||
| using Keyfactor.Orchestrators.Common.Enums; | ||||||||||||
| using Keyfactor.Orchestrators.Extensions; | ||||||||||||
| using Microsoft.Extensions.Logging; | ||||||||||||
| using Microsoft.VisualBasic; | ||||||||||||
| using Newtonsoft.Json; | ||||||||||||
|
|
||||||||||||
| namespace Keyfactor.Extensions.Orchestrator.AzureKeyVault | ||||||||||||
| { | ||||||||||||
|
|
@@ -38,8 +40,6 @@ private Uri AzureCloudEndpoint | |||||||||||
| case "china": | ||||||||||||
| logger.LogTrace(AzureAuthorityHosts.AzureChina.ToString()); | ||||||||||||
| return AzureAuthorityHosts.AzureChina; | ||||||||||||
| //case "germany": | ||||||||||||
| // return AzureAuthorityHosts.AzureGermany; // germany is no longer a valid azure authority host as of 2021 | ||||||||||||
| case "government": | ||||||||||||
| logger.LogTrace(AzureAuthorityHosts.AzureGovernment.ToString()); | ||||||||||||
| return AzureAuthorityHosts.AzureGovernment; | ||||||||||||
|
|
@@ -199,7 +199,7 @@ public virtual async Task<KeyVaultResource> CreateVault() | |||||||||||
| } | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| public virtual async Task<KeyVaultCertificateWithPolicy> ImportCertificateAsync(string certName, string contents, string pfxPassword, Dictionary<string,string> tags) | ||||||||||||
| public virtual async Task<KeyVaultCertificateWithPolicy> ImportCertificateAsync(string certName, string contents, string pfxPassword, Dictionary<string, string> tags, bool nonExportable) | ||||||||||||
| { | ||||||||||||
| try | ||||||||||||
| { | ||||||||||||
|
|
@@ -221,6 +221,7 @@ public virtual async Task<KeyVaultCertificateWithPolicy> ImportCertificateAsync( | |||||||||||
| logger.LogTrace($"calling ImportCertificateAsync on the KeyVault certificate client to import certificate {certName}"); | ||||||||||||
|
|
||||||||||||
| var options = new ImportCertificateOptions(certName, p12bytes); | ||||||||||||
| options.Policy = new CertificatePolicy { Exportable = !nonExportable, ContentType = CertificateContentType.Pkcs12 }; | ||||||||||||
|
|
||||||||||||
| if (tags.Any()) | ||||||||||||
| { | ||||||||||||
|
|
@@ -303,15 +304,31 @@ public virtual async Task<IEnumerable<CurrentInventoryItem>> GetCertificatesAsyn | |||||||||||
| { | ||||||||||||
| var cert = await CertClient.GetCertificateAsync(certificate.Name); | ||||||||||||
| logger.LogTrace($"got certificate details"); | ||||||||||||
| logger.LogTrace($"cert properties: {JsonConvert.SerializeObject(cert.Value?.Properties)}"); | ||||||||||||
| var itemEntryParams = new Dictionary<string, object>(); | ||||||||||||
|
|
||||||||||||
| if (cert.Value?.Properties?.Tags != null && cert.Value.Properties.Tags.Count > 0) { // set tags entry parameter to value | ||||||||||||
| itemEntryParams.Add(EntryParameters.TAGS, JsonConvert.SerializeObject(cert.Value.Properties.Tags)); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| if (cert.Value.Policy != null) // set nonexportable entry parameter to value | ||||||||||||
| { | ||||||||||||
| var exportable = cert.Value.Policy?.Exportable; | ||||||||||||
| itemEntryParams.Add(EntryParameters.NON_EXPORTABLE, !exportable); | ||||||||||||
|
||||||||||||
| itemEntryParams.Add(EntryParameters.NON_EXPORTABLE, !exportable); | |
| if (exportable.HasValue) | |
| { | |
| itemEntryParams.Add(EntryParameters.NON_EXPORTABLE, !exportable.Value); | |
| } |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -17,26 +17,27 @@ | |||
| </PropertyGroup> | ||||
|
|
||||
| <ItemGroup> | ||||
| <PackageReference Include="Azure.Core" Version="1.45.0" /> | ||||
| <PackageReference Include="Azure.Identity" Version="1.13.2" /> | ||||
| <PackageReference Include="Azure.ResourceManager" Version="1.13.0" /> | ||||
| <PackageReference Include="Azure.ResourceManager.KeyVault" Version="1.3.0" /> | ||||
| <PackageReference Include="Azure.ResourceManager.Resources" Version="1.9.0" /> | ||||
| <PackageReference Include="Azure.Security.KeyVault.Administration" Version="4.5.0" /> | ||||
| <PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.7.0" /> | ||||
| <PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.7.0" /> | ||||
| <PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" /> | ||||
| <PackageReference Include="Azure.Core" Version="1.51.1" /> | ||||
| <PackageReference Include="Azure.Identity" Version="1.17.1" /> | ||||
| <PackageReference Include="Azure.ResourceManager" Version="1.13.2" /> | ||||
| <PackageReference Include="Azure.ResourceManager.KeyVault" Version="1.3.3" /> | ||||
| <PackageReference Include="Azure.ResourceManager.Resources" Version="1.11.2" /> | ||||
| <PackageReference Include="Azure.Security.KeyVault.Administration" Version="4.6.0" /> | ||||
| <PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.8.0" /> | ||||
| <PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.8.0" /> | ||||
| <PackageReference Include="Azure.Storage.Blobs" Version="12.27.0" /> | ||||
| <PackageReference Include="BouncyCastle.NetCore" Version="2.2.1" /> | ||||
| <PackageReference Include="Keyfactor.Logging" Version="1.1.2" /> | ||||
| <PackageReference Include="Keyfactor.Orchestrators.Common" Version="3.2.0" /> | ||||
| <PackageReference Include="Keyfactor.Logging" Version="1.3.0" /> | ||||
| <PackageReference Include="Keyfactor.Orchestrators.Common" Version="3.3.0" /> | ||||
| <PackageReference Include="Keyfactor.Orchestrators.IOrchestratorJobExtensions" Version="1.0.0" /> | ||||
| <PackageReference Include="Keyfactor.Platform.IPAMProvider" Version="1.0.0" /> | ||||
| <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" /> | ||||
| <PackageReference Include="Microsoft.Identity.Client" Version="4.68.0" /> | ||||
| <PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.68.0" /> | ||||
| <PackageReference Include="System.Drawing.Common" Version="9.0.2" /> | ||||
| <PackageReference Include="Microsoft.Identity.Client" Version="4.82.1" /> | ||||
| <PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.82.1" /> | ||||
| <PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.3" /> | ||||
|
||||
| <PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.3" /> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,7 +17,6 @@ | |||||
| using Keyfactor.Orchestrators.Extensions.Interfaces; | ||||||
| using System.Collections.Generic; | ||||||
| using Newtonsoft.Json; | ||||||
| using System.Security.AccessControl; | ||||||
|
|
||||||
| namespace Keyfactor.Extensions.Orchestrator.AzureKeyVault | ||||||
| { | ||||||
|
|
@@ -46,11 +45,13 @@ public JobResult ProcessJob(ManagementJobConfiguration config) | |||||
|
|
||||||
| string tagsJSON; | ||||||
| bool preserveTags; | ||||||
| bool nonExportable; | ||||||
|
|
||||||
| logger.LogTrace("parsing entry parameters.. "); | ||||||
|
|
||||||
| tagsJSON = config.JobProperties[EntryParameters.TAGS] as string ?? string.Empty; | ||||||
| preserveTags = config.JobProperties[EntryParameters.PRESERVE_TAGS] as bool? ?? false; | ||||||
| preserveTags = config.JobProperties[EntryParameters.PRESERVE_TAGS] as bool? ?? true; | ||||||
|
||||||
| preserveTags = config.JobProperties[EntryParameters.PRESERVE_TAGS] as bool? ?? true; | |
| preserveTags = config.JobProperties[EntryParameters.PRESERVE_TAGS] as bool? ?? false; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,17 @@ | ||
| - 3.2.2 | ||
| - Updated screenshots in README | ||
| - Returning entry parameters along with inventory | ||
|
|
||
| - 3.2.1 | ||
| - Documentation updates and improvements | ||
| - Updated NuGet packages | ||
|
|
||
| - 3.2.0 | ||
| - Added an optional entry parameter to indicate whether the private key of the cert should be not exportable when stored in KeyVault | ||
| - Now specifying the pkcs12 format when wirting certs to Azure KeyVault. This should prevent the error when a PEM cert was added outside of Command and then we attempt to update without specifying the format (Azure assumes PEM and throws an error if not). | ||
|
|
||
|
Comment on lines
+8
to
+11
|
||
| - 3.1.9 | ||
| - Added optional entry parameter to indicate that existing tags should be preserved if certificate is replaced | ||
| - bug fix for government cloud host name resolution | ||
|
|
||
| - 3.1.8 | ||
| - Fixed bug where enrollment would fail if the CertificateTags field was not defined as an entry parameter | ||
|
|
@@ -11,7 +22,6 @@ | |
| - Added support for Azure KeyVault Certificate Metadata via Entry Parameters | ||
| - Fixed issue where an error would be returned during Inventory if 0 certificates were found | ||
| - Converted to BouncyCastle crypto libraries | ||
|
|
||
|
|
||
| - 3.1.6 | ||
| - Preventing CertStore parameters from getting used if present but empty. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused
using Microsoft.VisualBasic;appears to have been added but nothing in this file references it. Please remove the unused import to avoid unnecessary dependencies and compiler warnings.