ptt / pttbbs

PTT BBS source code
GNU General Public License v2.0
1.1k stars 138 forks source link

Rate Limit #56

Open HenryChoutw opened 5 years ago

HenryChoutw commented 5 years ago

這個其實不是bug, 也不是ptt問題. 只是突然想到的, 但是不知道去那建議, 就當異想天開好了. 看到ptt網頁版有人提到太多跳板IP張貼特定文章, 尤其某些立場很明顯的Id. 想到的方法是或許ptt可以考慮實作類似Rate Limit或IP Throttling的機制. 條件是跳版範圍越大, 跳板次數太多, 延長其張貼文章的間隔時間. 例如說, 某位使用者IP的國家登入範圍包括

英國, 法國, 德國, 美國, ..., 日本

張貼文章次數的頻率超過某個treshold, 或是採兩者混合統計(或類似可以加入當作機制設定的因素).

則該使用者每次張貼文章的時間間隔呈採Exponential backoff計算.

wens commented 5 years ago

It is possible to for the system to look at past login IPs to try to discern a pattern for each user, as they log on. By country sounds like a good idea. Going deeper you would need to define a proper "distance" for IPs, which is really hard to do. It might make sense to check if a user stays within clusters of IPs, but cellphones make this non-trivial.

Also, throttling by IPs hurts people behind NATs.

系統可以在使用者登入的時候,試圖分析使用者目前以及過去登入的 IP 看是不是有規律。依照國家是個不錯的方式。如果要更細微就必須先定義什麼叫做 IP 範圍很大,這其實不太容易。或許可以看使用者是不是固定從某些IP群登入,但是手機會讓這很難做。

此外,根據 IP 去限制流量、登入、或發文,其實對 NAT 後面的使用者相當不友善。