Server Guides: Difference between revisions
formatting |
format of code |
||
Line 25: | Line 25: | ||
* '''Firewall''': Configure a firewall to control incoming and outgoing traffic. | * '''Firewall''': Configure a firewall to control incoming and outgoing traffic. | ||
* '''Regular Updates''': Ensure the server and all software are regularly updated. | * '''Regular Updates''': Ensure the server and all software are regularly updated. | ||
* '''Split Disks''': Separate | * '''Split Disks''': Separate */tmp* and */var* partitions with *noexec* flag. | ||
* '''Log Monitoring''': Regularly monitor server logs for suspicious activities. | * '''Log Monitoring''': Regularly monitor server logs for suspicious activities. | ||
* '''Privilege Escalation Mitigation''': Use | * '''Privilege Escalation Mitigation''': Use *sysctl* variables and kernel parameters to mitigate privilege escalation. | ||
* '''Audit''': Regularly audit the server using tools like | * '''Audit''': Regularly audit the server using tools like *rkhunter* and *debsecan*. | ||
* '''Open Ports''': Only open necessary ports (e.g., 80, 443, 22). | * '''Open Ports''': Only open necessary ports (e.g., 80, 443, 22). | ||
Line 34: | Line 34: | ||
* '''Data Encryption''': Encrypt all data communication. | * '''Data Encryption''': Encrypt all data communication. | ||
** Use | ** Use *scp*, *ssh*, *rsync*, or *sftp* for file transfer. | ||
** Consider VPNs like OpenVPN or tinc for secure connections. | ** Consider VPNs like OpenVPN or tinc for secure connections. | ||
* '''Service Management''': | * '''Service Management''': | ||
Line 41: | Line 41: | ||
* '''Kernel and Software Updates''': | * '''Kernel and Software Updates''': | ||
** Apply all security patches promptly. | ** Apply all security patches promptly. | ||
** Consider using tools like | ** Consider using tools like *apticron* for Debian-based systems. | ||
* '''Linux Security Extensions''': | * '''Linux Security Extensions''': | ||
** Enable SELinux or other security extensions to enforce limitations on applications. | ** Enable SELinux or other security extensions to enforce limitations on applications. | ||
* '''User Accounts and Password Policies''': | * '''User Accounts and Password Policies''': | ||
** Enforce strong password policies. | ** Enforce strong password policies. | ||
** Use tools like | ** Use tools like *pam_cracklib* to enforce password strength. | ||
** Set up password aging policies using | ** Set up password aging policies using *chage*. | ||
* '''Fail2ban''': | * '''Fail2ban''': | ||
** Install and configure Fail2ban to block IP addresses after failed login attempts. | ** Install and configure Fail2ban to block IP addresses after failed login attempts. | ||
* '''Disable Unwanted Services''': | * '''Disable Unwanted Services''': | ||
** Disable unnecessary services and daemons. | ** Disable unnecessary services and daemons. | ||
** Use | ** Use *systemctl* to manage services on modern Linux distributions. | ||
* '''Network Security''': | * '''Network Security''': | ||
** Use | ** Use *iptables* or *firewalld* to manage firewall rules. | ||
** Use tools like | ** Use tools like *nmap* to scan open ports. | ||
* '''File System Security''': | * '''File System Security''': | ||
** Separate critical file systems into different partitions with appropriate mount options ( | ** Separate critical file systems into different partitions with appropriate mount options (*noexec*, *nodev*, *nosuid*). | ||
* '''Regular Backups''': | * '''Regular Backups''': | ||
** Implement regular, encrypted backups to an offsite location. | ** Implement regular, encrypted backups to an offsite location. |