41 Commits
Author SHA1 Message Date
Angel Dionisio 15136eb0d8 Sign managed updates Linux tarballs with cosign (#68053)
* add managed updates artifact signature verification

* updating signature max size to a more realistic, yet generous size

* fail teleport-update bulds when artifact verifier key is missing

* forward artifact signing key into Docker buildbox

* verify artifact signature over stream instead of pre-computed digest

* add insecure-skip-artifact-signature flag for dev builds

* renaming insecure signature flag and simplify verifier flow

* import separation for linter CI fix

* gofmt

* simplifying verifyArfifactSig function, table tests

* verify artifact signature during install, adding godoc for WithDigest

* adding staging CDN fallback

* updating isStagingCDN url check by adding helper function to check for raw vs want url equality, pr comments

* clarify ECDSA-specific digest verification comment

* initialize artifact signature verifier at construction time

* embed backup artifact signature public key for managed updates

* move teleport-update signature inputs to main.go

* removing comment

* verify staging signatures by default with explicit fallback

* update staging signature verification to trust prod artifacts

* fix test expected message error
2026-08-07 20:05:42 +00:00
Cam Hutchison 54273f91fe fips: Switch to Go-native FIPS140 builds from boring crypto (#66690)
* fips: Switch to Go-native FIPS140 builds from boring crypto

Switch to using Go-native FIPS140 builds, using the GOFIPS140 build
environment variable, from the old boringcrypto FIPS140 build. The
latter is no longer supported now that Go supports FIPS140 builds
natively.

FIPS140 is enabled across the build when FIPS=1 is passed to `make` when
building. The main package of the binaries import the `lib/fipscheck`
package to ensure that a binary is not switched into or out of FIPS140
mode at launch time using the GODEBUG environment variable.

FIPS140 builds of OSS Teleport are not a supported configuration,
however the base of the Enterprise edition is the OSS repository, so
most of the changes are in this repository. Building OSS Teleport in
FIPS140 mode may not be complete.

* fips: Stop using fips buildbox

Stop using the fips buildbox for fips release builds, and just use the
normal centos7 buildbox. The fips buildbox sets
`GOEXPERIMENT=boringcrypto` which should no longer be set when building
with Go-native FIPS140. The fips buildbox is otherwise identical to the
non-fips buildbox.
2026-05-20 00:42:41 +00:00
STeve (Xin) Huang dee809f091 Fix an issue tbot start/configure command usage not aligned (#65161) 2026-04-01 13:28:22 +00:00
Luke Okraszewski c223947413 [ci] add differential benchmark workflows (#63100)
This commit does the following:
- Move existing smoke benchmark workflows to seperate workflow.
- Add differential benchmark workflows
- Split benchmarks into heavy and micro categories
- Add make target arguments for benchmark time and count
- Move smoketests to run only on PRs
- Differential benchmarks run on merge queue

Benchmarks above 1ms/op are considered heavy and should make
use of iteration based benchtime to prevent the CI job from taking
too much time. Benchmarks are skipped based on env vars, this is an
alternative to splitting benchmark targets into seperate files with
build tags.

The smoke tests should be much faster and as such are set to run
on PRs to ensure the targets are not broken in the change.

The current parameters for differential benchmarks attempt to balance
CI runner time and confidence for benchstat.

Differential benchmarks determine the base commit to run the tests against,
this happens within the same job to remove the runner to runner variance.
2026-02-20 15:31:03 +00:00
Marco Dinis 91a5094e5d Configure allow-proxy-conflict in teleport-update using env var (#63860)
`teleport-update` is used to auto discover servers.
Sometimes it might be required to allow proxy conflicts, when we are
installing instances that were previously discovered by another cluster.

This is a simple fix for a single instance: just remove the
`teleport.yaml` file in target server.

However, for large clusters, this can be problematic.

Exposing this setting using an env var allows the Discovery Service to
conditionally set it.
2026-02-18 12:19:04 +00:00
Stephen Levine 3cecb0d696 [teleport-update] Add support for tbot Managed Updates (#60478)
* PID and readyz changes for tbot

remove teleport-update changes

Revert "remove teleport-update changes"

This reverts commit ee1bf09af8e9582c123761fad56bc2bc520e164d.

revert extra linting fixes

simplify test matrix

merge conflict

tbot auth case

rebase

log fixes

go-mod-tidy-all

Release 18.3.2-dev.sclevine.1

Release 18.3.2-dev.sclevine.2

fix confusing log when upgrading from non-tbot to tbot versions of teleport-update

Release 18.3.2-dev.sclevine.3

another logging adjustment

logging

Revert "Release 18.3.2-dev.sclevine.3"

This reverts commit 22b0f1b6d1.

Revert "Release 18.3.2-dev.sclevine.2"

This reverts commit 8485bba40b.

Revert "Release 18.3.2-dev.sclevine.1"

This reverts commit 6c26f2869d.

revert go.mod linting

* go-mod-tidy-all for linting
2025-11-10 17:24:36 +00:00
Andrew LeFevre c27ca5c2e1 fix teleport-update labeling itself when installing SELinux SSH module (#57659)
* fix teleport-update labeling itself when installing SELinux SSH module

* always set SELinux env var when reexec'ing

* skip extracting selinux install script
2025-09-18 14:47:41 +00:00
Marco Dinis 3243cb385d Server Auto Discover: handle suffix'd installations (#59094)
Teleport can be installed using `teleport-update`.
When installing teleport with a suffix (ie `teleport-update -i`) it will
install teleport in non-default locations, as well as an expectation to
use non-default locations for data directory and configuration and a
different systemd unit name.

In this scenario, running `teleport install autodiscover` should use
those non-default values.

This PR changes that command to consider those, and not the default ones
when the `TELEPORT_INSTALL_SUFFIX` env var is set.
2025-09-16 08:50:19 +00:00
Stephen Levine 9652ac9f42 Expose install suffix, dir, and PATH as env vars (#58813) 2025-09-05 19:00:13 +00:00
Andrew LeFevre c6010eb0db allow teleport-update to configure Teleport SSH SELinux module (#54108)
* allow teleport-update to configure Teleport SSH SELinux module

* fix setting selinux env var
2025-07-23 16:43:22 +00:00
Stephen Levine 5ea0f2a214 [teleport-update] Use teleport config package to generate systemd services (#55499)
* Refactor systemd services

* cleanup

* use FIPS in config test

* cleanup

* prevent large package import

* rename testdata file
2025-07-06 00:33:57 +00:00
Hugo Shaka d66a0f8a99 Add teleport status --is-up-to-date (#55646)
* Add `teleport status --is-up-to-date`

* Add tests + update on edition mismatch

* Address Stephen's feedback
2025-06-20 14:44:20 +00:00
Stephen Levine 2953f80789 [teleport-update] Run FIPS teleport with --fips flag (#54529)
* fix fips bug with systemd service

* fix bugs, add testing flags

* fix tests
2025-05-06 23:00:48 +00:00
rosstimothy 1f6cd45387 Add benchmark tests to capture init cost (#53637)
https://github.com/gravitational/teleport/issues/53050 was a result
of some expensive initialization that ended up impacting end users.
Existing benchmark tests did not cover this because they do not
actually launch the entire teleport binary.

The cost can be observed via `inittrace`, though it is documented
that the output is not stable and may be changed at any time.

```
GODEBUG='inittrace=1' ./releases/17.4.1/teleport version 2>&1 | rg '^init' | awk '{print $5 " ms " $2}' | sort -n -r | head -10
170 ms github.com/go-mysql-org/go-mysql/server
2.6 ms github.com/microsoft/go-mssqldb/internal/cp
2.6 ms github.com/goccy/go-json/internal/decoder
2.2 ms cloud.google.com/go/compute/apiv1/computepb
2.0 ms github.com/aws/aws-sdk-go/aws/endpoints
1.8 ms k8s.io/client-go/kubernetes/scheme
1.2 ms github.com/gravitational/teleport/lib/kube/proxy
1.2 ms github.com/gogo/protobuf/types
0.78 ms k8s.io/kubectl/pkg/scheme
0.73 ms github.com/gravitational/teleport/lib/kube/proxy/testing/kube_server
```

In order to cover in a stable way, new tests were added to the tool
package of each binary. The tests does one basic thing, re-execute
the test binary and exits. The re-execution is required to account
for any initialization costs that would otherwise be missed since
they happen prior to TestMain being called.
2025-04-09 15:11:39 +00:00
Stephen Levine 362fce8c3d [teleport-update] Add local updater metadata (#53602)
* add metadata

* newline

* cleanup status error

* refactor status error

* fix print

* order

* fix test on linux

* Truncate time to ms

* add host param to request

* jitter locally

* rename host to id

* rename func var
2025-04-07 22:05:56 +00:00
Stephen Levine ca30c3d84a [teleport-update] Additional log message and UX cleanup (#53180)
* More teleport-update UX cleanup

* cleanup overwrite error

* cleanup

* more cleanup
2025-03-19 17:04:50 +00:00
Stephen Levine 50dad3ecdd [teleport-update] Improve clarity of error logs and address UX edge cases (#52777)
* Usability fixes

* cancel jitter

* root + fix logs

* check extra case

* cleanup

* extra warning

* tests

* feedback

* add newlines

* adjust message

* consistent error type
2025-03-12 18:53:00 +00:00
Stephen Levine 2ce55778f5 [teleport-update] Set umask 0022 for teleport-update to avoid errors on enable (#52725)
* Set umask 0022 for teleport-update

* init -> main

* refactor

* move const

* add flag

* missed not

* fix inequality

* remove flag

* dead code

* docs

* docs 2

* feedback
2025-03-04 16:44:12 +00:00
Stephen Levine f3d2b45ac4 [teleport-update] Fix usage of default $PATH dir (#52604)
* Fix usage of default path

* fix other overrides

* fix hang on start
2025-02-28 03:39:50 +00:00
Stephen Levine df433832ca [teleport-update] Ensure stable interface between versions of teleport-update (#52152)
* refactor data dir

* finish refactor

* fix path

* cleanup

* more tests

* lint

* prevent notice failure without systemd

* feedback

* url
2025-02-18 23:26:13 +00:00
Stephen Levine dc9fa5f417 [teleport-update] skip updater setup when systemd is missing (#52022)
* skip updater installation when systemd is missing

* test

* wording
2025-02-11 23:47:51 +00:00
Stephen Levine 50ea82a418 [teleport-update] add insecure flag for testing (#52019)
* insecure flag

* fmt
2025-02-11 15:12:05 +00:00
Stephen Levine d4dd7e497a require force for uninstall (#51973) 2025-02-07 20:51:51 +00:00
Stephen Levine 0aba33474f [teleport-update] use new updater to reload and verify Teleport (#51734)
* wip

* finish implementation

* fix tests

* test setup

* remove stale data

* bug

* spelling

* pass log format and debug through

* feedback
2025-02-06 03:37:13 +00:00
Stephen Levine ba65e79c6a [teleport-update] Add --overwrite flag to replace tarball installations (#51579)
* add --overwrite flag

* extra warning
2025-01-30 00:35:37 +00:00
Vadym Popov 00a38c4376 [teleport-update] common MakeURL with ability to override BaseURL (#51383)
* Add templates for client tools auto-update download url

* Change to base url setting by env

MakeURL moved to common function to be general for both, agent and client tools

* Reuse MakeURL moved to common package

* Fix linter warning

* Add common env variable to override base url

* Remove template from interface

* Make template exported
Change a stale comment

* Remove unused code
2025-01-28 21:18:39 +00:00
Vadym Popov 1bf9cd5996 Fix duplicate teleport-update short command (#50304) 2024-12-16 22:44:45 +00:00
Stephen Levine f7bf7eb086 [teleport-update] update --now (#49807)
* update --now

* testdata
2024-12-05 20:00:09 +00:00
Stephen Levine 7eeed25ad8 [teleport-update] Fix usage of trace (#49388)
* fix trace

* rebase
2024-12-04 00:43:11 +00:00
Stephen Levine 08f8e55bf8 [teleport-update] Isolated installation suffix (#49364)
* namespacing

* words

* cli

* fix

* err

* use structured logs consistently

* comments

* bugs

* test

* switch to new paths

* test

* adjust

* reserved

* cleanup

* cleanup

* docs

* fix uninstall

* test

* simplify init

* cleanup

* namespace -> install-suffix

* log
2024-12-03 21:58:23 +00:00
Stephen LevineandHugo Shaka 36008dd114 [teleport-update] Uninstall subcommand (#49341)
* Uninstall

* tests

* comment

* Short-circuit link package on pinned

* log

* move error

* Update lib/autoupdate/agent/process.go

Co-authored-by: Hugo Shaka <[email protected]>

* Update lib/autoupdate/agent/process.go

Co-authored-by: Hugo Shaka <[email protected]>

* Update lib/autoupdate/agent/process.go

Co-authored-by: Hugo Shaka <[email protected]>

* Update lib/autoupdate/agent/process.go

Co-authored-by: Hugo Shaka <[email protected]>

* fix

---------

Co-authored-by: Hugo Shaka <[email protected]>
2024-11-22 21:58:02 +00:00
Stephen Levine e6fb164cae [teleport-update] status subcommand (#49308)
* status

* cleanup

* comments

* cleanup output by removing optional fields

* rebase fix
2024-11-21 22:19:44 +00:00
Stephen Levine 63838a3e12 [teleport-update] Add support for version pinning (#49307)
* pinning

* cleanup

* unskip

* cleanup

* unpin

* typo
2024-11-21 21:08:23 +00:00
Stephen LevineandHugo Shaka 1989776905 [teleport-update] Add unlink-package command (#49250)
* unlink

* test

* lock type

* comments

* cleanup

* Update lib/autoupdate/agent/installer.go

Co-authored-by: Hugo Shaka <[email protected]>

---------

Co-authored-by: Hugo Shaka <[email protected]>
2024-11-21 16:51:46 +00:00
Stephen Levine 7faefa223e [teleport-update] Add systemd setup (#49174)
* service and timer

* comments

* feedback

* feedback
2024-11-20 20:13:24 +00:00
Stephen Levine fb64dbe47c [teleport-update] Add link subcommand (#48712)
* wip

* refactor

* docs

* updater

* add link command

* test LinkPackage

* cleanup

* fix enterprise paths

* fix systemd linking

* typo

* comment

* comments

* typo

* feedback

* adjust systemd service locations

* cleanup tests, adjust service link path
2024-11-15 02:38:52 +00:00
Stephen Levine aadb50d450 [teleport-update] Add update subcommand (#48244)
* Add update subcommand

* fix

* lint

* add command

* warn on known edition

* warn on unknown edition for update
2024-11-11 21:50:19 +00:00
Stephen Levine 323e56e363 [teleport-update] Add support for reloading the agent & reverting symlinks on failed reload (#47929)
* wip

* cleanup

* comments

* test wip

* test link revert

* tests

* cleanup

* cleanup more

* comments

* comments

* errors

* comments

* linting

* fix bugs

* fix typo

* cleanup

* cleanup

* fix revert

* lint

* feedback

* fix

* fix test

* clarify comment

* use afterfunc
2024-11-04 21:49:25 +00:00
Stephen Levine c394da09d3 [teleport-update] Add linking into /usr/local (#47879)
* clean up download logic

* Finish installer tests

* fips and ent support

* feedback

* move enterprise/fips to webapi

* wip

* wip2

* add cleanup

* fix extract

* wip

* fix tests

* remove safety

* cleanup

* cleanup extract

* cleanup

* cleanup

* fix bugs

* cleanup
2024-10-28 16:05:29 +00:00
Stephen Levine d0ca3bf965 [teleport-update] Add enable command (#47565)
* Add enable scaffold

* add installer

* refactor

* add enable tests

* clean up download logic

* Finish installer tests

* cleanup

* fix flags

* fix errors

* logging

* cleanup

* fix test

* Fix download size logic

* remove agent prefixes

* namespace package

* rename file

* feedback

* fips and ent support

* hide force version

* feedback

* feedback 2

* fix test

* move enterprise/fips to webapi

* Fix interface
2024-10-21 18:46:56 +00:00
Stephen Levine aae732aac5 Add teleport-update binary scaffolding and disable command (#46418)
* Add main.go

* wip

* group flag

* wip

* wip

* mvp

* wip

* separate files

* cleanup

* jitter

* scaffold only

* remove teleport changes

* remove teleport changes - group

* test

* test lock

* remove edition

* feedback

* clarify default data dir

* cleanup

* move version to status

* consistent naming for update.yaml

* improve lock test

* explain lint

* use shared locking logic

* fix test

* Move disable logic to lib

* feedback

* switch to default transport
2024-10-10 19:24:03 +00:00