Skip to content

docs(security): proces 'Adding a new dependency' + PR template#183

Closed
mpasternak wants to merge 2 commits into
devfrom
security/dep-review-docs
Closed

docs(security): proces 'Adding a new dependency' + PR template#183
mpasternak wants to merge 2 commits into
devfrom
security/dep-review-docs

Conversation

@mpasternak
Copy link
Copy Markdown
Member

Podsumowanie

PR 11/12 z serii pypi-security-best-practices — praktyki #16
(Consult Vulnerability Databases)
i #17 (Verify Published Package Contents).

Co się zmienia

docs/SECURITY_PRACTICES.md

Nowa sekcja "Adding a new dependency" — 5-minutowy review checklist
dla każdej nowej Python dep:

  1. Vulnerability databases — Snyk Advisor + OSV.dev + GitHub Advisory DB.
  2. Liveness check — ostatni release, contributors, otwarte issues.
  3. Trusted Publisher attestation — badge na PyPI (PEP 740).
  4. Reduce dep tree first (praktyka Feature/xxx rozszerz zrodla #14) — czy stdlib wystarczy?
    requestsurllib.request, python-dotenv → Python 3.13 native.
  5. Wheel availabilityuv lock --check --no-build musi przejść.

Sub-sekcja "Verify published wheel content" dla high-risk packages
(auth/crypto/network) — krok-po-kroku jak rozpakować wheel i porównać
z tagged source. Wykrywa GHA cache poisoning + build-time injection.

.github/PULL_REQUEST_TEMPLATE.md (NOWY plik)

Pierwszy PR template w repo. Sekcje:

  • Co się zmienia + Plan testowy (checkbox listy).
  • Checklist bezpieczeństwa — checkboxy dla:
    • Nowa zależność → link do procesu w SECURITY_PRACTICES.md.
    • Sekrety/.env* → placeholders only.
    • GitHub Actions → zizmor/SHA-pin.
    • Dockerfile → no uv pip install poza lockfile.
  • Powiązane — issue/ticket Freshdesk.

Zależności

Bazuje na security/deterministic-installs (PR #179, tworzy
docs/SECURITY_PRACTICES.md). Po jego mergeu rebase czysto.

Plan testowy

  • pre-commit pass.
  • Po mergeu — następny PR powinien automatycznie pokazać template
    w opisie (rebase'em).

🤖 Generated with Claude Code

Praktyka #4 z lirantal/pypi-security-best-practices (Use Deterministic
Installations).

Audyt wszystkich uv invocations w repo:
- CI workflows (tests.yml, refresh-baseline.yml): --frozen present (good)
- Dockerfile builder + test stages: --frozen present (good)
- Entrypoint scripts: brak uv calls (good - moved to build time per
  obs 17168)
- Makefile prepare-developer-machine-{macos,linux}: BRAK --frozen -
  dodano w tym commicie (pierwsze setup powinno respektowac lockfile)

Wyjatki swiadome (udokumentowane w docs/SECURITY_PRACTICES.md):
- make uv-sync (luzny dla aktywnego dev cycle)
- make live-docs (sphinx-autobuild celowo poza lockfile)
- make enable/disable-microsoft-auth (alternatywa: --extra office365)

Nowy plik docs/SECURITY_PRACTICES.md agreguje polityki bezpieczenstwa BPP
ze wszystkich PR-ow z serii pypi-security-best-practices:
- Deterministyczne instalacje (--frozen)
- Wheel-only policy (PR #177)
- Cooldown przed instalacja (PR #175, #178)
- Eksplicytny indeks PyPI (PR #174)
- SHA-pinning GitHub Actions (PR #176)

Doc zostanie rozbudowany w PR-ach #10 (secrets) i #11 (dep review).
Praktyki #16, #17 z lirantal/pypi-security-best-practices (Consult
Vulnerability Databases / Verify Published Package Contents).

docs/SECURITY_PRACTICES.md - nowa sekcja z 5-minutowym checklist dla
kazdej nowej Python dep:
1. Vulnerability databases: Snyk Advisor + OSV.dev + GitHub Advisory DB
2. Liveness check: ostatni release, contributors, otwarte issues
3. Trusted Publisher attestation badge na PyPI
4. Reduce dep tree first (praktyka #14): czy stdlib wystarczy?
5. Wheel availability check (uv lock --check --no-build)

Sekcja "Verify published wheel content" dla high-risk packages
(auth/crypto/network) - krok-po-kroku jak rozpakowac wheel i porownac
z tagged source (wykrywa GHA cache poisoning, build-time injection).

.github/PULL_REQUEST_TEMPLATE.md - nowy plik z:
- Sekcja "Co sie zmienia" + "Plan testowy"
- Checklist bezpieczenstwa: nowa dep / sekrety / workflowy / Dockerfile
- Sekcja "Powiazane" (issue/ticket)

Bazuje na security/deterministic-installs (PR #179).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant