Commit Graph
53 Commits
Author SHA1 Message Date
Justinas Stankevičius c056efe974 Hosted plugins: add plugin management UI prerequisites (#22831)
* Add GetType() to Plugin

* Add Plugins feature flag to web

* Run prettier

* Update e_imports.go with slack plugin subpackage

Respective enterprise changes imports a new subpackage,
which pulls new dependencies.
2023-03-14 12:44:22 +00:00
Isaiah Becker-Mayer e2df4a31ba Fix incorrect login options for Windows Desktops (#22118)
* Removes desktop logins from the ACL and adds them to each Desktop resource
as returned to the frontend. This behavior parallels what's currently being
done with other similar resources such as Nodes, and fixes a bug where
users were able to see all the logins permitted by their roles on every
desktop "connect" dropdown, even if the role permitting that login didn't
apply to a given desktop.

* Extracts common logic out of GetWindowsDesktopLogins (now GetAllowedWindowsDesktopLogins), uses it to create a GetAllowedServerLogins as well, tests both of them together, removing EnumerateServerLogins

* reduce unnecessary looping by using maps

* fixes flakiness by sorting lists

* uses require.ElementsMatch rather than manually sorting lists

* consolidates duplicated logic

* Consolidates separate server and desktop logic into a single GetAllowedLoginsForResource

* fixes tests

* fixes import order and test
2023-02-24 21:06:38 +00:00
Matheus 6afd0dbd59 Add license and download verbs to user context ACL and default editor role (#19049) 2022-12-08 18:05:49 +00:00
Lisa Kim 296255f868 [Discover] Add ons for database flow (#19063)
* Add db access rule required for db discovery
  in editors role

For the webapi layer:
* Return db access with user context
* Add AWS RDS fields for creating db request
* Return hostname of each queried db server
2022-12-06 19:20:11 +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
Yassine Bounekhla 6d475e12b2 Add Access Request ID to response for UserContext (#15653) 2022-08-30 20:59:29 +00:00
Isaiah Becker-Mayer 6273856514 Remove directory_sharing build flag (#15789) 2022-08-25 15:15:45 +00:00
Lisa Kim f53f3e77d6 [Discover] Check if user has access to any registered resource (#15637)
* Add connection diagnostic access to UI user context
* Implement resource checker in the web api layer
* Remove setting NeedTotalCount flag for web api list resources
2022-08-24 16:33:03 +00:00
Tiago Silva 037daad083 Introduce dedicated server type for Kubernetes resources (#14389)
## What

First part of the Kubernetes [Discovery RFD](https://github.com/gravitational/teleport/pull/13376/) to introduce a Kubernetes server per cluster. 

This PR introduces a separate Kubernetes server that uses the already introduced `KubernetesClusterV3`. 

## Compatibility

In previous versions, Kubernetes Clusters were part of regular `ServerV2` resource and this refactoring deprecates the `ServerV2` usage but keeps them for compatibility with previous version.

Everything is backward compatible, so v10 kubernetes agents and trusted clusters can connect fine.

## Next steps

Once this is merged, a new PR will introduce dynamic registration for Kubernetes Clusters discovered through EKS Discovery.
2022-08-04 14:21:11 +00:00
Noah Stride 02b4f8575f Configure linter to catch British 🇬🇧 spellings 🇺🇸 🦅 📖 (#14363)
* configure golangci-lint misspell to check for anglicized spellings

* Americanize spellings

* fix aws constant value with british spelling 🇬🇧

* update api types with americanized spellings

* use american spellings .cloudbuild/scripts
2022-07-14 10:51:23 +00:00
Isaiah Becker-Mayer 2f83932597 Add directory sharing to the ACL (#14103) 2022-07-07 01:34:04 +00:00
MatheusandNic Klaassen 8ce4e6bfbf Add sshLogins to nodes endpoint on webapi (GET /nodes) (#13266)
* Add sshLogins to nodes endpoint on webapi

* Remove sshLogins from user context endpoint response

Co-authored-by: Nic Klaassen <nic@goteleport.com>
2022-06-14 12:56:16 +00:00
Isaiah Becker-Mayer ce4d6234ff Add ActiveSessions flag to ACL (#12962)
Adds ActiveSessions to the userContext/acl and changes Sessions to RecordedSessions for clarity's sake
2022-05-30 14:11:25 +00:00
Bernard Kim 079b38caf1 Enable desktop access in Web UI in Cloud clusters (#10969) 2022-03-08 21:43:36 +00:00
Isaiah Becker-Mayer eb71cae26c Adds a DesktopSessionRecording flag to the ACL (#10365)
* Adds a DesktopSessionRecording flag to the ACL to tell the frontend whether or not a user's desktop sessions are being recorded.

* Accounts for the fact that desktop recording may be disabled globally

* fixes linting error
2022-02-18 23:26:37 +00:00
Isaiah Becker-Mayer e8cd8fa040 adds cliipboard to userACL (#10207) 2022-02-08 14:24:16 +00:00
Alan Parra f16e9f5c53 Fix the UI to correctly determine if a user has access to a resource (#9473)
Introduce the GuessIfAccessIsPossible method, so callers may verify if a user
has access to a category of resources, instead of access to a specific resource.

Fixes a bug where the "Session Recordings" menu doesn't show for users with
where-based roles.
2021-12-21 21:54:31 +00:00
Justinas Stankevičius 9522415b61 Disable desktop access in Web UI in Cloud clusters (#8858) 2021-11-05 07:31:46 -07:00
Isaiah Becker-Mayer 0abd5734ed userACL (#8560)
Adds userACL fields and logic for desktops.
2021-10-20 08:06:00 -07:00
Brian Joerger 2c8342c9de Remove RoleConditions type alias from lib/services. (#8441) 2021-10-05 14:04:18 -07:00
Zac Bergquist e66a359bfd Unify RBAC checking functions (#8407)
Prior to this change, we have several variants of CheckAccessTo*
methods for each resource type that uses RBAC.

This change reduces duplication and the potential for RBAC to behave
differently for different resources by implementing a common
CheckAccess method that can check access to a variety of resources.

This implementation is also sometimes faster than the original
implementation, because it is careful to avoid checking unnecessary
matchers after a role has already denied access.

This includes a new resource for KubernetesClusterV3 and a conversion func.
Note: plumbing the KubernetesClusterV3 resource through existing protos
and deprecating the original resource is out of scope for this change.
2021-09-30 08:41:28 -06: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
Brian Joerger 4d36870ff0 Remove remaining API aliases (#7137) 2021-06-08 12:08:55 -07:00
Brian Joerger 7bff7c41bd Remove API aliases (#6983) 2021-06-04 13:29:31 -07:00
Lisa Kim 9c06ddc8ad Check cloud feature before setting billing access for web (#6537)
* Init web handler with auth server feature flags on proxy init
* Retrieve auth server features by calling Ping when connecting 
  to auth svc which contains the server feature flags in the response
2021-05-05 14:58:43 -07:00
Lisa Kim 991059869e Create GET db and kube list web handlers (#6672) 2021-05-05 12:52:46 -07:00
Lisa Kim d39600a666 Revert "[web] Check for cloud feature before setting billing access (#6465)" (#6500)
This reverts commit 16be5376f5.

Remove panic caused by nil modules when auth/proxy are run seperately.
2021-04-19 16:48:29 -07:00
Lisa Kim 16be5376f5 [web] Check for cloud feature before setting billing access (#6465) 2021-04-15 14:40:08 -07:00
Lisa Kim b0dba9bc00 Set suggested reviewers field to the UI user context struct (#5467) 2021-03-24 16:46:24 -07:00
Alexey Kontsevoy 472df28f2a Add "billing_information" RBAC resource (#5676)
* Expose GRPC client connection to plugins
* Replaces global plugin state with the PluginRegistry
2021-03-01 22:47:03 -05:00
Lisa Kim e5604b274c Add AccessRequest access to userACL (#4984)
* Add AccessRequest access to userACL
* Define requestable roles
* Update UI test plan to include access request
* Edit testplan and fix whitespace issue
* When renewing session, set expiry to the shortest time
2020-12-31 13:41:08 -05:00
Lisa Kim 727c1fae9b Get additional roles from approved access request when extending web session (#4619)
* Add strategyAccess field in user context
* Enable passing of requestID to renewSession handler and extendWebSession
2020-11-05 13:15:57 -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
Alexey KontsevoyandLisa Kim 1ab776a73b Allow managing local users and adding a server via web ui (#4498)
* Add token access to userACL (#4357)
* Add node access to userACL (#4445)

Co-authored-by: Lisa Kim <lisa@gravitational.com>
2020-10-14 21:22:50 -04:00
Andrew Lytvynov 92ed2db38a Fixing golint warnings, batch 1
Mostly cosmetic changes:
- making receiver names consistent
- renaming `foo.FooBar` to `foo.Bar` (using package name as prefix)
- removing redundant `else` branches
- changing `a += 1` to `a++`
2020-10-13 00:22:49 +00:00
Lisa Kim 31ae316b93 Set users ACL and refactor reset password token event (#4212)
* Set ACL for performing CRUD operations on other local users
* Refactor how events are emitted when creating resetting password
* Update createResetPasswordToken handler, struct (remove some fields), 
and endpoint (remove namespace)
2020-08-17 15:10:38 -07:00
Lisa Kim 0242fdd0e5 Set user permission for viewing audit logs for UserACL (#3941) 2020-06-30 14:42:42 -07:00
Andrew Lytvynov 0add471f16 gosimple: remove comparisons to boolean constants
`if x == true` or `if x == false` should be just `if x` or `if !x`.
2020-05-15 16:32:45 +00:00
3c670d5d58 Merge Teleport V4.3 UI branch to master (#3583)
* Add monorepo

* Add reset/passwd capability for local users (#3287)

* Add UserTokens to allow password resets

* Pass context down through ChangePasswordWithToken

* Rename UserToken to ResetPasswordToken

* Add auto formatting for proto files

* Add common Marshaller interfaces to reset password token

* Allow enterprise "tctl" reuse OSS user methods (#3344)

* Pass localAuthEnabled flag to UI (#3412)

* Added LocalAuthEnabled prop to WebConfigAuthSetting struct in webconfig.go
* Added LocalAuthEnabled state as part of webCfg in  apiserver.go

* update e-refs

* Fix a regression bug after merge

* Update tctl CLI output msgs (#3442)

* Use local user client when resolving user roles

* Update webapps ref

* Add and retrieve fields from Cluster struct (#3476)

* Set Teleport versions for node, auth, proxy init heartbeat
* Add and retrieve fields NodeCount, PublicURL, AuthVersion from Clusters
* Remove debug logging to avoid log pollution when getting public_addr of proxy
* Create helper func GuessProxyHost to get the public_addr of a proxy host
* Refactor newResetPasswordToken to use GuessProxyHost and remove publicUrl func

* Remove webapps submodule

* Add webassets submodule

* Replace webapps sub-module reference with webassets

* Update webassets path in Makefile

* Update webassets

1b11b26 Simplify and clean up Makefile (#62) https://github.com/gravitational/webapps/commit/1b11b26

* Retrieve cluster details for user context (#3515)

* Let GuessProxyHost also return proxy's version
* Unit test GuessProxyHostAndVersion & GetClusterDetails

* Update webassets

4dfef4e Fix build pipeline (#66) https://github.com/gravitational/webapps/commit/4dfef4e

* Update e-ref

* Update webassets

0647568 Fix OSS redirects https://github.com/gravitational/webapps/commit/0647568

* update e-ref

* Update webassets

e0f4189 Address security audit warnings Updates  "minimist" package which is used by 7y old "optimist". https://github.com/gravitational/webapps/commit/e0f4189

* Add new attr to Session struct (#3574)

* Add fields ServerHostname and ServerAddr
* Set these fields on newSession

* Ensure webassets submodule during build

* Update e-ref

* Ensure webassets before running unit-tests

* Update E-ref

Co-authored-by: Lisa Kim <lisa@gravitational.com>
Co-authored-by: Pierre Beaucamp <pierre@gravitational.com>
Co-authored-by: Jenkins <jenkins@gravitational.io>
2020-04-15 15:35:26 -04:00
Russell Jones 3d9c34f1f0 Don't pass and clone client *tls.Config, instead pass cipher suites and
create new *tls.Config. Add test coverage for this.
2018-08-21 17:09:57 -07:00
Russell Jones 617b35128c Made GetNodes identity aware to only return nodes which that user has
access to. In debug mode, made RBAC failures more verbose.
2018-08-20 16:10:35 -07:00
Alexey Kontsevoy 9829bb0442 (web) server version (#2137) 2018-08-04 10:03:55 -04:00
Alexey Kontsevoy 7d5150e0b4 (web) detect github user 2018-02-07 18:00:20 -05:00
Alexey Kontsevoy c6f42c49d9 adding password change API endpoint 2017-10-13 17:02:40 -04:00
Alexey Kontsevoy efadceae0e include license headers 2017-09-09 00:41:40 -04:00
Alexey Kontsevoy d058e38868 addressing PR 2017-09-05 22:31:33 -04:00
Alexey Kontsevoy 2a9047cfd3 addressing PR 2017-09-05 21:27:08 -04:00
Alexey Kontsevoy dd35f5c762 (web) css fixes and cleanup 2017-09-04 13:31:46 -04:00
Alexey Kontsevoy 4dad2d9336 (web) ACL 2017-09-01 19:36:54 -04:00