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

[V10] Download mTLS files from Web (#14526) #15081

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

marcoandredinis
Copy link
Contributor

Backport of #14526

@github-actions github-actions bot added the tctl tctl - Teleport admin tool label Aug 1, 2022
@github-actions github-actions bot removed request for r0mant and ryanclark August 1, 2022 13:38
@marcoandredinis marcoandredinis enabled auto-merge (squash) August 1, 2022 14:44
In the context of Teleport Discover we are trying to ease the usage of Teleport for the user's first interaction.

When adding a new database resource the user must, among other things, generate the mTLS files
Examples:
https://goteleport.com/docs/database-access/guides/postgres-self-hosted/#step-25-create-a-certificatekey-pair
https://goteleport.com/docs/database-access/guides/mysql-self-hosted/#step-24-create-a-certificatekey-pair

This PR aims to reduce this friction: the user should be able to setup the resource without prior setup of local tools (`tsh login`)
We're doing this by providing an endpoint that will return those exact files

Demo
```shell
marco@lenix ~/p/downloadmtls> curl --silent --insecure 'https://127.0.0.1.nip.io:3080/v1/webapi/sites/lenix/sign' --dat
a '{"hostname":"discover.example.com", "ttl":"9999h", "format": "db"}' --header 'Authorization: Bearer 308bf3dd3019ddc4
2cff44a48e028480' --header 'Content-Type: application/json' -OJ
marco@lenix ~/p/downloadmtls> tar -xvf teleport_mTLS_discover.example.com.tar.gz
server.key
server.crt
server.cas
marco@lenix ~/p/downloadmtls> head -1 server.*
==> server.cas <==
-----BEGIN CERTIFICATE-----

==> server.crt <==
-----BEGIN CERTIFICATE-----

==> server.key <==
-----BEGIN RSA PRIVATE KEY-----
```

Fixes #14049
@marcoandredinis marcoandredinis force-pushed the marco/v10/download_mtls branch from 348742d to 6ee2030 Compare August 1, 2022 14:44
@marcoandredinis marcoandredinis merged commit 18bf1c6 into branch/v10 Aug 1, 2022
@marcoandredinis marcoandredinis deleted the marco/v10/download_mtls branch August 1, 2022 15:37
@marcoandredinis marcoandredinis added the discover Issues related to Teleport Discover label Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discover Issues related to Teleport Discover tctl tctl - Teleport admin tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants