Azure / acr

Azure Container Registry samples, troubleshooting tips and references
https://aka.ms/acr
Other
162 stars 106 forks source link

Block users from pull unsigned images when Policies/Content trust is enabled #698

Open AdvanRafael opened 1 year ago

AdvanRafael commented 1 year ago

What is the problem you're trying to solve We understand Docker Content Trust (DCT) works when calling docker cli either by parameter --disable-content-trust=false or export DOCKER_CONTENT_TRUST=1 before image operation. So far we know several key points to DCT:

  1. ACR enable registry content trust
  2. Require docker client enable DCT itself.
  3. Only works in docker cli, not docker API.

The problems are

  1. It is difficult to teach client users do this in their end devices.
  2. Our application is rely on docker API, but docker API does not support DCT.

Describe the solution you'd like Since Azure hosts signature server and registry server, ACR should know the image is signed or not. We expect an option in server side, and the function works for docker cli and docker API. When the option is enabled, only signed images can be pull. Otherwise will receive error response. When the option is disabled, any image can be pull.

Additional context We found Harbor already done the function. After Deployment security is enabled, neither docker cli nor docker API can not pull unsigned image.

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

FeynmanZhou commented 7 months ago

Hi @AdvanRafael ,

Sorry for the late response.

Based on your request, we would suggest using Notation to sign your images in ACR intead of DCT. See this doc for details.

ACR doesn't support denying pull unsigned images so far, but there is a way to deny unsigned images on its deployment.

For example, you can use admission controller to control the deployment request on Kubernetes.

How do you run your images?