Details
Affected Deployment Scenarios
- Manager API exposed on the public internet or untrusted networks
- Malicious users or compromised systems in internal networks
- Tenant isolation failures in multi-tenant environments
Remediation
Recommended Fix
Add authentication and authorization middleware to the Job API in the manager/router/router.go file:
// Before Fix (lines 204-211)
job := apiv1.Group("/jobs")
job.POST("", middlewares.CreateJobRateLimiter(limiter), h.CreateJob)
job.DELETE(":id", h.DestroyJob)
job.PATCH(":id", h.UpdateJob)
job.GET(":id", h.GetJob)
job.GET("", h.GetJobs)
// After Fix
job := apiv1.Group("/jobs", jwt.MiddlewareFunc(), rbac)
job.POST("", middlewares.CreateJobRateLimiter(limiter), h.CreateJob)
job.DELETE(":id", h.DestroyJob)
job.PATCH(":id", h.UpdateJob)
job.GET(":id", h.GetJob)
job.GET("", h.GetJobs)
Temporary Mitigation
Before the fix is released, the following mitigation measures can be taken:
- Network Isolation: Restrict network access to the Manager API
- Use firewall rules to limit source IPs
- Only allow trusted internal networks to access
- Use Kubernetes NetworkPolicy to restrict Pod-to-Pod communication
- API Gateway: Deploy an API gateway in front of Manager for authentication
- Use reverse proxies like Nginx/Kong/Traefik
- Configure OAuth2/JWT validation
- Monitoring and Alerting: Monitor abnormal access patterns to Job API
- Log all Job API calls
- Set up alerts for abnormal job creation/deletion
Verify Fix
After the fix, all unauthenticated requests should return 401 Unauthorized:
curl -s -X GET http://localhost:8080/api/v1/jobs
Expected Output:
{
"message": "Unauthorized"
}
Appendix: Complete Verification Logs
Deployment Verification Logs
$ kubectl -n dragonfly-system get pods
NAME READY STATUS RESTARTS AGE
dragonfly-manager-5cc788d64b-grpbk 1/1 Running 0 5m
dragonfly-mysql-0 1/1 Running 0 5m
dragonfly-redis-master-0 1/1 Running 0 5m
dragonfly-redis-replicas-0 1/1 Running 0 5m
dragonfly-scheduler-0 1/1 Running 0 5m
dragonfly-seed-client-0 1/1 Running 0 5m
$ kubectl -n dragonfly-system get svc dragonfly-manager
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
dragonfly-manager ClusterIP 10.96.240.126 <none> 8080/TCP,65003/TCP 5m
POC Execution Complete Logs
See poc_output.log file for details.
==========================================
VUL-001: Job API Unauthenticated Access POC
==========================================
[Test 1] GET /api/v1/jobs (No Authentication)
HTTP Status: 200
Response: []
✅ VULNERABLE: Endpoint accessible without authentication
[Test 2] POST /api/v1/jobs (No Authentication)
HTTP Status: 200
Job ID: 2
✅ VULNERABLE: Job created without authentication
[Test 3] GET /api/v1/jobs/2 (No Authentication)
HTTP Status: 200
✅ VULNERABLE: Job details accessible without authentication
[Test 4] PATCH /api/v1/jobs/2 (No Authentication)
HTTP Status: 200
✅ VULNERABLE: Job updated without authentication
[Test 5] DELETE /api/v1/jobs/2 (No Authentication)
HTTP Status: 200
✅ VULNERABLE: Job deleted without authentication
[Test 6] GET /api/v1/clusters (Should Require Authentication)
HTTP Status: 401
Response: {"message":"Unauthorized"}
✅ EXPECTED: Endpoint correctly requires authentication
==========================================
POC Execution Complete
==========================================
---
Patches
- Dragonfy v2.4.1 and above.
Workarounds
There are no effective workarounds, beyond upgrading.