Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README to encourage secure configuration #12

Merged
merged 1 commit into from
Apr 5, 2017
Merged

Update README to encourage secure configuration #12

merged 1 commit into from
Apr 5, 2017

Conversation

anishathalye
Copy link
Contributor

MongoDB by default binds to all interfaces, which means that it'll
accept connections from anywhere. This is really insecure.

@ehzhang ehzhang self-requested a review April 4, 2017 21:03
Copy link
Contributor

@ehzhang ehzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

On a tangent, this should probably also be included for deploy instructions @jlin816, since we haven't really specified how to use .env.config.

Copy link
Contributor

@jlin816 jlin816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think someone who's reading these docs is more likely to copy / paste the setup commands and end up doing exactly what we're not recommending.
It seems better to note that a manual setup is possible but omit how it's done, assuming that people who want the manual setup know what they're doing and can figure it out themselves.

Can you also explain the context of the issue in a bit more detail? As I understand what you've written, in most cases it's set up securely as a daemon when you install on most Linux distributions, but you're saying also that there's some other default setting that's not secure?

@anishathalye
Copy link
Contributor Author

If you run mongod --dbpath db, Mongo binds to all interfaces. You need to specify --bind_ip to explicitly bind to the loopback interface and avoid auto-accepting remote connections.

It's kinda scary how many people recommend running mongod --dbpath db (https://github.com/search?q=%22mongod+--dbpath%22&type=Code&utf8=%E2%9C%93).

If you apt-get install Mongo on Debian, the default /etc/mongod.conf includes reasonably sane settings that have bind IP set to something more restrictive than "all local interfaces", among other things. Most distributions probably do something sane here.

@anishathalye
Copy link
Contributor Author

Related article: https://blog.shodan.io/its-still-the-data-stupid/

@jlin816
Copy link
Contributor

jlin816 commented Apr 5, 2017

Ah okay, I think I understand what you mean now (thought that "not recommended" meant "not secure" the first time I read it). Can we de-emphasize the not-recommended method? I'm thinking very roughly something like "we recommend you run as a daemon with the default installation on most Linux distributions... [code block snippet] ... although not recommended, you can also set Mongo up securely by ... [inline code snippet, probably]."

@ravirahman
Copy link

ravirahman commented Apr 5, 2017 via email

@ehzhang
Copy link
Contributor

ehzhang commented Apr 5, 2017

IMO, for quick local setup, basic instructions for everything involved in making it work (including relevant commands for a database dependency) should be included.

This feels like bikeshedding, which I think can be solved by renaming this section to "Local Development" instead of "Setup". Real recommendations on setup should be expanded upon in a different section.

MongoDB by default binds to all interfaces, which means that it'll
accept connections from anywhere. This is really insecure.
@ravirahman
Copy link

ravirahman commented Apr 5, 2017 via email

@jlin816
Copy link
Contributor

jlin816 commented Apr 5, 2017

Ok, I think this is fine. I'm less concerned about how to install Mongo than being specific about what config we're suggesting here. Sincemongod --dbpath db is so widely used, deviating from that for a somewhat obscure issue should be explained. I had some context from OffiX, but even I was confused initially with what was being suggested.

@jlin816 jlin816 merged commit cd3a705 into techx:master Apr 5, 2017
@anishathalye
Copy link
Contributor Author

I agree with Ravi's comments on not telling people how to configure production servers (for slightly different reasons). I have nothing against giving people advice on how to configure software we haven't written, but I don't think any of us want to put in the effort to fully explain how to configure a production MongoDB instance (and I don't think such an explanation belongs in our README).

I also agree with Edwin -- people have short attention spans, and we want to make it easy for people to quickly start playing around with our software. To this end, I slightly updated my pull request.

But fully revamping the README to differentiate between dev setup and prod setup is out of scope for my pull request. If someone else wants to do that, I think it would be great. Gavel, for example, has a detailed development guide, it has a deploy to Heroku button, and it has a short section in the README about production deployment (and we don't give any advice on setting up the database or anything like that).

krubenok pushed a commit to hackmcgill/McHacks-Registration that referenced this pull request Dec 21, 2017
Update README to encourage secure configuration
jtviolet pushed a commit to jtviolet/fountain that referenced this pull request Aug 13, 2019
Update README to encourage secure configuration
jtviolet pushed a commit to jtviolet/fountain that referenced this pull request Aug 13, 2019
Update README to encourage secure configuration
pshirlyn pushed a commit that referenced this pull request Jan 28, 2020
add navigation links to README.md
koroket pushed a commit to koroket/weddingreg that referenced this pull request Aug 15, 2022
add navigation links to README.md
koroket pushed a commit to koroket/weddingreg that referenced this pull request Sep 19, 2022
add navigation links to README.md
Daniel-Ev-Esc pushed a commit to Daniel-Ev-Esc/quill_pruebas that referenced this pull request Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants