|
| 1 | +# syntax=docker/dockerfile:1 |
| 2 | +# Reverse-proxy Apache devant le honeypot HTTP (FastAPI). Objectif anti-détection : |
| 3 | +# - en-têtes / pages d'erreur / version Apache authentiques : Apache/2.4.57 (Debian) ; |
| 4 | +# - assets statiques WordPress RÉELS servis depuis le disque (vrais ETag / Last-Modified |
| 5 | +# / Accept-Ranges, contenu byte-exact => résiste au fingerprint WPScan) ; |
| 6 | +# - tout le dynamique proxifié vers le backend FastAPI (honeypot-http:8080). |
| 7 | +FROM debian:bookworm-slim |
| 8 | + |
| 9 | +# Apache + extraction des SEULS fichiers statiques de WordPress 6.5.2 (pas de .php : |
| 10 | +# sans mod_php, Apache divulguerait sinon le code source des .php). |
| 11 | +# hadolint ignore=DL3008,DL3015 |
| 12 | +RUN apt-get update \ |
| 13 | + && apt-get install -y --no-install-recommends apache2 ca-certificates curl unzip \ |
| 14 | + && a2enmod proxy proxy_http headers rewrite \ |
| 15 | + && curl -fsSL https://wordpress.org/wordpress-6.5.2.zip -o /tmp/wp.zip \ |
| 16 | + && unzip -q /tmp/wp.zip -d /tmp \ |
| 17 | + && cd /tmp/wordpress \ |
| 18 | + && find wp-includes wp-content wp-admin -type f \ |
| 19 | + \( -name '*.css' -o -name '*.js' -o -name '*.map' -o -name '*.png' -o -name '*.jpg' \ |
| 20 | + -o -name '*.jpeg' -o -name '*.gif' -o -name '*.svg' -o -name '*.ico' \ |
| 21 | + -o -name '*.woff' -o -name '*.woff2' -o -name '*.ttf' -o -name '*.eot' \) \ |
| 22 | + -exec cp --parents -t /var/www/html {} + \ |
| 23 | + && cp readme.html license.txt /var/www/html/ \ |
| 24 | + && chown -R www-data:www-data /var/www/html \ |
| 25 | + && sed -i 's/^ServerTokens .*/ServerTokens OS/' /etc/apache2/conf-available/security.conf \ |
| 26 | + && sed -i 's/^ServerSignature .*/ServerSignature On/' /etc/apache2/conf-available/security.conf \ |
| 27 | + && rm -rf /tmp/wp.zip /tmp/wordpress /var/lib/apt/lists/* |
| 28 | + |
| 29 | +COPY honeypot.conf /etc/apache2/sites-available/000-default.conf |
| 30 | + |
| 31 | +# Valide la syntaxe de la conf au build (échoue le build si la conf est invalide). |
| 32 | +RUN apache2ctl configtest |
| 33 | + |
| 34 | +EXPOSE 80 |
| 35 | +# Apache en avant-plan comme PID 1. |
| 36 | +CMD ["apache2ctl", "-D", "FOREGROUND"] |
0 commit comments