Skip to content

checks: Exclude vendored code from bandit scanning - #7699

Merged
echoix merged 1 commit into
OSGeo:mainfrom
cwhite911:bandit-exclude-vendored
Jul 15, 2026
Merged

echoix merged 1 commit into
OSGeo:mainfrom
cwhite911:bandit-exclude-vendored

Conversation

@cwhite911

Copy link
Copy Markdown
Contributor

This addresses 13 open code scanning (Bandit) alerts that all point into vendored code GRASS does not maintain:

  • python/libgrass_interface_generator/ (vendored ctypesgen): 4x B102 (exec), 4x B403 (pickle import), 1x B605, 1x B307, 1x B602, 1x B607
  • python/grass/temporal/ply/ (vendored PLY): 1x B307 (eval)

Both directories are already excluded from pylint (ignore-paths) and from the formatter (extend-exclude) in pyproject.toml, so this brings bandit in line with existing practice for vendored code.

Verified locally with bandit 1.9.4 (the version currently used in CI): before the change, bandit -c pyproject.toml -iii -r on the two directories reports exactly the 13 findings above; after the change it reports none.

This is part of a larger effort to work through the open code scanning alerts, grouped into small PRs by issue type.

Written with the assistance of Claude Code.

Bandit scans the vendored ctypesgen copy in
python/libgrass_interface_generator and the vendored PLY copy in
python/grass/temporal/ply, reporting 13 findings (B102, B403, B605,
B307, B602, B607) in code GRASS does not maintain. Exclude both
directories, matching the existing pylint ignore-paths and formatter
extend-exclude entries.
@github-actions github-actions Bot added the Python Related code is in Python label Jul 14, 2026
@echoix

echoix commented Jul 14, 2026

Copy link
Copy Markdown
Member

@cwhite911 You can create the commit message

@echoix
echoix merged commit f85545a into OSGeo:main Jul 15, 2026
26 checks passed
@github-actions github-actions Bot added this to the 8.6.0 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants