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

Remove mongolab addon from Heroku deploy #215

Merged
merged 9 commits into from
Nov 10, 2020

Conversation

rcowsill
Copy link
Contributor

@rcowsill rcowsill commented Oct 10, 2020

As raised in #212, mLab is shutting down their mongolab Heroku addon on November 10th 2020. This is a WIP pull request containing the changes to remove the addon and update documentation.

The functional changes are complete and the next step is the documentation. I'm posting this draft so contributors can comment on the general approach and give feedback on the documentation changes once they are added.

This branch cannot be merged until after PR #214, and it also requires the docker-compose fix from my fix/mongodb-uri branch. It also includes a change to speed up Cypress tests, which can be pulled out if required.

Tasks:

  • Remove mongolab:sandbox addon from app.json
  • Add a MONGODB_URI env variable to app.json (required, default "")
  • Remove reference to the current mLab database from config/env/all.js
  • Remove support for MONGOLAB_URI in config/env/all.js (only needed for the mongolab addon)
  • Update heroku deploy instructions in README.md to cover database setup
  • Update tutorial for A1 - Injection to say NoSQL injection is blocked on deployments using Atlas M0

Collection drop commands were sent without waiting for their completion. The
userId counter insert could complete before the counter collection drop.
In that case the new counter would be deleted
* Make the web service connect to the mongo service, not mLab
* Update readme to remove the "change config" step
* Import NODE_ENV into the web service so the appropriate config is used
* Skip devDependency install by default
* Use lowercase NODE_ENV so Heroku can strip devDependencies in production
* MONGOLAB_URI isn't needed as the mongolab addon has been removed
* Removed the old mlab connection URI as that database will be deleted
* Default db is localhost:27017, for all other cases set MONGODB_URI
  (don't commit database credentials to a public repo)
* Heroku section includes database set up instructions
* "Remote MongoDB" sections cover Atlas instead of mLab
* "Remote MongoDB" sections use MONGODB_URI env var (don't commit DB password)
* Adjusted layout and fixed some typos
@rcowsill
Copy link
Contributor Author

rcowsill commented Nov 1, 2020

Added the updated instructions to the PR.

As well as updating the instructions to cover Atlas instead of mLab, there are some structural changes. The main one is that Heroku is now the last option on the list. The loss of the mLab addon makes it a lot less convenient, as database setup is now required. Also, the local MongoDB and docker setups have become easier to use because they work with the default settings.

The last thing needed to complete this PR is an updated A1 tutorial with a warning that the NoSQL injection vulnerability isn't demonstrable when using Atlas M0.

Feel free to reply in the meantime with any feedback on the documentation or the functional changes.

Also corrected the example connection string, which was in the wrong format
* Moved examples for NoSQL and SSJS attacks into a new panel
* Added a note to the new panel about Atlas M0 (doesn't support js queries)
* Updated log injection section formatting to match the others
@rcowsill
Copy link
Contributor Author

rcowsill commented Nov 2, 2020

This is now ready to review.

As already mentioned, this PR includes #214 as its first commit. The second commit is to fix #213. It also includes ec40213 and fe5b12b to make test turnaround faster. I'm happy to split this up or squash/rebase the changes if desired.

@ckarande ckarande merged commit c44bbd6 into OWASP:master Nov 10, 2020
@rcowsill rcowsill deleted the fix/heroku-db branch November 10, 2020 21:36
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.

2 participants