Anforderungen an die LAMP-Serversoftware

503
Dexter

Ich baue meinen ersten LAMP-Server, der sowohl als Remote-Testserver als auch zum Erstellen eines Webservers verwendet werden kann.

Ich werde Ubuntu Server mit Apache2, PHP7, MySQL 5.7, OpenSSL und vsFTPd verwenden.

Ich verstehe, wie man LAMP- und FTP-Stacks in sich installiert und verwendet, aber was ich nicht weiß, ist, welche andere Software ich brauche, um es sicher zu machen.

Es wird sich hinter einer Sonicwall befinden, und ich lese diesen Artikel in Bezug auf Benutzer-, Datei- und Verzeichnissicherheit. Aber es geht nicht um den Schutz vor Viren, bösartigem Code und Brute Forcing von hinter der Netzwerkfirewall. Ich verstehe, dass der PHP-Code sich um vieles kümmern muss, was ich lerne.

Muss ich neben dem LAMP-Stack und dem FTP-Server noch zusätzliche Software wie Anti-Virus, Firewall usw. installieren?

PS Ich plane, WHM / cPanel und die Abhängigkeiten dafür zu installieren, was ich verstehe.

1
Grundsätzlich finde ich im Internet, dass AV on LAMP nicht erforderlich ist, es sei denn, ich habe einen Dateiserver. Solange ich nur bestimmte Medienformate akzeptiere, sollte ich für einen nicht indizierten Webserver relativ sicher sein und mein PHP-Code ist sicher, sobald ich ihn auf die Remote-Site hochlade. Dexter vor 8 Jahren 0

1 Antwort auf die Frage

2
Xiong Chiamiov

Securing a web server is a large topic, more fit for a book (or series of books) than a Stack Exchange answer. With that being said, I'll address a few points.

but what it doesn't talk about is protection from viruses, malicious code, and brute forcing from behind the network firewall.

Generally speaking, we don't concern ourselves much with virus-type infections in Linux. The target percentage of computers is much lower, the permissions systems (and things like SELinux) help prevent a lot of issues that would arise, and installation of software only from trusted software repositories help reduce this threat.

Keep your server up to date, subscribe to the Ubuntu security announcement list, and don't run untrusted software. And don't disable AppArmor.

General advice in security circles is that once any sign of infection is found, you should nuke (erase) the server and start from scratch, rather than trying to clean out any infection. To this end, you should configure (and test!) regularly-scheduled backups. It's also a very good idea to use a configuration management tool (I like Ansible) for all of your configuration, rather than doing it by hand, so that you can bring up another server instantly.

One final recommendation I have is to install fail2ban. It's most often used to protect against SSH brute-force attempts, but it also ships with configuration files for a number of other common brute-forced network services. If you use Ansible, configuring it becomes much easier due to the presence of includeable roles from their community repo.

I should be relatively safe for an unindexed web server

There are bots constantly scanning the entire known IPv4 address space for servers, so you should never assume that simply because your server is not publicly linked to, it won't be found.