Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.4.0 #155

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a016afc
fix(ci): Add KFC 11.1.2 test labs
spbsoluble Jan 17, 2024
8042d64
fix(store-types): Store type create omits empty fields.
spbsoluble Feb 7, 2024
c371b88
fix(pam-types): `types-list` does not crash on nil httpResponse.
Feb 7, 2024
404c5d3
chore: Update license year, and bump AKV runner go version
spbsoluble Feb 8, 2024
58be5eb
fix(tests): Remove "ProviderTypeParams" from pam-types tests for KFC …
spbsoluble Feb 8, 2024
4bf5c2a
fix(tests): Fix nil pointer issues on tests.
spbsoluble Feb 12, 2024
a8b68e5
feat(cli): Update `import/export` sub CLIs
spbsoluble Feb 13, 2024
d26d614
chore(deps): Bump deps
spbsoluble Feb 14, 2024
363439c
fix(tests): Adding back PAMList test
spbsoluble Feb 14, 2024
dffc675
Update store_types.json for k8s-orchestrator:remote_pam
Feb 20, 2024
51ec192
Update generated README
Feb 20, 2024
134b0c7
Merge pull request #151 from Keyfactor/k8s-orchestrator
spbsoluble Feb 20, 2024
2ba773f
chore(ci): Adding 11.2.0 lab tests
spbsoluble Feb 20, 2024
6560ecb
fix(tests): PAM test null pointer check
spbsoluble Feb 21, 2024
5abb0d9
chore(deps): Bump go client version
spbsoluble Feb 21, 2024
7163658
chore(docs): Update docs
spbsoluble Feb 21, 2024
cdc5218
Merge branch 'release-1.4' into 1112_test_endpoint
spbsoluble Feb 21, 2024
876aaed
Bump package version to 1.4.0-rc.5
Feb 21, 2024
0086811
chore(docs): Update docs
spbsoluble Feb 26, 2024
dc403c6
Bump package version to 1.4.0-rc.8
Feb 26, 2024
0aaac4b
chore(docs): Update docs
spbsoluble Feb 26, 2024
56807ee
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 26, 2024
ad67635
Bump package version to 1.4.0-rc.9
Feb 26, 2024
6a5c8e8
WIP
spbsoluble Feb 27, 2024
3034ec9
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
bb7bf4d
feat(stores): `stores export` now allows for `--all` and user interac…
spbsoluble Feb 27, 2024
264bebe
Bump package version to 1.4.0-rc.10
Feb 27, 2024
5bfee1a
fix(ci): update gh token
spbsoluble Feb 27, 2024
898f96c
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
20164cf
chore(docs): Update install docs.
spbsoluble Feb 27, 2024
92c1739
chore(docs): generate TOC
spbsoluble Feb 27, 2024
bc35dd7
Bump package version to 1.4.0-rc.12
Feb 27, 2024
4517815
chore(docs): Rename docs path
spbsoluble Feb 27, 2024
b9206f2
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
a6661a0
Bump package version to 1.4.0-rc.13
Feb 27, 2024
a3c3da6
chore(docs): Update Makefile toc target
spbsoluble Feb 27, 2024
d45603c
Bump package version to 1.4.0-rc.14
Feb 27, 2024
9ba647f
chore(docs): Update TOC
spbsoluble Feb 27, 2024
f23c707
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
cb2d369
Bump package version to 1.4.0-rc.15
Feb 27, 2024
47465e9
chore(docs): Update TOC
spbsoluble Feb 27, 2024
b0f55fa
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
5cf2e90
Bump package version to 1.4.0-rc.16
Feb 27, 2024
4022f11
feat(stores): `delete` can be called interactively or from a file pat…
spbsoluble Feb 27, 2024
e7f7e85
Bump package version to 1.4.0-rc.17
Feb 27, 2024
c5ea5d9
chore(docs): Update `stores delete` docs
spbsoluble Feb 27, 2024
ef8e593
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
cdba8eb
Bump package version to 1.4.0-rc.18
Feb 27, 2024
4b36c7e
chore(docs): Update CHANGELOG.md
spbsoluble Feb 27, 2024
b8d2550
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
0d095b7
Bump package version to 1.4.0-rc.19
Feb 27, 2024
b531f73
chore(docs): Update CHANGELOG.md
spbsoluble Feb 27, 2024
5e4ec8a
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
1bd313d
Bump package version to 1.4.0-rc.20
Feb 27, 2024
7653593
fix(stores): test regression
spbsoluble Feb 27, 2024
acdab48
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
2552307
Bump package version to 1.4.0-rc.21
Feb 27, 2024
b14b173
fix(tests): test regression
spbsoluble Feb 27, 2024
b88bdf3
Merge remote-tracking branch 'origin/epic_54795' into epic_54795
spbsoluble Feb 27, 2024
fd036d4
Bump package version to 1.4.0-rc.22
Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
356 changes: 110 additions & 246 deletions .github/workflows/tests.yml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .github/workflows/update-stores.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
sparse-checkout: |
.github
path: './merge-folder/'
token: ${{ secrets.SDK_SYNC_PAT }}
token: ${{ secrets.V2BUILDTOKEN }}
ref: '${{env.KFUTIL_ARG}}'

