Skip to content

Commit 36ae054

Browse files
authored
Merge pull request #4 from Keyfactor/release-1.0
Merge 1.0.0 to main
2 parents 3048539 + 72b02ab commit 36ae054

20 files changed

Lines changed: 353 additions & 206 deletions

README.md

Lines changed: 196 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,222 @@
1-
# cpr-cagateway-template
1+
<h1 align="center" style="border-bottom: none">
2+
Aruba Clearpass Gateway AnyCA Gateway REST Plugin
3+
</h1>
4+
5+
<p align="center">
6+
<!-- Badges -->
7+
<img src="https://img.shields.io/badge/integration_status-pilot-3D1973?style=flat-square" alt="Integration Status: pilot" />
8+
<a href="https://github.com/Keyfactor/aruba-clearpass-caplugin/releases"><img src="https://img.shields.io/github/v/release/Keyfactor/aruba-clearpass-caplugin?style=flat-square" alt="Release" /></a>
9+
<img src="https://img.shields.io/github/issues/Keyfactor/aruba-clearpass-caplugin?style=flat-square" alt="Issues" />
10+
<img src="https://img.shields.io/github/downloads/Keyfactor/aruba-clearpass-caplugin/total?style=flat-square&label=downloads&color=28B905" alt="GitHub Downloads (all assets, all releases)" />
11+
</p>
12+
13+
<p align="center">
14+
<!-- TOC -->
15+
<a href="#support">
16+
<b>Support</b>
17+
</a>
18+
·
19+
<a href="#requirements">
20+
<b>Requirements</b>
21+
</a>
22+
·
23+
<a href="#installation">
24+
<b>Installation</b>
25+
</a>
26+
·
27+
<a href="#license">
28+
<b>License</b>
29+
</a>
30+
·
31+
<a href="https://github.com/orgs/Keyfactor/repositories?q=anycagateway">
32+
<b>Related Integrations</b>
33+
</a>
34+
</p>
35+
36+
37+
The Clearpass AnyCA Gateway REST plugin extends the capabilities of Aruba Clearpass Onboard to Keyfactor Command via the Keyfactor AnyCA Gateway REST. The plugin represents a fully featured AnyCA REST Plugin with the following capabilies :
38+
* CA Sync:
39+
* Download all certificates issued to the customer by the Clearpass CA.
40+
* Certificate enrollment for the Clearpass products listed in the manifest file:
41+
* Support certificate enrollment (new keys/certificate)
42+
* Support certificate re-issuance/renewal (new public/private keys with the same or different domain names).
43+
* Certificate revocation:
44+
* Request revocation of a previously issued certificate.
45+
46+
## Compatibility
47+
48+
The Aruba Clearpass Gateway AnyCA Gateway REST plugin is compatible with the Keyfactor AnyCA Gateway REST 24.2.0 and later.
49+
50+
## Support
51+
The Aruba Clearpass 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.
52+
53+
> 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.
54+
55+
## Requirements
256

3-
## Template for new CA Gateway integrations
57+
---
458

5-
### Use this repository to create new integrations for new CA Gateway integration types.
59+
### ClearPass Onboard: Setting Up an API Client
660

61+
#### Step 1: Access ClearPass Admin Console
62+
1. **Login** to the ClearPass Admin console using your administrator credentials.
63+
2. Navigate to **Administration** > **API Services** > **API Clients**.
764

