Skip to content

Security ip allowlist checks review - #172

Merged
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
olaleyeolajide81-sketch:Security-IP-allowlist-checks-review
Mar 27, 2026
Merged

Security ip allowlist checks review#172
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
olaleyeolajide81-sketch:Security-IP-allowlist-checks-review

Conversation

@olaleyeolajide81-sketch

Copy link
Copy Markdown

#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

Gas Optimization Bot 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
@drips-wave

drips-wave Bot commented Mar 26, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@greatest0fallt1me
greatest0fallt1me merged commit 32eaed4 into CalloraOrg:main Mar 27, 2026
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.

Security: IP allowlist checks review (ip-range-check usage audit)

2 participants