Skip to main content

django_octo_security

License: MIT Python Framework: Django Package Manager: Rye PyPI Version Latest on Django Packages Tests: pytest BDD: Behave Load Test: Locust CI Code Style: PEP 8 PyPI Provenance

Enterprise-ready, non-intrusive Django runtime security posture and zero-dependency environment CVE audit module under the Django-Octo architecture.


Core Philosophy: Non-Intrusive Dual Access

django-octo-security is engineered to plug into any existing Django application without altering your host project's native logic, templates, or root routes:

  1. Public/Internal Posture Endpoint (/security-audit/): Single-query database lookup (CveAuditScan.objects.first()) rendering enforced HTTP security headers and the latest environment vulnerability audit status.
  2. Native Django Admin Integration (Security > CVE Checker): Automatically registers a dedicated administrative module in the left sidebar of /admin/ with one-click environment scanning (Run CVE Environment Audit), querying the official OSV.dev vulnerability database via Python standard library (importlib.metadata + urllib.request) with zero external runtime dependencies.

Security & Audit Architecture

Layer Mechanism / Target Engineering Purpose
01 Clickjacking Shield Enforces X-Frame-Options: DENY to prevent unauthorized iframe embedding.
02 MIME Sniffing Guard Enforces X-Content-Type-Options: nosniff against content-type confusion attacks.
03 Referrer Isolation Applies Referrer-Policy: strict-origin-when-cross-origin to prevent token leakage.
04 Single-Query Posture View Renders /security-audit/ in a single ORM query for high-throughput scalability.
05 Runtime Introspection Reads active virtual environment packages via native importlib.metadata.
06 Batch OSV Vulnerability Query Cross-references all installed PyPI packages against api.osv.dev/v1/querybatch.
07 Advisory Enrichment & Fixes Resolves CVE aliases, patched versions, and official references per vulnerability.
08 Immutable Audit Persistence Stores historical snapshots (CveAuditScan) directly in the host database.

Plug-and-Play Installation

Install the official package directly into any modern Django (>=6.1.2) and Python (>=3.12) infrastructure using pip or Rye:

1. Clone & Synchronize Environment

Clone the repository and trigger the Rust-backed Rye environment compiler to lock and synchronize dependencies:

git clone https://github.com/jeanpmodev/django_octo_security.git
cd django_octo_security
rye sync

2. Register in settings.py

Add "django_octo_security" to your INSTALLED_APPS:

INSTALLED_APPS = [
    # ... your existing apps
    "django_octo_security",
]

3. Include the Audit Route in urls.py

Including the module at the root preserves your host application's homepage (/) and mounts the posture report at /security-audit/:

from django.contrib import admin
from django.urls import include, path

urlpatterns = [
    path("admin/", admin.site.urls),
    path("", include("django_octo_security.urls")),
]

4. Apply Migrations

python3 manage.py migrate

5. Initialize Runtime Service

Fire up the local development engine instance:

python3 manage.py runserver

Navigate to 127.0.0.1:8000/security-audit/ to inspect live.


Usage

  • Security Posture Screen: Navigate to http://127.0.0.1:8000/security-audit/ to inspect active HTTP security policies and the latest environment CVE audit badge.
  • Admin CVE Checker: Log in to http://127.0.0.1:8000/admin/, open Security > CVE Checker in the left navigation bar, and click Run CVE Environment Audit at the top right to scan all installed Python packages in real time.

Quality Assurance & Testing

This module is backed by a dedicated QA suite covering Unit & Query-Count Tests (pytest), BDD Specifications (behave), and Load Testing (locust). To keep the core package minimal, test dependencies are installed on demand—see TESTING.md for instructions and benchmark reports.

📄 License & Ecosystem Blueprint

Distributed under the permissive terms of the MIT License.

Metadata

Release files for django-octo-security 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-octo-security 0.1.0
File Size Uploaded Provenance Actions
django_octo_security-0.1.0.tar.gz 217.6 kB With provenance Details for django_octo_security-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-octo-security 0.1.0
File Interpreter ABI Platform Actions
django_octo_security-0.1.0-py3-none-any.whl Python 3 none any Details for django_octo_security-0.1.0-py3-none-any.whl

Total release size: 230.7 kB

Release files / django_octo_security-0.1.0.tar.gz

Download URL django_octo_security-0.1.0.tar.gz
Size 217.6 kB
Tags Source
SHA-256 checksum
How to use checksums
51cd6d0dbb0cf0afc4ae94d40f034fd6f672b2b5badbcea66dbe1ef5175d0710
BLAKE2b-256 checksum
How to use checksums
d09b24ec7f8096f9194cfce5c27d82a82842125ec3d3581b75b4639fa9e81ba0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Release files / django_octo_security-0.1.0-py3-none-any.whl

Download URL django_octo_security-0.1.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92dd3c4674a7b92d2e39bc6b0dc256b39e94794caa7d24b39a71abccde85216b
BLAKE2b-256 checksum
How to use checksums
803c8b684ab29dfadacefa90f689aa77524097925af9b63d3c74363bb17d84f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Security for django-octo-security 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_octo_security-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page