# Trivy mirror (pkg.shecan.ir)

> Mirror of the Trivy package repositories (aquasecurity.github.io/trivy-repo: apt at /deb, suite generic; rpm at /rpm/releases/<arch>) for installing Trivy. The vulnerability database (ghcr.io/aquasecurity/trivy-db) and the Java index database are OCI artifacts pulled through the GHCR mirror with --db-repository / --java-db-repository.

- Upstream: aquasecurity.github.io/trivy-repo, ghcr.io (پایگاه‌دادهٔ آسیب‌پذیری‌ها)
- Mirror URLs: <https://mirror-trivy.pkg.shecan.ir/>, <https://mirror-ghcr.pkg.shecan.ir/>
- Clients: apt, dnf, yum, trivy
- Service status: <https://pkg.shecan.ir/status.json> (key `trivy`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/trivy/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/trivy.json>

## Limitations

- apt and dnf still verify Aqua Security's signature.
- The database repositories must be pointed at mirror-ghcr.pkg.shecan.ir (flags, TRIVY_DB_REPOSITORY/TRIVY_JAVA_DB_REPOSITORY or trivy.yaml); the checks bundle (ghcr.io/aquasecurity/trivy-checks) works the same way with --checks-bundle-repository.
- GitHub release binaries, the install script and the Homebrew formula are not mirrored.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### apt: persistent (user- or system-wide configuration)

Run (linux)

```sh
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSLo /etc/apt/keyrings/trivy.asc https://mirror-trivy.pkg.shecan.ir/deb/public.key
echo "deb [signed-by=/etc/apt/keyrings/trivy.asc] https://mirror-trivy.pkg.shecan.ir/deb generic main" | sudo tee /etc/apt/sources.list.d/trivy.list
sudo apt update && sudo apt install -y trivy
```

### dnf, yum: persistent (user- or system-wide configuration)

Configuration file (linux): `/etc/yum.repos.d/trivy.repo`

```ini
[trivy]
name=Trivy repository
baseurl=https://mirror-trivy.pkg.shecan.ir/rpm/releases/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://mirror-trivy.pkg.shecan.ir/rpm/public.key
```

### dnf: persistent (user- or system-wide configuration)

Run (linux) (checked by hand)

```sh
sudo dnf install -y trivy
```

### trivy: persistent (user- or system-wide configuration)

Configuration file: `~/.trivy.yaml`

```
db:
  repository: mirror-ghcr.pkg.shecan.ir/aquasecurity/trivy-db:2
  java-repository: mirror-ghcr.pkg.shecan.ir/aquasecurity/trivy-java-db:1
```

Undo / restore the default

```sh
mv ~/.trivy.yaml ~/.trivy.yaml.shecan-off
```

### trivy: temporary (one command or the current shell; nothing saved)

Example (checked by hand)

```sh
trivy image --db-repository mirror-ghcr.pkg.shecan.ir/aquasecurity/trivy-db:2 --java-db-repository mirror-ghcr.pkg.shecan.ir/aquasecurity/trivy-java-db:1 mirror-docker.pkg.shecan.ir/library/alpine:3.20
```
