Security ip allowlist checks review - #172
Merged
greatest0fallt1me merged 3 commits intoMar 27, 2026
Merged
Conversation
added 3 commits
March 26, 2026 14:47
- Add Zod dependency for schema validation - Create reusable validation middleware in src/middleware/validate.ts - Support for body, query, and params validation - Consistent 400 error responses with detailed field-level errors - Apply validation to developer revenue endpoint (limit/offset query params) - Apply validation to gateway routes (apiId parameter) - Add comprehensive test suite for validation middleware - Include both basic and detailed validation error formats Closes CalloraOrg#5
Add comprehensive resilience tests for proxy integration including: - Connection reset handling and recovery - Slow upstream timeout scenarios - Sensitive header leakage prevention - Case-insensitive header stripping - Response header filtering - Request ID correlation through errors Security improvements: - Verify API keys, auth tokens, and cookies are stripped upstream - Ensure IP address headers are not leaked - Validate proper hop-by-hop header filtering Documentation: - Add comprehensive forwarded header policy (FORWARDED_HEADER_POLICY.md) - Document security measures and data integrity notes Closes CalloraOrg#147
Implement comprehensive IP allowlist security for admin and gateway endpoints. - Add IP allowlist middleware with IPv4/IPv6 CIDR support - Implement spoofing-resistant proxy header handling - Protect admin (/api/admin/*) and gateway (/api/gateway/*) endpoints - Add comprehensive unit and integration tests (70 test cases) - Document trusted proxy headers configuration - Maintain full backward compatibility - Add security logging and audit trail Addresses issue CalloraOrg#152: Security: IP allowlist checks review Security improvements: - Network-level access control for sensitive endpoints - Robust proxy header validation with priority ordering - IPv6 deployment support with boundary testing - Comprehensive security event logging - Environment-based configuration management
|
@olaleyeolajide81-sketch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#152 Security: IP allowlist checks review (ip-range-check usage audit)
Repo Avatar
CalloraOrg/Callora-Backend
Description
Audit any IP range usage for admin/gateway endpoints; add tests for boundary CIDRs and spoofing-resistant behavior behind proxies.
Requirements and context
Document trusted proxy headers configuration.
Avoid breaking IPv6 deployments.
Suggested execution
Fork the repo and create a branch: git checkout -b chore/ip-allowlist-audit
Work in Callora-Backend (TypeScript / Express).
Primary paths
src/types/ip-range-check.d.ts + call sites (search repo)
Run npm run lint, npm run typecheck, and npm test.
Deliverables
Tests + documentation in PR description.
Test and commit
Add or extend unit and/or integration tests (src//*.test.ts, tests/integration/).
Paste summarized test output in the PR; call out security or data-integrity notes.
Example commit message
chore(security): audit ip allowlist usage
Guidelines
Tests should cover new behavior and important edge cases.
Keep changes focused; follow existing patterns in the codebase.
Timeframe: 96 hours from assignment unless agreed otherwise.
closes #152