Socket map for check virtual users and virtual domains#281
Socket map for check virtual users and virtual domains#281maneeshaxyz merged 25 commits intoLSFLK:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new, dedicated socket map service to handle virtual user and domain existence checks for the Postfix SMTP server. This change significantly enhances the flexibility and dynamism of user validation by decoupling it from the Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new socketmap-server Go service to handle virtual user and domain lookups for Postfix, replacing the previous SQLite-based approach. The changes include the Go service itself, Docker integration via docker-compose.yaml, a Dockerfile for building the service, and extensive documentation and test scripts. While this is a significant and valuable feature, the review has identified several critical and high-severity issues. There is a critical race condition in the in-memory cache implementation in main.go that needs to be addressed with a mutex. Additionally, there are widespread inconsistencies between the implemented netstring protocol in the Go service and the plain-text protocol used in most of the test scripts and documentation, rendering them incorrect and non-functional. Other suggestions include improving the Dockerfile for security and reproducibility, and adding a healthcheck to the service in docker-compose.yaml.
f24fa1b to
e7859dd
Compare
278 bug secure the rspamd web UI dashboard (LSFLK#279) * fix: update Rspamd worker configuration to remove Prometheus metrics access * fix: update rspamd-server configuration to expose port 11332 without publishing feat: create socketmap for vitual-users, virtual-domains and virtual-aliases - Implemented a new Socketmap service in Go for dynamic user validation in Postfix. - Created Dockerfile for building and running the Socketmap service. - Added Docker Compose configuration for integrating Socketmap into the Silver mail server stack. - Developed comprehensive documentation including deployment guide, integration summary, and quick start reference. - Implemented caching mechanism for user lookups to improve performance. - Added automated and interactive testing scripts for validating service functionality. - Updated Postfix configuration scripts to utilize Socketmap for mailbox validation. - Established logging for monitoring service activity and troubleshooting. feat: enhance logging and troubleshooting for socketmap service feat: implement netstring protocol support for Postfix socketmap service fix: correct request format for Postfix socketmap protocol in documentation and tests chore: remove redundant documentations chore: remove outdated Socketmap architecture documentation Refactor socketmap service: Remove outdated documentation and scripts - Deleted LOGGING_UPDATE.md, NETSTRING_FIX.md, QUICKSTART.md, TROUBLESHOOTING.md, diagnostic.sh, interactive-test.sh, test-netstring.sh, and test.sh as they contained obsolete information and functionality. - Enhanced logging and netstring protocol support have been implemented in the main service code, making these documents redundant. - Updated service to ensure proper netstring encoding and decoding for socketmap requests. - Improved error handling and response logging for better debugging. remove Socketmap integration quick reference documentation feat: enhance socketmap service to support virtual domains and aliases
2070508 to
88063c8
Compare
… include additional status
…d log extraction for Sample App ID
…ilter parameters in API requests
- Introduced new types for Thunder API responses in `types.go`. - Implemented user validation logic in `user.go` to check if a user exists in Thunder IDP. - Refactored main application logic in `main.go` to utilize the new Thunder authentication and user validation functions. - Removed legacy code related to Thunder authentication and user validation. - Enhanced logging for better traceability during user and domain validation processes.
|
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new socketmap-server service written in Go to handle Postfix virtual domain and user lookups, replacing the previous SQLite-based mechanism. While the architectural change is sound and the Go code is clean, several critical security vulnerabilities were identified. These include hardcoded administrative credentials, potential Denial of Service via memory exhaustion, and multiple injection vulnerabilities (Filter Injection and Path Traversal) due to insufficient validation of untrusted input. Additionally, the socketmap-server container runs with excessive privileges (as root with the Docker socket mounted), and TLS verification is disabled for communication with the Thunder IDP, further increasing the attack surface. There is also a critical bug in the token refresh logic that will cause authentication to fail after the initial token expires. Addressing these issues is essential before deployment.
…r values to prevent injection attacks
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…nto a separate function
|
LGTM. |
📌 Description
This PR adds a socketmap service for Postfix to validate virtual users and domains against Thunder IDP, eliminating the need for local user and domain tables in the shared.db database. The service implements the Postfix socketmap protocol with netstring encoding for efficient TCP-based lookups.
🔍 Changes Made
dev.silver.openmail.lk→openmail.lk/silver/dev)✅ Checklist (Email System)
🧪 Testing Instructions
cd services/socketmap go run main.go