> For the complete documentation index, see [llms.txt](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/oaa/templates/secret-scanner-template.md). Agents can also search and read this documentation through its [MCP server](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/~gitbook/mcp).

# Secret Scanner

Template for submitting leaked secret findings from external secret scanning tools

{% hint style="info" %}
**Early Access**: The Secret Scanner template is available on an Early Access basis. Contact Veza Support to enable it for your organization before you create a provider with this template.
{% endhint %}

Use this template to bring findings from an external secret scanning tool into Veza using the [Open Authorization API](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/oaa.md). Each finding records one place a credential was found in source control, so that leaked credentials can be correlated with the matching secrets in Azure Key Vault.

This template is smaller than the others. It has no application, resource, or identity entities, no permission model, and no custom properties. A submission is a single flat list of findings.

## How it differs from the other templates

|                     | Secret scanner                    | Other templates                  |
| ------------------- | --------------------------------- | -------------------------------- |
| Payload shape       | one flat array of findings        | nested entities                  |
| Custom properties   | not supported                     | supported                        |
| Permissions         | none                              | declared and bound to identities |
| Incremental updates | not supported                     | supported by several templates   |
| Entity hierarchy    | derived by Veza from the findings | declared in the payload          |

If you are modeling a credential management system rather than the output of a scanner, use the [Secret Store](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/oaa/templates/secret-store-template.md) template instead. Secret Store describes vaults, entries, and who can read them. Secret Scanner describes credentials that were found where they should not be.

## Entities Veza creates

You submit findings. Veza groups them and creates two entity types:

* **Custom Leaked Secret** - one per distinct `fingerprint`, representing a single credential
* **Custom Leaked Secret Finding** - one per submitted finding, representing one occurrence of that credential

A credential committed to three repositories produces one leaked secret and three findings. Veza also rolls up first and last seen timestamps and a finding count onto the leaked secret.

To use the secret scanner template, set the template type to `secret_scanner` when creating a new data provider:

```bash
curl -X POST "https://{VEZA_URL}/api/v1/providers/custom" \
-H "authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
--data '{"name":"MyScanner","custom_template":"secret_scanner"}'
```

{% hint style="info" %}
This template does not support [incremental updates](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/oaa/best-practices/incremental-updates.md). Every push replaces the contents of the data source, so submit the complete set of current findings each time.
{% endhint %}

### Correlation with Azure Key Vault

When a leaked secret has a `key_id`, Veza looks for an Azure Key Vault secret, key, or certificate whose name equals the `key_id`. The match isn't case-sensitive. Veza connects the leaked secret to the first matching Key Vault secret, key, or certificate in each Azure subscription where Veza discovers Key Vault objects. A leaked secret without a `key_id`, or with no matching Key Vault object, isn't connected to a credential.

