Skip to content

Applications should ask only for their node Traefik routes #8354

Open

Description

@DavidePrincipi

Some applications ask for permission to manage the web routes of every Traefik instance in the cluster (traefik@any:routeadm), but they only ever change the routes of the Traefik instance running on their own node. The narrower permission traefik@node:routeadm is enough for them.

Asking for less access follows the principle of least privilege, and the Software Center app info (#8321) will show a smaller, more accurate list of permissions.

Applications to change

Application Current label org.nethserver.authorizations
ns8-dokuwiki traefik@any:routeadm cluster:accountconsumer
ns8-grafana traefik@any:routeadm
ns8-metrics traefik@any:routeadm
ns8-prometheus traefik@any:routeadm
ns8-nethsecurity-controller traefik@any:routeadm node:tunadm,portsadm
ns8-nextcloud traefik@any:routeadm cluster:accountconsumer
ns8-rustfs traefik@any:routeadm

All of them reach Traefik either with agent.resolve_agent_id('traefik@node') or with the core helpers agent.set_route() / agent.get_route() without an explicit agent_id, which also target the node's Traefik instance.

The example in the core developer manual (docs/modules/images.md) uses traefik@any:routeadm too, so new applications tend to copy it: change it to traefik@node:routeadm.

Blocked by #8329

When an application is updated, roles that are no longer requested are not revoked (#8329). Until that is fixed, installed applications keep the broad traefik@any grant after the update, and only new installations get the narrower one. The application changes do not break anything in the meantime, so each fix can be released with the next regular update of its application, with no hurry.

Testing

For each application, after the update to the fixed version (and with #8329 fixed):

  • redis-cli hgetall roles/module/<module_id> lists only traefik<N> (the Traefik of the application node) with role routeadm, not every Traefik instance in the cluster.
  • Configure the application with a host name or path: the HTTP route is created and the application is reachable.
  • Remove the application: its HTTP routes are removed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

  • Status
    In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions