1739810044
Align challenge numbering and cross-page links, and clarify Backend C/TLS guidance so participants always see valid routes and safer cert mounting defaults.
322 lines
12 KiB
HTML
322 lines
12 KiB
HTML
<!doctype html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>HTL Workshop Challenges</title>
|
|
<style>
|
|
:root {
|
|
--bg: #081825;
|
|
--panel: #10273d;
|
|
--panel-soft: #163450;
|
|
--text: #e9f2fb;
|
|
--muted: #b7cbdf;
|
|
--accent: #4ecdc4;
|
|
--easy: #59d68a;
|
|
--medium: #ffd166;
|
|
--hard: #ff7b72;
|
|
--expert: #6fb6ff;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
font-family: "Fira Sans", "Segoe UI", sans-serif;
|
|
color: var(--text);
|
|
background:
|
|
radial-gradient(circle at 100% 0%, #1f4060 0%, transparent 45%),
|
|
radial-gradient(circle at 0% 100%, #14324a 0%, transparent 35%),
|
|
var(--bg);
|
|
min-height: 100vh;
|
|
padding: 1.2rem;
|
|
}
|
|
|
|
main {
|
|
width: min(1150px, 100%);
|
|
margin: 0 auto;
|
|
display: grid;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.panel {
|
|
background: var(--panel);
|
|
border: 1px solid #315678;
|
|
border-radius: 14px;
|
|
padding: 1.1rem;
|
|
}
|
|
|
|
h1,
|
|
h2,
|
|
h3 {
|
|
margin-top: 0;
|
|
}
|
|
|
|
p,
|
|
li {
|
|
color: var(--muted);
|
|
line-height: 1.5;
|
|
}
|
|
|
|
a {
|
|
color: var(--accent);
|
|
}
|
|
|
|
code {
|
|
font-family: "JetBrains Mono", "Fira Code", "Consolas", "Liberation Mono", monospace;
|
|
font-size: 0.92em;
|
|
background: #0d1f31;
|
|
border: 1px solid #2d4f6e;
|
|
border-radius: 6px;
|
|
padding: 0.1rem 0.35rem;
|
|
}
|
|
|
|
pre {
|
|
background: #0b2133;
|
|
border: 1px solid #2b5578;
|
|
border-radius: 10px;
|
|
padding: 0.75rem 0.85rem;
|
|
overflow-x: auto;
|
|
margin: 0.65rem 0;
|
|
}
|
|
|
|
pre code {
|
|
display: block;
|
|
background: transparent;
|
|
border: 0;
|
|
border-radius: 0;
|
|
padding: 0;
|
|
font-size: 0.92rem;
|
|
line-height: 1.45;
|
|
white-space: pre;
|
|
}
|
|
|
|
.top-links {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.pill {
|
|
display: inline-block;
|
|
text-decoration: none;
|
|
background: #11314b;
|
|
border: 1px solid #2a5d84;
|
|
border-radius: 999px;
|
|
padding: 0.35rem 0.75rem;
|
|
}
|
|
|
|
.badge {
|
|
display: inline-block;
|
|
border-radius: 999px;
|
|
padding: 0.15rem 0.5rem;
|
|
font-size: 0.8rem;
|
|
font-weight: 700;
|
|
margin-bottom: 0.45rem;
|
|
}
|
|
|
|
.easy {
|
|
color: #08210f;
|
|
background: var(--easy);
|
|
}
|
|
|
|
.medium {
|
|
color: #312200;
|
|
background: var(--medium);
|
|
}
|
|
|
|
.hard {
|
|
color: #3b0905;
|
|
background: var(--hard);
|
|
}
|
|
|
|
.expert {
|
|
color: #031c37;
|
|
background: var(--expert);
|
|
}
|
|
|
|
details {
|
|
background: var(--panel-soft);
|
|
border: 1px solid #2d5577;
|
|
border-radius: 12px;
|
|
padding: 0.75rem 0.85rem;
|
|
margin-bottom: 0.7rem;
|
|
}
|
|
|
|
details:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
summary {
|
|
cursor: pointer;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.kw {
|
|
color: #e9f2fb;
|
|
font-weight: 700;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<section class="panel">
|
|
<h1>Challenges - Reverse Proxy & TLS</h1>
|
|
<p>Manuelle Proxy-Konfiguration, Security-Entscheidungen und TLS von Grund auf.</p>
|
|
<div class="top-links">
|
|
<a class="pill" href="/">Startseite</a>
|
|
<a class="pill" href="/challenges.html">Challenges</a>
|
|
<a class="pill" href="/hints.html">Hints</a>
|
|
<a class="pill" href="/solutions.html">Solutions</a>
|
|
<a class="pill" href="/service/a">Backend A</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>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Abgabe-Format</h2>
|
|
<ul>
|
|
<li>1-3 Minuten Demo</li>
|
|
<li>Done-Check live ausfuehren</li>
|
|
<li>2-3 Saetze: was, warum, welche Wirkung</li>
|
|
</ul>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Easy</h2>
|
|
|
|
<details>
|
|
<summary><span class="badge easy">Easy</span> 1) Routing verstehen (aktiv)</summary>
|
|
<p><span class="kw">Muss:</span> zuerst in <code>proxy/nginx.conf</code> nachsehen, dann testen.</p>
|
|
<p><span class="kw">Warum wichtig:</span> Routing ist die Grundfunktion jedes Reverse Proxys - ohne sauberes Matching ist alles andere instabil.</p>
|
|
<ul>
|
|
<li>Welche <code>location</code> matched <code>/service/a</code>?</li>
|
|
<li>Welcher <code>upstream</code> wird verwendet?</li>
|
|
</ul>
|
|
<pre><code>curl http://localhost:8080/service/a
|
|
curl http://localhost:8080/service/b</code></pre>
|
|
</details>
|
|
|
|
<details id="challenge-2-backend-c">
|
|
<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">Zusatz:</span> <code>backends/c/index.html</code> ist vorhanden und darf angepasst werden.</p>
|
|
<p><span class="kw">Warum wichtig:</span> Neue Services kommen laufend dazu; Erweiterungen ohne Seiteneffekte sind Praxisalltag.</p>
|
|
<pre><code>curl http://localhost:8080/service/c
|
|
curl http://localhost:8080/service/a
|
|
curl http://localhost:8080/service/b</code></pre>
|
|
</details>
|
|
|
|
<details>
|
|
<summary><span class="badge easy">Easy</span> 3) Eigene Route /demo/a</summary>
|
|
<p><span class="kw">Muss:</span> Alias-Route bauen, die auf Backend A fuehrt.</p>
|
|
<p><span class="kw">Warum wichtig:</span> Der Proxy entkoppelt externe Pfade von internen Backend-Implementierungen.</p>
|
|
<pre><code>curl http://localhost:8080/demo/a</code></pre>
|
|
</details>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Medium</h2>
|
|
|
|
<details>
|
|
<summary><span class="badge medium">Medium</span> 4) Security Headers</summary>
|
|
<p>Setze mindestens <code>nosniff</code>, <code>DENY</code>, <code>strict-origin-when-cross-origin</code>, <code>Permissions-Policy</code>, <code>COOP</code>, <code>CORP</code>.</p>
|
|
<p><span class="kw">Optional:</span> CSP fuer statische Seiten.</p>
|
|
<p><span class="kw">Warum wichtig:</span> Diese Header reduzieren konkrete Browser-Angriffsvektoren und gehoeren zur Security-Baseline.</p>
|
|
<pre><code>curl -I http://localhost:8080/</code></pre>
|
|
</details>
|
|
|
|
<details>
|
|
<summary><span class="badge medium">Medium</span> 5) Interne Route absichern</summary>
|
|
<p><span class="kw">Muss:</span> <code>/internal/status</code> nur fuer <code>127.0.0.1</code>.</p>
|
|
<p><span class="kw">Wichtig:</span> Host-Request zeigt typischerweise 403 (Docker-Netzwerk).</p>
|
|
<p><span class="kw">Warum wichtig:</span> Nicht jeder Endpoint darf oeffentlich erreichbar sein; Netzsegmentierung beginnt oft am Proxy.</p>
|
|
<pre><code>curl -i http://localhost:8080/internal/status
|
|
./scripts/compose.sh exec -T reverse-proxy sh -lc "wget -qO- http://127.0.0.1/internal/status"</code></pre>
|
|
</details>
|
|
|
|
<details>
|
|
<summary><span class="badge medium">Medium</span> 6) Logging verbessern</summary>
|
|
<p>Eigenes <code>log_format</code> mit Upstream-Infos einbauen.</p>
|
|
<p><span class="kw">Warum wichtig:</span> Ohne brauchbare Logs dauert Fehleranalyse deutlich laenger und Incident-Response wird unzuverlaessig.</p>
|
|
<pre><code>curl http://localhost:8080/service/a
|
|
./scripts/compose.sh logs reverse-proxy</code></pre>
|
|
</details>
|
|
|
|
<details>
|
|
<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><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
|
|
curl -s http://localhost:8080/service/a | grep -o "Target A2\|Target A"
|
|
done</code></pre>
|
|
</details>
|
|
|
|
<details>
|
|
<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><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>
|
|
<pre><code>curl -I http://localhost:8080/service/a</code></pre>
|
|
</details>
|
|
|
|
<details>
|
|
<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><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
|
|
curl http://localhost:8080/service/b
|
|
./scripts/compose.sh logs reverse-proxy</code></pre>
|
|
</details>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Hard (TLS)</h2>
|
|
|
|
<details>
|
|
<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><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>
|
|
</details>
|
|
|
|
<details>
|
|
<summary><span class="badge hard">Hard</span> 11) HTTP -> HTTPS Redirect</summary>
|
|
<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>
|
|
<pre><code>curl -I http://localhost:8080/service/a</code></pre>
|
|
</details>
|
|
|
|
<details>
|
|
<summary><span class="badge hard">Hard</span> 12) TLS Haertung + Chain + HSTS</summary>
|
|
<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>
|
|
<pre><code>curl -I https://localhost:8443/service/a
|
|
openssl s_client -connect localhost:8443 -servername localhost</code></pre>
|
|
</details>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Bonus Expert</h2>
|
|
|
|
<details>
|
|
<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>
|
|
<ol>
|
|
<li>HTTP auf <code>8080</code> mitschneiden und Klartext zeigen.</li>
|
|
<li>HTTPS auf <code>8443</code> mitschneiden.</li>
|
|
<li><code>ClientHello</code>, <code>ServerHello</code>, <code>Certificate</code> markieren.</li>
|
|
<li>3-5 Bulletpoints: was ist sichtbar, was ist geschuetzt?</li>
|
|
</ol>
|
|
<p><span class="kw">Optional:</span> TLS Decrypt mit <code>SSLKEYLOGFILE</code>.</p>
|
|
<p><span class="kw">Abgabe:</span> mind. 3 Screenshots + technische Interpretation.</p>
|
|
</details>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|