durcissement-erplibre/docs/DEPLOYMENT-STEPS.md
2026-03-03 09:42:18 -05:00

61 lines
No EOL
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Déploiement modèle de référence
Exemple illustratif : https://www.rencontres-linux.quebec
## Pré-requis
- Debian/Ubuntu moderne
- Docker Engine + Docker Compose
- Nginx sur lhôte
- nftables
- (optionnel) fail2ban, modsecurity
## Étapes
1. Créer un réseau Docker dédié :
```bash
docker network create erplibre_net
```
2. Adapter `docker/docker-compose.yml` (mots de passe, image ERPLibre).
3. Démarrer la stack :
```bash
cd docker
docker compose up -d
```
4. Vérifier quaucun port applicatif nest publié :
```bash
docker ps --format 'table {.Names}\t{.Ports}'
```
5. Installer Nginx et activer le vhost :
- Copier `nginx/erplibre.conf` vers `/etc/nginx/sites-available/`
- Adapter `server_name` et les chemins TLS Certbot
- `nginx -t && systemctl reload nginx`
6. TLS (Certbot) :
- Préparer `/var/www/letsencrypt`
- Générer/renouveler les certificats
7. Activer nftables :
- Copier `nftables/edge.nft` dans `/etc/nftables.d/`
- Inclure `/etc/nftables.d/*.nft` dans `/etc/nftables.conf`
- `nft -f /etc/nftables.conf`
- `systemctl enable --now nftables`
8. Fail2ban :
- Copier `fail2ban/jail.local` dans `/etc/fail2ban/jail.d/erplibre.local`
- Copier les filtres dans `/etc/fail2ban/filter.d/`
- `systemctl restart fail2ban`
9. Mitigation ASN TTL :
- Copier `asn-mitigation/update-asn-ttl-blocklist.sh` vers `/usr/local/sbin/`
- Copier les listes vers `/etc/edge/`
- Copier les units systemd vers `/etc/systemd/system/`
- `systemctl daemon-reload`
- `systemctl enable --now asn-ttl-blocklist.timer`
10. Logrotate :
- Copier `logrotate/nginx-erplibre` vers `/etc/logrotate.d/`
## Tests
- Depuis lextérieur : seuls 80/443 doivent répondre.
- SSL Labs : viser A/A+.