Skip to content

Commit

Permalink
Add bandit SAST check [RHELDST-18795]
Browse files Browse the repository at this point in the history
Added SAST check for this repository.
  • Loading branch information
rbikar committed Apr 15, 2024
1 parent 8b2c206 commit 08a2e7b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/tox-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,27 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
bandit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Tox
run: pip install tox
- name: Run Tox
run: tox -e bandit
bandit-exitzero:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Tox
run: pip install tox
- name: Run Tox
run: tox -e bandit-exitzero
14 changes: 14 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,17 @@ max-line-length = 100

[pep8]
max-line-length = 100

[testenv:bandit-exitzero]
deps=
bandit
commands=
# Skip B101 low severity assert warnings in the tests directory
bandit -r ./tests --severity-level low --exit-zero --skip B101
bandit -r . -l --exclude './.tox,./tests' --exit-zero

[testenv:bandit]
deps=
bandit
commands=
bandit -r . -ll --exclude './.tox' --confidence-level medium

0 comments on commit 08a2e7b

Please sign in to comment.