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:Documentation Index
Fetch the complete documentation index at: https://kosli-reference-docs-v2-17-8.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- A JSON Schema (optional) that defines the expected structure of attestation data
- JQ rules (optional) that evaluate the attestation data for compliance
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
Theschema 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
Thejq_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 usingfile(). If omitted, no schema validation is performed. Semantic equality is used for comparison, so formatting differences are ignored.