← ClaudeAtlas

django-securitylisted

Security audit for Django applications including settings.py (SECRET_KEY, DEBUG, ALLOWED_HOSTS), middleware order, ORM raw queries, template autoescape bypass, CSRF protection, Django Admin exposure, authentication backends, file upload handling, and Django-specific patterns. Use this skill whenever the user mentions Django, settings.py, manage.py, Django ORM, Django REST Framework, DRF, makemigrations, urls.py, views.py, or asks "audit my Django app", "Django security review", "Django settings safe". Trigger when the codebase contains `django` in `requirements.txt` / `pyproject.toml`, or `manage.py`, `settings.py`, `urls.py` files.
hlsitechio/claude-skills-security · ★ 1 · API & Backend · score 65
Install: claude install-skill hlsitechio/claude-skills-security
# Django Security Audit Audit Django applications including DRF (Django REST Framework) APIs. ## When this skill applies - Reviewing Django `settings.py` files - Auditing views, models, and templates - Reviewing DRF serializers and viewsets - Checking authentication and permission classes - Auditing Django Admin exposure ## Workflow Follow `../_shared/audit-workflow.md`. ### Phase 1: Stack detection ```bash grep -E '^Django|django' requirements.txt pyproject.toml 2>/dev/null find . -name 'manage.py' -not -path '*/.venv/*' find . -name 'settings.py' -o -name 'settings/*.py' 2>/dev/null python -c "import django; print(django.get_version())" 2>/dev/null ``` ### Phase 2: Inventory ```bash # Settings files find . -name 'settings*.py' -not -path '*/.venv/*' -not -path '*/node_modules/*' # Views find . -name 'views.py' -o -name 'views/' -type d 2>/dev/null # URL configurations find . -name 'urls.py' 2>/dev/null # Raw SQL usage grep -rn '\.raw(\|cursor()\|connection\.cursor' . --include='*.py' 2>/dev/null # Template autoescape disabling grep -rn '|safe\|autoescape off\|mark_safe\|format_html' . --include='*.py' --include='*.html' 2>/dev/null ``` ### Phase 3: Detection — the checks #### `settings.py` audit - **DJG-SET-1** `SECRET_KEY` from environment variable, not committed: ```python SECRET_KEY = os.environ['DJANGO_SECRET_KEY'] ``` Audit: `git log -p settings.py | grep -i secret_key` — if any historical commit has a real secret, rotate. - **DJG-SET-2** `DEBUG