Aplica el lema de menos es más:
Es decir, cuando contrates el vps/vds o servidor dedicado empieza por desinstalar todo el software que no vayas a usar en el. Contra menos software instalado, menores vectores de ataque tendrás.
http://searchsecurity.techtarget.com.../attack-vector http://security.stackexchange.com/qu...the-difference http://www.solvetic.com/tutoriales/a...as-operativos/
CentOS
rpm -aq > softlist.txt
cat softlist.txt | less o less softlist.txt
Debian
dpkg- l
dpkg- l > softlist.txt
cat softlist.txt | less o less softlist.txt
Mira los puertos y servicios corriendo:
netstat -aon
netstat -an
http://web.mit.edu/rhel-doc/4/RH-DOC...ver-ports.html https://www.hostdog.es/blog/%C2%BFco...as-mi-servidor
Desactiva los servicios que no necesites al inicio del sistema.
Debian
sudo systemctl list-units
sudo systemctl status nombre-del-servicio
sudo systemctl stop nombre-del-servicio
yum purge nombre-el-servicio
CentOS
systemctl stop nombre-del-servicio
yum remove nombre-del-sofware
Firewall iptables o ufw si eres novato en Linux.
Cambiar el port de ssh por otro que no sea el 22 o el 2222.
SETUID, SETGUID y StickyBit
https://docs.oracle.com/cd/E19683-01...-69/index.html
Tuning al /etc/sysctl.conf para prevenir ciertos ataques como:
MITM attacks
IP Spoofing
SYN Flood
Inhabilitar IPv6
http://tecadmin.net/disable-ipv6-on-linux/
etc.
Instalación de un WAF como mod_security para evitar hacks a los sitios webs.
Securización de las particiones /tmp y /dev/shm
Encontrar permisos 777 con find
Permisos chmod correctos en directorios
Inhabilitar compilers o compiladores
Server Hardening Tips & Tricks:
Every server security conscious organization will have their own methods for maintaining adequate system and network security. Often you will find that server hardening consultants can bring your security efforts up a notch with their specialized expertise.
Some common server hardening tips & tricks include:
- Use Data Encryption for your Communications
- Avoid using insecure protocols that send your information or passwords in plain text.
- Minimize unnecessary software on your servers.
- Disable Unwanted SUID and SGID Binaries
- Keep your operating system up to date, especially security patches.
- Using security extensions is a plus.
- When using Linux, SELinux should be considered. Linux server hardening is a primary focus for the web hosting industry, however in web hosting SELinux is probably not a good option as it often causes issues when the server is used for web hosting purposes.
- User Accounts should have very strong passwords
- Change passwords on a regular basis and do not reuse them
- Lock accounts after too many login failures. Often these login failures are illegitimate attempts to gain access to your system.
- Do not permit empty passwords.
- SSH Hardening
--- Change the port from default to a non standard one
--- Disable direct root logins. Switch to root from a lower level account only when necessary.
- Unnecessary services should be disabled. Disable all instances of IRC - BitchX, bnc, eggdrop, generic-sniffers, guardservices, ircd, psyBNC, ptlink.
- Securing /tmp /var/tmp /dev/shm
- Hide BIND DNS Sever Version and Apache version
- Hardening sysctl.conf
- Server hardenining by installing Root Kit Hunter and ChrootKit hunter.
- Minimize open network ports to be only what is needed for your specific circumstances.
- Configure the system firewall (Iptables) or get a software installed like CSF or APF. Proper setup of a firewall itself can prevent many attacks.
- Consider also using a hardware firewall
- Separate partitions in ways that make your system more secure.
- Disable unwanted binaries
- Maintain server logs; mirror logs to a separate log server
- Install Logwatch and review logwatch emails daily. Investigate any suspicious activity on your server.
- Use brute force and intrusion detection systems
- Install Linux Socket Monitor - Detects/alerts when new sockets are created on your system, often revealing hacker activity
- Install Mod_security as Webserver Hardening
- Hardening the Php installation
https://www.idontplaydarts.com/2011/...-php-on-linux/ http://www.securitybydefault.com/201...te-phpini.html https://howtogetonline.com/how-to-ha...r-security.php
- Limit user accounts to accessing only what they need. Increased access should only be on an as-needed basis.
- Maintain proper backups
- Don't forget about physical server security
http://www.serverhardening.com/
Linux Hardening Checklist
https://www.ucd.ie/t4cms/UCD%20Linux...0Checklist.pdf http://learnlinuxwithrohan.blogspot....nd-rlogin.html
El hardening no es copiar y pegar configs de seguridad encontradas de Internet. Pues cada servidor es un mundo y necesita de una configuración distinta. No es lo mismo tunear un server para una red de 100MB o de 1GBps. Debes saber lo que haces. Saber de sistemas operativos y de redes.
Para todo lo demás tienes las guías de la NSA.
etc.