Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions IISU/ClientPSCertStoreReEnrollment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinIIS;
using Keyfactor.Logging;
using Keyfactor.Orchestrators.Common.Enums;
using Keyfactor.Orchestrators.Extensions;
Expand All @@ -34,8 +33,8 @@ namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore
{
internal class ClientPSCertStoreReEnrollment
{
private ILogger _logger;
private IPAMSecretResolver _resolver;
private readonly ILogger _logger;
private readonly IPAMSecretResolver _resolver;

public ClientPSCertStoreReEnrollment(ILogger logger, IPAMSecretResolver resolver)
{
Expand All @@ -59,8 +58,10 @@ public JobResult PerformReEnrollment(ReenrollmentJobConfiguration config, Submit
JobProperties properties = JsonConvert.DeserializeObject<JobProperties>(config.CertificateStoreDetails.Properties,
new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Populate });

WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri($"{properties?.WinRmProtocol}://{config.CertificateStoreDetails.ClientMachine}:{properties?.WinRmPort}/wsman"));
connectionInfo.IncludePortInSPN = properties.SpnPortFlag;
WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri($"{properties?.WinRmProtocol}://{config.CertificateStoreDetails.ClientMachine}:{properties?.WinRmPort}/wsman"))
{
IncludePortInSPN = properties.SpnPortFlag
};
var pw = new NetworkCredential(serverUserName, serverPassword).SecurePassword;
_logger.LogTrace($"Credentials: UserName:{serverUserName}");

Expand Down Expand Up @@ -91,7 +92,7 @@ public JobResult PerformReEnrollment(ReenrollmentJobConfiguration config, Submit
Collection<PSObject> results;

// If the provider name is null, default it to the Microsoft CA
if (providerName == null) providerName = "Microsoft Strong Cryptographic Provider";
providerName ??= "Microsoft Strong Cryptographic Provider";

// Create the script file
ps.AddScript("$infFilename = New-TemporaryFile");
Expand Down
2 changes: 1 addition & 1 deletion IISU/ClientPSIIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public ClientPSIIManager(ReenrollmentJobConfiguration config, string serverUsern
Port = config.JobProperties["Port"].ToString();
HostName = config.JobProperties["HostName"]?.ToString();
Protocol = config.JobProperties["Protocol"].ToString();
SniFlag = config.JobProperties["SniFlag"].ToString()?.Substring(0, 1);
SniFlag = config.JobProperties["SniFlag"]?.ToString()[..1];
IPAddress = config.JobProperties["IPAddress"].ToString();

PrivateKeyPassword = ""; // A reenrollment does not have a PFX Password
Expand Down
2 changes: 1 addition & 1 deletion IISU/ImplementedStoreTypes/Win/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.Win
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinCert
{
public class Inventory : WinCertJobTypeBase, IInventoryJobExtension
{
Expand Down
2 changes: 1 addition & 1 deletion IISU/ImplementedStoreTypes/Win/Management.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using System.Net;
using Keyfactor.Logging;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.Win
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinCert
{
public class Management : WinCertJobTypeBase, IManagementJobExtension
{
Expand Down
2 changes: 1 addition & 1 deletion IISU/ImplementedStoreTypes/Win/ReEnrollment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using Keyfactor.Orchestrators.Extensions.Interfaces;
using Microsoft.Extensions.Logging;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.Win
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinCert
{
public class ReEnrollment : WinCertJobTypeBase, IReenrollmentJobExtension
{
Expand Down
2 changes: 1 addition & 1 deletion IISU/ImplementedStoreTypes/Win/WinInventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using System.Management.Automation.Runspaces;
using System.Text;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.Win
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinCert
{
internal class WinInventory : ClientPSCertStoreInventory
{
Expand Down
6 changes: 3 additions & 3 deletions IISU/ImplementedStoreTypes/WinIIS/IISManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinIIS
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.IISU
{
public class IISManager
{
Expand Down Expand Up @@ -66,7 +66,7 @@ public IISManager(ReenrollmentJobConfiguration config, string serverUserName, st
Port = config.JobProperties["Port"].ToString();
HostName = config.JobProperties["HostName"]?.ToString();
Protocol = config.JobProperties["Protocol"].ToString();
SniFlag = config.JobProperties["SniFlag"].ToString()?.Substring(0, 1);
SniFlag = config.JobProperties["SniFlag"].ToString()?[..1];
IpAddress = config.JobProperties["IPAddress"].ToString();

PrivateKeyPassword = ""; // A reenrollment does not have a PFX Password
Expand Down Expand Up @@ -105,7 +105,7 @@ public IISManager(ManagementJobConfiguration config, string serverUserName, stri
Port = config.JobProperties["Port"].ToString();
HostName = config.JobProperties["HostName"]?.ToString();
Protocol = config.JobProperties["Protocol"].ToString();
SniFlag = config.JobProperties["SniFlag"].ToString()?.Substring(0, 1);
SniFlag = config.JobProperties["SniFlag"].ToString()?[..1];
IpAddress = config.JobProperties["IPAddress"].ToString();

PrivateKeyPassword = config.JobCertificate.PrivateKeyPassword;
Expand Down
2 changes: 1 addition & 1 deletion IISU/ImplementedStoreTypes/WinIIS/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinIIS
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.IISU
{
public class Inventory : WinCertJobTypeBase, IInventoryJobExtension
{
Expand Down
6 changes: 1 addition & 5 deletions IISU/ImplementedStoreTypes/WinIIS/Management.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@
using Microsoft.PowerShell.Commands;
using Newtonsoft.Json;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinIIS
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.IISU
{
public class Management : WinCertJobTypeBase, IManagementJobExtension
{
private ILogger _logger;

public string ExtensionName => string.Empty;

private string _thumbprint = string.Empty;

private Runspace myRunspace;

public Management(IPAMSecretResolver resolver)
Expand Down Expand Up @@ -139,8 +137,6 @@ private JobResult PerformRemoveCertificate(ManagementJobConfiguration config, st
{
_logger.LogTrace("Before Remove Certificate...");

string certificateContents = config.JobCertificate.Contents;
string privateKeyPassword = config.JobCertificate.PrivateKeyPassword;
string storePath = config.CertificateStoreDetails.StorePath;
long jobNumber = config.JobHistoryId;

Expand Down
2 changes: 1 addition & 1 deletion IISU/ImplementedStoreTypes/WinIIS/ReEnrollment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using Keyfactor.Orchestrators.Extensions.Interfaces;
using Microsoft.Extensions.Logging;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinIIS
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.IISU
{
public class ReEnrollment: WinCertJobTypeBase, IReenrollmentJobExtension
{
Expand Down
2 changes: 1 addition & 1 deletion IISU/ImplementedStoreTypes/WinIIS/WinIISInventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System.Management.Automation.Runspaces;
using System.Text;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinIIS
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.IISU
{
internal class WinIISInventory : ClientPSCertStoreInventory
{
Expand Down
1 change: 1 addition & 0 deletions IISU/WindowsCertStore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</ItemGroup>

<ItemGroup>
<Compile Remove="ImplementedStoreTypes\WinIIS\IISManager.cs" />
<Compile Remove="PowerShellCertRequest.cs" />
</ItemGroup>

Expand Down
24 changes: 12 additions & 12 deletions IISU/manifest.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"extensions": {
"Keyfactor.Orchestrators.Extensions.IOrchestratorJobExtension": {
"CertStores.WinIIS.Inventory": {
"CertStores.IISU.Inventory": {
"assemblypath": "WindowsCertStore.dll",
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinIIS.Inventory"
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.IISU.Inventory"
},
"CertStores.WinIIS.Management": {
"CertStores.IISU.Management": {
"assemblypath": "WindowsCertStore.dll",
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinIIS.Management"
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.IISU.Management"
},
"CertStores.WinIIS.ReEnrollment": {
"CertStores.IISU.ReEnrollment": {
"assemblypath": "WindowsCertStore.dll",
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinIIS.ReEnrollment"
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.IISU.ReEnrollment"
},
"CertStores.Win.Inventory": {
"CertStores.WinCert.Inventory": {
"assemblypath": "WindowsCertStore.dll",
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.Win.Inventory"
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinCert.Inventory"
},
"CertStores.Win.Management": {
"CertStores.WinCert.Management": {
"assemblypath": "WindowsCertStore.dll",
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.Win.Management"
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinCert.Management"
},
"CertStores.Win.ReEnrollment": {
"CertStores.WinCert.ReEnrollment": {
"assemblypath": "WindowsCertStore.dll",
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.Win.ReEnrollment"
"TypeFullName": "Keyfactor.Extensions.Orchestrator.WindowsCertStore.WinCert.ReEnrollment"
}
}
}
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ In version 2.0 of the IIS Orchestrator, the certificate store type has been rena

**Note: There is an additional certificate store type of “IIS” that ships with the Keyfactor platform. Migration of certificate stores from the “IIS” type to either the “IISBin” or “IISU” types is not currently supported.**

**Note: In version 3.0, the orchestrator has been renamed from IISU to WinCert. There is currently no succession process to update previous certificate store types.**


**1. Create the New Certificate Store Type**

Expand All @@ -122,9 +120,9 @@ In Keyfactor Command create a new Certificate Store Type similar to the one belo

CONFIG ELEMENT | DESCRIPTION
------------------|------------------
Name |A descriptive name for the extension. Example: WinCert (for general windows cert store), WinIIS (for IIS Webstore cert store)
Short Name |The short name that identifies the registered functionality of the orchestrator. Currently must be either Win or WinIIS
Custom Capability|Store type name orchestrator will register with. Currently must be Win or WinIIS.
Name |A descriptive name for the extension. Example: WinCert (for general windows cert store), IISU (for IIS Webstore cert store with bindings)
Short Name |The short name that identifies the registered functionality of the orchestrator. Currently must be either WinCert or IISU
Custom Capability|Store type name orchestrator will register with. Currently must be WinCert or IISU.
Job Types |Inventory (Checked), Add, Remove, and Reenrollment are the supported job types.
General Settings|Needs Server - Checked<br>Blueprint Allowed - Unchecked<br>Uses PowerShell - Unchecked
Requires Store Password |Determines if a store password is required when configuring an individual store. This must be unchecked.
Expand Down Expand Up @@ -201,7 +199,7 @@ See Keyfactor InstallingKeyfactorOrchestrators.pdf Documentation. Get from your

**3a. Create an IIS Binding Certificate Store within Keyfactor Command**

In Keyfactor Command create a new Certificate Store similar to the one below, selecting "WinIIS" as the Category and the parameters as described in &quot;Create the New Certificate Store Type for the New IIS AnyAgent&quot;.<br>
In Keyfactor Command create a new Certificate Store similar to the one below, selecting "IISU" as the Category and the parameters as described in &quot;Create the New Certificate Store Type for the New IIS AnyAgent&quot;.<br>

![](images/IISCertStore.png)

Expand All @@ -225,7 +223,7 @@ Inventory Schedule |The interval that the system will use to report on what cert

**3b. Create a Windows Certificate Store within Keyfactor Command**

In Keyfactor Command create a new Certificate Store similar to the one below, selecting "WinIIS" as the Category and the parameters as described in &quot;Create the New Certificate Store Type for the New IIS AnyAgent&quot;.<br>
In Keyfactor Command create a new Certificate Store similar to the one below, selecting "IISU" as the Category and the parameters as described in &quot;Create the New Certificate Store Type for the New IIS AnyAgent&quot;.<br>

![](images/WinCertStore.png)

Expand Down
12 changes: 5 additions & 7 deletions readme_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ In version 2.0 of the IIS Orchestrator, the certificate store type has been rena

**Note: There is an additional certificate store type of “IIS” that ships with the Keyfactor platform. Migration of certificate stores from the “IIS” type to either the “IISBin” or “IISU” types is not currently supported.**

**Note: In version 3.0, the orchestrator has been renamed from IISU to WinCert. There is currently no succession process to update previous certificate store types.**


**1. Create the New Certificate Store Type**

Expand All @@ -34,9 +32,9 @@ In Keyfactor Command create a new Certificate Store Type similar to the one belo

CONFIG ELEMENT | DESCRIPTION
------------------|------------------
Name |A descriptive name for the extension. Example: WinCert (for general windows cert store), WinIIS (for IIS Webstore cert store)
Short Name |The short name that identifies the registered functionality of the orchestrator. Currently must be either Win or WinIIS
Custom Capability|Store type name orchestrator will register with. Currently must be Win or WinIIS.
Name |A descriptive name for the extension. Example: WinCert (for general windows cert store), IISU (for IIS Webstore cert store with bindings)
Short Name |The short name that identifies the registered functionality of the orchestrator. Currently must be either WinCert or IISU
Custom Capability|Store type name orchestrator will register with. Currently must be WinCert or IISU.
Job Types |Inventory (Checked), Add, Remove, and Reenrollment are the supported job types.
General Settings|Needs Server - Checked<br>Blueprint Allowed - Unchecked<br>Uses PowerShell - Unchecked
Requires Store Password |Determines if a store password is required when configuring an individual store. This must be unchecked.
Expand Down Expand Up @@ -113,7 +111,7 @@ See Keyfactor InstallingKeyfactorOrchestrators.pdf Documentation. Get from your

**3a. Create an IIS Binding Certificate Store within Keyfactor Command**

In Keyfactor Command create a new Certificate Store similar to the one below, selecting "WinIIS" as the Category and the parameters as described in &quot;Create the New Certificate Store Type for the New IIS AnyAgent&quot;.<br>
In Keyfactor Command create a new Certificate Store similar to the one below, selecting "IISU" as the Category and the parameters as described in &quot;Create the New Certificate Store Type for the New IIS AnyAgent&quot;.<br>

![](images/IISCertStore.png)

Expand All @@ -137,7 +135,7 @@ Inventory Schedule |The interval that the system will use to report on what cert

**3b. Create a Windows Certificate Store within Keyfactor Command**

In Keyfactor Command create a new Certificate Store similar to the one below, selecting "WinIIS" as the Category and the parameters as described in &quot;Create the New Certificate Store Type for the New IIS AnyAgent&quot;.<br>
In Keyfactor Command create a new Certificate Store similar to the one below, selecting "IISU" as the Category and the parameters as described in &quot;Create the New Certificate Store Type for the New IIS AnyAgent&quot;.<br>

![](images/WinCertStore.png)

Expand Down