# If the branch does not exist, first check out the main branch from kfutil.
Expand All @@ -82,7 +82,7 @@ jobs:
sparse-checkout: |
.github
path: './merge-folder/'
token: ${{ secrets.SDK_SYNC_PAT }}
token: ${{ secrets.V2BUILDTOKEN }}

# Save a copy of the original json
- name: Save original store_types.json
Expand All @@ -96,15 +96,15 @@ jobs:
with:
repository: 'keyfactor/integration-tools'
path: './tools/'
token: ${{ secrets.SDK_SYNC_PAT }}
token: ${{ secrets.V2BUILDTOKEN }}

- name: Run Python Script
working-directory: ./tools/store-type-merge
run: |
python main.py --repo-name ${{ env.KFUTIL_ARG }} --ref ${{ env.TARGET_REPO_BRANCH }}
cat store_types.json
env:
GITHUB_TOKEN: ${{ secrets.SDK_SYNC_PAT }}
GITHUB_TOKEN: ${{ secrets.V2BUILDTOKEN }}

- name: Save Store Types JSON Artifact
if: success()
Expand Down Expand Up @@ -194,4 +194,4 @@ jobs:
});
console.log(`Pull request created: ${{env.KFUTIL_ARG}}:${{env.TARGET_REPO_BRANCH}} : ${response.data.html_url}`);
env:
GITHUB_TOKEN: ${{ secrets.SDK_SYNC_PAT }}
GITHUB_TOKEN: ${{ secrets.V2BUILDTOKEN }}
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# v1.4.0
## Features

