Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

5 times a year if you are a freelancer.


Linux already stores plenty of secrets in files in /etc. Just do the same: the root protected init file for your app likely has a mechanism for passing an env var to the new process. Systemd and supervisor do. Then pop os.environ instead of reading it, and you are safe from bots and script kiddies, which is likely your threat model


And what happens on reboot ? Then you get to hardware solutions, and a small website is not going to want that.


You need to unlock bitwarden. As mentioned above - this is more a solution for local development (against a non-local db).

For a service, one would need some kind of secret management - but a shell script could set this variable/value for input to eg docker or a k8s setup. Or the service (eg: heroku) could handle it.


"What happens on reboot" is a good question for a scheme that involves not using the filesystem, but bitwarden is not such a scheme. Everything will be fine after a reboot.


You need your app to have the bitwarden decryption passphrase to read it. Do you intent to enter that manually if the server reboots ?

If not, then it's a secret you must manage, and you are back to square one: either using a simpler solution, use a hardware key, or going full secure vault service, with privileged first request, and so on.


The passphrase is hardcoded and kept in version control. ;D


Env vars in systemd or supervisor files are fine for small server projects. But make sure you pop them from the os.environ dict once you read them to avoid accidental exposure.

For the desktop, use the keyring module.

If you start to scale up your threat model, you should use a vault, but the setup is way more costly, and tricky to get the reboot story right (hence the priviledged first requests comments).


> But make sure you pop them from the os.environ dict once you read them to avoid accidental exposure.

I've always accepted this was an attack vector, and some malicious library could extract env vars.

This actually makes a lot of sense, thanks!


Depends of the size of your setup. Most website are small, and their threat model don't require more than having the secrets in a systemd file env statement.

After all, if you have a single server, and the attacker can read a root protected file oe the spawned processes context, you are pwned already. As for exposing env var, popping os.environ is usually enough.

No need to pay for more than you must: bots and script kiddies are not mossad.


The name suck, but the idea is they are plugguable: check the django packages site for an idea of the benefit of that. It's essentially a plugin system with autoloading of some resources, such as the model and templates.

Also, apps override each other in the order or import. E.g one app can override the template of another just by using the same name. This means you can plug AND extend.


Django-allauth usually got you covered, but in the rare case it doesn't, creating a micro service just for auth is a way better alternative than a complete rewrite.


I do pretty much the same, which makes me think it should be django default startup template.

I would also do:

- install django_extensions and django_debug_toolbar

- rename the admin URL route to contain a uuid

- setup black, mypy, pylint, ipdb, ipython, dotenv and doit (I do so for all my python projects)

- manage.py createsuperuser

Also, very often :

- setup celery (locally with fs backend)

- setup vitejs

- install sentry and mailtrap plugins

- install django-allauth

- install DRF

And currently exploring:

- replace DRF with django ninja


Nice

I have wished for a while that browser would store the entire page of any bookmark you save automatically, and put a decent search engine on it. I wrote a script once to do it for my bookmarks, and it didn't even take that much space on my hard drive.

Your system could be a Firefox addon, kinda like what scrapbook used to be, but automatic. Even with a note system, and storing metadata, Zotero style, but without the need for the dual setup.


How mozzilla is not pursuing that kind of innovation in Firefox itself is beyond me. Instead they continously try to ape the Chrome UI and collect telemetry without permission so that they can give you "exciting" "new" features like colorways.


If Ukraine had been in NATO, Russia wouldn't have invaded.

They did because Ukraine was in the verge of joining, knowing that once it was done, they would not be able to attack anymore.

Plus, NATO being historically a shield, not a sword, Russia stance was basically the equivalent of stating "to look for safety or we kick your ass".


> was in the verge of joining

Where did you get this incorrect information? Joining NATO non-negotiably requires checking a few boxes, one of which is having all your borders settled and under no dispute. Ukraine did not fit this requirement and thus could not have been on the verge of any such thing. They had stated their desire to join, then canceled (under Yanukovych), then re-stated it, but they were never even close to being admitted.


NATOs operations have frequently involved air campaigns against states that pose no direct threat to any of its members. Quite a bizarre shield.

You can tell me the operations were justified. I'm yet to be convinced that the Russian regime should not feel threatened by them.


Troops need combat experience somewhere for there to be any hope of their effectiveness. That was enough justification, from a military standpoint.

Unfortunate geopolitical consequences of the conflicts are unfortunate.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: