containers-roadmap icon indicating copy to clipboard operation
containers-roadmap copied to clipboard

[ECR] [request]: Repository deletion protection

Open samgiles opened this issue 6 years ago • 12 comments

Tell us about your request Add deletion protection to ECR repositories to prevent accidental deletion when using automation or in the console.

Which service(s) is this request for? ECR

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? I'm trying to prevent a case where a production service is running in a container cluster, EKS or ECS, and something or someone wipes out a dependent repository in ECR, either by accident in the console, mis-config with automation (think Terraform), or otherwise. Preventing this would mitigate somewhat the need for additional backups or something.

Are you currently working around this issue? My plan is to use a tool like reg (https://github.com/genuinetools/reg) to try and automate backup of layers and images to S3, so in the event of loss, our most critical images can be restored automatically within moments, rather than the mass rebuild of every image we need.

I might, if I have time try and open source a solution, that backs up a set of critical tags for a named repository to S3 using a lambda and events on ECR (haven't yet checked if there are appropriate events for this).

samgiles avatar Mar 18 '19 22:03 samgiles

Also, it is possible to have a Lifecycle Rule delete an image that is currently running with autoscaling rules. If it decides to autoscale from 1 to 2 and the image doesn't exist, it goes to 0.

phishy avatar Sep 26 '19 19:09 phishy

An update if this is being considered would be really appreciated. Automated cleaning of ECR repositories is far more risky this way.

Tokimimo avatar Nov 05 '19 14:11 Tokimimo

After accidentally nuking a couple of registries when importing them as resources into Terraform, I agree this could be a very much appreciated feature.

joan-s-molas avatar Dec 03 '19 11:12 joan-s-molas

Can I +1 this issue? I was doing a terraform apply in a for-loop, trying to add scanning=true to everything and a typo made months ago in one of the terraform files accidentally caused a delete-then-create of a repo which nuked all previously installed images. Something similar to termination protection on EC2 instances would be really nice

tvaughan77 avatar Jul 08 '20 19:07 tvaughan77

+1

infinityplus1 avatar Dec 06 '22 00:12 infinityplus1

Hi all! I wanted to share that this is something we've been thinking about addressing. We have done some initial work, and it's a fairly broad thing to solve for. We don't have any specifics to share right now, but did want to say here that we are doing some research around deletion protection. Please add an upvote or comment if you're interested, thanks!

jlbutler avatar Dec 14 '22 02:12 jlbutler

Protecting ECR image deletion through console is must have feature to prevent accidental deletions.

parameshjava avatar Dec 24 '22 14:12 parameshjava

Upvote : a need for several reasons; No longer able to track back vulnerabilities on still running components (rescan ...) Potential havoc in prod env.

TomasD38 avatar Jan 16 '23 10:01 TomasD38

+1

javiercm1410 avatar Jan 16 '24 20:01 javiercm1410

+1

PavelDamyanov avatar Feb 19 '24 19:02 PavelDamyanov

Kindly add this feature

pratikbhawsar26 avatar Mar 09 '24 11:03 pratikbhawsar26

This would be a neat feature to have

KarBroden avatar Jun 24 '24 14:06 KarBroden

+1, recently had an incident caused by deleting a repository which was created via terraform but not merged to main. Obviously, that's a process issue, but the old cbell@ ops meeting would definitely have resulted in a "make it harder to accidentally delete things" action item, and there's no way to actually do that via ECR right now!

@jlbutler been a couple of years, any updates here? Even blocking repo deletion if there are protected tags would be great!

jwestbury avatar Mar 20 '25 17:03 jwestbury