Skip to content

Commit 34c782f

Browse files
authored
Release 2.1 (#20)
* adding update_catalog property (#18) v2.1.2 - Bug fix: Discovery not working against Windows servers - Bug fix: Issue running Discovery on Windows servers with one or more spaces in the path ---------
1 parent 7f59109 commit 34c782f

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v2.1.2
2+
- Bug fix: Discovery not working against Windows servers
3+
- Bug fix: Issue running Discovery on Windows servers with one or more spaces in the path
4+
15
v2.1
26
- New RFDER certificate store type added
37
- RFPEM modified to now support PKCS#1 private key formats (BEGIN RSA PRIVATE KEY)

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,14 @@ CURL script to automate certificate store type creation can be found [here](Cert
329329
 
330330
## Creating Certificate Stores and Scheduling Discovery Jobs
331331

332-
Please refer to the Keyfactor Command Reference Guide for information on creating certificate stores and scheduling Discovery jobs in Keyfactor Command. However, there are two fields that are important to highlight here - Client Machine and Store Path. For Linux orchestrated servers, "Client Machine" should be the DNS or IP address of the remote orchestrated server while "Store Path" is the full path and file name of the file based store, beginning with a forward slash (/). For Windows orchestrated servers, "Client Machine" should be of the format {protocol}://{dns-or-ip}:{port} where {protocol} is either http or https, {dns-or-ip} is the DNS or IP address of the remote orchestrated server, and {port} is the port where WinRM is listening, by convention usually 5985 for http and 5986 for https. "Store Path" is the full path and file name of the file based store, beginning with a drive letter (i.e. c:\). For example valid values for Client Machine and Store Path for Linux and Windows managed servers may look something like:
332+
Please refer to the Keyfactor Command Reference Guide for information on creating certificate stores and scheduling Discovery jobs in Keyfactor Command. However, there are a few fields that are important to highlight here - Client Machine, Store Path (Creating Certificate Stores), and Directories to search (Discovery jobs) and Extensions (Discovery jobs). For Linux orchestrated servers, "Client Machine" should be the DNS or IP address of the remote orchestrated server while "Store Path" is the full path and file name of the file based store, beginning with a forward slash (/). For Windows orchestrated servers, "Client Machine" should be of the format {protocol}://{dns-or-ip}:{port} where {protocol} is either http or https, {dns-or-ip} is the DNS or IP address of the remote orchestrated server, and {port} is the port where WinRM is listening, by convention usually 5985 for http and 5986 for https. "Store Path" is the full path and file name of the file based store, beginning with a drive letter (i.e. c:\). For example valid values for Client Machine and Store Path for Linux and Windows managed servers may look something like:
333333

334334
Linux: Client Machine - 127.0.0.1 or MyLinuxServerName; Store Path - /home/folder/path/storename.ext
335335
Windows: Client Machine - http<span>s://My.Server.Domain:59</span>86; Store Path - c:\folder\path\storename.ext
336+
337+
For "Directories to search", you can chain paths with a comma delimiter as documented in the Keyfactor Command Reference Guide, but there is also a special value that can be used instead - fullscan. Entering fullscan in this field will tell the RemoteFile discovery job to search all available drive letters and recursively search all of them for files matching the other search criteria.
338+
339+
For "Extensions", a reserved value of noext will cause the RemoteFile discovery job to search for files that do not have an extension. This value can be chained with other extensions using a comma delimiter. For example, entering pem,jks,noext will cause the RemoteFile discovery job to search for files with extensions of PEM or JKS or files that do not have extensions.
336340
&nbsp;
337341
&nbsp;
338342
## Developer Notes

RemoteFile/Discovery.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ public JobResult ProcessJob(DiscoveryJobConfiguration config, SubmitDiscoveryUpd
5353
{
5454
string userName = PAMUtilities.ResolvePAMField(_resolver, logger, "Server User Name", config.ServerUsername);
5555
string userPassword = PAMUtilities.ResolvePAMField(_resolver, logger, "Server Password", config.ServerPassword);
56-
57-
certificateStore = new RemoteCertificateStore(config.ClientMachine, userName, userPassword, directoriesToSearch[0].Substring(0, 1) == "/" ? RemoteCertificateStore.ServerTypeEnum.Linux : RemoteCertificateStore.ServerTypeEnum.Windows);
5856

59-
certificateStore.Initialize();
6057
ApplicationSettings.Initialize(this.GetType().Assembly.Location);
6158

59+
certificateStore = new RemoteCertificateStore(config.ClientMachine, userName, userPassword, directoriesToSearch[0].Substring(0, 1) == "/" ? RemoteCertificateStore.ServerTypeEnum.Linux : RemoteCertificateStore.ServerTypeEnum.Windows);
60+
certificateStore.Initialize();
61+
6262
if (directoriesToSearch.Length == 0)
6363
throw new RemoteFileException("Blank or missing search directories for Discovery.");
6464
if (extensionsToSearch.Length == 0)

RemoteFile/RemoteCertificateStore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ private List<string> FindStoresWindows(string[] paths, string[] extensions, stri
397397
List<string> results = new List<string>();
398398
StringBuilder concatFileNames = new StringBuilder();
399399

400-
if (paths[0] == FULL_SCAN)
400+
if (paths[0].ToLower() == FULL_SCAN)
401401
{
402402
paths = GetAvailableDrives();
403403
for (int i = 0; i < paths.Length; i++)
@@ -439,7 +439,7 @@ private string FormatPath(string path)
439439
logger.MethodEntry(LogLevel.Debug);
440440
logger.MethodExit(LogLevel.Debug);
441441

442-
return path + (path.Substring(path.Length - 1) == @"\" ? string.Empty : @"\");
442+
return "'" + path + (path.Substring(path.Length - 1) == @"\" ? string.Empty : @"\") + "'";
443443
}
444444
}
445445

RemoteFile/RemoteHandlers/WinRMHandler.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,5 @@ private string FormatResult(ICollection<PSObject> results)
254254

255255
return rtn.ToString();
256256
}
257-
258-
private string FormatFTPPath(string path)
259-
{
260-
_logger.MethodEntry(LogLevel.Debug);
261-
_logger.MethodExit(LogLevel.Debug);
262-
263-
return path.Substring(0, 1) == @"/" ? path : @"/" + path.Replace("\\", "/");
264-
}
265257
}
266258
}

readme_source.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,14 @@ CURL script to automate certificate store type creation can be found [here](Cert
268268
&nbsp;
269269
## Creating Certificate Stores and Scheduling Discovery Jobs
270270

271-
Please refer to the Keyfactor Command Reference Guide for information on creating certificate stores and scheduling Discovery jobs in Keyfactor Command. However, there are two fields that are important to highlight here - Client Machine and Store Path. For Linux orchestrated servers, "Client Machine" should be the DNS or IP address of the remote orchestrated server while "Store Path" is the full path and file name of the file based store, beginning with a forward slash (/). For Windows orchestrated servers, "Client Machine" should be of the format {protocol}://{dns-or-ip}:{port} where {protocol} is either http or https, {dns-or-ip} is the DNS or IP address of the remote orchestrated server, and {port} is the port where WinRM is listening, by convention usually 5985 for http and 5986 for https. "Store Path" is the full path and file name of the file based store, beginning with a drive letter (i.e. c:\). For example valid values for Client Machine and Store Path for Linux and Windows managed servers may look something like:
271+
Please refer to the Keyfactor Command Reference Guide for information on creating certificate stores and scheduling Discovery jobs in Keyfactor Command. However, there are a few fields that are important to highlight here - Client Machine, Store Path (Creating Certificate Stores), and Directories to search (Discovery jobs) and Extensions (Discovery jobs). For Linux orchestrated servers, "Client Machine" should be the DNS or IP address of the remote orchestrated server while "Store Path" is the full path and file name of the file based store, beginning with a forward slash (/). For Windows orchestrated servers, "Client Machine" should be of the format {protocol}://{dns-or-ip}:{port} where {protocol} is either http or https, {dns-or-ip} is the DNS or IP address of the remote orchestrated server, and {port} is the port where WinRM is listening, by convention usually 5985 for http and 5986 for https. "Store Path" is the full path and file name of the file based store, beginning with a drive letter (i.e. c:\). For example valid values for Client Machine and Store Path for Linux and Windows managed servers may look something like:
272272

273273
Linux: Client Machine - 127.0.0.1 or MyLinuxServerName; Store Path - /home/folder/path/storename.ext
274274
Windows: Client Machine - http<span>s://My.Server.Domain:59</span>86; Store Path - c:\folder\path\storename.ext
275+
276+
For "Directories to search", you can chain paths with a comma delimiter as documented in the Keyfactor Command Reference Guide, but there is also a special value that can be used instead - fullscan. Entering fullscan in this field will tell the RemoteFile discovery job to search all available drive letters and recursively search all of them for files matching the other search criteria.
277+
278+
For "Extensions", a reserved value of noext will cause the RemoteFile discovery job to search for files that do not have an extension. This value can be chained with other extensions using a comma delimiter. For example, entering pem,jks,noext will cause the RemoteFile discovery job to search for files with extensions of PEM or JKS or files that do not have extensions.
275279
&nbsp;
276280
&nbsp;
277281
## Developer Notes

0 commit comments

Comments
 (0)