Skip to content

Commit dcb9b89

Browse files
authored
Merge 2213302 into e30f109
2 parents e30f109 + 2213302 commit dcb9b89

8 files changed

Lines changed: 99 additions & 30 deletions

File tree

.github/workflows/keyfactor-bootstrap-workflow-v3.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Keyfactor Bootstrap Workflow
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, closed, synchronize, edited, reopened]
7+
push:
8+
create:
9+
branches:
10+
- 'release-*.*'
11+
12+
jobs:
13+
call-starter-workflow:
14+
uses: keyfactor/actions/.github/workflows/starter.yml@v4
15+
permissions:
16+
contents: write # Explicitly grant write permission
17+
with:
18+
command_token_url: ${{ vars.COMMAND_TOKEN_URL }}
19+
command_hostname: ${{ vars.COMMAND_HOSTNAME }}
20+
command_base_api_path: ${{ vars.COMMAND_API_PATH }}
21+
secrets:
22+
token: ${{ secrets.V2BUILDTOKEN}}
23+
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
24+
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
25+
scan_token: ${{ secrets.SAST_TOKEN }}
26+
entra_username: ${{ secrets.DOCTOOL_ENTRA_USERNAME }}
27+
entra_password: ${{ secrets.DOCTOOL_ENTRA_PASSWD }}
28+
command_client_id: ${{ secrets.COMMAND_CLIENT_ID }}
29+
command_client_secret: ${{ secrets.COMMAND_CLIENT_SECRET }}

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 align="center" style="border-bottom: none">
2-
GlobalSign MSSL Gateway AnyCA Gateway REST Plugin
2+
GlobalSign MSSL AnyCA Gateway REST Plugin
33
</h1>
44

55
<p align="center">
@@ -38,10 +38,10 @@ The GlobalSign CAPlugin enables the Synchronization, Enrollment, and Revocation
3838

3939
## Compatibility
4040

41-
The GlobalSign MSSL Gateway AnyCA Gateway REST plugin is compatible with the Keyfactor AnyCA Gateway REST 25.2.0 and later.
41+
The GlobalSign MSSL AnyCA Gateway REST plugin is compatible with the Keyfactor AnyCA Gateway REST 25.2.0 and later.
4242

4343
## Support
44-
The GlobalSign MSSL Gateway AnyCA Gateway REST plugin is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com.
44+
The GlobalSign MSSL AnyCA Gateway REST plugin is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com.
4545

4646
> 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.
4747
@@ -60,7 +60,7 @@ This extension uses the contact information of the GCC Domain point of contact f
6060

6161
1. Install the AnyCA Gateway REST per the [official Keyfactor documentation](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/InstallIntroduction.htm).
6262