### Stores
- `stores import generate-template`: New sub CLI to generate a CSV template for bulk importing stores. [See docs](docs/kfutil_stores_import_generate-template.md)`.
- `stores delete`: Support for user interactive mode.
- `stores delete`: Support of delete from CSV file.
- `stores export`: Supports `--all` flag and user interactive mode

## Fixes
- Various null pointer references when nothing and/or empty inputs/responses are received.
- Installer script checksum check now validates properly. #119
- `stores import` sub CLI is now listed and documented #71

### Store Types
- Empty `storepath` values are no longer passed to the API. #56

### PAM Types
- Handle duplicate provider type that is already created without crashing. #139

## Docs
- [Examples for certificate store bulk operations](https://github.com/Keyfactor/kfutil/tree/epic_54795/examples/cert_stores/bulk_operations#readme)

# v1.3.2

### Package
Expand Down
13 changes: 13 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ endif
OS_ARCH := $(shell go env GOOS)_$(shell go env GOARCH)
BASEDIR := ${HOME}/go/bin
INSTALLDIR := ${BASEDIR}
MARKDOWN_FILE := README.md
TEMP_TOC_FILE := temp_toc.md



default: build

Expand Down Expand Up @@ -71,4 +75,13 @@ prerelease: fmt setversion
git tag $(VERSION)
git push origin $(VERSION)

check_toc:
@grep -q 'TOC_START' $(MARKDOWN_FILE) && echo "TOC already exists." || (echo "TOC not found. Generating..." && $(MAKE) generate_toc)

generate_toc:
# check if markdown-toc is installed and if not install it
@command -v markdown-toc >/dev/null 2>&1 || (echo "markdown-toc is not installed. Installing..." && npm install -g markdown-toc)
markdown-toc -i $(MARKDOWN_FILE) --skip 'Table of Contents'


.PHONY: build prerelease release install test fmt vendor version setversion
94 changes: 71 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,46 @@

# Keyfactor Command Utility (kfutil)

`kfutil` is a go-lang CLI wrapper for Keyfactor Command API. It also includes other utility/helper functions around automating common Keyfactor Command operations.

#### Integration status: Production - Ready for use in production environments.

<!-- toc -->

- [About the Keyfactor API Client](#about-the-keyfactor-api-client)
- [Support for Keyfactor Command Utility (kfutil)](#support-for-keyfactor-command-utility-kfutil)
- [Quickstart](#quickstart)
* [Linux/MacOS](#linuxmacos)
+ [Prerequisites:](#prerequisites)
+ [Installation:](#installation)
* [Windows](#windows)
+ [Prerequisites:](#prerequisites-1)
+ [Installation:](#installation-1)
- [Environmental Variables](#environmental-variables)
* [Linux/MacOS:](#linuxmacos)
* [Windows Powershell:](#windows-powershell)
- [Authentication Providers](#authentication-providers)
- [Commands](#commands)
* [Login](#login)
* [Logout](#logout)
- [Commands](#commands-1)
* [Bulk operations](#bulk-operations)
+ [Bulk create cert stores](#bulk-create-cert-stores)
+ [Bulk create cert store types](#bulk-create-cert-store-types)
* [Root of Trust](#root-of-trust)
+ [Quickstart](#quickstart-1)
+ [Generate Certificate List Template](#generate-certificate-list-template)
+ [Generate Certificate Store List Template](#generate-certificate-store-list-template)
+ [Run Root of Trust Audit](#run-root-of-trust-audit)
+ [Run Root of Trust Reconcile](#run-root-of-trust-reconcile)
* [Certificate Store Inventory](#certificate-store-inventory)
+ [Show the inventory of a certificate store](#show-the-inventory-of-a-certificate-store)
+ [Add certificates to certificate stores](#add-certificates-to-certificate-stores)
+ [Remove certificates from certificate stores](#remove-certificates-from-certificate-stores)
- [Development](#development)
* [Adding a new command](#adding-a-new-command)

<!-- tocstop -->

## About the Keyfactor API Client

This API client allows for programmatic management of Keyfactor resources.
Expand All @@ -13,18 +49,12 @@ This API client allows for programmatic management of Keyfactor resources.

Keyfactor Command Utility (kfutil) 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/

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

---


---


[!NOTE] 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.

## Quickstart

### Prerequisites:
### Linux/MacOS
#### Prerequisites:
- [jq](https://stedolan.github.io/jq/download/) CLI tool, used to parse JSON output.
- Either
- [curl](https://curl.se/download.html) CLI tool, used to download the release files.
Expand All @@ -33,22 +63,24 @@ Keyfactor Command Utility (kfutil) is open source and supported on best effort l
- [openssl](https://www.openssl.org/source/) CLI tool, used to validate package checksum.
- `$HOME/.local/bin` in your `$PATH` and exists if not running as root, else `/usr/local/bin` if running as root.

### Installation:

#### Linux/MacOS
#### Installation:
```bash
bash <(curl -s https://raw.githubusercontent.com/Keyfactor/kfutil/main/install.sh)
````

#### Windows (or Linux/MacOS if PowerShell is preferred)
### Windows
#### Prerequisites:
- Powershell 5.1 or later

#### Installation:
```powershell
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Keyfactor/kfutil/main/install.ps1" -OutFile "install.ps1"
# Install kfutil to $HOME/AppData/Local/Microsoft/WindowsApps.
# Use Get-Help .\install.ps1 -Full for help and examples.
.\install.ps1
```

### Environmental Variables
## Environmental Variables

All the variables listed below need to be set in your environment. The `kfutil` command will look for these variables
and use them if they are set. If they are not set, the utility will fail to connect to Keyfactor.
Expand All @@ -63,7 +95,7 @@ and use them if they are set. If they are not set, the utility will fail to conn
| KFUTIL_EXP | Set to `1` or `true` to enable experimental features. |
| KFUTIL_DEBUG | Set to `1` or `true` to enable debug logging. |

Linux/MacOS:
### Linux/MacOS:

```bash
export KEYFACTOR_HOSTNAME="<mykeyfactorhost.mydomain.com>"
Expand All @@ -80,7 +112,7 @@ export KFUTIL_EXP=0 # Set to 1 or true to enable experimental features
export KFUTIL_DEBUG=0 # Set to 1 or true to enable debug logging
```

Windows Powershell:
### Windows Powershell:

```powershell
$env:KEYFACTOR_HOSTNAME = "<mykeyfactorhost.mydomain.com>"
Expand Down Expand Up @@ -138,29 +170,45 @@ kfutil logout

#### Bulk create cert stores

For full documentation, see [stores import](docs/kfutil_stores_import.md).
For full documentation, see [stores import](docs/kfutil_stores_import.md). For a full user-interactive guide, see the
[stores bulk operations examples](examples/cert_stores/bulk_operations/README.md).

This will attempt to process a CSV input file of certificate stores to create. The template can be generated by
running: `kfutil stores import generate-template` command.

```bash
kfutil stores import create --file <file name to import> --store-type-id <store type id> --store-type-name <store type name> --results-path <filepath for results> --dry-run <check fields only> [flags]
kfutil stores import csv --file <file name to import>
```

```bash
kfutil stores import --help
Tool for generating import templates and importing certificate stores
kfutil stores import --help
Tools for generating import templates and importing certificate stores

Usage:
kfutil stores import [command]

Available Commands:
create Create certificate stores
csv Create certificate stores from CSV file.
generate-template For generating a CSV template with headers for bulk store creation.

Flags:
-h, --help help for import

Global Flags:
--api-path string API Path to use for authenticating to Keyfactor Command. (default is KeyfactorAPI) (default "KeyfactorAPI")
--auth-provider-profile string The profile to use defined in the securely stored config. If not specified the config named 'default' will be used if it exists. (default "default")
--auth-provider-type string Provider type choices: (azid)
--config string Full path to config file in JSON format. (default is $HOME/.keyfactor/command_config.json)
--debug Enable debugFlag logging.
--domain string Domain to use for authenticating to Keyfactor Command.
--exp Enable expEnabled features. (USE AT YOUR OWN RISK, these features are not supported and may change or be removed at any time.)
--format text How to format the CLI output. Currently only text is supported. (default "text")
--hostname string Hostname to use for authenticating to Keyfactor Command.
--no-prompt Do not prompt for any user input and assume defaults or environmental variables are set.
--password string Password to use for authenticating to Keyfactor Command. WARNING: Remember to delete your console history if providing kfcPassword here in plain text.
--profile string Use a specific profile from your config file. If not specified the config named 'default' will be used if it exists.
--username string Username to use for authenticating to Keyfactor Command.

Use "kfutil stores import [command] --help" for more information about a command.
```

Expand Down Expand Up @@ -203,7 +251,7 @@ For full documentation, see [stores rot](docs/kfutil_stores_rot.md).
The root of trust (rot) utility is a tool that allows you to bulk manage Keyfactor certificate stores and ensure that a
set of defined certificates are present in each store that meets a certain set of criteria or no criteria at all.

### Root of Trust Quickstart
#### Quickstart

```bash
echo "Generating cert template file certs_template.csv"
Expand Down
23 changes: 23 additions & 0 deletions artifacts/pam/pam-create-template-v11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "string",
"remote": true,
"area": 0,
"services": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"providerTypeParamValues": [
{
"id": 0,
"value": "string",
"instanceId": 0,
"instanceGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"providerTypeParam": {
"id": 0,
"name": "string",
"displayName": "string",
"instanceLevel": true
}
}
],
"securedAreaId": 0
}
2 changes: 1 addition & 1 deletion cmd/auth_providers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Keyfactor
// Copyright 2024 Keyfactor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmd/certificates.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package cmd Copyright 2023 Keyfactor
// Copyright 2024 Keyfactor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
6 changes: 5 additions & 1 deletion cmd/constants.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package cmd Copyright 2023 Keyfactor
// Copyright 2024 Keyfactor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -25,6 +25,10 @@ const (
XKeyfactorRequestedWith = "APIClient"
XKeyfactorApiVersion = "1"
FlagGitRef = "git-ref"
FlagFromFile = "from-file"
DebugFuncEnter = "entered: %s"
DebugFuncExit = "exiting: %s"
DebugFuncCall = "calling: %s"
)

var ProviderTypeChoices = []string{
Expand Down
2 changes: 1 addition & 1 deletion cmd/containers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package cmd Copyright 2023 Keyfactor
// Copyright 2024 Keyfactor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Loading
Loading