Commit Graph
1493 Commits
Author SHA1 Message Date
STeve (Xin) Huang 5cabb533a5 TLS Routing native WebSocket connection upgrade support (#36343)
* TLS routing connection upgrade using native websocket

* update ut in api

* lib/web/UT update

* fix typo, lint and race

* deal with subprotocol negotiation

* review comments round 1

* fix lint?

* add UT and address some other comments

* add env var to toggle mode

* fix lint
2024-02-12 18:04:01 +00:00
Tiago Silva 2967ea4f13 Discovery: Add TAG sync object to Discovery config (#37908)
This PR adds the ability to configure TAG AWS poll in discovery config.

Part of https://github.com/gravitational/access-graph/issues/458

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2024-02-12 11:43:48 +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
Krzysztof Skrzętnicki 2a2213696f Make the helpers for old and new style resources return error if neither matches. (#37907)
This change makes it harder to accidently misuse these helpers, which would manifest as silent corruption of data as well as other issues.
2024-02-09 14:39:12 +00:00
Sakshyam Shah 0cc7731312 add preset field to SAMLIdPServiceProviderV1 spec (#37968)
* feat: add preset field to SAMLIdPServiceProviderSpecV1

* add samlsp package to define preset types, validate preset names"

* check empty string in validatePreset func

* run make fix-imports
2024-02-09 14:28:28 +00:00
Krzysztof Skrzętnicki 4f5d530b77 Add database object and database object import rule types (#37795)
* Add database object and database object import rule types.

* Address review feedback.

- Switch to multiple allowed values per label.
- Improve some error messages
- Avoid abbreviated where possible.

* Add context for resource types

* Update comment for sub_kind fields.

* Update test to accomodate new field name.

* Fix tests

* item => rule

* Extend proto docs
2024-02-09 14:21:14 +00:00
Krzysztof Skrzętnicki 93603ab009 Add db.session.permissions.update event (#37798)
* Add `db.session.permissions.update` event

* Update doc

* Fix event type
2024-02-09 09:14:58 +00:00
Krzysztof Skrzętnicki 28b3186193 Fix default expiry for timestamp-based RFD 153-style resources (#37909)
* Fix default expiry for timestamp-based RFD 153-style resources

* Clarify doc for GetExpiry
2024-02-09 07:56:20 +00:00
Brian Joerger b60e7a7a1f Hardware Key settings (#37727)
* Add hardware key settings to cluster auth preference.

* Parse HardwareKey auth settings from configuration file.

* Add GetRequireKnownSerialNumber method to AuthPrefence type.

* Add deprecation logic for authpref.PIVSlot, following the logic set out
in #16034.

* Address comments.
2024-02-08 20:59:00 +00:00
STeve (Xin) Huang e192ad386e Propagate user-agent from GRPC for cert.create events (#37726)
* Add user-agent to cert.create event

* fix tctl and minor stuff

* fix integration test
2024-02-08 20:39:43 +00:00
STeve (Xin) Huang 6684370580 Improve error message when auto-user provisioning fails on reader endpoints (#37557)
* Improve error message when auto-user provisioning fails on reader endpoints

* fix lint
2024-02-08 19:48:07 +00:00
Anton Miniailo cbcad5c459 Add kubeAppDiscovery bool parameters to the discovery config (#37755)
It controls whether to enable Kubernetes App discovery in the discovered Kuberentes clusters.
Currently only EKS in integration mode will be supported.
2024-02-08 05:04:35 +00:00
Yassine Bounekhla b4062acd65 Add protos for Notifications resources and CRUD RPCs (#37707)
* add protos for notifications and crud rpcs

* CR
2024-02-07 20:29:51 +00:00
Krzysztof SkrzętnickiandSTeve Huang bc1ba9c23c Add DatabasePermissions field to role (#37797)
* Add DatabasePermissions field to role.

* Change error wording in a minor way

* Update api/types/role.go

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>

* Update api/proto/teleport/legacy/types/types.proto

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>

* Update autogenerated files

* Guard against wildcards in `spec.allow.db_permissions`

---------

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>
2024-02-07 20:03:11 +00:00
Alan Parra 22b371f869 chore: Bump golangci-lint to v1.56.0 (#37854)
* chore: Bump golangci-lint to v1.56.0

* Use only enable linters for testifylint

* Fix various testifylint offenders

* Fix testifylint offenders in api/
2024-02-07 19:54:00 +00:00
Marco André Dinis 5c63683645 AWS OIDC Service: bootstrap and ListDatabases stub (#37335)
This PR adds a new gRPC Service to handle the AWS OIDC Integration
actions.

All the HTTP exposed actions will use this new service.
Eg, list databases, list ec2 instances, and so on

This PR adds the new service and a placeholder for the first action to
me refactored: ListDatabases.
This action is not used/implemented yet.
2024-02-05 18:18:11 +00:00
Alan Parra 57d3b43f6a Add the deprecated option GenerateUserSingleUseCerts (#37724)
* Deprecate the GenerateUserSingleUseCerts RPC

* Update generated protos
2024-02-02 19:18:44 +00:00
rosstimothy b7318b5c7e Enable errorlint via golangci-lint (#37669)
Adds the new linter and configures it to prevent direct error
comparisions and type assertions in favor of errors.Is and errors.As.
All current violations caught by the linter have been updated
accordingly.
2024-02-02 15:59:24 +00:00
Alan Parra f7dfb5ce81 fix: Do not wrap io.EOF intercepted by stream Sends (#37647)
* Verify that intercepted stream Sends wrap io.EOF

* fix: Do not wrap io.EOF intercepted by stream Sends

* Use a helper func, fix duplicate Send/Recv calls

* Fix typo
2024-02-01 18:05:06 +00:00
Noah Stride 8c824ddd3b Remove deprecated Bot API methods (#37636)
* Remove deprecated Bot API methods

* Fix tests using deprecated RPC

* Fix more tests for legacy
2024-02-01 16:15:54 +00:00
Alan Parra 0013681f22 chore: Remove deprecated MFA streaming methods (#37589)
* Remove deprecated MFA streaming methods

* Drop the newMFADeviceFields.totpSecret field

* Hollow out / remove proto messages

* Update generated protos

* Remove unused method

* Simplify createRegisterChallenge logic

* Remove client methods
2024-02-01 14:15:36 +00:00
Noah Stride 0844fdb3f4 Add UserName to BotJoin event (#37563)
* Update protos from cloud

* Include UserName in Bot join audit event
2024-02-01 11:28:06 +00:00
Alan Parra 5347e4e727 chore: Remove the deprecated GenerateUserSingleUseCerts method (#37601)
* Remove the deprecated GenerateUserSingleUseCerts method

* nit: Don't capture traces on guard errors

* Drop client methods

* Remove usages of SingleUseUserCert

* Hollow out / remove deprecated proto messages

* Update generated protos

* Remove unused method
2024-01-31 22:10:47 +00:00
Alan Parra 446505674b chore: Remove the AuthenticationSettings.DeviceTrustDisabled field (#37595) 2024-01-31 18:56:38 +00:00
matheusandBartosz Leper a9047217b9 Backend supporting changes for Bot creation flow (#37348)
* Add bot ui labels and github join token

* Use strings.HasPrefix instead of includes

* Add `ssh` to label

* Add bot join token endpoint

* Lint

* Fix comment typo

Co-authored-by: Bartosz Leper <bartosz.leper@goteleport.com>

* Fix comment typo

Co-authored-by: Bartosz Leper <bartosz.leper@goteleport.com>

* Improve webUIFlowLabelKey comment

---------

Co-authored-by: Bartosz Leper <bartosz.leper@goteleport.com>
2024-01-31 14:04:24 +00:00
Tiago Silva d71b48f9b5 Correct gRPC handler name StreamUnstructuredSessionEvents (#37580)
This PR fixes the name of the gRPC method
`StreamUnstructuredSessionEvents` from
`StreamUnstructuredSessionEventsServer` to the correct version. This
typo was introduced during the original review and was never detected
because clients implemented a fallback mechanism to old
`StreamSessionEvents` api.

This PR also partially reverts commit
386e63c584 so v15 clients can still
connect to v14 clusters.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2024-01-31 11:05:01 +00:00
Anton Miniailo e4aba94c3b Add event for discover resource EKS. (#36892) 2024-01-31 06:25:01 +00:00
Michael Wilson 14b95e25e4 Add in Okta access list sync audit event. (#37475)
The audit event for the Okta access list synchronizer has been added. This
will be used to then broadcast this information to prehog.
2024-01-30 20:42:24 +00:00
Brian Joerger 6a5a151809 Refactor admin MFA ceremony - don't create an MFA challenge the client can't solve (#37367)
* Refactor MFA ceremony logic to avoid creating challenges when the client has no way to solve it.

* Add client-side ErrMFANotSupported for better MFA ceremony error handling.
2024-01-29 18:38:25 +00:00
dependabot[bot] baff90a0fe Bump the go group in /api with 2 updates (#37395)
Bumps the go group in /api with 2 updates: [github.com/google/uuid](https://github.com/google/uuid) and [google.golang.org/grpc](https://github.com/grpc/grpc-go).


Updates `github.com/google/uuid` from 1.5.0 to 1.6.0
- [Release notes](https://github.com/google/uuid/releases)
- [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/uuid/compare/v1.5.0...v1.6.0)

Updates `google.golang.org/grpc` from 1.60.1 to 1.61.0
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.60.1...v1.61.0)

---
updated-dependencies:
- dependency-name: github.com/google/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-29 17:13:47 +00:00
Trent Clarke 0f0b00b021 Allow setting metadata via types.SAMLConnector interface (#37309) 2024-01-28 10:32:15 +00:00
Brian Joerger 89858233c1 Restore WebUI UpdateUser; add TODO. (#37375) 2024-01-27 00:12:59 +00:00
Sakshyam Shah 2fd0f85c1d SAML IdP Name ID format constants (#37135)
* SAML IdP Name ID formats

* update comment copy
2024-01-26 21:56:13 +00:00
Edoardo Spadolini b5512bf418 Unblock Read and Write when closing a grpc transport Conn (#37343) 2024-01-26 17:22:29 +00:00
Marco André Dinis 876362b0b1 AWSOIDC: Compute Proxy's Endpoint for issuing a token (#37253)
* AWSOIDC: Compute Proxy's Endpoint for issuing a token

Instead of receiving the issuer URL as param, use the internal state of
the proxies to fetch the public endpoint.

This deprecates the field so that old clients can still talk to the
AuthServer, but their Issuer param is ignored.

* Add single param for cached resources

* use cache for everything except keystore
2024-01-26 13:35:16 +00:00
Brian Joerger bca9688bb2 Fix hardware key sign err shadow bug. (#37285) 2024-01-25 21:48:33 +00:00
Zac Bergquist 4329c28960 Remove some dead code (#37269) 2024-01-25 19:42:43 +00:00
Michael Wilson 4bc2845ec6 Add group and app filters for the Okta access list sync. (#37178)
* Add group and app filters for the Okta access list sync.

Group and app filters for the Okta access list sync feature have been added
to the plugin settings and to the service settings.

* Correct group filters comment.

* Return offending filter on failure.

* Add in examples for filters.
2024-01-25 15:41:16 +00:00
Hugo Shaka ea73e0931c Fix AccessList proto 0 time mapping to epoch (#36810)
* add test for AL next audit date zero time

* fix AL next audit date time conversion

* lint
2024-01-25 15:05:15 +00:00
Brian Joerger 9b733e8b8e Make tctl bots add prompt for MFA just once (#37121)
* Reuse MFA for tctl bots add.

* Fix MFA required check for admin role.

* Remove broken auth preference check; Fix IsMFARequiredCheck for built in Admin role.

* Check for nil MFA response in MFA retry logic.

* Refactor MFA ceremony to return a custom error when MFA is not required.

* Fix TestAdminActionMFA unit tests.

* Fix unit test.
2024-01-24 21:28:52 +00:00
Brian Joerger 8d933d066a Update Admin Action MFA enforcment (#37136)
* Only enforce admin MFA when webauthn is required.

* Add TELEPORT_UNSTABLE_DISABLE_MFA_ADMIN_ACTIONS env flag for an emergency escape hatch.

* Fix TestAdminActionMFA unit tests.
2024-01-24 20:06:52 +00:00
Brian Joerger e7d91bf30f Remove unused admin action name from IsMFARequiredRequest_AdminAction (#37102)
* Remove unused admin action name from IsMFARequiredRequest_AdminAction.

* Reserve field name.
2024-01-24 19:51:05 +00:00
357b2c8207 Refactor Admin Action MFA prompt (#37127)
* Move Admin Action RPC name to debug; rephrase client-visible prompt.

* Update api/mfa/prompt.go

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

* Update api/mfa/prompt.go

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2024-01-24 19:36:03 +00:00
Mike Jensen 09a33d86d6 Remove account lockout from failed recovery attempts (#35325)
* Remove account lockout from failed recovery attempts

This account lockout looks to be unecessary and potentially problematic.  Recovery codes and recovery through MFA are not possible to brute force.

In addition the potential to lockout an account from being able to use a recovery method could result in them being unable to unlock their account from other potential abuse cases (for example an attacker locking the account from failed password attempts).

As discussed in the RFD (https://github.com/gravitational/teleport/pull/35533) this includes the removal of all the API used for this locking mechanism.

* accountrecovery: Update `WithLock` function names

* accountrecovery: Combine verifyRecoveryCode and verifyRecoveryCodeWithRecord into one function

* Further GRPC cleanup after PR feedback

* Apply PR Feedback
2024-01-24 18:17:52 +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
Trent Clarke b537ebad14 SCIM API types and service definitions (#36623)
This PR icludes supporting changes for the implementation of SCIM provisioning
Teleport Enterprise.

This change includes:
 * A protobuf description of the SCIM service, allowing generic resource CRUD
   operations
 * Generated files for same
 * Internal abstractons for the SCIM GRPC service
 * Hooks to allow Teleport Enterprise to override the default
   "Not Implemented" GRPC service.
2024-01-24 06:18:19 +00:00
Michael b4f8cebbc9 Add TeleportNamespace to back sorted label prefixes (#37126) 2024-01-24 00:44:08 +00:00
Brian Joerger 85b7d9b460 Make tctl users add prompt for MFA just once (#36997)
* Refactor MFA prompt logic for the API client to enable various MFA
ceremony use cases.

* Address comments.

* Prompt for MFA before creating a user with tctl.

* Check if AdminActionMFA is enforced before attempting to create an MFA auth challenge.
2024-01-23 19:48:28 +00:00
Brian Joerger 218d608f83 MFA Auth Audit Events (#36953)
* Add mfa events to events.proto.

* Emit CreateMFAAuthChallenge event.

* Emit ValidateMFAAuthResponse event.

* Make Client changes to display MFA auth audit events in the WebUI.

* Fix unit test.
2024-01-23 04:08:27 +00:00
Brian Joerger 1db61a6a81 Client MFA Ceremony refactor (#36996)
* Refactor MFA prompt logic for the API client to enable various MFA
ceremony use cases.

* Address comments.
2024-01-23 01:16:18 +00:00