Skip to content

Commit 0d5f673

Browse files
committed
📝 Extend seccurity section
1 parent 28624d7 commit 0d5f673

9 files changed

Lines changed: 1008 additions & 387 deletions

File tree

docs/productive/qa/pysa.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ and identifies vulnerable code.
1313
.. seealso::
1414
* `What Is Taint Analysis and Why Should I Care?
1515
<https://dzone.com/articles/what-is-taint-analysis-and-why-should-i-care>`_
16-
* `How Pysa works <https://pyre-check.org/docs/pysa-basics>`_
16+
* `How Pysa works <https://pyre-check.org/docs/pysa-basics/>`_
1717
* `Running Pysa <https://pyre-check.org/docs/pysa-running/>`_
1818
* `Pysa Tutorial
19-
<https://github.com/facebook/pyre-check/tree/main/documentation/pysa_tutorial>`_
19+
<https://github.com/facebook/Pysa/tree/main/documentation/pysa_tutorial>`_
2020

2121
Configuration
2222
-------------

docs/productive/security/dependencies.rst

Lines changed: 602 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
.. SPDX-FileCopyrightText: 2026 cusy GmbH
2+
..
3+
.. SPDX-License-Identifier: BSD-3-Clause
4+
5+
Separating environments
6+
=======================
7+
8+
Current best practice is to separate different environments depending on what is
9+
to be done in each one. For example, in our `cusy.tasks
10+
<https://github.com/cusyio/cusy.tasks>`_ application, a distinction is made
11+
between the following environments:
12+
13+
.. code-block:: toml
14+
:caption: pyproject.toml
15+
16+
[project]
17+
18+
dependencies = [
19+
"rich",
20+
"tinydb",
21+
"typer",
22+
]
23+
24+
[dependency-groups]
25+
dev = [
26+
"pre-commit",
27+
"reuse",
28+
"tox-uv",
29+
"watchgha",
30+
{ include-group = "docs" },
31+
{ include-group = "tests" },
32+
]
33+
docs = [
34+
"furo",
35+
"interrogate",
36+
"matplotlib",
37+
"sphinx-copybutton",
38+
"sphinx-inline-tabs",
39+
"sphinxcontrib-napoleon",
40+
"sphinxext-opengraph",
41+
]
42+
tests = [
43+
"coverage[toml]",
44+
"faker",
45+
"pytest",
46+
"pytest-cov",
47+
]
48+
49+
This means that when the application is running, only the dependencies required
50+
for that purpose are installed; additional dependencies are only installed when
51+
testing or deploying the documentation. Only the development environment
52+
contains all dependencies.
53+
54+
Just as your Python environment should be kept up to date with immutable
55+
references, your :doc:`../git/advanced/hooks/checks` and GitHub Actions should
56+
also be updated regularly.
57+
58+
In the :file:`.pre-commit-config.yaml` file, the versions of the checks and
59+
their hashes should be updated regularly, for example using:
60+
61+
.. code-block:: console
62+
63+
$ uv run prek update --freeze --cooldown-days 7
64+
https://github.com/pre-commit/pre-commit-hooks
65+
updating rev `v6.0.0` -> `3e8a8703264a2f4a69428a0aa4dcb512790b2c8c` (frozen: v6.0.0)
66+
67+
.. seealso::
68+
:doc:`../git/advanced/hooks/prek`
69+
70+
.. _pinact:
71+
72+
Check your GitHub Actions
73+
-------------------------
74+
75+
For GitHub Actions, you can use `pinact
76+
<https://github.com/suzuki-shunsuke/pinact>`_, for example with:
77+
78+
.. code-block:: console
79+
80+
$ pinact run -u --min-age 7
81+
82+
`zizmor <https://docs.zizmor.sh>`_ is a static analysis tool that detects
83+
security vulnerabilities in GitHub Actions workflows – including template
84+
injection, unpinned actions, excessive permissions, credential exposure and
85+
`more than 30 other checks <https://docs.zizmor.sh/audits/>`_. zizmor identifies
86+
vulnerabilities such as those exploited through :ref:`token exfiltration
87+
<token_exfiltration>`.
88+
89+
.. seealso::
90+
* :ref:`zizmorcore`
15.1 KB
Loading

0 commit comments

Comments
 (0)