Improve workshop consistency and navigation

Align challenge numbering and cross-page links, and clarify Backend C/TLS guidance so participants always see valid routes and safer cert mounting defaults.
This commit is contained in:
hkoeck
2026-03-07 19:40:50 +01:00
parent 92a833ec50
commit 1739810044
8 changed files with 112 additions and 52 deletions
+1 -2
View File
@@ -36,9 +36,8 @@ Basisrouten nach dem Start:
Plattformhinweise: Plattformhinweise:
- Linux: Docker Engine oder Docker Desktop - Linux: Docker Engine oder Docker Desktop
- macOS: Docker Desktop - macOS: Docker Desktop (falls `make` fehlt -> `xcode-select --install`)
- Windows: Docker Desktop + WSL Integration aktiv - Windows: Docker Desktop + WSL Integration aktiv
- macOS: falls `make` fehlt -> `xcode-select --install`
## Schnellstart ## Schnellstart
+16 -11
View File
@@ -161,7 +161,7 @@ curl http://localhost:8080/service/a
./scripts/compose.sh logs reverse-proxy ./scripts/compose.sh logs reverse-proxy
``` ```
### 6a) Load Balancing konfigurieren ### 7) Load Balancing konfigurieren
**Ziel** **Ziel**
- Kernfunktion eines Reverse Proxys praktisch zeigen. - Kernfunktion eines Reverse Proxys praktisch zeigen.
@@ -185,7 +185,7 @@ for i in $(seq 1 8); do
done done
``` ```
### 6b) Response Header Minimization ### 8) Response Header Minimization
**Ziel** **Ziel**
- Unnoetige Header aus Upstream-Responses entfernen. - Unnoetige Header aus Upstream-Responses entfernen.
@@ -200,7 +200,7 @@ done
**Abgrenzung zu Challenge 4** **Abgrenzung zu Challenge 4**
- Challenge 4 setzt aktive Schutz-Header. - Challenge 4 setzt aktive Schutz-Header.
- Challenge 6b entfernt unnoetige Header aus Upstream-Responses. - Challenge 8 entfernt unnoetige Header aus Upstream-Responses.
**Warum wichtig** **Warum wichtig**
- Weniger Response-Metadaten bedeuten weniger Angriffsoberflaeche fuer Fingerprinting und Reconnaissance. - Weniger Response-Metadaten bedeuten weniger Angriffsoberflaeche fuer Fingerprinting und Reconnaissance.
@@ -210,7 +210,7 @@ done
curl -I http://localhost:8080/service/a curl -I http://localhost:8080/service/a
``` ```
### 6c) Debugging Challenge (kaputte Config reparieren) ### 9) Debugging Challenge (kaputte Config reparieren)
**Ziel** **Ziel**
- Fehlerdiagnose in Nginx ueben. - Fehlerdiagnose in Nginx ueben.
@@ -223,6 +223,11 @@ curl -I http://localhost:8080/service/a
- Mindestens 2-3 Fehler finden und fixen. - Mindestens 2-3 Fehler finden und fixen.
- Symptome und Diagnoseweg erklaeren. - Symptome und Diagnoseweg erklaeren.
**Erwartete Fehlerarten (Beispiel aus `nginx.broken.conf`)**
- Upstream-Name passt nicht zum referenzierten Namen in `proxy_pass`.
- Falscher Upstream-Port (`8080` statt `80`).
- Fehlender Trailing Slash in `proxy_pass` bei Prefix-Location.
**Warum wichtig** **Warum wichtig**
- Debugging unter Druck ist Praxisalltag; diese Aufgabe trainiert systematisches Vorgehen mit Logs und Config-Tests. - Debugging unter Druck ist Praxisalltag; diese Aufgabe trainiert systematisches Vorgehen mit Logs und Config-Tests.
@@ -237,7 +242,7 @@ curl http://localhost:8080/service/b
## Hard (TLS) ## Hard (TLS)
### 7) HTTPS von 0 mit Easy-RSA ### 10) HTTPS von 0 mit Easy-RSA
**Ziel** **Ziel**
- Eigene CA + Server-Zertifikat fuer `localhost` erstellen. - Eigene CA + Server-Zertifikat fuer `localhost` erstellen.
@@ -259,11 +264,11 @@ curl http://localhost:8080/service/b
curl https://localhost:8443/service/a curl https://localhost:8443/service/a
``` ```
### 8) HTTP -> HTTPS Redirect ### 11) HTTP -> HTTPS Redirect
**Voraussetzung** **Voraussetzung**
- Challenge 7 muss abgeschlossen sein. - Challenge 10 muss abgeschlossen sein.
- Nutze deine bestehende `nginx.conf` aus Challenge 7 als Basis. - Nutze deine bestehende `nginx.conf` aus Challenge 10 als Basis.
**Ziel** **Ziel**
- HTTP sauber auf HTTPS umlenken. - HTTP sauber auf HTTPS umlenken.
@@ -283,10 +288,10 @@ curl https://localhost:8443/service/a
curl -I http://localhost:8080/service/a curl -I http://localhost:8080/service/a
``` ```
### 9) TLS Haertung + Chain Check + HSTS ### 12) TLS Haertung + Chain Check + HSTS
**Voraussetzung** **Voraussetzung**
- Challenge 7 und 8 muessen abgeschlossen sein. - Challenge 10 und 11 muessen abgeschlossen sein.
- Erweitere dieselbe `nginx.conf` weiter. - Erweitere dieselbe `nginx.conf` weiter.
**Ziel** **Ziel**
@@ -316,7 +321,7 @@ openssl s_client -connect localhost:8443 -servername localhost
## Bonus Expert ## Bonus Expert
### 10) Wireshark: HTTP vs HTTPS sauber analysieren ### 13) Wireshark: HTTP vs HTTPS sauber analysieren
**Ziel** **Ziel**
- Nachweisbar zeigen, was im Klartext sichtbar ist und was durch TLS geschuetzt wird. - Nachweisbar zeigen, was im Klartext sichtbar ist und was durch TLS geschuetzt wird.
+52 -13
View File
@@ -39,15 +39,29 @@ cd certs/easyrsa
./easyrsa sign-req server localhost ./easyrsa sign-req server localhost
``` ```
## 5) Dateien fuer Nginx bereitstellen ## 5) Nur Runtime-Zertifikate bereitstellen (nicht komplette PKI mounten)
Typische Dateien: Nutze fuer den Container nur die benoetigten Laufzeitdateien:
- `pki/issued/localhost.crt` - `localhost.crt` (Server-Zertifikat)
- `pki/private/localhost.key` - `localhost.key` (Server-Private-Key)
- `pki/ca.crt`
Danach in `proxy/nginx.conf` TLS aktivieren und in `docker-compose.yml` Port `443` mappen. Beispiel:
```bash
mkdir -p ../../live
cp pki/issued/localhost.crt ../../live/
cp pki/private/localhost.key ../../live/
chmod 600 ../../live/localhost.key
```
Warum nicht die ganze PKI mounten?
- In `pki/` liegen CA-relevante Dateien.
- Runtime-Container sollen keine unnoetigen PKI/CA-Dateien sehen.
- Prinzip: minimal noetige Secrets in Runtime.
Danach in `proxy/nginx.conf` TLS aktivieren und in `docker-compose.yml` Port `443` + Cert-Volume mappen.
### Compose-Mindestbeispiel ### Compose-Mindestbeispiel
@@ -60,24 +74,49 @@ services:
volumes: volumes:
- ./proxy/nginx.conf:/etc/nginx/nginx.conf:ro,z - ./proxy/nginx.conf:/etc/nginx/nginx.conf:ro,z
- ./proxy/html:/usr/share/nginx/html:ro,z - ./proxy/html:/usr/share/nginx/html:ro,z
- ./certs/easyrsa/pki:/etc/nginx/pki:ro,z - ./certs/live:/etc/nginx/certs:ro,z
``` ```
### Nginx-Mindestbeispiel ### Nginx-Mindestbeispiel (HTTP + HTTPS)
```nginx ```nginx
server {
listen 80;
server_name _;
location = /healthz {
default_type text/plain;
return 200 "ok\n";
}
location / {
return 301 https://$host:8443$request_uri;
}
}
server { server {
listen 443 ssl; listen 443 ssl;
server_name localhost; server_name localhost;
ssl_certificate /etc/nginx/pki/issued/localhost.crt; ssl_certificate /etc/nginx/certs/localhost.crt;
ssl_certificate_key /etc/nginx/pki/private/localhost.key; ssl_certificate_key /etc/nginx/certs/localhost.key;
ssl_protocols TLSv1.2 TLSv1.3; ssl_protocols TLSv1.2 TLSv1.3;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Cross-Origin-Resource-Policy "same-origin" always;
location /service/a { location /service/a {
proxy_pass http://backend_a/; proxy_pass http://backend_a/;
} }
location /service/b {
proxy_pass http://backend_b/;
}
} }
``` ```
@@ -86,14 +125,14 @@ server {
Fedora: Fedora:
```bash ```bash
sudo cp pki/ca.crt /etc/pki/ca-trust/source/anchors/htl-workshop-root-ca.crt sudo cp certs/easyrsa/pki/ca.crt /etc/pki/ca-trust/source/anchors/htl-workshop-root-ca.crt
sudo update-ca-trust sudo update-ca-trust
``` ```
Ubuntu/Debian: Ubuntu/Debian:
```bash ```bash
sudo cp pki/ca.crt /usr/local/share/ca-certificates/htl-workshop-root-ca.crt sudo cp certs/easyrsa/pki/ca.crt /usr/local/share/ca-certificates/htl-workshop-root-ca.crt
sudo update-ca-certificates sudo update-ca-certificates
``` ```
@@ -114,7 +153,7 @@ curl https://localhost:8443/service/a
Falls CA nicht global importiert ist: Falls CA nicht global importiert ist:
```bash ```bash
curl --cacert pki/ca.crt https://localhost:8443/service/a curl --cacert certs/easyrsa/pki/ca.crt https://localhost:8443/service/a
``` ```
## 8) Typische Fehlerbilder ## 8) Typische Fehlerbilder
+13 -11
View File
@@ -172,6 +172,7 @@
<a class="pill" href="/solutions.html">Solutions</a> <a class="pill" href="/solutions.html">Solutions</a>
<a class="pill" href="/service/a">Backend A</a> <a class="pill" href="/service/a">Backend A</a>
<a class="pill" href="/service/b">Backend B</a> <a class="pill" href="/service/b">Backend B</a>
<a class="pill" href="/challenges.html#challenge-2-backend-c">Backend C (ab C2)</a>
</div> </div>
</section> </section>
@@ -199,7 +200,7 @@
curl http://localhost:8080/service/b</code></pre> curl http://localhost:8080/service/b</code></pre>
</details> </details>
<details> <details id="challenge-2-backend-c">
<summary><span class="badge easy">Easy</span> 2) backend-c hinzufuegen</summary> <summary><span class="badge easy">Easy</span> 2) backend-c hinzufuegen</summary>
<p><span class="kw">Muss:</span> Compose-Service + Upstream + Route <code>/service/c</code>.</p> <p><span class="kw">Muss:</span> Compose-Service + Upstream + Route <code>/service/c</code>.</p>
<p><span class="kw">Zusatz:</span> <code>backends/c/index.html</code> ist vorhanden und darf angepasst werden.</p> <p><span class="kw">Zusatz:</span> <code>backends/c/index.html</code> ist vorhanden und darf angepasst werden.</p>
@@ -246,7 +247,7 @@ curl http://localhost:8080/service/b</code></pre>
</details> </details>
<details> <details>
<summary><span class="badge medium">Medium</span> 6a) Load Balancing</summary> <summary><span class="badge medium">Medium</span> 7) Load Balancing</summary>
<p>Zweite Instanz von Backend A (<code>backend-a2</code>) einbauen und Round-Robin zeigen.</p> <p>Zweite Instanz von Backend A (<code>backend-a2</code>) einbauen und Round-Robin zeigen.</p>
<p><span class="kw">Warum wichtig:</span> Lastverteilung ist Kernnutzen eines Reverse Proxys fuer Skalierung und Verfuegbarkeit.</p> <p><span class="kw">Warum wichtig:</span> Lastverteilung ist Kernnutzen eines Reverse Proxys fuer Skalierung und Verfuegbarkeit.</p>
<pre><code>for i in $(seq 1 8); do <pre><code>for i in $(seq 1 8); do
@@ -255,17 +256,18 @@ done</code></pre>
</details> </details>
<details> <details>
<summary><span class="badge medium">Medium</span> 6b) Response Header Minimization</summary> <summary><span class="badge medium">Medium</span> 8) Response Header Minimization</summary>
<p>Mindestens einen Backend-Response-Header per <code>proxy_hide_header</code> ausblenden.</p> <p>Mindestens einen Backend-Response-Header per <code>proxy_hide_header</code> ausblenden.</p>
<p><span class="kw">Abgrenzung zu #4:</span> #4 setzt Schutz-Header, #6b entfernt unnoetige Header aus Upstream-Responses.</p> <p><span class="kw">Abgrenzung zu #4:</span> #4 setzt Schutz-Header, #8 entfernt unnoetige Header aus Upstream-Responses.</p>
<p><span class="kw">Warum wichtig:</span> Weniger preisgegebene Metadaten erschweren Fingerprinting und zielgerichtete Angriffe.</p> <p><span class="kw">Warum wichtig:</span> Weniger preisgegebene Metadaten erschweren Fingerprinting und zielgerichtete Angriffe.</p>
<pre><code>curl -I http://localhost:8080/service/a</code></pre> <pre><code>curl -I http://localhost:8080/service/a</code></pre>
</details> </details>
<details> <details>
<summary><span class="badge medium">Medium</span> 6c) Debugging Challenge</summary> <summary><span class="badge medium">Medium</span> 9) Debugging Challenge</summary>
<p>Mit <code>proxy/nginx.broken.conf</code> arbeiten, Fehler finden und reparieren.</p> <p>Mit <code>proxy/nginx.broken.conf</code> arbeiten, Fehler finden und reparieren.</p>
<p><span class="kw">Warum wichtig:</span> In der Praxis geht es oft um Diagnose unter Zeitdruck, nicht nur um Greenfield-Konfiguration.</p> <p><span class="kw">Warum wichtig:</span> In der Praxis geht es oft um Diagnose unter Zeitdruck, nicht nur um Greenfield-Konfiguration.</p>
<p><span class="kw">Typische Fehler in der kaputten Datei:</span> Upstream-Name-Mismatch, falscher Port, fehlender Trailing Slash in <code>proxy_pass</code>.</p>
<pre><code>curl http://localhost:8080/service/a <pre><code>curl http://localhost:8080/service/a
curl http://localhost:8080/service/b curl http://localhost:8080/service/b
./scripts/compose.sh logs reverse-proxy</code></pre> ./scripts/compose.sh logs reverse-proxy</code></pre>
@@ -276,22 +278,22 @@ curl http://localhost:8080/service/b
<h2>Hard (TLS)</h2> <h2>Hard (TLS)</h2>
<details> <details>
<summary><span class="badge hard">Hard</span> 7) HTTPS von 0 (Easy-RSA)</summary> <summary><span class="badge hard">Hard</span> 10) HTTPS von 0 (Easy-RSA)</summary>
<p>Zertifikat fuer <code>localhost</code>, Port <code>8443:443</code>, Root-CA importiert.</p> <p>Zertifikat fuer <code>localhost</code>, Port <code>8443:443</code>, Root-CA importiert.</p>
<p><span class="kw">Warum wichtig:</span> TLS-Grundaufbau ist Voraussetzung fuer vertrauliche und manipulationssichere Kommunikation.</p> <p><span class="kw">Warum wichtig:</span> TLS-Grundaufbau ist Voraussetzung fuer vertrauliche und manipulationssichere Kommunikation.</p>
<pre><code>curl https://localhost:8443/service/a</code></pre> <pre><code>curl https://localhost:8443/service/a</code></pre>
</details> </details>
<details> <details>
<summary><span class="badge hard">Hard</span> 8) HTTP -&gt; HTTPS Redirect</summary> <summary><span class="badge hard">Hard</span> 11) HTTP -&gt; HTTPS Redirect</summary>
<p><span class="kw">Voraussetzung:</span> Challenge 7 abgeschlossen. Bestehende Config weiterverwenden.</p> <p><span class="kw">Voraussetzung:</span> Challenge 10 abgeschlossen. Bestehende Config weiterverwenden.</p>
<p><span class="kw">Warum wichtig:</span> Redirect verhindert unabsichtliche Klartext-Nutzung und erzwingt den sicheren Transport.</p> <p><span class="kw">Warum wichtig:</span> Redirect verhindert unabsichtliche Klartext-Nutzung und erzwingt den sicheren Transport.</p>
<pre><code>curl -I http://localhost:8080/service/a</code></pre> <pre><code>curl -I http://localhost:8080/service/a</code></pre>
</details> </details>
<details> <details>
<summary><span class="badge hard">Hard</span> 9) TLS Haertung + Chain + HSTS</summary> <summary><span class="badge hard">Hard</span> 12) TLS Haertung + Chain + HSTS</summary>
<p><span class="kw">Voraussetzung:</span> Challenge 7 und 8 abgeschlossen. Gleiche Config weiter erweitern.</p> <p><span class="kw">Voraussetzung:</span> Challenge 10 und 11 abgeschlossen. Gleiche Config weiter erweitern.</p>
<p><span class="kw">Warum wichtig:</span> Erst Haertung + HSTS reduzieren Downgrade-Risiken und sorgen fuer dauerhaft sichere Clients.</p> <p><span class="kw">Warum wichtig:</span> Erst Haertung + HSTS reduzieren Downgrade-Risiken und sorgen fuer dauerhaft sichere Clients.</p>
<pre><code>curl -I https://localhost:8443/service/a <pre><code>curl -I https://localhost:8443/service/a
openssl s_client -connect localhost:8443 -servername localhost</code></pre> openssl s_client -connect localhost:8443 -servername localhost</code></pre>
@@ -302,7 +304,7 @@ openssl s_client -connect localhost:8443 -servername localhost</code></pre>
<h2>Bonus Expert</h2> <h2>Bonus Expert</h2>
<details> <details>
<summary><span class="badge expert">Expert</span> 10) Wireshark: HTTP vs HTTPS sauber ausarbeiten</summary> <summary><span class="badge expert">Expert</span> 13) Wireshark: HTTP vs HTTPS sauber ausarbeiten</summary>
<p><span class="kw">Warum wichtig:</span> Sichtbarkeit auf Paketebene macht den Sicherheitsgewinn von TLS fuer alle nachvollziehbar.</p> <p><span class="kw">Warum wichtig:</span> Sichtbarkeit auf Paketebene macht den Sicherheitsgewinn von TLS fuer alle nachvollziehbar.</p>
<ol> <ol>
<li>HTTP auf <code>8080</code> mitschneiden und Klartext zeigen.</li> <li>HTTP auf <code>8080</code> mitschneiden und Klartext zeigen.</li>
+2
View File
@@ -134,6 +134,7 @@
<a class="pill" href="/solutions.html">Solutions</a> <a class="pill" href="/solutions.html">Solutions</a>
<a class="pill" href="/service/a">Backend A</a> <a class="pill" href="/service/a">Backend A</a>
<a class="pill" href="/service/b">Backend B</a> <a class="pill" href="/service/b">Backend B</a>
<a class="pill" href="/challenges.html#challenge-2-backend-c">Backend C (ab C2)</a>
</div> </div>
</section> </section>
@@ -173,6 +174,7 @@ cd certs/easyrsa
./easyrsa build-ca nopass ./easyrsa build-ca nopass
./easyrsa gen-req localhost nopass ./easyrsa gen-req localhost nopass
./easyrsa sign-req server localhost</code></pre> ./easyrsa sign-req server localhost</code></pre>
<p>Nur Runtime-Certs mounten (z. B. <code>certs/live</code>), nicht die komplette PKI.</p>
</article> </article>
<article class="card"> <article class="card">
<h3>Fedora CA Import</h3> <h3>Fedora CA Import</h3>
+1
View File
@@ -114,6 +114,7 @@
<a class="pill" href="/solutions.html">Solutions</a> <a class="pill" href="/solutions.html">Solutions</a>
<a class="pill" href="/service/a">Backend A</a> <a class="pill" href="/service/a">Backend A</a>
<a class="pill" href="/service/b">Backend B</a> <a class="pill" href="/service/b">Backend B</a>
<a class="pill" href="/challenges.html#challenge-2-backend-c">Backend C (ab C2)</a>
</div> </div>
</section> </section>
+25 -13
View File
@@ -173,6 +173,7 @@
<a class="pill" href="/solutions.html">Solutions</a> <a class="pill" href="/solutions.html">Solutions</a>
<a class="pill" href="/service/a">Backend A</a> <a class="pill" href="/service/a">Backend A</a>
<a class="pill" href="/service/b">Backend B</a> <a class="pill" href="/service/b">Backend B</a>
<a class="pill" href="/challenges.html#challenge-2-backend-c">Backend C (ab C2)</a>
</div> </div>
</section> </section>
@@ -272,7 +273,7 @@ access_log /var/log/nginx/access.log workshop;</code></pre>
</details> </details>
<details> <details>
<summary><span class="badge medium">Medium</span> 6a) Load Balancing</summary> <summary><span class="badge medium">Medium</span> 7) Load Balancing</summary>
<p><span class="kw">Dateien:</span> <code>docker-compose.yml</code>, <code>proxy/nginx.conf</code>, <code>backends/a2/index.html</code></p> <p><span class="kw">Dateien:</span> <code>docker-compose.yml</code>, <code>proxy/nginx.conf</code>, <code>backends/a2/index.html</code></p>
<p><span class="kw">Commands noetig:</span> ja</p> <p><span class="kw">Commands noetig:</span> ja</p>
<p><span class="kw">Compose (backend-a2):</span></p> <p><span class="kw">Compose (backend-a2):</span></p>
@@ -293,10 +294,10 @@ done</code></pre>
</details> </details>
<details> <details>
<summary><span class="badge medium">Medium</span> 6b) Response Header Minimization</summary> <summary><span class="badge medium">Medium</span> 8) Response Header Minimization</summary>
<p><span class="kw">Dateien:</span> <code>proxy/nginx.conf</code></p> <p><span class="kw">Dateien:</span> <code>proxy/nginx.conf</code></p>
<p><span class="kw">Commands noetig:</span> ja</p> <p><span class="kw">Commands noetig:</span> ja</p>
<p><span class="kw">Abgrenzung zu #4:</span> #4 fuegt Schutz-Header hinzu, #6b entfernt unnoetige Upstream-Metadaten.</p> <p><span class="kw">Abgrenzung zu #4:</span> #4 fuegt Schutz-Header hinzu, #8 entfernt unnoetige Upstream-Metadaten.</p>
<pre><code>location /service/a { <pre><code>location /service/a {
proxy_pass http://backend_a/; proxy_pass http://backend_a/;
proxy_hide_header ETag; proxy_hide_header ETag;
@@ -306,14 +307,23 @@ done</code></pre>
</details> </details>
<details> <details>
<summary><span class="badge medium">Medium</span> 6c) Debugging Challenge</summary> <summary><span class="badge medium">Medium</span> 9) Debugging Challenge</summary>
<p><span class="kw">Dateien:</span> <code>proxy/nginx.broken.conf</code>, <code>proxy/nginx.conf</code></p> <p><span class="kw">Dateien:</span> <code>proxy/nginx.broken.conf</code>, <code>proxy/nginx.conf</code></p>
<p><span class="kw">Commands noetig:</span> ja</p> <p><span class="kw">Commands noetig:</span> ja</p>
<p>Kopiere testweise <code>proxy/nginx.broken.conf</code> auf <code>proxy/nginx.conf</code>, behebe die Fehler und stelle danach die funktionierende Konfiguration wieder her.</p> <p><span class="kw">Ablauf:</span> Kopiere testweise <code>proxy/nginx.broken.conf</code> auf <code>proxy/nginx.conf</code>, behebe die Fehler und stelle danach die funktionierende Konfiguration wieder her.</p>
<pre><code>cp proxy/nginx.broken.conf proxy/nginx.conf <pre><code>cp proxy/nginx.broken.conf proxy/nginx.conf
make proxy-reload make proxy-reload
./scripts/compose.sh logs reverse-proxy</code></pre> ./scripts/compose.sh logs reverse-proxy</code></pre>
<p><span class="kw">Konkrete Fehler und Fixes:</span></p>
<ol>
<li><span class="kw">Upstream-Mismatch:</span> <code>backend_a_typo</code> ist definiert, aber <code>backend_a</code> wird referenziert -> Namen angleichen.</li>
<li><span class="kw">Falscher Port:</span> <code>backend-a:8080</code> -> auf <code>backend-a:80</code> korrigieren.</li>
<li><span class="kw">Pfadfehler:</span> in <code>/service/b</code> fehlt der Trailing Slash bei <code>proxy_pass</code> -> <code>proxy_pass http://backend_b/;</code>.</li>
</ol>
<p><span class="kw">Check:</span> beide Routen funktionieren wieder.</p> <p><span class="kw">Check:</span> beide Routen funktionieren wieder.</p>
<pre><code>curl http://localhost:8080/service/a
curl http://localhost:8080/service/b
./scripts/compose.sh logs reverse-proxy</code></pre>
</details> </details>
</section> </section>
@@ -321,7 +331,7 @@ make proxy-reload
<h2>Hard (TLS) - Musterloesungen</h2> <h2>Hard (TLS) - Musterloesungen</h2>
<details> <details>
<summary><span class="badge hard">Hard</span> 7) HTTPS mit Easy-RSA</summary> <summary><span class="badge hard">Hard</span> 10) HTTPS mit Easy-RSA</summary>
<p><span class="kw">Dateien:</span> <code>docker-compose.yml</code>, <code>proxy/nginx.conf</code>, <code>certs/easyrsa/*</code></p> <p><span class="kw">Dateien:</span> <code>docker-compose.yml</code>, <code>proxy/nginx.conf</code>, <code>certs/easyrsa/*</code></p>
<p><span class="kw">Commands noetig:</span> ja</p> <p><span class="kw">Commands noetig:</span> ja</p>
<pre><code>mkdir -p certs/easyrsa <pre><code>mkdir -p certs/easyrsa
@@ -337,13 +347,15 @@ cd certs/easyrsa
- "8080:80" - "8080:80"
- "8443:443" - "8443:443"
volumes: volumes:
- ./certs/easyrsa/pki:/etc/nginx/pki:ro,z</code></pre> - ./certs/live:/etc/nginx/certs:ro,z</code></pre>
<p><span class="kw">Wichtig:</span> Nicht die komplette PKI in den Container mounten. Nur Runtime-Zertifikat + Key bereitstellen.</p>
<p><span class="kw">Nginx TLS-Pfade:</span> <code>ssl_certificate /etc/nginx/certs/localhost.crt;</code> und <code>ssl_certificate_key /etc/nginx/certs/localhost.key;</code></p>
<p><span class="kw">Check:</span> <code>curl https://localhost:8443/service/a</code> (ohne <code>-k</code> nach CA-Import)</p> <p><span class="kw">Check:</span> <code>curl https://localhost:8443/service/a</code> (ohne <code>-k</code> nach CA-Import)</p>
</details> </details>
<details> <details>
<summary><span class="badge hard">Hard</span> 8) HTTP -&gt; HTTPS Redirect</summary> <summary><span class="badge hard">Hard</span> 11) HTTP -&gt; HTTPS Redirect</summary>
<p><span class="kw">Voraussetzung:</span> Challenge 7 abgeschlossen (gleiches Config-File weiterverwenden).</p> <p><span class="kw">Voraussetzung:</span> Challenge 10 abgeschlossen (gleiches Config-File weiterverwenden).</p>
<p><span class="kw">Dateien:</span> <code>proxy/nginx.conf</code></p> <p><span class="kw">Dateien:</span> <code>proxy/nginx.conf</code></p>
<p><span class="kw">Commands noetig:</span> ja</p> <p><span class="kw">Commands noetig:</span> ja</p>
<pre><code>server { <pre><code>server {
@@ -363,8 +375,8 @@ cd certs/easyrsa
</details> </details>
<details> <details>
<summary><span class="badge hard">Hard</span> 9) TLS Haertung + HSTS</summary> <summary><span class="badge hard">Hard</span> 12) TLS Haertung + HSTS</summary>
<p><span class="kw">Voraussetzung:</span> Challenge 7 und 8 abgeschlossen.</p> <p><span class="kw">Voraussetzung:</span> Challenge 10 und 11 abgeschlossen.</p>
<p><span class="kw">Dateien:</span> <code>proxy/nginx.conf</code></p> <p><span class="kw">Dateien:</span> <code>proxy/nginx.conf</code></p>
<p><span class="kw">Commands noetig:</span> ja</p> <p><span class="kw">Commands noetig:</span> ja</p>
<pre><code>ssl_protocols TLSv1.2 TLSv1.3; <pre><code>ssl_protocols TLSv1.2 TLSv1.3;
@@ -381,7 +393,7 @@ openssl s_client -connect localhost:8443 -servername localhost</code></pre>
<h2>Bonus Expert - Wireshark (ausformulierte Referenzloesung)</h2> <h2>Bonus Expert - Wireshark (ausformulierte Referenzloesung)</h2>
<details> <details>
<summary><span class="badge expert">Expert</span> 10) HTTP vs HTTPS sauber analysieren</summary> <summary><span class="badge expert">Expert</span> 13) HTTP vs HTTPS sauber analysieren</summary>
<p><span class="kw">Dateien:</span> keine Pflicht-Datei; optional Wireshark Settings und Keylog-Datei</p> <p><span class="kw">Dateien:</span> keine Pflicht-Datei; optional Wireshark Settings und Keylog-Datei</p>
<p><span class="kw">Commands noetig:</span> ja</p> <p><span class="kw">Commands noetig:</span> ja</p>
<p><span class="kw">Schritt 1 - HTTP Capture:</span></p> <p><span class="kw">Schritt 1 - HTTP Capture:</span></p>
@@ -394,7 +406,7 @@ openssl s_client -connect localhost:8443 -servername localhost</code></pre>
<p><span class="kw">Schritt 2 - HTTPS Capture:</span></p> <p><span class="kw">Schritt 2 - HTTPS Capture:</span></p>
<ol> <ol>
<li>HTTPS muss vorher laufen (Challenge 7).</li> <li>HTTPS muss vorher laufen (Challenge 10).</li>
<li>Filter auf <code>tcp.port == 8443</code> oder <code>tls</code> setzen.</li> <li>Filter auf <code>tcp.port == 8443</code> oder <code>tls</code> setzen.</li>
<li>Request senden: <code>curl https://localhost:8443/service/a</code>.</li> <li>Request senden: <code>curl https://localhost:8443/service/a</code>.</li>
<li>Pakete markieren: <code>ClientHello</code>, <code>ServerHello</code>, <code>Certificate</code>.</li> <li>Pakete markieren: <code>ClientHello</code>, <code>ServerHello</code>, <code>Certificate</code>.</li>
+2 -2
View File
@@ -34,8 +34,8 @@ http {
listen 443 ssl; listen 443 ssl;
server_name localhost; server_name localhost;
ssl_certificate /etc/nginx/pki/issued/localhost.crt; ssl_certificate /etc/nginx/certs/localhost.crt;
ssl_certificate_key /etc/nginx/pki/private/localhost.key; ssl_certificate_key /etc/nginx/certs/localhost.key;
ssl_protocols TLSv1.2 TLSv1.3; ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;