Skip to content

Commit 286b2d7

Browse files
spbsolubleKeyfactorMichael Henderson
authored
Pan feedback (#22)
* feat(storetypes): Adding new storetypes `K8SNamespace` and `K8SCluster` * feat(storetype): Added `K8SPFX` and `K8SPKCS12` storetypes feat(inventory): Inventory supports K8S opaque secrets w/ keys `p12`, `pfx`, `pkcs12` sourcing password from `password` field on same secret. * feat(storetype): K8SCluster store type is now available for inventory feat(storetype): K8SNS store type is now available for inventory * feat(management): Management add and remove now work for store types K8SCluster and K8SNS * feat: K8SPKCS12 storetypes now support companion K8S secrets feat(discovery): K8SPKCS12 store types support discovery. feat(management): K8SPKCS12 store types now support add and remove. * feat(inventory): `K8SPKCS12` now supports field name extensions. ex: `myhost.pkcs12` fix(inventory): `K8SPKCS12` now uses correct store password hierarchy. fix(management): `K8SPKCS12` add/remove now add and remove into existing pkcs12 stores. * fix(discovery): `K8SPKCS12` now support use of extensions field chore(docs): Updated docs for `K8SPKCS12`. Field name changes required!. * Update generated README * fix: Adding tests back so build passes * feat(discovery): `K8SJKS` discovery support. * feat(inventory): `K8SJKS` inventory initial support * fix(discovery): JKS and PKCS12 discovery added additional logging for allowed keys check. fix(management): PKCS12 logs actually indicate PKCS12. * fix(storetypes): `K8SJKS` now inventories legacy JKS file types properly. chore(deps): Upgraded to `net6.0` * chore(scripts): Adding scripts relevant to creating JKS files. * fix(inventory): `K8SJKS` inventory now works properly with attached and remote K8S passwords, and now supports implied namespace when specifying `StorePasswordPath` * fix(inventory): KubeSecretType parameters are now case insensitive. * feat(management): `K8SJKS` now support add and remove, but require custom alias `k8s_field_name/alias`. * fix(discovery): `K8SJKS` case issue. chore(docs): Update `K8SJKS` docs with storepath and alias patterns. * Update generated README * fix(inventory): `K8SPKCS12` storetype now uses custom alias to support multiple PKCS12 on a single K8S secret. * fix(inventory): `K8SJKS` & `K8SPKCS12` storetypes now fail when the secret isn't found. fix(management): `K8SPKCS12` storetypes now preserve additional secret fields if they exist. * fix(inventory): K8SPKCS12 stores don't use CN as alias. fix(management): K8SPKCS12 add/remove operations now don't fail when the K8S secret doesn't exist. * fix(management): K8SJKS stores now preserve existing secret data if it exists. * fix(management): K8SJKS stores handle secrets w/o existing fields. fix(management): K8SJKS & K8SPKCS12 stores pass chain properly back to Command. * fix(inventory): `K8STLCSECR`, `K8SSECRET`, `K8SCLUSTER` stores now read and pass full chain back to Command. chore: linting * Update generated README * fix(inventory): `K8SSECRET` and `K8STLSSECR` now return cert chains back to Command. fix(management): `K8SSECRET` and `K8STLSSECR` now deploy cert chains back to the K8S secrets. chore(docs): Update docs with notes on managing `K8SSECRET` and `K8STLSSECR` stores. * Update generated README * fix(discovery): `K8SJKS` and `K8SPKCS12` no longer try to check if data is valid pkcs12 or jks file. * chore(docs): Adding screenshots around cluster secrets * Update generated README * chore(logging): Added some verbose logging around handling `K8SJKS` stores. * fix(management): `K8SCLUSTER`, `K8STLSSECR`, `K8SSECRET` stores now have option to use a separate field for chain: `ca.crt`. This defaults to `false`. * chore(docs): Store type definitions now allow for `SeparateChain` which defaults to `false`. This means the field `ca.crt` will not be used for `opaque` and `tls` secrets. * Update generated README * fix(inventory): `K8SJKS` stores that are actually `PKCS12` format inventory chain properly. * fix(management): `K8SJKS` management for jks of type `PKCS12` * fix(inventory): `K8SPKCS12` stores inventory properly after allowing `allowedKeys` to be passed. fix(inventory): `K8STLSSECR` & `K8SSECRET` stores now return empty inventory and a warning if secret is not found in k8s. * fix(manifest): Revert manifest changes to storetypes. * chore(docs): Adding some general info around K8SPKCS12 stores. chore(docs): Updated manifest to reflect production ready. * Update generated README * chore(docs): JKS and PKCS12 secret key verbiage clarification. * Update generated README * chore: [skip ci] Comment out autochangelog workflow. * [skip ci] chore(lint): Remove irrelevant TODOs and add license header. * [skip ci] chore(docs): Fix `CHANGELOG` formatting. * chore(docs): Added missing descriptions for `IncludeCertChain` and `SeparateChain`. chore(docs): Removed `required` status from `KubeSecretName` and `KubeNamespace` to allow implication via storepath. chore(manifest): Updated storetype definitions with latest configurations. chore(docs): Updated stale screenshots w/o `Needs Server` checked. * Update generated README * fix(ci): Adding missing workflow for storetype merge. * chore: Fix CHANGELOG.md version [skip ci] * update changelog version --------- Co-authored-by: Keyfactor <[email protected]> Co-authored-by: Michael Henderson <[email protected]>
1 parent 2468556 commit 286b2d7

Some content is hidden

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

47 files changed

+6001
-2056
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#name: Auto Changelog
2+
#on:
3+
# push:
4+
# branches:
5+
# - main
6+
# - release*
7+
# - pan_feedback
8+
##name: autochangelog
9+
##
10+
##on:
11+
## repository_dispatch:
12+
## types: [autochangelog]
13+
#
14+
#jobs:
15+
# push:
16+
# name: Push Container
17+
# runs-on: ubuntu-latest
18+
# steps:
19+
# - name: Checkout Code
20+
# uses: actions/checkout@v2
21+
# with:
22+
# fetch-depth: '0'
23+
# - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
24+
# - name: autochangelog-action
25+
# id: ac
26+
# uses: rubenfiszel/[email protected]
27+
# with:
28+
# changelog_file: './CHANGELOG.md'
29+
# manifest_file: './manifest.yaml'
30+
# dry_run: false
31+
# issues_url_prefix: 'https://github.com/org/repo/issues/'
32+
# tag_prefix: 'v'
33+
# - name: Create Pull Request
34+
# id: cpr
35+
# uses: peter-evans/create-pull-request@v2
36+
# with:
37+
# token: ${{ secrets.GITHUB_TOKEN }}
38+
# commit-message: 'Update changelog and manifest'
39+
# title: 'ci: release ${{ steps.ac.outputs.version }}'
40+
# body: |
41+
# Release [${{ steps.ac.outputs.version }}](https://github.com/org/repo/releases/tag/v${{ steps.ac.outputs.version }})
42+
# labels: autorelease
43+
# branch: automatic-release-prs
44+
# reviewers: your-reviewers-list
45+
# - name: Check outputs
46+
# run: |
47+
# echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
48+
# echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Keyfactor Merge Cert Store Types
2+
on: [workflow_dispatch]
3+
4+
jobs:
5+
get-manifest-properties:
6+
runs-on: windows-latest
7+
outputs:
8+
update_catalog: ${{ steps.read-json.outputs.update_catalog }}
9+
integration_type: ${{ steps.read-json.outputs.integration_type }}
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Store json
13+
id: read-json
14+
shell: pwsh
15+
run: |
16+
$json = Get-Content integration-manifest.json | ConvertFrom-Json
17+
$myvar = $json.update_catalog
18+
echo "update_catalog=$myvar" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
19+
$myvar = $json.integration_type
20+
echo "integration_type=$myvar" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
21+
22+
call-update-store-types-workflow:
23+
needs: get-manifest-properties
24+
if: needs.get-manifest-properties.outputs.integration_type == 'orchestrator' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
25+
uses: Keyfactor/actions/.github/workflows/update-store-types.yml@main
26+
secrets:
27+
token: ${{ secrets.UPDATE_STORE_TYPES }}

CHANGELOG.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# 1.1.1
2+
3+
## Features
4+
- feat(storetypes): `K8SPKCS12` store type added to support PKCS12, .P12, PFX, files in K8S `opaque` secrets.
5+
- feat(storetypes): `K8SJKS` store type added to support JKS files in K8S `opaque` secrets.
6+
- feat(storetypes): `K8SCLUSTER` store type added to support PEM files in K8S `opaque` and `tls` secrets for an entire cluster as a single store.
7+
- feat(storetypes): `K8SNS` store type added to support PEM files in K8S `opaque` and `tls` secrets for a single namespace as a single store.
8+
- feat(discovery): Support added for: `K8SNS`, `K8SPKCS12`, `K8SJKS` store types.
9+
- feat(management): Support added for:,`K8SCLUSTER`, `K8SNS`, `K8SPKCS12`, `K8SJKS` store types.
10+
- feat(inventory): Support added for: `K8SCLUSTER`, `K8SNS`, `K8SPKCS12`, `K8SJKS` store types.
11+
12+
# 1.0.6
13+
14+
## Bug Fixes
15+
- fix(base): If unable to convert to x509Certificate2 object then just use raw bytes from job.
16+
- fix(client): Replace remaining "private_keys" refs to "tls.key"
17+
- fix(management): Private keys coming from Keyfactor command are not stored unencrypted in secrets.
18+
- fix(management): Remove check for cert bytes in HandleTlsSecret
19+
- fix(management): Condition for handling "create_store" includes check of PEM and alias.
20+
21+
## Other Changes
22+
- chore(scripts): Add script to stand up Hashicorp Vault CA and create some certs then push them into K8S secrets.
23+
24+
# 1.0.4
25+
26+
## Bug Fixes
27+
- fix(management): Opaque secrets now manage tls.crt and tls.key rather than `certificates` and `private_keys`.
28+
Only a single cert and key are supported.
29+
30+
# 1.0.3
31+
32+
## Bug Fixes
33+
- fix(base): Add additional logic extracting private keys
34+
- fix(base): Verbose logging.
35+
- fix(client): Discovery locations now include cluster name.
36+
- fix(discovery): StorePath now includes cluster name from kubeconfig credentials.
37+
- fix(management): When creating `X509Certificate2` include flag to allow export.
38+
- fix(scripts): Fixed k8s service account scripts to default to index 0 and added notes about assumption.
39+
40+
## Other Changes
41+
- chore(docs): Added docs about `StorePath`
42+
43+
# 1.0.2
44+
45+
## Bug Fixes
46+
- fix(base): Add support for empty or null `ServerUsername` and default to `kubeconfig`
47+
- fix(base): Throw configuration exception if `ServerPassword` is null or empty.
48+
- fix(client): Init kf logger properly.
49+
- fix(client): Remove will search all secret keys to check for cert rather than just managed keys.
50+
- fix(discovery): Remove duplicate locations from results and print out discovered locations in the message.
51+
- fix(discovery): Lists all namespaces and then checks if namespace is in the "Directories to search" parameter rather than filter by API call.
52+
- fix(discovery): Now checks the storetype passed to determine what K8S secret type to import when checking secret keys.
53+
- fix(inventory): Added more logging
54+
- fix(inventory): When secret is not found on K8S inventory is assumed empty.
55+
- fix(management): Add support for `createStore`
56+
- fix(management): Enable use of "create store" tick box, which triggers an empty management job.
57+
- fix(manifest): Capability names match docs
58+
- fix(store-types): Update store types to require server and remove `KubeSvcCreds` field.
59+
60+
61+
## Other Changes
62+
- chore(docs): Removed KubeSvcCreds reference from PAM stub.
63+
64+
# 1.0.1
65+
66+
## Bug Fixes
67+
- fix(base): Parse `KubeNamespace` and `KubeSecretName` from storepath if contains `/`
68+
- fix(inventory): Allowing for secret key tls.crt and tls.key for `Opaque` secret types.
69+
- fix(inventory): Returned certs list now returns list of certs.
70+
71+
## Other Changes
72+
- chore(docs): Remove references to `KubeSvcCreds` field, and instead force `Needs Server` which implicitly adds fields
73+
for `ServerUsername` and `ServerPassword`
74+
75+
# 1.0.0
76+
- Initial release
77+
78+

Keyfactor.Orchestrators.K8S.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ VisualStudioVersion = 17.3.32929.385
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Keyfactor.Orchestrators.K8S", "kubernetes-orchestrator-extension\Keyfactor.Orchestrators.K8S.csproj", "{F497D7FA-AC9F-4BB2-935F-6A7569ACC173}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestConsole", "TestConsole\TestConsole.csproj", "{8C2C6B52-E386-4DAE-B596-7EE4E64EB0F4}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestConsole", "TestConsole\TestConsole.csproj", "{8C2C6B52-E386-4DAE-B596-7EE4E64EB0F4}"
99
EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution

0 commit comments

Comments
 (0)