Skip to content

Commit c7f9a26

Browse files
authored
Create bandit.yml
1 parent 0465902 commit c7f9a26

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/bandit.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# Bandit is a security linter designed to find common security issues in Python code.
7+
# This action will run Bandit on your codebase.
8+
# The results of the scan will be found under the Security tab of your repository.
9+
10+
# https://github.com/marketplace/actions/bandit-scan is ISC licensed, by abirismyname
11+
# https://pypi.org/project/bandit/ is Apache v2.0 licensed, by PyCQA
12+
13+
name: Bandit
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "main" ]
20+
schedule:
21+
- cron: '39 10 * * 0'
22+
23+
jobs:
24+
bandit:
25+
permissions:
26+
contents: read # for actions/checkout to fetch code
27+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
28+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
29+
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v2
33+
- name: Bandit Scan
34+
uses: shundor/python-bandit-scan@9cc5aa4a006482b8a7f91134412df6772dbda22c
35+
with: # optional arguments
36+
# exit with 0, even with results found
37+
exit_zero: true # optional, default is DEFAULT
38+
# Github token of the repository (automatically created by Github)
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information.
40+
# File or directory to run bandit on
41+
# path: # optional, default is .
42+
# Report only issues of a given severity level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything)
43+
# level: # optional, default is UNDEFINED
44+
# Report only issues of a given confidence level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything)
45+
# confidence: # optional, default is UNDEFINED
46+
# comma-separated list of paths (glob patterns supported) to exclude from scan (note that these are in addition to the excluded paths provided in the config file) (default: .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg)
47+
# excluded_paths: # optional, default is DEFAULT
48+
# comma-separated list of test IDs to skip
49+
# skips: # optional, default is DEFAULT
50+
# path to a .bandit file that supplies command line arguments
51+
# ini_path: # optional, default is DEFAULT
52+

0 commit comments

Comments
 (0)