artefactual-sdps / enduro

A tool to support ingest and automation in digital preservation workflows
https://enduro.readthedocs.io/
Apache License 2.0
4 stars 3 forks source link

Problem: API lacks an authorization implementation #957

Closed jraddaoui closed 2 months ago

jraddaoui commented 3 months ago

Is your feature request related to a problem? Please describe.

Enduro's API has optional authentication using OpenID Connect (OIDC), but there is no mechanism in place to control access to resources based on user roles or permissions.

Describe the solution you'd like

I looked at different options to provide this functionally:

ACLs allows granular control over each resource, but it has scalability issues as the application grows. Like RBAC, they won't provide a flexible and fine-grained access control that will allow us to manage complex access needs dynamically as the application grows.

Both ABAC and PBAC grant or deny access based on attributes like user roles, resource types, operations, etc., evaluating them through defined policies. This attributes can have a hierarchical organization, policy inheritance and delegated administration (as the system and organization evolves). While PBAC provides comprehensive policy management, it can be implemented following ABAC when more defined policies and integration with external decision points are needed.

As an initial implementation or PoC, I'd like to see how Enduro is capable of getting a list of attributes from a configurable claim in the OIDC access token and limit user actions based on them. For example, considering the following actions (API-endpoints/UI-views):

And the following attributes:

"configurable_claim": [ "package:*" ]

Should be able to perform all actions.

"configurable_claim": [ "package:list", "package:read" ]

Should only be able to list and read packages, but not download them.

Describe alternatives you've considered

Mentioned above.

Additional context

aseles13 commented 3 months ago

This is a good incremental approach to validating and building out our identity management capabilities in Enduro.

fiver-watson commented 3 months ago

@jraddaoui I believe this is the issue related to our discussion about adding a prototype landing page so we can test users w no permissions. If that's correct, below is a super simple, rough first pass:

Image

I thought it could be nice to show the username in the welcome header text, but we can also skip that if it adds too much complexity. Otherwise, it's just a basic project description and a link or two.

jraddaoui commented 3 months ago

Initial implementation:

Screenshot from 2024-06-25 21-40-58

Some notes @fiver-watson:

Let me know your initial thoughts.

sallain commented 3 months ago

As discussed, we don't currently have the infrastructure to test this locally. I can see the lovely new landing page 🎉 For our purposes, I'm going to move this to done; we can reopen if necessary once the client has had a chance to configure and test.