NamespaceManagement cleanup can delete RBAC in unrelated namespaces

未关闭
#1,557 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@Rizwana777 已经在做这个了。

开始于 2026年11月16日。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
22/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
go, kubernetes
领域
devops, security

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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)

主要语言
Go
星标
190
派生
367
平均合并
4 天 2 小时
30 天内合并 PR
63

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

redhat-developer/gitops-operator 的其他 Issue

查看 redhat-developer/gitops-operator 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。