Add PASV Same-IP Check feature for enhanced security#111
Open
rhykw wants to merge 5 commits intopyama86:masterfrom
Open
Add PASV Same-IP Check feature for enhanced security#111rhykw wants to merge 5 commits intopyama86:masterfrom
rhykw wants to merge 5 commits intopyama86:masterfrom
Conversation
Add new configuration option to enable PASV same-IP validation: - Add EnforceSameIPCheck boolean field to config struct - Set default value to false to maintain backward compatibility - Add WithEnforceSameIPCheck() ConfigOption function - TOML configuration name: enforce_same_ip_check
Add validation logic to reject PASV data connections from different IPs: - Modify clientListenOrDial() to check client IP against control connection IP - Implement loop to handle multiple connection attempts - Only allow connections when EnforceSameIPCheck is enabled - Log validation results for debugging - Maintain vsftpd pasv_promiscuous=NO equivalent behavior
Add configuration example for enforce_same_ip_check option: - Add documentation comment explaining the feature - Set default value to false - Place configuration near related ignore_passive_ip setting
Add test cases to verify EnforceSameIPCheck functionality: - Test with enforce_same_ip_check enabled - Test combination with IgnorePassiveIP setting - Ensure configuration compatibility with existing features
Fix field alignment in config struct
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.
概要
PASVモードでのデータ接続において、コントロール接続と同じIPアドレスからの接続のみを許可するセキュリティ機能を追加。
変更内容
EnforceSameIPCheck設定オプションを追加pasv_promiscuous=NOと同等の動作設定方法
セキュリティ
この機能により、第三者による不正なデータ接続攻撃(FTP bounce attack等)を防ぐことができる。
後方互換性
デフォルト値は false に設定されており、既存の動作に影響しないはず。。。