Good day. Maybe a very stupid solution to my question. Lets say I have a multi-tenant app I create for the construction industry. So the app support different tenants. Business 1 buys the app using a monthly fee. Business 2 buys the app using a monthly fee. I give Business 1 one ADMIN person and the person will have the role of ADMIN. I limit the Users table in such a way that only ADMINs can register new users for their Business. I use a field that will register new users under Business 1. Let’s call the field “company” and set the value to Business 1. Every new User then gets registered with a field to identify which company.
Every business creates new projects in a Table called “projects”. I can create projects for different businesses in the same table. Same for Business 2.
So let’s say that for some reason the ADMIN person accidentally shares his details with a person that wants to cause damage. That person gets the credentials of the ADMIN person, creates his own version of the ADMIN app (he has the API Keys from decoding my app and can see my API calls) and starts creating users for different Businesses as he will have rights to register new Users in the table. OR another user with another role assigned are able to create projects in the projects table. His details get compromised by a malicious attacker and are now able to create projects for any business.
That ADMIN person has access now to the whole Users table and can then change the “company field” should he choose?
How can I secure this? Sorry if this is a stupid question. I am new to multi tenant apps.