Commit Graph
32 Commits
Author SHA1 Message Date
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
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
Alan Parra 57508a9e58 Address U2F sunset TODOs (#17030)
Address TODOs, add deprecation warnings and remove as many U2F code references
as possible.

Existing behavior is kept unaltered: it's still possible to inform Teleport of
old U2F AppIDs and U2F configurations are still silently converted to WebAuthn.
There's no reason to break that, so we don't.

Most server-side references to SecondFactorU2F are removed, but client-side
references remain: this makes it possible to interop newer clients with old
clusters (something else may break, but hopefully not this part).

Closes #10375.
2022-10-05 13:13:09 +00:00
Ryan Clark 806a568ada Introduce config v3, add auth_server and proxy_server, remove auth_addresses (#15761) 2022-09-28 15:30:15 +00:00
Tiago Silva 45c065acee Adds kube_cluster watcher for kubernetes service (#16281)
This PR presents a watcher for dynamic `kube_cluster` resources. The cluster credentials can be set using a `kubeconfig` whose payload is defined in `KubernertesClusterV3.Spec.Kubeconfig`. These credentials are used to connect to the Kubernetes API server and if invalid, the cluster is not served and returns an error.

Currently, `kube_cluster` resources created via the API with a kubeconfig payload can be dynamically served by the `kubernetes_service` by enabling dynamic resources.

```yaml
kubernetes_service:
   enabled: true

   resources:
       labels:
           '*': '*'
```

# Future work
- The discovery service will have to create these resources. 
- Support Azure and AWS dynamic authentication

Part of #16135, #13376  
Related to  #12048, #16276
2022-09-23 17:07:13 +00:00
951ee345eb Azure mysql postgres auto discovery configuration (#15629)
* Add Azure auto-discovery configuration fields

* Init databases if azure matchers are in config

* Use AzureMatchers in db service

* Use all azure subscriptions/resource groups if omitted in matcher

* Add azure config tests

* Update lib/services/matchers.go

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

* Update lib/config/fileconf.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/config/fileconf.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/services/matchers.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Remove superfluous cmp option for diffing azure matcher

* Rename AzureMatchers Tags to ResourceTags

* Deduplicate subscription/resource groups and add tests

* Remove azure matcher config fixup

Co-authored-by: Krzysztof Skrzętnicki <krzysztof.skrzetnicki@goteleport.com>
Co-authored-by: Marek Smoliński <marek@goteleport.com>
2022-08-19 19:31:38 +00:00
NajiObeid 787395395a Add config setting for proxy peering public addr (#14905)
* peer proxy public addr config

* address pr comments

* address pr comments

* address pr comments
2022-08-09 15:16:22 +00:00
Russell Jones fafb8016b1 Add support for session recording config override
The origin for the types.SessionRecordingConfig resource was always
being set to "config-file". Update parsing logic to only set
"config-file" if something is specified in file configuration, otherwise
use "defaults".

This will allow users to create a "session_recording_config" resource
that can update session recording configuration.
2022-07-19 11:10:52 -07:00
Gavin Frazar d1781d39be Do not override cfg.CAPins if ApplyCAPins is called with empty caPins… (#14122)
Do not override cfg.CAPins if ApplyCAPins is called with empty caPins slice
2022-07-12 01:19:18 +00:00
David Boslee 32695a2f05 Add proxy peering support (#12359)
This adds proxy peering support. A configurable setting that allows for agents 
to connect to a subset of proxies and be reachable through any proxy in the
cluster. This is achieved by creating grpc connections between each proxy
server. Client connections can then be passed between proxies to the desired
agent.
2022-06-02 17:08:24 +00:00
Gavin FrazarandAlan Parra df4991ea8c Optionally provide ca_pin as a file path (#12796)
* Optionally provide ca_pin as a file path

* Fix lint errors

* Test CA pin reads from file and from string

* Simplify ApplyCAPins

* Update lib/service/cfg.go

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

* Update lib/utils/utils_test.go

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

* Move length check into ApplyCAPins

* Rename token.go to config.go

* Add test for statictoken parsing

* Refactor token parsing test

* Error on empty ca_pin file

* Warn if config value is a path to an empty file

* Update lib/config/fileconf_test.go

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

* Log empty file warning instead of printing

* Allow multiple entries in files referenced by config values

* Update static token parsing test

* Test reading multiple tokens/pins from a file referenced by a config

* Update lib/config/fileconf.go

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

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2022-05-31 22:14:50 +00:00
Alan Parra 59fa9f0dae Drop validation and references to U2F Facets (#12892)
U2F facets don't serve a purpose since Webauthn became the de-facto MFA
mechanism. This should make it easier for users to write v10-style
authentication configs.

The remaining U2F fields are still relevant for when we derive Webauthn settings
from U2F, so those are kept (and validated).

Note that we still keep the fileconf field, since we don't want configs to
needlessly break during version upgrades.

#10375

* Remove references to U2F.Facets
* Remove Facets from U2F proto
* Reinstate proto Facets field

U2F gets marshaled as JSON to storage, so we better keep the field to
avoid issue with resource configs.

* Add deprecation notice on comment
* Update generated protos
2022-05-31 21:00:24 +00:00
Noah Stride 35083f730e Validate HSM pin & PKCS11 module file permissions (#12362) 2022-05-05 16:46:10 +00:00
Marek Smoliński f906831e58 Add ability to run Mongo proxy on separate listener (#9194) 2021-12-14 14:26:14 +01:00
Tim Ross d3789279ae use RoutingStrategy enum instead of boolean flag 2021-10-22 17:12:43 -07:00
Nic Klaassen 0bcff02fe0 support empty string ca_pin (#8154) 2021-09-08 12:24:44 -07:00
Nic Klaassen da951723f6 Add file configuration for HSMs (#7959) 2021-08-18 21:58:05 -07:00
jane quin dffc9767e8 Allow setting diagnostics address via config file (#6865) 2021-06-30 10:14:21 -07:00
Andrew Lytvynov d4247cb150 hsm: migrate CA storage schema (#7245)
* hsm: migrate CA storage schema

Migrate types.CertAuthorityV2 schema according to
https://github.com/gravitational/teleport/blob/master/rfd/0025-hsm.md#backend-storage

Includes proto changes, types.CertAuthority wrapper changes and data
migration.

Note that we keep and update the old fields for backwards-compatibility.
If a cluster is upgraded to v7 and then downgraded back to v6,
everything should keep working.

* Address review feedback
2021-06-16 12:17:03 -05:00
Roman Tkachenko d67e11ff2d Adding postgres_public_addr and mysql_public_addr (#6426) 2021-04-21 19:52:52 -07:00
Andrew Lytvynov 8492f62d43 u2f: add optional attestation cert validation (#6057)
By specifying `device_attestation_cas` in `teleport.yaml`, admins can
restrict U2F device manufacturers. For example, specifying the yubico
attestation CA
(https://developers.yubico.com/U2F/yubico-u2f-ca-certs.txt), you can
restrict users to only yubikeys.

Example error when using the yubico CA and trying to register a Google
Titan key:

```
$ tsh mfa add --type u2f --name test && tsh mfa rm test
Tap any *registered* security key
Tap your *new* security key
ERROR: rpc error: code = InvalidArgument desc = U2F device attestation certificate is signed by "CN=Security Key,O=Google", but this cluster only accepts certificates from ["CN=Yubico U2F Root CA Serial 457200631"]; make sure you're using a U2F device from a trusted manufacturer
```
2021-03-23 15:14:31 -07:00
Russell Jones 904b0d0488 Added Application Access.
Added support for an identity aware, RBAC enforcing, mutually
authenticated, web application proxy to Teleport.

* Updated services.Server to support an application servers.
* Updated services.WebSession to support application sessions.
* Added CRUD RPCs for "AppServers".
* Added CRUD RPCs for "AppSessions".
* Added RBAC support using labels for applications.
* Added JWT signer as a services.CertAuthority type.
* Added support for signing and verifying JWT tokens.
* Refactored dynamic label and heartbeat code into standalone packages.
* Added application support to web proxies and new "app_service" to
  proxy mutually authenticated connections from proxy to an internal
  application.
2020-11-03 14:32:13 -08:00
Gus Luxton fceb91f9d9 Rename references 2020-06-25 10:38:49 -03:00
Alexander Klizhentas 32b84e6765 Read join tokens from file, fixes #2515. (#2864) 2019-07-17 12:51:18 -07:00
Russell Jones 09241c635e Added support for FedRAMP/FIPS 140-2.
Added "--fips" flag to "teleport start" command which can start
Enterprise in FedRAMP/FIPS 140-2 mode.

In FIPS mode, Teleport configures the TLS and SSH servers with FIPS
compliant cryptographic algorithms. In FIPS mode, if non-compliant
algorithms are chosen, Teleport will fail to start. In addition,
Teleport checks if the binary was compiled against an approved
cryptographic module (BoringCrypto) and fails to start if it was not.
If a client, like tsh, tries to use non-FIPS encryption, like NaCl,
those requests are also rejected.
2019-05-07 12:51:02 -07:00
Russell Jones 6d1c16f745 Added support for nodes dialing back to cluster.
Updated services.ReverseTunnel to support type (proxy or node). For
proxy types, which represent trusted cluster connections, when a
services.ReverseTunnel is created, it's created on the remote side with
name /reverseTunnels/example.com. For node types, services.ReverseTunnel
is created on the main side as /reverseTunnels/{nodeUUID}.clusterName.

Updated services.TunnelConn to support type (proxy or node). For proxy
types, which represent trusted cluster connections, tunnel connections
are created on the main side under
/tunnelConnections/remote.example.com/{proxyUUID}-remote.example.com.
For nodes, tunnel connections are created on the main side under
/tunnelConnections/example.com/{proxyUUID}-example.com. This allows
searching for tunnel connections by cluster then allows easily creating
a set of proxies that are missing matching services.TunnelConn.

The reverse tunnel server has been updated to handle heartbeats from
proxies as well as nodes. Proxy heartbeat behavior has not changed.
Heartbeats from nodes now add remote connections to the matching local
site. In addition, the reverse tunnel server now proxies connection to
the Auth Server for requests that are already authenticated (a second
authentication to the Auth Server is required).

For registration, nodes try and connect to the Auth Server to fetch host
credentials. Upon failure, nodes now try and fallback to fetching host
credentials from the web proxy.

To establish a connection to an Auth Server, nodes first try and connect
directly, and if the connection fails, fallback to obtaining a
connection to the Auth Server through the reverse tunnel. If a
connection is established directly, node startup behavior has not
changed. If a node establishes a connection through the reverse tunnel,
it creates an AgentPool that attempts to dial back to the cluster and
establish a reverse tunnel.

When nodes heartbeat, they also heartbeat if they are connected directly
to the cluster or through a reverse tunnel. For nodes that are connected
through a reverse tunnel, the proxy subsystem now directs the reverse
tunnel server to establish a connection through the reverse tunnel
instead of directly.

When sending discovery requests, the domain field has been replaced with
tunnelID. The tunnelID field is either the cluster name (same as before)
for proxies, or {nodeUUID}.example.com for nodes.
2019-04-26 15:41:45 -07:00
Russell Jones 9886411293 Don't read configuration section if it's not enabled. 2018-08-31 17:01:01 -07:00
Sasha Klizhentas 95dcc8bbe7 Introduce disconnect client logic.
This commit implements #1935, fixes #2038

Auth server now supports global
defaults for timeout behavior:

```
auth_service:
  client_idle_timeout:  15m
  disconnect_expired_cert: no
```

New role options were introduced:

```
kind: role
version: v3
metadata:
  name: intern
  spec:
    options:
    # these two settings override the global ones:
    client_idle_timeout:  1m
    disconnect_expired_cert: yes
```
2018-07-12 19:00:13 -07:00
Sasha Klizhentas a4c86e0603 Add public_addr support for auth and ssh services.
This commit fixes #1803, fixes #1889

* Adds support for public_addr for Proxy and Auth
* Parameter advertise_ip now supports host:port format
* Fixes incorrect output for tctl get proxies
* Fixes duplicate output of some error messages.
2018-05-02 18:04:05 -07:00
Roman Tkachenko 143b834e57 Changes for the upcoming teleport pro:
* Allow external audit log plugins
* Add support for auth API server plugins
* Add license file path configuration parameter (not used in open-source)
* Extend audit log with user login events
2017-11-21 17:35:58 -08:00
Sasha Klizhentas 3c2570fa35 Sasha High Availability. 2017-04-07 16:54:15 -07:00
Russell Jones 1dcd3e11e5 Refactored authentication configuration, created resources for dynamic configuration of authentication configuration, and updated documentation. 2017-02-22 11:48:06 -08:00