Automate clean-up of Attestations
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Goal and agreed policy
Extend image cleanup to remove obsolete GitHub artifact attestations without breaking verification of supported images.
The retention policy is:
| Subject | Policy |
|---|---|
| Images belonging to a published GitHub release, including prereleases | Preserve their attestations indefinitely |
| Images for an open pull request | Preserve while the PR is open |
Current default-branch edge image |
Preserve |
| Other, obsolete builds | Eligible only after a seven-day grace period |
This replaces the ambiguous original reference to "release branches". A release tag or draft release alone does not confer indefinite retention. Published-release protection takes precedence even if the image later disappears from the registry. Never delete or modify published release assets.
Current implementation and starting points
Inspected at af840070c907d71ce06334ea65eded00dc3946a4; recheck the implementation before starting.
.github/workflows/image-cleanup.yml: weekly/manual cleanup usingdataaxiom/ghcr-cleanup-action, deleting untagged and orphaned images..github/workflows/pr-image-cleanup.yml: closed-PRpr-<number>image cleanup and separate cache cleanup..github/workflows/wc-build-push.yml: creates index-level GitHub provenance and pushes it to the registry; BuildKit also generates SBOM material.- Package scope:
amp-devcontainer,amp-devcontainer-base,amp-devcontainer-cpp,amp-devcontainer-docs,amp-devcontainer-embedded-cpp,amp-devcontainer-embedded-rust,amp-devcontainer-rust.
GitHub attestation records, OCI registry attestations/referrers, and release assets are different storage surfaces. Removing one does not prove that the others were removed.
Implementation requirements
- Establish a supported, repository-scoped inventory and authentication path first. Document how existing attestations and their subjects are discovered, including historical orphans whose images have already disappeared. Digest lookup alone cannot discover unknown digests. Check pagination, API availability, and the actual minimum token permissions with a disposable fixture before enabling deletion. If historical discovery is incomplete, report that explicitly rather than claiming a complete cleanup.
- Resolve a protected set from published releases, open PRs, and current
edge, across all packages. Use immutable digests, not tag-name matching alone. Walk multi-platform indexes to include child manifests and associated evidence. Preserve shared digests if any protected reference reaches them. - Keep a durable, auditable release-to-digest mapping at publication if existing metadata cannot reconstruct it reliably. Bootstrap older published releases conservatively; unresolved mappings block affected deletions. A short-lived workflow artifact is not an indefinite-retention record.
- Require at least seven days since a candidate was first confirmed obsolete/unprotected, and at least seven days since its attestation was created. Closing a PR or advancing
edgestarts the grace period; it must not trigger immediate deletion. Treat in-flight builds as protected and recheck protection immediately before deleting. - Reconcile with existing image cleanup so the order does not destroy the information needed to classify attestations. A missing image is not sufficient justification to delete published-release evidence. Unknown tags, malformed metadata, incomplete pagination, authentication failures, rate limits, registry errors, or ambiguous ownership must result in retention and a diagnostic, not inferred absence.
- Apply the same policy to provenance and SBOM predicates, including the attestations introduced by philips-software/amp-devcontainer#1135. If an attestation covers multiple subjects, preserve the entire record when any subject is protected.
- Prefer deletion by validated attestation ID over organization-wide digest deletion. Verify repository ownership explicitly; identical digests may occur in other repositories. Preserve registry referrers needed by protected images and identify which registry-side cleanup is already handled by the existing action.
- Provide a dry-run mode reporting keep/delete/unknown decisions, subject digest, attestation ID, reason, and grace-period status. Roll out with a reviewed dry run before enabling scheduled deletion. Export candidate bundles and a deletion manifest before applying changes; document their retention and the limits of recovery.
- Keep cleanup bounded, idempotent, and safe to rerun after partial failures. Use least privilege, pinned actions, existing workflow conventions, and safe handling of event/API data. Do not execute code from a closed PR with elevated credentials. A scheduled sweep must handle cases where a fork PR's close event cannot obtain deletion permissions.
Do not silently expand this into organization-wide cleanup, deletion of valid release evidence, or changing the image retention policy.
Required tests
Use fixtures and a disposable integration target, not production release deletions:
- Published release survives indefinitely, including a missing registry image and shared release/PR/edge digest.
- Open PR and current
edgesurvive; closed PR and superseded edge survive until the full grace period expires. - Old draft/tag-only build has no indefinite exemption, but an active build is not deleted.
- Boundary times, publication/reopening/edge changes between planning and deletion, multi-platform children, referrers, multiple subjects, and multiple predicates.
- Unrelated repository with the same digest is untouched.
- Missing/ambiguous release mappings, paginated results, 403/404 ambiguity, 429/5xx, registry failures, and interrupted/repeated runs fail safely.
- Dry run performs zero deletions; apply deletes only approved eligible fixtures; protected image verification still succeeds afterward.
Acceptance criteria
- The agreed policy and grace-period semantics are documented and automated for every in-scope package.
- Discovery coverage and minimum permissions are demonstrated; historical gaps are resolved or explicitly block unsafe deletion.
- Published-release evidence is protected independently of moving tags and registry availability.
- GitHub and registry cleanup responsibilities are explicit; both provenance and SBOM evidence follow one policy.
- Automated positive/negative tests pass, and a reviewed dry-run report precedes scheduled apply.
- Logs/exported manifests support auditing; partial failures are visible and do not widen deletion scope.
Dependencies and references
No dependency on philips-software/amp-devcontainer#1135: implement predicate-independent retention now; that issue integrates its new SBOM records with this policy.
- GitHub attestation lifecycle guidance
- Repository attestation lookup API
- Organization attestation APIs, including
DELETE /orgs/{org}/attestations/{attestation_id}. Validate authentication support; do not assume the image cleanup token already suffices.
- Lingua principale
- Shell
- Stelle
- 136
- Fork
- 8
- Merge medio
- 17h 19m
- PR unite (30g)
- 53
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di philips-software/amp-devcontainer
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
philips-software/amp-devcontainer#1571 ·
I maintainer di solito rispondono entro 1 giorno
-
Inventory smoke tests can hang despite command timeout; fail with bounded diagnosticsForse già presa @rjaegers l’ha presa 23 giorni fa. Aperta
philips-software/amp-devcontainer#1569 · 1 reazione · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
Evaluate tool versionsApertascheduled stale tool-versions
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
philips-software/amp-devcontainer#1475 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
philips-software/amp-devcontainer#1433 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Evaluate tool versionsApertascheduled tool-versions
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
philips-software/amp-devcontainer#1222 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di philips-software/amp-devcontainer
Issue simili
-
documentation enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
aws/aws-networking-best-practices#256 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
openai-directory
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
smores56/homelab-platform#289 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno