Paparan berkas for Django

critical5 checks

Repositories, environment files, database dumps and backups are the fastest path from reconnaissance to full compromise.

What Django must have

  • /.git and /.svn not reachable
  • /.env, /.env.local and config backups return 404
  • No .sql, .zip or .tar.gz dumps in the web root
  • Debug consoles and admin panels not publicly reachable
  • Directory listing disabled

How to fix it

  1. 1Serve nothing from the web root that is not meant to be public
  2. 2Block dotfiles at the edge and rotate every secret that was exposed

Django context

Python web framework with an ORM and admin interface.

DEBUG=True leaks stack traces and settings. Restrict /admin and rotate SECRET_KEY if it ever leaked.