Commit Graph
61 Commits
Author SHA1 Message Date
Michael 265b58cb7e Apply new logos based on license (#41294) 2024-05-15 19:09:33 +00:00
Alex McGrath 65459e872e Remove support for disabling second factor authentication (#40956)
* dont allow disabling second factor

* update docs for 2fa change

* add environmental variable to work around disabled 2fa

* check if its cloud

* update todos

* add a test

* introduce insecure test mode

* fixes for tests
2024-05-10 11:57:34 +00:00
ddbd9eefed Replace isTeam with new flags (#39794)
* Add new flags to modules

* Add deprecated comments to isTeam

* Make support flag an enum

* Add a TODO instead of deprecating flag right away

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Add gogoproto.jsontag to new fields

* remove meaning from enum zero value

* Reuse proto.SupportType instead of suping

* Replace isTeam for new flags in web app

* Update proto file: rename enum 0 value to unspecified;fix json tag casing

* Reuse proto file instead of aliasing it

* undo removing method by accident

* Add MobileDeviceManagement field to web config struct

* Improve comments

* Fix tests

* Simplify lockedFeatures object

* Include JoinActiveSessions in the web config object

* Remove more instances of isTeam

* Apply suggestions from code review - improve comments

Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>

* Use consistent comments to remove isTeam

* Update godocs comments

* Revert removign `isTeam` from stories it still should

* Fix godoc typo

Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>
2024-04-30 11:54:17 +00:00
matheusandAlan Parra fad473a236 Add new flags to modules to replace isTeam (#39695)
* Add new flags to modules

* Add deprecated comments to isTeam

* Make support flag an enum

* Add a TODO instead of deprecating flag right away

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Add gogoproto.jsontag to new fields

* remove meaning from enum zero value

* Reuse proto.SupportType instead of suping

* Update proto file: rename enum 0 value to unspecified;fix json tag casing

* Reuse proto file instead of aliasing it

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2024-03-22 17:27:59 +00:00
Brian Joerger 328986789e Hardware key serial number attestation (#37728)
* Add support for hardware key serial number attestation through user
trait.

* Modify AttestHardwareKey interface to return full attestation data

* Add serial number to attestation data and verify it

* Add unit test.

* Address comments.

* Don't accept partial matches.

* Fix build and test errors.
2024-02-10 01:07:58 +00:00
Justinas Stankevičius 9bcde33d49 Add Teleport Policy feature (#37013)
* Add Teleport Policy feature flag

* Add Policy feature to License

* Make `Policy` field a structure

To accomodate potential future parameters
2024-01-24 17:03:42 +00:00
Lisa Kim 36b3deab6e Lift legacy check for Access List and Access Monitoring (#35702)
* Revert "Restrict IGS flag check to usage based plans only (#35431)"

This reverts commit 31e1715532.

* Update test

* Pass access request monthly limit to webconfig

* Fix typo
2023-12-21 01:45:16 +00:00
Grzegorz ZdunekandJakub Nyckowski 32e87b2779 Expose GetSuggestedAccessLists in AccessListClient (#35714)
* Expose `GetSuggestedAccessLists` in `AccessListClient`

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>

* Fix typo

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2023-12-18 15:33:23 +00:00
Lisa Kim b7b1e13eab Audit use of usageBased flag in backend (#35341)
* Audit use of usageBased flag in backend

* Remove IsTrialProduct from feature object

* Address cr
2023-12-06 23:02:47 +00:00
Lisa Kim 31e1715532 Restrict IGS flag check to usage based plans only (#35431)
* Restrict IGS flag check to usage based plans only

* Remove unused func
2023-12-06 17:40:07 +00:00
Lisa Kim ba2bdb9d66 Define access monitoring max range limit field (#35241)
* Define max report range limit fields

* Add feature limits to web ui config
2023-12-05 20:28:55 +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
Lisa Kim ee32982679 Add ProductType to features and add IGS checks with access request verify limit (#35075)
* Add product type to features and define feature limit helpers

* Add IGS check with access request monhtly verify

* Move limit getters to enterprise

* Simplify product type conversion

* Add clarifying comment
2023-11-30 22:04:48 +00:00
Lisa Kim 6ade117e9a Adds IGS related fields to feature, module, and license objects (#34868)
* Revert "Deprecate field AdvancedAccessWorkflows to AccessRequest.Enabled (#34792)"

This reverts commit 79d1a5d16e.

* Add IGS related fields to features and modules

* Boiler plate for enabling access monitoring through modules

* Add IGS related license fields

* Use access monitoring feature flag instead

* Fix test

* Add backwards comp without deprecating field

* Address CR

* Address CR
2023-11-27 18:22:49 +00:00
Lisa Kim 79d1a5d16e Deprecate field AdvancedAccessWorkflows to AccessRequest.Enabled (#34792)
* Deprecate AdvancedAccessWorkflows proto field

* Remove AdvancedAccessWorkflows feature module field

* Rename fields

* Rename fields for all plugins

* Test ping proto response

* Address CR
2023-11-21 18:59:02 +00:00
Jakub Nyckowski af817583ad Proxy TAG requests through Auth (#34642)
* Proxy TAG requests through Auth

* Integrate Access Graph feature and optimize services

This commit entails the integration of the Access Graph feature into the existing service configuration. This feature is manifested through an 'IsEnabled' method that checks the state of the access graph. Additionally, the auth service logic now includes a flag for enabling access graph. The services have been further optimized with adjustments geared towards improving performance and readability of the code.

* Move TAG enabled flag from proxy to user setting/auth context

* Swap a pointer to AccessGraph config with a value.

* Add 'TestNewAccessGraph' function to 'useracl_test.go' file.

The function 'TestNewAccessGraph' has been added to run tests checking the configuration of Access Graph. Furthermore, a small change is made for the 'KindAccessGraph' comment in 'constants.go' to provide more accurate information.

* Implement Access Graph feature across various files

The Access Graph feature has been incorporated in 'module.go', 'authservice.proto', 'auth.go', and 'plugin.go' files. A method 'EnableAccessGraph' is also introduced in 'module.go' to allow the usage of this feature. Descriptions of Access Graph have been adjusted across files to explicitly state the feature's enablement.

* Fix tests

* Remove unused access graph feature code

This commit removes all references and uses of the access graph feature from the codebase. It also updates corresponding tests to reflect this removal. It also adds EnableAccessGraph() method to testing module to fix test compilation.
2023-11-16 18:08:37 +00:00
Michael Wilson 590435c1e2 Allow user locks to affect access list membership. (#34354)
* Allow locks to deny access to access lists.

Access list membership will now be impacted by active user locks. If a user
is locked, they will not be considered a part of an access list. This, in turn
will be used for things like Okta assignments to ensure that Okta access can be
rescinded while a lock is active.

* Access list membership checker is its own struct now.

* Rebase and fix tests.
2023-11-15 15:24:07 +00:00
Marek Smoliński f3545eba3f Security Reports (#30853) 2023-10-16 10:11:54 +00:00
rosstimothy 84e1be110a Complete services.Users interface refactoring (#33233)
* Update e ref

* Complete services.Users interface refactoring

Removes temporary functions required to migrate the interface
without breaking e.

Closes #32949.
2023-10-10 19:56:42 +00:00
rosstimothy b60ea81d54 Update users interface (#32987)
services.UsersService now takes a context and returns the user
from write operations as shown in the diff below. The bulk of the
changes are from modifying code to account for the additional
parameter and/or return value. Functional changes to better make
use of the new API will come in follow up PRs.

```diff
// UserGetter is responsible for getting users
type UserGetter interface {
	// GetUser returns a user by name
-	GetUser(user string, withSecrets bool) (types.User, error)
+	GetUser(ctx context.Context, user string, withSecrets bool) (types.User, error)
}

// UsersService is responsible for basic user management
type UsersService interface {
	UserGetter
	// CreateUser creates user, only if the user entry does not exist
-	CreateUser(user types.User) error
+	CreateUser(ctx context.Context, user types.User) (types.User, error)
	// UpdateUser updates an existing user.
-	UpdateUser(ctx context.Context, user types.User) error
+	UpdateUser(ctx context.Context, user types.User) (types.User, error)
	// UpdateAndSwapUser reads an existing user, runs `fn` against it and writes
	// the result to storage. Return `false` from `fn` to avoid storage changes.
	// Roughly equivalent to [GetUser] followed by [CompareAndSwapUser].
	// Returns the storage user.
	UpdateAndSwapUser(ctx context.Context, user string, withSecrets bool, fn func(types.User) (changed bool, err error)) (types.User, error)
	// UpsertUser updates parameters about user
-	UpsertUser(user types.User) error
+	UpsertUser(ctx context.Context, user types.User) (types.User, error)
	// CompareAndSwapUser updates an existing user, but fails if the user does
	// not match an expected backend value.
	CompareAndSwapUser(ctx context.Context, new, existing types.User) error
	// DeleteUser deletes a user with all the keys from the backend
	DeleteUser(ctx context.Context, user string) error
	// GetUsers returns a list of users registered with the local auth server
-	GetUsers(withSecrets bool) ([]types.User, error)
+	GetUsers(ctx context.Context, withSecrets bool) ([]types.User, error)
	// DeleteAllUsers deletes all users
-	DeleteAllUsers() error
+	DeleteAllUsers(ctx context.Context) error
}
```

Depends on gravitational/teleport.e#2346
Implements step 3 of #32949
2023-10-10 14:07:46 +00:00
rosstimothyandEdoardo Spadolini 6874bc1844 Start migrating services.UserService to use context and return users (#32920)
* Start migrating services.Identity to use context and return users

Adds new variants of existing methods that are going to be updated
to support propagating context and return users from create, update
and upsert. This is an unfortunate step required because e utilizes
the interface for various functionality. In order to prevent breaking
builds, the temporary methods were added so that e can be converted
to them first, then oss can be updated to the new version of the
interface. Once that is done e will be converted and then the temp
methods will be removed.

* fix typos in comment

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* fix: don't set metadata on existing item in CAS

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* fix: gci

* fix: set resource id on update

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-10-09 17:11:39 +00:00
Jakub Nyckowski 21772c6c9c Add new methods to AccessResourcesGetter interface (#32805) 2023-10-02 16:08:59 +00:00
Jakub Nyckowski f9c419674c Generate access list allowed promotions on access request creation (#31768)
* Generate access list suggestions on access request creation

* Add test
Cleanup code

* Add comment

* Fix typo and refactor access suggestion in services library

Fixed a typo in a comment in `access_list.go`. Refactored `accessrequest/suggestion.go` for enhanced code structure. The old model had all methods related to access request in a single interface, `accessRequestAPIGetter`, which had been divided among multiple interfaces for better division of responsibilities. A new function `GetSuggestedAccessLists` was created to narrow down the single duty for each function. These changes ensure more convenient unit testing and better accountability.

* Improve access request suggestions logic

This commit improves the logic for generating access request suggestions. It includes the requester's roles and traits as well as those from the access list and provides suggestions only for resource-based requests. A new method was also introduced for initializing AccessRequestSuggestions to avoid nil error.

* Refactor access list suggestions to promotions

The concept of 'suggestions' was updated to 'promotions' in different files (auth.go, client.go, auth_service_test.go, auth_service.proto among others) to make it more intuitive and align with the business context. This implies changing the wording, the functions called and the variable names. The feature itself hasn't changed, just the way it is referred.

* This commit changes the method name "GenerateAccessListSuggestions" to "GenerateAccessRequestPromotions" in multiple files. The naming is changed to reflect the actual function of the method, which is generating promotions for given access requests, rather than generating list suggestions. All relevant mentions and usages of this method are updated to reflect the name change. Modification also includes adjustments to the comments and interfaces related to the updated function for better code clarity.

* Refactor "GenerateAccessListSuggestions" to "GenerateAccessRequestPromotions"

Renamed method "GenerateAccessListSuggestions" to "GenerateAccessRequestPromotions" across the codebase. This change reflects the actual functionality of the method, which is to generate promotions for access requests, not suggestions. This aligns the method name with its purpose, and offers better code readability. Comments related to this function were also updated to maintain consistency.

* Update method handling access requests promotions

Revised the method of handling failures when generating access requests promotions. Now, even if promotions fail to generate, the request will not fail entirely. Instead, the request can still be approved but without promotions. Also, changed the UpsertAccessRequestAllowedPromotions method to CreateAccessRequestAllowedPromotions to clearly indicate its purpose, while revising related test cases and comments.
2023-09-22 19:34:32 +00:00
Marco André Dinis 859898635f Use Amazon EICE to connect into EC2 instances (#30632)
* Use Amazon EICE to connect into EC2 instances

This PR adds a new method to SSH into EC2 instances.
It uses the Amazon EC2 Instance Connect Endpoint to do so.

You can read more about the capabilities/limitations of this feature
here
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-using-eice.html

From the Teleport point of view, this uses the AWS OIDC Integration to
call the AWS APIs.
This connection mode is similar to the Agentless mode, where Teleport
connects to the OpenSSH daemon on the target server.
Except, that with this mode there's no required set up on the target
machine (no CAs are being used).

An overview of the flow when the user tries to SSH into a node:
- an SSH Public Key is sent to the target EC2 Instance
- a connection is made to the EC2 Instance Connect Endpoint using
  websockets, which in turn pipes the connection to the Private IP of
  the EC2 Instance

* review pt1

* pass CA for tests

* add godocs to OpenTunnelEC2

* fetch proxy public address jit

* add docs and move key generation to native package

* remove tcp socket
2023-08-24 16:38:51 +00:00
Yassine Bounekhla 62e910c2c5 add custom theme and logos (#30823) 2023-08-23 18:17:11 +00:00
Justinas Stankevičius 96f3df96b1 Enable limited Access Requests feature for the Team plan (#29866)
* Add access request monthly limit to Features

* Add a method to retrieve usage of Access Requests

* Verify access request limit when creating

* Remove AccessRequestsFeature.Enabled

Feature is always enabled now, the flag serves no purpose

* Expose usage of access requests in auth server

* Reimplement access request usage using audit log

* Disallow unauthenticated access to resource usage

* Tidy proto structures

* Start enforcing access request limit in auth

* Run GCI

* Add a license header to usage_test.go

* Add missing godoc

* Restructure usage proto per PR comments

* Construct proto.AccessRequestUsage in getARMU

* Reduce log level when encountering an unexpected event

* Simplify return

* Add godoc to GetResourcesUsage in client

* Fix merge mess-ups

* Count all requests, no matter their review state

* Factor out GetAccessRequestMonthlyUsage

* Move out resource usage to its own service

* Validate the limit after dry run is done

Unbreak UI when the limit is up

* Fix imports

* Remove Limit

SearchEvents will default to defaults.EventsIterationLimit

* Rename the service proto

* Add godocs to the gRPC service

* Move resource usage to a dedicated package

* Define single GetUsage rpc for all resource types

* Additions for limited access requests UI rework

* Add a test for GetAccessRequestMonthlyUsage

* Address lint

* Run GCI

* Add licenses where missing

* Expect CTA_UNSPEICIFED rather than `undefined`

* Expect CTA_UNSPECIFIED instead of undefined
2023-08-16 17:20:34 +00:00
Yassine Bounekhla c9a8288920 add feature hiding license flag (#30083) 2023-08-15 20:56:33 +00:00
Alan Parra 9d7f553bf3 Add usage-based feature values for Device Trust (#28919)
* Add DeviceTrustFeature to Auth protos

* Update generated protos

* Add DeviceTrustFeature to modules.Features
2023-07-11 17:25:00 +00:00
Jakub Nyckowski ae8f2fa929 Assist - Configuration and usage (#25953)
* Assist - Configuration and usage

* Add network config test

* Add config test

* Run GCI

* Address review comments
2023-05-11 01:56:55 +00:00
matheus e5c0992809 Add SetFeatures method to modules (#24729)
* Add SetCloudFeatures method to modules

* Implement missing method on test module

* Small refactors to adress code review

* Lint fix
2023-05-04 15:04:47 +00:00
matheus 57690ee961 Add IsUsageBased to features and send it to web UI (#25465)
* Add IsUsageBased to features and send to web UI

* Update flag name

* Improve comment

* Add comments and improve field name

* Remove duplicated property
2023-05-04 14:57:48 +00:00
Marco André Dinis 3102b82770 Use stable/cloud when Automatic Upgrades is on. (#23395)
* Use `cloud/stable` when Automatic Upgrades is on.

Teleport provides scripts to install teleport agents/services.
Those scripts use YUM/DEB repositories when possible.
Each repo has multiple channels:
- stable/v11
- stable/v12
- cloud/stable

We want to ensure that if the cluster is running in the cloud and
automatic upgrades is on (auth service was started with
TELEPORT_AUTOMATIC_UPGRADES=yes teleport ...), then the installation
script must offer the `cloud/stable` channel.

This PR changes the following scripts:
- Discover Install Node
- Discover Install Database Service
- Install App script
- EC2 default-installer and EC2 default-agentless-installer

* add helm chart knobs to enable auto updater

* use let instead of const and remove default export

* add HA to helm chart

* always return .automatic_upgrades in web ping response

* rename cloud/stable to stable/cloud

* fix ts test
2023-03-28 16:05:09 +00:00
Justinas Stankevičius bb4994e214 Add configuration options for hosted plugin runtime (#22320)
* Add Plugins feature flag

* Add config for plugins runtime

* Allow reading OAuth secrets from files

* Rename Plugins to HostedPlugins

Make it clear that this is separate from the upcoming
self-hosted, standalone plugins that will be part of the Teleport
binary.

* Only allow to read client credentials from files
2023-03-09 11:59:38 +00:00
Matheus f48d7f3c4f Add recovery codes flag to modules and web config (#19046)
* Add recovery codes feature to modules and web config
* Add EnableRecoveryCodes to Modules interface
2022-12-06 18:07:33 +00:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Brian Joerger ce20b20753 PIV login enforcement (#15874)
Add private key policy enforcement.

  - Add private key policy cert extensions and enforcement.

  - Add private key policy settings and attestation logic.

  - Wire attestation request through login endpoints.

  - Store attestation data for reissue requests.

  - Add private key policy discovery and logic.

  - Relogin on hardware key policy errors.

  - Include integration with Teleport Connect.
2022-09-30 23:27:48 +00:00
Yassine Bounekhla 09633dd47f Remove license feature flags for Moderated Sessions, Resource Access Requests, Machine ID (#16585) 2022-09-30 21:46:25 +00:00
Tim Buckley 207332d170 Add Machine ID enterprise license enforcement (#13914)
* Add Machine ID enterprise license enforcement

This adds two checks to Machine ID for license enforcement: one on
initial bot create, and another on join.

* Use modules.SetTestModules(); fix failing test
2022-06-29 16:27:18 +00:00
Nic Klaassen 7f3944b2e5 Add MachineID and Resource Access Requests license features (#13392) 2022-06-15 17:58:50 -07:00
Joel 8b00efedaa Add Moderated Sessions licensing (#11388) 2022-03-28 18:38:56 +00:00
Isaiah Becker-Mayer bc11f2dfe6 Adds Desktops to license (#9576)
* Adds Desktops to license

* adds newline
2022-01-06 18:43:47 +00:00
Nic Klaassen 99cc8eb5ef Require enterprise license for HSM support (#8370) 2021-09-27 10:40:47 -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
Andrej Tokarčík a92dcc3df4 Introduce modules.ValidateResource for Cloud-specific validation (#7092) 2021-06-07 10:31:55 -07:00
Trent Clarke 4284fc3586 Forbids use of --insecure in FIPS mode (#6191)
Forbids the use of the `--insecure` mode when FIPS mode is enabled in teleport
Disables the `--insecure` tsh command line option when built with FIPS support

See-Also: #5073
2021-05-14 09:22:46 +10:00
Brian Joerger 5e9ea1c7e1 Add Features and PublicAddrs to PingResponse (#5742) 2021-03-10 18:15:40 -08:00
Sasha Klizhentas 013f9680c9 OSS RBAC
Implements RFD #7

https://github.com/gravitational/teleport/blob/master/rfd/0007-rbac-oss.md

OSS users can use roles. Some FedRamp related role options
are limited to enterprise.

All users are migrated to a new role "ossuser".

This role is a limited access role downgrading all users
from OSS role "admin".

All trusted clusters are mapped to "ossuser" as well.

Github connector maps teams to generated roles.

For transition period, format `tctl users add alice` works
alongside with `tctl users add alice --roles=admin`, but prints
a warning.
2021-02-17 17:04:03 -08:00
a-palchikov c7f494b3eb Test flakes: make tests reentrant (#5343)
* Make tests reentrant.
* Address review comments
* Bump e to release
2021-02-03 13:49:28 +01:00
Russell Jones bf0d76da84 Added support for admin user and token management.
Updated default admin rule in Enterprise to include KindUser: RW and
KindToken: RW permissions to allow admins to perform user and token
management.
2020-11-05 10:49:59 -08:00