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 Snyk Vulnerabilities Security Audit OpenSSF Scorecard Socket Badge codecov

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.1

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.1
File Size Uploaded Provenance Actions
django_octo_security-0.1.1.tar.gz 98.7 kB With provenance Details for django_octo_security-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 111.9 kB

Release files / django_octo_security-0.1.1.tar.gz

Download URL django_octo_security-0.1.1.tar.gz
Size 98.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e5b00ef5e36787f311727ef14ee7ca6000e691c9a1d6ce12851b39f4a0d76051
BLAKE2b-256 checksum
How to use checksums
06ea8dfabd180a04952f98934088798f8d5968f2f9c9431415bc01f46e3c76a6
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 15, 2026.

Transparency log

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

Download URL django_octo_security-0.1.1-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f0337900d9311830944d3c186900b63dcc772d1eb1d339bf3d4a5a1bd163bea
BLAKE2b-256 checksum
How to use checksums
8d025b546208e86aa037014fedc8759cd63a751c7cd2bca175fcc3f3bc6a01ac
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 15, 2026.

Transparency log

Security for django-octo-security 0.1.1

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.1.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 15, 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.1 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