Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0c5cb14
Ab#75723 (#90)
leefine02 Sep 19, 2025
6243e3e
Update generated docs
Sep 19, 2025
dcfbbe5
ab#76170
Sep 22, 2025
d97f980
Merge branch 'ab#76170' of https://github.com/Keyfactor/remote-file-o…
Sep 22, 2025
9c00853
ab#76170
Sep 23, 2025
c7b59c5
ab#76170
Sep 25, 2025
d4399b3
ab#76170
Sep 26, 2025
973e015
ab#76170
Sep 30, 2025
beb93bb
ab#76170
Oct 20, 2025
da527de
ab#76170
Oct 20, 2025
5b66542
ab#76170
Oct 27, 2025
a91af57
Update generated docs
Oct 27, 2025
6aa94b6
ab#76170
Oct 27, 2025
f9dc1ab
Merge branch 'ab#76170' of https://github.com/Keyfactor/remote-file-o…
Oct 27, 2025
1d87b10
ab#76170
Oct 29, 2025
6b1b601
ab#76170
Oct 30, 2025
1c76847
ab#76170
Oct 31, 2025
a25afcc
ab#76170
Oct 31, 2025
8eb6712
ab#76170
Oct 31, 2025
e13b387
ab#76170
Nov 7, 2025
8a79ba6
Update generated docs
Nov 7, 2025
7504596
ab#76170
Nov 7, 2025
2ee36a9
Merge branch 'ab#76170' of https://github.com/Keyfactor/remote-file-o…
Nov 10, 2025
665cefa
Update generated docs
Nov 10, 2025
00f9d40
ab#76170
Nov 10, 2025
88fb901
Merge branch 'ab#76170' of https://github.com/Keyfactor/remote-file-o…
Nov 10, 2025
3c58d30
Update generated docs
Nov 10, 2025
8f7bfc7
ab#76170
Nov 11, 2025
4336dd7
Merge branch 'ab#76170' of https://github.com/Keyfactor/remote-file-o…
Nov 11, 2025
250c05e
ab#76170
Nov 11, 2025
1685975
Update generated docs
Nov 11, 2025
a6ce8a0
ab#76170
Nov 11, 2025
aa2efba
Merge branch 'ab#76170' of https://github.com/Keyfactor/remote-file-o…
Nov 11, 2025
af5e21f
ab#76170
Nov 11, 2025
498d540
Update generated docs
Nov 11, 2025
26f7ada
ab#76170
Nov 11, 2025
a5f477a
Merge branch 'ab#76170' of https://github.com/Keyfactor/remote-file-o…
Nov 11, 2025
54c7d3f
Update generated docs
Nov 11, 2025
80779a4
ab#76170
Nov 11, 2025
1e0edca
Merge branch 'ab#76170' of https://github.com/Keyfactor/remote-file-o…
Nov 12, 2025
ec1a5cf
ab#76170
Nov 12, 2025
b80d66c
ab#76170
Nov 12, 2025
b847466
Update generated docs
Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .github/workflows/keyfactor-merge-store-types.yml

This file was deleted.

19 changes: 13 additions & 6 deletions .github/workflows/keyfactor-starter-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ on:

