Enable trivy scanner in Harbor OVA if not enabled during deployment
search cancel

Enable trivy scanner in Harbor OVA if not enabled during deployment

book

Article ID: 394732

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

  • Harbor OVA has default trivy scanner.
  • Not enable the option 'Enable Harbor Default Scanner' during OVA deployment.
  • No default scanner in Interrogation Services of Harbor administrative portal.

Environment

Harbor OVA 2.x

Resolution

NOTE: take snapshot or backup before implement below steps. 

To install trivy after Harbor OVA deployment:

  1. SSH Harbor virtual machine with root.
  2. Go to the folder of harbor configuration:

    # cd /etc/goharbor/harbor
     
  3. Stop Harbor components:

    # docker-compost down

  4. Add trivy to docker-compose:

    # ./prepare --with-trivy

  5. Confirm the trivy has been added to docker-compose

    # grep -i trivy docker-compose.yml

    The out sample:

      trivy-adapter:
        container_name: trivy-adapter
        image: vmware.io/goharbor/trivy-adapter-photon:v2.10.3_vmware.1
            source: /storage/data/trivy-adapter/trivy
            target: /home/scanner/.cache/trivy
            source: /storage/data/trivy-adapter/reports
            tag: "trivy-adapter"
          ./common/config/trivy-adapter/env

  6. Start docker-compose again:

    # docker-compose up -d

    The output sample:

    WARN[0000] /etc/goharbor/harbor/docker-compose.yml: `version` is obsolete 
    [+] Running 11/11
      Network harbor_harbor        Created
      Container harbor-log         Started
      Container redis              Started
      Container registryctl        Started
      Container harbor-db          Started
      Container harbor-portal      Started
      Container registry           Started
      Container trivy-adapter      Started
      Container harbor-core        Started
      Container harbor-jobservice  Started
      Container nginx              Started

  7. Login Harbor administrative portal to confirm the default trivy scanner installed.