Skip to content

Add lifecycle annotations to images pushed to MCR #1201

@MichaelSimons

Description

@MichaelSimons

A broader set of services are starting to consume image annotations. Specifically Azure container scanning honors the lifecycle annotation to treat EOL images specially. As a result, the images produced with the .NET Docker infrastructure should have these lifecycle annotations added.

Related links:

  • OCI Annotations Spec

  • Thread & Vulnerability Management guidance (MSFT internal link)

    How can I mark an image in my ACR as end of life or dictate how long it should be scanned and reported on?
    Attach annotations* to the image called 'lifecycle annotations' which requires:
    
    The ACR Metadata Service to be onboarded for your registry (see callout below)
    [ORAS CLI](https://oras.land/docs/installation/) must be installed
    ORAS CLI must be authenticated to your registry [(See How to Authenticate ORAS CLI)](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-oci-artifacts#sign-in-to-a-registry)
    You can use the ORAS CLI to attach lifecycle annotations by running the following command:
    
    Variables:
    
    $IMAGE refers to a fully qualified image name or digest (e.g. myregistry.azurecr.io/myimage:v1 OR myregistry.azurecr.io/myimage@sha256:fdbd1bc674f77e7a3b8129ecac062a9b7c22de74968e8ea3a46f071f61f3e99f)
    Lifecycle.end-of-life.date should be in the expected format of yyyy-mm-dd
    oras attach --artifact-type application/vnd.microsoft.artifact.lifecycle --annotation "vnd.microsoft.artifact.lifecycle.end-of-life.date=2023-05-12T21:15:10.8343521Z" $IMAGE
    

Work Items:

Metadata

Metadata

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions