Skip to content

fix(release): reject release artifacts that ship development files - #97

Merged
oc-tmueller merged 1 commit into
mainfrom
fix/reject-development-files-in-release-artifacts
Sep 9, 2026
Merged

oc-tmueller merged 1 commit into
mainfrom
fix/reject-development-files-in-release-artifacts

Conversation

@oc-tmueller

Copy link
Copy Markdown
Contributor

Producer-side half of owncloud/core#41824. The consumer-side guard is owncloud/server-release#54.

Why

ownCloud 11.0.0 shipped 13 bundled apps as the working tree they were built in — .git/, .github/, tests/, vendor-bin/ and build/artifacts/. That is ~102 MB of development material, 16 git repositories, and files_antivirus's EICAR acceptance data, which made a ClamAV scan of an appliance image report Eicar-Test-Signature FOUND and rejected the image at a customer's AV gate.

The bad tarballs are the apps' own release assets, hand-uploaded before this workflow existed. Nothing on the way to publication looked at what was inside them.

This has to block publication rather than be cleaned up afterwards: the signature assertion in this very step runs over the same tarball, so the development files are code-signed. An administrator deleting them breaks occ integrity:check-app, which leaves "ship it as-is" or "delete the whole app" as the only options.

What

The Assert artifacts are signed step already computes listing=$(tar tzf "$tarball") per tarball, so the check extends that loop rather than adding a second tar tzf pass. The step is renamed to Assert artifacts are signed and free of development files; the job name Release is unchanged, so no required-check names move.

A tarball is rejected when it contains:

rejected scope
.git any depth
.git, .github, tests, build, vendor-bin the app's own top level

Anchoring the directory names to the app's top level means a vendored dependency shipping its own tests/ is unaffected. .git is depth-agnostic because migrate_to_ocis 3.0.0 shipped three of them under vendor/ (ramsey/uuid, brick/math, ramsey/collection).

Relationship to the ocsign checkout guard (#93)

Complementary, not duplicated. ocsign v0.3.0 refuses to sign a staging tree holding a .git entry; this inspects the finished tarball and also covers tests, build, .github and vendor-bin, which ocsign accepts. Every app affected by #41824 has a signed signature.json, so the ocsign guard alone would not have caught them.

Verification

The step body was extracted and run against real published assets, so this is the actual workflow code rather than a paraphrase:

Passes — all 11 app releases that were built by CI, 12,947 files total:

external v1.5.2, files_antivirus v1.3.2, files_external_dropbox v2.1.2, files_ldap_home v0.6.2, files_primary_s3 v1.6.2, firstrunwizard v1.4.2, graphapi v0.3.2 (7,835 files), migrate_to_ocis v3.0.1, openidconnect v2.3.4, twofactor_totp v0.10.2, user_ldap v0.20.3.

No false positive, including the two largest vendor trees.

Fails — known-bad hand-uploaded assets: announcementcenter v1.3.1 (226 entries), files_antivirus v1.3.1 (352), notifications v0.7.1 (243), migrate_to_ocis v3.0.0 (141, caught only by the depth-agnostic .git rule).

End-to-end on files_antivirus, showing both checks in sequence:

# v1.3.2 (clean)
signed: files_antivirus/appinfo/signature.json (alg=ecdsa-p384-sha384, CN=files_antivirus)
clean: no development files                                     -> exit 0

# v1.3.1 (dirty)
signed: files_antivirus/appinfo/signature.json (alg=ecdsa-p384-sha384, CN=files_antivirus)
::error::... ships development files - point artifact-glob at the packaged artifact
  ... 352 matching entries in total                             -> exit 1

The dirty asset passing the signature check and failing hygiene is exactly the problem: it is validly signed.

bash -n clean on the step body, YAML parses, 14 steps intact, and calens renders the changelog fragment.

Note on rollout

This lands blocking rather than warn-first. The plan had been to sweep every app with gh workflow run release.yml -f dry-run=true, but app release.yml files are tag-triggered only with no workflow_dispatch, so that sweep is not dispatchable — hence the asset-based sweep above instead. Only 11 of 44 apps have ever released through this workflow, so for the remaining 33 this check will fire for the first time on their next release. That is the intended behaviour: a trip means the app genuinely ships development files. artifact-glob already points at the packaged artifact in every app repo I checked, and owncloud/server-release#54 catches anything that slips through before it reaches a bundle.

🤖 Generated with Claude Code

A release artifact must be the app's packaged output, never the working
tree it was built in. ownCloud 11.0.0 shipped 13 bundled apps as build
trees: ~102 MB of development material, 16 git repositories, and
files_antivirus's EICAR acceptance data, which made anti-virus scans of
the release tarball fail at a customer's AV gate.

The signature assertion already runs over each published tarball, so
extend that loop rather than adding a second `tar tzf` pass. A tarball is
now rejected when it holds .git at any depth, or .git, .github, tests,
build or vendor-bin at the app's own top level. Anchoring the directory
names to the top level means a vendored dependency shipping its own
tests/ is unaffected; .git is depth-agnostic because migrate_to_ocis
3.0.0 shipped three of them under vendor/.

This has to block publication rather than be cleaned up afterwards: the
signature covers the offending files too, so an administrator removing
them breaks `occ integrity:check-app`. It complements the ocsign checkout
guard, which refuses to sign a staging tree holding .git but accepts
tests, build, .github and vendor-bin.

Verified by running the step body against real assets: the 11 app
releases built by CI all pass (12,947 files, including graphapi's
7,835-file vendor tree), while announcementcenter v1.3.1,
files_antivirus v1.3.1, notifications v0.7.1 and migrate_to_ocis v3.0.0
all fail - the last caught only by the depth-agnostic .git rule.

Refs: owncloud/core#41824

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants