|
1 | 1 | # Keyfactor Util |
| 2 | + |
2 | 3 | General go-lang CLI utility for the Keyfactor API. |
3 | 4 |
|
4 | 5 | ## Quickstart |
| 6 | + |
5 | 7 | ```bash |
6 | 8 | make install |
7 | 9 | kfutil --help |
8 | 10 | ```` |
9 | 11 |
|
| 12 | +### Environmental Variables |
| 13 | + |
| 14 | +All the variables listed below need to be set in your environment. The `kfutil` command will look for these variables |
| 15 | +and use them if they are set. If they are not set, the utility will fail to connect to Keyfactor. |
| 16 | + |
| 17 | +```bash |
| 18 | +export KEYFACTOR_HOSTNAME=<mykeyfactorhost.mydomain.com> |
| 19 | +export KEYFACTOR_USERNAME=<myusername> # Do not include domain |
| 20 | +export KEYFACTOR_PASSWORD=<mypassword> |
| 21 | +export KEYFACTOR_DOMAIN=<mykeyfactordomain> |
| 22 | +``` |
| 23 | + |
10 | 24 | ## Commands |
11 | 25 |
|
12 | 26 | ### Bulk operations |
13 | 27 |
|
14 | 28 | #### Bulk create cert stores |
| 29 | + |
15 | 30 | `# TODO: Not implemented` |
16 | | -This will attempt to process a CSV input file of certificate stores to create. The template can be generated by running: `kfutil generate-template --type bulk-certstore` command. |
| 31 | +This will attempt to process a CSV input file of certificate stores to create. The template can be generated by |
| 32 | +running: `kfutil generate-template --type bulk-certstore` command. |
| 33 | + |
17 | 34 | ```bash |
18 | 35 | kfutil bulk create certstores --file <path to csv file> |
19 | 36 | ``` |
20 | 37 |
|
21 | 38 | #### Bulk create cert store types |
22 | | -`# TODO: Not implemented` |
23 | | -This will attempt to process a CSV input file of certificate store types to create. The template can be generated by running: `kfutil generate-template --type bulk-certstore-types` command. |
| 39 | + |
| 40 | +`# TODO: Not implemented` |
| 41 | +This will attempt to process a CSV input file of certificate store types to create. The template can be generated by |
| 42 | +running: `kfutil generate-template --type bulk-certstore-types` command. |
| 43 | + |
24 | 44 | ```bash |
25 | 45 | kfutil bulk create certstores --file <path to csv file> |
26 | 46 | ``` |
27 | 47 |
|
28 | 48 | ### Root of Trust |
29 | 49 |
|
30 | 50 | #### Generate Certificate List Template |
| 51 | + |
31 | 52 | This will write the file `certs_template.csv` to the current directory. |
| 53 | + |
32 | 54 | ```bash |
33 | 55 | kfutil stores generate-template-rot --type certs |
34 | 56 | ``` |
35 | 57 |
|
36 | 58 | #### Generate Certificate Store List Template |
| 59 | + |
37 | 60 | This will write the file `certs_template.csv` to the current directory. |
| 61 | + |
38 | 62 | ```bash |
39 | 63 | kfutil stores generate-template-rot --type stores |
40 | 64 | ``` |
41 | 65 |
|
42 | 66 | #### Run Root of Trust Check |
43 | | -This will read the file `certs.csv` from the current directory or the absolute path, and generate a report of the certificate stores that contain the specified certificates. |
| 67 | + |
| 68 | +This will read the file `certs.csv` from the current directory or the absolute path, and generate a report of the |
| 69 | +certificate stores that contain the specified certificates. |
| 70 | + |
44 | 71 | ```bash |
45 | 72 | kfutil stores rot --stores stores.csv --certs certs.csv |
46 | 73 | ``` |
47 | 74 |
|
48 | 75 | ### Development |
| 76 | + |
49 | 77 | This CLI developed using [cobra](https://umarcor.github.io/cobra/) |
| 78 | + |
50 | 79 | #### Adding a new command |
| 80 | + |
51 | 81 | ```bash |
52 | 82 | cobra-cli add <my-new-command> |
53 | 83 | ``` |
| 84 | + |
54 | 85 | alternatively you can specify the parent command |
| 86 | + |
55 | 87 | ```bash |
56 | 88 | cobra-cli add <my-new-command> -p '<parent>Cmd' |
57 | 89 | ``` |
0 commit comments