> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cybedefend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Hub

> Connect and scan container images from Docker Hub.

**Docker Hub** is the default registry for Docker containers. CybeDefend allows you to scan both public and private images using Personal Access Token authentication.

## CybeDefend Configuration

| Field                     | Description                      | Example                 |
| ------------------------- | -------------------------------- | ----------------------- |
| **DockerHub Username**    | Your Docker Hub username         | `username`              |
| **Personal Access Token** | Docker Hub Personal Access Token | `dckr_pat_xxxxxxxxxxxx` |

## How to Create a Personal Access Token in DockerHub

<Steps>
  <Step title="Access Docker Hub Settings">
    Go to Docker Hub → **Account Settings** → **Security** → **Access Tokens**
  </Step>

  <Step title="Create New Token">
    Create a new Access Token with a description (e.g., `cybedefend-scanner`)
  </Step>

  <Step title="Select Permissions">
    Select **Read-only** permission (recommended for scanning)
  </Step>

  <Step title="Copy Token">
    Copy the token immediately and paste it in CybeDefend (you won't see it again!)
  </Step>
</Steps>

<Warning>
  The Personal Access Token is only displayed once when created. Make sure to copy it immediately before closing the dialog.
</Warning>

## Security Best Practices

<CardGroup cols={2}>
  <Card title="Use Read-Only Tokens" icon="shield-check">
    Create tokens with minimal permissions required for scanning operations only.
  </Card>

  <Card title="Rotate Tokens Regularly" icon="rotate">
    Change your access tokens periodically to minimize security risks.
  </Card>

  <Card title="Never Commit Tokens" icon="lock">
    Store tokens in environment variables or secret managers, never in code.
  </Card>

  <Card title="Use Dedicated Accounts" icon="user-shield">
    Create a separate Docker Hub account for automated scanning.
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication Failed" icon="circle-exclamation">
    * Verify username and token are correct
    * Check if the token has expired
    * Ensure the token has the required permissions
  </Accordion>

  <Accordion title="Rate Limit Exceeded" icon="gauge-high">
    * Docker Hub has pull rate limits for free accounts
    * Consider upgrading to Docker Hub Pro for higher limits
    * Use authenticated pulls to get higher rate limits
  </Accordion>
</AccordionGroup>
