Commit Graph
437 Commits
Author SHA1 Message Date
Alan Parra bcf99aaedc Drop local_auth/second_factor warning (#22851)
Drop warning about second_factor configured in clusters with local_auth:false.
This is a valid configuration for clusters with session MFA, regardless if their
authn method.
2023-03-09 21:16:38 +00:00
Zac Bergquist 2ae9d770fc Refactor tctl's dependencies (#22693)
* Move configuration from lib/service to lib/service/servicecfg

The new servicecfg package will hold only configuration for services.
This will allow other packages (like tctl and tsh) to depend on
servicecfg without pulling in all of lib/service (which has a number
of platform-specific details).

This is the first step towards being able to build tctl for Windows.

* Move PAM and BPF config into servicecfg

This breaks a compile-time dependency on BPF/PAM for tctl.
2023-03-09 17:48:36 +00:00
Justinas Stankevičius bb4994e214 Add configuration options for hosted plugin runtime (#22320)
* Add Plugins feature flag

* Add config for plugins runtime

* Allow reading OAuth secrets from files

* Rename Plugins to HostedPlugins

Make it clear that this is separate from the upcoming
self-hosted, standalone plugins that will be part of the Teleport
binary.

* Only allow to read client credentials from files
2023-03-09 11:59:38 +00:00
Andrew Burke e28d969fdc Add Azure auto-joining (#21087)
This change adds the ability for Azure virtual machines to automatically
join a Teleport cluster.
2023-03-01 22:18:43 +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
Brian Joerger 1dcc997189 Add headless auth preference logic. (#22148) 2023-02-27 18:25:51 +00:00
Andrew Burke 4c4669f07f Remove Azure install params from node configure output (#22113)
This change fixes a bug where Azure join params would incorrectly appear in
the output of `teleport node configure`.
2023-02-22 23:18:13 +00:00
Tiago Silva 4bb0f3809c Remove deprecated warning when proxy starts (#21798)
This PR removes a deprecated warning when Teleport proxy starts.
If the cluster is running in multiplex mode the warning is not valid
because Kubernetes Proxy is enabled by default using ALPN proxy
listener.
2023-02-14 16:39:16 +00:00
Gavin Frazar 5c752c4df8 Fixup teleport db configure create (#20968)
* add missing flags
* fix config generation bugs
* always wrap generated strings value in quotes
* parse and check generated config
* update tests for db agent config gen
2023-02-11 00:54:07 +00:00
STeve (Xin) Huang 23481cd831 Update database config samples (#21480) 2023-02-09 14:20:26 +00:00
Michael Wilson a798ed091a Add in file configuration for the SAML IdP. (#21262)
* Add in file configuration for the SAML IdP.

The SAML IdP is now configurable via file configuration.

* Exclude IdP named variables from linter.
2023-02-08 19:07:37 +00:00
Andrew Burke 732594f191 Add Azure join method (#20019) 2023-02-08 17:21:11 +00:00
STeve (Xin) Huang 8c53757aac Require flag for dynamic resources matching "tsh db configure create" (#20966)
* Require a new flag for enabling dynamic resources matching for "tsh db configure create"

* rename flag to --dynamic-resources-labels

* make naming more consistent
2023-02-02 22:07:59 +00:00
Michael Wilson 7c4bba7414 Add IdP options to role and auth preferences. (#20999)
* Add IdP options to role and auth preferences.

Both role and auth preferences have IdP options added to them. At the auth
preferences level, if the SAML IdP option is set to false, the IdP will be
disabled globally. At the role level, it will control which roles allow
access to the IdP.

* Make SAML access by default.

* Fix tests.

* Fix config test.
2023-02-01 18:45:49 +00:00
Gavin Frazar 08e3f75925 Fix SQLServer discovery config generation (#20496)
* Add tests for untested discovery flags (SQLServer, ElastiCache, MemoryDB)
2023-01-25 16:53:18 +00:00
Alex McGrath 66985553db Add agentless installer in the teleport discovery service (#19648)
* Add agentless installer

* Resolve comments

* Resolve comments

* Use GetCertAuthorities locally

* Try to get IMDS hostname

* Try get imds hostname first

This seems to be how its implemented for non-agentless nodes

* Use FIPS cipher suites

* use the openssh ca, resolve comments

* write keys to /etc/teleport/agentless by default

* Resolve comment

* lints

* test fixes
2023-01-24 14:49:06 +00:00
Tiago Silva e7ff55ddc4 Validate AWS regions when configuring the AWSMatcher (#20278)
This PR validates if the provided list of regions belongs to any AWS partition. If the region list is invalid or empty, Teleport prints a helpful message and exits.

Fixes #20276
2023-01-17 16:20:24 +00:00
Isaiah Becker-Mayer cab45d7712 deletes unused parsing code for defunct trusted_clusters (#20109) 2023-01-14 00:28:30 +00:00
STeve (Xin) Huang 48fbd369ed Enable database fetchers for discovery service (#19739) 2023-01-13 14:03:06 +00:00
9ecfca3c73 Add non_ad_hosts to windows desktop service config (#19806)
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Isaiah Becker-Mayer <isaiah@goteleport.com>
2023-01-11 20:44:19 +00:00
Vitor Enes 3fd74ae3fd Periodically reload proxy certificates (#19996)
This commit adds a certificate reloader that periodically reloads proxy
certificates.

Implementation was intentionally kept as simple as possible:
- periodically go through all key pairs and try to load them again
- if any key pair fails to load, then no certificate is updated
- no retry mechanism
- `inotify` is not used

The interval between reloads is configurable by setting
`https_keypairs_reload_interval` to some duration. If not set, or if set
to `0`, then certificates are not reloaded periodically. Thus, this
feature is opt-in and the current behaviour is maintained.
2023-01-10 16:27:40 +00:00
Gavin Frazar ef43b4cef9 azure mysql and postgresql flex server discovery (#19759)
* Move GCP cloud clients into a separate interface
* Add azure mysql/postgresql flex server support
* Add teleport db configure create support for azure postgres/mysql flex servers
* discover both single and flexi server with 'mysql' and 'postgres' db types.
* go doc gcp interface
* Add is_flexi_server to database Azure config
2023-01-09 18:48:08 +00:00
Isaiah Becker-Mayer f30e5c970c Adds show_desktop_wallpaper flag, disables Windows wallpaper by default (#19541) 2023-01-06 17:26:15 +00:00
Jakub Nyckowski d68cb9377b Switch golang.org/x/crypto to gravitational fork (#19579)
* Switch golang.org/x/crypto to gravitational fork

* Update golden files

* Add comment to go.mod

* Update api module to use crypto fork.

* Move x/crypto to replaced section in dependabot.yml
2023-01-04 19:30:58 +00:00
Gavin Frazar 213d4be6e7 Remove unused yaml tags (#19802)
* Move ldap discovery config struct for parsing into fileconf
2023-01-04 18:24:30 +00:00
Gavin Frazar 5bb0ef15db add dynamodb database access (#18843)
* Add a new db engine
* Add tests for new engine
* Update tsh db subcommands
* Refactor error message and suggestions for unsupported tsh commands
* Add dynamodb to test plan
* Add AWS external ID to db config and update protos
2022-12-30 18:22:30 +00:00
Isaiah Becker-Mayer 9a06ca404c Windows Certificate SID Mapping (#19340) 2022-12-22 21:54:50 +00:00
Krzysztof Skrzętnicki 71b19fa61d Implement teleport app start --cloud=... flag. (#19331) 2022-12-22 11:02:19 +01:00
Alan Parra f28319a6b8 Add user-visible device trust settings (#19531)
Add device trust settings to teleport.yaml and cluster_auth_preference resource.

Example configuration (teleport.yaml):

```yaml
auth_service:
  authentication:
    device_trust:
      mode: "required"  # requires Teleport Enterprise
```

gravitational/teleport.e#514
2022-12-21 15:24:12 +00:00
Steven Martin e1ebc332f8 spell fixes (#19419) 2022-12-16 19:01:28 +00:00
Vitor Enes 0050eb7e4a Allow cluster_networking_config to have defaults origin (#19106)
This commit ensures that `cluster_networking_config` has the
`teleport.dev/origin: defaults` label when no related field is set in
the configuration file.
Before this commit, `cluster_networking_config` would always have the
`teleport.dev/origin: config-file`, even if no related field was set.
2022-12-13 13:17:52 +00:00
Krzysztof Skrzętnicki dd67a49ab5 Azure CLI access (#18675) 2022-12-12 19:34:53 +00:00
STeve (Xin) Huang 43529b2653 AWS Redshift Serverless auto-discovery (#18974) 2022-12-09 21:23:56 +00:00
Hugo Shaka 4f89756d8b Add --apply-on-starup flag (#19009) 2022-12-06 15:50:52 +00:00
STeve (Xin) Huang f2cf36a450 AWS Redshift Serverless engine support (#18651) 2022-12-01 15:36:48 +00:00
Zac Bergquist 166dc5a1be Clean up defaults (#18860)
- Make vars const where possible
- Move constants that are only used by the audit log into lib/events
- Remove unused vars
2022-11-30 15:50:29 +00:00
Zac Bergquist c903cfa1d2 Cache static desktop labels (#18807)
This resolves a long-standing TODO, and ensures that we don't run
the same set of regular expression matches every heartbeat loop.
2022-11-29 18:18:59 +00:00
Gabriel Corado fa15a7c4c4 Azure SQL Server auto discovery (#17745) 2022-11-28 15:02:49 +00:00
Jakub Nyckowski 506e0db534 Enable network BPF modules only when needed. (#18497) 2022-11-25 18:33:40 +00:00
STeve (Xin) Huang 72b5a2f81f Add extra database validations to CreateDatabase (#18776) 2022-11-25 16:12:53 +00:00
Steven Martin 00728c4f63 spell fixes (#18545) 2022-11-17 16:28:05 +00:00
Zac Bergquist da7680ad0b Use x/exp/slices instead of home grown utilities (#18524)
We were inconsistent throughout the codebase and would sometimes
use the slices package and other times use our own equivalents
in api/.

This removes our versions in favor of the golang.org/x package that
does the same, which has the added benefit of reducing the surface
area of the public API module.

Note: despite existing uses of the slices package, for some reason
it didn't show up in go.mod or go.sum. Fixed that too.
2022-11-17 15:25:46 +00:00
Tiago Silva e868d2e9e8 Adds GCP GKE auto-discovery (#17831)
This PR presents a watcher for automatic `kube_cluster` discovery for GCP GKE clusters. Given an identity with access to the GCP cloud, the auto-discovery service will scan the cloud and register all clusters available in Kubernetes Engine.

Once the discovery service creates a `kube_cluster` on the Auth Server, the Kubernetes Service will start serving it. The credentials used to access the cluster are short-lived and generated through Google OAuth2 associated with the GCP Service Account configured for the Kubernetes Service.

GCP's Service Account must have the following role def attached:

```yaml
description: 'GKE Auto-Discovery'
includedPermissions:
- container.clusters.impersonate
- container.clusters.get
- container.clusters.list
- container.pods.get
- container.selfSubjectAccessReviews.create
- container.selfSubjectRulesReviews.create
name: projects/{projectID}/roles/GKEKubernetesAutoDisc
stage: GA
title: GKEKubernetesAutoDisc
```

Part of #16135, #13376
Related to  #12048, #16276, #16281, #16633, #14991
2022-11-11 18:10:29 +00:00
Nic Klaassen bfbb71734d feat: add GCP KMS support for Teleport CA key material (#17933)
* feat: add GCP KMS support for Teleport CA key material

This commit implements support for GCP KMS as a backend for CA
operations in Teleport.

This is able to take advantage of much of the infrastucture that we have
already created for HSM support, and simply appears as a new backend for
the private key material.

The necessary configuration parameters include only the name of the KMS
keyring to use, and the protection level (which can be HSM or SOFTWARE).
These are configured in the teleport.yaml directly, in a new section
under the existing `ca_key_params` used for HSM configuration.

The GCP credentials are expected to be provided to the Teleport auth
server via the
[Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc).
This means that it "just works" if the auth server is running on a GCP
compute instance with the correct attached role, and you can run tests
locally by authenticating with `gcloud auth login`.

This does not support Teleport Cloud, as our current HSM support does
not, because the Auth server needs the configuration and the access to
the GCP account. That would be a larger effort probably requiring a new
Teleport service.
2022-11-11 00:03:49 +00:00
Andrew Burke d1ae4044e5 Automatically discover Azure Virtual Machines (#17850)
This PR allows Teleport to discover (but not yet enroll) Azure Virtual Machines.
2022-11-03 16:38:29 -07:00
Hugo Shaka 0d6adaa50a Standardize systemd LimitNOFILE (#17893)
Actual LimitNOFILE varies greatly between the systems as it depends on the
systemd version and the go version used to build Teleport. The goal of this
commit is to run Teleport in the same setup, regardless of the distro nor
Teleport version.

New systemd defaults are 1024:524288, and starting with go 1.19, go process can
increase their soft limit up to the hard limmit dynamically. Old systemd
versions don't suppoprt `soft:hard` notation and old go versions don't
automatically increase up to the hard limit. For this reasons, the most
compatible setting is to set softlimit=hardlimit=524288.
2022-10-31 16:56:02 +00:00
STeve (Xin) Huang 1b0a083b9d Database access AWS RDS Proxy support (#17005) 2022-10-31 15:21:31 +00:00
Noah Stride cc77b37b12 Support Config v2 in teleport configure (#17915)
* Support Config v2 in `teleport configure`

* Actually use v2 in test
2022-10-31 11:40:36 +00:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Nic Klaassen 847f13a8a9 refactor keystore config (#17907) 2022-10-28 11:30:49 -07:00