Import File Into SecObserve
secobserve_upload_fileImport a local scan report, SBOM, or VEX file into SecObserve to deduplicate findings, apply rules, and resolve removed issues. Supports product, branch, service, and origin metadata.
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: params (UploadInput): Validated input containing: - 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 |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |