require_once() 被 open_basedir 阻止 - 那么如何保证系统安全?
我有一个包含大量重要数据并关心安全性的网站,现在我必须在那里运行一些潜在不安全的代码(Joomla)。我想通过 open_basedir “封闭”整个目录树,同时我不想隐藏数据库密码 - 所以我想将数据库密码移出 open_basedir 树(以及一些可以连接的功能)到数据库,以便调用者本身无法获得密码)。但有一个问题 - 当 open_basedir 运行时 require_once 也不起作用!
有什么方法可以设置 open_basedir 并允许 require_once 吗?
有没有其他方法可以调用 open_basedir 有限区域之外的一些秘密 php 代码?
请帮忙。提前致谢!
I have a website with a lot of important data and care about security, and now I must run there some potentially unsafe code (Joomla). I want to "enclose" this whole directory tree by open_basedir, and at the same time I wan't to hide database password from it - so I want to move the database password OUT of the open_basedir tree (along with some functionality which would connect to the database, so that the caller doesn't get the password itself). But there is a problem - require_once also doesn't work when open_basedir is in action!!!
Is there any way how to set up open_basedir and allow require_once?
Is there any other way how to call some SECRET php code OUT of the open_basedir limited area?
Please help. Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,它起作用,除非您试图包含 basedir 之外的文件。然后它会像其他任何试图到达 basedir 之外的东西一样失败。
如果定义了 basedir,就无法摆脱它。如果您发现一个错误,则它是一个错误,必须立即消除。
Yes it does, unless you're trying to include a file outside of the basedir. Then it'd fail like anything else that tries to reach outside of the basedir.
There is no way out of a basedir if you have it defined. If you find one, it is a bug and must be squashed immediately.