13 lines
642 B
Markdown
13 lines
642 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 (`src/lib.rs`)
|
|
1. `safe_join(base_dir: &Path, relative_path: &str) -> Result<PathBuf, SecurityError>` — odrzuć ścieżki absolutne (`Path::is_absolute`) oraz zawierające `Component::ParentDir` (`..`), w przeciwnym razie zwróć `Ok(base_dir.join(relative_path))`.
|
|
2. `redact_secrets(log_line: &str) -> String` — zamaskuj wartości po `Bearer `, `token=` oraz `password=` na `***`.
|
|
|
|
## Uruchomienie testów
|
|
```bash
|
|
make test PKG=eng06-security-appsec
|
|
```
|