Commit Graph
2141 Commits
Author SHA1 Message Date
Marco Dinis 8fb1b11f8f UserTasks - DiscoverRDS issues: add protos (#50985)
This PR adds the proto changes required to create UserTasks related to
Auto Discovering RDS databases.

Similar to the already existing EC2 and EKS.
2025-01-14 09:10:34 +00:00
Noah Stride ccc639383a Workload ID: Introduce basic rule condition operators (#50940)
* Pull condition operators into a one of

* Add wrapper structs to support repeated

* Adjust for new protos

* Fix tflint

* Start fixing tests

* Add more test cases

* More test cases

* Fix marshalling of resource

* Fix test in lib/services
2025-01-10 21:15:11 +00:00
rosstimothy 17edb10e43 Permit routing to agentless nodes with non-UUID metadata.name (#50915)
We suggest that a UUID is used for agentless nodes metadata.name
field, but we do not enforce it. This causes several edge cases
and slightly weird UX in places that expect the name to be a UUID.
Most notably, this presents dialing problems for the web ui as
described in https://github.com/gravitational/teleport/issues/50914.
To allowing dialing to function in all cases for these servers,
routing has been updated to permit matches on metadata.name, however,
the match is given a lower score then a match on a UUID. This should
permit dialing, though, it may still result in ambiguity.

Closes #50914.
2025-01-09 20:35:14 +00:00
Hugo ShakaandAlan Parra 9dc860d5fe Fix proto resource 153 marshalling for autoupdate_* resources (#50688)
* Fix proto resource 153 marshalling

* Update tool/tctl/common/collection_test.go

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

* Update tool/tctl/common/collection_test.go

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

* Address feedback

- Change from Resource153AdapterV2 to ProtoResource153Adapter
- fix test failures and unmarshal proto resources properly
- add a failing round-trip proto 153 test case
- bonus: fix the table tesst reosurce create that did not support
  running a single row

* Apply suggestions from code review

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

* lint

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2025-01-09 14:18:57 +00:00
Alan Parra e5966d8f0a chore: Bump google.golang.org/protobuf to v1.36.2 (#50841)
* chore: Bump google.golang.org/protobuf to v1.36.2

* Tidy modules

* Update generated protos
2025-01-08 13:50:45 +00:00
Noah Stride 84e9f20804 Encode Join Attributes in Bot Certificates (#49426)
* Persist Join Attributes in X509 Cert

* Use proto names when encoding

* Fix kube tests

* Fix other kube tests

* Fix interface nilness issue

* Add some tests to the TLSCA package and issuer

* Add more E2E style test that covers join attributes and workload id

* Explain test better

* Add JoinAttrs test for bots

* Remove methods no longer necesarry

* Fix imports

* Fix deprecation version

* Add comment explaining why we return even on failure

* Add GoDoc

* Fix logger

* Use auth server logger

* Remove unneccessary import
2025-01-08 09:59:15 +00:00
Alan Parra 532e917f5f chore: Bump api/ modules (#50828)
* chore: Bump golang.org/x/ modules

* Tidy modules
2025-01-07 17:43:31 +00:00
Alan Parra 12928537c6 chore: Bump opentelemetry modules (#50825)
* chore: Bump otel modules on api/

* chore: Bump otel modules on root
2025-01-07 16:41:09 +00:00
Alan Parra 8255a697f1 Add EvaluateDatabaseAccessRequest.database (#50481)
* Add EvaluateDatabaseAccessRequest.database

* Update generated protos
2025-01-06 20:24:37 +00:00
Brian Joerger 3ebf26978c Document second_factors field (#49016)
* Document second_factors; Update test plan.

* Update proto comment; Update terraform docs.

* Clarify second_factors reference.

* Fix docs lint.

* Address comments.

* Address marco's comment.
2025-01-06 19:57:26 +00:00
Gabriel Corado dbf8fcd964 Add client metadata to PostgreSQL database session start event (#50711)
* feat: add client metadata to database session start event

* refactor(test): update option to WithUserAgent
2025-01-06 18:53:35 +00:00
Edward Dowling f93eca5656 Add initial expiry service (#49267)
* Add initial expiry service

* Fix incorrect listAccessRequest options

* Fix linting

* Fix import order

* Check if context is done if sem aquisition fails in main loop

* Use gracefull exit context when starting expiry service
2025-01-06 15:06:17 +00:00
Noah StrideandTim Buckley c37a8e8af5 Support configuring DNS SANs for X509 SVIDs using WorkloadIdentity resource (#50676)
* Extend the protobuf

* Wire up DNS SAN field to issuance code

* Regenerate tfschema

* Add DNS SANs to the audit event

* Add test

* Rename to x509

* Add test/check that validates hostname generated

* Fix TS proto

* Update lib/auth/machineid/workloadidentityv1/decision_test.go

Co-authored-by: Tim Buckley <tim@goteleport.com>

---------

Co-authored-by: Tim Buckley <tim@goteleport.com>
2025-01-06 10:14:39 +00:00
Alan Parra a8e1cbb994 chore: Bump google.golang.org/grpc to v1.69.2 (#50543)
* chore: Bump google.golang.org/grpc to v1.69.2

* Exclude google.golang.org/grpc/stats/opentelemetry
2025-01-06 09:56:49 +00:00
Noah Stride 9c036f9f3e Add protos for encoding Join attributes (#50680) 2025-01-02 18:19:08 +00:00
Cam Hutchison 909cc20a5d Update master for v18 (#47988)
The v17 release branch has been made, so update master so that it refers
to v18.
2024-12-31 15:48:49 +00:00
Hugo Shaka afae487f30 Reduce clock usage + add time and period override in rollout controller (#50634) 2024-12-31 15:25:28 +00:00
Gabriel Corado 2dbdfd27a1 Determine session type on stream based on stream watcher events (#50395)
* refactor: determine session type on stream based on watcher

* refactor(auth): early return when is teleport server

* refactor: move to function and add tests

* chore(lib): fix lint

* refactor(events): make private function
2024-12-27 16:52:45 +00:00
Alan Parra d070ce0ec3 chore: Bump google.golang.org/protobuf to v1.36.1 (#50540)
* chore: Bump google.golang.org/protobuf to v1.36.1

* Update generated protos
2024-12-23 15:17:42 +00:00
Bernard Kim a221604dc5 Add UpsertTrustedClusterV2 RPC (#49789)
* Add UpsertTrustedClusterV2 rpc

This supersedes UpsertTrustedCluster rpc. V2 performs resource name
validation.

* Replace confusing UpsertValidationTrustedCluster name

* Use UpsertTrustedClusterV2 in tests

* Address feedback

- Remove unnecessary ping
- Update error messages
- Use skipNameValidation consts
- Validate cluster name before establishing trust
- Do not reveal cluster name in error message
- Use BadParameter instead of CompareFailed

* Use webclient.Find

* Fix test/lint

* Allow label updates

* Fix test

* Fix error handling

* Implement CreateTrustedClusterV2 and UpdateTrustedClusterV2

* Address feedback

* Minor fixes

* Move V2 RPCs to the trust service

* Update comment

* Drop V2 suffix

* Require matching revision

* Fix upsert/update revision

* Drop V2 from Create and Update APIs

* Lint: Fix typo
2024-12-21 04:24:29 +00:00
Noah Stride 3796023d01 Add support for WorkloadIdentity resource to the Teleport Terraform Provider (#50382)
* First pass at trying to generate terraform provider

* Wire up types

* Fix generation of docs

* Add godoc comments

* Add tests

* Tflint and add example
2024-12-20 18:37:20 +00:00
rosstimothy c61461b4fd Improve client tools host resolution (#50175)
Host resolution performed because labels, fuzzy search, or predicate
expressions were supplied to commands that establish connections to
a single host has historically been performed client side in tsh.
While that works in most cases, it can prevent correctly
resolving hosts in some situations, i.e. when there are ambiguous
hosts and tsh is unaware that the cluster routing strategy is set
to ROUTE_TO_MOST_RECENT.

To improve the experience, a new ResolveSSHTarget was added to
Auth to allow host resolution to be performed server side. The
resolution works in a similar manner to, and was inspired by
GetSSHTargets. In the event that the new RPC is not implemented,
because the client is newer than Auth, tsh has also been updated
to pull the cluster networking config and address any host
ambiguity if allowed.

As a result tsh scp and tsh proxy ssh should be much more
tolerant to, and still permit access in situations where
ambiguous hosts are present for some amount of time. Prior to
this the only way to connect in these situations was to find
the UUID of the correct target instance and try again after
seeing an ambiguous host error.
2024-12-20 15:57:26 +00:00
Tiago Silva 3fb3dc4453 netiq: Add NetIQ plugin boilerplate code (#50476)
This PR introduces the necessary protobuf changes to accomodate NetIQ
plugin.

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

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2024-12-20 13:31:57 +00:00
Hugo Shaka aaea047864 set rollout start date and don't start updating if rollout just changed (#50365)
This commit does two changes:
- the controller now sets the rollout start time when resetting the
  rollout
- the controller will not start a group if the rollout changed during
  the maintenance window (checks if the rollout start time is in the
  window)
2024-12-19 23:36:38 +00:00
Alan Parra a1881e9cad chore: Bump golang.org/x/net to v0.33.0 (#50396) 2024-12-19 13:48:05 +00:00
Matt Brock ef7a93fa3d Protobuf and configuration for Access Graph Azure Discovery (#50364)
* Protobuf and configuration for Access Graph Azure Discovery

* Adding godoc and removing Integration field from fileconf
2024-12-18 20:05:56 +00:00
Hugo Shaka 89a3d2a495 Add autoupdate_config and autoupdate_agent_rollout validation (#50181)
This commit removes the restrictions of the autoupdate_agent_rollout and autoupdate_config schedules but adds groups validation.

It also adds some optional server-side validation that should not be enforced at the resource level.
2024-12-17 17:12:42 +00:00
Alan Parra 0aaca3fcce Add the decisionv1.Service boilerplate (#49912)
* Add the decisionv1.Service boilerplate

* Wire decisionv1.Service to auth.GRPCServer

* Wire decisionpb.DecisionServiceClient to client.Client

* Add basic service testing
2024-12-17 14:13:16 +00:00
Noah Stride 1a4ba3ff0a Workload Identity: Add protos for issuance service and Attributes (#50163)
* Add protos for issuance service and attrs

* "expiry" -> "expires_at" rename

* Pull jwt/x509 svid out into own messages

* Add WorkloadIdentity/WorkloadIdentityRevision fields to SPIFFESVIDIssued

* Update package name
2024-12-17 11:40:28 +00:00
Marco Dinis c168172ddc Add debugging steps for DiscoverEC2 User Task issues (#47513)
* Add debugging steps for DiscoverEC2 User Task issues

This PR adds a new field when getting an User Task.
Description contains a markdown document that should be displayed to the
user which helps them fix the issue with the task.

* move descriptions from api to lib
2024-12-17 09:47:43 +00:00
Alan Parra 79e993b52b chore: Bump google.golang.org/protobuf to v1.36.0 (#50288)
* chore: Bump google.golang.org/protobuf to v1.36.0

* Update generated protos
2024-12-16 19:17:25 +00:00
Yassine Bounekhla 5047402502 skip access list if one of its roles is missing (#49456) 2024-12-16 19:06:40 +00:00
Alan Parra ec2d05f7e2 Add initial Decision (aka PDP) protos (#49875)
* Clone protos from fspmarshall/pdp-work-02

* Use decisionpb as the Go package alias

* Update DecisionService docs

* Split identity protos into separate files

* Update Metadata docs

* Split metadata into separate files

* Update Resource docs

* Update database access docs and fields

* Update SSH access docs and fields

* Ignore breaking changes on decision protos

* Update generated protos

* Use teleport.trait.v1.Trait

* Document mutual dependency between "ResourceID" types

* nit: s/ResourceID/ResourceId

* nit: Use the correct CamelCase field name in comments

* Update generated protos

* Add RouteToApp.target_port

* Update generated protos

* Update comments on TLSIdentity / tlsca.Identity

* Update generated protos
2024-12-16 18:02:29 +00:00
Trent ClarkeandRoman Tkachenko 86dc8b14d8 Adds Roles for IC resource access requests (#49565)
* Adds IC Account Assignments to preset `access` role

Adds the global-allow wildcards to the preset access role, allowing the `access`
role to participate in Resource Access Requests involving Identty Center
resources.

* Adds IC Account Assignments to preset `access` role

Adds the global-allow wildcards to the preset access role, allowing the `access`
role to participate in Resource Access Requests involving Identty Center
resources.

* Add default roles if not present

* Add reviewer role

* Update lib/services/presets.go

Co-authored-by: Roman Tkachenko <roman@goteleport.com>

* apply feedback

---------

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2024-12-16 02:06:46 +00:00
Hugo Shaka 793bedd5ab Change autoupdate proto messages (#50234)
* Change autoupdate proto messages

This commits does 3 changes:
- reflect the maintenance duration on the rollout in a new spec field
- add a rollout start time field in its status
- change wait_days into wait_hours

* int64 -> in32 for consistency with other fields
2024-12-14 22:51:51 +00:00
Marco Dinis d37da511c9 UserTasks for Discover EKS: create tasks when auto enrolling fails (#50024)
* UserTasks for Discover EKS: create tasks when auto enrolling fails

This PRs changes the DiscoveryService to ensure it creates UserTasks
when EKS Clusters fail to auto-enroll.

* simplify types
2024-12-13 11:47:12 +00:00
Marco Dinis ccd2a9915d Add last state change timestamp to UserTasks (#50130)
This PR adds a new field to the UserTask Status.
It will register the timestamp of when the UserTask state was last
changed.
2024-12-13 08:53:10 +00:00
120163032e Automatially add IC Account to Account Assignments Access Requests (#50154)
* Automatially add IC Account to Account Assignments Access Requests

The UI needs access to the account associated with an Account Assignment
in order to display the enclosing Account, otherwise the user will not
be able to see their assogned permission sets.

This patch automatically adds the enclosing account for any account
assignments in a resource access request and allows the user to see
ther human-friendly names in the access request listing.

* Apply suggestions from code review

Co-authored-by: Sakshyam Shah <sshah@goteleport.com>
Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Code review sugestions

---------

Co-authored-by: Sakshyam Shah <sshah@goteleport.com>
Co-authored-by: Marek Smoliński <marek@goteleport.com>
2024-12-12 23:47:51 +00:00
Trent ClarkeandMarek Smoliński b3fbbc2cf9 Filter IC Permission Sets based on access (#49936)
* Filter IC Permission Sets based on access

If a user is granted access to an IC Permission Set via an access request,
the UI treats the referenced account as if all Permission Sets are granted.
This hides the requestable Permission Sets from the user, making it
impossible for a user to requests more Permission Sets on that account.

This patch filters the Permission Sets delivered to the UI based on whether
the user already has access the Permission Sets and marks any requestable
Permission Sets on the account.

This provides the UI with enough information to decide how to display the
Permission Set list in order to get around the issue.

* Update lib/auth/auth_with_roles.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update auth_with_roles.go

---------

Co-authored-by: Marek Smoliński <marek@goteleport.com>
2024-12-12 22:51:01 +00:00
Marco Dinis da6dfdc76f Fix UserTask deterministic name for DiscoverEC2 issues (#50051) 2024-12-12 14:10:38 +00:00
dependabot[bot] 4613b1ac68 Bump golang.org/x/crypto from 0.29.0 to 0.31.0 in /api (#50101)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.29.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.29.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-12 13:25:59 +00:00
Noah Stride 49c30832f7 Add workload_identity_labels to RoleCondition (#50071)
* Add WorkloadIdentityLabels field to role

* Wire up access checker

* Add validation for new field

* Update CRDs

* Add to terraform provider

* Mispel some words to keep the republic happy

* Add WorkloadIdentityLabelsExpression

* Update Terraform provider

* Add to operator CRD

* PLS RUN CLA CHECK
2024-12-12 11:46:19 +00:00
Bartosz Leper e73e8aabf7 Fix unmarshalling of CreateDatabaseUserMode (#49995)
* Fix unmarshalling of CreateDatabaseUserMode

* Review
2024-12-11 17:55:57 +00:00
Yassine Bounekhla 22c5830ca8 prevent users from seeing notification for their own access request (#49915) 2024-12-11 17:44:45 +00:00
Rafał Cieślak 7eb25e4220 VNet: Refuse conn if local port doesn't match app spec (#49944)
* Add custom type for list of port ranges

* Verify local port before initializing local proxy

* Call AppResolver.OnInvalidLocalPort before refusing conn

* Fix how lib/vnet.TCPAppResolver sets leafClusterName

* Refactor CannotProxyVnetConnection

This allows more reasons to be specified.

* Improve how TshdNotificationsService gets cluster names

* Let notifications override auto-removability

* Send RPC to Electron app on invalid port

* Remove impl of sort.Interface from PortRanges

* Make GetTCPPorts return PortRanges

* Test clusterName only against RootClusterName

* Don't say "local port" in UI

* Show valid ports in Connect

* Show valid ports in tsh

* Fix fake app provider in tests
2024-12-11 16:20:58 +00:00
STeve (Xin) Huang 576192de20 GitHub proxy part 7: audit events (#49923)
* GitHub proxy part 7: audit events

* make Git Command consistent

* fix typo
2024-12-11 14:17:42 +00:00
Marco Dinis d87a04d28e UserTasks for DiscoverEKS Issues - proto (#49887) 2024-12-11 10:49:54 +00:00
Marco Dinis 0e1f1bc45e Discover EKS: allow custom labels for Kube Server (#49420)
This PR allows the UI to send extra labels for setting up the EKS
cluster.
2024-12-11 10:05:14 +00:00
STeve (Xin) Huang 80a58fc82c GitHub proxy part 5: OAuth flow to retrieve GitHub identity (#49849)
* GitHub proxy part 5: OAuth flow to retrieve GitHub identity

* review comments round1

* review comments round 2 and update tsh git list

* make -C integrations/operator crd

* make -C integrations/terraform docs

* fix flaky test
2024-12-10 17:31:32 +00:00
Noah Stride 35e934c1db Add basic tctl commands for WorkloadIdentity resource kind (#49828)
* Add basic tctl commands for WorkloadIdentity resource kind

* Add `tctl workload-identity ls`

* Add `tctl workload-identity ls`

* Fix message strings to be consistent

* Add tests for `tctl workload-identity` functionality
2024-12-10 17:19:05 +00:00