Commit Graph
76 Commits
Author SHA1 Message Date
Hugo Shaka bb6c5ee9ae Fix terraform/event-handler Makefile & Dockerfile (#41591)
This commit fixes three issues:
- Terraform and event-handler integratiosn were still using hardcoded
  versions instead of looking up the Teleport version
- The version was not detectde properly when building access pluigin in
  docker
- The event-handler Dockerfil was not importing the whole teleport
  repo as context which is required since the teleport-plugins
  -> teleport migration (we use the go.mod from the root)
2024-05-15 17:43:38 +00:00
fheinecke 4d3b141ad5 Restructured teleport-plugins makefile variables to match plugins (#41506) 2024-05-14 02:35:02 +00:00
Hugo Shaka 12af582096 Fix auto approval with duplicated service names + increase PD timeout (#41477)
* Fix auto approval with duplicated service names + increase PD timeout

* add license
2024-05-13 18:57:10 +00:00
Hugo Shaka 90392ca700 Make access plugin tests work with mandatory 2fa (#41412)
* Make access plugin tests work with mandatory 2fa

* fix Access List reminder tests

* lint
2024-05-10 15:13:42 +00:00
Hugo Shaka efbd441b83 Build standalone access plugins in teleport (#40970)
* add Makefiles and access plugin binaries

* lint + add version helper

* consolidate access plugin Makefiles

* add license
2024-05-01 18:52:30 +00:00
Hugo Shaka f573c2d457 discord pluign Makefile + Dockerfile (#40876) 2024-04-26 14:36:46 +00:00
Alex McGrath 3733dc218b log user notifications (#40625) 2024-04-18 09:50:46 +00:00
Marco André Dinis d3c795889e Fix JIRA issue type (#40587)
* Fix JIRA issue type

During set up we ask for the Jira Issue Type, but then we always send
the `Task` type.

This PR changes the field's value to match the configured one.

* add test
2024-04-18 07:05:22 +00:00
Alex McGrath 03a91bc9b6 @ requester by email in slack access requests (#40041)
* @ requester in access requests

* Add NotifyUser to direct message user on request update

* resolve comments

* Update test to make sure message is sent
2024-04-17 15:38:23 +00:00
9062d62aff Add access monitoring rules cache and tctl interactions (#40218)
* Add access monitoring rules cache and tctl interactions

* Swap access monitoring rules collections to use upsert

* Update accessmonitoringrules cache test

* Readd missing err check

* Update lib/auth/grpcserver.go

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>

* Update lib/auth/grpcserver.go

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

* Update tool/tctl/common/resource_command.go

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>

* Add tctl isForced behaviour for access monitoring rules

* Add missing methods to cache interface for access monitoring rules

* Add info messages to tctl commands for accessmonitoring rule edits

* Add missing user message for forced rule creation

* Appease linter

---------

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2024-04-17 13:05:01 +00:00
Hugo Shaka 8002d97c1c Skip flaky access plugin tests (#40525)
* Skip flaky access plugin tests

* fixup! Skip flaky access plugin tests
2024-04-12 21:51:51 +00:00
Hugo Shaka a24216e166 Prepare teleport access plugin enterprise test suite (#40479)
* Make AuthHelper support enterprise

* Split access OSS and Enterprise tets suites

* fix slack tests

* fix race in accesslist reminder tests

* fixup! fix race in accesslist reminder tests
2024-04-11 21:37:11 +00:00
Hugo Shaka 7e9ff5acc2 Vendor teleport-event-handler (#40364)
* Vendor event-forwarder plugin

* fix tests + add Makefile + CI

* lint

* Fix broken test

* use a separate go.mod

* ignore event-handler in flaky tests + update go.mod

* go mod tidy
2024-04-10 15:46:14 +00:00
0b01cf5c1f Fix opsgenie plugin to use correct annotation to determine whether or not to create alerts (#38435)
* Fix bug in opsgenie plugin mixing up notify-services and schedules

* Update docs for opsgenie plugin to use correct schedules

* Remove accidental change to opsgenie client

* Update opsgenie client tests

* Update opsgneie plugin behaviour for determining recipients

* Update docs with correct screenshot of role creation

* Stop Opsgenie plugin sending alerts when /schedules label is set

* Change rawRecipients initialisation in opsgenie bot

* Remove opsgenie add role example image from docs

* Update integrations/access/accessrequest/app.go

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

* Update docs/pages/access-controls/access-request-plugins/opsgenie.mdx

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

* Make variable Opsgenie plugin var names more consistent

* Update changelog with opsgenie breaking changes

* Rename ReqAnnotationSchedulesLabel for consistency

* Fix opsgenie getOnCall

* Add opsgenie approval tests + add approval user configuration

* Appease linter

* Add back in opsgenie client fix

* Appease linter

* Add in clarifying comment for alert request retry behaviour

* Add missing opsgenie endpoint mocks

---------

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
Co-authored-by: Hugo Hervieux <hugo.hervieux@goteleport.com>
2024-03-27 13:44:25 +00:00
Hugo Shaka a2cd86aad2 vendor teams plugin (#39375)
* vendor teams plugin

* add apcahe license
2024-03-25 14:45:29 +00:00
Hugo Shaka ac77719da8 Fix hosted snow Teleport client building (#39524)
* Fix hosted snow Teleport client building

* fix panic
2024-03-19 22:48:19 +00:00
0942b6f3ea fix jira error parsing (#39204)
* fix jira error parsing

* lint

* Address zac's feedback: imprement error + rename structs

* Update integrations/access/jira/types_test.go

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

* Apply suggestions from code review

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

* address feedback

* Update integrations/access/jira/types.go

* address feedback + fix tests

* fix unmarshal

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2024-03-14 14:58:42 +00:00
Hugo Shaka 21eac0672d Migrate jira access plugin tests (#38406)
* Migrate jira access plugin tests

* grant the access_request.update permission

* lint

* license
2024-02-20 21:14:44 +00:00
Hugo Shaka 0a0719c969 Migrate discord access plugin tests (#38405) 2024-02-20 21:08:42 +00:00
Hugo Shaka b2d2124a47 Migrate mattermost access plugin tests (#38408) 2024-02-20 21:08:35 +00:00
Hugo Shaka 5379ac2906 Migrate opsgenie access plugin tests (#38410) 2024-02-20 21:08:32 +00:00
Hugo Shaka 76bb578f35 Migrate pagerduty access plugin tests (#38412) 2024-02-20 21:08:29 +00:00
Hugo Shaka 76de74066b Migrate ServiceNow access plugin tests (#38413)
* Migrate ServiceNow access plugin tests

* lint
2024-02-20 21:08:25 +00:00
Hugo Shaka 7ce5629acd Migrate Slack access plugin tests (#38427) 2024-02-20 21:08:22 +00:00
Hugo Shaka e6951df7bd vendor email plugin (#38434)
* vendor email plugin

* remove unneeded dependency

* lint
2024-02-20 21:08:18 +00:00
Edward Dowling 89a3140dfb Revert "Fix opsgenie plugin to use correct annotation to determine whether or…" (#38338)
This reverts commit 3455f3b6b1.
2024-02-16 16:26:51 +00:00
Edward Dowling 3455f3b6b1 Fix opsgenie plugin to use correct annotation to determine whether or not to create alerts (#37929)
* Fix bug in opsgenie plugin mixing up notify-services and schedules

* Update docs for opsgenie plugin to use correct schedules

* Remove accidental change to opsgenie client

* Update opsgenie client tests
2024-02-12 17:38:15 +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
Edward Dowling e6f92cc3e0 Bump jira plugins timeout for reeconciling webhook and getIssue (#36746) 2024-01-17 16:28:11 +00:00
Michael WilsonandPaul Gottschling bc696e3923 Fix the access list reminder pagination loop. (#36228)
* Fix the access list reminder pagination loop.

On error in the access list reminder pagination loop, the loop now breaks
instead of continuing, which is the intended behavior. A test has been added
to exercise this. This test will time out with the previous behavior. A light
refactoring has been done to make it easier to mock the ListAccessLists
response.

Users running their own Slack plugins (outside of cloud) were running into an
issue here due to the plugin user not having permissions to read access lists.
On cloud tenants, the plugins should have this access, so the impact there is
minimal.

Additionally, the docs have been updated to include the access list
permissions.

* Test fixes.

* Tests are more consistent.

* Update docs/pages/includes/plugins/rbac-with-friendly-name.mdx

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

* Add in initial duration/trigger.

* Output migration instructions, add jitter back in.

* Don't return error when no recipients.

* Tune the error return.

---------

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
2024-01-08 15:55:08 +00:00
Zac Bergquist 44a6bb1933 Use pkg slices from the standard library (#35905)
Prefer the stdlib version of the experimental package.
Includes a depguard update to prevent future regressions,
as well as an e-ref update to appease depguard.

Generated with:

    $ gofmt -w -r '"golang.org/x/exp/slices" -> "slices"' . && \
        make fix-imports
2023-12-19 23:06:53 +00:00
Michael Wilson b615a08307 Notify requester of access request and subsequent updates via Slack. (#35394)
* Notify requester of access request and subsequent updates via Slack.

When submitting an access request, the Slack plugin will now notify the
requester directly in addition to the configured channels during Slack
plugin setup.

* Tweak tests, recipient logic.

* Add comment about user e-mail expectation.
2023-12-08 16:07:40 +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
Edward DowlingandMarco André Dinis 722e82ccdd Make Opsgenie plugin update statussink on healthcheck (#35047)
* Make Opsgenie plugin update statussink on healthcheck

* Update integrations/access/opsgenie/client.go

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>

* Simplify logger use in opsgenie client

---------

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>
2023-11-30 13:32:40 +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
Edward Dowling 44b868ffbb Retry jira getIssue status if result mismatches webhook payload (#34622)
* Retry jira getIssue status if result mismatches webhook payload

* Fix formatting

* Move initial getIssue call to retry loop

* Update tests for jira plugin to include status in webhook response
2023-11-24 15:22:14 +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
fheinecke 83b6062220 Fixed additional license format issues (#34726) 2023-11-17 21:14:08 +00:00
Michael Wilson 2dbb2b4d4b Access list app in plugin ceases to run when endpoints not implemented. (#34669)
When access list endpoints are not implemented, the access list app in the
access plugins will cease to run. This could happen if the integration is
being run against an open source server.
2023-11-16 20:39:31 +00:00
Michael Wilson f1c3fae146 Add Slack access list reminders. (#34461)
* Add Slack access list reminders.

Access list review reminders will now be sent to owners via Slack every week
until the access list is reviewed. Some small modifications were made to the
access list application to support partial success. Additionally, some changes
were made to the way access applications are instantiated to maintain
compatibility with enterprise.

* Tweak error returns, debug statements.

* Notify once per day after the next audit date has passed, remove access list name from slack notifications.

* Fix for day notifications.
2023-11-16 15:34:45 +00:00
fa5c373f6c Add auto approval flow for servicenow plugin (#33885)
* Add initial servicenow auto approval

* Stop servicenow healthcheck exiting early

* Update servicenow plugin tests to handle auto approval flow

* Add comment clarifying choice of identifier for servicenow plugin

* Fix healthcheck error handling in servicenow plugin

* Fix formatting errors

* Add more context to logs

* Fix logging in servicenow plugin

* Update integrations/access/servicenow/config.go

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>

* Remove supurfluous reqId in log

* Remove unused sentinal error

* Fix imports

* Remove unused field

* Fix formating

* Change servicenow plugin to always post review updates

* Refactor servicenow plugin auto approval flow

* Update integrations/access/servicenow/app.go

Co-authored-by: Hugo Shaka <hugo.hervieux@goteleport.com>

* Add mock for healthcheck endpoint

* Add missing check to skip test in OSS version

---------

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>
Co-authored-by: Hugo Shaka <hugo.hervieux@goteleport.com>
2023-11-11 01:08:43 +00:00
Michael Wilson 30490419f7 Introduce scaffolding for access list Slack notification. (#33415)
* Introduce scaffolding for access list Slack notification.

The initial scaffolding for notification of the need for reviews for access
lists has been introduced. This is not expected to do anything just yet, but
will do so in a follow on PR.

This has additionally separated the plugin data from the dynamic access core,
as it no longer is tightly coupled to access requests. No effort was made to
refactor the existing plugin data backend logic.

* Ensure that the context is cancelled on process termination.

* Remove debug hour addition.

* Correct notification date calcs, add test for notifications.

* Expire the access list after two weeks, use a single map instead of multiple plugin data keys.

* Run GCI.

* Tune tests, retry period is now a duration.

* Get rid of gocron, use intervals, test using intervals.

* GCI.

* Renames, test tweaks.

* Refactor access plugins.

* GCI.

* Adjust tests, remove generics, plugin data uses JSON marshal instead of custom marshaling.

* Move recipient back to common.

* Missed a few recipients imports.

* Tweaks to logic, auto registration of apps, commenting and cleanup.
2023-11-09 17:14:20 +00:00
rosstimothy d5a796c056 Enable testify lint (#34222)
Updates our golangci-lint configuration to enable testifylint and
fixes all issues found.

Bump e ref to include gravitational/teleport.e#2567
2023-11-06 20:38:38 +00:00
Noah Stride 516e15db56 Access Plugins: Support dynamic credential reloading (#32974)
* Refactor client creation in access plugins

* Remove unnecessary client creation

* Remove unused constant

* Fix imports

* Add dynamic watcher mode

* Export NewIdentityFileWatcher

* Add godoc for exported func

* Americanize Speling

* Change username used by dynamic ssh credentials
2023-11-01 16:53:36 +00:00
Edward Dowling 439e5dcdca Add suggested reviewers as assingee to servicenow incidents (#33704)
* Add suggested reviewers as assingee to servicenow incidents

* Fix suggested reviewers encoding

* Update comment for serviceno assigned_to field
2023-10-23 16:37:52 +00:00
5c44cbac8e Fix issue with ServiceNow incidents not including link to access request (#33565)
* Fix issue with ServiceNow incidents not including link to access request

* Add cluster to incident desciption and include user as caller

* Add status sink to servicenow client

* Fix formatting

* Undefer status updating in servicenow plugin

* Add log of plugin status

* Update integrations/access/servicenow/client.go

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>

* Fix bug caused by caller_id field being a different type on response

* Change format for description for resource requests

* Fix mock servicenow to use seperate incident response type

* Update integrations/access/servicenow/client_test.go

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

* Fix formating

* Update tests

---------

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>
2023-10-17 17:25:43 +00:00
Andrew Burke c4b2861f70 Show resources in Slack notification for access requests (#32887)
This change updates Slack notifications for resource-based access
requests to include the resources being requested.
2023-10-10 21:01:32 +00:00
Jakub Nyckowski e13137016c Add 'promoted' access request state (#31346)
* This change introduces a new 'promoted' access request state. The state represents that an access request has been promoted to an access list.

Affected code was modified to adjust to the new promoted state and ensure correct system's behavior.

Added a new 'GetAccessRequest' method for internal use to retrieve access request info.
Disallowed direct promotion of access requests. Introduced 'SubmitAccessReviewAllowPromotion' for promotions.
Added 'PromoteAccessRequest' method and updated its usage to restrict direct promotions.
Refactored code for better readability and testing. Renamed some functions, simplified logic, added test helpers.
Introduced 'promoted' state for access requests to handle promotion workflow.
Added 'PromotedAccessListTitle' in 'AccessReview' to track promotion state.

* Refactor function and message names for better clarity

The function and message names related to the promotion of an access request to an access list were restructured for better readability and consistency. Names like 'PromoteAccessReqResponse'  have been replaced with more descriptive names such as 'PromoteAccessRequestResponse'. This increases clarity and consistency across the project.

* Remove the hacky GRPC server implementation

* Change method names to be more descriptive

Renamed all instances of 'PromoteAccessRequest' to 'AccessRequestPromote' in multiple files. The new method name provides a more descriptive and clear understanding of the method's function, which improves code readability and maintenance. This change applies to method definitions, comments, and error messages.

* Refine error message and introduce IsPromoted method

Refined the error message in 'access_request.go' to better indicate that only promoted requests can set the promoted access list title, not just have one. This enhances clarity of error message. Additionally, introduced 'IsPromoted' method in 'access_request.go' file. This method will be useful for quickly checking if a request is in the PROMOTED state.

* Rename variable in SubmitAccessReview method

Renamed the variable "params" to "submission" in the 'SubmitAccessReview' function, in 'auth_with_roles.go' file. The name "submission" provides clearer indictation of its role in submitting access review. This enhances code readability and understandability. No logic changes were made during this update.
2023-09-26 18:46:50 +00:00
Reed Loden cc9343f513 Correct grammar error in PagerDuty integration notification (#32534)
s/which/who/

Fixes https://github.com/gravitational/teleport-plugins/issues/659.
2023-09-26 08:02:59 +00:00
Edward Dowling 743d137b62 Remove unused servicenow rotation code and rotas from recipient (#32204)
* Remove unused servicenow rotation code and rotas from recipient

* Fix some incorrect comments

* Return unimplemented error from fetchRecipient
2023-09-21 16:16:17 +00:00