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

[v16] Machine ID: Document 24h TTL limit and warn when exceeded #44989

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion docs/pages/enroll-resources/machine-id/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,22 @@ credentials produced by Machine ID from being used to connect to resources.

As a work-around, configure Device Trust enforcement on a role-by-role basis
and ensure that it is not required for roles that you will impersonate using
Machine ID.
Machine ID.

## Can Machine ID be used to generate long-lived certificates?

Machine ID cannot currently be used to generate certificates valid for longer
than 24 hours, and requests for longer certificates using the `certificate_ttl`
parameter will be reduced to this 24 hour limit.

This limit serves multiple purposes. For one, it encourages security best
practices by only ever issuing very short lived certificates. Additionally, as
Machine ID allows for certificate renewal, this limit helps to prevent further
exploitation should a Machine ID identity be compromised: an attacker could use
a stolen renewable certificate to request very long lived certificates and
maintain access for a much longer period.

If your use case absolutely requires long-lived certificates,
[`tctl auth sign`](../../reference/cli/tctl.mdx#tctl-auth-sign) can
alternatively be used, however this loses the security benefits of Machine ID's
short-lived renewable certificates.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ proxy_server: "teleport.example.com:443" # or "example.teleport.sh:443" for Tele
# certificate_ttl specifies how long certificates generated by `tbot` should
# live for. It should be a positive, numeric value with an `m` (for minutes) or
# `h` (for hours) suffix. By default, this value is `1h`.
# This has a maximum value of `24h`.
certificate_ttl: "1h"

# renewal_interval specifies how often `tbot` should aim to renew the
Expand Down Expand Up @@ -675,7 +676,7 @@ appropriate.
#### `directory`

The `directory` destination type stores artifacts as files in a specified
directory.
directory.

```yaml
# type specifies the type of the destination. For the directory destination,
Expand Down
9 changes: 9 additions & 0 deletions lib/tbot/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,15 @@ func (conf *BotConfig) CheckAndSetDefaults() error {
)
}

if conf.CertificateTTL > defaults.MaxRenewableCertTTL {
log.WarnContext(
context.TODO(),
"Requested certificate TTL exceeds the maximum TTL allowed and will likely be reduced by the Teleport server",
"requested_ttl", conf.CertificateTTL,
"maximum_ttl", defaults.MaxRenewableCertTTL,
)
}

return nil
}

Expand Down
Loading