Container audit loses the repository identity: git refuses the mounted repo (dubious ownership)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 52/100
调研方向
Start with the container setup in the image built from the #519 branch and docs/install/container.md; reproduce the documented docker run command and check how the audit obtains the mounted repository’s Git remote as uid 10001. Compare the confirmed safe.directory=/repo workaround with running as the host uid, and review the ownership implications before choosing a fix. Done means the documented container command identifies the repository and platform checks use its owner and name.
由索引模型根据 Issue 内容生成。
描述
With the documented command, docker run --rm -v "$PWD:/repo" <image> audit, on Linux:
Platform API call /repos//repo/releases?per_page=5 could not be measured (unavailable)
handler github_branch_protection needs owner/repo (from context or config)
Trust: unknown repository untrusted (no repository identity)
The owner is empty and the name is the mount directory (repo), so every platform check fails.
The cause is the container runs as uid 10001. The mounted repository belongs to the host user. git refuses it:
$ git -C /repo remote get-url origin
fatal: detected dubious ownership in repository at '/repo'
Confirmed workaround
docker run --rm -v "$PWD:/repo" \
-e GIT_CONFIG_COUNT=1 -e GIT_CONFIG_KEY_0=safe.directory -e GIT_CONFIG_VALUE_0=/repo \
<image> audit
With this, git returns the remote and the audit calls /repos/darnitdevorg/darnit/....
Possible fix
Set safe.directory=/repo in the image (Dockerfile ENV or the entrypoint). This turns off git's ownership check for the mounted repo, so it is worth a short look at what a hostile .git/config could do inside the container. The alternative is to document --user "$(id -u):$(id -g)", which I have not tested.
Related
- #579 stops the
/repos//namecall when the identity is empty. It does not give the container the identity. docs/install/container.mddoes not say that platform checks need-e GH_TOKEN.
Seen on RHEL 10 with podman (rootful), image built from the #519 branch.
- 主要语言
- Python
- 星标
- 22
- 派生
- 27
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 39
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
darnitdevorg/darnit 的其他 Issue
-
ci needs triage
难度 2/5 1-3 小时 新手友好度 62/100
darnitdevorg/darnit#607 ·
维护者通常 1 天内回复
-
dependencies module-baseline needs triage
难度 2/5 1-3 小时 新手友好度 68/100
darnitdevorg/darnit#606 ·
维护者通常 1 天内回复
-
A test starts real Sigstore signing (interactive OIDC login) when the attestation extra is installed未关闭module-baseline needs triage testing
难度 2/5 1-3 小时 新手友好度 65/100
darnitdevorg/darnit#604 ·
维护者通常 1 天内回复
-
`darnit validate` crashes on openssf-baseline.toml summarising levels可能已有人在做 @i-am-paradox 于 3 天前认领。 未关闭interface-cli module-core
难度 2/5 1-3 小时 新手友好度 78/100
darnitdevorg/darnit#589 · 1 条评论 ·
维护者通常 1 天内回复
-
Plugins hard-code version "0.1.0" while the packages are at 0.1.1可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭good first issue maintenance
难度 2/5 1-3 小时 新手友好度 83/100
darnitdevorg/darnit#587 · 2 条评论 ·
维护者通常 1 天内回复
查看 darnitdevorg/darnit 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
noontide-co/mainbranch#1211 · 1 条评论 ·
维护者通常 1 天内回复
-
[1.x Bug] run-operation --sql reports success but rolls back writes on transaction-capable adapters未关闭triage
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
bug settings ui
难度 2/5 1-3 小时 新手友好度 72/100
DewaldOosthuizen/py-tray-command-launcher#162 ·
维护者通常 1 天内回复
-
run_all sleeps after the final job despite documenting delays between jobs可能已有人在做 @Gambit-Checkmate 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100