2018-05-29 21:07:40 +00:00
|
|
|
---
|
2020-09-01 15:14:13 +00:00
|
|
|
layout: commands
|
2020-04-07 18:55:19 +00:00
|
|
|
page_title: 'Commands: Connect CA'
|
2018-05-29 21:07:40 +00:00
|
|
|
description: >
|
|
|
|
The connect CA subcommand is used to view and modify the Connect Certificate
|
|
|
|
Authority (CA) configuration.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Consul Connect Certificate Authority (CA)
|
|
|
|
|
|
|
|
Command: `consul connect ca`
|
|
|
|
|
|
|
|
The CA connect command is used to interact with Consul Connect's Certificate Authority
|
|
|
|
subsystem. The command can be used to view or modify the current CA configuration. See the
|
2023-01-25 16:52:43 +00:00
|
|
|
[Connect CA documentation](/consul/docs/connect/ca) for more information.
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
```text
|
|
|
|
Usage: consul connect ca <subcommand> [options] [args]
|
|
|
|
|
|
|
|
This command has subcommands for interacting with Consul Connect's
|
|
|
|
Certificate Authority (CA).
|
|
|
|
|
|
|
|
Here are some simple examples, and more detailed examples are available
|
|
|
|
in the subcommands or the documentation.
|
|
|
|
|
|
|
|
Get the configuration:
|
|
|
|
|
|
|
|
$ consul connect ca get-config
|
|
|
|
|
|
|
|
Update the configuration:
|
|
|
|
|
|
|
|
$ consul connect ca set-config -config-file ca.json
|
|
|
|
|
|
|
|
For more examples, ask for subcommand help or view the documentation.
|
|
|
|
|
|
|
|
Subcommands:
|
|
|
|
get-config Display the current Connect Certificate Authority (CA) configuration
|
|
|
|
set-config Modify the current Connect CA configuration
|
|
|
|
```
|
|
|
|
|
|
|
|
## get-config
|
|
|
|
|
|
|
|
This command displays the current CA configuration.
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The table below shows this command's [required ACLs](/consul/api-docs/api-structure#authentication). Configuration of
|
|
|
|
[blocking queries](/consul/api-docs/features/blocking) and [agent caching](/consul/api-docs/features/caching)
|
2022-01-10 21:44:56 +00:00
|
|
|
are not supported from commands, but may be from the corresponding HTTP endpoint.
|
|
|
|
|
|
|
|
| ACL Required |
|
|
|
|
| ---------------- |
|
|
|
|
| `operator:write` |
|
|
|
|
|
2018-05-29 21:07:40 +00:00
|
|
|
Usage: `consul connect ca get-config [options]`
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
Corresponding HTTP API Endpoint: [\[GET\] /v1/connect/ca/configuration](/consul/api-docs/connect/ca#get-ca-configuration)
|
2022-01-10 17:40:11 +00:00
|
|
|
|
2018-05-29 21:07:40 +00:00
|
|
|
#### API Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_options_client.mdx'
|
2020-04-07 23:56:08 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_options_server.mdx'
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
The output looks like this:
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"Provider": "consul",
|
2018-06-21 23:54:59 +00:00
|
|
|
"Config": {},
|
2018-05-29 21:07:40 +00:00
|
|
|
"CreateIndex": 5,
|
|
|
|
"ModifyIndex": 197
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## set-config
|
|
|
|
|
|
|
|
Modifies the current CA configuration. If this results in a new root certificate
|
2023-01-25 16:52:43 +00:00
|
|
|
being used, the [Root Rotation](/consul/docs/connect/ca#root-certificate-rotation) process
|
2018-05-29 21:07:40 +00:00
|
|
|
will be triggered.
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The table below shows this command's [required ACLs](/consul/api-docs/api-structure#authentication). Configuration of
|
|
|
|
[blocking queries](/consul/api-docs/features/blocking) and [agent caching](/consul/api-docs/features/caching)
|
2022-01-10 21:44:56 +00:00
|
|
|
are not supported from commands, but may be from the corresponding HTTP endpoint.
|
|
|
|
|
|
|
|
| ACL Required |
|
|
|
|
| ---------------- |
|
|
|
|
| `operator:write` |
|
|
|
|
|
2018-05-29 21:07:40 +00:00
|
|
|
Usage: `consul connect ca set-config [options]`
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
Corresponding HTTP API Endpoint: [\[PUT\] /v1/connect/ca/configuration](/consul/api-docs/connect/ca#update-ca-configuration)
|
2022-01-10 17:40:11 +00:00
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
The output looks like this:
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
```
|
|
|
|
Configuration updated!
|
|
|
|
```
|
2020-04-07 23:56:08 +00:00
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
The return code will indicate success or failure.
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2022-12-03 14:17:33 +00:00
|
|
|
~> **If currently using Vault CA provider:**
|
|
|
|
If you intend to change the CA provider from Vault to another,
|
2023-01-25 16:52:43 +00:00
|
|
|
or to change the Vault provider's [`RootPKIPath`](/consul/docs/connect/ca/vault#rootpkipath),
|
2022-12-03 14:17:33 +00:00
|
|
|
you must temporarily elevate the privileges of the Vault token
|
|
|
|
or auth method in use as described in the
|
2023-01-25 16:52:43 +00:00
|
|
|
[Vault CA provider documentation](/consul/docs/connect/ca/vault#additional-vault-acl-policies-for-sensitive-operations).
|
2022-12-03 14:17:33 +00:00
|
|
|
|
2018-05-29 21:07:40 +00:00
|
|
|
#### Command Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-config-file` - (required) Specifies a JSON-formatted file to use for the new configuration.
|
|
|
|
The format of this config file matches the request payload documented in the
|
2023-01-25 16:52:43 +00:00
|
|
|
[Update CA Configuration API](/consul/api-docs/connect/ca#update-ca-configuration).
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2021-01-29 21:38:11 +00:00
|
|
|
- `-force-without-cross-signing` `(bool: <optional>)` - Indicates that the CA change
|
2022-12-03 14:17:33 +00:00
|
|
|
should be forced to complete even if the current CA doesn't support root cross-signing.
|
|
|
|
|
|
|
|
~> **Caution:** Use of this flag will cause temporary connection failures
|
|
|
|
until service mesh proxies and/or Consul client agents receive a new certificate
|
|
|
|
that establishes trust with the new root.
|
|
|
|
Do not use this flag unless you are sure you need it.
|
2023-01-25 16:52:43 +00:00
|
|
|
Refer to [Forced Rotation Without Cross-Signing](/consul/docs/connect/ca#forced-rotation-without-cross-signing)
|
2021-01-29 21:38:11 +00:00
|
|
|
for more detail.
|
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
#### API Options
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
@include 'http_api_options_client.mdx'
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
@include 'http_api_options_server.mdx'
|