Skip to content

Add Access Control #153

Closed
Closed

Description

@Ayush5120

As our system grows, we need to ensure that users only have access to their resources for GET /tasks, GET /tasks/{task-id} and POST /tasks/{task-id}:cancel

Default access control setting would include these rules:

  • For creating a resource (i.e., POST /tasks), we would need to check if a given user is a member of a specific group. We would get this info from the Bearer token. A user creating a resource then becomes its "Owner".

  • Apart from viewing (GET endpoints) and modifying (POST /tasks/{task-id}:cancel) a resource, an "Owner" can also set the access roles for other users for that resource. So for example, if I create a resource and become its "Owner", I could give you an "Owner" role as well.

  • Other roles that *Owners" can assign to other users would be "Maintainer" and "Viewer" (the names of the roles can of course be different, maybe we can find better ones). "Maintainers" would be able to view and cancel jobs, but not modify access permissions. "Viewers" would only be able to view, i.e. get a detailed task info for the particular task, and have it returned to them as part of the list of all tasks.

  • Anyone without any of the roles could not even view the resource. But they may be able to create their own resources (if they are a member of the group).

  • Everyone should be able to access the service info, as long as they are authenticated, i.e., they send along a Bearer token - even if they are not part of the group that grants access to the task/resource creation endpoint.

Activity

  1. self-assigned this
    on Mar 23, 2023
  2. added
    priority: high
    type: security
    workload: days
    on Mar 23, 2023
  3. moved this from Todo to In Progress in BioHackEU23on Nov 2, 2023
  4. self-assigned this
    on Jan 6, 2025
  5. uniqueg commented on Oct 14, 2026

    @uniqueg
    Member

    Related: #201 covers LS Login bearer token validation and ECP_CLN group-based authorization for proTES, as part of the ELIXIR Compute Platform WP4 sprint. Per-task owner access control as described here builds on that.

  6. uniqueg commented on Oct 22, 2026

    @uniqueg
    Member

    This is now part of #215, which makes tasks owned by the user who submits them (or, for tasks that Conquest submits with its service token, by the user Conquest names), shows users only their own tasks and admins all of them. It uses FOCA's resource ownership helpers (FOCA 0.16), so nothing needs to be built into proTES itself. Group-based access to task creation (ECP_CLN) is covered by #212.

    Sharing tasks with other users (maintainer and viewer roles) is not needed for M4.4. Whether #215 includes it or it follows later is still to be decided; FOCA's ready-made role controllers (elixir-cloud-aai/foca#355) make it cheap either way. The PR for #215 will close this issue.

  7. moved this from In Progress to Done in BioHackEU23on Oct 23, 2026
  8. uniqueg commented on Oct 23, 2026

    @uniqueg
    Member

    Closed by the PR for #215. Sharing tasks with other users (maintainer and viewer roles) is not planned for now: by maintainer decision, only the owner of a task, the user who created it, can see and cancel it, and admins can't either, as task logs may hold sensitive data and data-access entitlements can't be passed from one user to another. If sharing is needed later, it can be added on top of FOCA's resource roles in a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: hightype: securityworkload: days

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions