mirror of
https://github.com/ADD-SP/ngx_waf.git
synced 2026-04-26 14:05:52 +03:00
[GH-ISSUE #98] 文件錯誤和建議 #210
Labels
No labels
MacOS
Nginx
OpenResty
Tengine
bug
documentation
enhancement
needs-investigation
pull-request
question
stale
stale
stale
timeout
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ngx_waf#210
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ADeeeee on GitHub (Jun 24, 2022).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/98
環境:
built with OpenSSL 1.1.1f 31 Mar 2020
TLS SNI support enabled
問題:
waf_cc_deny
waf_cache
兩項設定不支援寫在 http 的 context 裡面,執行
nginx -t就會顯示該錯誤可能是新版 nginx 有做修正,但需要標示在文件上
題外話:
如全域開啟 waf_modescurity 看是否註記建議寫在 http 的區塊,避免寫在 server 或 location 讓 nginx 重啟會重複讀取大量一樣的規則,導致服務關閉和開啟要等非常久,並會吃掉大量的記憶體
本身 waf 的部份應該同理,但經測試後,讀取上感覺不出來差異,或許是我規則太少的緣故
@ADD-SP commented on GitHub (Jun 27, 2022):
Current 版本的变化已经在文档中提示了,或许绿色不够显眼。
ngx_waf 应该不会重复读取 modsec 的规则,会自动从上级继承,而不是重新读取。
@ADeeeee commented on GitHub (Jun 28, 2022):
阿不好意思,這樣支援的部份是我沒看清楚文件
了解,我這邊會再測試一下 waf_modsecurity 上下級同時設定是否會重新讀取,感謝信心加持
@ADeeeee commented on GitHub (Jul 8, 2022):
不好意思我再重啟這個問題
用以下的條件來實測 nginx 是否會延遲讀取設定檔:
啟動設定:
結果:
單獨 http 啟用 WAF 和 modsecurity 設定,重複 10 次確認都差不多在 0.5s 左右:
http 和 server 啟用 WAF 設定,單獨 http 啟用 modsecurity 設定,重複 10 次確認都差不多在 1.3s 左右:
http 和 server 都啟用 WAF 和 modsecurity 設定,重複 10 次都在 1 分鐘左右:
這樣的結果看起來除了繼承 http 段之外,看起來都是 server 段會再重新讀取一次,才會有啟動時間上的差異?請再幫忙確認一下是否符合繼承上層不會重新讀取的概念
希望是不管怎麼寫都只要讀取一次就好,可以讓使用者有調整的彈性,並維持良好的效能
另外如 http 段有加上 WAF 啟動設定,而 server 只有加
waf bypass;而沒加上waf_rule_path,在 nginx 語法檢查上並不會出現錯誤,但 WAF 功能就會完全失效,這個可能要特別備註注意@stale[bot] commented on GitHub (Jul 21, 2022):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
此 issue 因为最近没有任何活动已经被标记,如果在此之后的一段时间内仍没有任何活动则会被关闭。感谢您对项目的支持。
@stale[bot] commented on GitHub (Jul 29, 2022):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
此 issue 因为最近没有任何活动已经被标记,如果在此之后的一段时间内仍没有任何活动则会被关闭。感谢您对项目的支持。
@stale[bot] commented on GitHub (Aug 10, 2022):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
此 issue 因为最近没有任何活动已经被标记,如果在此之后的一段时间内仍没有任何活动则会被关闭。感谢您对项目的支持。