Commit Graph
96 Commits
Author SHA1 Message Date
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
Brian Joerger 58f71101d8 feat: Hardware Key Agent - Add api/utils/keys/hardwarekey package (#53671)
* Move hardware key files into new hardwarekey package.

* Tidy up PIVSlot logic and remove its piv-go dependency.

* Add godoc comments to cliPrompt methods; Update cliprompt.go license year.

* Add godocs.
2025-04-07 19:31:11 +00:00
Michael 801bd8fc76 Add env var to disable Role Visualizer (#51880)
This is a temporary escape hatch to disable the role diff visualizer.
2025-02-07 15:21:43 +00:00
Yassine Bounekhla f143c9c06c add set as default functionality to auth connectors (#50751) 2025-01-20 14:55:16 +00:00
Hugo ShakaandStephen Levine a33473dde9 Make the proxy read from autoupdate_agent_rollout (#49380)
* Add autoupdate_agenbt_rollout support

* fix ping proxy tests

* address creack's feedback

* Address sclevine's feedback

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>

* fix panic in tests

---------

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>
2024-12-05 22:21:07 +00:00
Hugo Shaka 7d102ca45c introduce webclient.ReusableClient (#49296) 2024-11-27 15:22:22 +00:00
Brian Joerger 0927b6f768 Teleport Connect allow SSO hostname (#48035)
* Add SSO provider URLs to ping response.

* Add SSOHostname to profile.

* Add SSOHostname to teleterm cluster.

* Add SSO hostname to connect's proxy host allow list.

* Fix lint.

* Address comments.

* Document use of SSOHostname in the profile.

* Use sso host, not hostname.

* Ping with connector.

* Resolve comments.
2024-11-05 18:43:20 +00:00
Vadym Popov 9d2b5c5fe9 Client auto updates integration for {tctl,tsh} (#47815)
* Client auto updates integration for tctl/tsh

* Add version validation
Fix recursive version check for darwin platform
Fix cleanup for multi-package support

* Fix identifying tools removal from home directory

* Replace ToolsMode with ToolsAutoUpdate

* Reuse insecure flag for tests

* Fix CheckRemote with login

* Fix windows administrative access requirement
Update must be able to be canceled, re-execute with latest version or last updated
Show progress bar before request is made

* Fix update cancellation for login action
Address review comments

* Add signal handler with stack context cancellation

* Use copy instead of hard link for windows
Fix progress bar if we can't receive size of package

* Replace with list in order to support manual cancel

* Download archive package to temp directory

* Decrease timeout for client tools proxy call
2024-10-31 17:09:24 +00:00
Stephen Levine 3220ffad77 [teleport-update] Use new webapi fields to find version (#47961)
* Adapt teleport-update to new webapi endpoints

* feedback
2024-10-29 19:03:31 +00:00
Hugo Shaka 1807dfdf52 Implement immediate schedule support for automatic updates (#47920)
* Implement immediate schedule support

* expose edition, fips, and ensure ping endpoint answers

* fix after rebase

* fix cache tests
2024-10-29 15:11:29 +00:00
Vadym Popov 10fb784495 Client AutoUpdate proto structure changes (#47532)
* Update client autoupdate proto structure

* Replace with reserved

* Fix unit tests

* Add more info in proto

* Rename proto to be aligned RFD namings

* Replace enum type for ToolsMode to string
2024-10-17 14:36:06 +00:00
Vadym Popov eed38adeea Expose client tools auto update for find endpoint (#46785)
* Expose client tools auto update for find endpoint

* Group auto update settings in find response
Log error instead returning error
Add tests auto update settings in find endpoint
Add check for not implemented error

* Add more test cases
2024-10-04 16:01:55 +00:00
rosstimothy 741b54c2b4 Allow a custom SSH dial timeout to be set cluster wide (#45507)
A new SSHDialTimeout field is added to the ClusterNetworkingConfiguration
to allow cluster admins to override the default dial timeout of 30s.
The dial timeout is made available in /webapi/ping, stored in the tsh
profile, and cached on disk like other similar cluster settings so
that tsh ssh can consume the relevant information without requiring
an additional round trip to the cluster. At the moment, there is no
support for an unlimited dial timeout, as that would cause
complexity with backwards compatibility.
2024-08-20 13:11:46 +00:00
Nic KlaassenandTiago Silva bca26e06f4 add signature algorithm suite to ping response (#44567)
* add signature algorithm suite to ping response

* type fix

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2024-07-24 15:09:25 +00:00
Michelle Bergquist 0824ee8ee4 Type the UI entitlements to match the response (#44329) 2024-07-17 17:30:35 +00:00
Yassine Bounekhla f88877e4bf Add saml SLO to tsh logout (#43528) 2024-07-16 02:37:26 +00:00
Gabriel Corado 21b8ce45a0 List database session recordings on WebUI and tsh (#43893)
* feat(player): add postgresql session recording translator

* feat: database session recordings on WebUI

* test(web): fix expected config

* feat(web): fix missing database recording type

* refactor: code review suggestions

* refactor(tool): use database service name instead of connection db name

* chore(web): fix prettier errors

* feat(db): add default value for clock field

* chore(web): fix linter

* chore(player): revert change

* fix(db): missing session start time
2024-07-12 15:17:02 +00:00
Michelle Bergquist 7553aaa57a Surface entitlements to webCfg & UI (#43622) 2024-07-10 15:40:56 +00:00
Jakub Nyckowski bfaa3340e8 Remove Assist (#42657)
* Remove assist feature

* Fix some tests

* Remove unused functions

* Fix ut

Remove more stuff
2024-06-10 20:57:05 +00:00
Justinas Stankevičius 5eb9aa9a80 Entra ID integration: integration script updates and web onboarding prerequisites (#42172)
* Remove integration name validation from web script

Not used by the script. It is validated by the "plugins/validate"
endpoint.

* Add required frontend constants for Entra ID

* Support Azure/Entra integrations in the list

* Add IsPolicyEnabled to web config

* Allow custom URL for ButtonLockedFeature

* Add CTA_ENTRA_ID event type

* Expose TAGInfoCache for use in e

* Add LackingIgs option

* Add Entra ID icon

* Add Entra ID plugin to storybook

* Bump e for dev build

* Return underlying error in getPrivateAPIToken

* Find default Azure subscription instead of the first one

* Require user to re-login when provisioning Azure OIDC

* Update prehog protos with Entra ID values

From https://github.com/gravitational/cloud/pull/9111

* Suppress verbose warnings / information from az

* Add an additional message after successful auth

Lets user know that `az login` has completed
and `teleport` is continuing its work.

* Move EntraId constant to the bottom

* Revert unintended changes to usageevents

CTA is 1-to-1 with prehog, but IntegrationEnrollKind is not.

* Remove integrationName validation asserts from test

This parameter is no longer accepted by the endpoint

* Revert "Bump e for dev build"

This reverts commit fc747a0c33.
2024-05-31 13:54:28 +00:00
Michael 265b58cb7e Apply new logos based on license (#41294) 2024-05-15 19:09:33 +00:00
Rafał CieślakandKrzysztof Skrzętnicki 8e319e7fd6 webclient.Ping: Return error on unsuccessful response (#41317)
* webclient.Ping: Return err on unsuccessful response

* Log mangled response, add test case

* Point towards possible causes of errors

Co-authored-by: Krzysztof Skrzętnicki <krzysztof.skrzetnicki@goteleport.com>

---------

Co-authored-by: Krzysztof Skrzętnicki <krzysztof.skrzetnicki@goteleport.com>
2024-05-14 12:43:43 +00:00
Michael 80f314a550 Add DisableIncludeRequestableRequests to UIConfig (#41064) 2024-05-02 16:53:13 +00:00
ddbd9eefed Replace isTeam with new flags (#39794)
* Add new flags to modules

* Add deprecated comments to isTeam

* Make support flag an enum

* Add a TODO instead of deprecating flag right away

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Add gogoproto.jsontag to new fields

* remove meaning from enum zero value

* Reuse proto.SupportType instead of suping

* Replace isTeam for new flags in web app

* Update proto file: rename enum 0 value to unspecified;fix json tag casing

* Reuse proto file instead of aliasing it

* undo removing method by accident

* Add MobileDeviceManagement field to web config struct

* Improve comments

* Fix tests

* Simplify lockedFeatures object

* Include JoinActiveSessions in the web config object

* Remove more instances of isTeam

* Apply suggestions from code review - improve comments

Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>

* Use consistent comments to remove isTeam

* Update godocs comments

* Revert removign `isTeam` from stories it still should

* Fix godoc typo

Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>
2024-04-30 11:54:17 +00:00
rosstimothy 8f1522bb34 Convert api to use slog instead of logrus (#39255)
THe use of slog now allows logrus to be removed from the api
module entirely.
2024-03-18 21:20:28 +00:00
Alan Parra 446505674b chore: Remove the AuthenticationSettings.DeviceTrustDisabled field (#37595) 2024-01-31 18:56:38 +00:00
Lisa Kim 36b3deab6e Lift legacy check for Access List and Access Monitoring (#35702)
* Revert "Restrict IGS flag check to usage based plans only (#35431)"

This reverts commit 31e1715532.

* Update test

* Pass access request monthly limit to webconfig

* Fix typo
2023-12-21 01:45:16 +00:00
Zac Bergquist 44a6bb1933 Use pkg slices from the standard library (#35905)
Prefer the stdlib version of the experimental package.
Includes a depguard update to prevent future regressions,
as well as an e-ref update to appease depguard.

Generated with:

    $ gofmt -w -r '"golang.org/x/exp/slices" -> "slices"' . && \
        make fix-imports
2023-12-19 23:06:53 +00:00
Lisa Kim ba2bdb9d66 Define access monitoring max range limit field (#35241)
* Define max report range limit fields

* Add feature limits to web ui config
2023-12-05 20:28:55 +00:00
Lisa Kim 6eaf5eaf55 Web: Audit use of isUsageBasedBilling flag (#35172)
* Add team and igs flag to web config

* Use isTeam and igs flag in TeleportContext

* Update ButtonLockedFeature

* Update IntegrationTiles

* Update Sessions

* Update Support

* Fix grammar

* Add clarifying comment on isUsageBasedBilling flag
2023-12-01 18:01:27 +00:00
Jakub Nyckowski af817583ad Proxy TAG requests through Auth (#34642)
* Proxy TAG requests through Auth

* Integrate Access Graph feature and optimize services

This commit entails the integration of the Access Graph feature into the existing service configuration. This feature is manifested through an 'IsEnabled' method that checks the state of the access graph. Additionally, the auth service logic now includes a flag for enabling access graph. The services have been further optimized with adjustments geared towards improving performance and readability of the code.

* Move TAG enabled flag from proxy to user setting/auth context

* Swap a pointer to AccessGraph config with a value.

* Add 'TestNewAccessGraph' function to 'useracl_test.go' file.

The function 'TestNewAccessGraph' has been added to run tests checking the configuration of Access Graph. Furthermore, a small change is made for the 'KindAccessGraph' comment in 'constants.go' to provide more accurate information.

* Implement Access Graph feature across various files

The Access Graph feature has been incorporated in 'module.go', 'authservice.proto', 'auth.go', and 'plugin.go' files. A method 'EnableAccessGraph' is also introduced in 'module.go' to allow the usage of this feature. Descriptions of Access Graph have been adjusted across files to explicitly state the feature's enablement.

* Fix tests

* Remove unused access graph feature code

This commit removes all references and uses of the access graph feature from the codebase. It also updates corresponding tests to reflect this removal. It also adds EnableAccessGraph() method to testing module to fix test compilation.
2023-11-16 18:08:37 +00:00
Jakub Nyckowski 29d965d2fa TAG initial implementation (#34541)
* TAG initial implementation

This change introduces the initial Teleport integration with TAG. The implementation introduces:

* new `access_graph` section in `teleport.yaml` file that holds the access graph configuration
* new `access_graph` RBAC kind, that controls who has access to TAG feature
* the new access graph RBAC kind is added to the ACL REST endpoint, so WebUI know if TAG is enabled and the user has access to it.

* Remove `UseAuth` and improve comments in `AccessGraph`

This commit removes the `UseAuth` field from the `AccessGraph` configuration. At the same time, the comments for each field in `AccessGraph` have been made more consistent and descriptive, providing clear declaration of each field's purpose. The comments in `WatchEvents` in `grpcserver.go` have also been updated for clarity.
2023-11-13 22:46:17 +00:00
Andrew Burke 42822dab68 Deflake HTTP_PROXY tests (#33614)
This change rewrites a few HTTP_PROXY tests to be less flaky.
2023-11-08 17:01:05 +00:00
Marco André Dinis 072845b3fc Discover Kube Agent: use automatic upgrades version (#34145)
For clusters with auto upgrades enabled, the target version must be the
one provided by the VersionURL endpoint.
2023-11-02 15:43:53 +00:00
Brian Joerger a36d4d1e34 Configure custom PIV slot for hardware key support (#31732)
* Update RFD.

* Add custom PIV slot logic.

* Add custom piv slot to cluster auth preference.

* Fix error handling of parsing private key policy errors.

* Add new PIVSlot string type.
2023-10-11 01:36:22 +00:00
Yassine Bounekhla 62e910c2c5 add custom theme and logos (#30823) 2023-08-23 18:17:11 +00:00
rosstimothy 71b68695c9 Make TestWebClientClosesIdleConnections more stable (#30630)
Improves reliability of the test by eliminating the reliance of
connection states being received in the expected order. Instead all
states are sorted and compared with the expected states.

Fixes #30535
2023-08-17 19:23:33 +00:00
Yassine Bounekhla c9a8288920 add feature hiding license flag (#30083) 2023-08-15 20:56:33 +00:00
Alex McGrath 0760bc9776 Allow setting max_session_ttl from clusterauth preferences (#26824)
Document `default_session_ttl` in the reference.
2023-06-21 10:39:34 +00:00
Sakshyam Shah 1762c764ae feat: adds motd to the ui (#27813)
* feat: adds motd to the ui

* address review suggestions:
- update MOTD to Motd
- moved motd state to useLogin
- added behaviour tests

* add motd test to apiserver_test.go webconfig. update snapshot test to address motd warning

* git mv to update MOTD to Motd

* multiple fix:
- add unmount test
- remove motd title
- group states together in useLogin
- update arrow func to classic js func

* remove unused waitForElementToBeRemoved
2023-06-16 02:43:17 +00:00
Lisa Kim ad295055e3 Fix not being able to "login" with auth type set to sso but no connectors set yet (#27510)
* Delete ping service

* Move flags from web config instead of calling ping

* Clarify TODO comment
2023-06-07 19:44:43 +00:00
Jakub Nyckowski ae8f2fa929 Assist - Configuration and usage (#25953)
* Assist - Configuration and usage

* Add network config test

* Add config test

* Run GCI

* Address review comments
2023-05-11 01:56:55 +00:00
matheus 57690ee961 Add IsUsageBased to features and send it to web UI (#25465)
* Add IsUsageBased to features and send to web UI

* Update flag name

* Improve comment

* Add comments and improve field name

* Remove duplicated property
2023-05-04 14:57:48 +00:00
Alan Parra 48dd429917 Return auto-enroll status on Ping (#24752)
* Return auto-enroll status on Ping

* Verify both old and new flags
2023-04-24 14:43:29 +00:00
Marco André Dinis 3102b82770 Use stable/cloud when Automatic Upgrades is on. (#23395)
* Use `cloud/stable` when Automatic Upgrades is on.

Teleport provides scripts to install teleport agents/services.
Those scripts use YUM/DEB repositories when possible.
Each repo has multiple channels:
- stable/v11
- stable/v12
- cloud/stable

We want to ensure that if the cluster is running in the cloud and
automatic upgrades is on (auth service was started with
TELEPORT_AUTOMATIC_UPGRADES=yes teleport ...), then the installation
script must offer the `cloud/stable` channel.

This PR changes the following scripts:
- Discover Install Node
- Discover Install Database Service
- Install App script
- EC2 default-installer and EC2 default-agentless-installer

* add helm chart knobs to enable auto updater

* use let instead of const and remove default export

* add HA to helm chart

* always return .automatic_upgrades in web ping response

* rename cloud/stable to stable/cloud

* fix ts test
2023-03-28 16:05:09 +00:00
Edoardo Spadolini 701a0b05ed Remove the Houston enforcer (#23527)
* Remove the enforcer

* update e ref
2023-03-24 09:57:47 +00:00
rosstimothy 1c3188a38a Add a dedicated client to communicate with the Proxy SSH server (#22629)
A new `api/client/proxy/Client` has been added to interact with
the SSH and gRPC servers that the Proxy serves on its SSH port.
The client will first try connecting to the gRPC server and if
that fails it will fall back to the SSH server.

Much of the SSH functionality mimics the existing behavior of the
`ProxyClient` in `lib/client`. This is the first part of phasing
out that client in favor of the new client. There will be a follow
up PR that migrates `lib/client` to make use of the new client instead.

Part of #19812
2023-03-15 13:41:56 +00:00
rosstimothy c2fc9a9375 Add idle connection timeouts to http clients and servers (#22885)
Sets `http.Server.IdleTimeout` and `http.Client.IdleConnTimeout`
on clients and servers which didn't have them set. A default of
360s was chosen to be on par with the default of an NLB without
being identical.

This was added as another safety measure to prevent leaking any
idle connections indefinitely as seen in #22757.

`apidefaults.DefaultDialTimeout` was also renamed to
`apidefaults.DefaultIOTimeout` to better reflect its usage.
2023-03-10 16:47:06 +00:00
rosstimothy fa3bb9ac59 Ensure that the webclient closes connections (#22832)
The `http.Client.Transport` created in `newWebClient` wraps a
chain of `http.RoundTripper` over an underlying `http.Transport`.
Since we cannot guarantee that each `http.RoundTipper` has a
`CloseIdleConnections` method the usage of
`defer clt.CloseIdleConnections()` does not guarantee that the http
connections created during Find/Ping/etc are closed.

To prevent leaking connections implementations of `http.RoundTripper`
have added a `CloseIdleConnections` method added that forwards the
request on to the wrapped interface. The `otelhttp.Transport` does
not implement this method either so care has been taken to wrap it
in a `http.RoundTripper` which will call the root transport in
`enforceCloseIdleConnections`. An upstream issue has been filed
with otelhttp: https://github.com/open-telemetry/opentelemetry-go-contrib/issues/3543
to get the method added to their `Transport` implementation.

This wasn't noticed prior to upgrading to go1.20 becuase prior to
[this](https://github.com/golang/go/commit/4e7e7ae1406c70d9cc0809ec11105a55a60a0b70)
commit the `ReadHeaderTimeout` set on the Proxy web api http.Server
would cause the connection to appear idle and get terminated by the
server.

`TestWebClientClosesIdleConnections` was added to capture the leak
in connections as reported in #22757 and prevent any regressions.
2023-03-10 15:21:16 +00:00
MichaelandJeff Pihach d94fed7b0d Add static and dynamic web ui configuration options (#21945)
* Add UiConfig option to proxy service config

* Add uiConfig to GRV_CONFIG window object and use in terminal constructor

* Update configuration reference docs

* Remove extra structs and change property to scrollbackLines

* Update web/packages/teleport/src/config.ts

Co-authored-by: Jeff Pihach <hatched@users.noreply.github.com>

* Use a common struct and apply in applyProxyConfig

* Remove webclient dependency for fileconf

* Add missing doc comments

* Set individual properties of cfg.Proxy.UI

* Remove unneeded comment

* Add nolint rule

* Fix nolint

* Add test for UIConfig

* Cleanup tests

* Fix TestUIConfig context

* Allow dynamic config for web ui (#22097)

* Update protofiles

---------

Co-authored-by: Jeff Pihach <hatched@users.noreply.github.com>
2023-02-28 17:45:52 +00:00