Skip to content

Commit 4ae539b

Browse files
fiddlermikeyRexWheelerBob Pokornybhillkeyfactorjoynerar
authored
Prep for 2.0 release (#29)
* Doc updates (#27) * Added Apache License to source code and removed unfinished work comments. * Moved sql scripts to new folder * Add more context to Provider Name and SAN parms * Fixed Remove Bug Found after ReEnrollment Refactoring * Update IIS-Conversion.sql * Removed previously left in steps from initial code base. * Updated the entry parameters grid to provide additional information on required parameters. * Fixed Removal Bug and Updated Readme * Update to migration script * Pam Documentation Updates * null host name fix * null logger issue * New Test case added * Fixed Null entry errors when Hostname and SAN is empty. (#40) * Added reenrollment to store type configuration table * Removed spaces from entry parameters to match new orchestrator requirements * Changed wording on SAN enrollment parameter requirement * Update generated README Co-authored-by: Rex Wheeler <[email protected]> Co-authored-by: Bob Pokorny <[email protected]> Co-authored-by: Brian Hill <[email protected]> Co-authored-by: Adam Joyner <[email protected]>
1 parent 9b4cf20 commit 4ae539b

18 files changed

+398
-50
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
with:
1212
release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }}
1313
release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }}
14-
release_dir: IISWithBindings/bin/Release/netcoreapp3.1 # output directory to upload as a release, relative to checkout workspace
14+
release_dir: IISU/bin/Release/netcoreapp3.1
1515
secrets:
1616
token: ${{ secrets.PRIVATE_PACKAGE_ACCESS }}
1717

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
2.0.0
2-
* PAM Support added (requires Univesal Orchestrator Framework version 10.1)
2+
* Add support for reenrollment jobs (On Device Key Generation) with the ability to specify a cryptographic provider. Specification of cryptographic provider allows HSM (Hardware Security Module) use.
3+
* Local PAM Support added (requires Univesal Orchestrator Framework version 10.1)
4+
* Certificate store type changed from IISBin to IISU. See readme for migration notes.
5+
36

47
1.1.3
58
* Made WinRM port a store parameter

