我在Ubuntu14.04上运行一个私有虚拟服务器,并使用Nginx作为我的http服务器和/或反向代理。我在这台服务器上运行了多个open应用程序,其中大多数都是新的开源项目。
更新:服务器是我租给托管公司的VPS。安装程序将是每个应用程序的子域。
我想知道在一个简单的环境中保护nginx的各种可能性。就目前而言,此服务器仅用于dev/专用,我希望实现以下功能:
谢谢!
关于码头和沙尘暴的有趣的读物
我通常将文件夹设置为755,文件设置为644。(一些应用程序推荐777在整个文件夹:0)对于一个服务器,我宁愿暂时停留在ubuntu (更容易),尽管我有一个非常愉快的发现Arch几个月前。然而,我看到了这。我应该能够设置SE。
我总是使用https。Nginx只监听ssl端口。“问题”是我使用了一个自签名证书(也许不会太久),而且我对密码器不太了解,所以在我问一些问题之前,我将首先调查ssl。今天早上我才知道我可以在nginx config ^^中使用TLS
我不太明白什么是哈希。无论在哪里使用它(我的意思是在"server/nginx“配置中)。除了ssl配置之外,我仍然不知道在哪里使用散列。->我可以用散列作为密码吗?
我目前使用米特罗。但在Android (剪贴板劫持)上毫无用处
我还使用了rkhunter和fail2ban的一些基本选项。
发布于 2015-02-17 22:00:27
* Use an authenficiation for apps that don't have their own. Otherwise anyone can use it.为此,您可以使用。这是基本的,就像名字上说的。https://www.digitalocean.com/community/tutorials/how-to-set-up-http-authentication-with-nginx-on-ubuntu-12-10
* Restrict access to certain machines. I know Nginx can deny access based on IP adress, I was wondering if I could achieve this using other variables such as mac adress for example?其实我不建议你这么做。Mac地址可以被欺骗。加上密码应该足够了。IP地址也可以被欺骗,但是在这种情况下实现更有问题。
https://superuser.com/questions/19383/why-is-mac-based-authentication-insecure
* Prevent search engines to index what is on my server. I have read that I could use an Apache .htaccess but can I do it with nginx ? What is the difference with robots.txt files ?使用Robots.txt告诉搜索引擎你想让它远离什么。使用htaccess/basic确保。搜索引擎无法读取任何它没有密码的内容,尽管它可能会看到其中有一个页面(禁止在某种程度上可以证明页面的存在)。
http://en.wikipedia.org/wiki/Robots_排斥_标准
* How would one isolate webapps ? I was wondering if I could run each apps as separate users in order to harden security. Otherwise (someone tell me if I'm wrong) a security breach in one of them (and that may happen often with young projects) could allow an attacker to have access to all www-data user files. Regarding this thread I don't know if I must investigate in php5-fpm pools or only nginx or both.您可以在一个安全的容器中运行该应用程序,就像docker提供的那样。我相信SystemD也有一个本地容器。这样,在你陷入深深的麻烦之前,还有一个“沙箱”要打破。请记住,如果您的服务器上存在二进制漏洞,攻击者通常会以apache或Nginx用户的身份进行攻击,并且可以访问这些服务器可以访问的内容。许多主机提供商所做的事情是,他们在自己的虚拟机中运行每个站点。如果你的盒子有马力,这可能是一个很好的解决方案。
您确实希望确保正确设置所有文件夹的权限。如果使用centOS或RedHat Linux,也可以向web相关文件夹中添加另一层细粒度权限,以进一步锁定它们(调查SE )。既然您使用的是Ubuntu,这不是一个选项,但是如果您更改了,您应该检查它。同样,freeBSD有一个“监狱”的概念,限制了应用程序对整个系统的访问。你也会觉得这很有趣。
https://security.stackexchange.com/questions/81884
复制相似问题