Skip to content

Commit 4da9b05

Browse files
joevanwanzeeleKFKeyfactor
andauthored
feat: release 3.2
* separating the writing on passphrase and cert; including parameters for passphrase path and cert and passphrase prop names * added additional logic to build request based on how the secret is stored. * updated remaining cert stores * Update generated docs * Updated password write to preserve existing secret content if any. * Update generated docs * documentation and manifest updates * Update generated docs * Trimming leading slashes from passphrase secret name * Update generated docs * added additional logging and null checking on response data. * Update generated docs * added null check in catch block for reading the cert and passphrase; removed newtonsoft.json from the solution. Added additional logging. * implemented check for KV version, format requests depending on result * Update generated docs * updated read/write operations on kv-v1 to reflect that the secrets are _always_ stored as JSON in v1. --------- Co-authored-by: Keyfactor <keyfactor@keyfactor.github.io>
1 parent aba1c31 commit 4da9b05

File tree

51 files changed

+1564
-534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1564
-534
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 3.2.0
2+
* added parameter "PassphrasePath" to support custom passphrase path (no longer needs to be a secret named 'passphrase' on the same level)
3+
* added support for optional parameter on store path and passphrase path to indicate the property containing the value (if JSON secret)
4+
* the additional parameter and JSON property identifier apply to the following store types: HCVKVJKS, HCVKVP12, HCVKVPKS
5+
16
## 3.1.3
27

38
* documentation fix

README.md

Lines changed: 317 additions & 11 deletions
Large diffs are not rendered by default.

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
36.4 KB
Loading
44.9 KB
Loading
17.5 KB
Loading
19.1 KB
Loading
19.6 KB
Loading

0 commit comments

Comments
 (0)