Skip to content

Conversation

@smahima27
Copy link
Contributor

@smahima27 smahima27 commented Dec 24, 2025

Summary

Implements API security enhancements

  • Rate limiting middleware (Redis-backed)
  • Input validation for all critical endpoints
  • Protection against abuse and injection attacks

Changes

  • Rate Limiter: 100 req/min per IP, 500 req/min authenticated, 20/min VM creation, 50/min VM deletion
  • Input Validator: Hostname, pool name, tag, VM count, disk size, lifetime, JSON body validation
  • API Security: 6 critical endpoints secured with validation (POST /vm, POST /vm/:template, GET/PUT/DELETE /vm/:hostname, POST /vm/:hostname/disk/:size)

Testing

  • ✅ 27 unit tests for input validation (all passing)
  • ✅ Full integration test suite: 849 examples, 0 failures
  • ✅ Code coverage: 83.71%
  • ✅ All RuboCop offenses fixed

Jira

P4DEVOPS-9434

@smahima27 smahima27 requested a review from a team as a code owner December 24, 2025 12:14
@smahima27 smahima27 merged commit 76eb625 into main Dec 26, 2025
4 checks passed
@smahima27 smahima27 deleted the P4DEVOPS-9434 branch December 26, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants