Skip to content

Commit 5316fee

Browse files
documentation and manifest updates
1 parent 851ea6c commit 5316fee

File tree

5 files changed

+101
-12
lines changed

5 files changed

+101
-12
lines changed

docsource/hcvkvjks.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,34 @@ The inventory job will catalog the certificates contained within the store. Add
88

99
### Secret naming
1010

11-
In ordered to be managed by this orchestrator extension, a certificate store is comprised of two secret entries:
11+
In order to be managed by this orchestrator extension, a certificate store is comprised of two secret entries:
1212
- The certificate with the naming convention `<certificate name>_jks`
1313
- A secret containing the store passphrase located on the same level. This should be named `passphrase`
1414

15+
This is the convention followed by the certificate store if the full path to the secret is not provided, and no passphrase path is provided.
16+
17+
18+
**As of version 3.2+ of this integration, any secret name can be used, and the passphrase path can be anywhere within an accessable area of the KeyValue secrets engine.**
19+
20+
Additionally, we can read the certificate store and/or passphrase secret from a JSON secret that contains the value on a specific property.
21+
The way to indicate the property name that should be used to retreive the value of the certificate store or passphrase, add a "?" at the end of the path, followed by the property name.
22+
23+
**examples:**
24+
25+
StorePath = `kv-v2/mycerts/myjkscertstore?certData`
26+
> This path indicates that the secret containing the certificate store data is named "myjkscertstore" and is a JSON secret with the `certData` property containing the Base64 encoded certificate store.
27+
>
28+
29+
StorePath = `kv-v2/mycerts/myjkscertstore`
30+
> This path indicates that the entire secret value is the base64 encoded certificate store
31+
32+
> Generally, the paths to the certificate store data and passphrase should be in the following format
33+
> `<mount point>/<path-to-secret>?<json property name>`
34+
35+
36+
This convention applies to both the Store Path and Passphrase Path.
37+
38+
1539
### Base64 encoding
1640

1741
Certificates should be stored in a base64 encoded format.
@@ -46,6 +70,7 @@ Here are the steps for manually creating the store type in Keyfactor Command.
4670
- Click the "Custom Fields" tab to add the following custom fields:
4771
- **MountPoint** - Type: *string*
4872
- **IncludeCertChain** - Type: *bool* (If true, the available intermediate certificates will also be written to Vault during enrollment)
73+
- **PassphrasePath** - Type: *string* (If the passphrase is in a location other than in a secret named 'passphrase' at the same level as the cert store, provide the path here)
4974

5075
![](images/cert-store-type-kv-notPEM-custom-tab.png)
5176

@@ -65,10 +90,11 @@ In Keyfactor Command create a new Certificate Store that resembles the one below
6590

6691
- **Client Machine** - Enter an identifier for the client machine. This could be the Orchestrator host name, or anything else useful. This value is not used by the extension.
6792
- **Store Path** - This is the path after mount point where the certs will be stored.
68-
- example: `kv-v2\kf-secrets\mystore_jks` would use the path "\kf-secrets"
93+
- example: `kv-v2\kf-secrets\mystore_jks`
6994
- **Mount Point** - This is the mount point name for the instance of the Key Value secrets engine.
7095
- If left blank, will default to "kv-v2".
7196
- If your organization utilizes Vault enterprise namespaces, you should include the namespace here.
97+
- **Passphrase Path** - The path to the secret (and optional JSON property) where the certificate store passphrase is located.
7298

7399
#### Set the server username and password
74100

@@ -84,7 +110,10 @@ The certificate store entry is returned from a discovery job when..
84110
1. There is an entry named `passphrase` that contains the password for the store on the same level.
85111
1. The entry for the certificate contain the base64 encoded certificate file.
86112

87-
**Note**: Key/Value secrets that do not include the expected keys or names do not end with "_p12" will be ignored during inventory scans.
113+
> :warning:
114+
> While any secret and passphrase location can be used, the discovery job can only discover certificate stores that follow the default convention.
115+
> If you store your certificate stores and passphrases with another convention, the discovery job will not work in that case.
116+
88117

89118
Set the following fields to configure a discovery job for JKS Certificate Stores:
90119
- **Client Machine** - any string; it is unused by the Discovery job

docsource/hcvkvp12.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,29 @@ In ordered to be managed by this orchestrator extension, a certificate store is
1212
- The certificate with the naming convention `<certificate name>_p12`
1313
- A secret containing the store passphrase located on the same level. This should be named `passphrase`
1414

15+
This is the convention followed by the certificate store if the full path to the secret is not provided, and no passphrase path is provided.
16+
17+
18+
**As of version 3.2+ of this integration, any secret name can be used, and the passphrase path can be anywhere within an accessable area of the KeyValue secrets engine.**
19+
20+
Additionally, we can read the certificate store and/or passphrase secret from a JSON secret that contains the value on a specific property.
21+
The way to indicate the property name that should be used to retreive the value of the certificate store or passphrase, add a "?" at the end of the path, followed by the property name.
22+
23+
**examples:**
24+
25+
StorePath = `kv-v2/mycerts/myjkscertstore?certData`
26+
> This path indicates that the secret containing the certificate store data is named "myjkscertstore" and is a JSON secret with the `certData` property containing the Base64 encoded certificate store.
27+
>
28+
29+
StorePath = `kv-v2/mycerts/myjkscertstore`
30+
> This path indicates that the entire secret value is the base64 encoded certificate store
31+
32+
> Generally, the paths to the certificate store data and passphrase should be in the following format
33+
> `<namespace>/<mount point>/<path-to-secret>?<json property name>`
34+
> if namespaces are not used, that section can be omitted.
35+
36+
This convention applies to both the Store Path and Passphrase Path.
37+
1538
### Base64 encoding
1639

1740
Certificates should be stored in a base64 encoded format.
@@ -46,6 +69,7 @@ Here are the steps for manually creating the store type in Keyfactor Command.
4669
- Click the "Custom Fields" tab to add the following custom fields:
4770
- **MountPoint** - Type: *string*
4871
- **IncludeCertChain** - Type: *bool* (If true, the available intermediate certificates will also be written to Vault during enrollment)
72+
- **PassphrasePath** - Type: *string* (If the passphrase is in a location other than in a secret named 'passphrase' at the same level as the cert store, provide the path here)
4973

5074
![](images/cert-store-type-kv-notPEM-custom-tab.png)
5175

@@ -65,11 +89,11 @@ Create a new Certificate Store that resembles the one below:
6589

6690
- **Client Machine** - Enter an identifier for the client machine. This could be the Orchestrator host name, or anything else useful. This value is not used by the extension.
6791
- **Store Path** - This is the path after mount point where the certs will be stored.
68-
- example: `kv-v2\kf-secrets\mystore_p12` would use the path "\kf-secrets"
92+
- example: `kv-v2\kf-secrets\mystore_p12`
6993
- **Mount Point** - This is the mount point name for the instance of the Key Value secrets engine.
7094
- If left blank, will default to "kv-v2".
7195
- If your organization utilizes Vault enterprise namespaces, you should include the namespace here.
72-
96+
- **Passphrase Path** - The path to the secret (and optional JSON property) where the certificate store passphrase is located.
7397
#### Set the server username and password
7498

7599
- **SERVER USERNAME** should be the full URL to the instance of Vault that will be accessible by the orchestrator. (example: `http://127.0.0.1:8200`)
@@ -86,7 +110,10 @@ The certificate store entry is returned from a discovery job when..
86110
1. There is an entry named `passphrase` that contains the password for the store on the same level.
87111
1. The entry for the certificate contain the base64 encoded certificate file.
88112

89-
**Note**: Key/Value secrets that do not include the expected keys or names do not end with "_p12" will be ignored during inventory scans.
113+
> :warning:
114+
> While any secret and passphrase location can be used, the discovery job can only discover certificate stores that follow the default convention.
115+
> If you store your certificate stores and passphrases with another convention, the discovery job will not work in that case.
116+
90117

91118
Set the following fields to configure a discovery job for PKCS12 Certificate Stores:
92119
- **Client Machine** - any string; it is unused by the Discovery job

docsource/hcvkvpfx.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,28 @@ In ordered to be managed by this orchestrator extension, a certificate store is
1212
- The certificate with the naming convention `<certificate name>_pfx`
1313
- A secret containing the store passphrase located on the same level. This should be named `passphrase`
1414

15+
This is the convention followed by the certificate store if the full path to the secret is not provided, and no passphrase path is provided.
16+
17+
**As of version 3.2+ of this integration, any secret name can be used, and the passphrase path can be anywhere within an accessable area of the KeyValue secrets engine.**
18+
19+
Additionally, we can read the certificate store and/or passphrase secret from a JSON secret that contains the value on a specific property.
20+
The way to indicate the property name that should be used to retreive the value of the certificate store or passphrase, add a "?" at the end of the path, followed by the property name.
21+
22+
**examples:**
23+
24+
StorePath = `kv-v2/mycerts/myjkscertstore?certData`
25+
> This path indicates that the secret containing the certificate store data is named "myjkscertstore" and is a JSON secret with the `certData` property containing the Base64 encoded certificate store.
26+
>
27+
28+
StorePath = `kv-v2/mycerts/myjkscertstore`
29+
> This path indicates that the entire secret value is the base64 encoded certificate store
30+
31+
> Generally, the paths to the certificate store data and passphrase should be in the following format
32+
> `<namespace>/<mount point>/<path-to-secret>?<json property name>`
33+
> if namespaces are not used, that section can be omitted.
34+
35+
This convention applies to both the Store Path and Passphrase Path.
36+
1537
### Base64 encoding
1638

