You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Application update does not revoke old roles #8329
When an application is updated, update-module grants the roles requested by the new image, but it never removes the roles that are no longer requested.
The roles of a module are stored in the roles/module/<module_id> Redis hash, one field per target agent. update-module replaces the cluster/authorizations/module/<module_id> set with the new label, then calls add_module_permissions(), which only adds or overwrites fields. A target removed from the label keeps its old role. If the new image has no org.nethserver.authorizations label at all, the if authorizations: block is skipped and nothing changes.
Steps to reproduce
Install an application whose image has org.nethserver.authorizations=node:fwadm traefik@node:routeadm.
Update it to a version whose label is only traefik@node:routeadm.
redis-cli hgetall roles/module/<module_id> still lists node/1 fwadm.
Expected behavior
After an update, the roles granted to an application match exactly the label of the installed image, plus self:selfadm. Targets that are no longer requested are revoked. An empty label revokes everything except selfadm.
Notes
This is also needed to compare old and new permissions before an update (see the follow-up issue about approving new permissions).
Activity