Skip to content

Commit 506893a

Browse files
authored
Oracle Wallet & Ability to use separate group id when creating Linux store (#32)
* Add Group Ownership * Oracle Wallet and Group Name Specification * Discovery bug fix
1 parent e5d2876 commit 506893a

File tree

13 files changed

+423
-46
lines changed

13 files changed

+423
-46
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v2.3.0
2+
- New RFORA store type for Oracle Wallet support
3+
- Add ability to set separate owner and group id's when creating certificate stores.
4+
- Bug fix: "noext" extension option for Discovery on Windows servers
5+
- Bug fix: Added parentheses as valid characters for store path on Windows servers.
6+
17
v2.2.0
28
- Add ability to manage same windows server as installed without using WinRM
39
- Check for "core" version of PowerShell for command tweaks

README.md

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ The Universal Orchestrator is part of the Keyfactor software distribution and is
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

1616

17+
## Support for Remote File
1718

19+
Remote File
20+
21+
###### 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.
1822

1923

2024
---
@@ -104,6 +108,7 @@ The Remote File Orchestrator Extension is a multi-purpose integration that can r
104108
- PEM formatted files
105109
- DER formatted files
106110
- IBM Key Database files (KDB)
111+
- Oracle Wallet Pkcs12 files
107112

108113
While the Keyfactor Universal Orchestrator (UO) can be installed on either Windows or Linux; likewise, the Remote File Orchestrator Extension can be used to manage certificate stores residing on both Windows and Linux servers. The supported configurations of Universal Orchestrator hosts and managed orchestrated servers are shown below:
109114

@@ -173,7 +178,7 @@ The Remote File Orchestrator Extension uses a JSON configuration file. It is lo
173178
**SeparateUploadFilePath**(Applicable for Linux managed servers only) – Set this to the path you wish to use as the location on the orchestrated server to upload/download and later remove temporary work files when processing jobs. If set to "" or not provided, the location of the certificate store itself will be used. File transfer itself is performed using SCP or SFTP protocols (see FileT ransferProtocol setting). **Default Value if missing - blank**.
174179
**FileTransferProtocol** (Applicable for Linux orchestrated servers only) - SCP/SFTP/Both - Determines the protocol to use when uploading/downloading files while processing a job. Valid values are: SCP - uses SCP, SFTP - uses SFTP, or Both - will attempt to use SCP first, and if that does not work, will attempt the file transfer via SFTP. **Default Value if missing - SCP**.
175180
**DefaultLinuxPermissionsOnStoreCreation** (Applicable for Linux managed servers only) - Value must be 3 digits all between 0-7. The Linux file permissions that will be set on a new certificate store created via a Management Create job or a Management Add job where CreateStoreOnAddIsMissing is set to "Y". This value will be used for all certificate stores managed by this orchestrator instance unless overridden by the optional "Linux File Permissions on Store Creation" custom parameter setting on a specific certificate store (See the "Certificatee Store Types Supported" section later in this README). **Default Value if missing - 600**.
176-
**DefaultOwnerOnStoreCreation** (Applicable for Linux managed servers only) - When a Management job is run to remotely create the physical certificate store on a remote server, by default the file owner will be set to the user name associated with the Keyfactor certificate store. Setting DefaultOwnerOnStoreCreation to an alternative valid Linux user name will set that as the owner instead. Please make sure that the user associated with the certificate store will have valid permissions to chown the certificate store file to this alernative owner. The optional "Linux File Owner on Store Creation" custom parameter setting for a specific certificate store (See the "Certificatee Store Types Supported" section later in this README) can override this value for a specific store. **Default Value if missing - blank**.
181+
**DefaultOwnerOnStoreCreation** (Applicable for Linux managed servers only) - When a Management job is run to remotely create the physical certificate store on a remote server, by default the file owner and group will be set to the user name associated with the Keyfactor certificate store. Setting DefaultOwnerOnStoreCreation to an alternative valid Linux user name will set that as the owner/group instead. If the group and owner need to be different values, use a ":" as a delimitter between the owner and group values, such as ownerId:groupId. Please make sure that the user associated with the certificate store will have valid permissions to chown the certificate store file to this alernative owner. The optional "Linux File Owner on Store Creation" custom parameter setting for a specific certificate store (See the "Certificatee Store Types Supported" section later in this README) can override this value for a specific store. **Default Value if missing - blank**.
177182
 
178183
 
179184
## Certificate Store Types
@@ -188,7 +193,7 @@ When setting up the certificate store types you wish the Remote File Orchestrato
188193
- **Supported Job Types** - Inventory, Add, Remove, Create, and Discovery should all be checked.
189194
- **Needs Server** - Checked
190195
- **Blueprint Allowed** - Checked if you wish to make use of blueprinting. Please refer to the Keyfactor Command Reference Guide for more details on this feature.
191-
- **Uses PoserShell** - Unchecked
196+
- **Uses PowerShell** - Unchecked
192197
- **Requires Store Password** - Checked. NOTE: This does not require that a certificate store have a password, but merely ensures that a user who creates a Keyfactor Command Certificate Store MUST click the Store Password button and either enter a password or check No Password. Certificate stores with no passwords are still possible for certain certificate store types when checking this option.
193198
- **Supports Entry Password** - Unchecked.
194199

@@ -200,7 +205,7 @@ When setting up the certificate store types you wish the Remote File Orchestrato
200205

201206
*Custom Fields Tab:*
202207
- **Name:** LinuxFilePermissionsOnStoreCreation, **Display Name:** Linux File Permissions on Store Creation, **Type:** String, **Default Value:** none. This custom field is **not required**. If not present, value reverts back to the DefaultLinuxPermissionsOnStoreCreation setting in config.json (see Configuration File Setup section above). This value, applicable to certificate stores hosted on Linux orchestrated servers only, must be 3 digits all between 0-7. This represents the Linux file permissions that will be set for this certificate store if created via a Management Create job or a Management Add job where the config.json option CreateStoreOnAddIsMissing is set to "Y".
203-
- **Name:** LinuxFileOwnerOnStoreCreation, **Display Name:** Linux File Owner on Store Creation, **Type:** String, **Default Value:** none. This custom field is **not required**. If not present, value reverts back to the DefaultOwnerOnStoreCreation setting in config.json (see Configuration File Setup section above). This value, applicable to certificate stores hosted on Linux orchestrated servers only, represents the alternate Linux file owner that will be set for this certificate store if created via a Management Create job or a Management Add job where the config.json option CreateStoreOnAddIsMissing is set to "Y". Please confirm that the user name associated with this Keyfactor certificate store has valid permissions to chown the certificate file to this owner.
208+
- **Name:** LinuxFileOwnerOnStoreCreation, **Display Name:** Linux File Owner on Store Creation, **Type:** String, **Default Value:** none. This custom field is **not required**. If not present, value reverts back to the DefaultOwnerOnStoreCreation setting in config.json (see Configuration File Setup section above). This value, applicable to certificate stores hosted on Linux orchestrated servers only, represents the alternate Linux file owner/group that will be set for this certificate store if created via a Management Create job or a Management Add job where the config.json option CreateStoreOnAddIsMissing is set to "Y". If the group and owner need to be different values, use a ":" as a delimitter between the owner and group values, such as ownerId:groupId. Please confirm that the user name associated with this Keyfactor certificate store has valid permissions to chown the certificate file to this owner.
204209

205210
Entry Parameters Tab:
206211
- See specific certificate store type instructions below
@@ -232,9 +237,6 @@ Use cases supported:
232237
Entry Parameters Tab:
233238
- no additional entry parameters
234239

235-
 
236-
CURL script to automate certificate store type creation can be found [here](Certificate%20Store%20Type%20CURL%20Scripts/PKCS12.curl)
237-
238240
 
239241
 
240242
**************************************
@@ -262,9 +264,6 @@ Use cases supported:
262264
Entry Parameters Tab:
263265
- no additional entry parameters
264266

265-
 
266-
CURL script to automate certificate store type creation can be found [here](Certificate%20Store%20Type%20CURL%20Scripts/JKS.curl)
267-
268267
 
269268
 
270269
**************************************
@@ -297,9 +296,6 @@ Use cases supported:
297296
Entry Parameters Tab:
298297
- no additional entry parameters
299298

300-
 
301-
CURL script to automate certificate store type creation can be found [here](Certificate%20Store%20Type%20CURL%20Scripts/PEM.curl)
302-
303299
 
304300
 
305301
**************************************
@@ -326,9 +322,6 @@ Use cases supported:
326322
Entry Parameters Tab:
327323
- no additional entry parameters
328324

329-
 
330-
CURL script to automate certificate store type creation can be found [here](Certificate%20Store%20Type%20CURL%20Scripts/DER.curl)
331-
332325
 
333326
 
334327
**************************************
@@ -357,7 +350,31 @@ Entry Parameters Tab:
357350
- no additional entry parameters
358351

359352
 
360-
CURL script to automate certificate store type creation can be found [here](Certificate%20Store%20Type%20CURL%20Scripts/KDB.curl)
353+
 
354+
**************************************
355+
**RFORA Certificate Store Type**
356+
**************************************
357+
358+
The RFORA store type can be used to manage Pkcs2 Oracle Wallets. Please note that while this should work for Pkcs12 Oracle Wallets installed on both Windows and Linux servers, this has only been tested on wallets installed on Windows. Please note, when entering the Store Path for an Oracle Wallet in Keyfactor Command, make sure to INCLUDE the eWallet.p12 file name that by convention is the name of the Pkcs12 wallet file that gets created.
359+
360+
Use cases supported:
361+
1. One-to-many trust entries - A single certificate without a private key in a certificate store. Each certificate identified with a custom alias or certificate thumbprint.
362+
2. One-to-many key entries - One-to-many certificates with private keys and optionally the full certificate chain. Each certificate identified with a custom alias or certificate thumbprint.
363+
3. A mix of trust and key entries.
364+
365+
**Specific Certificate Store Type Values**
366+
*Basic Tab:*
367+
- **Short Name** – Required. Suggested value - **RFORA**. If you choose to use a different value you must make the corresponding modification to the manifest.json file (see "Remote File Orchestrator Extension Installation", step 6 above).
368+
369+
*Advanced Tab:*
370+
- **Supports Custom Alias** - Required.
371+
- **Private Key Handling** - Optional.
372+
373+
*Custom Fields Tab:*
374+
- **Name:** WorkFolder, **Display Name:** Work Folder, **Type:** String, **Default Value:** empty. This custom field is **required**. This required field should contain the path on the managed server where temporary work files can be created during Inventory and Management jobs. These files will be removed at the end of each job Please make sure that user id you have assigned to this certificate store will have access to create, modify, and delete files from this folder.
375+
376+
Entry Parameters Tab:
377+
- no additional entry parameters
361378

362379
 
363380
 

RemoteFile/Discovery.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public JobResult ProcessJob(DiscoveryJobConfiguration config, SubmitDiscoveryUpd
6868

6969
locations = certificateStore.FindStores(directoriesToSearch, extensionsToSearch, filesTosearch, includeSymLinks);
7070
foreach (string ignoredDir in ignoredDirs)
71-
locations = locations.Where(p => !p.StartsWith(ignoredDir)).ToList();
71+
{
72+
locations = locations.Where(p => !p.StartsWith(ignoredDir) || !p.ToLower().StartsWith("find:")).ToList();
73+
}
7274
}
7375
catch (Exception ex)
7476
{

RemoteFile/ImplementedStoreTypes/JKS/JKSCertificateStoreSerializer.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using Org.BouncyCastle.X509;
1919

2020
using Microsoft.Extensions.Logging;
21+
using Keyfactor.Orchestrators.Extensions;
2122

2223
namespace Keyfactor.Extensions.Orchestrator.RemoteFile.JKS
2324
{
@@ -44,7 +45,7 @@ public Pkcs12Store DeserializeRemoteCertificateStore(byte[] storeContents, strin
4445
jksStore.Load(ms, string.IsNullOrEmpty(storePassword) ? new char[0] : storePassword.ToCharArray());
4546
}
4647

47-
foreach(string alias in jksStore.Aliases)
48+
foreach (string alias in jksStore.Aliases)
4849
{
4950
if (jksStore.IsKeyEntry(alias))
5051
{
@@ -84,15 +85,15 @@ public List<SerializedStoreInfo> SerializeRemoteCertificateStore(Pkcs12Store cer
8485

8586
JksStore jksStore = new JksStore();
8687

87-
foreach(string alias in certificateStore.Aliases)
88+
foreach (string alias in certificateStore.Aliases)
8889
{
8990
if (certificateStore.IsKeyEntry(alias))
9091
{
9192
AsymmetricKeyEntry keyEntry = certificateStore.GetKey(alias);
9293
X509CertificateEntry[] certificateChain = certificateStore.GetCertificateChain(alias);
9394

9495
List<X509Certificate> certificates = new List<X509Certificate>();
95-
foreach(X509CertificateEntry certificateEntry in certificateChain)
96+
foreach (X509CertificateEntry certificateEntry in certificateChain)
9697
{
9798
certificates.Add(certificateEntry.Certificate);
9899
}
@@ -110,7 +111,7 @@ public List<SerializedStoreInfo> SerializeRemoteCertificateStore(Pkcs12Store cer
110111
jksStore.Save(outStream, string.IsNullOrEmpty(storePassword) ? new char[0] : storePassword.ToCharArray());
111112

112113
List<SerializedStoreInfo> storeInfo = new List<SerializedStoreInfo>();
113-
storeInfo.Add(new SerializedStoreInfo() { FilePath = storePath+storeFileName, Contents = outStream.ToArray() });
114+
storeInfo.Add(new SerializedStoreInfo() { FilePath = storePath + storeFileName, Contents = outStream.ToArray() });
114115

115116
logger.MethodExit(LogLevel.Debug);
116117
return storeInfo;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2021 Keyfactor
2+
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
3+
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
5+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
6+
// and limitations under the License.
7+
8+
using Keyfactor.Extensions.Orchestrator.RemoteFile.KDB;
9+
using Keyfactor.Orchestrators.Extensions.Interfaces;
10+
11+
namespace Keyfactor.Extensions.Orchestrator.RemoteFile.OraWlt
12+
{
13+
public class Inventory : InventoryBase
14+
{
15+
internal override ICertificateStoreSerializer GetCertificateStoreSerializer(string storeProperties)
16+
{
17+
return new OraWltCertificateStoreSerializer(storeProperties);
18+
}
19+
20+
public Inventory(IPAMSecretResolver resolver)
21+
{
22+
_resolver = resolver;
23+
}
24+
}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2021 Keyfactor
2+
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
3+
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
5+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
6+
// and limitations under the License.
7+
8+
using Keyfactor.Extensions.Orchestrator.RemoteFile.KDB;
9+
using Keyfactor.Orchestrators.Extensions.Interfaces;
10+
11+
namespace Keyfactor.Extensions.Orchestrator.RemoteFile.OraWlt
12+
{
13+
public class Management : ManagementBase
14+
{
15+
internal override ICertificateStoreSerializer GetCertificateStoreSerializer(string storeProperties)
16+
{
17+
return new OraWltCertificateStoreSerializer(storeProperties);
18+
}
19+
20+
public Management(IPAMSecretResolver resolver)
21+
{
22+
_resolver = resolver;
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)