Protéger son VPS des attaques DDoS : Guide complet

Protéger son VPS des attaques DDoS : Guide complet

Table des matières

Introduction

Les attaques DDoS sont de plus en plus fréquentes. Ce guide vous montre comment protéger votre VPS.

Types d'attaques DDoS

  • Volumétrique : Saturation de la bande passante
  • Protocolaire : Exploitation des protocoles (SYN flood)
  • Applicative : Ciblage des applications web

Protection niveau 1 : Paramètres kernel

Éditez /etc/sysctl.conf :

net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.core.somaxconn = 65535

Appliquez :

sysctl -p

Protection niveau 2 : Firewall UFW

ufw default deny incoming
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw limit ssh
ufw enable

Protection niveau 3 : Fail2ban

apt install fail2ban -y

Configuration /etc/fail2ban/jail.local :

[sshd]
enabled = true
maxretry = 3
bantime = 86400

Protection niveau 4 : Rate limiting Nginx

limit_req_zone $binary_remote_addr zone=req_limit:10m rate=10r/s;

server {
    limit_req zone=req_limit burst=20 nodelay;
}

Protection niveau 5 : Cloudflare

Cloudflare offre une protection DDoS gratuite efficace :

1. Créez un compte
2. Ajoutez votre domaine
3. Activez \"Under Attack Mode\" si nécessaire

Protection OneHeberge

Tous nos VPS incluent :


  • Protection DDoS jusqu'à 1 Tbps

  • Filtrage réseau automatique

  • Monitoring 24/7