Skip to content

Commit 9ebbe94

Browse files
authored
Merge pull request #8 from Keyfactor/release-1.1-pre
Release 1.1 pre
2 parents 166ac23 + 7d91528 commit 9ebbe94

File tree

7 files changed

+105
-70
lines changed

7 files changed

+105
-70
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1.1.0
2-
* Migrate to .NET Core
2+
* Migrate to Universal Orchestrator (KF9 / .NET Core)
33
* Perform Renewals using RenewalThumbprint
44

55
1.0.3
@@ -8,8 +8,9 @@
88
* 1 SNI Enabled
99
* 2 Non SNI binding which uses Central Certificate Store
1010
* 3 SNI binding which uses Central Certificate Store
11+
* Last release to support Windows Orchestrator (KF8)
1112

1213
1.0.2
13-
* Remove dependnce on Windows.Web.Administration on the orchestrator server. The agent will now use the local version on the managed server via remote powershell
14+
* Remove dependence on Windows.Web.Administration on the orchestrator server. The agent will now use the local version on the managed server via remote powershell
1415
* add support for the IncludePortInSPN flag
1516
* add support to use credentials from Keyfactor for Add/Remove/Inventory jobs.

IISWithBindings.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1A6C93E7-24FD-47FD-883D-EDABF5CEE4C6}"
99
ProjectSection(SolutionItems) = preProject
1010
CHANGELOG.md = CHANGELOG.md
11+
integration-manifest.json = integration-manifest.json
1112
.github\workflows\keyfactor-extension-release.yml = .github\workflows\keyfactor-extension-release.yml
1213
README.md = README.md
14+
README.md.tpl = README.md.tpl
1315
EndProjectSection
1416
EndProject
1517
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "images", "images", "{6302034E-DF8C-4B65-AC36-CED24C068999}"

