* 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
* Implement auto-approvals for datadog
* Address feedback
- Use standard teleport.dev/schedules annotation
- Link Datadog API docs
* Check annotations before api calls
* 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
* 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>
* 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>
* 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
* 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>
* @ requester in access requests
* Add NotifyUser to direct message user on request update
* resolve comments
* Update test to make sure message is sent
* 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
* 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.
* 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.