642 B
642 B
06 — Bezpieczeństwo Kodu (AppSec: Path Traversal, Redakcja Sekretów)
Teoria: notes/07-appsec-and-secure-coding.md
Zadania (src/lib.rs)
safe_join(base_dir: &Path, relative_path: &str) -> Result<PathBuf, SecurityError>— odrzuć ścieżki absolutne (Path::is_absolute) oraz zawierająceComponent::ParentDir(..), w przeciwnym razie zwróćOk(base_dir.join(relative_path)).redact_secrets(log_line: &str) -> String— zamaskuj wartości poBearer,token=orazpassword=na***.
Uruchomienie testów
make test PKG=eng06-security-appsec