# IaC on Docker Hub Scan

{% embed url="<https://youtu.be/c2grj-xHz1o>" %}

### &#x20;Prerequisites&#x20;

To integrate Docker Hub, users must have the following requirements available.

* Docker Hub account&#x20;
* Private images in Docker Hub

## To Scan Public Images

Go to ‘Applications’ -> ‘Scan’ -> ‘Other’ -> ‘Docker Hub’ and insert name of the image you want to scan:

<figure><img src="https://lh4.googleusercontent.com/BH5KruePuddcBJortzCuK7eoQvhNWJoA8em5Ep8UAWQS_afI5WLEFqL3DIlssW-NFD7BlgQdVVqXCMFeStYHjWv5HWC86vVrw6yDyDYpzcZQeUsh9wdTxSzDJNsutsGtcKh9GSRwLAOf4jHvs9lKulzVkY7Pu8KVPEA5-HFL6Mnj81HWaVTwsky1Lg" alt=""><figcaption></figcaption></figure>

After the scan new application with the name of the image will be created:

<figure><img src="https://lh3.googleusercontent.com/-4xum4gxCbDsaE1s2PPy-ULKrVW4T3ClTDtz8ESAR6pXBKuM3lTghdic3Bo5jFL6sHjIFre3HkBSo8XzoAHV6tp8yRHAFP1wtSeSeNg0dYVZWGJsPaAYUiQkovvg8Ii_UL6hY2WFCZmFAzP9JoxNLbgPRbo_1gFMJhiB1xdDsSLIQ7t7eSnFX7TWvQ" alt=""><figcaption></figcaption></figure>

## To Scan Private images

### Step 1: Create Access Token in Docker Hub.

Go to **‘Account settings’ -> ‘Security’ -> ‘New Access Token’.** Fill ‘Token Description’ and choose Read-Only access permission:

<figure><img src="https://lh5.googleusercontent.com/WuCivPo6G8Isx6ANWzYSrD6YhtcPWbbsQuuNB0cvtfIcwZ_kzHG5lO6cuyJ0IVJoR8gz500sk_EAUPUPg1P7-cpEIpwc62SNcGZxXIfF_buzJbuKd1OthzILPJkNMGQR6D_ZSFDZsWDRzDJjaAjcXcUlB8r0ZCasLDN4cWAEMtBy68Tz3MI4Xo0bug" alt=""><figcaption></figcaption></figure>

Click on ‘**Generate**’ and copy your Docker Hub ID and Access Token:

<figure><img src="https://lh4.googleusercontent.com/sTT4pQEeATXYg0iBxqTagJSs820n3RMrqG-qU839M6_ODlqW1dZxcgJ8ZpORf6KPerga1ze2v3G-NgTNalWcMO0Mx5oSQBzTwj-zFmWEvU7XVe4b5L6tIjC06S6__3zay6qV6mC0OIdqYLnck4tZ5bMg75bQynjrKmRHGqv0sCtmmtBZPzBRCY053Q" alt=""><figcaption></figcaption></figure>

### Step 2: Add Docker Hub integration in CloudDefense.

Go to **‘Integrations’ -> ‘Container Coverage’ -> ‘Docker Hub’.** Paste your Docker Hub ID and Access token and click **‘Configure’:**

<figure><img src="https://lh3.googleusercontent.com/54IaLZcUHRgHEZMgogwTSPvbqbH39jdggUaxdR8Aa0FldEjLPphygIzek2a9AklZXqFl_ZsihBsbQQ_4FNt9Etn0BX46giIbd2WfNJN0qn5ug1XgfO9r7hKkSXWLiL6SY_pga0s96meUVB6Zp_auShtromoXs9GKhnOhIckACqtRi1Se6X51VcX_ZQ" alt=""><figcaption></figcaption></figure>

### Step 3: Scan your private images.

After successful configuration you can scan your own images.

Go to the **‘Integrations’ -> ‘Container Coverage’ -> ‘Docker Hub’ or ‘Applications’ -> ‘Scan’ -> ‘Other’ -> ‘Docker Hub’ -> ‘Your own images’** and choose the image (images) you want to scan:

<figure><img src="https://lh3.googleusercontent.com/0xBsZzPTESJIJkFsMfPRQQZJDoKr_GBtU01tyJAocxQ_FabpGUlcnYfKyVO0VnnvGkr7PSMGivjktpnmG2id9vy3epRlHxPLIcUYbZ5Qou8Rq5uqSlpkHsFp7gsiYDTsH0ZpgXS8M8EZjxssv_RPdH-xBZjRa-GZpcDYQdYQq7gn4T8mQdzIjPZPsA" alt=""><figcaption></figcaption></figure>
