129 lines
4.6 KiB
JSON
129 lines
4.6 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "urn:durkahelper:schema:profile:v1",
|
|
"title": "DurkaHelper declarative defense profile v1",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["schema", "name"],
|
|
"properties": {
|
|
"schema": {"const": "durkahelper.profile.v1"},
|
|
"name": {"type": "string", "minLength": 1, "maxLength": 120},
|
|
"snapshot": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"adapters": {
|
|
"type": "array",
|
|
"maxItems": 5,
|
|
"uniqueItems": true,
|
|
"items": {"enum": ["platform", "processes", "listeners", "services", "compose"]}
|
|
},
|
|
"include": {"$ref": "#/$defs/globs"},
|
|
"exclude": {"$ref": "#/$defs/globs"},
|
|
"max_files": {"type": "integer", "minimum": 1, "maximum": 100000},
|
|
"max_file_bytes": {"type": "integer", "minimum": 1, "maximum": 1073741824},
|
|
"max_total_bytes": {"type": "integer", "minimum": 1, "maximum": 21474836480}
|
|
}
|
|
},
|
|
"compose": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["project", "files", "services"],
|
|
"properties": {
|
|
"project": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"},
|
|
"files": {
|
|
"type": "array", "minItems": 1, "maxItems": 8, "uniqueItems": true,
|
|
"items": {"$ref": "#/$defs/composePath"}
|
|
},
|
|
"services": {
|
|
"type": "array", "minItems": 1, "maxItems": 128, "uniqueItems": true,
|
|
"items": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"}
|
|
}
|
|
}
|
|
},
|
|
"health": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 128,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["name", "url"],
|
|
"properties": {
|
|
"name": {"type": "string", "minLength": 1, "maxLength": 120},
|
|
"url": {"type": "string", "minLength": 1, "maxLength": 4096, "pattern": "^https?://"},
|
|
"status": {"type": "integer", "minimum": 100, "maximum": 599},
|
|
"contains": {"type": "string", "maxLength": 4096},
|
|
"timeout": {"type": "number", "exclusiveMinimum": 0, "maximum": 60}
|
|
}
|
|
}
|
|
},
|
|
"backup": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["entries"],
|
|
"properties": {
|
|
"entries": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 256,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["path", "kind"],
|
|
"properties": {
|
|
"path": {"$ref": "#/$defs/relativePathOrDot"},
|
|
"kind": {"enum": ["file", "tree", "native_dump"]}
|
|
}
|
|
}
|
|
},
|
|
"exclude": {"$ref": "#/$defs/globs"},
|
|
"max_files": {"type": "integer", "minimum": 1, "maximum": 100000},
|
|
"max_file_bytes": {"type": "integer", "minimum": 1, "maximum": 4294967296},
|
|
"max_total_bytes": {"type": "integer", "minimum": 1, "maximum": 107374182400}
|
|
}
|
|
},
|
|
"evidence": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"allow_extensions": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 2,
|
|
"uniqueItems": true,
|
|
"items": {"enum": [".json", ".jsonl"]}
|
|
},
|
|
"max_files": {"type": "integer", "minimum": 1, "maximum": 1024},
|
|
"max_file_bytes": {"type": "integer", "minimum": 1, "maximum": 67108864},
|
|
"max_total_bytes": {"type": "integer", "minimum": 1, "maximum": 1073741824}
|
|
}
|
|
}
|
|
},
|
|
"$defs": {
|
|
"composePath": {
|
|
"type": "string",
|
|
"minLength": 5,
|
|
"maxLength": 1024,
|
|
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)(?!.*:)(?!.*[<>\"|?*])(?!.+(?:[. ])(?:/|$))[^/]+(?:/[^/]+)*\\.ya?ml$"
|
|
},
|
|
"relativePathOrDot": {
|
|
"$comment": "The runtime additionally enforces NFC, case-fold uniqueness, and Windows reserved-device names for backup/restore portability.",
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 1024,
|
|
"pattern": "^(?:\\.|(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)(?:[Cc][Oo][Nn]|[Pp][Rr][Nn]|[Aa][Uu][Xx]|[Nn][Uu][Ll]|[Cc][Oo][Mm][1-9]|[Ll][Pp][Tt][1-9])(?:[ .]*\\.[^/]*)?(?:/|$))(?!.*\\\\)(?!.*:)(?!.*[<>\"|?*])(?!.+(?:[. ])(?:/|$))[^/]+(?:/[^/]+)*)$"
|
|
},
|
|
"globs": {
|
|
"type": "array",
|
|
"maxItems": 128,
|
|
"items": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 512,
|
|
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)(?!.*:).+$"
|
|
}
|
|
}
|
|
}
|
|
}
|