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

Add security linters #880

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .ci/run-safety.sh → .ci/run-security-linters.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#! /bin/bash

set -x
set -eo pipefail

# {{{ security

# 38678: django-celery-results: no update currently available
# https://github.com/celery/django-celery-results/issues/154
# 39253: py.path.svnwc DOS
Expand All @@ -15,3 +21,14 @@ poetry run safety check \
-i 40291 \
-i 41002 \
--full-report

# }}}

CODE_DIRS=(relate course accounts)

# FIXME: Also use https://semgrep.dev/p/owasp-top-ten
poetry run semgrep --config "p/ci" "${CODE_DIRS[@]}"

poetry run bandit -r -c pyproject.toml "${CODE_DIRS[@]}"

# vim: foldmethod=marker
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
poetry run flake8 --extend-ignore Q000 tests
- name: "Mypy"
run: poetry run mypy relate course
- name: "Safety"
run: bash ./.ci/run-safety.sh
- name: "Security linters"
run: bash ./.ci/run-security-linters.sh
- name: "Sphinx"
run: |
cp local_settings_example.py local_settings.py
Expand Down
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ mypy:
<<: *quality
script: poetry run mypy relate course

safety:
security-lint:
<<: *quality
script: bash ./.ci/run-safety.sh
script: bash ./.ci/run-security-linters.sh

Python 3:
<<: *test
Expand Down
Loading