@@ -335,32 +335,33 @@ the vulnerabilities that need to be taken into account when using the library.
335
335
336
336
Addressing common vulnerabilities in Github Actions
337
337
---------------------------------------------------
338
- Vulnerabilities can exist in continuous integration pipelines the same way can exist in the codebase.
339
- Therefore, it is important to secure your actions / workflows against known vulnerabilities to prevent
340
- security breaches and supply chain attacks .
338
+ Vulnerabilities can exist in continuous integration (CI) pipelines just as they can in a codebase.
339
+ To reduce the risk of security breaches and supply chain attacks, it is important to secure your
340
+ GitHub Actions workflows against known vulnerabilities .
341
341
342
- `zizmor `_ is a static analysis tool that can help audit Github Actions CI/CD setups. It provides functionality
343
- for detecting common vulnerabilities and in some cases, fixing them. Refer to ` zizmor audit rules `_ for detailed
344
- information about the rules ` zizmor ` applies when auditing workflows.
342
+ `zizmor `_ is a static analysis tool that audits GitHub Actions CI/CD setups. It detects common
343
+ vulnerabilities and, in some cases, can automatically fix them. For detailed information about
344
+ the rules that zizmor applies when auditing workflows, see ` zizmor audit rules `_ .
345
345
346
346
Auditing CI/CD setups in the PyAnsys ecosystem
347
347
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348
- The recommended workflow auditing process for PyAnsys ecosystem projects is using the ``ansys/actions/check-actions-security ``
349
- action. The action is wraps ``zizmor `` lightly to provide additional functionalities and configurations sensible for projects
350
- within the ecosystem. Refer to `the check-actions-security-action documentation `_ for information on how to set it up.
348
+ For PyAnsys ecosystem projects, the recommended way to audit workflows is to use the
349
+ ``ansys/actions/check-actions-security `` action. The action wraps ``zizmor `` and provides
350
+ additional functionality and configuration tailored to PyAnsys projects. For setup instructions,
351
+ see `the check-actions-security-action documentation `_.
351
352
352
- How to fix common issues detected by ``zizmor ``
353
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
354
- This section provides information on fixing common workflow vulnerabilities. Project maintainers can also consult the
355
- following pull requests for examples of workflows / actions already fixed within the PyAnsys ecosystem:
353
+ Fixing common issues detected by ``zizmor ``
354
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
355
+ This section describes how to fix common workflow vulnerabilities.
356
+ For practical examples, see these pull requests with fixes already applied in the PyAnsys ecosystem:
356
357
357
358
- `Ansys actions security fixes 1 `_
358
359
- `Ansys actions security fixes 2 `_
359
360
- `Ansys actions security fixes 3 `_
360
361
- `PyConverter-XML2Py security fixes `_
361
362
362
- For vulnerabilities not list here, refer to `zizmor audit rules `_ for remediation steps. For more examples on fixing
363
- issues detected by zizmor, consult `zizmor trophy case `_.
363
+ For vulnerabilities not listed here, refer to `zizmor audit rules `_ for remediation steps.
364
+ For additional examples of fixes, see the `zizmor trophy case `_.
364
365
365
366
**artipacked **
366
367
@@ -390,8 +391,8 @@ issues detected by zizmor, consult `zizmor trophy case`_.
390
391
391
392
.. note ::
392
393
393
- When `` git `` commands requiring credentials to be persisted are executed in subsequent steps
394
- within the same job, this vulnerability can be ignored. See `ignoring zizmor results `_
394
+ When you run git commands that require persisted credentials in subsequent steps within the same job,
395
+ you can ignore this audit finding. For details, see `ignoring zizmor results `_
395
396
396
397
**unpinned-uses **
397
398
@@ -425,12 +426,13 @@ issues detected by zizmor, consult `zizmor trophy case`_.
425
426
426
427
.. note ::
427
428
428
- ``ansys/actions/check-actions-security `` has a ``trust-ansys-actions `` option that allows using tags
429
- for ``ansys/actions ``. With this option, only external actions need to be pinned.
429
+ The ``ansys/actions/check-actions-security `` action has a ``trust-ansys-actions `` option that
430
+ allows you to use tags for ``ansys/actions ``.
431
+ When this option is enabled, you only need to pin external actions.
430
432
431
433
.. tip ::
432
434
433
- The `pinact `_ tool can be used to automatically pin versions of actions and reusable workflows.
435
+ You can use the `pinact `_ tool to automatically pin versions of actions and reusable workflows.
434
436
435
437
**github-env **
436
438
@@ -561,8 +563,7 @@ issues detected by zizmor, consult `zizmor trophy case`_.
561
563
.. note ::
562
564
563
565
The trick is to pass state between steps using ``GITHUB_OUTPUT `` instead of ``GITHUB_ENV `` or ``GITHUB_PATH ``.
564
- For commands expected to run on ``cmd `` or ``pwsh `` on windows runners, the principle is the same, only the
565
- syntax changes.
566
+ On Windows runners, the same principle applies when running commands in ``cmd `` or ``pwsh ``; only the syntax differs.
566
567
567
568
**template-injection **
568
569
@@ -638,12 +639,12 @@ issues detected by zizmor, consult `zizmor trophy case`_.
638
639
639
640
.. note ::
640
641
641
- Notice that RUNNER_TEMP and GITHUB_WORKSPACE were not explicitly set in the ``env `` block. This
642
- is because some github context variables have corresponding environment variables, such as `` runner.temp ``
643
- and ``github.workspace `` in this case.
642
+ Notice that `` RUNNER_TEMP `` and `` GITHUB_WORKSPACE `` were not explicitly set in the ``env `` block.
643
+ Some GitHub context variables automatically map to environment variables, such as
644
+ `` runner.temp `` to `` RUNNER_TEMP `` and ``github.workspace `` to `` GITHUB_WORKSPACE ``
644
645
645
- When corresponding environment variables are not automatically available, they must be set in the
646
- `` env `` block of the job or step where they are needed before they can be used .
646
+ If a corresponding environment variable is not automatically available, you must set it in the `` env ``
647
+ block of the job or step where it is needed before you can use it .
647
648
648
649
**excessive-permissions **
649
650
@@ -784,23 +785,34 @@ Ignoring ``zizmor`` findings
784
785
785
786
One-off comments
786
787
++++++++++++++++
787
- While auditing workflows with zizmor, you may have to ignore audit findings that are not relevant
788
- to your workflows. zizmor audits are ignored by adding a comment to any line within the span where
789
- the audit finding is located, so long as it can be identified as a YAML comment.
788
+ While auditing workflows with ``zizmor ``, you might need to ignore findings that are not relevant to your workflows.
789
+ You can ignore ``zizmor `` audits by adding a YAML comment on any line within the span of the finding.
790
790
791
- The comment should be in the format ``# zizmor: ignore[rulename] ``, where ``<rulename> `` is audit rule type.
792
- To ignore ``artipacked `` for example, ``# zizmor: ignore[artipacked] `` would be added. Ignoring
793
- multiple audits within the same span is achieved by separating each rule with a comma, e.g.
794
- ``zizmor: ignore[github-env,template-injection] ``.
791
+ Use the following format:
795
792
796
- For more information, refer to `ignoring zizmor results `_.
793
+ .. code :: yaml
794
+
795
+ # zizmor: ignore[<rule-name>]
796
+
797
+ For example, to ignore the ``artipacked `` rule:
798
+
799
+ .. code :: yaml
800
+
801
+ # zizmor: ignore[artipacked]
802
+
803
+ To ignore multiple rules in the same span, separate them with commas:
804
+
805
+ .. code :: yaml
806
+ # zizmor: ignore[github-env,template-injection]
807
+
808
+ For more information, see `ignoring zizmor results `_.
797
809
798
810
``zizmor.yml `` configuration file
799
811
+++++++++++++++++++++++++++++++++
800
- A ``zizmor.yml `` configuration file is easier to maintain than one-off comments when ignoring multiple
801
- findings or entire files .
812
+ If you need to ignore multiple findings or entire files, a ``zizmor.yml `` configuration file is
813
+ easier to maintain than one-off comments .
802
814
803
- A ``zizmor.yml `` may look like the following :
815
+ A ``zizmor.yml `` file might look like this :
804
816
805
817
.. code :: yaml
806
818
@@ -818,9 +830,9 @@ A ``zizmor.yml`` may look like the following:
818
830
819
831
This configuration file achieves the following:
820
832
821
- - Declares that ``ansys/actions `` can be pinned with tags but ``actions/* `` must be pinned with a SHA.
822
- - Ignores all ``template-injection `` findings in safe.yml, regardless of line/ column location.
823
- - Ignores any ``template-injection `` findings in somewhat-safe.yml that occur on line 123
824
- - Ignores one ``template-injection `` finding in one-exact-spot.yml that occurs on line 123, column 456
833
+ - Declares that ``ansys/actions `` can be pinned with tags, but ``actions/* `` must be pinned with a SHA.
834
+ - Ignores all ``template-injection `` findings in `` safe.yml `` , regardless of line or column location.
835
+ - Ignores any ``template-injection `` findings in `` somewhat-safe.yml `` that occur on line 123.
836
+ - Ignores one ``template-injection `` finding in `` one-exact-spot.yml `` that occurs on line 123, column 456.
825
837
826
- For more information, refer to `ignoring zizmor results `_.
838
+ For more information, see `ignoring zizmor results `_.
0 commit comments