Commit Graph
24 Commits
Author SHA1 Message Date
Zac Bergquist 2ae9d770fc Refactor tctl's dependencies (#22693)
* Move configuration from lib/service to lib/service/servicecfg

The new servicecfg package will hold only configuration for services.
This will allow other packages (like tctl and tsh) to depend on
servicecfg without pulling in all of lib/service (which has a number
of platform-specific details).

This is the first step towards being able to build tctl for Windows.

* Move PAM and BPF config into servicecfg

This breaks a compile-time dependency on BPF/PAM for tctl.
2023-03-09 17:48:36 +00:00
Michael Wilson 49c64aabcb Move the authorizer into its own package. (#22776)
* Move the authorizer into its own package.

The Authorizer and associated functions and constants have been moved into
their own package `authz`. This will allow us to more easily create separate
services for gRPC functionality so that we're not pushing as much into the
`lib/auth` package.

Though this PR is large, the only actual code change here is making
`ContextForLocalUser` exported and changing the `permissions_test.go` so that
it doesn't rely on the `lib/auth` package.

* Use context functions.

* Test and linting fixes.

* Add in a temporary alias file to ensure e still compiles.

* Use functions instead of var aliases for performance reasons.

* Adding in godocs, cleaning up tests.

* Fix tests.

* Add a few more aliases.
2023-03-09 02:21:10 +00:00
Russell Jones 7895fddc57 Added the ability to supply Access Request TTLs
Added the ability to specify two CLI flags for Access Requests:
"--request-ttl" and "--session-ttl".

Updated "CreateAccessRequest" to adhere to the following rules.

If an Access Request does not have a TTL set (expiration time
types.AccessRequest resource itself), a default of 1 hour is used. Next,
the request value is truncated by the lifetime of the certificate,
requested expiration, and then strictest session TTL on all roles
requested.

Similar logic is followed for the expiration time of the elevated
certificate that will be issued if the Access Request is approved. First
the requested value is truncated by the lifetime of the certificate,
requested expiration, and then strictest session TTL on all roles
requested.

The output of "tsh requests ls" and "tctl requests ls" has been updated
to display the TTL values.
2022-12-14 15:18:33 -08:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Jeff Pihach 4c2fe9ae09 fix help output for --access-request flag. (#15042) 2022-07-29 19:19:09 +00:00
Nic Klaassen 8bca6e20c6 Add resource IDs to tsh request ls (#13799) 2022-06-28 10:27:39 -07:00
Nic Klaassen 27a1f1c3d6 Prune roles for Resource Access Requests (#13323) 2022-06-10 16:50:55 +00:00
Nic Klaassen 4d76910b59 nicer ResourceID strings (#13093) 2022-06-03 01:33:11 +00:00
Noah Stride 18558b88e9 thread context.Context from tctl Run() to subcommands (#13029) 2022-06-01 12:49:59 +01:00
Jeff Pihach cceac2db71 Add hint message when removing access requests. (#11963)
* Add hint message when removing access requests.

* Add hint message if removing an access request that has already been approved.

* fixed typo.

* do not delete access requests unless it hasn't been approved or a force flag has been provided.

* Tweaked hint messaging.
2022-05-04 22:11:39 +00:00
Edoardo SpadoliniandAndrew Burke 879a3c124a Escape access request and access resolution reasons in tctl (#9381)
* Pass request and resolve reasons in tctl through %q like it's done in tsh

* Update tool/tctl/common/access_request_command.go

Co-authored-by: Andrew Burke <31974658+atburke@users.noreply.github.com>

Co-authored-by: Andrew Burke <31974658+atburke@users.noreply.github.com>
2021-12-16 16:16:46 +00: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 7bff7c41bd Remove API aliases (#6983) 2021-06-04 13:29:31 -07:00
Forrest Marshall 59d2379b94 custom approval conditions 2021-03-24 14:33:40 -07:00
Andrej Tokarčík 46aa81b1ce Fix CLI content spoofing through access request reason 2021-03-01 22:14:10 +01:00
Brian Joerger ce6e08c438 api dependency reduction - uuid (#5386)
Move uuid generation for access requests to /lib/services.
2021-02-01 11:12:49 -08:00
Forrest Marshall f5c62fcc20 add dynamic access oracle 2020-12-31 09:57:05 -08:00
Forrest Marshall af05ce3eeb extended dynamic access API
Various improvements related to extending the dynamic access
API, including:

- Support for users with no statically defined roles.

- Unify trait mapping logic (e.g. claims_to_roles) across
the connector types.

- Support for matcher syntax and claims_to_roles mappings when
configuring which roles a user is able to request.

- Allow tsh or the web UI to automatically generate wildcard
access requests when dictated by role configuration.

- Allow RBAC configuration to attach annotations to pending
access requests which can be consumed by plugins.

- Allow plugins to attach annotations to approvals/denials
which appear in the audit log, and may also be looked up
later to determine additional info about a resolution.

- Support prompts, request reasons, and approval/denial
reasons for access requests.
2020-11-05 12:18:26 -08: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
Forrest Marshall c0c1aa063d support access-request update delegators 2020-04-23 14:57:09 -07:00
Forrest Marshall 568e185996 Add support for access request resource to cache (#3213)
Cache was missing support for access requests, causing
watchers to hang indefinitely without receiving events
when cache was in use.
2019-12-19 14:14:22 -08:00
Forrest Marshall 088be329af implement delayed access-request cleanup 2019-12-06 15:56:04 -08:00
Forrest Marshall ec327b6e03 Implment access-request system (workflow API) 2019-12-02 14:05:51 -08:00