Skip to content

Commit 5e12d12

Browse files
authored
Release 2.3 (#100)
Squash 2.3.1 to main
1 parent 0d8a8aa commit 5e12d12

File tree

6 files changed

+68
-23
lines changed

6 files changed

+68
-23
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2.3.1
2+
* Added additional error trapping for WinRM connections to allow actual error on failure.
3+
14
2.3.0
25
* Added Sql Server Binding Support
36
* Modified WinCert Advanced PrivateKeyAllowed setting from Required to Optional

IISU/ClientPSCertStoreManager.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ public JobResult AddCertificate(string certificateContents, string privateKeyPas
6565
X509KeyStorageFlags.Exportable
6666
);
6767

68-
_logger.LogTrace($"X509 Cert Created With Subject: {x509Cert.SubjectName}");
69-
_logger.LogTrace(
70-
$"Begin Add for Cert Store {$@"\\{_runspace.ConnectionInfo.ComputerName}\{storePath}"}");
68+
_logger.LogDebug($"X509 Cert Created With Subject: {x509Cert.SubjectName}");
69+
_logger.LogDebug($"Begin Add for Cert Store {$@"\\{_runspace.ConnectionInfo.ComputerName}\{storePath}"}");
7170

7271
// Add Certificate
7372
var funcScript = @"
@@ -83,12 +82,13 @@ function InstallPfxToMachineStore([byte[]]$bytes, [string]$password, [string]$st
8382
}";
8483

8584
ps.AddScript(funcScript).AddStatement();
86-
_logger.LogTrace("InstallPfxToMachineStore Statement Added...");
85+
_logger.LogDebug("InstallPfxToMachineStore Statement Added...");
8786

8887
ps.AddCommand("InstallPfxToMachineStore")
8988
.AddParameter("bytes", Convert.FromBase64String(certificateContents))
9089
.AddParameter("password", privateKeyPassword)
9190
.AddParameter("storeName", $@"\\{_runspace.ConnectionInfo.ComputerName}\{storePath}");
91+
9292
_logger.LogTrace("InstallPfxToMachineStore Command Added...");
9393

9494
foreach (var cmd in ps.Commands.Commands)
@@ -100,6 +100,7 @@ function InstallPfxToMachineStore([byte[]]$bytes, [string]$password, [string]$st
100100
_logger.LogTrace("Invoking ps...");
101101
ps.Invoke();
102102
_logger.LogTrace("ps Invoked...");
103+
103104
if (ps.HadErrors)
104105
{
105106
_logger.LogTrace("ps Has Errors");
@@ -119,6 +120,7 @@ function InstallPfxToMachineStore([byte[]]$bytes, [string]$password, [string]$st
119120
_logger.LogTrace("Clearing Commands...");
120121
ps.Commands.Clear();
121122
_logger.LogTrace("Commands Cleared..");
123+
_logger.LogInformation($"Certificate was successfully added to cert store: {storePath}");
122124

123125
return new JobResult
124126
{
@@ -129,6 +131,8 @@ function InstallPfxToMachineStore([byte[]]$bytes, [string]$password, [string]$st
129131
}
130132
catch (Exception e)
131133
{
134+
_logger.LogError($"Error Occurred in ClientPSCertStoreManager.AddCertificate(): {e.Message}");
135+
132136
return new JobResult
133137
{
134138
Result = OrchestratorJobStatusJobResult.Failure,

IISU/ImplementedStoreTypes/Win/Management.cs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,26 +119,22 @@ private JobResult performAddition(ManagementJobConfiguration config)
119119
string storePath = config.CertificateStoreDetails.StorePath;
120120
long jobNumber = config.JobHistoryId;
121121

122-
// Setup a new connection to the client machine
123-
//var connectionInfo = new WSManConnectionInfo(new Uri($"{certStoreDetails?.WinRmProtocol}://{config.CertificateStoreDetails.ClientMachine}:{certStoreDetails?.WinRmPort}/wsman"));
124-
//_logger.LogTrace($"WinRm URL: {certStoreDetails?.WinRmProtocol}://{config.CertificateStoreDetails.ClientMachine}:{certStoreDetails?.WinRmPort}/wsman");
125-
126122
if (storePath != null)
127123
{
128-
_logger.LogTrace($"Attempting to get licenses from cert path: {storePath})");
124+
_logger.LogInformation($"Attempting to add certificate to cert store: {storePath}");
129125

130126
ClientPSCertStoreManager manager = new ClientPSCertStoreManager(_logger, myRunspace, jobNumber);
131-
JobResult result = manager.AddCertificate(certificateContents, privateKeyPassword, storePath);
132-
133-
_logger.LogTrace($"Certificate was successfully added to cert store: {storePath})");
127+
return manager.AddCertificate(certificateContents, privateKeyPassword, storePath);
134128
}
135-
136-
return new JobResult
129+
else
137130
{
138-
Result = OrchestratorJobStatusJobResult.Success,
139-
JobHistoryId = config.JobHistoryId,
140-
FailureMessage = ""
141-
};
131+
return new JobResult
132+
{
133+
Result = OrchestratorJobStatusJobResult.Failure,
134+
JobHistoryId = config.JobHistoryId,
135+
FailureMessage = "Store Path is empty or null."
136+
};
137+
}
142138
}
143139
catch (Exception e)
144140
{

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
12
# WinCertStore Orchestrator
23

34
The Windows Certificate Store Orchestrator Extension implements two certificate store types. 1) “WinCert” which manages certificates in a Windows local machine store, and 2) “IISU” which manages certificates and their bindings in a Windows local machine store that are bound to Internet Information Server (IIS) websites. These extensions replace the now deprecated “IIS” cert store type that ships with Keyfactor Command. The “IISU” extension also replaces the “IISBin” certificate store type from prior versions of this repository. This orchestrator extension is in the process of being renamed from “IIS Orchestrator” as it now supports certificates that are not in use by IIS.
45

56
#### Integration status: Production - Ready for use in production environments.
67

7-
88
## About the Keyfactor Universal Orchestrator Extension
99

1010
This repository contains a Universal Orchestrator Extension which is a plugin to the Keyfactor Universal Orchestrator. Within the Keyfactor Platform, Orchestrators are used to manage “certificate stores” — collections of certificates and roots of trust that are found within and used by various applications.
@@ -13,23 +13,22 @@ The Universal Orchestrator is part of the Keyfactor software distribution and is
1313

1414
The Universal Orchestrator is the successor to the Windows Orchestrator. This Orchestrator Extension plugin only works with the Universal Orchestrator and does not work with the Windows Orchestrator.
1515

16-
1716
## Support for WinCertStore Orchestrator
1817

19-
WinCertStore Orchestrator is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative.
18+
WinCertStore Orchestrator is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com
2019

2120
###### To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab.
2221

23-
2422
---
2523

2624

25+
---
26+
2727

2828

2929
## Keyfactor Version Supported
3030

3131
The minimum version of the Keyfactor Universal Orchestrator Framework needed to run this version of the extension is 10.1
32-
3332
## Platform Specific Notes
3433

3534
The Keyfactor Universal Orchestrator may be installed on either Windows or Linux based platforms. The certificate operations supported by a capability may vary based what platform the capability is installed on. The table below indicates what capabilities are supported based on which platform the encompassing Universal Orchestrator is running.
@@ -124,6 +123,27 @@ In version 2.0 of the IIS Orchestrator, the certificate store type has been rena
124123

125124
**Note: If Looking to use GMSA Accounts to run the Service Kefyactor Command 10.2 or greater is required for No Value checkbox to work**
126125

126+
## Security and Permission Considerations
127+
From an official support point of view, Local Administrator permissions are required on the target server. Some customers have been successful with using other accounts and granting rights to the underlying certificate and private key stores. Due to complexities with the interactions between Group Policy, WinRM, User Account Control, and other unpredictable customer environmental factors, Keyfactor cannot provide assistance with using accounts other than the local administrator account.
128+
129+
For customers wishing to use something other than the local administrator account, the following information may be helpful:
130+
131+
* The WinCert extensions (WinCert, IISU, WinSQL) create a WinRM (remote PowerShell) session to the target server in order to manipulate the Windows Certificate Stores, perform binding (in the case of the IISU extension), or to access the registry (in the case of the WinSQL extension).
132+
133+
* When the WinRM session is created, the certificate store credentials are used if they have been specified, otherwise the WinRM session is created in the context of the Universal Orchestrator (UO) Service account (which potentially could be the network service account, a regular account, or a GMSA account)
134+
135+
* WinRM needs to be properly set up between the server hosting the UO and the target server. This means that a WinRM client running on the UO server when running in the context of the UO service account needs to be able to create a session on the target server using the configured credentials of the target server and any PowerShell commands running on the remote session need to have appropriate permissions.
136+
137+
* Even though a given account may be in the administrators group or have administrative privledges on the target system and may be able to execute certificate and binding operations when running locally, the same account may not work when being used via WinRM. User Account Control (UAC) can get in the way and filter out administrative privledges. UAC / WinRM configuration has a LocalAccountTokenFilterPolicy setting that can be adjusted to not filter out administrative privledges for remote users, but enabling this may have other security ramifications.
138+
139+
* The following list may not be exhaustive, but in general the account (when running under a remote WinRM session) needs permissions to:
140+
- Instantiate and open a .NET X509Certificates.X509Store object for the target certificate store and be able to read and write both the certificates and related private keys. Note that ACL permissions on the stores and private keys are separate.
141+
- Use the Import-Certificate, Get-WebSite, Get-WebBinding, and New-WebBinding PowerShell CmdLets.
142+
- Create and delete temporary files.
143+
- Execute certreq commands.
144+
- Access any Cryptographic Service Provider (CSP) referenced in re-enrollment jobs.
145+
- Read and Write values in the registry (HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server) when performing SQL Server certificate binding.
146+
127147
## Creating New Certificate Store Types
128148
Currently this orchestrator handles two extensions: IISU for IIS servers with bound certificates and WinCert for general Windows Certificates.
129149
Below describes how each of these certificate store types are created and configured.

integration-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"orchestrator": {
1313
"UOFramework": "10.1",
1414
"pam_support": true,
15+
"keyfactor_platform_version": "9.10",
1516
"win": {
1617
"supportsCreateStore": false,
1718
"supportsDiscovery": false,

readme_source.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ In version 2.0 of the IIS Orchestrator, the certificate store type has been rena
2323

2424
**Note: If Looking to use GMSA Accounts to run the Service Kefyactor Command 10.2 or greater is required for No Value checkbox to work**
2525

26+
## Security and Permission Considerations
27+
From an official support point of view, Local Administrator permissions are required on the target server. Some customers have been successful with using other accounts and granting rights to the underlying certificate and private key stores. Due to complexities with the interactions between Group Policy, WinRM, User Account Control, and other unpredictable customer environmental factors, Keyfactor cannot provide assistance with using accounts other than the local administrator account.
28+
29+
For customers wishing to use something other than the local administrator account, the following information may be helpful:
30+
31+
* The WinCert extensions (WinCert, IISU, WinSQL) create a WinRM (remote PowerShell) session to the target server in order to manipulate the Windows Certificate Stores, perform binding (in the case of the IISU extension), or to access the registry (in the case of the WinSQL extension).
32+
33+
* When the WinRM session is created, the certificate store credentials are used if they have been specified, otherwise the WinRM session is created in the context of the Universal Orchestrator (UO) Service account (which potentially could be the network service account, a regular account, or a GMSA account)
34+
35+
* WinRM needs to be properly set up between the server hosting the UO and the target server. This means that a WinRM client running on the UO server when running in the context of the UO service account needs to be able to create a session on the target server using the configured credentials of the target server and any PowerShell commands running on the remote session need to have appropriate permissions.
36+
37+
* Even though a given account may be in the administrators group or have administrative privledges on the target system and may be able to execute certificate and binding operations when running locally, the same account may not work when being used via WinRM. User Account Control (UAC) can get in the way and filter out administrative privledges. UAC / WinRM configuration has a LocalAccountTokenFilterPolicy setting that can be adjusted to not filter out administrative privledges for remote users, but enabling this may have other security ramifications.
38+
39+
* The following list may not be exhaustive, but in general the account (when running under a remote WinRM session) needs permissions to:
40+
- Instantiate and open a .NET X509Certificates.X509Store object for the target certificate store and be able to read and write both the certificates and related private keys. Note that ACL permissions on the stores and private keys are separate.
41+
- Use the Import-Certificate, Get-WebSite, Get-WebBinding, and New-WebBinding PowerShell CmdLets.
42+
- Create and delete temporary files.
43+
- Execute certreq commands.
44+
- Access any Cryptographic Service Provider (CSP) referenced in re-enrollment jobs.
45+
- Read and Write values in the registry (HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server) when performing SQL Server certificate binding.
46+
2647
## Creating New Certificate Store Types
2748
Currently this orchestrator handles two extensions: IISU for IIS servers with bound certificates and WinCert for general Windows Certificates.
2849
Below describes how each of these certificate store types are created and configured.

0 commit comments

Comments
 (0)