Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
84b4d17
Fix breaking changes in upload-artifact action use
MrFired Apr 25, 2024
7264faa
Upgrade upload-serif action to v3
MrFired Apr 25, 2024
3ab8218
Allow config file specification
MrFired Apr 25, 2024
94a3512
Create dependabot.yml
reactive-firewall Sep 9, 2024
2d60b3a
Update README.md
reactive-firewall Sep 9, 2024
ffce041
Merge pull request #1 from reactive-firewall/dev
reactive-firewall Sep 9, 2024
003ff64
[UPDATE] (deps): Bump github/codeql-action from 2 to 3
dependabot[bot] Sep 9, 2024
5490c83
Update name in action.yml
reactive-firewall Sep 9, 2024
5feae96
Merge pull request #2 from reactive-firewall/dependabot/github_action…
dependabot[bot] Sep 9, 2024
491651b
Merge pull request #3 from reactive-firewall/main
reactive-firewall Sep 9, 2024
3868a74
Update README.md
reactive-firewall Sep 9, 2024
c8b1d56
Merge pull request #4 from reactive-firewall/dev-fixup-1
reactive-firewall Sep 9, 2024
ff1a646
Merge pull request #5 from reactive-firewall/dev
reactive-firewall Sep 9, 2024
637c5c4
Update README.md
reactive-firewall Oct 3, 2024
f8cf05e
Pull useful improvements from Community (#7)
reactive-firewall Nov 13, 2024
c56ff8d
re:re:re updated the usage example in the README.md
reactive-firewall Nov 13, 2024
ba51d0c
Improved Usage Example (#6) Fixed deprecation issue, and added commun…
reactive-firewall Dec 7, 2024
c5150a2
Prepare to merge with upstream fork from shundor/bandit-scan#2
reactive-firewall Apr 11, 2025
e2e29b9
Merge branch 'main' into sync-with-upstream-10
reactive-firewall Apr 11, 2025
ad6fae3
Backport of dependency automation from reactive-firewall/python-bandi…
reactive-firewall Apr 11, 2025
11a72c7
[REVIEW] Simpler defaults for backported dependabot.yml
reactive-firewall Apr 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of action.yml
target-branch: "main"
rebase-strategy: "disabled"
# Labels on pull requests for version updates only
labels:
- "enhancement" # choosen as closest exsisting label
commit-message:
prefix: "[UPDATE] "
include: "scope"
schedule:
interval: "weekly"
day: "tuesday"
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ Bandit is a tool designed to find common security issues in Python code. This ac
To run a bandit scan include a step like this:

```yaml
uses: shundor/bandit-action@v1
with:
path: "."
level: high
confidence: high
exit_zero: true
uses: shundor/python-bandit-scan@v1
with: # optional arguments
path: "."
level: high
confidence: high
# exit with 0, even with results found
exit_zero: true # optional, default is DEFAULT
```

## Inputs
Expand Down Expand Up @@ -66,4 +67,5 @@ The action will create an artifact containing the sarif output.

## Credits

- :bow: This action is based on [bandit-action](https://github.com/mdegis/bandit-action) by [Melih Değiş](https://github.com/mdegis/).
- :bow: This action is based on [bandit-action](https://github.com/mdegis/bandit-action) by [Melih Değiş](https://github.com/mdegis/).
- :bow: This action also includes fixes proposed by [Kenta Nakase](https://github.com/parroty) and [Thiago Grisolfi](https://github.com/Grisolfi) and ["MrFired"](https://github.com/MrFired) ... πŸŽ‰ but automated by [@dependabot[bot]](https://github.com/apps/dependabot)
22 changes: 17 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Bandit Scan'
name: 'Python Bandit Scan'
description: 'Bandit Scan'
branding:
icon: arrow-left
Expand Down Expand Up @@ -32,6 +32,10 @@ inputs:
description: 'path to a .bandit file that supplies command line arguments'
required: false
default: 'DEFAULT'
config_path:
description: 'path to a YAML or TOML file that supplies command line arguments'
required: false
default: 'DEFAULT'
GITHUB_TOKEN:
description: 'Github token of the repository (automatically created by Github)'
required: true
Expand Down Expand Up @@ -102,24 +106,32 @@ runs:
else
INI_PATH="--ini $INPUT_INI_PATH"
fi
bandit -f sarif -o results.sarif -r $INPUT_PATH $LEVEL $CONFIDENCE $EXCLUDED_PATHS $EXIT_ZERO $SKIPS $INI_PATH

if [ "$INPUT_CONFIG_PATH" == "DEFAULT" ]; then
CONFIG_PATH=""
else
CONFIG_PATH="-c $INPUT_CONFIG_PATH"
fi
bandit -f sarif -o results.sarif -r $INPUT_PATH $LEVEL $CONFIDENCE $EXCLUDED_PATHS $EXIT_ZERO $SKIPS $INI_PATH $CONFIG_PATH
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_LEVEL: ${{ inputs.level }}
INPUT_CONFIDENCE: ${{ inputs.confidence }}
INPUT_EXCLUDED_PATHS: ${{ inputs.excluded_paths }}
INPUT_EXIT_ZERO: ${{ inputs.exit_zero }}
INPUT_SKIPS: ${{ inputs.skips }}
INPUT_INI_PATH: ${{ inputs.ini_path }}
INPUT_INI_PATH: ${{ inputs.ini_path }}
INPUT_CONFIG_PATH: ${{ inputs.config_path }}

- name: Upload artifact
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: results.sarif
path: results.sarif
overwrite: true

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif

Expand Down