我們有一個 Kubernetes 集群,我們在其中運行了一些財務軟體 - Strands。當我們試圖訪問我們前端的一個頁面時,來自前端的請求被發送到 Kubernetes pod,它應該處理這個請求。
pod 運行 Tomcat,我們看到請求被拒絕并顯示以下訊息:
2022-10-31T10:30:46,133 INFO [UserSessionFilter.java:153] : URI :/bfm-web/config/get.action
2022-10-31T10:30:46,133 INFO [UserSessionFilter.java:154] : Remote Host :10.240.0.103
2022-10-31T10:30:46,133 INFO [UserSessionFilter.java:155] : Remote Port :41898
2022-10-31T10:30:54,295 INFO [UserSessionFilter.java:152] : Request not allowed. Just return a 403 status
2022-10-31T10:30:54,296 INFO [UserSessionFilter.java:153] : URI :/bfm-web/config/get.action
2022-10-31T10:30:54,296 INFO [UserSessionFilter.java:154] : Remote Host :10.240.0.229
2022-10-31T10:30:54,296 INFO [UserSessionFilter.java:155] : Remote Port :57206
我不熟悉 Tomcat 或 Java,也不知道去哪里找。我試圖檢查 web.xml 檔案中的某些過濾器,但可以找到任何線索。這可能與某些 Kubernetes 授權設定有關嗎?
讓我知道我可以與您分享哪些資訊以提供幫助,這里有一些其他日志,并且后端使用 PostgreSQL 資料庫存盤用戶資料,但它似乎運作良好:
2022-10-27T11:16:20,751 INFO [{omitted_due_to_sec_reasons}HttpHeaderUserSessionFilter.java:71] : The header name [user.header.name] has been set to HTTP_STRANDS_USER
上面這個對我來說似乎很有趣,因為它似乎是一個自定義過濾器,它將過濾器設定為接受特定的標題(我故意省略了一些公司資訊)。有誰知道我在哪里可以找到這些過濾器?
10.240.0.103 - - [28/Oct/2022:14:02:33 0000] "GET /bfm-web/config/get.action HTTP/1.1" 403 707
10.240.0.103 - - [31/Oct/2022:10:12:01 0000] "GET /bfm-web/config/get.action HTTP/1.1" 403 743
10.240.0.103 - - [31/Oct/2022:10:24:31 0000] "GET /bfm-web/config/get.action HTTP/1.1" 403 743
10.240.0.103 - - [31/Oct/2022:10:24:36 0000] "GET /bfm-web/config/get.action HTTP/1.1" 403 743
10.240.0.103 - - [31/Oct/2022:10:30:46 0000] "GET /bfm-web/config/get.action HTTP/1.1" 403 743
10.240.0.229 - - [31/Oct/2022:10:30:54 0000] "GET /bfm-web/config/get.action HTTP/1.1" 403 743
和別的:
31-Oct-2022 10:12:01.856 INFO [http-nio-8080-exec-10] org.apache.catalina.core.ApplicationContext.log Request not allowed. Just return a 403 status. URI :: /bfm-web/config/get.action
31-Oct-2022 10:24:31.966 INFO [http-nio-8080-exec-2] org.apache.catalina.core.ApplicationContext.log Request not allowed. Just return a 403 status. URI :: /bfm-web/config/get.action
31-Oct-2022 10:24:36.951 INFO [http-nio-8080-exec-3] org.apache.catalina.core.ApplicationContext.log Request not allowed. Just return a 403 status. URI :: /bfm-web/config/get.action
31-Oct-2022 10:30:46.133 INFO [http-nio-8080-exec-5] org.apache.catalina.core.ApplicationContext.log Request not allowed. Just return a 403 status. URI :: /bfm-web/config/get.action
31-Oct-2022 10:30:54.297 INFO [http-nio-8080-exec-6] org.apache.catalina.core.ApplicationContext.log Request not allowed. Just return a 403 status. URI :: /bfm-web/config/get.action
uj5u.com熱心網友回復:
該問題與 Ingress NGINX 控制器上缺少“enable-underscores-in-headers: 'true'”有關。添加它并重新啟動 pod 起到了神奇的作用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/526162.html
