Skip to content

Commit 6dd7ba3

Browse files
authored
Merge 9d4788d into df0170a
2 parents df0170a + 9d4788d commit 6dd7ba3

31 files changed

+206
-73
lines changed

.github/workflows/keyfactor-merge-store-types.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ on:
1111

1212
jobs:
1313
call-starter-workflow:
14-
uses: keyfactor/actions/.github/workflows/[email protected]
14+
uses: keyfactor/actions/.github/workflows/starter.yml@v4
15+
with:
16+
command_token_url: ${{ vars.COMMAND_TOKEN_URL }} # Only required for doctool generated screenshots
17+
command_hostname: ${{ vars.COMMAND_HOSTNAME }} # Only required for doctool generated screenshots
18+
command_base_api_path: ${{ vars.COMMAND_API_PATH }} # Only required for doctool generated screenshots
1519
secrets:
16-
token: ${{ secrets.V2BUILDTOKEN}}
17-
APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}}
18-
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
19-
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
20-
scan_token: ${{ secrets.SAST_TOKEN }}
20+
token: ${{ secrets.V2BUILDTOKEN}} # REQUIRED
21+
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} # Only required for golang builds
22+
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} # Only required for golang builds
23+
scan_token: ${{ secrets.SAST_TOKEN }} # REQUIRED
24+
entra_username: ${{ secrets.DOCTOOL_ENTRA_USERNAME }} # Only required for doctool generated screenshots
25+
entra_password: ${{ secrets.DOCTOOL_ENTRA_PASSWD }} # Only required for doctool generated screenshots
26+
command_client_id: ${{ secrets.COMMAND_CLIENT_ID }} # Only required for doctool generated screenshots
27+
command_client_secret: ${{ secrets.COMMAND_CLIENT_SECRET }} # Only required for doctool generated screenshots

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v2.12.0
2+
- Added config.json setting and its override store level custom field - AllowShellCommands. If "N" (default "Y"), SFTP will be used to create stores and move files on Linux-based certificate store servers. No Linux shell commands will be used in the integration.
3+
14
v2.11.4
25
- Bug Fix: Handle condition where a certificate store definition that contains an invalid value for `FileTransferProtocol`
36
would return empty inventory. If no value is set or an invalid value is set, the default value of `Both` will be used

README.md

Lines changed: 46 additions & 3 deletions
Large diffs are not rendered by default.

