Do we have tool (and if not, I think that there should be), that you can input the API endpoints that you are using, confirm read/write status, and it outputs what the minimum scope for you PAT token is?
eg. I need to read (GET) from these three endpoints for my workflow:
Yes, this looks correct. The three scopes you listed are the minimum required for these GET APIs.
I also think this is a good idea for a tool. It would make it easier to identify the minimum PAT scopes required for any API endpoint and follow the least-privilege approach. It should also consider the PAT owner’s access/user level, since access is not limited to scopes alone.
That is a neat idea - drop your endpoints and methods into a tool and have it provide the minimum required scopes. I’m not aware of one today that’s officially part of the Community Toolbox. Would love to see it though.
There isn’t currently a SailPoint tool that automatically analyzes API endpoints and calculates the minimum PAT scopes required.
For the endpoints you listed, your proposed scopes look correct:
idn:sod-policy:read
idn:identity-history:read
idn:sources:read
The best way to validate is to create a PAT with only those scopes and test the API calls. If any request returns 403 Forbidden, add the additional scope indicated by the API documentation. Using the least-privilege approach is generally the recommended practice.
The scoped credentials work fine when its created as one of my PAT tokens.
However, if I try to create credentials via Admin/security settings/API management, the workflow fails on this end point: https://sailpoint.api.identitynow.com/sod-policies/v1/:id because (I think) of this statement:
“This gets specified SOD policy. Requires role of ORG_ADMIN.”
Is there a way to fix this problem other than creating a service account as an identity, scoping a PAT token, and assigning it the above Role?
Your question actually inspired me to build a solution for this!
I created a Workflow PAT Scope Analyzer that maps SailPoint’s API specs from GitHub against the endpoints and HTTP methods in your workflow JSON, outputting the exact minimum scopes needed.
In case you or anyone else in the thread wants to try it: