Skip to content

[Feature]: Add Role based access control to running workflows - update decorators #782

Closed
@srichmond

Description

@srichmond

Refinement of ticket after discussion on 11-2:

Requirements:

  • Ability to assign privileges per group

  • Ability to check privileges halfway a workflow

  • Make it possible to check authorization at each input type step

    • like suspend, callback input steps (iow when a user/proces changes the workflow into running state)
  • Dropped requirement: ability to change the minimal rights in the UI. This should be a handled by the auth implementation of the application

Suggested solution

  • Extend the stepdecorator to call an optional function, which is performing the isAllowed function by the attribute workflow_name, workflow_step_name (optional) and user. If this function returns true the workflow (step) can be executed.
    • Update the @update, @inputstep and @workflow decorators to include the isAllowed function.

In other tickets:


Contact Details

[email protected]

What should we build?

We would like to restrict access to running workflows to role based access control.

This should be pluggable such that a user can integrate with their own selected auth solution.

Relevant pseudo code

SURF ticket details https://git.ia.surfsara.nl/netdev/automation/projects/orchestrator/-/issues/2173

Summary

At the moment the task page has restricted access, while some to the workflows could be run/inspected by anybody, as the risk is minimal to none. Therefore it would be nice to be specific on defining execution rights per wf/task.
The new task button requires the access to the /orchestrator/processes/create/task. By adding an extra field to the task or workflow DB record, a minimal authorization level (MAL) can be specified.

  • /orchestrator/processes/create/task/no_risk
  • /orchestrator/processes/create/task/low_risk
  • /orchestrator/processes/create/task/medium_risk
  • /orchestrator/processes/create/task/major_risk
  • /orchestrator/processes/create/task/service_affecting
  • /orchestrator/processes/create/task/admin_only

By default all workflows and tasks are medium_risk.
When populating the new task dropdown, the user scope is matched with the MAL, so only allowed tasks are shown.

  • add MAL field to the workflows table in coreDB
    • consider an extra field active/inactive per workflow?
    • remove column deleted_at

DB view of workflows

image

  • add endpoint to change the MAL per workflow/task in the FE (Metadata pages), only allow valid fields (ENUM) --> ticket to be specced

image

  • add logic that validates in the BE that requested workflow/task is allowed to be executed by the user based on the added field in the workflows table.
  • Filter the new task dropdown with the valid task matching the users profile

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions