Only Admins May Create ApplicationSets
ApplicationSets are privileged resources that should only be managed by cluster administrators.Why Admin-Only Access?
ApplicationSets have significant privileges:-
Arbitrary Project Access
- ApplicationSets can create Applications under any Project
- Many Argo CD setups include Projects (like
default) with high permissions - These Projects often have permissions to manage Argo CD’s own resources (RBAC ConfigMap, Secrets, etc.)
-
Rapid Resource Creation/Deletion
- ApplicationSets can quickly create an arbitrary number of Applications
- They can delete them just as quickly
- This could overwhelm clusters or disrupt services
-
Secret Access
- Some generators (like Git generator) can read Secrets in the Argo CD namespace
- These Secrets could be sent to arbitrary URLs as auth headers
- Example: Using the
apifield to send credentials to attacker-controlled endpoints
Recommendation: Use Kubernetes RBAC to restrict ApplicationSet create/update/delete permissions to admin users only.
RBAC Configuration Example
Control ApplicationSet Sources of Truth
Even if non-admins cannot create ApplicationSet resources, they may still affect ApplicationSet behavior through generator sources.Git Generator Risks
Potential Attacks
Excessive Application Creation:- Strain the ApplicationSet controller
- Strain the Application controller
- Trigger SCM provider rate limiting
- Degrade service for legitimate Applications
- Creating Applications that consume excessive cluster resources
- Deploying resource-intensive workloads to multiple clusters simultaneously
Mitigation Strategies
Restrict Git Repository Access
Restrict Git Repository Access
- Limit push access to the source Git repository
- Require pull request reviews for changes
- Use branch protection rules
- Implement approval workflows
Use Resource Quotas
Use Resource Quotas
Set limits in Argo CD AppProjects:
Monitor ApplicationSet Activity
Monitor ApplicationSet Activity
- Set up alerts for unusual Application creation patterns
- Monitor for rapid increases in Application count
- Track resource consumption by Applications
Validate Configuration Files
Validate Configuration Files
Use CI/CD to validate config files before merge:
Templated Project Field
Theproject field deserves special attention when templated.
The Risk
Example vulnerable ApplicationSet:- Create an Application in the
defaultProject (which may have admin permissions) - Deploy to the
argocdnamespace - Modify Argo CD’s RBAC ConfigMap
- Escalate privileges
Secure Pattern
Safe ApplicationSet with hard-coded project:
Requirements for Templated Projects
For Git generators:- PRs must require admin approval
- Implement mandatory code review
- Use branch protection
- Consider using CODEOWNERS files
Repository Credentials for ApplicationSets
Configuring Non-Scoped Repositories
Via UI:- Navigate to Settings → Repositories
- Add repository
- Set Project field to blank in the dropdown
Why Non-Scoped?
Project-scoped repositories restrict which Projects can use them. If the ApplicationSet’sproject field is templated, the ApplicationSet doesn’t know in advance which Projects will be used, so it needs access to a non-scoped repository.
Git Generator Specific Concerns
No Signature Verification
This means:- Cannot verify commit signatures
- Cannot guarantee commits are from trusted sources
- Must rely on Git provider access controls
- Use GitHub/GitLab branch protection with required reviews
- Enable signed commits at the repository level
- Monitor for unexpected changes
- Use audit logs to track who made changes
SCM Provider Authentication
The Git generator can use Secrets for SCM provider authentication:- Restrict ApplicationSet create/update to admins only
- Use Secret scanning tools
- Audit ApplicationSet resources regularly
Best Practices
Principle of Least Privilege
- Only admins can manage ApplicationSets
- Hard-code sensitive fields (project, cluster, namespace)
- Scope generators to specific paths or labels
- Use restricted AppProjects
Git Access Control
- Require PR reviews for generator sources
- Use branch protection rules
- Implement CODEOWNERS
- Enable audit logging
Monitoring & Alerting
- Alert on rapid Application creation
- Monitor resource consumption
- Track ApplicationSet changes
- Review audit logs regularly
Resource Limits
- Set AppProject resource quotas
- Limit Applications per ApplicationSet
- Use namespace ResourceQuotas
- Implement rate limiting
Security Checklist
Before deploying ApplicationSets in production:RBAC Configuration
- ApplicationSet create/update/delete restricted to admins
- Kubernetes RBAC rules in place
- Argo CD RBAC configured appropriately
ApplicationSet Review
- Project field hard-coded (or admin-controlled source)
- Destination cluster hard-coded or restricted
- Destination namespace hard-coded or restricted
- Generator sources controlled by admins
Git Repository Security
- Branch protection enabled
- Required reviews configured
- CODEOWNERS file in place
- Audit logging enabled
AppProject Configuration
- Resource quotas set
- Destination restrictions configured
- Source repositories restricted
- Cluster resource deny list configured
Example Secure Configuration
Here’s a complete example of a secure self-service ApplicationSet:Next Steps
Overview
Learn more about ApplicationSet fundamentals and capabilities