Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CockroachDB uses Postgres wire protocol so it's pretty much supported out-of-the-box (with client certificate auth) but this PR implements a few updates for better integration and to account for some differences in auth:
Update
tctl auth sign
command to support--format=cockroachdb
which produces secrets in Cockroach-friendly format. That includes filenames (Cockroach expects them to benode.crt
,node.key
,ca.crt
) and mandatoryCN=node
for the node certs. See their docs for more details if interested.Add
protocol: cockroachdb
for database configuration. Technically this is the same asprotocol: postgres
on the backend, but it is used e.g. to pick appropriate client to connect with.Related to the above, update
tsh db connect
to use nativecockroach
CLI client to connect to CockroachDB. It falls back topsql
(which is compatible) ifcockroach
isn't found.For authorization, do not use
db_names
for RBAC. Onlydb_users
are enforced, similar to MySQL. This is because, unlike Postgres, in Cockroach you can switch database at any time without reconnecting and cross-database queries are allowed so limitingdb_names
on Teleport side would be pointless.The guide will be coming in a separate PR.