Skip to main content
Manages a custom attestation type in Kosli. Custom attestation types define how Kosli validates and evaluates evidence from proprietary tools, custom metrics, or specialized compliance requirements. Custom attestation types define the structure and validation rules for attestations in Kosli. They can include:
  • A JSON Schema (optional) that defines the expected structure of attestation data
  • JQ rules (optional) that evaluate the attestation data for compliance
Note: While both schema and jq_rules are optional attributes in Terraform, the Kosli API requires at least one of them to be provided when creating or updating a custom attestation type.

Example usage

Schema validation

The schema attribute is optional and can contain a valid JSON Schema (draft-07) that defines the structure of attestation data. When provided, attestation data will be validated against this schema. Common schema types:
  • Security scans: Define vulnerability counts and scan metadata
  • Code coverage: Define coverage percentages and test metrics
  • Performance tests: Define response times and error rates

Schema example

JQ rules

The jq_rules attribute is optional and contains an array of JQ expressions that must ALL evaluate to true for an attestation to be considered compliant. When provided, each rule is evaluated against the attestation data. If omitted, no evaluation is performed.

JQ rules examples

Import

Custom attestation types can be imported using their name:

Schema

Required

  • name (String) Name of the custom attestation type. Must start with a letter or number and can only contain letters, numbers, periods, hyphens, underscores, and tildes. Changing this will force recreation of the resource.

Optional

  • description (String) Description of the custom attestation type. Explains what this attestation type validates.
  • jq_rules (List of String) List of jq evaluation rules. Each rule is a jq expression that must evaluate to true for the attestation to be considered compliant. Example: [".coverage >= 80"]. If omitted, no evaluation is performed.
  • schema (String) JSON Schema definition that defines the structure of attestation data. Can be provided inline using heredoc syntax or loaded from a file using file(). If omitted, no schema validation is performed. Semantic equality is used for comparison, so formatting differences are ignored.
  • summary (String) JSON array of ordered, labelled jq expressions rendered as rows on the attestation detail page in Kosli. Each element is an object with a name (the row label) and an expression (a jq expression evaluated against the attestation data); values that are valid URLs render as links. Can be provided inline using jsonencode()/heredoc syntax or loaded from a file using file(), so the same JSON can be kept in one place and shared with other tooling. Example: jsonencode([{ name = "Coverage", expression = ".coverage" }]). If omitted, the attestation detail page falls back to showing the jq evaluation results as a pass/fail checklist; removing it from a type that had one clears the summary. Semantic JSON equality is used when reading the value back from Kosli, so your formatting is preserved rather than being rewritten to the API’s compact form.
Last modified on August 24, 2026