Configuration file schema
The configuration file schema describes the data in .witnyx.yml.
The file is YAML, and the schema describes the data that it holds.
Configuration file explains what each field does.
Where the schema and the loader differ, the loader decides:
- It accepts
failOnvalues in any letter case, which the schema refuses. - It accepts
versionas the text"1", and refuses1.0, which the schema accepts. - It accepts a number or a boolean where a text is expected, such as
product.nameornote; the schema allows them only forproduct.version. - It allows only one
quality:value infailOn. - It refuses two
notAffectedentries with the sameid, in any letter case, and the samecomponent. - It refuses a date that does not exist, such as
2027-02-30, anexpiresthat is not afterapprovedOn, and anexpiresmore than 12 months afterapprovedOn. - Its rule for the host of
securityTxtUrlis narrower: the host may have no underscore, and may not be empty.
Its ID is https://witnyx.dev/schemas/config/v1.json.
witnyx schema config prints the copy bundled with the tool:
$ witnyx schema config "$id": "https://witnyx.dev/schemas/config/v1.json", "title": "Witnyx configuration (.witnyx.yml), version 1",{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://witnyx.dev/schemas/config/v1.json", "title": "Witnyx configuration (.witnyx.yml), version 1", "description": "The repository's Witnyx settings (spec section 8.3). The file is YAML; this schema describes the data it holds. An empty value means not set. Where this schema and the loader differ, the loader decides; the differences: (1) the loader accepts failOn values in other letter cases, which the schema refuses (it tolerates surrounding spaces only in failOn values, dates and URLs); (2) it also accepts version as the text \"1\", and refuses 1.0, which the schema accepts; (3) it accepts a number or a boolean where a text is expected, such as product name or note, where the schema allows them only for product version; (4) only one quality: value is allowed in total, which the schema does not encode; (5) it refuses two notAffected entries with the same id (in any letter case) and component; (6) it refuses a date that does not exist, such as 2027-02-30, an expires not after approvedOn, and an expires more than 12 months after approvedOn; (7) its host rule is narrower: a securityTxtUrl host must be one that Java URI parses as a host (no underscore, no empty host).", "type": "object", "additionalProperties": false, "required": ["version"], "properties": { "version": { "description": "The format version; always 1.", "type": "integer", "const": 1 }, "failOn": { "description": "When to fail the build, as with --fail-on. The --fail-on flag wins over this. none cannot be combined with other values, and at most one quality: value is allowed (the loader checks the second rule).", "oneOf": [ { "type": "null" }, { "$ref": "#/$defs/rule" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/rule" } } ], "if": { "type": "array", "contains": { "const": "none" } }, "then": { "items": { "const": "none" } } }, "product": { "description": "Replaces the product name and version taken from the SBOM; --product-name and --product-version win over this.", "type": ["object", "null"], "additionalProperties": false, "properties": { "name": { "type": ["string", "null"] }, "version": { "type": ["string", "number", "boolean", "null"] } } }, "securityTxtUrl": { "description": "Where security.txt is published. It is fetched only from a public https host; plain http is accepted only for localhost, 127.0.0.1 or [::1].", "oneOf": [ { "type": "null" }, { "type": "string", "pattern": "^\\s*([Hh][Tt][Tt][Pp][Ss]://[^\\s/?#]+|[Hh][Tt][Tt][Pp]://([Ll][Oo][Cc][Aa][Ll][Hh][Oo][Ss][Tt]|127\\.0\\.0\\.1|\\[::1\\])(:[0-9]+)?)([/?#]\\S*)?\\s*$" } ] }, "notAffected": { "description": "Vulnerabilities assessed as not affecting the product. An entry counts only when a person approved it. Two entries with the same id (in any letter case) and component are refused by the loader, not by this schema.", "type": ["array", "null"], "items": { "$ref": "#/$defs/notAffected" } } }, "$defs": { "rule": { "type": "string", "pattern": "^\\s*(exploited|critical|high|eol|none|quality:(100|0?[0-9]?[0-9])%?)\\s*$" }, "date": { "description": "A date written YYYY-MM-DD.", "type": "string", "pattern": "^\\s*[0-9]{4}-[0-9]{2}-[0-9]{2}\\s*$" }, "empty": { "description": "Not set.", "oneOf": [{ "type": "null" }, { "type": "string", "pattern": "^\\s*$" }] }, "approver": { "description": "A person with an email address, e.g. a name followed by the address in angle brackets.", "type": "string", "pattern": "(^|[ \\t\\n\\r\\f\\x0B@()<>])[^ \\t\\n\\r\\f\\x0B@()<>]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}" }, "notAffected": { "type": "object", "additionalProperties": false, "required": ["id", "component", "justification", "expires"], "properties": { "id": { "description": "The vulnerability ID or one of its aliases, e.g. a CVE ID.", "type": "string", "pattern": "\\S" }, "component": { "description": "A package URL; without a version it covers every version.", "type": "string", "pattern": "^\\s*pkg:/*[A-Za-z0-9.+-]+/[^/\\s#?]" }, "justification": { "enum": ["component_not_present", "vulnerable_code_not_present", "vulnerable_code_not_in_execute_path", "vulnerable_code_cannot_be_controlled_by_adversary", "inline_mitigations_already_exist"] }, "note": { "type": ["string", "null"] }, "assessedBy": { "description": "Who assessed it; an agent writes its own name here.", "type": ["string", "null"] }, "approvedBy": { "description": "The person who approved the entry. Agents leave it empty.", "oneOf": [{ "$ref": "#/$defs/empty" }, { "$ref": "#/$defs/approver" }] }, "approvedOn": { "description": "Required when approvedBy is set.", "oneOf": [{ "$ref": "#/$defs/empty" }, { "$ref": "#/$defs/date" }] }, "expires": { "description": "After approvedOn, and at most 12 months after it.", "$ref": "#/$defs/date" } }, "allOf": [ { "if": { "required": ["approvedBy"], "properties": { "approvedBy": { "$ref": "#/$defs/approver" } } }, "then": { "required": ["approvedOn"], "properties": { "approvedOn": { "$ref": "#/$defs/date" } } }, "else": { "properties": { "approvedOn": { "$ref": "#/$defs/empty" } } } } ] } }}Witnyx is a record-keeping and workflow tool. It does not certify compliance. Nothing on this site is legal advice.