8-
1. [Use this repository](#using-the-repository)
9-
1. [Update the integration-manifest.json](#updating-the-integration-manifest.json)
10-
1. [Add Keyfactor Bootstrap Workflow (keyfactor-bootstrap-workflow.yml)](#add-bootstrap)
11-
1. [Create required branches](#create-required-branches)
12-
1. [Replace template files/folders](#replace-template-files-and-folders)
13-
1. [Create initial prerelease](#create-initial-prerelease)
14-
---
65+
#### Step 2: Create a New API Client
66+
1. Click on the **Add API Client** button to create a new API client.
1567

16-
#### Using the repository
17-
1. Select the ```Use this template``` button at the top of this page
18-
1. Update the repository name following [these guidelines](https://keyfactorinc.sharepoint.com/sites/IntegrationWiki/SitePages/GitHub-Processes.aspx#repository-naming-conventions)
19-
1. All repositories must be in lower-case
20-
1. General pattern: company-product-type
21-
1. e.g. hashicorp-vault-orchestator
22-
1. Click the ```Create repository``` button
68+
#### Step 3: Configure the API Client
2369

24-
---
70+
- **Client ID**:
71+
- Enter some value such as `Client1` in the **Client ID** field.
72+
- This is the value you will use in Keyfactor for the API Client ID when setting up the CA.
2573

26-
#### Updating the integration-manifest.json
74+
- **Description**:
75+
- You can provide a description for this API client, such as "Sample API client for testing purposes," in the **Description** field.
2776

28-
*The following properties must be updated in the integration-manifest.json*
77+
- **Enabled**:
78+
- Ensure the **Enabled** checkbox is selected. This means the API client will be active and able to make API calls.
2979

30-
Clone the repository locally, use vsdev.io, or the GitHub online editor to update the file.
80+
- **Operating Mode**:
81+
- Select **ClearPass REST API - Client will be used for API calls to ClearPass** from the **Operating Mode** dropdown.
3182

32-
* "name": "Friendly name for the integration"
33-
* This will be used in the readme file generation and catalog entries
34-
* "description": "Brief description of the integration."
35-
* This will be used in the readme file generation
36-
* If the repository description is empty this value will be used for the repository description upon creating a release branch
37-
* "release_dir": "PATH\\\TO\\\BINARY\\\RELEASE\\\OUTPUT\\\FOLDER"
38-
* Path separators can be "\\\\" or "/"
39-
* Be sure to specify the release folder name. This can be found by running a Release build and noting the output folder
40-
* Example: "AzureAppGatewayOrchestrator\\bin\\Release"
41-
* "gateway_framework": "" string denoting the required command gateway framework version
42-
---
83+
- **Operator Profile**:
84+
- Select **Super Administrator** from the **Operator Profile** dropdown.
85+
- This profile will provide the API client with the necessary permissions to interact with ClearPass.
4386

44-
#### Add Bootstrap
45-
Add Keyfactor Bootstrap Workflow (keyfactor-bootstrap-workflow.yml). This can be copied directly from the workflow templates or through the Actions tab
46-
* Directly:
47-
1. Create a file named ```.github\workflows\keyfactor-bootstrap-workflow.yml```
48-
1. Copy the contents of [keyfactor/.github/workflow-templates/keyfactor-bootstrap-workflow.yml](https://raw.githubusercontent.com/Keyfactor/.github/main/workflow-templates/keyfactor-bootstrap-workflow.yml) into the file created in the previous step
49-
* Actions tab:
50-
1. Navigate to the [Actions tab](./actions) in the new repository
51-
1. Click the ```New workflow``` button
52-
1. Find the ```Keyfactor Bootstrap Workflow``` and click the ```Configure``` button
53-
1. Click the ```Commit changes...``` button on this screen and the next to add the bootstrap workflow to the main branch
54-
55-
A new build will run the tasks of a *Push* trigger on the main branch
56-
57-
*Ensure there are no errors during the workflow run in the Actions tab.*
87+
- **Grant Type**:
88+
- Select **Client credentials (`grant_type=client_credentials`)** from the **Grant Type** dropdown.
89+
- This means the API client will authenticate using its client credentials.
5890

59-
---
91+
- **Client Secret**:
92+
- Since this is a non-public client, ensure the **Generate a new client secret** checkbox is selected.
93+
- The system will generate a new client secret. For example, `FFFDDDCCCRRR4444DDDDDDDDDDD`.
94+
- **Note:** The client secret is used in the OAuth2 `client_secret` parameter and will be encrypted once stored, so be sure to copy it securely.
95+
96+
#### Step 4: Set Token Lifetimes
6097

61-
#### Create required branches
62-
1. Create a release branch from main: release-1.0
63-
1. Create a dev branch from the starting with the devops id in the format ab#\<DevOps-ID>, e.g. ab#53535.
64-
1. For the cleanest pull request merge, create the dev branch from the release branch.
65-
1. Optionally, add a suffix to the branch name indicating initial release. e.g. ab#53535-initial-release
98+
- **Access Token Lifetime**:
99+
- Enter `8` in the **Access Token Lifetime** field.
100+
- Select **hours** from the dropdown. This means the access token will be valid for 8 hours.
101+
102+
#### Step 5: Save the API Client
103+
1. Once all fields are configured, click the **Create API Client** button to save the new API client.
104+
2. If you need to cancel, click the **Cancel** button.
105+
106+
#### Step 6: Use the API Client
107+
- Use the **Client ID** (`Client1`) and **Client Secret** (`FFFDDDCCCRRR4444DDDDDDDDDDD`) in your Gateway Configuration Settings.
66108

67109
---
68110

111+
### Getting the Certificate Authority ID in Aruba ClearPass Onboard
112+
113+
#### Steps to Get the Certificate Authority ID
114+
115+
1. **Log in to ClearPass Policy Manager**:
116+
- Open your web browser and navigate to the ClearPass Policy Manager login page.
117+
- Enter your credentials and log in.
118+
119+
2. **Navigate to the Certificate Authorities Page**:
120+
- Go to **Onboard** > **Certificate Authorities**.
69121

70-
#### Replace template files and folders
71-
1. Replace the contents of readme_source.md
72-
1. Create a CHANGELOG.md file in the root of the repository indicating ```1.0: Initial release```
73-
1. Replace the SampleOrchestratorExtension.sln solution file and SampleOrchestratorExtension folder with your new orchestrator dotnet solution
74-
1. Push your updates to the dev branch (ab#xxxxx)
122+
3. **Select the Certificate Authority**:
123+
- Find the Certificate Authority you are interested in.
124+
- Click the **Edit** button next to the Certificate Authority.
125+
126+
4. **Locate the ID in the URL**:
127+
- Once the edit page opens, look at the URL in your browser's address bar.
128+
- The ID of the Certificate Authority will be part of the URL. It usually appears as a numeric value after `id=`.
129+
130+
5. **Command Gateway Translation**:
131+
- This will be used when setting up the Gateway as the CaId as explained in the Configuration section.
132+
133+
#### Note
134+
At the time of writing, there was no API call available to get a list of Certificate Authorities in ClearPass Onboard. Therefore, this method of extracting the ID from the URL was the only known way to obtain it.
75135

76136
---
77137

138+
### Aruba ClearPass Onboard Trust Chain Bundle Download
139+
140+
#### Steps to Download a Trust Chain Bundle
141+
142+
1. **Log in to ClearPass Policy Manager**:
143+
- Open your web browser and navigate to the ClearPass Policy Manager login page.
144+
- Enter your credentials and log in.
145+
146+
2. **Navigate to the Certificate Authority Trust Chain Page**:
147+
- Go to **Onboard** > **Certificate Authorities**.
148+
- Click on the appropriate **Certificate Authority**.
149+
- Click the **Trust Chain** link.
150+
151+
3. **Download the Trust Chain Bundle**:
152+
- Click the **Download Bundle** link on the Certificate Authority Trust Chain page.
153+
- The **Export Certificate** form will open.
154+
- In the **Format** row, choose the certificate format.
155+
- Follow the prompts to download the trust chain bundle.
156+
157+
4. **Save the Bundle**:
158+
- Save the downloaded bundle to a secure location on your computer.
159+
160+
5. **Using The Intermediate Certificate**:
161+
- Extract the Intermediate Certificate from the Bundle. This will be the certificate used when setting up the CA on the Gateway.
162+
163+
## Installation
164+
165+
1. Install the AnyCA Gateway REST per the [official Keyfactor documentation](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/InstallIntroduction.htm).
166+
167+
2. On the server hosting the AnyCA Gateway REST, download and unzip the latest [Aruba Clearpass Gateway AnyCA Gateway REST plugin](https://github.com/Keyfactor/aruba-clearpass-caplugin/releases/latest) from GitHub.
168+
169+
3. Copy the unzipped directory (usually called `net6.0`) to the Extensions directory:
170+
171+
```shell
172+
Program Files\Keyfactor\AnyCA Gateway\AnyGatewayREST\net6.0\Extensions
173+
```
174+
175+
> The directory containing the Aruba Clearpass Gateway AnyCA Gateway REST plugin DLLs (`net6.0`) can be named anything, as long as it is unique within the `Extensions` directory.
176+
177+
4. Restart the AnyCA Gateway REST service.
178+
179+
5. Navigate to the AnyCA Gateway REST portal and verify that the Gateway recognizes the Aruba Clearpass Gateway plugin by hovering over the ⓘ symbol to the right of the Gateway on the top left of the portal.
180+
181+
## Configuration
182+
183+
1. Follow the [official AnyCA Gateway REST documentation](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCA-Gateway.htm) to define a new Certificate Authority, and use the notes below to configure the **Gateway Registration** and **CA Connection** tabs:
184+
185+
* **Gateway Registration**
186+
187+
TODO Gateway Registration is a required section
188+
189+
* **CA Connection**
190+
191+
Populate using the configuration fields collected in the [requirements](#requirements) section.
192+
193+
* **ClientSecret** - Client Secret for Generating Bearer Token
194+
* **BaseUrl** - Base Url for ClearPass API such as https://url:8443
195+
* **ClearPassApiClient** - ClearPass API Client Name
196+
* **ClearPassCaId** - ClearPass Ca Id. Example would be 2. In ClearPass Onboard UI, click edit on the Ca and look at the id in the Url.
197+
198+
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 Aruba Clearpass Gateway plugin supports the following product IDs:
199+
200+
* **ca**
201+
* **code-signing**
202+
* **https**
203+
* **tls-client**
204+
* **trusted**
205+
206+
3. Follow the [official Keyfactor documentation](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCA-Keyfactor.htm) to add each defined Certificate Authority to Keyfactor Command and import the newly defined Certificate Templates.
207+
208+
4. In Keyfactor Command (v12.3+), for each imported Certificate Template, follow the [official documentation](https://software.keyfactor.com/Core-OnPrem/Current/Content/ReferenceGuide/Configuring%20Template%20Options.htm) to define enrollment fields for each of the following parameters:
209+
210+
* **NumberOfDaysValid** - OPTIONAL: The number of days of validity to use when requesting certs. If not provided, default is 365.
211+
212+
78213
79-
#### Create initial prerelease
80-
1. Create a pull request from the dev branch to the release-1.0 branch
81214
82215
83-
----
216+
## License
84217
85-
When the repository is ready for SE Demo, change the following property:
86-
* "status": "pilot"
218+
Apache License 2.0, see [LICENSE](LICENSE).
87219
88-
When the integration has been approved by Support and Delivery teams, change the following property:
89-
* "status": "production"
220+
## Related Integrations
90221
91-
If the repository is ready to be published in the public catalog, the following properties must be updated:
92-
* "update_catalog": true
93-
* "link_github": true
222+
See all [Keyfactor Any CA Gateways (REST)](https://github.com/orgs/Keyfactor/repositories?q=anycagateway).

aruba-clearpass-caplugin/ArubaClearPassCAPlugin.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
using Keyfactor.AnyGateway.Extensions;
2-
using Keyfactor.Common;
3-
using Keyfactor.Common.Exceptions;
42
using Keyfactor.Extensions.CAPlugin.ArubaClearPass.Client;
5-
using Keyfactor.Extensions.CAPlugin.ArubaClearPass.Models;
63
using Keyfactor.Logging;
7-
using Keyfactor.PKI.Enums;
84
using Keyfactor.PKI.Enums.EJBCA;
95
using Microsoft.Extensions.Logging;
10-
using Microsoft.Extensions.Logging.Abstractions;
11-
using Microsoft.VisualBasic;
12-
136
using Newtonsoft.Json;
14-
15-
using Org.BouncyCastle.Asn1.X509;
7+
using System;
168
using System.Collections.Concurrent;
17-
using System.Runtime.ConstrainedExecution;
18-
using System.Runtime.InteropServices;
19-
using static Keyfactor.PKI.PKIConstants.Microsoft;
9+
using System.Collections.Generic;
10+
using System.Linq;
11+
using System.Threading;
12+
using System.Threading.Tasks;
13+
2014

2115
using ArubaClearPassConstants = Keyfactor.Extensions.CAPlugin.ArubaClearPass.Constants;
2216

@@ -280,6 +274,11 @@ public List<string> GetProductIds()
280274
};
281275
}
282276

277+
Task<AnyCAPluginCertificate> IAnyCAPlugin.GetSingleRecord(string caRequestID)
278+
{
279+
throw new NotImplementedException();
280+
}
281+
283282
}
284283
}
285284

aruba-clearpass-caplugin/Client/ClearPassClient.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
using Microsoft.Extensions.Logging;
88
using Keyfactor.Logging;
99
using Keyfactor.PKI.Enums.EJBCA;
10-
using Org.BouncyCastle.Tls;
1110
using Certificate = Keyfactor.Extensions.CAPlugin.ArubaClearPass.Models.Certificate;
1211
using Keyfactor.Extensions.CAPlugin.Aruba.Models;
12+
using System.Net.Http;
13+
using System;
14+
using System.Threading.Tasks;
15+
using System.Collections.Generic;
16+
using System.Threading;
1317

1418
namespace Keyfactor.Extensions.CAPlugin.ArubaClearPass.Client
1519
{

aruba-clearpass-caplugin/Constants.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace Keyfactor.Extensions.CAPlugin.ArubaClearPass
1+
namespace Keyfactor.Extensions.CAPlugin.ArubaClearPass
82
{
93
public class Constants
104
{

aruba-clearpass-caplugin/Models/AuthPrivileges.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
1+
using System.Collections.Generic;
2+
63

74
namespace Keyfactor.Extensions.CAPlugin.Aruba.Models
85
{

aruba-clearpass-caplugin/Models/Certificate.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
63
using Newtonsoft.Json;
74

85
namespace Keyfactor.Extensions.CAPlugin.ArubaClearPass.Models

aruba-clearpass-caplugin/Models/CertificateListResponse.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Newtonsoft.Json;
2-
using System;
32
using System.Collections.Generic;
43

54

aruba-clearpass-caplugin/Models/EnrollCertificateRequest.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
using Newtonsoft.Json;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
72

83
namespace Keyfactor.Extensions.CAPlugin.ArubaClearPass.Models
94
{

0 commit comments

Comments
 (0)