Skip to content

Commit 77e2a24

Browse files
authored
v2.6.0 (ab#55565 ab#56848 ab#48866 ab#55923 ab#55599) - Added ability for Linux installed universal orchestrator to manage stores as an "agent" (stores reside on same server as universal orchestrator) without the need to have SSH enabled. - Added ability for Linux installed universal orchestrator to manage certificate stores on Windows servers by using SSH to communicate between the Linux UO server and the Windows machines hosting the certificate stores. - Modified Discovery against Linux servers to use the -name option instead of -iname for the Linux shell "find" command, so Discovery will work for AIX servers. - Upgraded several NuGet packages.
1 parent 0d78768 commit 77e2a24

File tree

10 files changed

+821
-420
lines changed

10 files changed

+821
-420
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v2.6.0
2+
- Added ability for Linux installed universal orchestrator to manage stores as an "agent" (stores reside on same server as universal orchestrator) without the need to have SSH enabled.
3+
- Added ability for Linux installed universal orchestrator to manage certificate stores on Windows servers by using SSH to communicate between the Linux UO server and the Windows machines hosting the certificate stores.
4+
- Modified Discovery against Linux servers to use the -name option instead of -iname for the Linux shell "find" command, so Discovery will work for AIX servers.
5+
- Upgraded several NuGet packages.
6+
17
v2.5.0
28
- Add new optional custom field and config.json entries to supply a user id other than "root" for the user to "sudo into" when UseSudo = "Y". There is an optional config.json DefaultSudoImpersonatedUser that will be used at the orchestrator level, and an optional new store type custom field, SudoImpersonatedUser, that overrides the config.json setting for each certificate store.
39
- Modified the optional sudo command prefix to remove the "-i" option which was creating a new shell for the impersonated id (always root up until this release). Without this option the profile for the logged in user and not the impersonated user will be used when running commands.

README.md

Lines changed: 406 additions & 205 deletions
Large diffs are not rendered by default.

RemoteFile/ManagementBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public JobResult ProcessJob(ManagementJobConfiguration config)
6464
switch (config.OperationType)
6565
{
6666
case CertStoreOperationType.Add:
67-
logger.LogDebug($"BEGIN create Operation for {config.CertificateStoreDetails.StorePath} on {config.CertificateStoreDetails.ClientMachine}.");
67+
logger.LogDebug($"BEGIN add Operation for {config.CertificateStoreDetails.StorePath} on {config.CertificateStoreDetails.ClientMachine}.");
6868
if (!certificateStore.DoesStoreExist())
6969
{
7070
if (ApplicationSettings.CreateStoreIfMissing)
@@ -76,7 +76,7 @@ public JobResult ProcessJob(ManagementJobConfiguration config)
7676
certificateStore.AddCertificate((config.JobCertificate.Alias ?? new X509Certificate2(Convert.FromBase64String(config.JobCertificate.Contents), config.JobCertificate.PrivateKeyPassword).Thumbprint), config.JobCertificate.Contents, config.Overwrite, config.JobCertificate.PrivateKeyPassword);
7777
certificateStore.SaveCertificateStore(certificateStoreSerializer.SerializeRemoteCertificateStore(certificateStore.GetCertificateStore(), storePathFile.Path, storePathFile.File, storePassword, certificateStore.RemoteHandler));
7878

79-
logger.LogDebug($"END create Operation for {config.CertificateStoreDetails.StorePath} on {config.CertificateStoreDetails.ClientMachine}.");
79+
logger.LogDebug($"END add Operation for {config.CertificateStoreDetails.StorePath} on {config.CertificateStoreDetails.ClientMachine}.");
8080
break;
8181

8282
case CertStoreOperationType.Remove:

RemoteFile/RemoteCertificateStore.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using System.Security.Cryptography.X509Certificates;
1313
using System.Text;
1414
using System.Text.RegularExpressions;
15-
using System.Threading;
1615

1716
using Microsoft.Extensions.Logging;
1817

@@ -22,9 +21,7 @@
2221
using Keyfactor.Extensions.Orchestrator.RemoteFile.RemoteHandlers;
2322
using Keyfactor.Extensions.Orchestrator.RemoteFile.Models;
2423
using Keyfactor.Logging;
25-
using System.Management.Automation;
2624
using System.Runtime.InteropServices;
27-
using Microsoft.CodeAnalysis.CSharp.Syntax;
2825

2926
namespace Keyfactor.Extensions.Orchestrator.RemoteFile
3027
{
@@ -346,7 +343,7 @@ internal void Initialize(string sudoImpersonatedUser)
346343
bool treatAsLocal = Server.ToLower().EndsWith(LOCAL_MACHINE_SUFFIX);
347344

348345
if (ServerType == ServerTypeEnum.Linux || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
349-
RemoteHandler = treatAsLocal ? new LinuxLocalHandler() as IRemoteHandler : new SSHHandler(Server, ServerId, ServerPassword, ServerType == ServerTypeEnum.Linux) as IRemoteHandler;
346+
RemoteHandler = treatAsLocal ? new LinuxLocalHandler() as IRemoteHandler : new SSHHandler(Server, ServerId, ServerPassword, ServerType == ServerTypeEnum.Linux, sudoImpersonatedUser) as IRemoteHandler;
350347
else
351348
RemoteHandler = new WinRMHandler(Server, ServerId, ServerPassword, treatAsLocal);
352349

RemoteFile/RemoteFile.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
77
</PropertyGroup>
88

@@ -25,8 +25,7 @@
2525
<PackageReference Include="Keyfactor.Logging" Version="1.1.1" />
2626
<PackageReference Include="Keyfactor.Orchestrators.IOrchestratorJobExtensions" Version="0.7.0" />
2727
<PackageReference Include="Keyfactor.PKI" Version="5.0.0" />
28-
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.0.7" />
29-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
28+
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.12" />
3029
</ItemGroup>
3130

3231
<ItemGroup>

RemoteFile/RemoteHandlers/LinuxLocalHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public override string RunCommand(string commandText, object[] arguments, bool w
5151
{
5252
_logger.MethodEntry(LogLevel.Debug);
5353

54-
string sudo = $"echo -e '\n' | sudo -i -S ";
54+
string sudo = $"echo -e \\n | sudo -S ";
5555

5656
try
5757
{

RemoteFile/RemoteHandlers/SSHHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class SSHHandler : BaseRemoteHandler
2525
{
2626
private ConnectionInfo Connection { get; set; }
2727
private string SudoImpersonatedUser { get; set; }
28+
private bool IsStoreServerLinux { get; set; }
2829
private SshClient sshClient;
2930

3031
internal SSHHandler(string server, string serverLogin, string serverPassword, bool isStoreServerLinux, string sudoImpersonatedUser)

RemoteFile/RemoteHandlers/WinRMHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System;
99
using System.Collections.Generic;
1010
using System.Management.Automation;
11-
using System.Management.Automation.Remoting;
1211
using System.Management.Automation.Runspaces;
1312
using System.Net;
1413
using System.Text;

images/orchestrator-agent.png

24.2 KB
Loading

0 commit comments

Comments
 (0)