TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to avoid plain text secret files?

6 点作者 surrTurr6 个月前
I use a password manager &amp; its CLI to get rid of e.g. my plain text PATH variables &amp; access secrets from scripts.<p>However I can&#x27;t find a way to get rid of plain text secret files such as e.g. a kubeconfig file.<p>Is there a tool (MacOS) that can e.g. encrypt files and ask for a popup when a process tries to access it? Or some other solutions that helps me get rid of these plain text secret files.

4 条评论

threecheese6 个月前
MacOS keychain functions are exposed via the “security “ command line tool. I use this in the terminal to push secrets into a new process’s environment when I don’t want them to persist in the terminal:<p><pre><code> &gt; security find-generic-password -a &quot;$USER&quot; -s &quot;PROJECT_OPENAI_API_KEY&quot; -w </code></pre> Ex:<p><pre><code> &gt; export OPENAI_API_KEY=$(security find-generic-password -a &quot;$USER&quot; -s &quot;PROJECT_OPENAI_API_KEY&quot; -w) llm do-something-cool-thanks-simonw </code></pre> This will pop up a keychain access request (password&#x2F;biometric prompt) and then inject $USER’s matching “application password” type secret into the child process environment.<p>Note you need to first give the calling app permissions to that secret into Keychain Access, otherwise you will get two password popups (one for the app, then one for the secret usage).<p>I have a function in my zshrc that wraps usage, to save typing.
评论 #42110059 未加载
surrTurr6 个月前
One solution I found so far, specifically for kubeconfig files: <a href="https:&#x2F;&#x2F;blog.mikael.green&#x2F;post&#x2F;1password-kubeconfig&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.mikael.green&#x2F;post&#x2F;1password-kubeconfig&#x2F;</a>
surrTurr6 个月前
Update: F-Secure via DeepGuard allows defining &quot;rules&quot;, which allow&#x2F;deny file access for specific processes and files. Looks like a nice tool.
sfmz6 个月前
<a href="https:&#x2F;&#x2F;www.privacyprotect.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.privacyprotect.dev&#x2F;</a> uses the webbrowsers&#x27; encryption libraries