Skip to content

Commit 72b2674

Browse files
authored
Merge 89e39ae into 0b2d104
2 parents 0b2d104 + 89e39ae commit 72b2674

24 files changed

+674
-437
lines changed

.github/workflows/keyfactor-starter-workflow.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ on:
1111

1212
jobs:
1313
call-starter-workflow:
14-
uses: keyfactor/actions/.github/workflows/starter.yml@3.1.2
14+
uses: keyfactor/actions/.github/workflows/starter.yml@v4
15+
with:
16+
command_token_url: ${{ vars.COMMAND_TOKEN_URL }} # Only required for doctool generated screenshots
17+
command_hostname: ${{ vars.COMMAND_HOSTNAME }} # Only required for doctool generated screenshots
18+
command_base_api_path: ${{ vars.COMMAND_API_PATH }} # Only required for doctool generated screenshots
1519
secrets:
16-
token: ${{ secrets.V2BUILDTOKEN}}
17-
APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}}
18-
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
19-
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
20-
scan_token: ${{ secrets.SAST_TOKEN }}
20+
token: ${{ secrets.V2BUILDTOKEN}} # REQUIRED
21+
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} # Only required for golang builds
22+
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} # Only required for golang builds
23+
scan_token: ${{ secrets.SAST_TOKEN }} # REQUIRED
24+
entra_username: ${{ secrets.DOCTOOL_ENTRA_USERNAME }} # Only required for doctool generated screenshots
25+
entra_password: ${{ secrets.DOCTOOL_ENTRA_PASSWD }} # Only required for doctool generated screenshots
26+
command_client_id: ${{ secrets.COMMAND_CLIENT_ID }} # Only required for doctool generated screenshots
27+
command_client_secret: ${{ secrets.COMMAND_CLIENT_SECRET }} # Only required for doctool generated screenshots

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2.6.3
2+
* Fixed re-enrollment or ODKG job when RDN Components contained escaped commas.
3+
* Updated renewal job for IIS Certs to delete the old cert if not bound or used by other web sites.
4+
* Improved Inventory reporting of CSP when cert uses newer CNG Keys.
5+
* Fixed an issue with complex PFX passwords that contained special characters such as '@' or '$', etc.
6+
* Fixed an issue when adding certificate to store, sometimes the wrong thumbprint was returned, thus breaking web site binding.
7+
* Removed the IIS bindings check. Now bindings are handled similar to IIS - if you bind a cert to a site using the same bindings, you risk the possibility of one of the duplicate sites to stop working and the certificate being bound to either site. Refer to IIS Documentation pertaining to HTTPS binding.
8+
* Fixed an issue with (remote) ODKG jobs that caused an error when the CSP was not specified that included bindings.
9+
* Fixed an issue with (remote) ODKG jobs that caused an error when the CSP was not specified that did not require binding.
10+
111
2.6.2
212
* Fixed error when attempting to connect to remote computer using UO service account
313
* Fixed error when connecting to remote computer using HTTPS; was defaulting to HTTP

IISU/ClientPSCertStoreReEnrollment.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,17 @@ public JobResult PerformReEnrollment(ReenrollmentJobConfiguration config, Submit
208208
FailureMessage = ""
209209
};
210210

211+
break;
212+
213+
case CertStoreBindingTypeENUM.None:
214+
215+
jobResult = new JobResult
216+
{
217+
Result = OrchestratorJobStatusJobResult.Success,
218+
JobHistoryId = config.JobHistoryId,
219+
FailureMessage = ""
220+
};
221+
211222
break;
212223
}
213224
}

IISU/ImplementedStoreTypes/Win/Inventory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public JobResult ProcessJob(InventoryJobConfiguration jobConfiguration, SubmitIn
9393
{
9494
Result = OrchestratorJobStatusJobResult.Success,
9595
JobHistoryId = jobConfiguration.JobHistoryId,
96-
FailureMessage = ""
96+
FailureMessage = $"Inventory completed returning {inventoryItems.Count} Items."
9797
};
9898
}
9999

