I have a project (django) running in our office in server. There are some people who have access in server. But I want to do something so that other people (who have access in server) can not read, or write, or edit, or do anything in my project (django)'s source code.
Server is running using Ubuntu OS.
CodePudding user response:
You should take a look at Linux file permissions.
Grant read / write / execute access to the user that run Django app.
Maybe create a group, where this user and you are, and give the group read permissions.
Like that everyone else will not be able to Read / Write / Ex ecute files in the project folder.
This should give these two commands:
(create user / group before and maybe backup before anything if it's a prod server)
sudo chown -R django:django_group /your/folder
sudo chmod -R 750 /your/folder
CodePudding user response:
The trick with permissions will help restrict access to non-privileged users, but the administrator with su can read anything.
So the administrator could read your config, keys, any other credentials or make a backup from PostgreSQL or another database and read data under Django's user credentials that could be found in your config.
You can install your app in the cloud in your infrastructure and if you need to make calls in your internal infrastructure there are a lot of technics - from ssh tunnel to writing a simple proxy app.
