Giter Club home page Giter Club logo

harbor-scanner-fake's Introduction

harbor-scanner-fake

This is a fake scanner used for the performance testing of harbor.

Build

To run performance tests for the target harbor instance, first ensure you have the prerequisites:

Then:

  1. Clone this repostiroy
git clone https://github.com/goharbor/harbor-scanner-fake
cd harbor-scanner-fake
  1. Build the binary
make build
  1. Run
./out/bin/harbor-scanner-fake

Get the binrary

You can also download the latest pre-build binary file.

curl -sL $(curl -s https://api.github.com/repos/goharbor/harbor-scanner-fake/releases/latest | grep 'http.*linux-amd64.tar.gz"' | awk '{print $2}' | sed 's|[\"\,]*||g') | tar -zx

Configuration

When run the scanner, we can privide a yaml file to customize the behavior of the scanner.

./out/bin/harbor-scanner-fake -c config.yaml

Here is a example yaml file

--
db:
  total: 10000  # The total count of the vulnerabilities in db
scanner:
  workers: 100 # The count of the scan workers
  skipPulling: true  # Skip pulling the artifact from registry when it's true
  errorRate: 0  # The rate when scan failed for the artifact
  vulnerableRate: 1  # The rate when there are vulnerabilities for the artifact
  vulnerabilitiesPerReport: 100  # The vulnerabilities count in the artifact
  reportGeneratingDuration: 0s  # The duration to generate the scan report after artifact pulled
server:
  address: 0.0.0.0:8080  # The address the scanner listend
  accessLog: true  # The access request will be logged when it's true
  timeout: 0s  # A timeout will be returned when the APIs don't response after this time duration
  delay:
    metadata: 0s  # The dealy duration of the metadata API
    acceptScanRequest: 0s  # The dealy duration of the accept scan request API
    getScanReport: 0s  # The dealy duration of the get scan report API

harbor-scanner-fake's People

Contributors

chlins avatar heww avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.