63-
2. On the server hosting the AnyCA Gateway REST, download and unzip the latest [GlobalSign MSSL Gateway AnyCA Gateway REST plugin](https://github.com/Keyfactor/globalsign-mssl-caplugin/releases/latest) from GitHub.
63+
2. On the server hosting the AnyCA Gateway REST, download and unzip the latest [GlobalSign MSSL AnyCA Gateway REST plugin](https://github.com/Keyfactor/globalsign-mssl-caplugin/releases/latest) from GitHub.
6464

6565
3. Copy the unzipped directory (usually called `net6.0` or `net8.0`) to the Extensions directory:
6666

@@ -71,11 +71,11 @@ This extension uses the contact information of the GCC Domain point of contact f
7171
Program Files\Keyfactor\AnyCA Gateway\AnyGatewayREST\net8.0\Extensions
7272
```
7373

74-
> The directory containing the GlobalSign MSSL Gateway AnyCA Gateway REST plugin DLLs (`net6.0` or `net8.0`) can be named anything, as long as it is unique within the `Extensions` directory.
74+
> The directory containing the GlobalSign MSSL AnyCA Gateway REST plugin DLLs (`net6.0` or `net8.0`) can be named anything, as long as it is unique within the `Extensions` directory.
7575

7676
4. Restart the AnyCA Gateway REST service.
7777

78-
5. Navigate to the AnyCA Gateway REST portal and verify that the Gateway recognizes the GlobalSign MSSL Gateway plugin by hovering over the ⓘ symbol to the right of the Gateway on the top left of the portal.
78+
5. Navigate to the AnyCA Gateway REST portal and verify that the Gateway recognizes the GlobalSign MSSL plugin by hovering over the ⓘ symbol to the right of the Gateway on the top left of the portal.
7979

8080
## Configuration
8181

@@ -103,8 +103,9 @@ This extension uses the contact information of the GCC Domain point of contact f
103103
* **RetryCount** - This is the number of times the AnyGateway will attempt to pickup an new certificate before reporting an error. Default is 5.
104104
* **SyncIntervalDays** - OPTIONAL: Required if SyncStartDate is used. Specifies how to page the certificate sync. Should be a value such that no interval of that length contains > 500 certificate enrollments.
105105
* **SyncStartDate** - If provided, full syncs will start at the specified date.
106+
* **Enabled** - Flag to Enable or Disable gateway functionality. Disabling is primarily used to allow creation of the CA prior to configuration information being available.
106107

107-
2. Define [Certificate Profiles](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCP-Gateway.htm) and [Certificate Templates](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCA-Gateway.htm) for the Certificate Authority as required. One Certificate Profile must be defined per Certificate Template. It's recommended that each Certificate Profile be named after the Product ID. The GlobalSign MSSL Gateway plugin supports the following product IDs:
108+
2. Define [Certificate Profiles](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCP-Gateway.htm) and [Certificate Templates](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCA-Gateway.htm) for the Certificate Authority as required. One Certificate Profile must be defined per Certificate Template. It's recommended that each Certificate Profile be named after the Product ID. The GlobalSign MSSL plugin supports the following product IDs:
108109
109110
* **PEV_SHA2**
110111
* **PEV**

globalsign-mssl-caplugin/Client/GlobalSignApiClient.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ public GlobalSignApiClient(GlobalSignCAConfig config, ILogger logger)
2626
Logger = logger;
2727
Config = config;
2828
// Logger = LogHandler.GetClassLogger(this.GetType());
29+
var enabled =config.Enabled;
30+
if (!enabled)
31+
{
32+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping config validation and MSSL Client creation...");
33+
Logger.MethodExit();
34+
return;
35+
}
2936
QueryService = new GASV1Client
3037
{
3138
Endpoint = { Address = new EndpointAddress(config.GetUrl(GlobalSignServiceType.QUERY)), Name = "QUERY" }

globalsign-mssl-caplugin/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ internal class Constants
2121
public static string PICKUPDELAY = "DelayTime";
2222
public static string SYNCSTARTDATE = "SyncStartDate";
2323
public static string SYNCINTERNVALDAYS = "SyncIntervalDays";
24+
public static string Enabled = "Enabled";
2425
}
2526

2627
public static class EnrollmentConfigConstants

globalsign-mssl-caplugin/GlobalSignCAConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class GlobalSignCAConfig
3232

3333
public string SyncStartDate { get; set; } = "";
3434
public int SyncIntervalDays { get; set; } = 0;
35-
35+
public bool Enabled { get; set; } = true;
3636

3737
public string GetUrl(GlobalSignServiceType queryType)
3838
{

globalsign-mssl-caplugin/GlobalSignCAPlugin.cs

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,25 @@ public class GlobalSignCAPlugin : IAnyCAPlugin
2323
private ICertificateDataReader? _certificateDataReader;
2424
private ILogger Logger;
2525

26-
private GlobalSignCAConfig Config { get; set; } = new();
27-
26+
private GlobalSignCAConfig Config { get; set; } = new();
27+
private bool _enabled = false;
2828

2929
public void Initialize(IAnyCAPluginConfigProvider configProvider, ICertificateDataReader certificateDataReader)
3030
{
3131
Logger = LogHandler.GetClassLogger(GetType());
3232
Logger.MethodEntry();
33+
var enabledValue = configProvider.CAConnectionData["Enabled"];
34+
bool isEnabled = enabledValue is bool ? (bool)enabledValue : bool.Parse((string)enabledValue);
35+
if (!isEnabled)
36+
{
37+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping config validation and MSSL Client creation...");
38+
Logger.MethodExit();
39+
return;
40+
}
3341
Config = new GlobalSignCAConfig
3442
{
3543
IsTest = bool.Parse((string)configProvider.CAConnectionData["TestAPI"]),
44+
Enabled = isEnabled,
3645
Password = (string)configProvider.CAConnectionData["GlobalSignPassword"],
3746
Username = (string)configProvider.CAConnectionData["GlobalSignUsername"],
3847
PickupDelay = int.Parse((string)configProvider.CAConnectionData["DelayTime"]),
@@ -426,6 +435,12 @@ public async Task<EnrollmentResult> Enroll(string csr, string subject, Dictionar
426435
public async Task Ping()
427436
{
428437
Logger.MethodEntry();
438+
if (!_enabled)
439+
{
440+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping config validation and MSSL Client creation...");
441+
Logger.MethodExit();
442+
return;
443+
}
429444
try
430445
{
431446
Logger.LogInformation("Ping reqeuest recieved");
@@ -443,6 +458,18 @@ public async Task ValidateCAConnectionInfo(Dictionary<string, object> connection
443458
{
444459
Logger = LogHandler.GetClassLogger(GetType());
445460
Logger.MethodEntry();
461+
462+
// Handle Enabled flag - could be bool or string
463+
var enabledValue = connectionInfo["Enabled"];
464+
bool isEnabled = enabledValue is bool ? (bool)enabledValue : bool.Parse((string)enabledValue);
465+
466+
if (!isEnabled)
467+
{
468+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping validation...");
469+
Logger.MethodExit(LogLevel.Trace);
470+
return;
471+
}
472+
446473
Config = new GlobalSignCAConfig
447474
{
448475
IsTest = bool.Parse((string)connectionInfo["TestAPI"]),
@@ -455,6 +482,7 @@ public async Task ValidateCAConnectionInfo(Dictionary<string, object> connection
455482
ORDER_TEST_URL = (string)connectionInfo["OrderAPITestURL"],
456483
QUERY_TEST_URL = (string)connectionInfo["QueryAPITestURL"],
457484
QUERY_PROD_URL = (string)connectionInfo["QueryAPIProdURL"],
485+
Enabled = isEnabled,
458486
SyncStartDate = connectionInfo.TryGetValue("SyncStartDate", out object? value)
459487
? (string)value : string.Empty,
460488
SyncIntervalDays = connectionInfo.TryGetValue("SyncIntervalDays", out var val)
@@ -470,6 +498,17 @@ public async Task ValidateCAConnectionInfo(Dictionary<string, object> connection
470498

471499
public Task ValidateProductInfo(EnrollmentProductInfo productInfo, Dictionary<string, object> connectionInfo)
472500
{
501+
// Handle Enabled flag - could be bool or string
502+
var enabledValue = connectionInfo["Enabled"];
503+
bool isEnabled = enabledValue is bool ? (bool)enabledValue : bool.Parse((string)enabledValue);
504+
505+
if (!isEnabled)
506+
{
507+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping validation...");
508+
Logger.MethodExit(LogLevel.Trace);
509+
return Task.CompletedTask;
510+
}
511+
473512
Config = new GlobalSignCAConfig
474513
{
475514
IsTest = bool.Parse((string)connectionInfo["TestAPI"]),
@@ -482,6 +521,7 @@ public Task ValidateProductInfo(EnrollmentProductInfo productInfo, Dictionary<st
482521
ORDER_TEST_URL = (string)connectionInfo["OrderAPITestURL"],
483522
QUERY_TEST_URL = (string)connectionInfo["QueryAPITestURL"],
484523
QUERY_PROD_URL = (string)connectionInfo["QueryAPIProdURL"],
524+
Enabled = isEnabled,
485525
SyncStartDate = connectionInfo.TryGetValue("SyncStartDate", out object? value)
486526
? (string)value : string.Empty,
487527
SyncIntervalDays = connectionInfo.TryGetValue("SyncIntervalDays", out var val)
@@ -592,6 +632,13 @@ public Dictionary<string, PropertyConfigInfo> GetCAConnectorAnnotations()
592632
Hidden = false,
593633
DefaultValue = "2000-01-01",
594634
Type = "Integer"
635+
},
636+
[Constants.Enabled] = new()
637+
{
638+
Comments = "Flag to Enable or Disable gateway functionality. Disabling is primarily used to allow creation of the CA prior to configuration information being available.",
639+
Hidden = false,
640+
DefaultValue = true,
641+
Type = "Boolean"
595642
}
596643
};
597644
}

integration-manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
{
6161
"name": "SyncStartDate",
6262
"description": "If provided, full syncs will start at the specified date."
63+
},
64+
{
65+
"name": "Enabled",
66+
"description": "Flag to Enable or Disable gateway functionality. Disabling is primarily used to allow creation of the CA prior to configuration information being available."
6367
}
6468
],
6569
"enrollment_config": [

0 commit comments

Comments
 (0)