-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC for automated testing of correct autorization on endpoints #1461
Comments
For example would a framework like these work for us? |
Of python -> Open Policy Agent |
@baszoetekouw perhaps it is a good idea to have a whiteboard session about this? What do we want to achieve, which problems it will solve and what would a MVP look like? There is an inherent risk of over-engineering this. |
@logan-life to plan a whiteboard session for this in October or November. |
Scheduling request sent for the whiteboard session. |
Conclusion of whiteboarding session: authorization framework doesn't seem feasible and will be complex anyway (because the system itself if complex). The tests should be automatically generated to iterate over all roles and all endpoints, and check if there is access. Easy way to start: anonymous user, iterate over all endpoints, and test if we have access. Generate a seed specifically for these tests; define a yaml file that describes these desired results. So, start a POC:
After the poc, see what this brings us, and if we should expand this to iterate over other roles (OrgAPI user, logged in user, co admin, etc) |
Time-boxed effort for the POC = ~ 3-4 days Potential benefits to realize:
|
Waiting for to be merged. https://github.com/SURFscz/SBS/tree/feature/automated-authz-testing-1461 is the branch with the automated end-points tests, and is created from the #1630 branch, which can not be merged until eduTeams fixes the refactored login flow. |
Can be tested. Is merged to main branch. |
Ok |
I would like to have automatic tests to prevent bugs like #1457.
Ideally there would be a test that iterates over all roles in the platform, tries to access all endpoints with all roles and checks that only the correct roles have access.
This is a huge piece of work, so I'm unsure on how to take this on. We should probably start with something like role definitions to see which role there are in the first place.
Or we could approach it from a different direction, and introduce a framework that helps with the mapping from user/token to role to access rights, and migrate all API authorisation to use a more structural framework like this.
@oharsta do you have an idea of there is a somewhat doable way to achieve this?
The text was updated successfully, but these errors were encountered: