{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Battle-Creek-LLC/secunit/schemas/control.schema.json",
"title": "Control",
"description": "A discrete recurring obligation derived from a WISP. One YAML file per control under controls/.",
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "policy", "owner", "cadence", "skill"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Stable kebab-case identifier; used as evidence path component."
},
"title": { "type": "string", "minLength": 1 },
"policy": { "type": "string", "minLength": 1 },
"nist": {
"type": "array",
"items": { "type": "string", "pattern": "^[A-Z]{2}-[0-9]+(\\([0-9]+\\))?$" },
"uniqueItems": true
},
"owner": { "type": "string", "minLength": 1 },
"cadence": {
"type": "string",
"enum": ["continuous", "weekly", "monthly", "quarterly", "semi-annual", "annual"]
},
"weekday": {
"type": "string",
"enum": ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]
},
"due_by": {
"type": "string",
"description": "For annual cadence; either an ISO date or a `<month>-<day>` form like `december-31`."
},
"skill": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
"skill_args": {
"type": "object",
"additionalProperties": true
},
"scope": { "$ref": "#/$defs/scope" },
"evidence_required": {
"type": "array",
"items": { "$ref": "#/$defs/evidenceRequirement" }
},
"remediation_thresholds": {
"type": "object",
"additionalProperties": { "type": "integer", "minimum": 0 }
},
"outputs": {
"type": "object",
"additionalProperties": true
},
"references": {
"type": "array",
"items": {
"type": "object",
"required": ["title"],
"properties": {
"title": { "type": "string" },
"path": { "type": "string" },
"url": { "type": "string", "format": "uri" }
}
}
}
},
"$defs": {
"scope": {
"type": "object",
"oneOf": [
{
"required": ["kind"],
"properties": {
"kind": { "type": "string", "minLength": 1 },
"all": { "type": "boolean" },
"has_tags": { "type": "array", "items": { "type": "string" } },
"excludes": { "type": "array", "items": { "type": "string" } }
},
"additionalProperties": false
},
{
"required": ["inline"],
"properties": {
"inline": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["name", "kind"],
"properties": {
"name": { "type": "string" },
"kind": { "type": "string" },
"tags": { "type": "array", "items": { "type": "string" } }
},
"additionalProperties": true
}
}
},
"additionalProperties": false
}
]
},
"evidenceRequirement": {
"type": "object",
"required": ["kind"],
"properties": {
"kind": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"prompt": { "type": "string" },
"path": { "type": "string" },
"cmd": { "type": "string" },
"per_system": { "type": "boolean" }
},
"additionalProperties": false
}
}
}