Deploy the secrets separately: they don't belong in your site's codebase.
One in every 600 websites has .git exposed
21–30 of 214 posts
Re: One in every 600 websites has .git exposed
#22For Apache, Order deny,allow Deny from all Order allow,deny Deny from all https://serverfault.com/questions/128069/how-do-i-prevent-ap...
Re: One in every 600 websites has .git exposed
#23The author doesn't give any suggestions for alternative ways to deploy. What are the best practices here? What should operators that currently deploy this way do instead?
Like this:
git --git-dir=/foo/bar.git --work-tree=/foo/bar.work init
git --git-dir=/foo/bar.git config receive.denyCurrentBranch ignore
Then create (and chmod +x): /foo/bar.git/hooks/post-update #!/bin/sh
work_tree=/foo/bar.work
GIT_WORK_TREE=$work_tree git checkout -f
Then you just create a symlink to the work tree for your website root, or put the work tree there, or whatever, depending on preference. Can't say this is perfect, but it works pretty well for smaller projects.Re: One in every 600 websites has .git exposed
#24For Apache, Order deny,allow Deny from all Order allow,deny Deny from all https://serverfault.com/questions/128069/how-do-i-prevent-ap...
Re: One in every 600 websites has .git exposed
#25Git is popular, but I find it hard to believe that 1/600 of all websites on the Internet use it.
Re: One in every 600 websites has .git exposed
#26I wonder what would happen if you searched for .svn, too. I'm sure you'd run into the same problem in many places. But would it be more or less likely to occur?
Re: One in every 600 websites has .git exposed
#27If you have the proper secret segregation now, but you're deploying by doing a git pull, now you run the risk of not really having segregated secrets all over again.
Re: One in every 600 websites has .git exposed
#28Earlier quoted context omitted.
I was busy editing it, thanks though. edit: sounded wayyy too snarky lol.
[deleted]
On HN, only two spaces are necessary for code:
example
And it only supports asterisks for italics, two blank lines for paragraphs, and turning URLs into links; it doesn't support any of the rest of Markdown.Re: One in every 600 websites has .git exposed
#29When googleing for "inurl:.git", it returns no results. And on top of that, I need to enter a captcha first?
Re: One in every 600 websites has .git exposed
#30Keeping your entire server-stack up-to-date, making sure you have SSL, using strong encryption for logging-in, hashing the passwords, making sure your server can only be reached via SSH, adding firewalls, filters, etc. etc.
Then some hacker in Eastern Europe comes along (or some beginner at the NSA/GCHQ) and finds out that your .git is exposed and somehow gains all vital user-data and admin data.
Being bashed with a boulder repeatedly would probably be less painful than the torture of knowing "I did it all, but they got me with an HTTP request... because nobody thought of double-checking what our VCS is doing".
How many other glaringly obvious mistakes might be out there right now? I can only imagine.