# Ensure that registry certificate file ownership is set to root:root

- Source: https://support.icompaas.com/support/solutions/articles/62000234336-ensure-that-registry-certificate-file-ownership-is-set-to-root-root
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS Docker Benchmark v1.7.0](https://support.icompaas.com/support/solutions/62000112687) › [CIS Docker Benchmark](https://support.icompaas.com/support/solutions/folders/62000169241)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:**

-   **Level 1** 
    

**Description:**

Docker registry certificates are critical for establishing secure communication between Docker and remote registries. These certificate files, typically located in /etc/docker/certs.d/<registry-name>, should be owned by root:root to ensure that unauthorized users cannot modify them.

**Rationale:**

The /etc/docker/certs.d/<registry-name> directory stores registry certificates used for Docker authentication. These files must be owned and group-owned by root to ensure they cannot be tampered with by less privileged users, which could compromise Docker's secure communication.

**Impact:**

**Pros:**

-   Prevents unauthorized access to or modification of registry certificates.
    
-   Enhances the overall security of Docker by ensuring that certificates remain intact.
    

**Cons:**

-   Misconfigured ownership may lead to unauthorized users modifying or tampering with the certificates.  
    

**Default Value:**

By default, the ownership of registry certificate files should be set to root:root.

**Pre-requisites:**

-   Administrative privileges on the Docker host system.
    
-   Knowledge of the Docker registry configuration and certificate management.
    

**Remediation**

**Test Plan:**

**Using AWS Console:**

1.  Log in to the EC2 instance running Docker.
    
2.  Verify the ownership of the registry certificate files:  
    
    stat -c %U:%G /etc/docker/certs.d/\* | grep -v root:root
    

**Using AWS CLI:**

1.  Connect to the EC2 instance.
    
2.  Run the following command to check the ownership:  
    
    stat -c %U:%G /etc/docker/certs.d/\* | grep -v root:root
    

**Implementation Plan:**

**Using AWS Console:**

1.  Log in to the EC2 instance.
    
2.  Set the ownership of the registry certificate files to root:root:  
    
    sudo chown root:root /etc/docker/certs.d/\*
    

**Using AWS CLI:**

1.  Use SSM to change the ownership of the certificate files:  
    
    aws ssm send-command --document-name "AWS-RunShellScript" --targets "Key=instanceIds,Values=instance\_id" --parameters 'commands=\["sudo chown root:root /etc/docker/certs.d/\*"\]'
    

**Backout Plan:**

**Using AWS Console:**

1.  Log in to the EC2 instance.
    
2.  Revert the ownership of the registry certificate files to their previous state if necessary:  
    
    sudo chown <previous-owner>:<previous-group> /etc/docker/certs.d/\*
    
      
    

**Using AWS CLI:**

1.  Use SSM to revert the ownership:  
    
    aws ssm send-command --document-name "AWS-RunShellScript" --targets "Key=instanceIds,Values=instance\_id" --parameters 'commands=\["sudo chown <previous-owner>:<previous-group> /etc/docker/certs.d/\*"\]'
    

**References:**

-   [Docker Registry Insecure Setup Documentation  
      
    ](https://docs.docker.com/registry/insecure/)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