IISWithBindings/Jobs/Inventory.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Management.Automation.Runspaces;
55
using System.Net;
66
using System.Security;
7+
using Keyfactor.Logging;
78
using Keyfactor.Orchestrators.Common.Enums;
89
using Keyfactor.Orchestrators.Extensions;
910
using Microsoft.Extensions.Logging;
@@ -55,6 +56,7 @@ private JobResult PerformInventory(InventoryJobConfiguration config, SubmitInven
5556
return new JobResult
5657
{
5758
Result = OrchestratorJobStatusJobResult.Failure,
59+
JobHistoryId = config.JobHistoryId,
5860
FailureMessage =
5961
$"Site {config.CertificateStoreDetails.StorePath} on server {config.CertificateStoreDetails.ClientMachine}: failed."
6062
};
@@ -66,6 +68,7 @@ private JobResult PerformInventory(InventoryJobConfiguration config, SubmitInven
6668
return new JobResult
6769
{
6870
Result = OrchestratorJobStatusJobResult.Warning,
71+
JobHistoryId = config.JobHistoryId,
6972
FailureMessage =
7073
$"Inventory on server {config.CertificateStoreDetails.ClientMachine} did not find any bindings."
7174
};
@@ -113,20 +116,24 @@ private JobResult PerformInventory(InventoryJobConfiguration config, SubmitInven
113116
return new JobResult
114117
{
115118
Result = OrchestratorJobStatusJobResult.Failure,
119+
JobHistoryId = config.JobHistoryId,
116120
FailureMessage =
117121
$"Unable to open remote certificate store: {psEx.Message}"
118122
};
119123
}
120124
catch (Exception ex)
121125
{
122-
_logger.LogTrace(ex.Message);
126+
_logger.LogTrace(LogHandler.FlattenException(ex));
127+
128+
string failureMessage = $"Inventory job failed for Site '{config.CertificateStoreDetails.StorePath}' on server '{config.CertificateStoreDetails.ClientMachine}' with error: '{ex.Message}'";
129+
_logger.LogWarning(failureMessage);
130+
123131
return new JobResult
124132
{
125133
Result = OrchestratorJobStatusJobResult.Failure,
126-
FailureMessage =
127-
$"Site {config.CertificateStoreDetails.StorePath} on server {config.CertificateStoreDetails.ClientMachine}: {ex.Message}"
134+
JobHistoryId = config.JobHistoryId,
135+
FailureMessage = failureMessage
128136
};
129-
130137
}
131138
}
132139

IISWithBindings/Jobs/Management.cs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Management.Automation.Runspaces;
55
using System.Net;
66
using System.Security.Cryptography.X509Certificates;
7+
using Keyfactor.Logging;
78
using Keyfactor.Orchestrators.Common.Enums;
89
using Keyfactor.Orchestrators.Extensions;
910
using Microsoft.Extensions.Logging;
@@ -99,7 +100,8 @@ private JobResult PerformRemoval(ManagementJobConfiguration config)
99100
if (foundBindings.Count == 0)
100101
return new JobResult
101102
{
102-
Result = OrchestratorJobStatusJobResult.Failure,
103+
Result = OrchestratorJobStatusJobResult.Failure,
104+
JobHistoryId = config.JobHistoryId,
103105
FailureMessage =
104106
$"Site {protocol} binding for Site {siteName} on server {config.CertificateStoreDetails.ClientMachine} not found."
105107
};
@@ -119,7 +121,8 @@ private JobResult PerformRemoval(ManagementJobConfiguration config)
119121
if (ps.HadErrors)
120122
return new JobResult
121123
{
122-
Result = OrchestratorJobStatusJobResult.Failure,
124+
Result = OrchestratorJobStatusJobResult.Failure,
125+
JobHistoryId = config.JobHistoryId,
123126
FailureMessage =
124127
$"Failed to remove {protocol} binding for Site {siteName} on server {config.CertificateStoreDetails.ClientMachine} not found."
125128
};
@@ -138,12 +141,16 @@ private JobResult PerformRemoval(ManagementJobConfiguration config)
138141
}
139142
catch (Exception ex)
140143
{
141-
_logger.LogTrace(ex.Message);
144+
_logger.LogTrace(LogHandler.FlattenException(ex));
145+
146+
string failureMessage = $"Remove job failed for Site '{config.CertificateStoreDetails.StorePath}' on server '{config.CertificateStoreDetails.ClientMachine}' with error: '{ex.Message}'";
147+
_logger.LogWarning(failureMessage);
148+
142149
return new JobResult
143150
{
144151
Result = OrchestratorJobStatusJobResult.Failure,
145-
FailureMessage =
146-
$"Site {config.CertificateStoreDetails.StorePath} on server {config.CertificateStoreDetails.ClientMachine}: {ex.Message}"
152+
JobHistoryId = config.JobHistoryId,
153+
FailureMessage = failureMessage
147154
};
148155
}
149156
}
@@ -207,7 +214,8 @@ function InstallPfxToMachineStore([byte[]]$bytes, [string]$password, [string]$st
207214
if (ps.HadErrors)
208215
return new JobResult
209216
{
210-
Result = OrchestratorJobStatusJobResult.Failure,
217+
Result = OrchestratorJobStatusJobResult.Failure,
218+
JobHistoryId = config.JobHistoryId,
211219
FailureMessage =
212220
$"Site {config.CertificateStoreDetails.StorePath} on server {config.CertificateStoreDetails.ClientMachine}: {ps.Streams.Error.ReadAll().First().ErrorDetails.Message}"
213221
};
@@ -296,7 +304,8 @@ function InstallPfxToMachineStore([byte[]]$bytes, [string]$password, [string]$st
296304
if (ps.HadErrors)
297305
return new JobResult
298306
{
299-
Result = OrchestratorJobStatusJobResult.Failure,
307+
Result = OrchestratorJobStatusJobResult.Failure,
308+
JobHistoryId = config.JobHistoryId,
300309
FailureMessage =
301310
$"Site {config.CertificateStoreDetails.StorePath} on server {config.CertificateStoreDetails.ClientMachine}: {ps.Streams.Error.ReadAll().First().ErrorDetails.Message}"
302311
};
@@ -313,12 +322,16 @@ function InstallPfxToMachineStore([byte[]]$bytes, [string]$password, [string]$st
313322
}
314323
catch (Exception ex)
315324
{
316-
_logger.LogTrace(ex.Message);
325+
_logger.LogTrace(LogHandler.FlattenException(ex));
326+
327+
string failureMessage = $"Add job failed for Site '{config.CertificateStoreDetails.StorePath}' on server '{config.CertificateStoreDetails.ClientMachine}' with error: '{ex.Message}'";
328+
_logger.LogWarning(failureMessage);
329+
317330
return new JobResult
318331
{
319332
Result = OrchestratorJobStatusJobResult.Failure,
320-
FailureMessage =
321-
$"Site {config.CertificateStoreDetails.StorePath} on server {config.CertificateStoreDetails.ClientMachine}: {ex.Message}"
333+
JobHistoryId = config.JobHistoryId,
334+
FailureMessage = failureMessage
322335
};
323336
}
324337
}

README.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
1-
# Windows IIS Orchestrator
1+
# Windows IIS Binding Orchestrator
22
## Orchestrator
33

4-
The IIS-With-Bindings AnyAgent allows a user to create, configure, and manage a Keyfactor certificate store defined as an Internet Information Systems (IIS) binding definition. The certificate itself will still be stored in the defined server's personal certificate store, but the management within Keyfactor will be abstracted to appear as if the binding itself houses the certificate.
4+
The IIS Bindings orchestrator treats the certificates bound (actively in use) on a Microsoft Internet Information Server (IIS) as a Keyfactor certificate store. Inventory and Management functions are supported. The orchestrator replaces the IIS orchestrator (which did not support binding.)
55

66
<!-- add integration specific information below -->
77
***
8-
**IIS With Binding AnyAgent Configuration**
8+
**IIS Binding Orchestrator Configuration**
99

1010
**Overview**
1111

12-
The IIS-With-Bindings AnyAgent allows a user to create, configure, and manage a Keyfactor certificate store defined as an Internet Information Systems (IIS) binding definition. The certificate itself will still be stored in the defined server&#39;s personal certificate store, but the management within Keyfactor will be abstracted to appear as if the binding itself houses the certificate.
12+
The IIS Binding Orchestrator remotely manages certificates in a Windows Server local machine certificate store.
13+
The "Personal" (My) and "Web Hosting" Stores are supported.
14+
Only certificates that are bound to an IIS web site are managed.
15+
Unbound certificates are ignored.
1316

1417
This agent implements three job types – Inventory, Management Add, and Management Remove. Below are the steps necessary to configure this AnyAgent.
1518

16-
**1. Create the New Certificate Store Type for the New IIS-With-Bindings AnyAgent**
19+
WinRM is used to remotely manage the certificate stores and IIS bindings. WinRM must be properly configured to allow
20+
the server running the orchestrator to manage the server running IIS.
21+
22+
**1. Create the New Certificate Store Type for the IIS Binding Orchestrator**
1723

1824
In Keyfactor Command create a new Certificate Store Type similar to the one below:
1925

2026
#### STORE TYPE CONFIGURATION
2127
CONFIG ELEMENT | DESCRIPTION
22-
---------------------|------------------
28+
------------------|------------------
2329
Name |Descriptive name for the Store Type
2430
Short Name |The short name that identifies the registered functionality of the orchestrator. Must be IISBinding
31+
Custom Capability|Store type name orchestrator will register with. Must be "IISBindings".
2532
Needs Server |Must be checked
2633
Blueprint Allowed |Unchecked
2734
Requires Store Password |Determines if a store password is required when configuring an individual store. This must be unchecked.
@@ -30,7 +37,7 @@ Supports Custom Alias |Determines if an individual entry within a store can have
3037
Uses PowerShell |Unchecked
3138
Store Path Type |Determines what restrictions are applied to the store path field when configuring a new store. This must be Multiple Choice
3239
Store Path Value|A comma separated list of options to select from for the Store Path. This, combined with the hostname, will determine the location used for the certificate store management and inventory. Must be My, WebHosting
33-
Private Keys |This determines if Keyfactor can send the private key associated with a certificate to the store. This is requried since IIS will need the private key material to establish TLS connections.
40+
Private Keys |This determines if Keyfactor can send the private key associated with a certificate to the store. This is required since IIS will need the private key material to establish TLS connections.
3441
PFX Password Style |This determines how the platform generate passwords to protect a PFX enrollment job that is delivered to the store. This can be either Default (system generated) or Custom (user determined).
3542
Job Types |Inventory, Add, and Remove are the supported job types.
3643

@@ -44,25 +51,16 @@ Job Types |Inventory, Add, and Remove are the supported job types.
4451

4552
**Custom Fields:**
4653

47-
<table>
48-
<tr><th>Parameter Name</th><th>Parameter Type</th><th>Default Value</th><th>Required</th></tr>
49-
<tr><td>spnwithport</td><td>Boolean</td><td>false</td><td>No</td></tr>
54+
- **SPN With Port** – Defaults to false but some customers need for remote PowerShell Access
5055

51-
- **SPN With Port** – Defaults to false but some customers need for remote Powershell Access
52-
</table>
56+
Parameter Name|Parameter Type|Default Value|Required
57+
---|---|---|---
58+
spnwithport|Boolean|false|No
5359

5460
![](images/screen1-b.gif)
5561

5662
**Entry Parameters:**
5763
This section must be configured with binding fields. The parameters will be populated with the appropriate data when creating a new certificate store.<br/>
58-
<table>
59-
<tr><th>Parameter Name</th><th>Parameter Type</th><th>Default Value</th><th>Required</th></tr>
60-
<tr><td>Port</td><td>String</td><td>443</td><td>Yes</td></tr>
61-
<tr><td>IP Address</td><td>String</td><td>*</td><td>Yes</td></tr>
62-
<tr><td>Host Name</td><td>String</td><td></td><td>No</td></tr>
63-
<tr><td>Site Name</td><td>String</td><td>Default Web Site</td><td>Yes</td></tr>
64-
<tr><td>Sni Flag</td><td>String</td><td>0 - No SNI</td><td>No</td></tr>
65-
<tr><td>Protocol</td><td>Multiple Choice</td><td>https</td><td>Yes</td></tr>
6664

6765
- **Site Name** – Required (Adding an entry, Removing an entry, Reenrolling an entry). The site name for the web site being bound to – i.e. &quot;Default Web Site&quot;
6866
- **IP Address** – Required (Adding an entry, Removing an entry, Reenrolling an entry). The IP address for the web site being bound to. Default is &quot;\*&quot; for all IP Addresses.
@@ -71,19 +69,27 @@ This section must be configured with binding fields. The parameters will be popu
7169
- *Protocol* - Required (Adding an entry, Removing an entry, Reenrolling an entry)
7270
- https
7371
- http
74-
- **Sni Flag** – Optional. Set the SNI flag assoicated with the binding being created.Default is &quot;0&quot;. Acceptable values are:
72+
- **Sni Flag** – Optional. Set the SNI flag associated with the binding being created. Default is "0". Acceptable values are:
7573
- 0 - No SNI
7674
- 1 - SNI Enabled
7775
- 2 - Non SNI Binding
7876
- 3 - SNI Binding
79-
</table>
77+
78+
Parameter Name|Parameter Type|Default Value|Required
79+
---|---|---|---
80+
Port|String|443|Yes
81+
IP Address|String|*|Yes
82+
Host Name |String||No
83+
Site Name |String|Default Web Site|Yes
84+
Sni Flag |String|0 - No SNI|No
85+
Protocol |Multiple Choice|https|Yes
8086

8187
![](images/screen1-c.gif)
8288

83-
**2. Register the IIS-With-Bindings AnyAgent with Keyfactor**
84-
See Keyfactor InstallingKeyfactorOrchestrators.pdf Documentation. Get from your Keyfactor contact/representitive.
89+
**2. Register the IIS Binding Orchestrator with Keyfactor**
90+
See Keyfactor InstallingKeyfactorOrchestrators.pdf Documentation. Get from your Keyfactor contact/representative.
8591

86-
**3. Create an IIS With Binding Certificate Store within Keyfactor Command**
92+
**3. Create an IIS Binding Certificate Store within Keyfactor Command**
8793

8894
In Keyfactor Command create a new Certificate Store similar to the one below, selecting IIS With Binding as the Category and the parameters as described in &quot;Create the New Certificate Store Type for the New IIS-With-Bindings AnyAgent&quot;.
8995

0 commit comments

Comments
 (0)