Code Monkey home page Code Monkey logo

Comments (14)

Lorna0 avatar Lorna0 commented on September 26, 2024 1

6.1 版本支持通过下面的命令禁用 sl-session:

docker exec safeline-mgt /app/mgt-cli toggle-sl-session

注意:

  1. 禁用 sl-session 会导致 “数据统计” 的 PV/UV (“页面浏览”/“独立访客”) 失效
  2. 如果需要重启启用,再次执行命令即可
  3. 因为该命令的使用概率低,不能保证每次发版都测试。禁用后请注意升级前备份和测试,避免影响业务。如有问题麻烦再次向我们反馈

@sollyu
师傅试一下吧。另外最好还是尽快修复网站处理不了 cookie 的问题。

from safeline.

Lorna0 avatar Lorna0 commented on September 26, 2024

是开源的 app 么,可以分享下 因返回 set-cookie 导致程序不能运行 的技术细节么,看看能不能直接解决。

一般来说 cookie 里面就是各种网站一通 set,各用各的,所以我们之前没考虑过可选配置。

from safeline.

Lorna0 avatar Lorna0 commented on September 26, 2024

如果是第一次用 waf 出现这种情况,也有蛮大概率并不是 set-cookie 导致的,而是别的什么地方出的问题

from safeline.

sollyu avatar sollyu commented on September 26, 2024

回复第一条
闭源安卓软件,主要原因软件里使用的网络框架的okhttp(默认支持set-cookie)安卓在做生产包时回开启代码混淆+无用代码移除,因为没有用到cookie所以就没测试出cookie的问题,现在的问题表象是解析cookie时错误的解析成了map,实际是string。混淆导致,非okhttp问题(可以理解把生产包把okhttp的setCookie给删除或者破坏了)

回复第二条:
使用抓包工具测试了,使用waf和不使用waf的网络返回的内容就set-cookie这个差异,并且安卓开发也追踪了相关的错误,证明确实是set-cookie导致,目前的临时方案是暂时不用WAF。

from safeline.

zclaiqcc avatar zclaiqcc commented on September 26, 2024

回复第一条 闭源安卓软件,主要原因软件里使用的网络框架的okhttp(默认支持set-cookie)安卓在做生产包时回开启代码混淆+无用代码移除,因为没有用到cookie所以就没测试出cookie的问题,现在的问题表象是解析cookie时错误的解析成了map,实际是string。混淆导致,非okhttp问题(可以理解把生产包把okhttp的setCookie给删除或者破坏了)

回复第二条: 使用抓包工具测试了,使用waf和不使用waf的网络返回的内容就set-cookie这个差异,并且安卓开发也追踪了相关的错误,证明确实是set-cookie导致,目前的临时方案是暂时不用WAF。

试试 NGINX conf 把 Header 移除试试?

proxy_hide_header set-cookie;
proxy_hide_header Cookie;

https://stackoverflow.com/questions/67548886/remove-specific-cookie-in-nginx-reverse-proxy
https://serverfault.com/questions/928912/how-do-i-remove-a-server-added-header-from-proxied-location

自定义站点 nginx conf

from safeline.

zclaiqcc avatar zclaiqcc commented on September 26, 2024

回复第一条 闭源安卓软件,主要原因软件里使用的网络框架的okhttp(默认支持set-cookie)安卓在做生产包时回开启代码混淆+无用代码移除,因为没有用到cookie所以就没测试出cookie的问题,现在的问题表象是解析cookie时错误的解析成了map,实际是string。混淆导致,非okhttp问题(可以理解把生产包把okhttp的setCookie给删除或者破坏了)
回复第二条: 使用抓包工具测试了,使用waf和不使用waf的网络返回的内容就set-cookie这个差异,并且安卓开发也追踪了相关的错误,证明确实是set-cookie导致,目前的临时方案是暂时不用WAF。

试试 NGINX conf 把 Header 移除试试?

proxy_hide_header set-cookie; proxy_hide_header Cookie;

https://stackoverflow.com/questions/67548886/remove-specific-cookie-in-nginx-reverse-proxy https://serverfault.com/questions/928912/how-do-i-remove-a-server-added-header-from-proxied-location

自定义站点 nginx conf

测了下好像不行。WAF 前面还有 NGINX 么?如果有的话在前面的 NGINX 上移除一下试试

from safeline.

sollyu avatar sollyu commented on September 26, 2024

测试,无用。
配置如下:IF_backend_1

    location ^~ / {
       ....
        proxy_hide_header set-cookie;
        proxy_hide_header Cookie;
        ....
    }

并且直接重启了safeline-tengine容器,以然返回带有cookie的内容。

在提issue前,已经搜索并测试了百度、bing、谷歌前三页ngingx 移除header相关的方法。

回复最新:没了,现在WAF为第一入口

from safeline.

sollyu avatar sollyu commented on September 26, 2024

@Lorna0 老哥,上班了不,还有救吗?

from safeline.

Lorna0 avatar Lorna0 commented on September 26, 2024

@sollyu 这个 cookie 是用来统计 PV/UV 的,如果去掉了相关统计会不正常。我们讨论一下,看下能不能开个口子。

from safeline.

sollyu avatar sollyu commented on September 26, 2024

好的,非常感谢🙏

from safeline.

sollyu avatar sollyu commented on September 26, 2024

可不可以只让/api的API关闭set-cookie,这样即使不正常,也就这个API部分不正常

from safeline.

sollyu avatar sollyu commented on September 26, 2024

收到,马上测试,另外问一下,是不是用了这个命令,整个WAF都会禁用“数据统计”,看参数好像并没有指定哪个Host来禁用。

from safeline.

xbingW avatar xbingW commented on September 26, 2024

这个不会禁用数据统计,只是因为没有 sl-session 有些统计会无法工作,比如 pv/uv

from safeline.

sollyu avatar sollyu commented on September 26, 2024

已测试,生效,老版本运行运行OK,感谢支持。

from safeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.