Commit Graph
170 Commits
Author SHA1 Message Date
Noah Stride ee6e527eaf WMI: Allow max TTL for X509 and JWT SVIDs to be configured (#53787)
* Add maximum_ttl fields to the WorkloadIdentity resource

* Update issuer service to respect configurable max TTLs

* Add tests for TTL specification

* Add validation logic & tests

* Update terraform provider

* Fix tbot max ttl limitations

* Clarify name of `ignoreMaximumTTL`

* Introduce `defaultTTL` constant

* Fix generation of jwt

* Update operator resources
2025-04-09 17:28:51 +00:00
Noah Stride 47ec6d7222 Operator support for WorkloadIdentity resource (#53484)
* Generate CRDs

* Update snapshots

* Add apis impl for WorkloadIdentity

* Add WorkloadIdentityReconciler

* Add test for WorkloadIdentityReconciler

* Update RBAC

* Update to include version in kind

* Fix license header

* Fix handling of well-known Struct type

* Ignore revsiion
2025-04-09 14:18:31 +00:00
Noah Stride 63e269a756 Operator support for Bot resource (#53453)
* Add `Bot` manifests

* Update protos

* Add Bot API resource impl

* Add reconciler

* Fix bot CRD "versions" name

* Fix Unmarshal/Marshal panic for 153 resources

* Fix update test

* Mispell Marshalling

* Generate docs page

* Update role.yaml

* Add TeleportBot to resource list

* Update contributing

* Try to update the versions per RFD160

* Update k8s rbac for new resource name

* Use proto binary encoding for Marshal/Unmarshal

* Clear out unversioned crd

* More efficient deepcopyinto

* Fix license

* Add unmarshal options for protojson

* Update golden

* Fix RBAC
2025-04-01 15:31:48 +00:00
Gavin Frazar 8d38eac6ce [docs] Fix role reference request_access docs (#53471)
* Fix request_access godoc

* Update terraform docs

* Update operator CRD docs
2025-03-26 22:43:56 +00:00
Noah Stride 7cbb46d2ed Support configuring StaticJWKS for the GitLab join method (#53386)
* Update protobuf

* Implement and test ValidateTokenWithJWKS

* Update join logic to use new method for static jwks

* Update Terraform Provider

* Update operator docs/files

* Update goldenfile
2025-03-25 18:03:09 +00:00
Andrew Burke a67d70b436 OCI join - add proto and client (#51444)
This change adds protos, the client, and a bunch of boilerplate
for the Oracle join method.
2025-01-29 20:11:16 +00:00
Tiago Silva c88d89fb1a plugins: remove outdated sigs.k8s.io/kustomize/api replace (#51402)
* plugins: remove outdated `sigs.k8s.io/kustomize/api` replace

This PR removes the outdated go.mod replace directive for
`sigs.k8s.io/kustomize/api` and adds the
`kustomize_disable_go_plugin_support` build tag to skip the support for
dynamic plugins.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>

* handle review comments

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2025-01-23 15:54:06 +00:00
rosstimothy ef859498bc Vendor gravitational/trace/trail in api (#51032)
* Vendor gravitational/trace/trail in api

Pulling in the trail package directly in api will allow the trace
module to shed the grpc-go dependency. This needs to land prior
to https://github.com/gravitational/trace/pull/112 being included
in a new version of trace.

There should be no noticable change in the api depdency tree since
it already depends on grpc-go. Some additional items from the
trace/internal package were also vendored within trail as needed.
Additionally, some of the public api of trail that was not being
consumed has been made private.

* fix: appease linters
2025-01-14 21:04:01 +00:00
Hugo Shakaandrosstimothy 4883a184cd Remove direct zap dependecy in operator and kube-agent-updater (#50960)
* Remove direct zap dependecy

* fixup! Remove direct zap dependecy

* Apply suggestions from code review

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

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2025-01-14 15:38:38 +00:00
Bernard Kim 646329da7d operator: Support trusted_cluster resources (#49920)
* 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

* Update CRDs

1. Run `make manifests`.
2. Run `make -C crdgen update-protos`.
3. Run `make -C crdgen update-snapshot`.

* Implement trusted_cluster CRD

* Update docs

* Support secret lookup

* Update secret lookup docs

* Fix error handling

* Use V2

* Implement CreateTrustedClusterV2 and UpdateTrustedClusterV2

* Address feedback

* Minor fixes

* Use Create/Update instead of Upsert

* Update crdgen

* Update trusted_cluster tests

* Move V2 RPCs to the trust service

* crdgen

* Remove V2 suffix

* 2024 -> 2025

* Use slog
2025-01-13 17:21:09 +00:00
rosstimothy cca83feb66 Convert integrations to use slog (#50921) 2025-01-10 16:08:42 +00:00
rosstimothy 2c764e14b5 Reduce reliance on servicecfg.Config logrus logger (#50817)
Converts most items to use servicecfg.Config.Logger instead of
servicecfg.Config.Log. The deprecated logrus logger unfortunately
cannot be removed yet as it's still used in e. Additionally all
logging within the config package was converted to use slog.
2025-01-07 20:09:30 +00:00
Paul Gottschling 9f2f4c458e Remove dots from operator reference filenames (#50734)
The dots cause issues with our hosting infrastructure, which returns
404s when users make requests for Kubernetes operator reference pages
with no trailing slash.

This change returns a filename from the format function in the CRD/CRD
docs generator so we can return different file names for CRDs and their
docs. It also renames CRD docs pages to include hyphens instead of dots
and underscores, and adds redirects.
2025-01-06 13:19:46 +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
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
Bernard Kim 6995108c6e crdgen: Update testdata (#49375)
* Update crdgen testdata

* Update CONTRIBUTING.md
2024-12-02 19:55:42 +00:00
rosstimothy ace61e4350 Add missing target to integrations/operator crd (#49518)
This ensures that manifests are generated in response to proto
changes. Without this the linter will fail, and tell you to run
make -C integrations/operator crd, but nothing would be generated,
see https://github.com/gravitational/teleport/actions/runs/12056106780/job/33618509170?pr=49510.
2024-11-27 20:09:59 +00:00
STeve (Xin) Huang fae535b3df GitHub Proxy part 2: git_server resource, service, and RBAC (#49393)
* git_server resource and role.allow.github_permissions

* implicit RO on KindGitServer

* review comments

* fix ut

* make -C integrations/operator crd

* fix ut again

* make crds-up-to-date and make -C integrations/terraform docs
2024-11-27 16:12:30 +00:00
Erik Tate a8bff10c86 adding SSHPortForwarding config to RoleOptions (#49165) 2024-11-22 20:20:12 +00:00
Pawel Kopiczko 1a6f8d4c8a Add request.reason.mode to role conditions (proto only) (#49256)
This changes the proto type (+validation) only to declutter the original PR https://github.com/gravitational/teleport/pull/49124

The real changes are in

- api/proto/teleport/legacy/types/types.proto
- api/types/access_request.go
- lib/auth/auth_with_roles.go
- lib/auth/auth_with_roles_test.go

The rest is all generated.
2024-11-22 12:33:03 +00:00
Tim Buckleyandrosstimothy dee7a6f981 Machine ID: Add bitbucket join method for Bitbucket Pipelines joining (#48724)
* Add `bitbucket` join method for Bitbucket Pipelines joining

This adds a new `bitbucket` join method that Machine ID bots can use
to authenticate to Teleport from Bitbucket Pipelines CI runs.

* Add unit tests for bitbucket joining

This also fully adds `deployment_environment_uuid` which was found to
be missing.

* Fix imports

* Update tf docs

* Docs update

* Update generated TF resources

* Attempt to work around docs linter

* Add provision token tests

* Remove pipeline_uuid and step_uuid from protos

Also, fix deploment_environment_uuid field name.

* Remove references to removed fields in tests

* Switch to go-oidc/v3 and remove now-redundant nbf check

* Fix go.mod imports for the TF provider

* Fix event-handler go.mod

* Address review feedback; add 15s timeout to fetch provider metadata

* Update lib/bitbucket/token_validator.go

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

* Fix build after constant rename

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2024-11-21 23:05:58 +00:00
Edoardo Spadolini bcbfa8192e Get rid of math/rand in favor of math/rand/v2 (#49294)
* Get rid of math/rand in favor of math/rand/v2

* Update retryutils to use rand.N

* Update e ref
2024-11-21 12:57:32 +00:00
Noah Stride c72a4f2be6 Support for joining Actions in un-reachable GitHub Enterprise Servers via Static JWKS (#48973)
* Add JWKS based validator for github tokens

* Extend proto

* Update auth srvr github join impl to support static jwks

* Ignore govet

* initialize with jwks validator

* Update docs

* Update terraform shizz

* Regenerate various things
2024-11-15 12:32:55 +00:00
Hugo ShakaandAlan Parra 5d7eb65612 Improve 'Please run' messages in the CI (#48365)
* Improve 'Please run error'

* add missing file

* fix script

* Apply suggestions from code review

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

* address alan's feedback

* Update Makefile

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

* Update build.assets/please-run.sh

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

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2024-11-04 22:07:23 +00:00
Hugo Shaka 3e74e6dd40 operator: fix oidc conenctor max age (#48316) 2024-11-04 17:59:36 +00:00
Lisa Kim a132be09d2 Add a new role.allow.request field called kubernetes_resources (#47173)
* Add a new role.allow.request field called kubernetes_resources

* Fix lint: update terraform docs
2024-11-01 03:47:00 +00:00
Zac Bergquist c7765fa7f1 Fix incorrect usages of "it's" (#48252) 2024-10-31 23:35:30 +00:00
Marek Smoliński a9adc59ba3 Fix TeleportOktaImportRule (#48197) 2024-10-31 10:20:33 +00:00
Maxim Dietz 9383c38bf0 fix: Provide membershipKind fields for owners/members in tests (#48191) 2024-10-31 02:43:46 +00:00
Maxim Dietz a0540c5afe feat: Update AccessList Proto with new fields, add utils (#47828)
- Add Hierarchy utils for nested AccessList validation and handling
- Update AccessList Protos with new fields
- Update AccessList and AccessListMember types and converters with new
  fields
2024-10-30 20:00:49 +00:00
Bartosz Leper ae2b549f99 Add Kubernetes access section to the role editor (#47674)
* Add Kubernetes access section to the role editor

* Review

* Update the k8s operator docs

This also removes the mention of valid values of the Kind field, as I don't
want the external documentation to point to Teleport source files.

* Update operator CRDs and Terraform resources
2024-10-24 14:52:27 +00:00
Trent Clarke 63ac9101bb Adds Identity Center account assignments to role conditions (#47793)
* Adds Identity Center account assignments to role conditions

* Update types.proto

* Review fixups

* Updates operator resources

* Add generated docs

* Terraform doc updates
2024-10-24 02:19:45 +00:00
Brian Joerger 94295c981c feat: SSO MFA - support for OIDC MaxAge (#47292)
* Add max age to oidc mfa settings.

* Validate oidc max age.

* Update error message.

* Upate terraform schema and docs and crds.
2024-10-16 20:19:18 +00:00
Erik Tate 750f8082dd adding note about terraform mappings for create_host_user_mode to host user creation guide (#47139) 2024-10-11 14:38:05 +00:00
Brian Joerger 66058cd083 feat: SSO MFA - add missing SAML MFA fields (#47291)
* Add missing SAML MFA settings.

* Validate saml mfa settings and set fields from entity_descriptor.

* Reuse entity descriptor from base connector when applicable.

* Upate terraform schema and docs and crds.
2024-10-10 22:11:48 +00:00
Steven Martinandrosstimothy d724cf229b logging spell fixes (#47450)
* logging spell fixes

* remove space in log message

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

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2024-10-10 17:30:48 +00:00
Erik Tate 432b6ae2ab Update protoc-gen-terraform to v3.0.0 (#47374)
* adding new Attribute param to custom type generator funcs and adjusting
configs to support using protoc-gen-terraform v3.0.0

* generating newly available docs for the terraform provider

* fixing new lint errors
2024-10-10 15:14:10 +00:00
Hugo Shaka adbd4fb7da Fix content generated from proto (#47360) 2024-10-08 20:00:31 +00:00
Alan Parra 052c634b90 chore: Bump gcloud modules (#46995)
* chore: Bump gcloud modules

* Update Terraform docs

* Update operator manifests
2024-09-30 22:06:14 +00:00
2ba79b2dcd operator: support storing SSO connector client secret in a Kubernetes Secret (#46699)
* Allow operator secret lookup

* Document which fields can lookup secrets

* operator: support secret lookup

* fixup! operator: support secret lookup

* Apply suggestions from code review

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
Co-authored-by: Roman Tkachenko <roman@goteleport.com>

* lint

* add link to operator docs

* address feedback

* Revert "add link to operator docs"

This reverts commit cd812eb453.

---------

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2024-09-20 21:44:22 +00:00
Paul Gottschling 154a6ab390 Fix operator docs reference generator bug (#46732)
In the reference page for one Kubernetes operator resource, some
Markdown links are malformed.

The issue is that some fields of custom resource definitions used by the
operator consist of arrays of anonymous objects with fields that are
also objects. When creating docs based on these fields, the operator
resource docs generator creates a malformed link reference.

This change modifies the generator to replace any spaces with hyphens
before outputting link references, causing the resulting internal links
to work correctly.

This change also does some light refactoring to remove an unnecessary
`switch` statement.
2024-09-19 14:45:06 +00:00
Marek Smoliński ee8a673560 Move OKTA TF tests to TerraformSuiteEnterprise (#46669) 2024-09-17 15:47:36 +00:00
Hugo Shaka b31523c123 operator: Add secretlookup library (#46570)
* operator: Add secretlookup lib

* fixup! operator: Add secretlookup lib

* fix tests + address feedback
2024-09-13 20:19:29 +00:00
Erik Tate c592dbce0a adding configuration for setting default shell on host users (#46539) 2024-09-13 20:05:28 +00:00
Hugo Shaka 3e6b952338 operator: Simpler and more powerful Mutate function (#46566)
* operator: Simpler and more powerful Mutate function

* lint
2024-09-13 15:23:41 +00:00
Tim Buckley db689c76ef Terraform Cloud joining: Support Terraform Enterprise issuers (#46051)
This adds support for hostname/issuer overrides, needed to support
on-prem Terraform Enterprise installs. When the new `hostname` field
is unset, behavior is changed, but when set, the JWT is validated
against it instead of `app.terraform.io`.

Additionally, this renames `join_terraform.go` to
`join_terraformcloud.go`, since that was missed during the rename
in #45574.
2024-09-10 01:33:49 +00:00
Tiago Silva c0df3dc421 Update k8s.io deps to 1.31 (#46307) 2024-09-06 13:23:12 +00:00
Tiago Silva e9805ea819 Run integration tests on proto changes (#46218)
Integration tests only run on `api/types` changes so they don't end up validating if the crds are out of sync with protos.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2024-09-04 14:49:32 +00:00
Tim BuckleyandTiago Silva 03dba137cd Machine ID: Terraform Cloud joining (#45574)
* Machine ID: Terraform Cloud joining

This adds a new `terraform` join method, which uses Terraform Cloud's
Workload Identity OIDC provider to provide delegated joining support
for Machine ID bots. As the Terraform provider now embeds tbot, this
means - with some light modifications - that the Terraform provider
can now join using this join method, and without any secrets.

* Address some review feedback, add first batch of tests

This addresses a few feedback items, defaulting the audience to the
Teleport cluster name and requiring allow rules specify an
organization + at least one other parameter.

Also, adds a first batch of tests.

* Update autogenerated CRD docs

* Add tests for RegisterUsingToken and provisioning token init

* Fix imports

* Fix CRD docs

* Update tfschema

* Update tf docs

* Update docstring to make it clear that `Audience` is optional

* Update manifests

* Update CRD docs

* Code review feedback; docstring fixes

* Rename lib/terraform to lib/terraformcloud

* Rename terraform -> terraform_cloud

Renames the new join method to terraform_cloud to make it clear that
it won't work for TF running elsewhere (where other join methods
should be used)

* Fix tests and docs lints

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

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Update proto artifacts

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2024-08-27 23:27:09 +00:00
Anton MiniailoandTiago Silva edcc6a410b Add MFAVerificationInterval option for roles (#45569)
* add min mfa ttl

* Fix missing import

* Take into account cluster wide's requirement of per session MFA.

* Add tests.

* Protobufs update.

* Rename minMFAVerificationInterval to MFAVerificationInterval

* Use google.protobuf.Duration instead of casttype Duration.

* Remove unnecessary types.NewDuration cast.

* Update docs for mfaVerificationInterval.

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2024-08-21 23:58:03 +00:00