Import File Into SecObserve
secobserve_upload_fileImport local scanner reports, SBOMs, or VEX documents into SecObserve to deduplicate findings, apply rules, and resolve disappeared issues.
Instructions
Import a local scanner report, SBOM or VEX document into SecObserve.
This is the correct way to get findings in: the import deduplicates against existing observations, applies rules, resolves findings that disappeared from the report, and records a vulnerability check. Creating observations by hand with secobserve_create does none of that.
The file must live under the server's import directory (SECOBSERVE_IMPORT_DIR, the working directory by default) and be at most 64 MiB.
Args: kind (str): "observations", "sbom" or "vex". file_path (str): Path to the report, absolute or relative to the import directory. product_id (Optional[int]) / product_name (Optional[str]): exactly one, ignored for kind="vex" which matches on the document's own product data. branch_id (Optional[int]) with product_id, or branch_name (Optional[str]) with product_name; a named branch is created if missing. service (Optional[str]): Service to attach findings to. suppress_licenses (Optional[bool]): kind="observations" only. docker_image_name_tag / endpoint_url / kubernetes_cluster / kubernetes_namespace (Optional[str]): origin metadata recorded on each finding.
Returns: str: The import counts as reported by the API, one per line -- for "observations": observations_new, observations_updated, observations_resolved plus license_components_new/updated/deleted; for "sbom": the license_components_* counts; for "vex": the API's summary.
Examples: - Use when: "import trivy-results.json into product 12, branch main" -> kind="observations", file_path="trivy-results.json", product_id=12, branch_id=3 - Use when: "load this SBOM for the release branch" -> kind="sbom", file_path="sbom.cdx.json", product_name="Portal", branch_name="release-2.1" - Use when: "apply the vendor's VEX" -> kind="vex", file_path="vendor.openvex.json" - Don't use when: the data is behind an API you have configured in SecObserve (use secobserve_api_import).
Error Handling: A path outside the import directory, a missing, empty or oversized file is refused before any request is made. 400 usually means the parser could not read the format -- check the product's expected parser with secobserve_list(resource="parsers"). Read-only mode blocks the call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | 'observations' = a scanner report (Trivy, Grype, Semgrep, ZAP, ...); 'sbom' = a CycloneDX or SPDX SBOM, which creates license components; 'vex' = a third-party VEX document whose statements assess existing observations. | |
| service | No | Service name to attach the findings to. | |
| branch_id | No | Target branch by id, with product_id. | |
| file_path | Yes | Path to the file, absolute or relative to the server's import directory. | |
| product_id | No | Target product by id. Give this or product_name. | |
| branch_name | No | Target branch by name; created if missing. Use with product_name. | |
| endpoint_url | No | Origin metadata: the scanned URL, for DAST reports. | |
| product_name | No | Target product by exact name. The by-name endpoints can create the branch on the fly. | |
| suppress_licenses | No | For kind='observations': skip license component extraction from the report. | |
| kubernetes_cluster | No | Origin metadata: cluster. | |
| kubernetes_namespace | No | Origin metadata: namespace. | |
| docker_image_name_tag | No | Origin metadata: the scanned image, e.g. 'registry/app:1.2.3'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |