v0.2.0 is now available 🎉

NIS2 Compliance for Django
in 5 Minutes

Forensic logging, active defense, and SIEM integration. The security-first middleware that makes your application compliant by design.

Install via Pip
$ pip install django-nis2-shield
MIT License Open Source Python 3.8+

Everything you need for NIS2

Forensic Logging

Structured JSON/CEF logs signed with HMAC-SHA256. PII encryption built-in for GDPR compliance.

Active Defense

Rate limiting, Tor exit node blocking, and Session Guard to prevent hijacking attempts.

SIEM Ready

Out-of-the-box integration with Elasticsearch, Splunk, and QRadar. Includes Docker dashboard.

How it Works

1

Install

Add the package to your Django project using pip. No complex dependencies.

2

Configure

Add the middleware to your settings.py and define your encryption keys.

3

Comply

Your app is now generating forensic logs and actively defending against threats.

settings.py
MIDDLEWARE = [
    'django.contrib.sessions.middleware.SessionMiddleware',
    # Just add this line!
    'django_nis2_shield.middleware.Nis2GuardMiddleware',
    'django.middleware.common.CommonMiddleware',
]

NIS2_SHIELD = {
    'INTEGRITY_KEY': 'your-secret-key',
    'ANONYMIZE_IPS': True,
    'ENABLE_RATE_LIMIT': True,
    'BLOCK_TOR_EXIT_NODES': True,
}