Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bandit security linting #181

Merged
merged 2 commits into from
Apr 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/security-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Security Linting"

on:
push:
branches: [ master, develop ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
schedule:
- cron: '55 22 14 * *'

jobs:
bandit:
name: Bandit
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install bandit
run: |
python -m pip install --upgrade pip wheel
python -m pip install bandit

- name: Run bandit
# "B101:assert_used" is allowed in tests.
run: |
bandit -r src docs ./setup.py
bandit -r tests --skip B101
3 changes: 2 additions & 1 deletion tests/django_settings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile

SECRET_KEY = 'WE DONT CARE ABOUT IT'
SECRET_KEY = secrets.token_hex()

if "postgresql" in os.getenv("TOX_ENV_NAME", ""):
DATABASES = {
Expand Down