Commit Graph
21 Commits
Author SHA1 Message Date
Bartosz Leper ed93168ea5 Lower bcrypt cost when testing (#40254)
* Lower bcrypt cost when testing

* Review
2024-04-08 16:50:20 +00:00
Forrest 223a2a8b31 rework ListUsers API (#39626)
* add stream helpers

* rework list users api
2024-03-21 18:29:11 +00:00
rosstimothy 1aec5414f1 Replace constants from trace with equivalents defined in teleport (#39307)
* Remove logging from circuit breaker

The logging is never output, and if it was would be very verbose.
Instead of dropping the level down to trace the logger is removed
entirely.

* Add constants from trace library

The logging functionality in trace is being removed in an upcoming
release. To prepare the logging component keys are copied from trace
into teleport.

* Convert trace.ComponentFields to teleport.ComponentFields

* Replace trace.Component with teleport.ComponentKey

* Replace trace logging constants
2024-03-14 13:04:29 +00:00
Brian Joerger 6ac3732976 Remove quiet/silent flags from authz checks (#37832)
* Always log role check errors to Trace level.

* Remove all quiet/silent flags from role checks.
2024-02-12 21:17:02 +00:00
Brian Joerger faf97aad9e Refactor authz package helper methods - AuthorizeAdminAction (#37565)
* Add authz context helper methods for authorizing admin actions.

* Replace uses of old authz helper methods.

* Address comments.
2024-02-09 21:42:46 +00:00
Brian Joerger eba938662c Refactor authz package helper methods - AuthorizeWith* (#37564)
* Add authz context helper methods.

* Replace uses of old authz helper methods.

* Remove unused context parameter.

* Apply suggestion.

* Add non-variadic verb argument instead of empty verbs check.

* Resolve Alan's comments.

* Remove new usage of old helper.
2024-02-09 01:51:22 +00:00
Brian Joerger 7f5e233407 Allow reused MFA for specific admin action endpoints (#36830)
* Allow reused MFA for specific admin action endpoints.

* Add godoc.

* Fix IsMFARequire_AdminAction and add test.
2024-01-22 20:02:56 +00:00
Hugo Shaka 90d7973f43 fix uipdating and upserting users with broken certs or password/mfa (#36658) 2024-01-15 14:16:59 +00:00
Gabriel Corado e6f61abc9e Add client remote address to some audit events (#36354)
* feat: add client addr to administrative events

* test(auth): update assert
2024-01-10 13:22:08 +00:00
Brian Joerger e8339ae856 MFA for Admin Actions: users (#35386)
* Make user endpoints admin actions.

* Fix user tests.

* Fix update user in the webui.

* Add tctl admin action test suite.

* Minor test suite refactors.

* Resolve comments.

* Use localhost as RPID in test.
2023-12-14 21:39:32 +00:00
Trent Clarke e44b359a7e Grant Okta RW on locks (#35348)
In order for the Okta service to be able to lock out deleted users,
it needs the ability to create and manipulate locks. This PR grants
the builtin Okta Role the ability to do so, but also puts limits on
this ability.

 1. The Okta service may only create and manipulate locks with an
    `okta` origin label,
 2. The Okta service may only create and manipulate locks that
    target a User with an `okta` origin label, and nothing else,
 3. The Okta service may only delete locks with an Okta origin

This PR also
 * Implements `ResourceWithLabels` interface on `types.LockV2` in order
   to re-use the existing Okta restrictions,
 * Refactors the existing Okta restrictions to make them accessable for
   Lock CRUD, and
 * Adds tests for Lock CRUD
2023-12-12 04:20:26 +00:00
rosstimothy 7cdd591475 Improve UserMetadata used in User audit events (#35493)
Ensures that the metadata always contains the identity of the user
performing the action and stops falling back to the user that
last created the resource. Also adds a helper function to the
authz.Context to make getting the UserMetadata from the already
retrieved identity easier.
2023-12-08 16:12:04 +00:00
rosstimothy b8ad35c58b Properly identify user responsible for UpsertUser invocations (#35428)
Prior to this change the name of the user being updated was set
in the audit event and not the user performing the updated. This
modifies upsert user to use the same code as create and update to
populate the user metadata.
2023-12-06 20:40:51 +00:00
fheinecke b178b8b732 Updated Teleport codebase to AGPL3 license (#35259)
Signed-off-by: Fred Heinecke <fred.heinecke@goteleport.com>
2023-12-01 17:48:14 +00:00
Trent Clarke f5b548ee72 Grant the Okta service the right to write Users (#33630)
* Grant the Okta service the right to write Users

In preparation for the Okta service syncing user accounts, this patch grants the Okta
service the right to create/update/delete users, in addition to the existing read
permission.

* Restricts User RBAC operations on the built-in Okta role

* Address review comments

 - Consolidates update checking into a single function
 - Adds implementation for new user service

* remove unused code

* Refactor Okta access and tests

* Fix merge detritus

* Doc updates

* Hopefully last pass

* Linter appeasement

* Consilidated checks

* Update auth_with_roles_okta_rbac_test.go

docs
2023-11-15 01:25:43 +00:00
rosstimothy 8ab8f0de38 Implement ListUsers in the usersv1.Service (#34223)
The api client was also updated to prefer using ListUsers over
GetUsers.
2023-11-09 21:37:18 +00:00
rosstimothy 89728df07a Enable conditional updates for users (#34306)
https://github.com/gravitational/teleport/pull/34255 temporarily
reverted users to blind update since the operator didn't handle
revisions properly. Now that https://github.com/gravitational/teleport/pull/34265
has been merged to update the operator to support revisions, the
conditional updates for users can be restored.
2023-11-07 20:00:34 +00:00
rosstimothy 1023f9f6b2 Validate user and roles prior to creating (#34263)
Ensures that a user cannot be created with roles that do not exist.
2023-11-06 19:12:49 +00:00
rosstimothy 83bc454f24 Temporarily disable conditional updates for users (#34255)
The operator is not handling revisions which causes TestUsersUpdate
in users_controller_test.go to fail. Rolling back the user service
backend to use update until the operator is updated to unblock CI.
2023-11-06 18:16:31 +00:00
rosstimothy 632ba90530 Enable optimistic locking support for users (#34045)
Converts the auth client to use the new usersv1.Service instead
of the auth.ProtoService to manage users. Since the new service
leverages conditional updates this allows optimistic locking to
now be used. The legacy RPC service now calls into the new users
service to consolidate logic for all but the UpdateUser method,
which was left alone to prevent altering the semantics of update
for legacy clients. Additionally, the auth HTTP routes to get
users were removed since they don't look to be consumed and have
long been deprecated in favor of the gRPC API.
2023-11-03 14:54:26 +00:00
rosstimothy 8370b3afda Implement users service (#33315)
Adds an implementation of the teleport.users.v1.UsersService RPC
service. Logic was copied from lib/auth/auth.go and
lib/auth/auth_with_roles.go but not removed in favor of the new
service yet. Follow up work will consolidate the legacy code to
call into the new users service.
2023-10-28 00:06:30 +00:00