Problem
Admin endpoints are accessible from any IP address. There is no network-level access restriction to limit exposure of admin operations.
Proposed Solution
Create backend/cntr/ip-whitelist.guard.ts — a NestJS CanActivate guard that reads ADMIN_IP_WHITELIST (comma-separated IPs) from the config, extracts the client IP from request.ip, and returns true only if the IP is in the list. If the env var is empty or unset, the guard allows all traffic (fail-open). All implementation must live inside backend/cntr/.
Acceptance Criteria
Problem
Admin endpoints are accessible from any IP address. There is no network-level access restriction to limit exposure of admin operations.
Proposed Solution
Create
backend/cntr/ip-whitelist.guard.ts— a NestJSCanActivateguard that readsADMIN_IP_WHITELIST(comma-separated IPs) from the config, extracts the client IP fromrequest.ip, and returnstrueonly if the IP is in the list. If the env var is empty or unset, the guard allows all traffic (fail-open). All implementation must live insidebackend/cntr/.Acceptance Criteria
backend/cntr/ip-whitelist.guard.tsADMIN_IP_WHITELIST(comma-separated string)ForbiddenExceptionfor non-whitelisted IPsbackend/cntr/ip-whitelist.guard.spec.tscovering: matching IP, non-matching IP, empty whitelist