Skip to content

Commit 13e6818

Browse files
authored
Merge da527de into 7930e17
2 parents 7930e17 + da527de commit 13e6818

38 files changed

+504
-356
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.5
25
- Bug Fix: Rare race condition loading config settings when multiple RemoteFile jobs are running simultaneously on the same orchestrator
36
- Documentation update to better list out what Linux commands get executed under what situations in Requirements & Prerequisites section

README.md

Lines changed: 44 additions & 1 deletion
Large diffs are not rendered by default.

RemoteFile.UnitTests/RemoteFile.UnitTests.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

88
<IsPackable>false</IsPackable>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0"/>
13-
<PackageReference Include="xunit" Version="2.4.1"/>
12+
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />
13+
<PackageReference Include="Keyfactor.PKI" Version="8.1.1" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
15+
<PackageReference Include="xunit" Version="2.4.1" />
1416
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
1517
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1618
<PrivateAssets>all</PrivateAssets>

RemoteFile/ApplicationSettings.cs

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

RemoteFile/Discovery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public JobResult ProcessJob(DiscoveryJobConfiguration config, SubmitDiscoveryUpd
5757
string userPassword = PAMUtilities.ResolvePAMField(_resolver, logger, "Server Password", config.ServerPassword);
5858

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

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

RemoteFile/ImplementedStoreTypes/DER/DERCertificateStoreSerializer.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,22 @@
55
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
66
// and limitations under the License.
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.IO;
11-
using System.Linq;
12-
13-
using Newtonsoft.Json;
14-
8+
using Keyfactor.Extensions.Orchestrator.RemoteFile.Models;
9+
using Keyfactor.Extensions.Orchestrator.RemoteFile.RemoteHandlers;
1510
using Keyfactor.Logging;
11+
using Keyfactor.PKI.CryptographicObjects.Formatters;
1612
using Keyfactor.PKI.PrivateKeys;
1713
using Keyfactor.PKI.X509;
18-
using Keyfactor.Extensions.Orchestrator.RemoteFile.RemoteHandlers;
19-
using Keyfactor.Extensions.Orchestrator.RemoteFile.Models;
20-
2114
using Microsoft.Extensions.Logging;
22-
15+
using Newtonsoft.Json;
2316
using Org.BouncyCastle.Crypto;
2417
using Org.BouncyCastle.Pkcs;
18+
using Org.BouncyCastle.Tls;
2519
using Org.BouncyCastle.X509;
20+
using System;
21+
using System.Collections.Generic;
22+
using System.IO;
23+
using System.Linq;
2624

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

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

10097
if (!string.IsNullOrEmpty(SeparatePrivateKeyFilePath))
10198
{

0 commit comments

Comments
 (0)