Skip to content

Commit e56e706

Browse files
committed
📝 Switch from uv-secure to uv audit'
1 parent 70d7dde commit e56e706

2 files changed

Lines changed: 63 additions & 12 deletions

File tree

‎docs/productive/git/advanced/hooks/scripts.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ Linter und Formatierer
9292
Python Code Quality Authority
9393
Codequalitätswerkzeuge (und Plugins) für die Programmiersprache Python:
9494

95+
`ruff-pre-commit <https://github.com/astral-sh/ruff-pre-commit>`_
96+
pre-commit-Hook für :doc:`../../../qa/ruff`
9597
`flake8 <https://github.com/PyCQA/flake8>`_
9698
fördert die Durchsetzung eines konsistenten Python-Stils
9799
`autoflake <https://github.com/PyCQA/autoflake>`_

‎docs/productive/security.rst‎

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,76 @@ Sicherheitslücken in seiner eigenen Codebasis oder in seinen Abhängigkeiten
3030
aufweist. Eine offene Sicherheitslücke kann leicht ausgenutzt werden und sollte
3131
so 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

3966
Wenn eine Schwachstelle in einer Abhängigkeit gefunden wird, solltet ihr auf
4067
eine nicht-anfällige Version aktualisieren; wenn kein Update verfügbar ist,
4168
solltet ihr überlegen, die Abhängigkeit zu entfernen.
4269

4370
Wenn 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

Comments
 (0)