I would like to do access control based on committer's IP. I.e., allow pushing from development IPs and deny pushing from staging/production IPs. I am using Git Essentials/Git Stash and my git pushes are via the ssh protocol.
Without finding a better approach with Git Stash, I am trying to add a pre-receive hook (perl script) suggested by the following:
http://search.cpan.org/~mschilli/SVN-Utils-ClientIP-0.02/ClientIP.pm
Since it is based on lsof I have to run stash as root by setting the STASH_USER variable as root, which is not good from security stand point. Long story short, I got the pre-receive perl script to detect committer's IP correctly on a plain Git server, but in the Git Essential context, the script is not able to detect IP, likely due to the difference in inter-process mechanisms.
Is there better approaches and plugins that allows one to do IP-based access control?
Thank you very much for your comments.