Commit graph

5508 commits

Author SHA1 Message Date
Sasha Klizhentas c623aa4dc5 Add cluster labels
Fixes #3604

This commit adds support for cluster_labels
role parameter limiting access to remote clusters by label.
New tctl update rc provides interface to set labels on remote clusters.

Consider two clusers, `one` - root and `remote` - leaf.

```bash
$ tsh clusters
Cluster Name Status
------------ ------
one          online
two          online
```

Create the trusted cluster join token with labels:

```bash
$ tctl tokens add --type=trusted_cluster --labels=env=prod
```

Every cluster joined using this token will inherit env:prod labels.

Alternatively, update remote cluster labels by modifying
`rc` command. Letting remote clusters to propagate their labels
creates a problem of rogue clusters updating their labels to bad values.

Instead, administrator of root cluster control the labels
using remote clusters API without fear of override:

```bash
$ tctl get rc

kind: remote_cluster
metadata:
  name: two
status:
  connection: online
  last_heartbeat: "2020-09-14T03:13:59.35518164Z"
version: v3
```

```bash
$ tctl update rc/two --set-labels=env=prod

cluster two has been updated
```

```bash
$ tctl get rc
kind: remote_cluster
metadata:
  labels:
    env: prod
  name: two
status:
  connection: online
  last_heartbeat: "2020-09-14T03:13:59.35518164Z"
```

Update the role to deny access to prod env:

```yaml
kind: role
metadata:
  name: dev
spec:
  allow:
    logins: [root]
    node_labels:
      '*': '*'

    # Cluster labels control what clusters user can connect to. The wildcard ('*') means
    # any cluster. If no role in the role set is using labels and cluster is not labeled,
    # the cluster labels check is not applied. Otherwise, cluster labels are always enforced.
    # This makes the feature backwards-compatible.
    cluster_labels:
      'env': 'staging'
  deny:
    # cluster labels control what clusters user can connect to. The wildcard ('*') means
    # any cluster. By default none is set in deny rules to preserve backwards compatibility
    cluster_labels:
      'env': 'prod'
```

```bash
$ tctl create -f dev.yaml
```

Cluster two is now invisible to user with `dev` role.

```bash
$ tsh clusters
Cluster Name Status
------------ ------
one          online
```
2020-11-03 16:10:15 -08: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
Russell Jones a175e21c97 Vendored gopkg.in/square/go-jose.v2/jwt. 2020-11-03 14:32:13 -08:00
Brian Joerger 9379b676f1
Add new helper function for parsing multiple addresses at once. (#4675) 2020-11-03 13:50:22 -08:00
Ben Arent 51f3076973
[examples] Fixing extra s/admins/admin (#4683) 2020-11-03 08:34:38 -08:00
Ben Arent bbde69da0c
Update Release Table with latest versions (#4684)
* Update release table

* Other versions are EOL
2020-11-02 19:08:12 -08:00
Gus Luxton 77fca3e736
Update Docker docs for 4.4 (#4679) 2020-11-02 16:48:22 -04:00
Gus Luxton abe2b607d5
Add support for RPM signing via Drone (#4634) 2020-10-31 15:27:00 -03:00
Gus Luxton 3905726d8f
Added 4.4.2 to CHANGELOG (#4668) 2020-10-30 21:43:13 -03:00
Steven Martin e02db47025
[docs] Update Ubuntu versions in enhanced sessions docs (#4628) 2020-10-30 16:22:34 -07:00
Gus Luxton 95c7def152
Restore tunnel_public_addr to docs (#4671) 2020-10-30 18:48:30 -03:00
Andrew Lytvynov 5ec194cd0d
Implement kubernetes_service registration and startup (#4611)
* Implement kubernetes_service registration and sratup

The new service now starts, registers (locally or via a join token) and
heartbeats its presence to the auth server.

This service can handle k8s requests (like a proxy) but not to remote
teleport clusters. Proxies will be responsible for routing those.
The client (tsh) will not yet go to this service, until proxy routing is
implemented. I manually tweaked server addres in kubeconfig to test it.

You can also run `tctl get kube_service` to list all registered
instances. The self-reported info is currently limited - only listening
address is set.

* Address review feedback
2020-10-30 17:19:53 +00:00
Gus Luxton e32db1d2f8
Update Teleport image and dumb-init path in Docker quickstart (#4655) 2020-10-29 18:02:48 -03:00
Ben Arent 77d6173079
[docs] Proxy & Auth tweaks for running Teleport at scale. (#4659) 2020-10-29 06:57:12 -07:00
Gus Luxton 9c0d2bd210
Add arm64 builds (#4639) 2020-10-28 23:23:52 -03:00
Gus Luxton 53cfda2fe0
Use tmpfs instead of disk storage (#4647) 2020-10-28 19:26:32 -03:00
Andrew Lytvynov fd2959260e
Add kube_listen_addr to proxy_service (#4616)
This is a shorthand for the larger kubernetes section:
```
proxy_service:
  kube_listen_addr: "0.0.0.0:3026"
```
if equivalent to:
```
proxy_service:
  kubernetes:
    enabled: yes
    listen_addr: "0.0.0.0:3026"
```

This shorthand is meant to be used with the new `kubernetes_service`:
https://github.com/gravitational/teleport/pull/4455
It reduces confusion when both `proxy_service` and `kubernetes_service`
are configured in the same process.
2020-10-28 21:52:08 +00:00
Andrew Lytvynov 025143d856
RFD 5: Kubernetes Service (#4455) 2020-10-28 17:55:46 +00:00
Russell Jones 3ffdbe55da Updated CODEOWNERS.
Added @r0mant and @a-palchikov.
2020-10-28 10:20:27 -07:00
Brian Joerger a0bbabc16b
Read token from storage when it's not found in the cache. (#4648) 2020-10-28 09:51:33 -07:00
thetuber 1bb640e812
Typos in User Manual regarding description for Linux download link and support for single SSH jumphost. (#4637) 2020-10-24 15:33:55 -03:00
Andrew Lytvynov f56014f95f
Make k8s permissions test optional (#4618)
* Make k8s permissions test optional

There are several legitimate cases where it can fail:
- root proxy running inside k8s but without access to local k8s cluster
- root proxy running with a dummy kubeconfig that we recommended in the
  past

Leave a ForwarderConfig flag to enforce this check, it will be useful in
kubernetes_service later that should always have the right permissions.
2020-10-23 18:30:48 +00:00
Gus Luxton aaa2451908
[auto] Update AMI IDs for 4.4.1 (#4625) 2020-10-23 15:09:03 -03:00
Gus Luxton c949adfec4
Add auto PR logic (#4624) 2020-10-23 14:32:48 -03:00
Gus Luxton 2504d765c9
Add post-release checklist (#4620) 2020-10-22 16:45:38 -03:00
Ben Arent a9e9a2ca62
Update to 4.4.1 (#4615)
Co-authored-by: Gus Luxton <gus@gravitational.com>
2020-10-22 07:09:37 -07:00
Gus Luxton 712421b6df
Bump up Teleport version for cron-built Docker images (#4602) 2020-10-22 00:17:54 -03:00
Andrew Lytvynov bd974ef09a
golint: final batch of fixes (#4589)
And enable `golint` during `make lint`.
2020-10-22 00:13:09 +00:00
Sasha Klizhentas ac2fb2f9b4 Fixes configuration with multiple event backends
This commit fixes #4598

Config with multiple event backends was crashing on 4.4:

```yaml
  storage:
    audit_events_uri: ['dynamodb://streaming', 'stdout://', 'dynamodb://streaming2']
```
2020-10-21 15:23:56 -07:00
Sasha Klizhentas 7b8bfe4f60 Backoff on network errors and mark corrupted records.
Uploader retries slower on network errors and picks the pace
after any upload has succeeded.

Records that were corrupted, will never get uploaded.

The uploader will create streams indefinitely, clogging the auth server
with streams. Now uploader writes marker for bad session uploads
and does not attempt to reupload.
2020-10-21 14:33:04 -07:00
Gus Luxton 74652bcb67
Update CHANGELOG (#4614) 2020-10-21 18:20:14 -03:00
Gus Luxton b0800af9fa
Fix syntax and indentation in PAM docs (#4596)
Co-authored-by: Ben Arent <ben@gravitational.com>
2020-10-21 17:01:35 -03:00
Gus Luxton fdf9d9ca10
Fix multiplexing config directive in FAQ (#4585)
Co-authored-by: Ben Arent <ben@gravitational.com>
2020-10-21 16:24:55 -03:00
Gus Luxton fe36035819
Update examples to 4.4 (#4608) 2020-10-21 16:00:17 -03:00
Gus Luxton 3fd915fdae
Add clarification on *-sync modes to changelog (#4604) 2020-10-21 15:48:04 -03:00
Ben Arent 7ba704c3a6 Update changelog *-syn 2020-10-20 10:01:38 -07:00
Russell Jones 97469f1d22 Updated CHANGELOG.md. 2020-10-19 18:01:05 -07:00
Gus Luxton 57067a5a16
Install ca-certificates from package rather than copying manually (#4576) 2020-10-19 16:38:46 -03:00
Gus Luxton b8a898a7f6
Stop test execution early for changes to docs only (#4560) 2020-10-19 16:25:52 -03:00
Andrew Lytvynov f6eb0654c8
tctl: always format resources as lists in JSON/YAML (#4281)
This makes it more practical for parsing (e.g. with `jq`).

Also, refactor the formatting code because all JSON/YAML formatting is
the same.
2020-10-19 17:56:49 +00:00
Andrew Lytvynov 5cd212fecd
Add kubernetes_service to teleport.yaml (#4497)
* Fix local etcd test failures when etcd is not running

* Add kubernetes_service to teleport.yaml

This plumbs config fields only, they have no effect yet.

Also, remove `cluster_name` from `proxy_config.kubernetes`. This field
will only exist under `kubernetes_service` per
https://github.com/gravitational/teleport/pull/4455

* Handle IPv6 in kubernetes_service and rename label fields

* Disable k8s cluster name defaulting in user TLS certs

Need to implement service registration first.
2020-10-19 17:28:10 +00:00
Ben Arent 6e784c9413
[docs] Feature content for Teleport 4.4 (#4488)
Co-authored-by: Gus Luxton <gus@gravitational.com>
2020-10-19 08:28:36 -07:00
Russell Jones 7bcf63fbf0 Apply suggestions from code review
Co-authored-by: Gus Luxton <gus@gravitational.com>
2020-10-16 17:36:19 -07:00
Russell Jones d9c6119a14 Fixed PAM integration tests. 2020-10-16 17:36:19 -07:00
Andrew Lytvynov 483ea8b23d Add config option to gate pam_authenticate calls
Most users won't need this, so the behavior is optional. Default system
configs will usually trigger a password prompt, which is why this
feature is disabled by default.
2020-10-16 17:36:19 -07:00
jane (quin) c5de9aac5f
Export latency profile (#4516)
* option to export latency profile

* use print percentiles method

* add timestamp to file name

* add descriptions to flags

* Flush to make sure data is written to file

* path error catching

* fix trailing whitespaces

* seperate logic into separate functions

* return histogram err message

* move functionality into one function

* return path for onBenchmark to print

* close file if writer error
2020-10-16 15:35:36 -07:00
Andrew Lytvynov 566b7cc457 RFD 1: user testify/require instead of testify/assert
`require` is a sister package to `assert` that terminates the test on
failure. `assert` records the failure but lets the test proceed, which
is un-intuitive.

Also update all existing tests to match.
2020-10-16 00:15:25 +00:00
Andrew Lytvynov 2c6b48de39 Fix example code in RFD 1
All `assert.X` functions take `testing.T` as first argument.
Also, add example of `assert.ErrorAssertionFunc` in subtests.
2020-10-16 00:15:25 +00:00
Andrew Lytvynov 01516c5744 Partial revert of negative regexps in RBAC labels
This change was not backwards compatible - variable interpolation should
work in node_labels.

This commit partially reverts
https://github.com/gravitational/teleport/pull/4253 and
https://github.com/gravitational/teleport/pull/4430
2020-10-15 21:46:06 +00:00
Steven Martin 339bf0b74e
Modify script example to pull k8s config in docs (#4561)
* Update k8s script retrieval

Curl command retrieves the html version, not the script itself. modified to retrieve raw.

* Modify k8s script url to use raw
2020-10-15 15:15:54 -04:00