Container audit loses the repository identity: git refuses the mounted repo (dubious ownership)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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
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.
- Dominant language
- Python
- Stars
- 22
- Forks
- 27
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 35
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from darnitdevorg/darnit
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
darnitdevorg/darnit#587 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
darnitdevorg/darnit#585 ·
Maintainers usually reply within 1 day
-
quality
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
darnitdevorg/darnit#523 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
darnitdevorg/darnit#516 ·
Maintainers usually reply within 1 day
-
good first issue module-core
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
darnitdevorg/darnit#506 ·
Maintainers usually reply within 1 day
All issues in darnitdevorg/darnit
Similar issues
-
🐛 Bug: Calendar work items cannot be opened on mobilePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Status: Triage Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Objects.List treats versions=false (and similar flags) as truePossibly taken @andaaron claimed this today. Openpriority: p2 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
googleapis/storage-testbench#829 ·
Maintainers usually reply within 2 days
-
[Bug]: memory provider treats 1:1 DMs as shared surfaces, so DM turns never receive reviewed recordsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
rlaope/oh-my-hermes#2088 ·
Maintainers usually reply within 1 day