# argocd-rbac-cm
data:
policy.default: role:readonly
ArgoCD
Topics in this category
ArgoCD
RBAC
ArgoCD RBAC controls what authenticated users and groups can do within ArgoCD—viewing, syncing, creating, or deleting Applications, and managing clusters, repos, and projects. It's separate from Kubernetes RBAC (which governs cluster resource access) and is defined in the argocd-rbac-cm ConfigMap using policy rules and roles.
Real-world example
Developers get a role that can view and sync their team's apps but not delete clusters or edit other teams' apps.
Applications
Multi-cluster
RBAC
ArgoCD ships two built-in roles: role:admin (full access to everything) and role:readonly (view-only). You define custom roles in the RBAC policy for finer control. The policy.default sets the fallback role for users without a specific grant (often readonly or empty to deny).
policy.default: role:readonly
Real-world example
Unmapped users default to readonly, while a custom 'team-a' role grants sync rights on team-a apps only.
Applications
RBAC
Multi-cluster
Policy lines use a CSV-like format: `p, <subject>, <resource>, <action>, <object>, <effect>`. Resources include applications, clusters, repositories, projects, logs, exec. Actions include get, create, update, delete, sync, override. Objects scope by project/app (e.g., proj/app) and support wildcards. `g` lines map users/groups to roles.
p, role:dev, applications, sync, team-a/*, allow
p, role:dev, applications, get, team-a/*, allow
g, team-a-group, role:dev
Real-world example
The dev role can get and sync any application in the team-a project, and the SSO group team-a-group is bound to it.
Applications
Multi-cluster
RBAC
Use the object field as project/application with wildcards, e.g., `team-a/*` grants a role over all apps in the team-a project. Because AppProjects group apps and constrain destinations/sources, scoping RBAC by project gives clean multi-tenant boundaries—each team manages only its project's apps.
p, role:team-a, applications, *, team-a/*, allow
Real-world example
Team A's role has full application actions but only within the team-a project, isolating them from other teams.
Applications
Multi-cluster
RBAC
ArgoCD supports SSO via OIDC (directly or through its bundled Dex connector for LDAP, SAML, GitHub, etc.). Users log in with their identity provider; group claims from the token are mapped to ArgoCD roles in the RBAC policy via `g, <group>, <role>` lines, centralizing access control with corporate identity.
g, "my-org:platform-team", role:admin
g, "my-org:developers", role:dev
Real-world example
Engineers log in with corporate SSO, and their IdP group memberships automatically grant the right ArgoCD roles.
RBAC
Multi-cluster
Applications
AppProjects enforce what can be deployed (allowed repos, destinations, resource kinds) while RBAC enforces who can act on which project's apps. Together they isolate tenants: a team's role is scoped to its project, and the project restricts that team's apps to approved repos, clusters, and namespaces—limiting both authority and blast radius.
# Project restricts destinations; RBAC restricts who can sync them
p, role:team-a, applications, sync, team-a/*, allow
Real-world example
Team A can only sync apps in its project, and that project can only deploy to team-a namespaces on approved clusters.
Applications
Multi-cluster
RBAC
List only the allowed actions in policy lines, omitting others (default deny). For example allow get and sync but not delete or override. Because ArgoCD RBAC is deny-by-default, granting sync without a delete rule means the user can trigger syncs but cannot delete the application.
p, role:operator, applications, get, '*/*', allow
p, role:operator, applications, sync, '*/*', allow
# no delete rule -> delete denied
Real-world example
On-call operators can sync any app to recover from drift but cannot delete apps, limiting accidental damage.
Applications
Sync & Health
RBAC
The exec resource controls whether a user can open a shell into a running pod via ArgoCD's terminal feature. It's powerful (equivalent to kubectl exec) and can bypass other controls, so it's disabled by default and granted narrowly. Enabling it requires both the feature flag and an explicit RBAC allow.
p, role:admin, exec, create, '*/*', allow
Real-world example
Only senior SREs get exec permission for emergency debugging, and it's off by default for everyone else.
RBAC
Applications
Multi-cluster
Beyond user SSO, ArgoCD supports local accounts and AppProject roles with scoped JWT tokens for automation. A project role defines allowed actions on that project's apps, and you issue a token bound to it for CI to sync apps—least privilege for pipelines without granting a human-level or admin account.
# AppProject role for CI
roles:
- name: ci-deployer
policies:
- p, proj:team-a:ci-deployer, applications, sync, team-a/*, allow
Real-world example
The CI pipeline uses a project-scoped token that can only sync team-a apps, never touching other projects.
Applications
Multi-cluster
RBAC
RBAC policy lives in the argocd-rbac-cm ConfigMap, with keys policy.csv (the rules), policy.default (fallback role), and scopes (which token claims to use for group mapping). Changes take effect without restart. Managing it declaratively (in Git) keeps access control itself under GitOps.
data:
policy.default: role:readonly
policy.csv: |
g, my-team, role:admin
Real-world example
Access control changes go through a PR to the argocd-rbac-cm manifest, so permissions are reviewed and versioned.
RBAC
GitOps Principles
Applications