<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Security on Don't Repeat Yourself</title><link>https://krokotsch.eu/tags/security/</link><description>Recent content in Security on Don't Repeat Yourself</description><generator>Hugo -- 0.152.2</generator><language>en-us</language><lastBuildDate>Wed, 10 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://krokotsch.eu/tags/security/index.xml" rel="self" type="application/rss+xml"/><item><title>Keep Secrets Out of Your .env File</title><link>https://krokotsch.eu/posts/keep-secrets-out-of-your-env-file/</link><pubDate>Wed, 10 Jun 2026 00:00:00 +0000</pubDate><guid>https://krokotsch.eu/posts/keep-secrets-out-of-your-env-file/</guid><description>&lt;p&gt;Recently there was a slew of supply chain attacks on several Python packages.
One of them, named &lt;a href="https://devops-daily.com/posts/shai-hulud-hades-pypi-wave-june-2026"&gt;Shai-Hulud&lt;/a&gt;, was especially impressive because you only had to install the compromised package, no import needed.
It then steals any credentials and secrets it can find on your machine, including ones in &lt;code&gt;.env&lt;/code&gt; files.&lt;/p&gt;
&lt;p&gt;My main question was: do people still keep secrets in environment variables?
API keys just lying around in plain text &lt;code&gt;.env&lt;/code&gt; files on your hard drive sound like a terrible idea.
Especially when the alternative is so simple and elegant.
This is why I&amp;rsquo;m sharing my favorite pattern for fetching secrets in Python: &lt;em&gt;the secret resolver&lt;/em&gt;.
It reads your secrets during application runtime from the secret provider of your choice, be it Azure Key Vault, KeePass, or 1Password.&lt;/p&gt;</description></item></channel></rss>