13 lines
624 B
Markdown
13 lines
624 B
Markdown
# 06 — Bezpieczeństwo Kodu (AppSec: Path Traversal, Redakcja Sekretów)
|
|
|
|
Teoria: [notes/07-appsec-and-secure-coding.md](../../../notes/07-appsec-and-secure-coding.md)
|
|
|
|
## Zadania (`appsec.go`)
|
|
1. `SafeJoin(baseDir, relPath string) (string, error)` — bezpiecznie połącz `baseDir` z `relPath`. Odrzuć ścieżki absolutne i próby wyjścia poza `baseDir` (`../../etc/passwd`) błędem `ErrPathTraversal`.
|
|
2. `RedactSecrets(logLine string) string` — zamaskuj wartości po `Bearer `, `token=` i `password=` na `***`.
|
|
|
|
## Uruchomienie testów
|
|
```bash
|
|
make test PKG=./exercises/02-engineering-2026/06-security-appsec
|
|
```
|