Help Targets

Add a Git repository

Scan a public or private Git repository for vulnerable dependencies and leaked secrets, using an access token that can read it.

A Git repository target lets Bavn clone a repository and check its code for vulnerable dependencies and leaked secrets. Bavn proves the repository is yours by reaching it with an access token you give it, so a token is needed for public repositories as well as private ones.

Make a read-only token

Create a token at your Git host that can read this repository and nothing more:

  • GitHub: a fine-grained personal access token with read access to the repository's contents.
  • GitLab: a project access token (or personal token) with read_repository.
  • Bitbucket: a repository access token with read access to the repository.

Bavn needs to read only. It stores the token encrypted and never shows it again; the edit form leaves the field blank and keeps the stored token unless you type a new one.

Add the repository

  1. Open Targets and choose New target.
  2. Set Type to Git repository and give it a Label.
  3. Under Repository, enter the Repository URL, such as https://github.com/your-org/your-repo.git.
  4. Access token: paste the token.
  5. Username: leave it empty for GitHub, GitLab or Bitbucket access tokens; Bavn uses the name each host expects. Fill it in only when your host needs a real user name with the token, such as a Bitbucket app password.
  6. Save, then choose Verify ownership on the target's row and Check now. Bavn checks that the token can list the repository's branches and tags (git ls-remote), without cloning it. If it can, the target is verified.

The repository's host must be reachable from the internet. A Git server on a private address is refused, for the same reason Bavn never scans private addresses from outside.

What Bavn scans in a repository

Scan type Engine What it finds
Dependencies Trivy Known vulnerabilities (CVEs) in the packages your lock files and manifests name, rated low to critical.
Secrets in repo Gitleaks Passwords, API keys and other secrets written into the code. Every leaked secret is rated high.
SBOM & CVEs Syft and Grype Syft builds a software bill of materials, a list of every component in the repository; Grype matches it against known vulnerabilities.

Some details worth knowing:

  • Secrets in repo checks the latest commit of the default branch. Secrets that exist only in older commits are not found.
  • A leaked secret's value stays in Bavn's database for the finding's evidence. Alert emails never include it.

Change the URL or the token

To use a new token, choose Edit, paste it into Access token and save. To point the target at another repository, change the Repository URL and paste a token for that repository in the same save: a new URL clears the verification and the stored token, so the old token is never sent to a different host. Then verify again.

How many repositories you can add

Free includes 3 repositories, Starter 20 repositories and Pro unlimited repositories. See Plans and limits.

All help articles