fix(docker): make app-shipped binaries executable - #687
DeepDiver1975 wants to merge 2 commits into
Conversation
|
Added the second half of this change: Making
The file is YAML rather than the plain format so entries can carry Merge order is unchanged and this PR stays draft until it is satisfied:
|
|
Note on the red build here: the Two consequences worth separating from this PR:
|
Apps ship binaries in their own bin/ directory - today only migrate_to_ocis/bin/rclone_linux_amd64. The complete tarball normalized every regular file to 0644, so the binary landed in the image non-executable. The app worked around it at install time (appinfo/install.php chmods 0755), but the image itself was wrong, and the image scan was blind: Trivy's gobinary analyzer gates on the exec bit (utils.IsExecutable, mode.Perm()&0111), so the binary was never analyzed. Restore 755 on apps/<app>/bin/<file> after the ownership pass. -mindepth/-maxdepth 3 keeps vendored scripts such as apps/files_primary_s3/vendor/mtdowling/jmespath.php/bin/jp.php at 644. owncloud/server-release#52 fixes this at the source. This chmod keeps the image correct and the scan meaningful for tarballs built before that lands. 10.16.4 does not bundle migrate_to_ocis, so only v24.04 changes behaviour today; both bases are updated for consistency. Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
…efile Making apps/*/bin/* executable also makes the bundled rclone binary visible to Trivy's gobinary analyzer for the first time. Once the 11.0.0 tarball ships upstream rclone v1.75.0 (owncloud/migrate_to_ocis#56) the image scan reports eight HIGH go1.26.5 stdlib findings; they are fixed in go 1.25.13 / 1.26.6, which no rclone release has been built with yet. Converts v24.04/11.0.0/.trivyignore to the YAML format so each entry can carry expired_at (2026-11-01) and a path scope - the acceptance expires by itself instead of being buried, and cannot spread to other components. Plain and YAML ignore files cannot be mixed in one scan, so the existing CVE-2024-51736 entry moves across with its justification. v22.04/10.16.4 is untouched: it does not bundle migrate_to_ocis. Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
7d078d2 to
e75e636
Compare
|
Closing: obsolete. The root cause was fixed at source and the image is already correct without this change. Verified against the shipped 11.0.1 bundle (
What made it obsolete:
The "Merge gate" this draft was waiting on is therefore fully satisfied, and what it was gating no longer needs the gate. Two observations from this PR that do not die with it:
|
Why
apps/migrate_to_ocis/bin/rclone_linux_amd64arrives in the image at0644. Two problems:The app cannot execute it;
appinfo/install.phppapers over this with a runtimechmod 0755.The image scan never sees it. Trivy's gobinary analyzer gates on the exec bit:
So
owncloud/server:11.0.0scans green while shipping a Go 1.22.4 rclone with 23 HIGH/CRITICAL vulnerabilities (incl.CVE-2025-68121,CVE-2024-45337,CVE-2026-33186). Not ignored, not filtered — invisible.The bit is correct in the app's git tree (
100755) and in the app release tarball (-rwxrwxr-x); it is lost when the complete tarball is assembled. owncloud/server-release#52 fixes that root cause. This PR is the defence-in-depth layer, so the image is correct and the scan is meaningful for tarballs built before that fix.What
One
RUNper base, after the existing ownership pass:-mindepth/-maxdepth 3scopes it toapps/<app>/bin/<file>.10.16.4bundles nomigrate_to_ocis, so onlyv24.04changes behaviour today; both bases get it for consistency.Testing
Built
v24.04against the currentowncloud-complete-20260730.tar.bz2:Scan of that image, with the existing
v24.04/11.0.0/.trivyignore:Every other target is 0, so the new red is exactly and only the rclone binary — which is the point: the blind spot is gone.
Same image with upstream rclone v1.75.0 (owncloud/migrate_to_ocis#56) swapped in:
The
gobinaryanalyzer running on that path and reporting clean is the proof the loop is closed.Merge gate
Merge order matters:
owncloud-complete-*.tar.bz2cut with 1., andmain.ymlpointed at itMerged before step 3, it turns the 11.0.0 image build red (23 findings,
exit-code: 1) — correctly, but with no fix available in the image.Follow-up (not in this PR)
owncloud-docker/ubuntu'sdocker-build.ymlpassesskip-files: /usr/bin/gomplate,/usr/bin/wait-for, suppressing those two Go binaries outright instead of tracking their CVEs. Both are clean today, so the skip is buying nothing and hiding future findings.🤖 Generated with Claude Code