[問題] 關於GCP架設 Django網站被外部攻擊

作者: firstlovesky   2020-12-24 00:08:31
各位前輩們好,小弟在 GCP上有一台 group VM,但前陣子開始被不知名的國外 ip攻擊,
接著系統這邊會收到異常通知信,x.x.x.x是這台 gcp機器的對外 ip,而這台機器本身有
做 DNS。內部服務是使用 Docker。
想請問一下:
1) 上網查到的部分資訊:https://wemp.app/posts/5e044241-8cb6-42f1-bdeb-f414e060
1923
2) 這類的攻擊怎麼有辦法讓機器內部噴出 error?因為我測試過直接打 Django不存在的
url path,內部是會導向 404處理,對方是如何透過 request POST然後造成系統異常的
3) 處理方式: 我有先透過防火牆擋掉 IP,但是後續又有不同的 IP位置用一樣的方法去
攻擊這台VM,目前我只能一個一個把 IP加入防火牆規則,但有更好的解法去處理這類的攻
擊嗎?
錯誤通知信:
Internal Server Error: /mifs/.;/services/LogService
DisallowedHost at /mifs/.;/services/LogService
Invalid HTTP_HOST header: 'x.x.x.x':443'. You may need to add 'x.x.x.x' to ALL
OWED_HOSTS.
Request Method: POST
Request URL: https://x.x.x.x':443/mifs/.%3B/services/LogService
Django Version: 2.0.1
Python Executable: /usr/local/bin/uwsgi
Python Version: 3.5.9
Exception Type: DisallowedHost at /mifs/.;/services/LogService
Exception Value: Invalid HTTP_HOST header: 'x.x.x.x:443'. You may need to add
'x.x.x.x' to ALLOWED_HOSTS.
Request information:
USER: [unable to retrieve the current user]
感謝各位前輩們的指教!
作者: roccqqck (ccqq)   2020-12-24 09:00:00
cloudflaire
作者: firstlovesky   2020-12-24 19:18:00
謝謝r大的回覆,想請問一下,是從clouldflare設黑名單嗎?這樣跟從gcp上設定防火牆的差異是?
作者: TakiDog (多奇狗)   2020-12-25 09:39:00
應該都有掛一層Nginx吧,看path應該找WAF服務(?
作者: Falldog (Yo)   2020-12-30 01:21:00
你的DNS設定是單純的CNAME的話 為什麼會有多個ip一直可以連到你的Django server? 應該是其他internal service?

Links booklink

Contact Us: admin [ a t ] ucptt.com