Guidelines on using django-tenants in a secure manner
See original GitHub issueAre there any guidelines on using django-tenants in a secure manner?
I can think of at least one issue by which using django-tenants could lead to a security vulnerability. By having 'django.contrib.sessions'
in SHARED_APPS
, can’t a user in one sub-domain/tenant impersonate a user in some other sub-domain/tenant?
While I am not sure if my guess is correct, we should have a section on security in the documentation and also have checks in the code that will catch insecurely configured projects.
Issue Analytics
- State:
- Created 8 years ago
- Comments:20 (15 by maintainers)
Top Results From Across the Web
Guidelines on using django-tenants in a secure manner #52
We don't want a user who logically belongs to one tenant to access data in a different one. We have a custom middleware...
Read more >Using django-tenants — django_tenants dev documentation
Creating a tenant works just like any other model in django. The first thing we should do is to create the public tenant...
Read more >Use django-tenant-schemas to Create a Multi-Tenant App
Easier version management. · The data is secure and private because it is stored in independent databases. · Having multiple database instances ...
Read more >A guide to design and develop a multi-tenant, secure and ...
In this guide you would learn how to use open technology stacks and a set of cloud services & platforms (that provide free...
Read more >Securing Open Source Clouds Using Models
We detail the implementation of these models in Django Web Framework and also show how to use the behavioral interfaces to implement a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In a recent project, we have
auth
models in the public tenant and other models in the private ones. We don’t want a user who logically belongs to one tenant to access data in a different one. We have a custom middleware immediately afterdjango.contrib.auth.middleware.AuthenticationMiddleware
which raises 403 in case of cross-tenant access.@suriya Thanks for pointing this out. Yes it is a problem if you have you session table in your tenant I have proved it on two different projects. I agree we need to document this out. Please do as @kosz85 states and have the session table in each tenant. I will work on the documentation over the next week.