@@ -30,27 +30,76 @@ Sicherheitslücken in seiner eigenen Codebasis oder in seinen Abhängigkeiten
3030aufweist. Eine offene Sicherheitslücke kann leicht ausgenutzt werden und sollte
3131so schnell wie möglich geschlossen werden.
3232
33- Für eine solche Überprüfung könnt ihr :abbr: `z.B. ( zum Beispiel ) ` `uv-secure
34- <https://pypi.org/project/uv-secure/> `_ verwenden. Alternativ könnt ihr auch
35- `osv <https://pypi.org/project/osv/ >`_ oder `pip-audit
36- <https://pypi.org/project/pip-audit/> `_ verwenden, das auf die `Open Source
37- Vulnerability Database <https://osv.dev> `_ zurückgreift.
33+ Für eine solche Überprüfung könnt ihr :abbr: `z.B. ( zum Beispiel ) ` ``uv audit ``
34+ verwenden. Alternativ könnt ihr auch `osv <https://pypi.org/project/osv/ >`_ oder
35+ `pip-audit <https://pypi.org/project/pip-audit/ >`_ verwenden.
36+
37+ ``uv audit `` ist ein neuer Befehl von uv≥0.11.19, der die Abhängigkeiten in
38+ eurem Projekt auf bekannte Schwachstellen in der `OSV
39+ <https://osv.dev> `_-Datenbank und „nachteilige“ Projektstatus :abbr: `z. B. ( zum
40+ Beispiel ) ` *deprecated * überprüft:
41+
42+ .. code-block :: console
43+
44+ $ uv audit
45+ warning: `uv audit` is experimental and may change without warning. Pass `--preview-features audit-command` to disable this warning.
46+ Resolved 115 packages in 16ms
47+ Found 12 known vulnerabilities and no adverse project statuses in 114 packages
48+
49+ Vulnerabilities:
50+
51+ idna 3.12 has 1 known vulnerability:
52+ - GHSA-65pc-fj4g-8rjx: Internationalized Domain Names in Applications (IDNA): Specially crafted inputs to idna.encode() can bypass CVE-2024-3651 fix
53+ Fixed in: 3.15
54+ Advisory information: https://github.com/kjd/idna/security/advisories/GHSA-65pc-fj4g-8rjx
55+ …
56+
57+ ``uv add ``, ``uv sync `` :abbr: `usw. ( und so weiter ) ` können nun bei jedem
58+ Synchronisierungsvorgang nach zuvor identifizierter Malware suchen. Diese
59+ Funktion ist standardmäßig nicht aktiviert, sie kann jedoch mit
60+ ``UV_MALWARE_CHECK=1 `` in der Shell einfach ermöglicht werden.
61+
62+ .. seealso ::
63+ * `uv audit <https://docs.astral.sh/uv/reference/cli/#uv-audit >`_
64+ * `uv audit settings <https://docs.astral.sh/uv/reference/settings/#audit >`_
3865
3966Wenn eine Schwachstelle in einer Abhängigkeit gefunden wird, solltet ihr auf
4067eine nicht-anfällige Version aktualisieren; wenn kein Update verfügbar ist,
4168solltet ihr überlegen, die Abhängigkeit zu entfernen.
4269
4370Wenn ihr glaubt, dass die Sicherheitslücke euer Projekt nicht betrifft, kann für
44- ``osv `` eine :file: `osv-scanner.toml `-Datei erstellt werden, :abbr: `u.a. ( unter
45- anderem ) ` mit der zu ignorierenden ID und einer Begründung, :abbr: `z.B. ( zum
46- Beispiel ) `:
71+ ``uv audit `` in der :file: `pyproject.toml `-Datei Ausnahmen definiert werden,
72+ :abbr: `z.B. ( zum Beispiel ) `:
4773
4874.. code-block :: toml
75+ :caption: pyproject.toml
76+
77+ [tool.uv.audit]
78+ ignore = ["PYSEC-2022-43017", "GHSA-5239-wwwm-4pmq"]
79+
80+ oder besser:
81+
82+ .. code-block :: toml
83+ :caption: pyproject.toml
84+
85+ [tool.uv.audit]
86+ ignore-until-fixed = ["PYSEC-2022-43017"]
87+
88+ .. seealso ::
89+ * `ignore <https://docs.astral.sh/uv/reference/settings/#audit_ignore >`_
90+ * `ignore-until-fixed
91+ <https://docs.astral.sh/uv/reference/settings/#audit_ignore-until-fixed> `_
92+
93+ Ihr könnt die Schwachstellenanalyse mit ``uv-audit `` auch in eure
94+ :doc: `pre-commit <git/advanced/hooks/pre-commit >`-Checks übernehmen:
95+
96+ .. code-block :: yaml
4997
50- [[IgnoredVulns]]
51- id = "GO-2022-1059"
52- # ignoreUntil = 2022-11-09 # Optional exception expiry date
53- reason = "No external http servers are written in Go lang."
98+ - repo : https://github.com/astral-sh/uv-pre-commit
99+ rev : 73c2d77a42a113aee9e4b748c24937f09557b82d # 0.11.24
100+ hooks :
101+ - id : uv-audit
102+ files : ^(uv\.lock|pyproject\.toml)$
54103
55104 Wartung
56105-------
0 commit comments