I'm not sure if I'm allowed to post and have one of my newly asked question on both security.stackexchange and unix.stackexchange or not, but I think it is appropriate to ask the question here too since it's about security of using git server and configuring it in a secure way and not only about the typical configuration. So here is what I've faced with several problems during the configuration, and I'd be so grateful if anyone can help.
I'm setting up a git server, and there will be three different groups working on different projects iOS, WebDevel, Android. I need to do it in a secure/safe way.
Meanwhile, I don't want iOS developers to be able to change Android stuff, or vice versa. In other words, I want to restrict any group only to their own project. (Read permission is not an issue, but if you can tell me how I can restrict read permission too, I'll be thankful)
I need your help in configuring the server in a way that Developers can use pull/push/commit through SSH via their public key, but ONLY for their own project! Is there a way to jail them to their own project repo directory? For instance, is there a way to say whenever
X user with the public key of
x_id_rsa.pub or with the request of
email@example.com:~/git/iOS trying to push or pull data, should be jailed to iOS and shouldn't be allowed to add any commit or anything else to other projects?
And the final question is that how can I use different types of policies for each repo directory by SELinux, and how much helpful can it be?
I'm using CentOS 7, please explain in details. I'm open to any suggestion, Thanks in advance.