Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow project namespaceResourceWhitelist on selected namespaces #20663

Open
andrewkaczynski opened this issue Nov 5, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@andrewkaczynski
Copy link

andrewkaczynski commented Nov 5, 2024

Summary

The Argo CD Project permissions "namespaceResourceWhitelist" affects all the possible namespaces allowed in the project destination. We want to narrow down the scope to selected namespaces only if specified.

Motivation

We have different teams, and for each, we configure similarly to the below Projects:

kind: AppProject
metadata:
  name: team-a
  namespace: argocd
spec:
  description: Team A Project
  sourceRepos:
  - '*'

  destinations:
  - namespace: !{kube-system,kube-public,kube-node-lease,velero}
    server: https://cluster-a.example.com:6443
    name: cluster-a
  - namespace: !{kube-system,kube-public,kube-node-lease,velero}
    server: https://cluster-b.example.com:6443
    name: cluster-b

Where certain namespaces are considered system ones by us and we don't want to give access to them to our teams. However, we want to allow them to configure single objects on them like CRDs to allow consume the services running on them.

Proposal

The proposal would be to extend the existing namespaceResourceWhitelist permission option to allow listed objects to be created in selected namespaces if specified. Example:

# Deny all namespaced-scoped resources in namespace velero from being created, except for Backup and BackupStorageLocation.
  namespaceResourceWhitelist:
  - group: 'velero.io'
    kind: Backup
    namespace: velero
  - group: 'velero.io'
    kind: BackupStorageLocation
    namespace: velero

That would require a change in the Argo CD Projects permissions engine. If a namespace is not listed, it should follow existing rules and apply to all allowed namespaces.
If the namespace is listed under namespaceResourceWhitelist but blacklisted In the destination namespace, the one in namespaceResourceWhitelist should have precedence and allow selected objects to be created.

@andrewkaczynski andrewkaczynski added the enhancement New feature or request label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant