security-django

Audit Django security settings and middleware for misconfigurations.

7|2|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/jal-co/jalco-opencode --skill security-django-jal-co
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-django
Source: https://github.com/jal-co/jalco-opencode/tree/main/opencode/.config/opencode/skills/security-django
Command: npx skills add https://github.com/jal-co/jalco-opencode --skill security-django-jal-co

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires rg, and includes scripts (resource) components.

What problem does it solve?

Django projects frequently ship with insecure settings and middleware configurations that expose data and risk compliance. This Skill helps security engineers identify and remediate SECRET_KEY handling, DEBUG, ALLOWED_HOSTS, CSRF protections, and DRF defaults across settings.py, middleware, and views.

Core Features & Use Cases

  • Critical settings auditing: checks SECRET_KEY handling, DEBUG state, and ALLOWED_HOSTS configuration.
  • Middleware & CSRF hardening: verifies presence and order of SecurityMiddleware and CsrfViewMiddleware, and reinforces CSRF usage.
  • DRF & authentication posture: reviews REST framework defaults to ensure authenticated access and proper permissions.

Quick Start

Review a Django project to audit security settings and apply hardening recommendations.

Frequently Asked Questions about security-django

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Django security settings for misconfigurations?

Auditing Django security settings requires scanning settings.py to verify SECRET_KEY handling, DEBUG state, and ALLOWED_HOSTS. This identifies insecure configurations, enforcing environment-based key loading, secure cookies, and proper middleware order.

What does SecurityMiddleware do and how does it protect Django apps?

SecurityMiddleware in Django enforces secure cookies, SSL redirects, and HSTS headers. Auditing its presence and order in settings.py ensures your app hardens against common web vulnerabilities and properly enforces secure transmission policies.

How do I check Django REST Framework defaults for authentication and permissions?

Checking Django REST Framework defaults involves reviewing settings.py to ensure authenticated access and proper permission classes are configured. This verifies DRF posture and prevents unauthorized API endpoints from exposing sensitive data.

Can I use this to audit CSRF protections and middleware order in Django?

Yes, auditing CSRF protections verifies the presence and order of CsrfViewMiddleware in Django settings.py. This reinforces CSRF usage, ensures proper middleware sequencing, and provides remediation guidance for hardening your application.

Does this security audit work with Django projects using manage.py and settings.py?

Yes, the security audit applies to Django projects containing settings.py and manage.py. It scans these files to identify misconfigurations across SECRET_KEY, DEBUG, ALLOWED_HOSTS, CSRF, and REST framework defaults, providing remediation guidance.

Why should I enforce environment-based SECRET_KEY loading in Django?

Enforcing environment-based SECRET_KEY loading in Django prevents hardcoded secrets in settings.py from exposing data. This approach ensures sensitive keys are loaded securely from the environment, reducing compliance risks and potential data breaches.