IISU/ImplementedStoreTypes/WinIIS/Inventory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public JobResult ProcessJob(InventoryJobConfiguration jobConfiguration, SubmitIn
9595
{
9696
Result = OrchestratorJobStatusJobResult.Success,
9797
JobHistoryId = jobConfiguration.JobHistoryId,
98-
FailureMessage = ""
98+
FailureMessage = $"Inventory completed returning {inventoryItems.Count} Items."
9999
};
100100
}
101101

IISU/ImplementedStoreTypes/WinIIS/Management.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using System;
1717
using System.Collections.Generic;
1818
using System.Collections.ObjectModel;
19+
using System.Linq;
1920
using System.Management.Automation;
2021
using Keyfactor.Extensions.Orchestrator.WindowsCertStore.Models;
2122
using Keyfactor.Logging;
@@ -89,6 +90,7 @@ public JobResult ProcessJob(ManagementJobConfiguration config)
8990
string protocol = jobProperties?.WinRmProtocol;
9091
string port = jobProperties?.WinRmPort;
9192
bool includePortInSPN = (bool)jobProperties?.SpnPortFlag;
93+
string alias = config.JobCertificate?.Alias?.Split(':').FirstOrDefault() ?? string.Empty; // Thumbprint is first part of the alias
9294

9395
_psHelper = new(protocol, port, includePortInSPN, _clientMachineName, serverUserName, serverPassword);
9496

@@ -171,6 +173,14 @@ public JobResult ProcessJob(ManagementJobConfiguration config)
171173
psResult = OrchestratorJobStatusJobResult.Unknown;
172174
}
173175

176+
// Only is the binding returns successful, check of original cert is still bound to any site, if not remove it from the store
177+
if (psResult == OrchestratorJobStatusJobResult.Success && !string.IsNullOrEmpty(alias))
178+
{
179+
_logger.LogTrace("Attempting to remove original certificate from store if it is no longer bound to any site.");
180+
RemoveIISCertificate(alias);
181+
_logger.LogTrace("Returned from removing cert if not used.");
182+
}
183+
174184
complete = new JobResult
175185
{
176186
Result = psResult,

IISU/ImplementedStoreTypes/WinSQL/Inventory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public JobResult ProcessJob(InventoryJobConfiguration jobConfiguration, SubmitIn
9393
{
9494
Result = OrchestratorJobStatusJobResult.Success,
9595
JobHistoryId = jobConfiguration.JobHistoryId,
96-
FailureMessage = ""
96+
FailureMessage = $"Inventory completed returning {inventoryItems.Count} Items."
9797
};
9898
}
9999

IISU/PSHelper.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public Collection<PSObject> ExecutePowerShellScript(string script)
386386
}
387387

388388
// Add Parameters if provided
389-
if (parameters != null)
389+
if (parameters != null && parameters.Count > 0)
390390
{
391391
if (isLocalMachine || isScript)
392392
{
@@ -398,13 +398,18 @@ public Collection<PSObject> ExecutePowerShellScript(string script)
398398
else
399399
{
400400
// Remote execution: Use ArgumentList for parameters
401-
var paramBlock = string.Join(", ", parameters.Select(p => $"[{p.Value.GetType().Name}] ${p.Key}"));
401+
var paramBlock = string.Join(", ", parameters.Select(p =>
402+
{
403+
string typeName = p.Value?.GetType().Name ?? "object";
404+
return $"[{typeName}] ${p.Key}";
405+
}));
406+
402407
var paramUsage = string.Join(" ", parameters.Select(p => $"-{p.Key} ${p.Key}"));
403408

404409
string scriptBlockWithParams = $@"
405-
param({paramBlock})
406-
{commandOrScript} {paramUsage}
407-
";
410+
param({paramBlock})
411+
{commandOrScript} {paramUsage}
412+
";
408413

409414
PS.Commands.Clear(); // Clear previous commands
410415
PS.AddCommand("Invoke-Command")

0 commit comments

Comments
 (0)