Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

914
Views
Whitelist IP - Mongodb Atlas & Heroku

I'm deploying a backend server (node/express) on Heroku. It's using Mongodb Atlas as database and the application is hosted on Heroku.

During development I have accepted to "allow access from anywhere" which works fine, but for production I believe this is a security risk. I can't seem to find an IP address for my Heroku server as it seems to be changing from time to time.

Any best practices which are somewhat easy to implement but also safe?

enter image description here

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

There is a great article here that talks about how they solved this issue and they did it by using Fixie which provides static IP addresses that solve the issue you are dealing with. I would recommend this over some other options I have provided below.

You can find all Heroku IP ranges with the following command:

HEROKU_REGION=eu; sudo apt -qqy install curl jq 2>/dev/null 1>/dev/null; heroku regions --json 2>/dev/null | jq ".[] | select(.name==\"$HEROKU_REGION\") | .provider.region" | (REGION=$(cat); curl -s https://ip-ranges.amazonaws.com/ip-ranges.json |  jq ".prefixes[] | select(.region==$REGION) | .ip_prefix")

Taken from this answer

also,

Heroku dynos use a subset of IP range of AWS EC2 instances, one can add the AWS IP ranges to the Cloud Atlas' whitelist, or get an add-on to provide a static outbound IP address, or to use a secure communication via TLS.

taken from a comment on this answer

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!