Skip to main content

Flake8 plugin adding some checks to make Python code adhere to more secure coding standard

Project description

Flake8 Secure Coding Standard Plugin

PyPI version CI Build CodeQL

flake8 plugin that enforces some secure coding standards.

Installation

pip install flake8-secure-coding-standard

Flake8 codes

Code Description
SCS100 Use of os.path.abspath() and os.path.relpath() should be avoided in favor of os.path.realpath()
SCS101 Use of eval() and exec() represent a security risk and should be avoided
SCS102 Use of os.system() should be avoided
SCS103 Use of shell=True in subprocess functions should be avoided
SCS104 Use of tempfile.mktemp() should be avoided, prefer tempfile.mkstemp()
SCS105 Use of yaml.load() should be avoided, prefer yaml.safe_load() or yaml.load(xxx, Loader=SafeLoader)
SCS106 Use of jsonpickle.decode() should be avoided
SCS107 Use of debugging code shoud not be present in production code (e.g. import pdb)
SCS108 assert statements should not be present in production code

Pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

-   repo: https://gitlab.com/pycqa/flake8
    rev: 3.7.8
    hooks:
    -   id: flake8
        additional_dependencies: [flake8-secure-coding-standard]

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

flake8-secure-coding-standard-1.0.1.tar.gz (16.5 kB view hashes)

Uploaded Source

Built Distribution

flake8_secure_coding_standard-1.0.1-py2.py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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