禁止无效的 CSRF 令牌 +monit

禁止无效的 CSRF 令牌 +monit

我已经在 AWS ec2 上安装了 monit,它运行良好。但是当我尝试通过 monit UI 重新启动 nginx 服务时,我收到类似“Forbidden Invalid CSRF Token +monit”的错误。

我的配置

check process nginx with pidfile /var/run/nginx.pid
   start program = "/etc/init.d/mysql start"
   stop program = "/etc/init.d/mysql stop"

答案1

监控实施双重提交 cookie 模式为了防止 csrf 攻击,它会发送一个securitytoken随 post 请求一起调用的 cookie,但直到(至少)版本 1.20 都没有考虑到在上述 cookie 之前存在的其他 cookie。

除了升级到较新版本之外它应该被修复有一个简单的解决方法,只需使用浏览器删除其他 cookie 或制作securitytoken列表中的第一个 cookie。

相关内容