Commit Graph
19 Commits
Author SHA1 Message Date
Edward Dowling 55e187c560 Decrease inline limit for plugin message formating (#53358)
* Decrese in line limit for plugin message formating

Also truncate message blocks that still exceed max slack text block length

* Add link to slack docs explaining text block char limit
2025-03-27 17:16:24 +00:00
rosstimothy cca83feb66 Convert integrations to use slog (#50921) 2025-01-10 16:08:42 +00:00
Bernard Kim 9f5b3602d3 Support AMR notification routing with email plugins (#49038)
* Support AMR routing with email plugins

* Update unit tests
2024-11-19 19:57:49 +00:00
Bernard Kim e9f296fc0f Implement auto-approvals for datadog (#47475)
* Implement auto-approvals for datadog

* Address feedback

- Use standard teleport.dev/schedules annotation
- Link Datadog API docs

* Check annotations before api calls
2024-10-16 02:16:58 +00:00
Edward Dowling d73304a60f Fix regression with access monitoring rule name vs type matching (#46294)
* Fix regression with access monitoring rule name vs type matching

* Add test to ensure AMRs are not updated without correct name

* Swap to using require empty in access monitoring tests
2024-09-09 15:49:12 +00:00
Bernard Kim 233ee5216a Slack plugin now lists logins permitted by requested role (#45392)
* Include logins

* Add unit tests

* Handle access denied gracefully

* Update documentation with required permissions

* Reduce doc

* Address feedback

* Imported twice

* Improve loggin; Replace none -> -
2024-08-19 16:49:47 +00:00
Edward Dowling e99e2077c3 Add Access Monitoring Rule routing to Opsgenie plugin (#43298) 2024-08-08 16:27:56 +00:00
Edward DowlingandMarco Dinis 66994d88ac Prevent AMRs being watched if access monitoring is not enabled (#43714)
* Prevent AMRs being watched if access monitoring is not enabled

* Log and ignore AMRs if cache initialisation fails

* Update integrations/access/accessrequest/app.go

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

* Use allowPartialSuccess when watching over changing watch kinds

* Add ability to get confirmed watch kinds from watch job

* Add test coverage for newJobWithConfirmedWatchKinds

* Swap watcher accepted kinds logic to use callback instead of channel

* Update test for watcherjob

* Add check for unset init callback to watcherjob

* Remove unneeded retry utility

* Remove unused import

* Remove retry logic from watcherjob tests

* Fix linting

* Add clarifying comments and better error message

* Remove unused import

---------

Co-authored-by: Marco Dinis <marco.dinis@goteleport.com>
2024-07-19 16:42:24 +00:00
Edward Dowlingandedward 08f097a668 Enable access monitoring rules for mattermost plugin (#42498)
* Enable access monitoring rules for mattermost plugin

* Add test for mattermost AMR creation

* Remove unused const in mattermost test

---------

Co-authored-by: edward <edward@edwards-MacBook-Pro.local>
2024-06-27 16:51:48 +00:00
Edward Dowling 2108041f44 Add check to AMR watcher to handle subject removing requests (#42171)
* Add check to AMR watcher to handle subject removing requests

* Simplify AMR update handling

* Update tests to cleanup access monitoring rules

* Add in more checks to ensure initial AMR applies
2024-05-30 16:52:21 +00:00
94332f34e9 Add initial condition parser for access monitoring rules (#40659)
* Add initial condition parser for access monitoring rules

* Update integrations/access/accessrequest/app.go

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

* Check previously unchecked error and minor refactor of AMR

* Simplify check for applicable access monitoring rules

* Refactor access monitoring rules plugin integration

* Fix formating and move lock aquisition

* Add methods for listing access monitoring rules with a filter

* Add contains_any predicate expression func

* Add in is_empty func to predicate expression

* Lock AMR cache in plugins while getting initial rules

* Add in check for access monitoring rule version

* Update integrations/access/accessrequest/app.go

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

* Update integrations/access/accessrequest/app.go

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

* Move lock so it doesnt persist over api calls

* Remove unused constant and add more context to logs

* Appease linter

* Update access monitoring rules tests to pass rule validation

* Add in missing access monitoring rules list with filter code

* Appease linter

* Add back validation code for AMRs

* Fix test plugin role and rename listaccessmonitoringrulewithfilter

* Fix local test for AMR crud operations

* Fix end range for listing rules

* Fix unwrapping of resource153 event for monitoring rules

* Refactor AMR cache init into helper function in plugin app

* Add seperate response type for listAccessMonitoringRulesWithfilter

* Add context to log for plugins failing to fetch recipients

* Grab access monitoring rules cache under lock all at once

* Add clarification for which fields are optional in listAMRfilter req

* Update integrations/access/accessrequest/app.go

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

* Update integrations/access/accessrequest/app.go

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

* Add forEach to common recipient set

* Move type check to after AMR event op switch

* Move turn some default parser spec methods to funcs

* Make some predicate func usable as methods as well

* Add len func to common recipient sets

* Add integration test for access monitoring rule and slack plugin

* Fix error types and messages when handling AMRs

* Use generic list resource with filter for AMR

* Add test for generic listResourceWithFilter

* Update listResourceWithFilter to use revision instead of id

* Update generic tests to use revision instead of id

* Fix linting

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2024-05-24 18:45:13 +00:00
Alex McGrath 3733dc218b log user notifications (#40625) 2024-04-18 09:50:46 +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
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
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
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
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
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