Skip to content

Commit

Permalink
Merge pull request #181 from romgar/bandit
Browse files Browse the repository at this point in the history
Bandit security linting
  • Loading branch information
LincolnPuzey committed Apr 24, 2021
2 parents 1174c12 + 512a433 commit 3e2a667
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
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

0 comments on commit 3e2a667

Please sign in to comment.