Skip to content

Updates self-hosted db discover to use 2190h ttl for certificate#47081

Merged
stevenGravy merged 5 commits intomasterfrom
stevenGravy/discoverdbsign
Oct 3, 2024
Merged

Updates self-hosted db discover to use 2190h ttl for certificate#47081
stevenGravy merged 5 commits intomasterfrom
stevenGravy/discoverdbsign

Conversation

@stevenGravy
Copy link
Copy Markdown
Contributor

@stevenGravy stevenGravy commented Oct 2, 2024

fixes #47069

changelog: Updates self-hosted db discover flow to generate 2190h TTL certs, not 12h

@stevenGravy stevenGravy requested a review from kimlisa October 2, 2024 12:37
@stevenGravy stevenGravy changed the title Updates self-hosted db discover to use 2190h ttl Updates self-hosted db discover to use 2190h ttl for certificate Oct 2, 2024
@stevenGravy stevenGravy enabled auto-merge October 2, 2024 12:47
@stevenGravy stevenGravy requested a review from r0mant October 2, 2024 12:49
@gravitational gravitational deleted a comment from github-actions Bot Oct 2, 2024
@gravitational gravitational deleted a comment from github-actions Bot Oct 2, 2024
@greedy52 greedy52 requested a review from GavinFrazar October 2, 2024 15:08
<Text mt={1}>
Restart the database server to apply the configuration.
Restart the database server to apply the configuration. The
certificate is by default 90 days so this will require installing an
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
certificate is by default 90 days so this will require installing an
certificate is valid for 90 days so this will require installing an

I guess the next question is how can they generate a new one? Should we add the tctl sign ... command here? Or just link to docs?

Copy link
Copy Markdown
Contributor Author

@stevenGravy stevenGravy Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think docs as there are things like is the user set up to impersonate right. I'll add that link

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcoandredinis , please see update

Comment thread web/packages/teleport/src/Discover/Database/MutualTls/useMutualTls.ts Outdated
stevenGravy and others added 3 commits October 2, 2024 19:03
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrm, i don't think we should define the database TTL here, but instead define it as a const in the file it is used (see other comment)

i don't see it being used in other places atm

Comment on lines +116 to +117
const ttl = cfg.getDatabaseCertificateTTL();
const requestData = JSON.stringify({ hostname, ttl });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the top of this file, i would define

// the length of the certificate to request for the database
const DEFAULT_DATABASE_TTL = '2190h'

then

Suggested change
const ttl = cfg.getDatabaseCertificateTTL();
const requestData = JSON.stringify({ hostname, ttl });
const requestData = JSON.stringify({ hostname, ttl: DEFAULT_DATABASE_TTL });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

took liberty to refactor this page a bit

@stevenGravy stevenGravy added this pull request to the merge queue Oct 3, 2024
Merged via the queue into master with commit cf9f81b Oct 3, 2024
@stevenGravy stevenGravy deleted the stevenGravy/discoverdbsign branch October 3, 2024 00:43
@public-teleport-github-review-bot
Copy link
Copy Markdown

@stevenGravy See the table below for backport results.

Branch Result
branch/v14 Create PR
branch/v15 Create PR
branch/v16 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing TTL when enrolling a Postgres DB via Web UI

4 participants