The package mirror's address reaches every app, so a token in it leaks

未关闭
#96 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go, kubernetes

调研方向

Start with validMirrorURL in internal/config/config.go and trace how the mirror address reaches internal/pixienv/pixienv.go and the config written in internal/cli/podcmd/runner.go. Then review the proposed auth Secret and install-step mount design, along with the mirror documentation; done means credentials stay out of the app environment and readable config, with tests covering rejected query strings and fragments.

由索引模型根据 Issue 内容生成。

描述

The package mirror's address still reaches every user's app, so a secret written into it leaks.

validMirrorURL refuses a user name or password, but a token anywhere else in the address passes, for example https://mirror.example.com/conda-forge?token=SECRET, https://mirror.example.com/t/SECRET/conda-forge (conda's own token form) or https://mirror.example.com/conda-forge#SECRET:
https://github.com/nebari-dev/tapas/blob/cc65f01120dbcf3efc76386b18a0ecc07e20cc93/internal/config/config.go#L1278-L1280

The full address is then put in the app container's environment as TAPAS_PIXI_MIRROR, which the person's own code can read:
https://github.com/nebari-dev/tapas/blob/cc65f01120dbcf3efc76386b18a0ecc07e20cc93/internal/pixienv/pixienv.go#L394-L396

and in /etc/pixi/config.toml, written world-readable (0644) and mounted into the app:
https://github.com/nebari-dev/tapas/blob/cc65f01120dbcf3efc76386b18a0ecc07e20cc93/internal/cli/podcmd/runner.go#L113

Reproduced on a local cluster with a user name and password before that check existed: inside the app, echo $TAPAS_PIXI_MIRROR printed the password.

Proposed fix: keep the mirror's address public and its credentials apart.

  • Refuse a query string and a fragment in the address, as a user name or password is refused now. A token in the path cannot be detected, so the docs say the address must hold no secret.
  • Credentials in a Secret named by a new setting (for example environments.mirror.authSecret): pixi's auth file, mounted read-only (0400) in the install step only, never in the app.
  • Keep TAPAS_PIXI_MIRROR out of the app container; the install step can keep it. /etc/pixi/config.toml can stay readable once it holds only the public address.
  • Document mirrors that need a login, and that a person's own pixi add in the app does not get the mirror's credentials.

Follow-up from #63 and #65.

主要语言
Go
星标
5
派生
0
平均合并
21 小时 13 分钟
30 天内合并 PR
53

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nebari-dev/tapas 的其他 Issue

查看 nebari-dev/tapas 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。