> ## 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.

# GitLab Container Registry

> Scan container images stored in GitLab's integrated container registry.

**GitLab Container Registry** provides a secure space for your Docker images. CybeDefend integrates with GitLab's registry to scan your containers for vulnerabilities.

## CybeDefend Configuration

| Field                    | Description                  | Example                               |
| ------------------------ | ---------------------------- | ------------------------------------- |
| **GitLab Project ID**    | Numeric project ID in GitLab | `12345`                               |
| **Registry URL**         | GitLab registry URL          | `registry.gitlab.com`                 |
| **Project Path**         | Project path in GitLab       | `username/project` or `group/project` |
| **Project Access Token** | GitLab project access token  | `glpat-xxxxxxxxxxxx`                  |

## How to Create a Project Access Token in GitLab

<Steps>
  <Step title="Access GitLab Project">
    Go to your GitLab project → **Settings** → **Access Tokens**
  </Step>

  <Step title="Create Token">
    Create a new token with a name (e.g., `CybeDefend Scanner`)
  </Step>

  <Step title="Select Role">
    Select the role: **Developer**
  </Step>

  <Step title="Select Scopes">
    Select the required scopes:

    * `read_api` (required to list images)
    * `read_registry` (required to access the registry)
  </Step>

  <Step title="Create and Copy">
    Click **Create project access token** and copy it immediately (you won't see it again!)
  </Step>

  <Step title="Configure CybeDefend">
    Paste the credentials with your project information in CybeDefend
  </Step>
</Steps>

<Warning>
  The Project 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 Project Tokens" icon="folder-tree">
    Prefer project access tokens over personal tokens for better security isolation.
  </Card>

  <Card title="Minimal Scopes" icon="shield-halved">
    Only grant `read_api` and `read_registry` scopes for scanning.
  </Card>

  <Card title="Set Expiration" icon="calendar-xmark">
    Always set an expiration date for your tokens to limit exposure.
  </Card>

  <Card title="Reporter Role" icon="user-check">
    Use Reporter role instead of Developer when only read access is needed.
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication Failed" icon="circle-exclamation">
    * Verify token has both `read_api` and `read_registry` scopes
    * Check if the token has expired
    * Ensure the registry URL is correct
  </Accordion>

  <Accordion title="Permission Denied" icon="ban">
    * Verify the project ID is correct
    * Check project visibility settings
    * Ensure registry is enabled for the project
  </Accordion>
</AccordionGroup>
