Search code examples
gitgithubsshcode-access-security

How to restrict code checkout only to a certain user/machine combination


How to restrict git code checkout only to a certain user/machine combination. Our projects reside in github and the user uses SSH to communicate with github for code access.

If the private key is copied to a different machine (say in his home), its possible to download the source code on a different machine.

We are within a LAN environment and I would prefer to restrict code access strictly to the single machine which is used by developer.

How should I enforce this?


Solution

  • How should I enforce this?

    Not from GitHub itself.

    Only a private git repo hosting server can, with the addition of an authorization layer like gitolite, offer restriction from IP address

    repo foo
        RW+ VREF/FROM/192.168.48.0/23   =   @junior-devs
        -   VREF/FROM                   =   @junior-devs
    

    Here, any user registered in the group "junior-devs" would have access at all to repo foo, unless they access it from 192.168.48.0.