diff --git a/README.md b/README.md index 0d14aa4..02f17b8 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ kfutil --help 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. +Linux/MacOS: ```bash export KEYFACTOR_HOSTNAME= export KEYFACTOR_USERNAME= # Do not include domain @@ -39,6 +40,36 @@ export KEYFACTOR_PASSWORD= export KEYFACTOR_DOMAIN= ``` +Windows Powershell +```powershell +$env:KEYFACTOR_HOSTNAME="" +$env:KEYFACTOR_USERNAME="" # Do not include domain +$env:KEYFACTOR_PASSWORD="" +$env:KEYFACTOR_DOMAIN="" +``` + +## Commands + +### Login +For full documentation on the `login` command, see the [login](docs/kfutil_login.md) documentation. + +*WARNING* - The `login` command will store your Keyfactor credentials in a file on your local machine. This file is not +encrypted and is not secure. It is recommended that you use the `login` command only on your local machine and not on a +shared machine. Instead of using the `login` command, you can set the environmental variables listed above. + +```bash +kfutil login +``` + +### Logout +For full documentation on the `logout` command, see the [logout](docs/kfutil_logout.md) documentation. + +*WARNING* - This will delete the file containing your Keyfactor credentials at `$HOME/.keyfactor/command_config.json`. + +```bash +kfutil logout +``` + ## Commands ### Bulk operations diff --git a/cmd/login.go b/cmd/login.go index 42b788b..a5e3559 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -24,13 +24,16 @@ const DefaultConfigFileName = "command_config.json" // loginCmd represents the login command var loginCmd = &cobra.Command{ Use: "login", - Short: "User interactive login to Keyfactor.", + Short: "User interactive login to Keyfactor. Stores the credentials in the config file '$HOME/.keyfactor/command_config.json'.", Long: `Will prompt the user for a username and password and then attempt to login to Keyfactor. You can provide the --config flag to specify a config file to use. If not provided, the default config file will be used. The default config file is located at $HOME/.keyfactor/command_config.json. To prevent the prompt for username and password, use the --no-prompt flag. If this flag is provided then the CLI will default to using the environment variables: KEYFACTOR_HOSTNAME, KEYFACTOR_USERNAME, KEYFACTOR_PASSWORD and KEYFACTOR_DOMAIN. + +WARNING: The username and password will be stored in the config file in plain text at: +'$HOME/.keyfactor/command_config.json.' `, Run: func(cmd *cobra.Command, args []string) { log.SetOutput(io.Discard) @@ -100,8 +103,11 @@ func authConfigFile(configFile string, noPrompt bool) bool { fmt.Printf("Enter Keyfactor Command host URL [%s]: \n", envHostName) _, phErr := fmt.Scanln(&host) if phErr != nil { - fmt.Println("Error getting hostname: ", phErr) - log.Fatal("[ERROR] getting hostname: ", phErr) + if phErr.Error() != "unexpected newline" { + fmt.Println("Error getting hostname: ", phErr) + log.Println("[ERROR] getting hostname: ", phErr) + } + } if len(host) == 0 { host = envHostName @@ -128,8 +134,10 @@ func authConfigFile(configFile string, noPrompt bool) bool { fmt.Printf("Enter your Keyfactor Command username [%s]: \n", envUserName) _, puErr := fmt.Scanln(&username) if puErr != nil { - fmt.Println("Error getting username: ", puErr) - log.Fatal("[ERROR] getting username: ", puErr) + if puErr.Error() != "unexpected newline" { + fmt.Println("Error getting username: ", puErr) + log.Println("[ERROR] getting username: ", puErr) + } } } if len(username) == 0 { @@ -189,8 +197,11 @@ func authConfigFile(configFile string, noPrompt bool) bool { fmt.Printf("Enter your Keyfactor Command AD domain [%s]: \n", envDomain) _, sdErr := fmt.Scanln(&domain) if sdErr != nil { - fmt.Println("Error getting domain: ", sdErr) - log.Fatal("[ERROR] getting domain: ", sdErr) + if sdErr.Error() != "unexpected newline" { + fmt.Println("Error getting domain: ", sdErr) + log.Println("[ERROR] getting domain: ", sdErr) + } + } if len(domain) == 0 { domain = envDomain diff --git a/cmd/logout.go b/cmd/logout.go new file mode 100644 index 0000000..8a8877b --- /dev/null +++ b/cmd/logout.go @@ -0,0 +1,36 @@ +// Package cmd Copyright 2022 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. +// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions +// and limitations under the License. +package cmd + +import ( + "fmt" + "io" + "log" + "os" + + "github.com/spf13/cobra" +) + +// logoutCmd represents the logout command +var logoutCmd = &cobra.Command{ + Use: "logout", + Short: "Removes the credentials file '$HOME/.keyfactor/command_config.json'.", + Long: `Removes the credentials file '$HOME/.keyfactor/command_config.json'.`, + Run: func(cmd *cobra.Command, args []string) { + log.SetOutput(io.Discard) + err := os.Remove(fmt.Sprintf("%s/.keyfactor/%s", os.Getenv("HOME"), DefaultConfigFileName)) + if err != nil { + fmt.Println("Error removing config file: ", err) + log.Fatal("[ERROR] removing config file: ", err) + } + fmt.Println("Logged out successfully!") + }, +} + +func init() { + RootCmd.AddCommand(logoutCmd) +} diff --git a/docs/kfutil.md b/docs/kfutil.md index ee13a45..d80d0d5 100644 --- a/docs/kfutil.md +++ b/docs/kfutil.md @@ -16,11 +16,12 @@ A CLI wrapper around the Keyfactor Platform API. ### SEE ALSO * [kfutil containers](kfutil_containers.md) - Keyfactor certificate store container API and utilities. -* [kfutil login](kfutil_login.md) - User interactive login to Keyfactor. +* [kfutil login](kfutil_login.md) - User interactive login to Keyfactor. Stores the credentials in the config file '$HOME/.keyfactor/command_config.json'. +* [kfutil logout](kfutil_logout.md) - Removes the credentials file '$HOME/.keyfactor/command_config.json'. * [kfutil orchs](kfutil_orchs.md) - Keyfactor agents/orchestrators APIs and utilities. * [kfutil status](kfutil_status.md) - List the status of Keyfactor services. * [kfutil store-types](kfutil_store-types.md) - Keyfactor certificate store types APIs and utilities. * [kfutil stores](kfutil_stores.md) - Keyfactor certificate stores APIs and utilities. * [kfutil version](kfutil_version.md) - Shows version of kfutil -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_containers.md b/docs/kfutil_containers.md index 324c6e0..1e9fd56 100644 --- a/docs/kfutil_containers.md +++ b/docs/kfutil_containers.md @@ -18,4 +18,4 @@ A collections of APIs and utilities for interacting with Keyfactor certificate s * [kfutil containers get](kfutil_containers_get.md) - Get certificate store container by ID or name. * [kfutil containers list](kfutil_containers_list.md) - List certificate store containers. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_containers_get.md b/docs/kfutil_containers_get.md index 9347111..09f1f04 100644 --- a/docs/kfutil_containers_get.md +++ b/docs/kfutil_containers_get.md @@ -21,4 +21,4 @@ kfutil containers get [flags] * [kfutil containers](kfutil_containers.md) - Keyfactor certificate store container API and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_containers_list.md b/docs/kfutil_containers_list.md index ff5a274..13f404f 100644 --- a/docs/kfutil_containers_list.md +++ b/docs/kfutil_containers_list.md @@ -20,4 +20,4 @@ kfutil containers list [flags] * [kfutil containers](kfutil_containers.md) - Keyfactor certificate store container API and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_login.md b/docs/kfutil_login.md index b556a1c..a8ab391 100644 --- a/docs/kfutil_login.md +++ b/docs/kfutil_login.md @@ -1,6 +1,6 @@ ## kfutil login -User interactive login to Keyfactor. +User interactive login to Keyfactor. Stores the credentials in the config file '$HOME/.keyfactor/command_config.json'. ### Synopsis @@ -11,6 +11,9 @@ To prevent the prompt for username and password, use the --no-prompt flag. If th the CLI will default to using the environment variables: KEYFACTOR_HOSTNAME, KEYFACTOR_USERNAME, KEYFACTOR_PASSWORD and KEYFACTOR_DOMAIN. +WARNING: The username and password will be stored in the config file in plain text at: +'$HOME/.keyfactor/command_config.json.' + ``` kfutil login [flags] @@ -28,4 +31,4 @@ kfutil login [flags] * [kfutil](kfutil.md) - Keyfactor CLI utilities -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_logout.md b/docs/kfutil_logout.md new file mode 100644 index 0000000..5fadd15 --- /dev/null +++ b/docs/kfutil_logout.md @@ -0,0 +1,23 @@ +## kfutil logout + +Removes the credentials file '$HOME/.keyfactor/command_config.json'. + +### Synopsis + +Removes the credentials file '$HOME/.keyfactor/command_config.json'. + +``` +kfutil logout [flags] +``` + +### Options + +``` + -h, --help help for logout +``` + +### SEE ALSO + +* [kfutil](kfutil.md) - Keyfactor CLI utilities + +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_orchs.md b/docs/kfutil_orchs.md index 835dc8b..1b26d75 100644 --- a/docs/kfutil_orchs.md +++ b/docs/kfutil_orchs.md @@ -22,4 +22,4 @@ A collections of APIs and utilities for interacting with Keyfactor orchestrators * [kfutil orchs logs](kfutil_orchs_logs.md) - Get orchestrator logs by ID or machine/client name. * [kfutil orchs reset](kfutil_orchs_reset.md) - Reset orchestrator by ID or machine/client name. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_orchs_approve.md b/docs/kfutil_orchs_approve.md index dcc457a..b52bb3f 100644 --- a/docs/kfutil_orchs_approve.md +++ b/docs/kfutil_orchs_approve.md @@ -21,4 +21,4 @@ kfutil orchs approve [flags] * [kfutil orchs](kfutil_orchs.md) - Keyfactor agents/orchestrators APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_orchs_disapprove.md b/docs/kfutil_orchs_disapprove.md index 89e8e32..bb59be4 100644 --- a/docs/kfutil_orchs_disapprove.md +++ b/docs/kfutil_orchs_disapprove.md @@ -21,4 +21,4 @@ kfutil orchs disapprove [flags] * [kfutil orchs](kfutil_orchs.md) - Keyfactor agents/orchestrators APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_orchs_get.md b/docs/kfutil_orchs_get.md index 10fc177..2f05016 100644 --- a/docs/kfutil_orchs_get.md +++ b/docs/kfutil_orchs_get.md @@ -21,4 +21,4 @@ kfutil orchs get [flags] * [kfutil orchs](kfutil_orchs.md) - Keyfactor agents/orchestrators APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_orchs_list.md b/docs/kfutil_orchs_list.md index 7b9a8c1..cba0fd3 100644 --- a/docs/kfutil_orchs_list.md +++ b/docs/kfutil_orchs_list.md @@ -20,4 +20,4 @@ kfutil orchs list [flags] * [kfutil orchs](kfutil_orchs.md) - Keyfactor agents/orchestrators APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_orchs_logs.md b/docs/kfutil_orchs_logs.md index 5daeae7..a8a0817 100644 --- a/docs/kfutil_orchs_logs.md +++ b/docs/kfutil_orchs_logs.md @@ -21,4 +21,4 @@ kfutil orchs logs [flags] * [kfutil orchs](kfutil_orchs.md) - Keyfactor agents/orchestrators APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_orchs_reset.md b/docs/kfutil_orchs_reset.md index fb7b655..c480cd0 100644 --- a/docs/kfutil_orchs_reset.md +++ b/docs/kfutil_orchs_reset.md @@ -21,4 +21,4 @@ kfutil orchs reset [flags] * [kfutil orchs](kfutil_orchs.md) - Keyfactor agents/orchestrators APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_status.md b/docs/kfutil_status.md index 32c9b5e..d89f882 100644 --- a/docs/kfutil_status.md +++ b/docs/kfutil_status.md @@ -20,4 +20,4 @@ kfutil status [flags] * [kfutil](kfutil.md) - Keyfactor CLI utilities -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_store-types.md b/docs/kfutil_store-types.md index 2769aa9..2e1b7d0 100644 --- a/docs/kfutil_store-types.md +++ b/docs/kfutil_store-types.md @@ -22,4 +22,4 @@ A collections of APIs and utilities for interacting with Keyfactor certificate s * [kfutil store-types templates-fetch](kfutil_store-types_templates-fetch.md) - Fetches store type templates from Keyfactor's Github. * [kfutil store-types update](kfutil_store-types_update.md) - Update a certificate store type in Keyfactor. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_store-types_create.md b/docs/kfutil_store-types_create.md index 7e16877..e7f4f00 100644 --- a/docs/kfutil_store-types_create.md +++ b/docs/kfutil_store-types_create.md @@ -22,4 +22,4 @@ kfutil store-types create [flags] * [kfutil store-types](kfutil_store-types.md) - Keyfactor certificate store types APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_store-types_delete.md b/docs/kfutil_store-types_delete.md index 035592d..241a473 100644 --- a/docs/kfutil_store-types_delete.md +++ b/docs/kfutil_store-types_delete.md @@ -22,4 +22,4 @@ kfutil store-types delete [flags] * [kfutil store-types](kfutil_store-types.md) - Keyfactor certificate store types APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_store-types_get.md b/docs/kfutil_store-types_get.md index d1ed7bf..694d655 100644 --- a/docs/kfutil_store-types_get.md +++ b/docs/kfutil_store-types_get.md @@ -22,4 +22,4 @@ kfutil store-types get [flags] * [kfutil store-types](kfutil_store-types.md) - Keyfactor certificate store types APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_store-types_list.md b/docs/kfutil_store-types_list.md index baadec1..1d66e9c 100644 --- a/docs/kfutil_store-types_list.md +++ b/docs/kfutil_store-types_list.md @@ -20,4 +20,4 @@ kfutil store-types list [flags] * [kfutil store-types](kfutil_store-types.md) - Keyfactor certificate store types APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_store-types_templates-fetch.md b/docs/kfutil_store-types_templates-fetch.md index faaea01..f9f12d2 100644 --- a/docs/kfutil_store-types_templates-fetch.md +++ b/docs/kfutil_store-types_templates-fetch.md @@ -20,4 +20,4 @@ kfutil store-types templates-fetch [flags] * [kfutil store-types](kfutil_store-types.md) - Keyfactor certificate store types APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_store-types_update.md b/docs/kfutil_store-types_update.md index ed45bed..ab7d3ca 100644 --- a/docs/kfutil_store-types_update.md +++ b/docs/kfutil_store-types_update.md @@ -21,4 +21,4 @@ kfutil store-types update [flags] * [kfutil store-types](kfutil_store-types.md) - Keyfactor certificate store types APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores.md b/docs/kfutil_stores.md index 9485b83..e261403 100644 --- a/docs/kfutil_stores.md +++ b/docs/kfutil_stores.md @@ -21,4 +21,4 @@ A collections of APIs and utilities for interacting with Keyfactor certificate s * [kfutil stores list](kfutil_stores_list.md) - List certificate stores. * [kfutil stores rot](kfutil_stores_rot.md) - Root of trust utility -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_get.md b/docs/kfutil_stores_get.md index 460632c..f7660e8 100644 --- a/docs/kfutil_stores_get.md +++ b/docs/kfutil_stores_get.md @@ -21,4 +21,4 @@ kfutil stores get [flags] * [kfutil stores](kfutil_stores.md) - Keyfactor certificate stores APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_import.md b/docs/kfutil_stores_import.md index ffa006f..ea27f7f 100644 --- a/docs/kfutil_stores_import.md +++ b/docs/kfutil_stores_import.md @@ -18,4 +18,4 @@ Tools for generating import templates and importing certificate stores * [kfutil stores import create](kfutil_stores_import_create.md) - Create certificate stores * [kfutil stores import generate-template](kfutil_stores_import_generate-template.md) - For generating a CSV template with headers for bulk store creation. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_import_create.md b/docs/kfutil_stores_import_create.md index baa3fd9..2e53b72 100644 --- a/docs/kfutil_stores_import_create.md +++ b/docs/kfutil_stores_import_create.md @@ -28,4 +28,4 @@ kfutil stores import create --file --store-type-id --store-t * [kfutil stores import](kfutil_stores_import.md) - Import a file with certificate store parameters and create them in keyfactor. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_inventory.md b/docs/kfutil_stores_inventory.md index f790bb7..eb64bb2 100644 --- a/docs/kfutil_stores_inventory.md +++ b/docs/kfutil_stores_inventory.md @@ -20,4 +20,4 @@ Commands related to certificate store inventory management * [kfutil stores inventory remove](kfutil_stores_inventory_remove.md) - Removes a certificate from the certificate store inventory. * [kfutil stores inventory show](kfutil_stores_inventory_show.md) - Show the inventory of a certificate store. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_inventory_add.md b/docs/kfutil_stores_inventory_add.md index ac853b9..16b7e9e 100644 --- a/docs/kfutil_stores_inventory_add.md +++ b/docs/kfutil_stores_inventory_add.md @@ -34,4 +34,4 @@ kfutil stores inventory add [flags] * [kfutil stores inventory](kfutil_stores_inventory.md) - Commands related to certificate store inventory management -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_inventory_clear.md b/docs/kfutil_stores_inventory_clear.md index 19100f7..c7dea61 100644 --- a/docs/kfutil_stores_inventory_clear.md +++ b/docs/kfutil_stores_inventory_clear.md @@ -27,4 +27,4 @@ kfutil stores inventory clear [flags] * [kfutil stores inventory](kfutil_stores_inventory.md) - Commands related to certificate store inventory management -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_inventory_remove.md b/docs/kfutil_stores_inventory_remove.md index 92052e8..c8d77c2 100644 --- a/docs/kfutil_stores_inventory_remove.md +++ b/docs/kfutil_stores_inventory_remove.md @@ -30,4 +30,4 @@ kfutil stores inventory remove [flags] * [kfutil stores inventory](kfutil_stores_inventory.md) - Commands related to certificate store inventory management -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_inventory_show.md b/docs/kfutil_stores_inventory_show.md index 7d7fbea..2633088 100644 --- a/docs/kfutil_stores_inventory_show.md +++ b/docs/kfutil_stores_inventory_show.md @@ -24,4 +24,4 @@ kfutil stores inventory show [flags] * [kfutil stores inventory](kfutil_stores_inventory.md) - Commands related to certificate store inventory management -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_list.md b/docs/kfutil_stores_list.md index 464520c..23b8aa7 100644 --- a/docs/kfutil_stores_list.md +++ b/docs/kfutil_stores_list.md @@ -20,4 +20,4 @@ kfutil stores list [flags] * [kfutil stores](kfutil_stores.md) - Keyfactor certificate stores APIs and utilities. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_rot.md b/docs/kfutil_stores_rot.md index 50c87dd..009ba29 100644 --- a/docs/kfutil_stores_rot.md +++ b/docs/kfutil_stores_rot.md @@ -31,4 +31,4 @@ kfutil stores rot reconcile --import-csv * [kfutil stores rot generate-template](kfutil_stores_rot_generate-template.md) - For generating Root Of Trust template(s) * [kfutil stores rot reconcile](kfutil_stores_rot_reconcile.md) - Reconcile either takes in or will generate an audit report and then add/remove certs as needed. -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_rot_audit.md b/docs/kfutil_stores_rot_audit.md index ee46492..4f17dbf 100644 --- a/docs/kfutil_stores_rot_audit.md +++ b/docs/kfutil_stores_rot_audit.md @@ -28,4 +28,4 @@ kfutil stores rot audit [flags] * [kfutil stores rot](kfutil_stores_rot.md) - Root of trust utility -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_rot_generate-template.md b/docs/kfutil_stores_rot_generate-template.md index 4e1ff70..4811688 100644 --- a/docs/kfutil_stores_rot_generate-template.md +++ b/docs/kfutil_stores_rot_generate-template.md @@ -27,4 +27,4 @@ kfutil stores rot generate-template [flags] * [kfutil stores rot](kfutil_stores_rot.md) - Root of trust utility -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_stores_rot_reconcile.md b/docs/kfutil_stores_rot_reconcile.md index 91c73b1..ca73750 100644 --- a/docs/kfutil_stores_rot_reconcile.md +++ b/docs/kfutil_stores_rot_reconcile.md @@ -33,4 +33,4 @@ kfutil stores rot reconcile [flags] * [kfutil stores rot](kfutil_stores_rot.md) - Root of trust utility -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/docs/kfutil_version.md b/docs/kfutil_version.md index 5af7664..a9399fa 100644 --- a/docs/kfutil_version.md +++ b/docs/kfutil_version.md @@ -20,4 +20,4 @@ kfutil version [flags] * [kfutil](kfutil.md) - Keyfactor CLI utilities -###### Auto generated by spf13/cobra on 29-Nov-2022 +###### Auto generated by spf13/cobra on 1-Dec-2022 diff --git a/pkg/version/version.go b/pkg/version/version.go index 844a102..a29e664 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,3 +1,3 @@ package version -const VERSION = "v0.2.0" +const VERSION = "v0.3.0" diff --git a/readme_source.md b/readme_source.md index 9f92401..2f6217d 100644 --- a/readme_source.md +++ b/readme_source.md @@ -10,11 +10,42 @@ kfutil --help 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. +Linux/MacOS: ```bash -export KEYFACTOR_HOSTNAME= -export KEYFACTOR_USERNAME= # Do not include domain -export KEYFACTOR_PASSWORD= -export KEYFACTOR_DOMAIN= +export KEYFACTOR_HOSTNAME="" +export KEYFACTOR_USERNAME="" # Do not include domain +export KEYFACTOR_PASSWORD="" +export KEYFACTOR_DOMAIN="" +``` + +Windows Powershell +```powershell +$env:KEYFACTOR_HOSTNAME="" +$env:KEYFACTOR_USERNAME="" # Do not include domain +$env:KEYFACTOR_PASSWORD="" +$env:KEYFACTOR_DOMAIN="" +``` + +## Commands + +### Login +For full documentation on the `login` command, see the [login](docs/kfutil_login.md) documentation. + +*WARNING* - The `login` command will store your Keyfactor credentials in a file on your local machine. This file is not +encrypted and is not secure. It is recommended that you use the `login` command only on your local machine and not on a +shared machine. Instead of using the `login` command, you can set the environmental variables listed above. + +```bash +kfutil login +``` + +### Logout +For full documentation on the `logout` command, see the [logout](docs/kfutil_logout.md) documentation. + +*WARNING* - This will delete the file containing your Keyfactor credentials at `$HOME/.keyfactor/command_config.json`. + +```bash +kfutil logout ``` ## Commands