gpt4 book ai didi

wordpress - 在带有可见 API key 的 WP Super Cache 中使用 Wordpress 中的单个 Cloudflare 帐户

转载 作者:行者123 更新时间:2023-12-04 19:25:20 28 4
gpt4 key购买 nike

我们开始在一些 Wordpress 客户帐户上使用 Cloudflare,并注意到在 CDN 设置中我的电子邮件地址和 API key 对客户可见。

这是其他人可以看到我的 Cloudlflare 电子邮件地址和 API key 的潜在安全问题吗?我应该为每个客户帐户使用 1 个 Cloudflare 帐户吗?

这是一个屏幕截图(我模糊了 API key 并删除了控制台中的电子邮件输入框),但客户可以看到这两个值。

dpr

他们可以用这 2 条数据做的最糟糕的事情是什么?

最佳答案

您必须使用 token 而不是全局 api key 。你只对某些区域严格 token

enter image description here

这只不会解决问题,您必须手动修改 wp 最快的缓存插件来修改请求以匹配 API token 的使用。
请求可以在 inc\cdn.php 中找到

修改后的文件:
https://gist.github.com/ahmed-abdelazim/7c8170f7fc4e821c6b015d770fcbf14a

所以

                $header = array("method" => "DELETE",
'headers' => array(
"X-Auth-Email" => $email,
"X-Auth-Key" => $key,
"Content-Type" => "application/json"
),
"body" => '{"purge_everything":true}'
);

转换为
                $header = array("method" => "DELETE",
'headers' => array(
//"X-Auth-Email" => $email,
"Authorization" => "Bearer ".$key,
"Content-Type" => "application/json"
),
"body" => '{"purge_everything":true}'
);

这在 cdn.php 文件中的插件中发生了五次

关于wordpress - 在带有可见 API key 的 WP Super Cache 中使用 Wordpress 中的单个 Cloudflare 帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58900978/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com