jobs:
call-starter-workflow:
uses: keyfactor/actions/.github/workflows/starter.yml@3.1.2
uses: keyfactor/actions/.github/workflows/starter.yml@v4
with:
command_token_url: ${{ vars.COMMAND_TOKEN_URL }} # Only required for doctool generated screenshots
command_hostname: ${{ vars.COMMAND_HOSTNAME }} # Only required for doctool generated screenshots
command_base_api_path: ${{ vars.COMMAND_API_PATH }} # Only required for doctool generated screenshots
secrets:
token: ${{ secrets.V2BUILDTOKEN}}
APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}}
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
scan_token: ${{ secrets.SAST_TOKEN }}
token: ${{ secrets.V2BUILDTOKEN}} # REQUIRED
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} # Only required for golang builds
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} # Only required for golang builds
scan_token: ${{ secrets.SAST_TOKEN }} # REQUIRED
entra_username: ${{ secrets.DOCTOOL_ENTRA_USERNAME }} # Only required for doctool generated screenshots
entra_password: ${{ secrets.DOCTOOL_ENTRA_PASSWD }} # Only required for doctool generated screenshots
command_client_id: ${{ secrets.COMMAND_CLIENT_ID }} # Only required for doctool generated screenshots
command_client_secret: ${{ secrets.COMMAND_CLIENT_SECRET }} # Only required for doctool generated screenshots
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v3.0.0
- Added support for post quantum ML-DSA certificates for store types RFPEM, RFJKS, RFPkcs12, and RFDER
- Added support for On Device Key Generation (ODKG)
- Removed FileTransferProtocol option from the config.json and store type custom fields. Integration will now always attempt SCP first and then SFTP (if SCP fails) for all file transfers.
- Removed .net8/.net6 dual build capabilities. 3.0 and later releases .net8 only due to mandatory use of later Keyfactor libraries that have minimum requirements of .net8.

v2.12.0
- 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.

v2.11.5
- Bug Fix: Rare race condition loading config settings when multiple RemoteFile jobs are running simultaneously on the same orchestrator
- Documentation update to better list out what Linux commands get executed under what situations in Requirements & Prerequisites section
Expand Down
99 changes: 65 additions & 34 deletions README.md

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions RemoteFile.UnitTests/ApplicationSettingsTests.cs

This file was deleted.

48 changes: 0 additions & 48 deletions RemoteFile.UnitTests/PropertyUtilitiesTests.cs

This file was deleted.

9 changes: 6 additions & 3 deletions RemoteFile.UnitTests/RemoteFile.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0"/>
<PackageReference Include="xunit" Version="2.4.1"/>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageReference Include="Keyfactor.Orchestrators.IOrchestratorJobExtensions" Version="1.0.0" />
<PackageReference Include="Keyfactor.PKI" Version="8.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
39 changes: 1 addition & 38 deletions RemoteFile/ApplicationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ namespace Keyfactor.Extensions.Orchestrator.RemoteFile
{
public class ApplicationSettings
{
public enum FileTransferProtocolEnum
{
SCP,
SFTP,
Both
}

private const string DEFAULT_LINUX_PERMISSION_SETTING = "";
private const string DEFAULT_OWNER_SETTING = "";
private const string DEFAULT_SUDO_IMPERSONATION_SETTING = "";
Expand All @@ -40,8 +33,8 @@ public enum FileTransferProtocolEnum
public static string DefaultLinuxPermissionsOnStoreCreation { get { return configuration.ContainsKey("DefaultLinuxPermissionsOnStoreCreation") ? configuration["DefaultLinuxPermissionsOnStoreCreation"] : DEFAULT_LINUX_PERMISSION_SETTING; } }
public static string DefaultOwnerOnStoreCreation { get { return configuration.ContainsKey("DefaultOwnerOnStoreCreation") ? configuration["DefaultOwnerOnStoreCreation"] : DEFAULT_OWNER_SETTING; } }
public static string DefaultSudoImpersonatedUser { get { return configuration.ContainsKey("DefaultSudoImpersonatedUser") ? configuration["DefaultSudoImpersonatedUser"] : DEFAULT_SUDO_IMPERSONATION_SETTING; } }
public static bool CreateCSROnDevice { get { return configuration.ContainsKey("CreateCSROnDevice") ? configuration["CreateCSROnDevice"]?.ToUpper() == "Y" : false; } }
public static string TempFilePathForODKG { get { return configuration.ContainsKey("TempFilePathForODKG") ? configuration["TempFilePathForODKG"] : string.Empty; } }
public static bool UseShellCommands { get { return configuration.ContainsKey("UseShellCommands") ? configuration["UseShellCommands"]?.ToUpper() == "Y" : true; } }
public static int SSHPort
{
get
Expand All @@ -60,34 +53,6 @@ public static int SSHPort
}
}
}
public static FileTransferProtocolEnum FileTransferProtocol
{
get
{
ILogger logger = LogHandler.GetClassLogger<ApplicationSettings>();

string protocolNames = string.Empty;
foreach (string protocolName in Enum.GetNames(typeof(FileTransferProtocolEnum)))
{
protocolNames += protocolName + ", ";
}
protocolNames = protocolNames.Substring(0, protocolNames.Length - 2);
string? protocolValue = configuration["FileTransferProtocol"];

if (!PropertyUtilities.TryEnumParse(protocolValue, out bool isFlagCombination, out FileTransferProtocolEnum protocol))
throw new RemoteFileException($"Invalid optional config.json FileTransferProtocol option of {protocolValue}. If present, must be one of these values: {protocolNames}.");

// Issue: If received a comma-delimited list ("SCP,SFTP,Both"), it's treating it as a flag combination (i.e. mapping it to 0+1+2=3)
// If this happens, we want to default it to Both so it's resolved as a valid mapping.
if (isFlagCombination)
{
logger.LogWarning($"FileTransferProtocol config value {protocolValue} mapped to a flag combination. Setting FileTransferProtocol explicitly to Both.");
protocol = FileTransferProtocolEnum.Both;
}

return protocol;
}
}

