[Feature] Keep credentials out of shareable VIP output: redact the auth cache and add a bundle command
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
src/vip/auth.py から始め、特に auth_cache_path()、689-697 行目のキャッシュ書き込みコード、_load_cached_auth()、および auth.py:238 の matches チェックを確認してください。キャッシュとバンドルの設計を選ぶ前に、既存の CLI サブコマンドと README.md/docs のカバレッジを確認してください。共有出力によって認証情報が露出せず、バンドルに credential selftest を備えた許可リスト化されたメンバー集合があり、feature が完了するまでユーザーに警告が表示されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
VIP writes live credentials into its working directory, and that directory is exactly what users are asked to hand over when something goes wrong. A support interaction that began with "here is the whole VIP output" arrived with .vip-auth-cache.json and .vip-auth-cache.meta.json in the archive. Nothing about that was user error: the files are dotfiles in the invocation directory, there is no command that produces a shareable subset, and no documentation says they should be excluded.
What is in those files
.vip-auth-cache.meta.json holds a Connect API key in cleartext (src/vip/auth.py:689-697):
meta = {
"api_key": session.api_key,
"key_name": session.key_name,
"connect_url": session._connect_url,
"requested_connect_url": session._requested_connect_url or session._connect_url,
"workbench_url": session._workbench_url,
}
meta_path.write_text(json.dumps(meta))
os.chmod(meta_path, 0o600)
.vip-auth-cache.json is a full Playwright storage state, and it is the more sensitive of the two. Per the docstring at src/vip/auth.py:342, the auth flow "deliberately visits the IdP and Connect as well as Workbench -- so this file holds their cookies too." That means a shared archive can carry a live IdP session cookie, which is broader than any single product's API key. Worth stating explicitly because it is easy to check the meta file, see api_key: null on a password or headless deployment, and conclude nothing sensitive was shared — the storage state says otherwise, and refresh_auth_cache_from_storage_state exists precisely to keep those cookies live across runs.
Both files land in Path.cwd() (auth_cache_path(), src/vip/auth.py:326-341). The only protections today are 0600 permissions and .gitignore entries, and neither survives zip -r.
Why the existing mitigations do not cover this
#223 fixed a different surface — API keys and passwords appearing in test failure output via config dataclass reprs. The on-disk auth cache was not part of that change, and the credential there is a real minted key with a real TTL rather than an echoed config value.
There is also no command that packages results for sharing. The subcommands today are version, auth mint, verify, cleanup, install, uninstall, report, status, and scaffold. Users who need to send output to someone else have no option but to archive the directory by hand and hope they know which files to leave out.
Proposal
Two complementary pieces, in the order they reduce risk:
-
Stop writing the secret where it does not need to be one. The API key in the meta file exists so a later run can reuse the session and so
cleanupcan delete the key it minted. Neither requires the key in plaintext next to the report — options include storing only the key name plus a reference, moving the cache under a user-scoped directory outside the reporting tree, or encrypting the value at rest. Whichever is chosen,_load_cached_auth(src/vip/auth.py:488-510) and thematchescheck (auth.py:238) are the consumers to keep working. -
Add a command that produces a shareable archive —
vip bundleor similar — that collects the report artifacts and diagnostic context and excludes the auth cache and anything else credential-bearing by construction, rather than relying on the user to prune. An allowlist of what goes in beats a denylist of what stays out, so a future artifact does not leak by default.
Until either lands, docs/ should say plainly that the auth cache holds live session material and must not be shared. Right now neither README.md nor anything under docs/ mentions these files at all.
Note for whoever picks this up
If a bundle command is built, treat "does the archive contain a credential" as a selftest and not a review checklist item — assert against the archive's actual member list, so adding a new artifact to the output directory cannot silently start including it.
- 主要言語
- Python
- スター
- 8
- フォーク
- 1
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 33
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
posit-dev/vip のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
team: workbench
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
posit-dev/vip#274 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
team: connect
難易度 3/5 1〜2日 初心者へのやさしさ 54/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/agent-lightning#661 ·
メンテナーはふだん 2 日以内に返信
-
area/profiles comp/cli P3 type/feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NousResearch/hermes-agent#146372 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] OpenAI-compatible embedding model alias breaks embedder construction対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistencies対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
GeoSeries scale and skew tests fail with pytest 9.2.0対応中かも @jiayuasu が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信