1739
Certificates should be stored in a base64 encoded format.
@@ -46,6 +68,7 @@ Here are the steps for manually creating the store type in Keyfactor Command.
4668
- Click the "Custom Fields" tab to add the following custom fields:
4769
- **MountPoint** - Type: *string*
4870
- **IncludeCertChain** - Type: *bool* (If true, the available intermediate certificates will also be written to Vault during enrollment)
71+
- **PassphrasePath** - Type: *string* (If the passphrase is in a location other than in a secret named 'passphrase' at the same level as the cert store, provide the path here)
4972

5073
![](images/cert-store-type-kv-notPEM-custom-tab.png)
5174

@@ -65,10 +88,11 @@ Create a new Certificate Store that resembles the one below:
6588

6689
- **Client Machine** - Enter an identifier for the client machine. This could be the Orchestrator host name, or anything else useful. This value is not used by the extension.
6790
- **Store Path** - This is the path to the secret containing the store.
68-
- example: `kv-v2\kf-secrets\mystore_pfx` would use the path "\kf-secrets"
91+
- example: `kv-v2\kf-secrets\mystore_pfx`
6992
- **Mount Point** - This is the mount point name for the instance of the Key Value secrets engine.
7093
- If left blank, will default to "kv-v2".
7194
- If your organization utilizes Vault enterprise namespaces, you should include the namespace here.
95+
- **Passphrase Path** - The path to the secret (and optional JSON property) where the certificate store passphrase is located.
7296

7397
#### Set the server username and password
7498

@@ -86,7 +110,9 @@ The certificate store entry is returned from a discovery job when..
86110
1. There is an entry named `passphrase` that contains the password for the store on the same level.
87111
1. The entry for the certificate contain the base64 encoded certificate file.
88112

89-
**Note**: Key/Value secrets that do not include the expected keys or names do not end with "_pfx" will be ignored during inventory scans.
113+
> :warning:
114+
> While any secret and passphrase location can be used, the discovery job can only discover certificate stores that follow the default convention.
115+
> If you store your certificate stores and passphrases with another convention, the discovery job will not work in that case.
90116
91117
Set the following fields to configure a discovery job for PFX Certificate Stores:
92118
- **Client Machine** - any string; it is unused by the Discovery job

hashicorp-vault-orchestrator/FileStores/Pkcs12FileStore.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public Pkcs12FileStore()
3030

3131
public byte[] CreateFileStore(string password)
3232
{
33-
Pkcs12Store newStore = null;
33+
Pkcs12StoreBuilder storeBuilder = new Pkcs12StoreBuilder();
34+
Pkcs12Store newStore = storeBuilder.Build();
3435
using (var outstream = new MemoryStream())
3536
{
3637
logger.LogDebug("Created new PKCS12 store, saving it to outStream");

integration-manifest.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@
6666
"DependsOn": "",
6767
"DefaultValue": "",
6868
"Required": true
69+
},
70+
{
71+
"Name": "PassphrasePath",
72+
"DisplayName": "Passphrase Path",
73+
"Type": "String",
74+
"DependsOn": "",
75+
"DefaultValue": "",
76+
"Required": false,
77+
"Description": "This is the path to the secret that contains the passphrase to the cert store file. If empty or omitted, assume the secret is named 'passphrase' on the same level as the certificate store secret."
6978
}
7079
],
7180
"EntryParameters": [],
@@ -227,7 +236,6 @@
227236
"DependsOn": "",
228237
"DefaultValue": "",
229238
"Required": false,
230-
"IsPAMEligible": true,
231239
"Description": "This is the path to the secret that contains the passphrase to the cert store file. If empty or omitted, assume the secret is named 'passphrase' on the same level as the certificate store secret."
232240
}
233241
],
@@ -310,7 +318,6 @@
310318
"DependsOn": "",
311319
"DefaultValue": "",
312320
"Required": false,
313-
"IsPAMEligible": true,
314321
"Description": "This is the path to the secret that contains the passphrase to the cert store file. If empty or omitted, assume the secret is named 'passphrase' on the same level as the certificate store secret."
315322
}
316323
],
@@ -393,7 +400,6 @@
393400
"DependsOn": "",
394401
"DefaultValue": "",
395402
"Required": false,
396-
"IsPAMEligible": true,
397403
"Description": "This is the path to the secret that contains the passphrase to the cert store file. If empty or omitted, assume the secret is named 'passphrase' on the same level as the certificate store secret."
398404
}
399405
],

0 commit comments

Comments
 (0)