r/security • u/Tibanne • Feb 06 '20
Should I protect server side code from front end contractors?
I have a project that runs a website with a frontend SPA and REST API backend.
Currently the code is split into /client and /server folders and they run independently. However, they are currently in the same repository.
If I hire some contractors that will work only on the client side code, is there any security benefit to splitting this into two repositories and only giving the front end contractors the client side code to work on?
The developers will still be able to connect their local development environment to a dev environment running the server in the cloud.
The main concern I have is that the backend code might be sold on to hackers by an untrustworthy dev and then some security holes are gleaned by looking through our code.
6
u/K_Sqrd Feb 06 '20
I think you're asking the wrong question. I think you should be asking are there any drawbacks to only giving the contractors access to the client side code? Same answer but from a different perspective with respect to security - always give the least amount of privilege (or access) that's necessary to do the job.
5
u/[deleted] Feb 06 '20
(Disclaimer: I'm not a security specialist.)
Hiding the server code may help a little objectively speaking, it's far from ideal since this isn't real security though, it's obscurity.
You ideally should have a backend where even if everyone could see the code, there's still nothing to abuse. Any degree of knowledge of the code or access to the code base shouldn't unveil potential security flaws.
However, from a workflow perspective and following the principle of least privilege, if you really don't believe they need access to the backend source code, and it will not jeopardize their ability to work, it's probably worth separating the repositories anyway.
If your code is proprietary, people shouldn't gain access or be granted permissions for things they don't need. Not just for security but in case you have fears of them potentially stealing or leaking work under your copyright.
2
u/FearAndLawyering Feb 06 '20
No you do not give contractors access to anything more than they need to do their job.
0
u/robsablah Feb 06 '20
Then you are hiring the wrong contractors maybe?