Generate SecObserve VEX Document
secobserve_vex_documentGenerate CSAF, OpenVEX, or CycloneDX VEX documents from assessed vulnerability observations. Revise existing documents by passing the base ID to update version.
Instructions
Generate a CSAF, OpenVEX or CycloneDX VEX document from assessed observations, or revise one.
The document's content comes from the assessments already recorded: statuses like "Not affected" plus their VEX justification. Assess first, generate second. Passing document_base_id revises that document and bumps its version instead of creating a new one. The generated file is written to the server's export directory.
Args: format (str): "csaf", "openvex" or "cyclonedx". document_id_prefix (Optional[str]): Required to create, and to identify a document to update. document_base_id (Optional[str]): Present only when updating. product_id (Optional[int]) and/or vulnerability_names (Optional[List[str]]): the scope when creating; at least one is required. branch_ids (Optional[List[int]]): Restrict to these branches. fields (Optional[dict]): Format-specific metadata (CSAF: title, publisher_name, publisher_category, publisher_namespace, tracking_status, tlp_label; OpenVEX: id_namespace, author, role; CycloneDX: author, manufacturer). filename (Optional[str]): Base filename for the written document.
Returns: str: A line giving the absolute path and byte size of the document written to the export directory.
Examples: - Use when: "publish an OpenVEX for product 12" -> format="openvex", document_id_prefix="acme-vex", product_id=12, fields={"id_namespace": "https://acme.example", "author": "Acme Security"} - Use when: "a CSAF advisory for CVE-2024-3094 across our products" -> format="csaf", vulnerability_names=["CVE-2024-3094"], fields={...} - Use when: reissuing after new assessments -> pass document_base_id. - Don't use when: importing someone else's VEX (use secobserve_upload_file, kind="vex").
Error Handling: 400 names the missing format-specific field; read the exact set with secobserve_describe_resource on the matching vex_* resource. A document with no qualifying assessments is generated but empty of statements.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | Format-specific fields. CSAF create needs title, publisher_name, publisher_category, publisher_namespace, tracking_status, tlp_label; OpenVEX needs id_namespace and author; CycloneDX takes author and manufacturer. Read the exact set with secobserve_describe_resource on the matching vex_* resource, or from /api/oa3/swagger-ui. | |
| format | Yes | VEX document format to generate. | |
| filename | No | Base filename for the generated document. No directory separators. | |
| branch_ids | No | Restrict to these branches of the product. | |
| product_id | No | Cover one product. Give product_id or vulnerability_names (or both) when creating. | |
| document_base_id | No | The generated base id. Required only when updating an existing document. | |
| document_id_prefix | No | Prefix of the document id. Required when creating, and to identify the document when updating. | |
| vulnerability_names | No | Cover these vulnerabilities across products, e.g. ['CVE-2024-3094']. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |