182 Commits

Author SHA1 Message Date
Kevin 61a5432bba Enable slack native review with UI and plugin app (#67821) 2026-06-23 17:46:08 +00:00
Kevin a2946e3c1b Change slack oauth call to use formdata instead of url params (#67932) 2026-06-22 17:39:31 +00:00
Kevin 948f2e2771 Add Slack review helm chart config (#67786)
* Add slack review helm chart config

* Address feedback
2026-06-17 19:31:46 +00:00
Kevin 6b5dd2de94 Add Slack review UI buttons (#67222)
* Add slack review UI buttons

* Add nolint:unused for function to be used in followup PR
2026-06-15 19:57:14 +00:00
Kevin df418075ed Add ReviewApp for Slack plugin (#67217)
* Add review config and app-level client for slack plugin

* Add ReviewApp to slack plugin

* Address feedback

* Move interactions buffersize to socketmode client; cleanup logs

* Use stream.Collect; clean up tests
2026-06-15 17:54:09 +00:00
Kevin d16dbcb1a1 Fix logging in accessrequest plugin (#67780) 2026-06-15 17:10:59 +00:00
Kevin 8002c7b8bd Revert default slackAPIURL for slack clients (#67735) 2026-06-12 00:03:28 +00:00
Kevin b1922cd5f8 Add native review config and app-level client for Slack plugin (#67208)
* Add review config and app-level client for slack plugin

* Address feedback
2026-06-10 18:31:52 +00:00
Kevin ed080fa018 Add Slack Socket Mode client for app interactions (#67148)
* Add slack socketmode client

* Address feedback; extend status; increase write wait

* Apply auto-reset to retry attempts counter

* Add link_disabled as fatal error

* Address feedback; change omitempty to omitzero
2026-06-09 17:54:44 +00:00
rosstimothy 4f17314a11 Initial migration to the Opaque API (#67279)
* Convert existing non-gogo codegen to the Hybrid API

Contributes to https://github.com/gravitational/teleport/issues/66776.

All existing protos explicitly set to API_OPEN have been change to
API_HBYRID. The new codegen was performed via make grpc. There are no
other functional changes to the code to start consuming the Hybrid API
those will come later. The intent is to get all Hybrid codegen in and
backported to ease the transition.

* Initial migration to the Opaque API

Contributes to https://github.com/gravitational/teleport/issues/66776.

All of the changes here are mechanical conversions generated from
`open2opaque rewrite -levels=green ./...`. There will be a follow up
to this in teleport.e which does the same. Once all changes have been
merged the process will be repeated with -levels=yellow followed by
-levels=red.


See https://protobuf.dev/reference/go/opaque-migration/ for more
details.
2026-06-05 14:52:58 +00:00
Kevin d27d251f95 Improve access request message titles for slack and discord plugins (#67285)
* Add RequestKind to plugin AccessRequestData

* Improve access request message titles for slack and discord plugins

* Clarify long-term access message
2026-06-01 22:18:06 +00:00
Kevin bb97c8f5db Add RequestKind to plugin AccessRequestData (#67281) 2026-06-01 21:51:58 +00:00
Hugo Shaka 7eb9914edc Revert "restore old oauth logic for seamless transition" (#66483)
This reverts commit 83b05c8ecb.
2026-05-12 16:28:05 +00:00
Kevin 61a403fab9 Remove unused parameter from access plugin NewApp (#66539) 2026-05-11 18:25:26 +00:00
Hugo Shaka 7e642fec45 Slack plugin oauth refactor (#65172)
* Add new simpler Slack oauth integration

* restore old oauth logic for seamless transition

* address kevin's feedback
2026-05-05 21:22:58 +00:00
rosstimothy 5870768c88 Stop using text/template and html/template to enable DCE (#65401)
All existing template usage was converted to make use of
github.com/DataDog/datadog-agent/pkg/template. The DataDog package
is a fork of the stdlib template packages with method calling
removed so that reflect.MethodByName does not prevent DCE.

There were a handful of method calls in our templates that were trivially
changed to use custom functions defined via FuncMaps or specifying the
calculated value to the template instead of calling a function in the template.

A future change will add linter rules to prevent new text/template or
html/imports from landing. They have not been included here so as
to not to break enterprise code while it is migrated.
2026-04-22 15:54:43 +00:00
rosstimothy 02a1b0b537 Inject modules into the auth server (#62858)
Contributes to https://github.com/gravitational/teleport/issues/62799.
2026-04-09 20:54:27 +00:00
Alan Parra 1b96139023 chore: Bump golangci-lint to v2.10.1 (#63939)
* Fix "builder.WriteString(fmt.Sprintf(...))" calls

* chore: Bump golangci-lint to v2.10.1

* Bump e/

* Fix a few more WriteString/Sprintf occurrences
2026-02-19 13:04:57 +00:00
Hugo Shaka 839f05350d Slack plugin hardening (#63288)
* Slack plugin hardening

- Do not cancel ongoing refresh
- Better logging in case of error

* fixup! Slack plugin hardening

* fixup! fixup! Slack plugin hardening

* Apply suggestions from code review

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

* address feedback

* fixup! address feedback

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2026-01-30 16:03:46 +00:00
Maxim 7d2d2a891d Access Requests: Add Resource-Scoped Constraints (#60123)
* feat: Extend `AWSRole` struct w/ `RequiresRequest`

- Differentiate between already-granted vs. requestable AWSRoles when
  including requestable resources in `clusterUnifiedResourcesGet`
  req

* feat: Implement Resource Constraints support for Proxy, Auth

* fixup: Fix tests

* test: Add tests for resourceaccessid-related helpers

* fixup: Address code review feedback

* test: Update identity/events tests for new `ResourceAccessID` fields

* fixup: Expand/improve godocs/comments for sentinel ResourceID handling

* fixup: Address code review feedback

* feat: Conv ResourceID->ResourceAccessID at cert decoding

- Convert ResourceIDs present on certs to ResourceAccessIDs at decoding
  time, rather than at each callsite. Update tests/usages of tlsca/sshca
  Identities to reflect this.
2026-01-27 14:51:52 +00:00
rosstimothy 6590c944b6 Inject modules into keygen (#62843)
Contributes to #62799.
2026-01-16 18:52:50 +00:00
Bernard Kim ad2cbb6464 access_monitoring_rule: evaluate rules using UserLoginState (#60782)
* Refactor access_monitoring_rules code

- Export EvaluateRules and NewAccessRequestExpressionEnv to reduce
  redundant code
- Embed clients within wrappedClient
- Simplify getLoginsByRole function
- Update missing permissions messages to use "access-plugin" role

* Evalute rules using UserLoginState

* Update access-plugin preset role permissions

* Fix test

* Fix typo

* Address feedback

* Refactor getLoginsByRole
2025-11-07 21:25:37 +00:00
Kevin 4713ff1c89 Refactor access list test cleanup (#61058) 2025-11-05 20:03:07 +00:00
Kevin d3782a8737 Fix slack plugin crashing if access lists feature is not supported (#60486)
* Modified access list app reminders to gracefully return if NotImplemented

* Added test coverage for slack plugin crash fix

* Update log output

* Remove unused code
2025-10-27 23:28:25 +00:00
Bernard Kim bb166ffe0b access_monitoring_rules: Implement schedules conditions (#59044)
* Implement schedules conditions

* Fix lint

* Remove schedules predicate expression

Consider all configured schedules by default

* Support schedules within notification rules

* Use timezone during evaluation

* Add debug logs
2025-10-15 23:33:52 +00:00
Hugo Shaka 398e18a636 reduce targetplatform warnings (#60232) 2025-10-15 01:22:16 +00:00
Bernard Kim 37b40eb87c Fixes Datadog Incident Management integration by updating on-call API client (#59616)
* Replace on-call unstable API with v2 API

* Test ignore casing for username

* Update godoc

* Use pagination metadata

* Add API docs to godocs
2025-09-26 22:45:57 +00:00
Zac Bergquist a4eb5edab6 Remove integrations/lib/backoff (#59113)
Plugins had their own backoff utils when they were a separate repo,
but now that they're in Teleport's repo we can reuse existing retry
utils.

Closes #47102
2025-09-19 00:49:34 +00:00
rosstimothy f5d033ea89 Update github.com/sigstore/rekor to v1.4.1 (#58797)
This update allows us to update go-chi/chi to v5.2.2 which resolves
GHSA-vrw8-fxc6-2r93.

The update also forces us to bump testify to 1.11.0 which brings
with it a change in behavior of require.Eventually. In prior versions,
the assertion function was initially only called _after_ the first tick.
In 1.11.0, the assertion function is called _immediately_ and then
on all subsequent ticks. This change in behavior has brought to light
a number of existing tests making use of require.Eventually with
buggy assertion functions. Their bugs were masked by the fact that
the intial tick was always enough time for the assertion to be
successful. The remediations in this change may not be all inclusive
as not all require.Eventually uses were audited, but all tests which
failed in one way or another are addresssed.
2025-09-08 16:57:17 +00:00
Zac Bergquist 191274b36d Reduce the number of custom set implementations (#57480)
* Reduce the number of custom set implementations

* Move set to a dedicated package

lib/utils is a large package and we don't want to force all packages
that need a set to import everything else in there.

A small alias remains in lib/utils to avoid breakign teleport.e.

* Fix tests

Some tests were depending on sorted elements, others cared about
the difference between a nil slice and a non-nil but empty slice.
2025-08-10 22:10:17 +00:00
Bernard Kim 934c41abec AccessMonitoringRules: Enable resource condition for notification rules (#57000)
* Enable resource condition for notification rules

* Set UsePreviewAsRoles option
2025-08-06 22:46:23 +00:00
rosstimothy 8f56697f76 Migrate all tests to use lib/auth/authtest helpers (#57030)
Removes the auth test helpers in lib/auth/helpers.go and
lib/auth/helpers_mfa.go and converts all tests to use the
equivalent helpers from the authtest package.

The e reference was also updated to include https://github.com/gravitational/teleport.e/pull/6932.

Updates https://github.com/gravitational/teleport/issues/51023.
2025-07-24 18:27:14 +00:00
Hugo Shaka 4cb60895b5 Lint Dockerfiles to stop build warnings (#57095) 2025-07-23 17:48:49 +00:00
Pawel Kopiczko f0b69e596f Ensure access_list.spec.type immutability (#56689)
* Ensure access_list.spec.type immutability

* Add coverage for DeprecatedDynamic
2025-07-21 16:16:00 +00:00
Pawel Kopiczko e3f5403309 AccessList: Restore (deprecated) "dynamic" type for compatibility (#56879) 2025-07-17 15:16:52 +00:00
rosstimothy 7541d6d7d0 Introduce logtest package (#56741)
Moves all test related logger initialization and creation to the
logtest package to reduce testing symbols in production code. The
existing helpers in lib/utils have been left in place until the
enterprise references can be converted.

Updates #51023.
2025-07-15 18:11:10 +00:00
rosstimothy 2afdce29c5 Introduce modulestest package (#56721)
The new package is meant to house a test friendly implementation
of modules.Modules. Due to the pervasive and global nature of
modules, this package also contains a copy of of
modules.SetTestModules. In a perfect world this function wouldn't
be needed and modules would be injected where required, however,
that would take considerable effort. The existing test modules
are temporarily left in place until the enterprise tests can be
updated to use modulestest.
2025-07-14 21:55:07 +00:00
Pawel Kopiczko 6dac0f5b2a AccessList.Spec.Type: Rename ImplicitDynamic -> Default ; Remove Dynamic (#56657) 2025-07-10 14:48:15 +00:00
Pawel Kopiczko ac82294e91 Disable notifications for non-dynamic Access Lists (#56399)
* Disable notifications for non-dynamic Access Lists

* Add godoc and use AccessList.IsReviewable
2025-07-03 21:03:54 +00:00
Zac Bergquist e4b45109a0 Modernize integrations (#55876)
$ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test -fix
2025-06-18 17:39:13 +00:00
Bernard Kim 465e7c540b Remote trailing . (#55308) 2025-06-03 16:30:28 +00:00
Bernard Kim 0fc059589d AccessMonitoringRules: Support user.traits with notification routing rules (#55101)
* Support user.traits with notifications

* Add recipients test
2025-05-28 22:57:21 +00:00
Bernard Kim 10b181a592 docs: Add access_monitoring_rule permissions (#55028)
* Include access_monitoring_rule permissions

* Log missing permissions
2025-05-21 22:07:30 +00:00
Edward Dowling 3a3bb32700 Apply traits to logins in plugin messages (#54449)
* Apply traits to logins in plugin messages

* Update docs to include include login traits information

* Add test coverage for plugin login traits application
2025-05-19 16:17:39 +00:00
rosstimothy 52816e8427 Bump golangci-lint to v2 (#54410)
* Bump golangci-lint to v2

* fix lints

* update e

* fix: delete removed cli option
2025-05-07 22:14:51 +00:00
Edward Dowling aa0e35f701 Add max duration to msteams plugin cards (#54110)
* Add max duration to msteams plugin cards

* Add test coverage to max_duration addition to plugindata

* Fix incorrect usage of maxDuration in msteams plugin

* Update integrations/lib/plugindata/access_request.go

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

* Fix error return from access request plugin data

* Fix formating in plugindata tests

* Update msteams plugin tests

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2025-04-29 16:14:58 +00:00
milos-teleport 1e0b63002d Increase the timeout for sending e-mails from 5 to 15 seconds (#53990) 2025-04-29 12:11:31 +00:00
Bernard Kim 6f20eee31e Implement access monitor (#53769)
* Implement access monitor

* FailFast before logging

* Use getters incase notification is null
2025-04-15 23:30:38 +00:00
Bernard Kim c32fa77951 Implement access monitoring review handler (#53773)
* Implement access monitoring review handler

* Add additional test cases

* Return AlreadyExists if already reviewed

* Address feedback
2025-04-12 04:27:03 +00:00
rosstimothy e7069792bc Add a parameterized types.Resource153UnwrapperT (#53567)
Provides a type safe resource 153 unwrapping variant to replace
types.Resource153Unwrapper. Most uses have been switched over to
the new type, though a few still exist and may be harder, if not
possible to convert without a considerable amount of change.
2025-04-01 14:39:44 +00:00