gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.33k stars 1.74k forks source link

PagerDuty - System Annotations Missing from Access Requests #42417

Closed goakley closed 3 months ago

goakley commented 3 months ago

We are seeing an issue with the PagerDuty request plugin v14.3.3 working with Teleport v14.3.19.

We have configured our Teleport roles with the following annotation:

spec:
  allow:
    request:
      annotations:
        pagerduty_services: [...]

The exact contents of that annotation array depends on the role itself - we have a couple dozen roles associated with various PagerDuty services.

The PagerDuty plugin is configured to look at that annotation:

[pagerduty]
notify_service = "pagerduty_notify_service"
services = "pagerduty_services"

However, when making any request for any role on any resources in Teleport, the plugin reports the following "error" (logged at the debug level, the most verbose level available):

DEBU  Cannot proceed further. Request is missing any annotations request_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX request_op:put request_state:PENDING pagerduty/app.go:242

This is difficult to debug, because we can't find a way to view the raw access request data itself (tsh requests show doesn't provide all the details of a request). There are no other logs from the plugin when a request is created. As far as we can tell, these requests are from users with roles containing the annotation mentioned above.

Looking at the source code, it looks like this check happens before any other processing. That means that the plugin isn't even looking for a specific annotation - it's reporting that there are absolutely no annotations in the access request sent to the plugin. Is this a bug? Is there a way we can get more information about these access requests, in order to verify that Teleport did in fact ignore the annotations we have on these roles?

hugoShaka commented 3 months ago

This means there is no annotation on the access request. You can validate this by running tctl get access_request (note, this command was added in a recent version, make sure to have the latest tctl for your major locally and to update teleport to the latest v14.

If teleport is not adding any annotation to the AR, this is very likely not a plugin issue but a role configuration issue.

Make sure that:

goakley commented 3 months ago

That fix does look like it will resolve the issue. Thanks for the backport!