Skip to content

Cloud Registry backend: public read access, service ownership, ECP_CLN:ADMIN admin role #62

Closed

Description

@uniqueg

Why?

The agreed permission model for the registry is:

  • anyone can browse;
  • any logged-in LS Login user can register a service and becomes its owner;
  • only the owner, or ECP_CLN:ADMIN, can change or delete it.

The current code (cloud_registry/ga4gh/registry/server.py) has no ownership model at all:

  • PUT /services/{id} and DELETE /services/{id} only require any valid token. Any logged-in user can overwrite or delete any entry.
  • POST /service-info, which sets the registry's own metadata, is equally open to any logged-in user.
  • The GA4GH spec file (cloud_registry/api/20201108.e0358db.openapi.yaml) declares a global security: bearerAuth, with disable_auth: False in config.yaml. The read endpoints (GET /services, /services/{id}, /services/types) therefore probably require a token as well, which contradicts public browsing. Verify against production with an unauthenticated curl.

This matters for M4.1 now: once real operators register their deployments (#63), any logged-in user could wipe the list. (An admin-set "verified" flag for proTES discovery is a separate, low-priority follow-up: #64.)

How?

  1. Make the read endpoints public by overriding security: [] on the GET operations, and keep writes authenticated.
  2. On POST /services / PUT (create), store the creator's sub (and display name/email from the token or userinfo, for the UI) as owner. Keep this in a registry-specific field or side collection rather than breaking the GA4GH Service schema. Expose it in GET responses, e.g., as an extension field, if strict response validation allows; otherwise via an additional endpoint.
  3. Allow PUT / DELETE on existing entries only for the owner or ECP_CLN:ADMIN (403 otherwise). Restrict POST /service-info to ECP_CLN:ADMIN.
  4. Admin role: membership in ECP_CLN:ADMIN, read from the LS Login entitlement claim. Take the exact entitlement string from a real admin's token or userinfo; don't guess the format.
  5. Migrate existing entries: they have no owner. Populate the Cloud Registry: owners register their own deployments, admins remove placeholder entries generic-issues#29 handles cleanup.
  6. Tests for every permission path. Update the docs.

Acceptance criteria

  • Unauthenticated GET on services and types works.
  • A logged-in user can create an entry and becomes its owner. Another non-admin user gets 403 on PUT / DELETE. ECP_CLN:ADMIN can modify anything.
  • Only ECP_CLN:ADMIN can post service-info.

Dependencies: none.


Part of the ELIXIR Compute Platform WP4 sprint (M&Ds due end of December 2026).
If you want to work on this issue:

  • Assign yourself (if someone is already assigned, ask them first or pick another one)
  • Move the issue to "In progress" on the project board
  • Start working 🚀

Activity

  1. added
    priority: high
    type: auth
    type: security
    workload: days
    ecp-wp4: M4.1
    on Oct 14, 2026
  2. moved this from Backlog to Ready in ELIXIR On-Cloudon Oct 14, 2026
  3. uniqueg commented on Oct 16, 2026

    @uniqueg
    MemberAuthor

    Ideally, addressing this should NOT require any code changes. Rather, it should make use of (Py)Casbin in the underlying FOCA archetype: https://github.com/elixir-cloud-aai/foca, as documented here: https://raw.githubusercontent.com/elixir-cloud-aai/foca/refs/heads/dev/docs/access_control/README.md.

    As such, the solution should consist of a draft PR that includes a minimally modified app configuration, along with the model file and any other necessary configuration files referenced in the modified app configuration parts. The configuration and generated files MUST be tested against the stated acceptance criteria in a test deployment that incorporates the proposed configuration.

    In addition to the above-stated acceptance criteria and behaviors, the solution must also support:

    • the ability for owners to manage the permission levels of other users on that service resource, by their unique user ID
    • setting an additional role "maintainer" for a given service resource, which allows PUT operations on the corresponding registered service resource, but NOT DELETE operations
  4. moved this from Ready to In progress in ELIXIR On-Cloudon Oct 17, 2026
  5. self-assigned this
    on Oct 17, 2026
  6. uniqueg commented on Oct 20, 2026

    @uniqueg
    MemberAuthor

    Update after a design review (2026-10-20). The implementation from #66 will be recreated as a new PR (its first commits are unsigned, which the dev ruleset doesn't allow) and extended. Changes and clarifications to the plan above:

    • Owners are not exposed in public GET responses (deviation from step 2). GET /services is public, so owners in it would publish users' LS Login IDs (and names/emails) to everyone, and an owners field would extend the GA4GH Service response, which we keep exactly as specified. Instead:
      • GET /me (authenticated) returns the caller's user ID, whether they are an admin, and their roles on services, so that the UI knows what the user may edit;
      • GET /services/{serviceId}/permissions (owners and admins) shows display names where known, stored from user info when a role is granted to the current user.
    • The admin group is not in the repository's default config. A default would apply to every deployment and couldn't be removed through config overlays (FOCA merges mappings key by key). Deployments map their admin group; for ELIXIR only the canonical LS Login form urn:geant:lifescience-ri.eu:group:elixir:ECP_CLN:ADMIN#aai.lifescience-ri.eu. The app refuses to start without an admin mapping unless custom.access_control.require_admin: false is set explicitly (also checked by the Helm chart).
    • Removing or downgrading the last owner of a service returns 409 (also for admins), so that services don't end up without owners by accident.
    • Token audience: verify_audience: False is removed from the default config, so deployments must set audience to the client IDs of the apps that call the registry (FOCA refuses to start otherwise). Otherwise, tokens issued for any LS Login app could be replayed against the registry.
    • POST /service-info (admins only): kept here, but the endpoint will be removed by feat!: serve service info from config only #100 (service info from config only).
    • Existing entries (step 5): the production deployment will be reinstalled with an empty database (see Populate the Cloud Registry: owners register their own deployments, admins remove placeholder entries generic-issues#29), so no entries without owners remain.
  7. moved this from In progress to Done in ELIXIR On-Cloudon Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ecp-wp4: M4.1priority: hightype: authtype: securityworkload: days

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions