Commit Graph
23 Commits
Author SHA1 Message Date
STeve (Xin) Huang 3a0ab15f4a Support App access behind load balancer (#22565)
* Support App access behind load balancer

* revert unecessary change

* fix lint

* Fix UT

* minor refactor
2023-03-14 13:47:41 +00:00
Zac Bergquist c924be5c6d Refer to tsh apps subcommand (#21431)
The `tsh appps` family of commands is aliased to `tsh apps`, so both
invocations work correctly. The command itself is defined as `tsh apps`,
so this is what appears in the help message.

Update references to `tsh app` to recommend `tsh apps` instead so that
there isn't confusion when browsing `tsh help` and looking for a missing
`app` subcommand.

Fixes #21367
2023-02-10 21:40:55 +00:00
Gabriel CoradoandRafał Cieślak bc63dddd7b Verify if proxy can handle application requests when creating session (#20418)
* feat(app): ensure there are healthy app services when creating session

* Apply suggestions from code review

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

* chore: code review updates

* refactor(app): preflight connection before creating session

* chore(web): change error message

* reafactor(app): change redirect to launcher rule

* refactor(app): rename preflight connection to health check app server

* refactor(apiserver): rename preflight connection

* refactor(apiserver): rename preflight connection

* refactor(apiserver): remove health check property

* test(appaccess): adjust new http status codes returned

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2023-02-10 10:42:55 +00:00
Ryan ClarkandZac Bergquist f2fbe92dcb Change the application access authentication flow (#17592)
* Change the application access auth flow to use a CORS POST request

* Remove auth state cookie

* Close the response body in tests

* Change the CSP to allow cross origin requests to the application

* Change the cookies to lax mode

* Update lib/web/app/handler_test.go

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

* Fix the proxy URL in tests

* Update webassets ref

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-01-12 21:57:01 +00:00
Alan Parra ba1282df62 Improve UserMetadata audit logging (#20081)
Improve UserMetadata audit logging by using `tlsca.Identity.GetUserMetadata()`
more consistently in audit logs.

There are still a handful of logs that don't include the data above for lack of
context (in the general sense and in the Go context sense), but many more
entries now call back to identity in some way.

Related to gravitational/teleport.e#514.
2023-01-11 21:03:17 +00:00
Gavin Frazar 4330e43cc9 security: Prevent app access authz bypass 2022-12-28 09:24:02 -08:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Michael b4bfd0b719 moved redirect path param to RawQuery and added escaping (#15628)
* moved redirect path param to RawQuery and added escaping

* fixed test description
2022-08-29 11:23:21 -05:00
Roman Tkachenko 38b8bb4307 Add support for proxying TCP apps (#13455)
Add support for proxying tcp apps
2022-07-26 19:01:39 +00:00
Michael 4280f814ae pass and preserve a path parameter during the app authentication (#13832)
* pass and preserve a path parameter during the app access authentication process

* added missing semicolons

* more javascript formatting

* removed incorrect path redirect. replace URL with URL.Path

* added a test for HasName

* added another test for default path

* ensure path param is valid path

* build url without string concat
2022-06-30 19:49:46 -05:00
Krzysztof SkrzętnickiandPrzemko Robakowski 66a676eb73 Switch to forked httprouter and enable UseRawPath option (#11068)
* Use forked httprouter with RawPath fix: gravitational/httprouter

* Enable UseRawPath everywhere.

* Test: allow MFA devices with `/` in names to be deleted

Co-authored-by: Przemko Robakowski <przemko.robakowski@goteleport.com>
2022-04-19 07:16:54 +00:00
Gabriel Corado 86e92be253 feat: app server requests failover (#9288) 2022-01-13 18:24:33 +00:00
rosstimothy 5cd7c3c294 Split auth.AccessPoint into variant specific interfaces (#8471) 2021-11-04 09:42:14 -04:00
Brian Joerger 9b8b9d6d0c rollback - Upgrade api version. (#7751) 2021-07-30 15:34:19 -07:00
Brian Joerger c040aca4c1 Upgrade api version. (#7609) 2021-07-28 13:51:21 -07:00
Roman Tkachenko 6c34385e35 Fix ping endpoint when proxy has multiple public addrs (#7368) 2021-06-23 13:00:46 -07:00
Brian Joerger 7bff7c41bd Remove API aliases (#6983) 2021-06-04 13:29:31 -07:00
Roman Tkachenko a3837f6720 App access cli flow (#5918) 2021-03-22 09:18:53 -07:00
Andrej Tokarčík ee7693f41d Prevent AAP login CSRF with OAuth-style state tokens 2021-03-01 22:14:10 +01:00
Andrej Tokarčík ff18d38d7e Set cookies with '__Host-' prefix 2021-03-01 22:14:10 +01:00
Russell Jones f13040a433 Added integration tests for Application Access. 2020-11-12 18:01:45 -08:00
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