Azure Key Vault is the only correlation target for this template. Matching to AWS IAM access keys and to [Secret Store](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/oaa/templates/secret-store-template.md#leaked-secret-correlation) entries applies only to leaked secrets found by [GitHub Secret Scanning](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/integrations/github.md#secret-scanning).

## Sample payload

<details>

<summary>Two findings for the same credential</summary>

Both findings share a `fingerprint`, so they resolve to one leaked secret with two occurrences.

```json
{
  "findings": [
    {
      "fingerprint": "a3f1c9e77b2d4e8091ac5f6b3d2e8104",
      "secret_hash": "9f2b1c",
      "credential_type": "AWS_ACCESS_KEY",
      "cloud_provider": "AWS",
      "source_system": "EXAMPLE_SCANNER",
      "repository_name": "example-org/billing-service",
      "repository_url": "https://git.example.com/example-org/billing-service",
      "file_path": "config/settings.yaml",
      "line_number": 42,
      "commit_hash": "4b7c2a91d8e3f560172bc4a9e8d3f102",
      "branch": "main",
      "author_email": "alice@example.com",
      "author_name": "Alice Chen",
      "commit_date": "2026-08-14T16:22:10Z",
      "commit_message": "Add billing service configuration",
      "scanner_confidence": 90,
      "scanner_rule_id": "aws-access-key-id",
      "key_id": "AKIAIOSFODNN7EXAMPLE",
      "discovered_at": "2026-09-02T04:15:00Z",
      "validation_status": "VALIDATED_ACTIVE",
      "validation_timestamp": "2026-09-02T04:16:30Z"
    },
    {
      "fingerprint": "a3f1c9e77b2d4e8091ac5f6b3d2e8104",
      "secret_hash": "9f2b1c",
      "credential_type": "AWS_ACCESS_KEY",
      "cloud_provider": "AWS",
      "source_system": "EXAMPLE_SCANNER",
      "repository_name": "example-org/deploy-scripts",
      "file_path": "scripts/deploy.sh",
      "line_number": 7,
      "branch": "main",
      "discovered_at": "2026-09-02T04:15:00Z",
      "validation_status": "VALIDATED_ACTIVE"
    }
  ]
}
```

</details>

## Top-level payload

| Field      | Type  | Description                                                                    |
| ---------- | ----- | ------------------------------------------------------------------------------ |
| `findings` | array | Required. Array of [finding](#findings) objects. The only field in the payload |

Veza rejects a payload that contains a field it doesn't recognize, either at the top level or inside a finding.

## Findings

Each finding is one occurrence of one credential in one location. Findings are flat: there is no nesting, so every finding repeats the details of the credential it belongs to.

```json
"findings": [
  {
    "fingerprint": "a3f1c9e77b2d4e8091ac5f6b3d2e8104",
    "secret_hash": "9f2b1c",
    "credential_type": "AWS_ACCESS_KEY",
    "cloud_provider": "AWS",
    "source_system": "EXAMPLE_SCANNER",
    "repository_name": "example-org/billing-service",
    "file_path": "config/settings.yaml",
    "line_number": 42,
    "discovered_at": "2026-09-02T04:15:00Z"
  }
]
```

### Identifying the credential

| Field             | Type   | Description                                                                                                                                           |
| ----------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fingerprint`     | string | Required. Stable identifier for the credential, used to group findings. Two findings sharing a fingerprint describe the same credential               |
| `secret_hash`     | string | Required. A short hash prefix of the credential, for display. Submit this prefix rather than the credential itself                                    |
| `credential_type` | string | Required. The kind of credential. See [Conventional values](#conventional-values)                                                                     |
| `cloud_provider`  | string | Required. The provider the credential belongs to. See [Conventional values](#conventional-values)                                                     |
| `key_id`          | string | The credential's public identifier, such as an access key ID. Used to correlate the leaked secret to a credential Veza already knows about (optional) |

### Locating the finding

| Field             | Type    | Description                                                                                |
| ----------------- | ------- | ------------------------------------------------------------------------------------------ |
| `source_system`   | string  | Required. The scanner that produced the finding                                            |
| `repository_name` | string  | Required. The repository the credential was found in                                       |
| `repository_url`  | string  | Link to the repository (optional)                                                          |
| `file_path`       | string  | Required. Path to the file within the repository                                           |
| `line_number`     | integer | The line holding the credential. Submit it: a finding without this field records line zero |
| `branch`          | string  | The branch the finding was seen on (optional)                                              |
| `commit_hash`     | string  | The commit the credential was found in (optional)                                          |
| `commit_date`     | string  | RFC3339 timestamp for the commit (optional)                                                |
| `commit_message`  | string  | The commit message (optional)                                                              |
| `author_email`    | string  | Email address of the commit author (optional)                                              |
| `author_name`     | string  | Name of the commit author (optional)                                                       |
| `finding_context` | string  | Surrounding context for the match, for triage (optional)                                   |

### Scanner and validation detail

| Field                  | Type    | Description                                                                                                                                   |
| ---------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `discovered_at`        | string  | Required. RFC3339 timestamp for when the scanner found the credential. Veza uses it to derive first and last seen dates for the leaked secret |
| `scanner_confidence`   | integer | How confident the scanner is, by convention from 0 to 100. A value of 0, or an omitted value, isn't recorded (optional)                       |
| `scanner_rule_id`      | string  | The scanner rule that matched (optional)                                                                                                      |
| `validation_status`    | string  | Whether the credential was tested and found to work. See [Conventional values](#conventional-values) (optional)                               |
| `validation_timestamp` | string  | RFC3339 timestamp for when validation ran. Also decides which finding's details win when several share a fingerprint (optional)               |
| `validation_response`  | string  | Free-form detail from the validation attempt (optional)                                                                                       |

When several findings share a `fingerprint`, Veza takes the credential details from the most recently validated one. If that finding leaves `key_id`, `credential_type`, or `cloud_provider` empty, Veza takes the value from another finding in the group. `secret_hash` and the validation fields come only from the most recently validated finding.

### Conventional values

Four fields hold values that are conventions rather than a set Veza enforces. Any string is accepted.

| Field               | Conventional values                                                                       |
| ------------------- | ----------------------------------------------------------------------------------------- |
| `credential_type`   | `AWS_ACCESS_KEY`, `AZURE_CLIENT_SECRET`, `GCP_SERVICE_ACCOUNT_KEY`, `GITHUB_PAT`, `OTHER` |
| `cloud_provider`    | `AWS`, `AZURE`, `GCP`, `GITHUB`, `OTHER`                                                  |
| `validation_status` | `NOT_VALIDATED`, `VALIDATED_ACTIVE`, `VALIDATED_INACTIVE`                                 |
| `source_system`     | the name of the scanner that produced the finding                                         |

A finding that omits `validation_status` is recorded as `NOT_VALIDATED`.

## What this template does not carry

Readers coming from a vulnerability management tool often look for these. None of them exists in this template:

* **Severity.** There is no severity field. `scanner_confidence` records how sure the scanner is that the match is real, which is a different thing.
* **Remediation or resolution state.** `validation_status` records whether the credential still works, not whether anyone has rotated or revoked it.
* **Assignment and ticketing.** There is no assignee, owner, or ticket link.
* **Custom properties.** This template accepts no `custom_properties` and no `custom_property_definition`.

For a JSON push, Veza also does not check required fields, either when the push is accepted or when the findings are processed. A finding missing a required field is stored with that value empty. Findings with no `fingerprint` are all grouped into a single leaked secret, so validate submissions before pushing them. A [CSV upload](#uploading-findings-as-a-csv-file) does check `fingerprint`.

## Uploading findings as a CSV file

You can also upload findings as a CSV file, with each row holding one finding. A column mapping on the provider assigns CSV columns to finding fields.

{% hint style="info" %}
The **Upload CSV** integration in the Veza interface doesn't offer the Secret Scanner template, so create the integration with the API. After that, upload each file with the `:push_csv` endpoint or with **Upload CSV** on the integration.
{% endhint %}

1. **Create the provider** with the CSV push type and a column mapping:

   ```bash
   curl -X POST "https://{VEZA_URL}/api/v1/providers/custom" \
   -H "authorization: Bearer {API_KEY}" \
   -H "Content-Type: application/json" \
   --data '{
     "name": "MyScannerCSV",
     "custom_templates": ["secret_scanner"],
     "push_type": "CSV",
     "csv_mapping_configuration": {
       "template_type": "secret_scanner",
       "column_mappings": [
         {"column_name": "fingerprint", "destination_type": "finding", "destination_property": "fingerprint"},
         {"column_name": "hash", "destination_type": "finding", "destination_property": "secret_hash"},
         {"column_name": "type", "destination_type": "finding", "destination_property": "credential_type"},
         {"column_name": "provider", "destination_type": "finding", "destination_property": "cloud_provider"},
         {"column_name": "scanner", "destination_type": "finding", "destination_property": "source_system"},
         {"column_name": "repo", "destination_type": "finding", "destination_property": "repository_name"},
         {"column_name": "path", "destination_type": "finding", "destination_property": "file_path"},
         {"column_name": "line", "destination_type": "finding", "destination_property": "line_number"},
         {"column_name": "key_id", "destination_type": "finding", "destination_property": "key_id"},
         {"column_name": "found_at", "destination_type": "finding", "destination_property": "discovered_at"}
       ]
     }
   }'
   ```

   Each mapping names a CSV column in `column_name`, sets `destination_type` to `finding`, and sets `destination_property` to a [finding](#findings) field. Custom properties aren't supported.
2. **Create a data source** on the provider, as for a [JSON push](#creating-and-updating-a-secret-scanner).
3. **Upload the file** to the data source's `:push_csv` endpoint, with the CSV contents base64-encoded in `csv_data`. See [Uploading the Data](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/integrations/csv/csv-automation.md#uploading-the-data).

These rules apply to the uploaded file:

* The first row holds the column headers. Header names aren't case-sensitive, and each must be unique.
* Every column named in the mapping must be present in the header row. Veza ignores columns that aren't mapped.
* A row without a `fingerprint` value fails the upload. Veza rejects the file and reports the affected lines.
* `validation_timestamp` and `validation_response` can't be mapped, so a workflow that needs them must push JSON.
* If `discovered_at` isn't mapped, Veza records the time of the upload. Timestamp columns accept the [CSV timestamp formats](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/integrations/csv.md#timestamp-formats).

As with a JSON push, each upload replaces the contents of the data source.

## Creating and updating a secret scanner

To create the OAA provider and push data:

1. **Create the provider** with the `secret_scanner` template type:

   ```bash
   curl -X POST "https://{VEZA_URL}/api/v1/providers/custom" \
   -H "authorization: Bearer {API_KEY}" \
   -H "Content-Type: application/json" \
   --data '{"name":"MyScanner","custom_template":"secret_scanner"}'
   ```
2. **Create a data source** on the provider:

   ```bash
   curl -X POST "https://{VEZA_URL}/api/v1/providers/custom/{PROVIDER_ID}/datasources" \
   -H "authorization: Bearer {API_KEY}" \
   -H "Content-Type: application/json" \
   --data '{"name":"my_scanner_source"}'
   ```
3. **Push the payload** to the data source:

   ```bash
   curl -X POST "https://{VEZA_URL}/api/v1/providers/custom/{PROVIDER_ID}/datasources/{DATASOURCE_ID}:push" \
   -H "authorization: Bearer {API_KEY}" \
   -H "Content-Type: application/json" \
   --data "{\"json_data\": $(jq -Rs . payload.json)}"
   ```

   The push endpoint requires the payload as a JSON-encoded string in the `json_data` field. `jq -Rs .` reads `payload.json` and escapes it as a JSON string.

Updates follow the same push workflow. Because this template replaces the data source contents on every push, submit the full current set of findings rather than only new ones. Veza removes a credential that the payload no longer lists.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/oaa/templates/secret-scanner-template.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
