Python Forum
Django project deployed to Heroku: Postgres security
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Django project deployed to Heroku: Postgres security
#1
I’ve setup my Django settings.py in such a way that I can access the Postgres instance in the cloud containing my production data in my local development environment by running this command in my local venv shell and in this format:

Quote:$ export DATABASE_URL=’postgres://USER:PASSWORD@HOST:PORT/NAME’`

It’s a very helpful feature. I love it.

As an example, here is a Postgres instance which contains placeholder content:

Quote:$ export DATABASE_URL=‘postgres://shzxdfrkdiilyw:37ec5eee52abf4a772454d55e6a71779c05b6720622e945cad54f4fbf7e6f84d@ec2-54-84-98-18.compute-1.amazonaws.com:5432/dcjnf0h34cfsc5’

You would think that posting the above URI on a public forum like this one is terrible security practices however Heroku gives admins a tool to generate a new Postgres username/password combo. Here is the command:


Quote:(venv) $ heroku pg:credentials:rotate


Before starting this thread, I invoked it. So the hostname, port, and name remain the same, but the new Postgres user/password is completely different.

If an attacker discovered my Postgres username, to brute force a password that is 64 characters long and a 36 charset size, this has 250 bits of entropy making it impossible to crack with current silicon.

Here is my question for all of you now: Since the username/pass is now different, for confirmation and verification, my site is still secure and my data is protected, is this correct?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Star Leapcell: The Python-Friendly Alternative to Heroku + Airtable Hybrid IssacChan 1 439 Feb-01-2024, 06:00 AM
Last Post: Athi
  Deployed Spider on Heroku: How do I email downloaded files? JaneTan 2 1,551 Mar-24-2022, 08:31 AM
Last Post: JaneTan
  Heroku Error H10 jamesaarr 1 2,009 Oct-21-2021, 03:43 PM
Last Post: jamesaarr
  Importing Postgres Heroku from AWS S3 Drone4four 0 1,790 May-27-2021, 01:09 PM
Last Post: Drone4four
  creating an exe file for a python django project Sanjish 0 2,607 Dec-27-2020, 07:33 AM
Last Post: Sanjish
  category and subcategory into django project dhirendra007 0 1,989 Dec-26-2020, 10:33 AM
Last Post: dhirendra007
  Flask Can't Save Screenshot to Postgres Db firebird 3 2,369 Sep-21-2020, 09:22 PM
Last Post: firebird
  Django project with a setup.py script. That do you think? axju 0 1,627 Oct-22-2019, 10:06 PM
Last Post: axju
  Scrape script when deployed on heroku not giving expected outcomes alok001 1 3,245 Oct-19-2019, 12:39 PM
Last Post: alok001
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,293 Jun-30-2019, 12:21 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020