• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

securitywing

Menu
  • About
  • Must Read
      • IIS Performance Boost
      • RFID Security
      • Web App Security Testing
      • How to Secure Home Network
      • Prevent Cross-Site Scripting Attacks
      • Renew Self-Signed Certificates
      • Penetration Testing Tools
      • VPN Concentrator
      • Forensic Investigation Tools
      • Digital Certificates
      • Cloud Security Issues
      • Advanced Evasion Prevention
      • Firewall Types
      • Tips to Prevent Data Exfiltration
      • Classified Info Handling
      • MySQL Security
      • Definition of 7 Types of Malware
      • VOIP Security
      • Why Antivirus Software Fails
      • 15 Network Security Vulnerabilities
      • Web App Security
      • IT Security Standards
      • Types of Virtualization
      • Android Security
      • Digital Signature
      • Advanced Malware Protection
    • Close
  • Consultancy
  • Contact

How to Enable AWS Cross Account ECR Image Replication

by wing

Docker image hosted in ECR in  a AWS account can be replicated into another AWS account by enabling the cross account replication setup. For example, you host a docker image in AWS account A and you have a ECS cluster where you need to deploy the docker image.  

aws cross account ECR repository replication

The steps require to enable cross account replication are:

1.Settings in the ECR host account:

  • Enable cross account replication by specying the destination account name and region.

 

2.Settings in the replicaiton account

  • Add a JSON permission policy with “CreateRepository” and “ReplicaiteImage” action. Also, specify the the ECR host repository ARN.

 

ECR host account settings

Click on the ECR registry

aws ecr registry

 

                             Select the private registry.

 

ECR replication account settings:

Go to the ECR registry and then select private and click on “Permissions”.

Next, add the below JSON policy. You need to replace the account ID in the Principal section by the account ID of your AWS ECR host account ID. In the “Resource” section of the policy you need to specify the account ID of the replicaiton account and replace repositoyr name “myrepo” by you reposityr name that is in the ECR host acount.

{
  "Sid": "replication-id",
  "Effect": "Allow",
  "Principal": {
    "AWS": "arn:aws:iam::xxxxxxxxxxx1:root"
  },
  "Action": [
    "ecr:CreateRepository",
    "ecr:ReplicateImage"
  ],
  "Resource": "arn:aws:ecr:eu-west-1:xxxxxxxxxxx2:repository/myrepo"
}

Finally, push a docker image in the account A, and you will in the Account B a new ECR repository with the exact  same name of the account B.

Related Posts:

  • How to Resolve Route 53 Privated Hosted zone from a VPC in a different AWS account
  • How to Mount Amazon EFS in EC2-CentOS Instance
  • How to Install Boto3 for AWS SDK using Anaconda in Windows
  • How to Setup AWS CloudFront for Externally Registered Domain Name
  • How to Setup SSL in AWS application load balancer for WordPress

Filed Under: AWS Tagged With: AWS, ecr

Primary Sidebar

CISSP Sample Test

Take a CISSP Sample Test

CISA IT governance Sample test



Twitter Follow @securitywing

Categories

  • AWS
  • containers
  • Internet Security and Safety
  • IS Audit
  • IT Security Exams
  • Network Security Tips
  • Off Track
  • Telecom
  • Tutorial

Pages

  • About
  • Best IT Security Certification Exam
  • CISA IT governance Sample test
  • CISA Sample Test
  • CISSP Sample Test Online
  • Consultancy
  • Contact

Popular Posts

  • 3 Steps to Install Miniku...
  • How to install a new Goda...
  • 63 Web Application Securi...
  • How to Renew Self-Signed...
  • Host Based IDS vs Network...
  • How to Setup AWS CloudFro...
  • 8 Effective Ways to Impro...
  • Active vs Passive FTP Mod...
  • Top 10 RFID Security Conc...
  • 3 Simple Steps to Capture...

Footer

Copyrights

Protected by Copyscape Duplicate Content Detection Software

Securitywing.com reserves the copyrights of all of its published articles.No contents of this site is permitted to be published to anywhere else in the Internet.If any contents are found in any other websites, securitywing reserves the rights to file a DMCA complaint. But you have the right to use the link of any relevant article of this site to point from your website if you consider that it might improve the quality of your article.

Tags

antivirus audit AWS backup browser check cisco cloud computer cyber data database encryption firewall home hsrp ids informaiton internet intrusion it kubernetes linux load balancing malware network protection putty risk router security security tips server ssh SSL switch tools virus vpn vulnerability web webserver website windows wordpress

Copyright © 2010-2023 ·All Rights Reserved · SecurityWing.com