Commit Graph
30 Commits
Author SHA1 Message Date
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
Tiago Silva 40861809a6 Add RoleV6 resource type (#19324)
This PR includes a new Role resource version that is compatible with V5 spec.

The new resource introduces the `kubernetes_resources` definition that allows operators to limit the Kubernetes resources that each member can access. The `kubernetes_resources` entries must follow the following format: `{"kind":"<kind>", "namespace":"<namespace>","name":"<pod>"}`. Currently, it only supports objects of `kind` `pod`. Valid examples `<namespace>/<name>:
- `*/*`: matches all pods in all namespaces.
- `default/*`: matches all pods in the `default` namespace.
- `*/nginx-*`: matches every pod prefixed with `nginx-` in every namespace.

For older resource versions - V5, V4, V3 - `kubernetes_resources` is automatically populated with `{"kind":"pod","namespace":"*","name":"*"}` to keep compatibility. For the newest version, it's mandatory to define its value otherwise access to pods will be denied.

Part of #18434
2023-01-05 09:58:12 +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
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +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
Russell Jones 22e81dcddb Refactored tests under web package
Refactored all tests under lib/web to use testify instead of gocheck.

Switched backend for most tests to memory.
2022-07-08 13:55:58 -07: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
Joel ea810d30d9 Implement Moderated Sessions (#8563)
* Implement Moderated Sessions
2022-02-15 17:02:10 +01:00
Isaiah Becker-Mayer e8cd8fa040 adds cliipboard to userACL (#10207) 2022-02-08 14:24:16 +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
Alan Parra dba49bfad6 Lint and fix missing license headers (#8075)
Introduce new make targets to check and add license headers to files
("make lint-license" and "make fix-license"). License checking is now a part of
"make lint" as well.

Initial attempts used goheader, but it caused "make lint-go" to become about 9x
slower (if not more), plus it only targets go files. Google's addlicense is fast
enough and targets however many file types we want.

Existing files that were missing licenses got the header added, using the
current year as the license date.

* Introduce lint-license and fix-license make targets
* Ignore generated files
* Add license to go files
* Replace irregular licenses with standard copyright/license
* Add license to proto files
* Install addlicense in build.assets Dockerfile
2021-08-30 09:44:09 -07: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
Nic Klaassen 109fa7443d Add V4 Roles (#7118) 2021-06-10 11:52:10 -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 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
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
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