Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

48867 add ssh #130

Open
wants to merge 27 commits into
base: release-2.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e3370a4
Started making changes to handle ssh connections.
Sep 5, 2024
c3912ab
Merge branch '48867-Add_SSH' into 62847-Update_SNI_Flags
rcpokorny Oct 8, 2024
9c8767e
Merge pull request #119 from Keyfactor/62847-Update_SNI_Flags
rcpokorny Oct 8, 2024
ccd3a21
Just moving code to cloud
Oct 18, 2024
b921fc4
Debugging IIS Scripts
Oct 22, 2024
3f1b1a9
Added PowerShell runspace for localMachines
Oct 22, 2024
62187bb
Added null check for PAM object
Oct 23, 2024
0a59d74
Updated code for WinCert and WinIIS
Oct 24, 2024
a930299
This commit fixes WinCert Add and WinIIS Add and Bind (both for local…
Oct 25, 2024
dd74cf1
Testing
Oct 30, 2024
eb44b0d
testing
Nov 4, 2024
b76ed18
testing
Nov 11, 2024
618335d
Merge branch '48867-Add_SSH' of https://github.com/Keyfactor/iis-orch…
Nov 11, 2024
17560cf
Testing
Nov 22, 2024
06fee4b
Merge branch '48867-Add_SSH' of https://github.com/Keyfactor/iis-orch…
Nov 22, 2024
60a1a82
Testing ReEnrollment
Nov 22, 2024
8ea49ab
Testing SQL ReEnrollment
Nov 26, 2024
81dc282
Testing SQL ReEnrollment
Nov 26, 2024
39b445b
ssh changes
Dec 13, 2024
10f0a49
Minor Script changes/improvements
Jan 3, 2025
4a29385
Testing SSH on Linux
Jan 21, 2025
9951651
Finished testing; cleaning up code.
Feb 12, 2025
a25c1a2
Started removing unnecessary code and files.
Feb 12, 2025
30a24ae
Cleaned up unused old code and removed unnecessary files.
Feb 13, 2025
f7d395e
Completed cleaning up code. Ready for Pre-Release.
Feb 13, 2025
52d9fdb
Update integration-manifest.json
rcpokorny Feb 17, 2025
de6ddb8
firx PR#130 merge conflict
Feb 17, 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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2.5.1
* Fixed WinSQL service name when InstanceID differs from InstanceName
2.6.0
* Added the ability to run the extension in a Linux environment. To utilize this change, for each Cert Store Types (WinCert/WinIIS/WinSQL), add ssh to the Custom Field <b>WinRM Protocol</b>. When using ssh as a protocol, make sure to enter the appropriate ssh port number under WinRM Port.
* NOTE: For legacy purposes the Display names WinRM Protocol and WinRM Port are maintained although the type of protocols now includes ssh.
* Moved all inventory and management jobs to external PowerShell script file .\PowerShellScripts\WinCertScripts.ps1

2.5.0
* Added the Bindings to the end of the thumbprint to make the alias unique.
Expand Down
43 changes: 21 additions & 22 deletions IISU/Certificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// 021225 rcp 2.6.0 Cleaned up and verified code

using Newtonsoft.Json;
using System;
using System.Linq;
using System.Text.RegularExpressions;
using System.Collections.Generic;

namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore
{
Expand All @@ -29,30 +31,27 @@ public class Certificate

public class Utilities
{
public static string FormatSAN(string san)
public static List<T> DeserializeCertificates<T>(string jsonResults)
{
// Use regular expression to extract key-value pairs
var regex = new Regex(@"(?<key>DNS Name|Email|IP Address)=(?<value>[^=,\s]+)");
var matches = regex.Matches(san);

// Format matches into the desired format
string result = string.Join("&", matches.Cast<Match>()
.Select(m => $"{NormalizeKey(m.Groups["key"].Value)}={m.Groups["value"].Value}"));

return result;
}
if (string.IsNullOrEmpty(jsonResults))
{
// Handle no objects returned
return new List<T>();
}

private static string NormalizeKey(string key)
{
return key.ToLower() switch
// Determine if the JSON is an array or a single object
if (jsonResults.TrimStart().StartsWith("["))
{
"dns name" => "dns",
"email" => "email",
"ip address" => "ip",
_ => key.ToLower() // For other types, keep them as-is
};
// It's an array, deserialize as list
return JsonConvert.DeserializeObject<List<T>>(jsonResults);
}
else
{
// It's a single object, wrap it in a list
var singleObject = JsonConvert.DeserializeObject<T>(jsonResults);
return new List<T> { singleObject };
}
}

}
}
}
211 changes: 0 additions & 211 deletions IISU/CertificateStore.cs

This file was deleted.

101 changes: 0 additions & 101 deletions IISU/ClientPSCertStoreInventory.cs

This file was deleted.

Loading
Loading