RemoteFile/ApplicationSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public enum FileTransferProtocolEnum
4141
public static string DefaultSudoImpersonatedUser { get { return configuration.ContainsKey("DefaultSudoImpersonatedUser") ? configuration["DefaultSudoImpersonatedUser"] : DEFAULT_SUDO_IMPERSONATION_SETTING; } }
4242
public static bool CreateCSROnDevice { get { return configuration.ContainsKey("CreateCSROnDevice") ? configuration["CreateCSROnDevice"]?.ToUpper() == "Y" : false; } }
4343
public static string TempFilePathForODKG { get { return configuration.ContainsKey("TempFilePathForODKG") ? configuration["TempFilePathForODKG"] : string.Empty; } }
44+
public static bool UseShellCommands { get { return configuration.ContainsKey("UseShellCommands") ? configuration["UseShellCommands"]?.ToUpper() == "Y" : true; } }
4445
public static int SSHPort
4546
{
4647
get

RemoteFile/Discovery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public JobResult ProcessJob(DiscoveryJobConfiguration config, SubmitDiscoveryUpd
5959
ApplicationSettings.Initialize(this.GetType().Assembly.Location);
6060

6161
certificateStore = new RemoteCertificateStore(config.ClientMachine, userName, userPassword, directoriesToSearch[0].Substring(0, 1) == "/" ? RemoteCertificateStore.ServerTypeEnum.Linux : RemoteCertificateStore.ServerTypeEnum.Windows, ApplicationSettings.SSHPort);
62-
certificateStore.Initialize(ApplicationSettings.DefaultSudoImpersonatedUser);
62+
certificateStore.Initialize(ApplicationSettings.DefaultSudoImpersonatedUser, true);
6363

6464
if (directoriesToSearch.Length == 0)
6565
throw new RemoteFileException("Blank or missing search directories for Discovery.");

RemoteFile/InventoryBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public JobResult ProcessJob(InventoryJobConfiguration config, SubmitInventoryUpd
4040
SetJobProperties(config, config.CertificateStoreDetails, logger);
4141

4242
certificateStore = new RemoteCertificateStore(config.CertificateStoreDetails.ClientMachine, UserName, UserPassword, config.CertificateStoreDetails.StorePath, StorePassword, FileTransferProtocol, SSHPort, IncludePortInSPN);
43-
certificateStore.Initialize(SudoImpersonatedUser);
43+
certificateStore.Initialize(SudoImpersonatedUser, UseShellCommands);
4444
certificateStore.LoadCertificateStore(certificateStoreSerializer, true);
4545

4646
List<X509Certificate2Collection> collections = certificateStore.GetCertificateChains();

RemoteFile/ManagementBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public JobResult ProcessJob(ManagementJobConfiguration config)
3838
SetJobProperties(config, config.CertificateStoreDetails, logger);
3939

4040
certificateStore = new RemoteCertificateStore(config.CertificateStoreDetails.ClientMachine, UserName, UserPassword, config.CertificateStoreDetails.StorePath, StorePassword, FileTransferProtocol, SSHPort, IncludePortInSPN);
41-
certificateStore.Initialize(SudoImpersonatedUser);
41+
certificateStore.Initialize(SudoImpersonatedUser, UseShellCommands);
4242

4343
PathFile storePathFile = RemoteCertificateStore.SplitStorePathFile(config.CertificateStoreDetails.StorePath);
4444

RemoteFile/ReenrollmentBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public JobResult ProcessJobToDo(ReenrollmentJobConfiguration config, SubmitReenr
6868
ApplicationSettings.FileTransferProtocolEnum fileTransferProtocol = ApplicationSettings.FileTransferProtocol;
6969

7070
certificateStore = new RemoteCertificateStore(config.CertificateStoreDetails.ClientMachine, UserName, UserPassword, config.CertificateStoreDetails.StorePath, StorePassword, fileTransferProtocol, SSHPort, IncludePortInSPN);
71-
certificateStore.Initialize(SudoImpersonatedUser);
71+
certificateStore.Initialize(SudoImpersonatedUser, UseShellCommands);
7272

7373
PathFile storePathFile = RemoteCertificateStore.SplitStorePathFile(config.CertificateStoreDetails.StorePath);
7474

RemoteFile/RemoteCertificateStore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,14 @@ internal string GenerateCSROnDevice(string subjectText, SupportedKeyTypeEnum key
453453
return csr;
454454
}
455455

456-
internal void Initialize(string sudoImpersonatedUser)
456+
internal void Initialize(string sudoImpersonatedUser, bool useShellCommands)
457457
{
458458
logger.MethodEntry(LogLevel.Debug);
459459

460460
bool treatAsLocal = Server.ToLower().EndsWith(LOCAL_MACHINE_SUFFIX);
461461

462462
if (ServerType == ServerTypeEnum.Linux || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
463-
RemoteHandler = treatAsLocal ? new LinuxLocalHandler() as IRemoteHandler : new SSHHandler(Server, ServerId, ServerPassword, ServerType == ServerTypeEnum.Linux, FileTransferProtocol, SSHPort, sudoImpersonatedUser) as IRemoteHandler;
463+
RemoteHandler = treatAsLocal ? new LinuxLocalHandler() as IRemoteHandler : new SSHHandler(Server, ServerId, ServerPassword, ServerType == ServerTypeEnum.Linux, FileTransferProtocol, SSHPort, sudoImpersonatedUser, useShellCommands) as IRemoteHandler;
464464
else
465465
RemoteHandler = new WinRMHandler(Server, ServerId, ServerPassword, treatAsLocal, IncludePortInSPN);
466466

0 commit comments

Comments
 (0)