IISU/IISManager.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System;
1+
// Copyright 2022 Keyfactor
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System;
216
using System.Linq;
317
using System.Management.Automation;
418
using System.Management.Automation.Runspaces;
@@ -50,7 +64,7 @@ public IISManager(ReenrollmentJobConfiguration config,string serverUserName,stri
5064
{
5165
SiteName = config.JobProperties["SiteName"].ToString();
5266
Port = config.JobProperties["Port"].ToString();
53-
HostName = config.JobProperties["HostName"].ToString();
67+
HostName = config.JobProperties["HostName"]?.ToString();
5468
Protocol = config.JobProperties["Protocol"].ToString();
5569
SniFlag = config.JobProperties["SniFlag"].ToString()?.Substring(0, 1);
5670
IpAddress = config.JobProperties["IPAddress"].ToString();
@@ -89,7 +103,7 @@ public IISManager(ManagementJobConfiguration config, string serverUserName, stri
89103
{
90104
SiteName = config.JobProperties["SiteName"].ToString();
91105
Port = config.JobProperties["Port"].ToString();
92-
HostName = config.JobProperties["HostName"].ToString();
106+
HostName = config.JobProperties["HostName"]?.ToString();
93107
Protocol = config.JobProperties["Protocol"].ToString();
94108
SniFlag = config.JobProperties["SniFlag"].ToString()?.Substring(0, 1);
95109
IpAddress = config.JobProperties["IPAddress"].ToString();

IISU/JobProperties.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System.ComponentModel;
1+
// Copyright 2022 Keyfactor
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System.ComponentModel;
216
using Newtonsoft.Json;
317

418
namespace Keyfactor.Extensions.Orchestrator.IISU

IISU/Jobs/Inventory.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2022 Keyfactor
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
using System;
216
using System.Collections.Generic;
317
using System.Linq;

IISU/Jobs/Management.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System;
1+
// Copyright 2022 Keyfactor
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System;
216
using System.Linq;
317
using System.Management.Automation;
418
using System.Management.Automation.Runspaces;
@@ -78,10 +92,11 @@ private JobResult PerformRemoval(ManagementJobConfiguration config)
7892
try
7993
{
8094
_logger.MethodEntry();
81-
var siteName = config.JobProperties["Site Name"];
95+
var siteName = config.JobProperties["SiteName"];
8296
var port = config.JobProperties["Port"];
83-
var hostName = config.JobProperties["Host Name"];
97+
var hostName = config.JobProperties["HostName"];
8498
var protocol = config.JobProperties["Protocol"];
99+
var ipAddress = config.JobProperties["IPAddress"].ToString();
85100
_logger.LogTrace($"Removing Site: {siteName}, Port:{port}, hostName:{hostName}, protocol:{protocol}");
86101

87102
var storePath = JsonConvert.DeserializeObject<JobProperties>(config.CertificateStoreDetails.Properties,
@@ -127,6 +142,7 @@ private JobResult PerformRemoval(ManagementJobConfiguration config)
127142
.AddParameter("Name", siteName)
128143
.AddParameter("Port", port)
129144
.AddParameter("HostHeader", hostName)
145+
.AddParameter("IPAddress",ipAddress)
130146
.AddStatement();
131147

132148

IISU/Jobs/ReEnrollment.cs

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System;
1+
// Copyright 2022 Keyfactor
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System;
216
using System.Collections.ObjectModel;
317
using System.Linq;
418
using System.Management.Automation;
@@ -36,7 +50,6 @@ private string ResolvePamField(string name, string value)
3650

3751
public JobResult ProcessJob(ReenrollmentJobConfiguration config, SubmitReenrollmentCSR submitReEnrollmentUpdate)
3852
{
39-
_logger.MethodEntry();
4053
_logger = LogHandler.GetClassLogger<ReEnrollment>();
4154
_logger.LogTrace($"Job Configuration: {JsonConvert.SerializeObject(config)}");
4255
var storePath = JsonConvert.DeserializeObject<JobProperties>(config.CertificateStoreDetails.Properties, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Populate });
@@ -105,13 +118,15 @@ private JobResult PerformReEnrollment(ReenrollmentJobConfiguration config, Submi
105118
ps.AddScript($"Add-Content $infFilename 'KeyLength={keySize}'");
106119
ps.AddScript($"Add-Content $infFilename 'KeySpec = 0'");
107120

108-
ps.AddScript($"Add-Content $infFilename '[Extensions]'");
109-
ps.AddScript(@"Add-Content $infFilename '2.5.29.17 = ""{text}""'");
110-
111-
// Todo: Parse SAN by '&' and add the below entry for each DSN
112-
foreach (string s in SAN.ToString().Split("&"))
121+
if(SAN != null)
113122
{
114-
ps.AddScript($"Add-Content $infFilename '_continue_ = \"{s + "&"}\"'");
123+
ps.AddScript($"Add-Content $infFilename '[Extensions]'");
124+
ps.AddScript(@"Add-Content $infFilename '2.5.29.17 = ""{text}""'");
125+
126+
foreach (string s in SAN.ToString().Split("&"))
127+
{
128+
ps.AddScript($"Add-Content $infFilename '_continue_ = \"{s + "&"}\"'");
129+
}
115130
}
116131

117132
// Execute the -new command

IISU/PSCertStoreException.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System;
1+
// Copyright 2022 Keyfactor
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System;
216
using System.Runtime.Serialization;
317

418
namespace Keyfactor.Extensions.Orchestrator.IISU

IISU/PSCertificate.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System;
1+
// Copyright 2022 Keyfactor
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System;
216

317
namespace Keyfactor.Extensions.Orchestrator.IISU
418
{

IISU/PowerShellCertException.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System;
1+
// Copyright 2022 Keyfactor
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
using System;
216
using System.Collections.Generic;
317
using System.Runtime.Serialization;
418
using System.Text;

0 commit comments

Comments
 (0)