static ApplicationSettings()
{
Expand Down Expand Up @@ -142,8 +107,6 @@ private static void ValidateConfiguration(ILogger logger)
logger.LogDebug($"Missing configuration parameter - DefaultLinuxPermissionsOnStoreCreation. Will set to default value of '{DEFAULT_LINUX_PERMISSION_SETTING}'");
if (!configuration.ContainsKey("DefaultOwnerOnStoreCreation"))
logger.LogDebug($"Missing configuration parameter - DefaultOwnerOnStoreCreation. Will set to default value of '{DEFAULT_OWNER_SETTING}'");
if (!configuration.ContainsKey("FileTransferProtocol"))
logger.LogDebug($"Missing configuration parameter - FileTransferProtocol. Will set to default value of 'SCP'");
}

private static string AddTrailingSlash(string path)
Expand Down
2 changes: 1 addition & 1 deletion RemoteFile/Discovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public JobResult ProcessJob(DiscoveryJobConfiguration config, SubmitDiscoveryUpd
string userPassword = PAMUtilities.ResolvePAMField(_resolver, logger, "Server Password", config.ServerPassword);

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

if (directoriesToSearch.Length == 0)
throw new RemoteFileException("Blank or missing search directories for Discovery.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,22 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
// and limitations under the License.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

using Newtonsoft.Json;

using Keyfactor.Extensions.Orchestrator.RemoteFile.Models;
using Keyfactor.Extensions.Orchestrator.RemoteFile.RemoteHandlers;
using Keyfactor.Logging;
using Keyfactor.PKI.CryptographicObjects.Formatters;
using Keyfactor.PKI.PrivateKeys;
using Keyfactor.PKI.X509;
using Keyfactor.Extensions.Orchestrator.RemoteFile.RemoteHandlers;
using Keyfactor.Extensions.Orchestrator.RemoteFile.Models;

using Microsoft.Extensions.Logging;

using Newtonsoft.Json;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Pkcs;
using Org.BouncyCastle.Tls;
using Org.BouncyCastle.X509;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Keyfactor.Extensions.Orchestrator.RemoteFile.DER
{
Expand Down Expand Up @@ -94,8 +92,7 @@ public List<SerializedStoreInfo> SerializeRemoteCertificateStore(Pkcs12Store cer
throw new RemoteFileException($"DER certificate store has a private key at {SeparatePrivateKeyFilePath}, but no private key was passed with the certificate to this job.");
}

CertificateConverter certConverter = CertificateConverterFactory.FromBouncyCastleCertificate(certificateStore.GetCertificate(alias).Certificate);
certificateBytes = certConverter.ToDER(string.IsNullOrEmpty(storePassword) ? string.Empty : storePassword);
certificateBytes = CryptographicObjectFormatter.DER.Format(certificateStore.GetCertificate(alias).Certificate);

if (!string.IsNullOrEmpty(SeparatePrivateKeyFilePath))
{
Expand Down
Loading