NamespaceManagement cleanup can delete RBAC in unrelated namespaces

Ouverte
#1,557 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@Rizwana777 y travaille déjà.

Depuis le 16/11/2026.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
22/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
go, kubernetes
Domaine
devops, security

Piste de recherche

Start in argocd-operator/controllers/argocd/util.go around lines 1999-2015, where cleanupRBACsForNamespaceManagement is called from handleArgoCDNamespaceManagementUpdate, then read deleteRBACsForNamespace. Confirm the Roles and RoleBindings deleted there are not filtered by owning instance. Done means deletion is limited to grants owned by the originating ArgoCD, with regression tests for unrelated namespaces both with and without the feature flag.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

kind/bug

A user who can create and update an ArgoCD CR in their own namespace can cause the operator to delete Argo CD Roles and RoleBindings in another namespace, without permission or consent from that namespace. This also occurs when ALLOW_NAMESPACE_MANAGEMENT_IN_NAMESPACE_SCOPED_INSTANCES=false.

Reproduction

With a cluster-wide operator installation and existing Argo CD RBAC in namespace victim:

  1. Create an ArgoCD CR in an unrelated namespace, tenant.
  2. Set its .spec.namespaceManagement to [{name: victim, allowManagedBy: true}].
  3. Remove that entry from the CR.

No NamespaceManagement CR or managed-by label authorizing the tenant instance is required in victim.

Actual behavior

The update predicate calls handleArgoCDNamespaceManagementUpdate, which passes the removed namespace to cleanupRBACsForNamespaceManagement. The cleanup deletes Roles and RoleBindings labeled app.kubernetes.io/part-of=argocd in victim, regardless of which instance owns them. Repeated updates can disrupt other Argo CD instances.

Relevant code: argocd-operator/controllers/argocd/util.go, particularly lines 1999–2015 and deleteRBACsForNamespace.

Expected behavior

Cleanup should delete only grants owned by the originating ArgoCD instance. Merely naming a namespace in the CR must not authorize deletion there. Add regression coverage for unrelated namespaces with the feature enabled and disabled, while preserving legitimate grant cleanup.

Confirmed at commit 5fb7a030 using an isolated fake-client reproduction through the update predicate; no live-cluster exploit was run.

(Bug text c/o OpenAI Codex v6.1 Sol xhigh)

Langage dominant
Go
Étoiles
190
Forks
367
Merge moyen
4 j 2 h
PR mergées (30 j)
63

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de redhat-developer/gitops-operator

Toutes les issues de redhat-developer/gitops-operator

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.