Skip to content

Commit a115994

Browse files
authored
Reconcile main from Release 1.2 (#12)
* Added parameters and updated documentation to support other azure clouds and private endpoints. * updated integration manifest with new properties. * Updated to search across all subscriptions and tenants for discovery. * fixed resource ID in api request * fixed subscription resource identifier in API call. * updated CHANGELOG * Update generated README
1 parent 361f382 commit a115994

12 files changed

+262
-122
lines changed

AzureAppGatewayOrchestrator.sln

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.0.33130.402
4+
VisualStudioVersion = 17.7.34221.43
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureAppGatewayOrchestrator", "AzureAppGatewayOrchestrator\AzureAppGatewayOrchestrator.csproj", "{F091A1E1-7168-47EC-854D-A05B36E83A68}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureAppGatewayTest", "AzureAppGatewayTest\AzureAppGatewayTest.csproj", "{140A37F7-A02E-4FA2-BB52-A82080DA0423}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureAppGatewayTest", "AzureAppGatewayTest\AzureAppGatewayTest.csproj", "{140A37F7-A02E-4FA2-BB52-A82080DA0423}"
9+
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3D61BD61-AAD0-41E8-A41D-194FED668C42}"
11+
ProjectSection(SolutionItems) = preProject
12+
CHANGELOG.md = CHANGELOG.md
13+
integration-manifest.json = integration-manifest.json
14+
readme_source.md = readme_source.md
15+
EndProjectSection
916
EndProject
1017
Global
1118
GlobalSection(SolutionConfigurationPlatforms) = preSolution

AzureAppGatewayOrchestrator/AzureAppGatewayOrchestrator.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<RootNamespace>Keyfactor.Extensions.Orchestrator.AzureAppGateway</RootNamespace>
66
<AssemblyName>Keyfactor.Extensions.Orchestrators.AzureAppGW</AssemblyName>
77
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
@@ -11,7 +11,7 @@
1111

1212
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
1313
<DefineConstants></DefineConstants>
14-
<BaseOutputPath>C:\Program Files\Keyfactor\Keyfactor Orchestrator\extensions\AzureAppGW</BaseOutputPath>
14+
<BaseOutputPath></BaseOutputPath>
1515
</PropertyGroup>
1616

1717
<ItemGroup>

AzureAppGatewayOrchestrator/Client/AzureAppGatewayClient.cs

Lines changed: 128 additions & 95 deletions
Large diffs are not rendered by default.

AzureAppGatewayOrchestrator/Client/AzureProperties.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// limitations under the License.
1414

1515
using Azure.Core;
16+
using Azure.Identity;
17+
using System;
18+
using System.Collections.Generic;
1619

1720
namespace Keyfactor.Extensions.Orchestrator.AzureAppGateway.Client
1821
{
@@ -21,5 +24,26 @@ public class AzureProperties
2124
public string TenantId { get; set; }
2225
public string ApplicationId { get; set; }
2326
public string ClientSecret { get; set; }
27+
public string AzureCloud { get; set; }
28+
public string StorePath { get; set; }
29+
public List<string> TenantIdsForDiscovery { get; set; }
30+
public Uri AzureCloudEndpoint
31+
{
32+
get
33+
{
34+
switch (AzureCloud)
35+
{
36+
37+
case "china":
38+
return AzureAuthorityHosts.AzureChina;
39+
case "germany":
40+
return AzureAuthorityHosts.AzureGermany;
41+
case "government":
42+
return AzureAuthorityHosts.AzureGovernment;
43+
default:
44+
return AzureAuthorityHosts.AzurePublicCloud;
45+
}
46+
}
47+
}
2448
}
2549
}

AzureAppGatewayOrchestrator/Jobs/AzureAppGatewayJob.cs

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
using System.Collections.Generic;
1516
using System.Runtime.CompilerServices;
1617
using Azure.Core;
1718
using Keyfactor.Extensions.Orchestrator.AzureAppGateway.Client;
@@ -34,18 +35,19 @@ protected void Initialize(CertificateStore details)
3435
logger.LogDebug($"Certificate Store Configuration: {JsonConvert.SerializeObject(details)}");
3536
logger.LogDebug("Initializing AzureAppGatewayClient");
3637
dynamic properties = JsonConvert.DeserializeObject(details.Properties);
37-
38+
3839
AzureProperties azureProperties = new AzureProperties
3940
{
4041
TenantId = details.ClientMachine,
4142
ApplicationId = properties?.ServerUsername,
42-
ClientSecret = properties?.ServerPassword
43-
};
44-
45-
GatewayClient = new AzureAppGatewayClient(azureProperties)
46-
{
47-
AppGatewayResourceId = new ResourceIdentifier(details.StorePath)
43+
ClientSecret = properties?.ServerPassword,
44+
AzureCloud = properties?.AzureCloud,
45+
StorePath = details?.StorePath
4846
};
47+
48+
azureProperties.AzureCloud = azureProperties.AzureCloud?.ToLower();
49+
50+
GatewayClient = new AzureAppGatewayClient(azureProperties);
4951
}
5052

5153
protected void Initialize(DiscoveryJobConfiguration config)
@@ -57,9 +59,28 @@ protected void Initialize(DiscoveryJobConfiguration config)
5759
{
5860
TenantId = config.ClientMachine,
5961
ApplicationId = config.ServerUsername,
60-
ClientSecret = config.ServerPassword
62+
ClientSecret = config.ServerPassword,
63+
6164
};
62-
65+
logger.LogTrace("Discovery job - getting tenant ids from directories to search field.");
66+
azureProperties.TenantIdsForDiscovery = new List<string>();
67+
var dirs = config.JobProperties?["dirs"] as string;
68+
logger.LogTrace($"Directories to search: {dirs}");
69+
70+
if (!string.IsNullOrEmpty(dirs))
71+
{
72+
// parse the list of tenant ids to perform discovery on
73+
azureProperties.TenantIdsForDiscovery.AddRange(dirs.Split(','));
74+
}
75+
else
76+
{
77+
// if it is empty, we use the default provided Tenant Id only
78+
azureProperties.TenantIdsForDiscovery.Add(azureProperties.TenantId);
79+
}
80+
81+
azureProperties.TenantIdsForDiscovery.ForEach(tId => tId = tId.Trim());
82+
azureProperties.TenantId = azureProperties.TenantId ?? azureProperties.TenantIdsForDiscovery[0];
83+
6384
GatewayClient = new AzureAppGatewayClient(azureProperties);
6485
}
6586
}

AzureAppGatewayOrchestrator/Jobs/Management.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
using System;
16-
using Azure.ResourceManager.Network.Models;
1716
using Keyfactor.Logging;
1817
using Keyfactor.Orchestrators.Common.Enums;
1918
using Keyfactor.Orchestrators.Extensions;

AzureAppGatewayTest/AzureAppGatewayTest.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

AzureAppGatewayTest/Program.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ public Program()
5454
ClientSecret = Environment.GetEnvironmentVariable("AZURE_CLIENT_SECRET") ?? string.Empty
5555
};
5656

57-
Client = new AzureAppGatewayClient(properties)
58-
{
59-
AppGatewayResourceId = new ResourceIdentifier(Environment.GetEnvironmentVariable("AZURE_GATEWAY_RESOURCE_ID") ?? string.Empty)
60-
};
57+
Client = new AzureAppGatewayClient(properties);
6158
}
6259

6360
private AzureAppGatewayClient Client { get; }
@@ -67,7 +64,7 @@ public void TestGetCertificates()
6764
Console.Write("Getting App Gateway Certificates...\n");
6865
foreach (CurrentInventoryItem certInv in Client.GetAppGatewaySslCertificates())
6966
{
70-
Console.Write($" Found certificate called {certInv.Alias}\n");
67+
Console.Write($"Found certificate called {certInv.Alias}\n");
7168
}
7269
}
7370

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
v1.1.0
2-
- First production release
1+
- 1.1.0
2+
- First production release
3+
4+
- 1.2.0
5+
- Added support for additional Azure global cloud instances (Government, China, Germany)
6+
- New store type property ("Azure Cloud")

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The Universal Orchestrator is the successor to the Windows Orchestrator. This Or
1616

1717
## Support for Azure Application Gateway Orchestrator
1818

19-
Azure Application Gateway Orchestrator is open source and there is **no SLA** for this tool/library/client. Keyfactor will address issues as resources become available. Keyfactor customers may request escalation by opening up a support ticket through their Keyfactor representative.
19+
Azure Application Gateway Orchestrator is open source and supported on best effort level for this tool/library/client. This means customers can report Bugs, Feature Requests, Documentation amendment or questions as well as requests for customer information required for setup that needs Keyfactor access to obtain. Such requests do not follow normal SLA commitments for response or resolution. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com/
2020

2121
###### 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.
2222

@@ -26,6 +26,10 @@ Azure Application Gateway Orchestrator is open source and there is **no SLA** fo
2626

2727

2828

29+
## Keyfactor Version Supported
30+
31+
The minimum version of the Keyfactor Universal Orchestrator Framework needed to run this version of the extension is 10.1
32+
2933
## Platform Specific Notes
3034

3135
The Keyfactor Universal Orchestrator may be installed on either Windows or Linux based platforms. The certificate operations supported by a capability may vary based what platform the capability is installed on. The table below indicates what capabilities are supported based on which platform the encompassing Universal Orchestrator is running.
@@ -110,6 +114,22 @@ by Keyfactor Orchestrators. To create the Azure Application Gateway Certificate
110114
"DefaultValue": null,
111115
"Required": true
112116
},
117+
{
118+
"Name": "AzureCloud",
119+
"DisplayName": "Azure Cloud",
120+
"Type": "MultipleChoice",
121+
"DependsOn": "",
122+
"DefaultValue": "public,china,germany,government",
123+
"Required": false
124+
},
125+
{
126+
"Name": "PrivateEndpoint",
127+
"DisplayName": "Private KeyVault Endpoint",
128+
"Type": "String",
129+
"DependsOn": "",
130+
"DefaultValue": null,
131+
"Required": false
132+
},
113133
{
114134
"Name": "ServerUseSsl",
115135
"DisplayName": "Use SSL",
@@ -161,9 +181,14 @@ fill the form with the following values:
161181
| Store Path | Application Gateway resource ID | Azure resource ID of the application gateway in the form `/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Network/applicationGateways/<application-gateway-name>` |
162182
| Server Username | Application ID | Application ID of the service principal that will be used to manage the Application Gateway |
163183
| Server Password | Client Secret | Secret of the service principal that will be used to manage the Application Gateway |
184+
| Azure Cloud | Azure Global Cloud Authority Host | The Azure Cloud field, if necessary, should contain one of the following values: "china, germany, government". This is the Azure Cloud instance your organization uses. If using the standard "public" cloud, this field can be left blank or omitted entirely from the store type definition. |
185+
| Private Endpoint | Azure Private Endpoint URL prefix | The Private Endpoint field should be used if you have a custom url assigned to your keyvault resources and they are not accessible via the standard endpoint associated with the Azure Cloud instance (\*.vault.azure.net, \*.vault.azure.cn, etc.). This field should contain the base url for your vault instance(s), excluding the vault name. If using the standard endpoints corresponding to your Azure Cloud instance, this field can be left blank or omitted entirely from the store type definition.|
164186
165187
For the discovery job, populate the _Directories to search_ with any value. The extension will discover all Application Gateways accessible by the Azure Service Principal.
166188
189+
> :warning: Discovery jobs are not supported for KeyVaults located outside of the Azure Public cloud or Keyvaults accessed via a private url endpoint.
190+
> All other job types implemented by this integration are supported for alternate Azure clouds and private endpoints.
191+
167192
### Important note about Certificate Renewal
168193
The Azure Application Gateway Orchestrator extension supports certificate renewal. If a certificate is renewed and is associated with an HTTP Listener,
169194
the extension will automatically re-associate the renewed certificate with the listener. The renewal workflow is as follows:

0 commit comments

Comments
 (0)