Skip to main content

Security oriented static analyser for python code.

Project description

Bandit
Build Status Docs Status Latest Version Python Versions Format License Discord

A security linter from PyCQA

Overview

Bandit is a tool designed to find common security issues in Python code. To do this Bandit processes each file, builds an AST from it, and runs appropriate plugins against the AST nodes. Once Bandit has finished scanning all the files it generates a report.

Bandit was originally developed within the OpenStack Security Project and later rehomed to PyCQA.

Bandit Example Screen Shot

Show Your Style

Security Status

Use our badge in your project’s README!

using Markdown:

[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)

using RST:

.. image:: https://img.shields.io/badge/security-bandit-yellow.svg
    :target: https://github.com/PyCQA/bandit
    :alt: Security Status

References

Python AST module documentation: https://docs.python.org/3/library/ast.html

Green Tree Snakes - the missing Python AST docs: https://greentreesnakes.readthedocs.org/en/latest/

Documentation of the various types of AST nodes that Bandit currently covers or could be extended to cover: https://greentreesnakes.readthedocs.org/en/latest/nodes.html

Container Images

Bandit is available as a container image, built within the bandit repository using GitHub Actions. The image is available on ghcr.io:

docker pull ghcr.io/pycqa/bandit/bandit

The image is built for the following architectures:

  • amd64

  • arm64

  • armv7

  • armv8

To pull a specific architecture, use the following format:

docker pull --platform=<architecture> ghcr.io/pycqa/bandit/bandit:latest

Every image is signed with sigstore cosign and it is possible to verify the source of origin using the following cosign command:

cosign verify ghcr.io/pycqa/bandit/bandit:latest \
  --certificate-identity https://github.com/pycqa/bandit/.github/workflows/build-publish-image.yml@refs/tags/<version> \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Where <version> is the release version of Bandit.

Sponsors

The development of Bandit is made possible by the following sponsors:

Mercedes-Benz Tidelift Stacklok

If you also ❤️ Bandit, please consider sponsoring.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bandit-1.8.3.tar.gz (4.2 MB view details)

Uploaded Source

Built Distribution

bandit-1.8.3-py3-none-any.whl (129.1 kB view details)

Uploaded Python 3

File details

Details for the file bandit-1.8.3.tar.gz.

File metadata

  • Download URL: bandit-1.8.3.tar.gz
  • Upload date:
  • Size: 4.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for bandit-1.8.3.tar.gz
Algorithm Hash digest
SHA256 f5847beb654d309422985c36644649924e0ea4425c76dec2e89110b87506193a
MD5 a4e9488464294c935be988cd8a9d0cd5
BLAKE2b-256 1aa5144a45f8e67df9d66c3bc3f7e69a39537db8bff1189ab7cff4e9459215da

See more details on using hashes here.

Provenance

The following attestation bundles were made for bandit-1.8.3.tar.gz:

Publisher: publish-to-pypi.yml on PyCQA/bandit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bandit-1.8.3-py3-none-any.whl.

File metadata

  • Download URL: bandit-1.8.3-py3-none-any.whl
  • Upload date:
  • Size: 129.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for bandit-1.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 28f04dc0d258e1dd0f99dee8eefa13d1cb5e3fde1a5ab0c523971f97b289bcd8
MD5 e8143ede387f575b3f23caaf9d49cc49
BLAKE2b-256 8885db74b9233e0aa27ec96891045c5e920a64dd5cbccd50f8e64e9460f48d35

See more details on using hashes here.

Provenance

The following attestation bundles were made for bandit-1.8.3-py3-none-any.whl:

Publisher: publish-to-pypi.yml on PyCQA/bandit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page