Skip to content

Commit 61d1667

Browse files
KillpitLuke Hindslukehinds
authored
add github-actions documentation (#1172)
* add github-actions documentation * made suggested changes to documentation * doc: make suggested change to the file * fix: added index.rst for ci-cd directory * fix: reference ci-cd in toctree * fix: completed all suggested fixes --------- Co-authored-by: Luke Hinds <[email protected]> Co-authored-by: Luke Hinds <[email protected]>
1 parent cea2b1c commit 61d1667

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

doc/source/ci-cd/github-actions.rst

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
GitHub Actions Workflow for Bandit
2+
==================================
3+
4+
This document provides a minimal complete example workflow for
5+
setting up a Code Scanning action using Bandit through GitHub
6+
Actions. It leverages PyCQA's `bandit-action
7+
<https://github.com/PyCQA/bandit-action>`_ for seamless
8+
integration.
9+
10+
Example YAML Code for GitHub Actions Pipeline
11+
---------------------------------------------
12+
13+
Below is an example configuration for the GitHub Actions pipeline:
14+
15+
.. code-block:: yaml
16+
17+
name: Bandit
18+
19+
on:
20+
workflow_dispatch:
21+
22+
jobs:
23+
analyze:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
# Required for all workflows
27+
security-events: write
28+
# Only required for workflows in private repositories
29+
actions: read
30+
contents: read
31+
steps:
32+
- name: Perform Bandit Analysis
33+
uses: PyCQA/bandit-action@v1
34+
35+
Inputs
36+
======
37+
38+
Below is a list of available inputs for the `bandit-action` and
39+
their descriptions:
40+
41+
.. list-table::
42+
:header-rows: 1
43+
:widths: 20 50 10 20
44+
45+
* - Name
46+
- Description
47+
- Required
48+
- Default Value
49+
* - ``configfile``
50+
- Config file to use for selecting plugins and overriding defaults.
51+
- False
52+
- ``DEFAULT``
53+
* - ``profile``
54+
- Profile to use (defaults to executing all tests).
55+
- False
56+
- ``DEFAULT``
57+
* - ``tests``
58+
- Comma-separated list of test IDs to run.
59+
- False
60+
- ``DEFAULT``
61+
* - ``skips``
62+
- Comma-separated list of test IDs to skip.
63+
- False
64+
- ``DEFAULT``
65+
* - ``severity``
66+
- Report only issues of a given severity level or higher. Options include ``all``, ``high``, ``medium``, ``low``.
67+
Note: ``all`` and ``low`` may produce similar results, but undefined rules will not be listed under ``low``.
68+
- False
69+
- ``DEFAULT``
70+
* - ``confidence``
71+
- Report only issues of a given confidence level or higher. Options include ``all``, ``high``, ``medium``, ``low``.
72+
Note: ``all`` and ``low`` may produce similar results, but undefined rules will not be listed under ``low``.
73+
- False
74+
- ``DEFAULT``
75+
* - ``exclude``
76+
- Comma-separated list of paths (glob patterns supported) to exclude from the scan. These are in addition to excluded paths provided in the config file.
77+
- False
78+
- ``.svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg``
79+
* - ``baseline``
80+
- Path of a baseline report to compare against (only JSON-formatted files are accepted).
81+
- False
82+
- ``DEFAULT``
83+
* - ``ini``
84+
- Path to a ``.bandit`` file that supplies command-line arguments.
85+
- False
86+
- ``DEFAULT``
87+
* - ``targets``
88+
- Source file(s) or directory(s) to be tested.
89+
- False
90+
- ``.``

doc/source/ci-cd/index.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. _ci-cd:
2+
3+
Continuous Integration and Deployment (CI/CD)
4+
=============================================
5+
6+
This section provides documentation for setting up Continuous
7+
Integration and Deployment (CI/CD) pipelines for automated
8+
security scanning and quality assurance in this project.
9+
Supported CI/CD Platforms
10+
-------------------------
11+
12+
The following CI/CD platforms are covered:
13+
14+
- **GitHub Actions**: Example workflows for security scanning and quality checks.
15+
Available Documentation
16+
-----------------------
17+
18+
.. toctree::
19+
:maxdepth: 1
20+
21+
github-actions
22+
More CI/CD platforms and configurations may be added over time.
23+
Contributions and improvements to these configurations are
24+
welcome.

doc/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Using and Extending Bandit
1717
plugins/index
1818
blacklists/index
1919
formatters/index
20+
ci-cd/index
2021
faq
2122

2223
Contributing

0 commit comments

Comments
 (0)