Skip to content

Code repositories

A project can hold any number of git repositories. Reconmap scans each one with code analysis tools (secret scanning, static analysis, dependency and SBOM scanners) on a runner, which works on a fresh clone of the repository. The results become findings of the project, attached to the repository.

Adding a repository

Open a project, select the Repositories tab and click New repository:

Field Description
Clone URL https://host/org/repo(.git) or git@host:org/repo.git (ssh:// also works). Do not put credentials in the URL; use the token field instead.
Name Optional; defaults to the last part of the URL.
Branch Optional; defaults to the remote's default branch.
Authentication How the runner authenticates when it clones (see below).

Each repository is also added to the project's asset tree as an asset of type repository, named after its URL. Findings from repository scans are attached to that asset. A project can't hold the same URL twice.

Starting a Code audit from the Scans page with a git@... or https://....git target also attaches the repository to the selected project, as a public repository, if it isn't attached already. To scan a private repository, add it on the Repositories tab first and choose how the runner authenticates.

Authentication

Every repository has its own authentication setting:

  • None (public repository): the runner clones without credentials.
  • Access token: a read-only token for an https:// URL. The token is encrypted at rest with the API's Data Protection keys and is never returned by the API or shown again; leave the field blank when editing to keep it. Set Token username to what your provider expects:
    • GitHub: a fine-grained personal access token with read-only Contents permission on the repository, with username x-access-token (the default).
    • GitLab: a project or personal access token with the read_repository scope, with username oauth2.
    • Bitbucket: a repository access token with read permission, with username x-token-auth.
  • Runner's own git credentials: the server stores nothing. The runner uses its host's git configuration: SSH keys and known_hosts for git@ URLs, or a git credential helper for https:// URLs. Use this when tokens should never leave the runner hosts.

A runner fetches the token from GET /api/repositories/{id}/clone-credentials right before it clones. The API only answers runners (Keycloak service accounts), and only while a scan of that repository is queued. The runner passes the token to git through a credential helper set in git's environment. That helper only answers for the repository's own host, so the token never appears in command lines, the clone URL, .git/config or the logs, and is not sent on a redirect to another host.

Tokens are encrypted with the same Data Protection keys as the AI provider keys. If those keys are lost (for example, a new API container without the keys volume), tokens must be entered again.

Scanning a repository

Click Scan next to a repository. This starts a Code audit scan and opens its page. The scan runs these tools:

Tool What it finds
Gitleaks Hardcoded secrets (API keys, passwords, tokens). Run with --redact, so secret values are not stored in Reconmap.
Bandit Security issues in Python code.
Semgrep Security issues in many languages (--config=auto).
Snyk Vulnerable dependencies (needs snyk auth on the runner).
Trivy Vulnerable dependencies, misconfigurations and secrets.
Syft A software bill of materials (packages become assets).

If an AI provider is configured, it may choose a subset of these tools and their order (see scans).

For each tool, the runner:

  1. creates a temporary directory and makes a shallow clone (--depth 1) of the repository's branch into it;
  2. runs the tool inside the clone;
  3. uploads the tool's report, along with the commit it scanned;
  4. deletes the clone.

The scan's tasks and the repository record the commit that was scanned, and the Repositories tab shows when each repository was last scanned and at which commit. For GitHub, GitLab and Bitbucket repositories, each finding's proof of concept links every location (file:line) to that file at that commit.

Runner requirements

The runner host needs git, plus each tool on its PATH: gitleaks, bandit, semgrep, snyk, trivy and syft. The official runner image includes git and the SSH client, but not the code scanners. A tool that is missing makes its task fail with the error. For git@ URLs with Runner's own git credentials, the runner's SSH key and the host key in known_hosts must be set up, because the runner never answers interactive prompts.

API

Method and path Description
GET /api/repositories?projectId=... Lists a project's repositories.
GET /api/repositories/{id} Gets one repository.
POST /api/repositories Adds a repository: { "projectId", "url", "name"?, "defaultBranch"?, "authType": "none" \| "token" \| "runner", "authUsername"?, "authToken"? }.
PUT /api/repositories/{id} Updates a repository. Fields that are left out are kept; a missing or blank authToken keeps the stored token. Switching away from token deletes the token.
DELETE /api/repositories/{id} Removes the repository and its queued clones. Its asset and findings are kept.
POST /api/repositories/{id}/scans Starts a scan, { "objective"? } (default Code audit). Returns the scan.

Responses never include the token, only hasToken. Project members can manage the repositories of their projects.