r/AskProgramming • u/Antique_Cod_1686 • May 21 '26
Other How do companies keep their proprietary code safe?
And what repository do they use? Do they use GitHub like most developers but in private mode or do they have their own servers to host their git repositories?
5
Upvotes
39
u/UKAD_LLC May 21 '26
Private repos are standard practice. The scary part usually isn’t GitHub - it’s poorly managed credentials, shared accounts, weak permissions, or ex-employees still having access 😅
33
u/generally_unsuitable May 21 '26
You can actually pay for a locally hosted version of github that has all of the features, but the cloud is in your office with no external access.
That said, it's not really necessary. Git server is free. It just doesn't have all the pretty graphs and stuff.
10
u/rlebeau47 May 21 '26
My company uses GitHub. All of our repos are private within an organization. Only employees have access.
15
u/YMK1234 May 21 '26
Github is not git. It's just a fancy website built around it. There are many others like it, most of which are FOSS and can be self hosted.
11
u/RobertDeveloper May 21 '26
We hosted our electronic patient records system source code on a pentium 3 tower case under someone's desk, the person sitting there sometimes kicked the computer case and we all were afraid it died, but it was ok.
5
u/rolfn May 21 '26
Many have set up their own repositories in their own infrastructure. Not necessarily git, there are many options (but I suppose most new setups use git and many old have migrated)
Or they use a service like GitHub with an enterprise account where they can close it down. Very often integrated with their own access management.
4
u/Weekly_Astronaut5099 May 21 '26
One can host git repository through just ssh connection so Github is really not that necessary.
3
u/garster25 May 21 '26
Yes. Which one depends how secure they want to keep it.
3
u/nawanamaskarasana May 21 '26
I would not trust GitHub for private repo. Back before all this CI-devops stuff I just ran git repos behind ssh on some local machine.
Edit: I now run gitea locally.
4
u/jewishSpaceMedbeds May 21 '26
Self-hosted Git, accessible only from the company's network. Sometimes cloud based, sometimes on prem.
5
u/Otherwise-Safety-579 May 21 '26
a lot, a lot of code is essentially worthless to anyone beyond the immediate client and developer. I'm not saying all, I'm not saying the majority, but a lot of it.
If I found out someone was using my old code and I somehow came across it, I'd only be interested in a diff to see if they better organized it and tamed some of the ugliest parts
2
u/khedoros May 21 '26
One place I worked had a self-hosted CVS server, then switched to Perforce in about 2013. Another used different things for different products. Github private repositories for a lot of things, but self-hosted Perforce for others. My most recent one hosted their own instance of Bitbucket.
2
u/Eubank31 May 21 '26
My company is split between our self hosted Gerrit instance and our private (employee access only) org on GitHub
2
u/xampl9 May 21 '26 edited May 21 '26
We use GitHub in private mode. Our IT staff is good about keeping up with cert renewals, etc. but can’t do anything about a breach on their end.
There are four scenarios we care about - code escaping into the wild, unauthorized changes, total loss of the code (GitHub just .. loses it), and being sued by someone and needing to go back to earlier commits during the discovery process.
Backups protect against most of those, but I’m not sure if they have the full history or are just a snapshot. I shall have to inquire…
At home I run Mercurial on a Raspberry Pi. A project I have been putting off will be getting rsync set up to back it up to the NAS.
2
u/halfuhsandwich May 21 '26
Locally hosted git server
2
u/KingofGamesYami May 21 '26
My org uses three self hosted gitlab instances, a self hosted apache subversion, two self hosted team foundation servers, three azure devops instances, a self hosted bitbucket instance, and a private github instance. That I know of; there could be more.
Lots of M&A history behind this mess.
2
u/DDDDarky May 21 '26
Private server
2
u/huuaaang May 21 '26
Private gitlab/github repos. You can also self-host Gitlab community edition. Or you can easily run your own git server. Though it's not going to have all the CI/CD and other stuff companies have come to rely on.
1
u/vmcrash May 21 '26
own server
1
u/Zealousideal_Sort521 May 21 '26
Usually some poorly secured git server that wouldn’t cost too much
1
u/kirilmetodi-i-bratmu May 21 '26
Several years ago i worked for a company who made casino software.
there was people who was with the company for 15+ years, and there was not a single person who can build the whole stack and run it.
hack over hack over hack over patch over 20+ year old code, the same for infra, patches and hacks all the way to the kernel. no automation, no IaC, the newer software was just scp, ssh and restart systemd, older, needed exact model cpu (think of Pentium 4 2.8 with HT), and there was like 3 models cpu on which that piece of software can be compiled.
taht company, even if they open source the whole thing, no one can build it, people get paid and works there and cant build it.
they had private self-hosted SVN (yep, no git, sorry, better luck in next company).
yet you dont need to keep your source code like a state secret when no one can run it anyway
1
u/Flashy-Whereas-3234 May 22 '26
There's proprietary code, and there's secret sauce.
We generally store both in one place, but we more tightly restrict who in the business gets access to the secret sauce.
Obviously creds and keys and what have you are infra secrets and aren't part of the source, so operational risk of code exposure is more about flaws you can exploit and less about thieving keys.
And if you think our day-to-day systems crud is worth stealing, more fool you. The vast majority would be better rewritten from scratch, if only anyone had time. You think you can prop up our services? We can barely get them running ourselves!
1
u/Floppie7th May 23 '26
We use self-hosted gitlab, and that's been the (slight) majority amongst companies I've worked for. Most of the remainder have used Github private repos, and one used self-hosted Gerrit.
I also use self-hosted gitlab for my open-source projects - I only mirror to gitlab to make it easier for people to discover and contribute if they feel so inclined
1
u/Qs9bxNKZ May 25 '26
On premise GitHub. Private mode. SSO / SAML or LDAP group level access. Policies around key and token rotation.
Next is probably an EMU where you restrict access, cloning and then VPN by IP.
Why?
1
u/PvtRoom May 21 '26
they host it on their own servers, and if they really care, those servers are air gapped, with strict access requirements, but that really depends on what it is and if it's enforced by paranoid men with guns.
nuclear secrets - you want those men with guns.
1
u/-Nyarlabrotep- May 21 '26
Git is far from the only VCS, obviously, so it's a bit of a silly premise. That said, they have their own private infrastructures, using probably a dozen or two different VCSs.
1
u/H4llifax May 21 '26
Self-hosted GitHub Enterprise