This commit is contained in:
DurkaHelper contributors committed 2026-10-10 07:29:48 +03:00
commit 303438d206
217 files changed
+66681

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:approved-drift:v1",
"title": "DurkaHelper reviewed approved drift v1",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"id",
"reviewed_at",
"baseline_sha256",
"current_sha256",
"drift"
],
"properties": {
"schema": {"const": "durkahelper.approved-drift.v1"},
"id": {
"type": "string",
"minLength": 8,
"maxLength": 128,
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
},
"reviewed_at": {"type": "string", "format": "date-time"},
"baseline_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"current_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"drift": {
"type": "object",
"additionalProperties": false,
"required": [
"adapters_changed",
"files_added",
"files_content_changed",
"files_metadata_changed",
"files_removed"
],
"properties": {
"adapters_changed": {
"type": "array",
"uniqueItems": true,
"items": {"enum": ["platform", "processes", "listeners", "services", "compose"]}
},
"files_added": {"$ref": "#/$defs/paths"},
"files_content_changed": {"$ref": "#/$defs/paths"},
"files_metadata_changed": {"$ref": "#/$defs/paths"},
"files_removed": {"$ref": "#/$defs/paths"}
}
}
},
"$defs": {
"paths": {
"type": "array",
"maxItems": 100000,
"uniqueItems": true,
"$comment": "Runtime additionally requires sorted, NFC, portable relative POSIX paths.",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 1024,
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)(?!.*:)[^/]+(?:/[^/]+)*$"
}
}
}
}
+61
View File
@@ -0,0 +1,61 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:backup-manifest:v1",
"title": "DurkaHelper backup manifest v1",
"type": "object",
"additionalProperties": false,
"required": ["schema", "tool", "created_at", "profile", "root", "entries", "summary", "bundle_sha256"],
"properties": {
"schema": {"const": "durkahelper.backup-manifest.v1"},
"tool": {"$ref": "#/$defs/tool"},
"created_at": {"type": "string", "format": "date-time"},
"profile": {"$ref": "#/$defs/profileRef"},
"root": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"entries": {
"type": "array", "minItems": 1, "maxItems": 100000,
"items": {
"type": "object", "additionalProperties": false,
"required": ["source", "stored", "kind", "size", "sha256", "mode", "mtime_ns"],
"properties": {
"source": {"$ref": "#/$defs/portablePathOrDot"},
"stored": {"type": "string", "pattern": "^files/[0-9]{6}\\.bin$"},
"kind": {"enum": ["file", "tree", "native_dump"]},
"size": {"type": "integer", "minimum": 0, "maximum": 4294967296},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"mode": {"type": "integer", "minimum": 0, "maximum": 4095},
"mtime_ns": {"type": "integer", "minimum": 0, "maximum": 253402300799999999999}
}
}
},
"summary": {
"type": "object", "additionalProperties": false,
"required": ["files", "total_bytes"],
"properties": {
"files": {"type": "integer", "minimum": 1, "maximum": 100000},
"total_bytes": {"type": "integer", "minimum": 0, "maximum": 107374182400}
}
},
"bundle_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
},
"$defs": {
"tool": {
"type": "object", "additionalProperties": false, "required": ["name", "version"],
"properties": {
"name": {"const": "DurkaHelper defense_ops"},
"version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:[-+][0-9A-Za-z.-]+)?$"}
}
},
"profileRef": {
"type": "object", "additionalProperties": false, "required": ["name", "sha256"],
"properties": {
"name": {"type": "string", "minLength": 1, "maxLength": 120},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
},
"portablePathOrDot": {
"$comment": "The runtime additionally enforces NFC, case-fold uniqueness, reserved-device names, and deterministic ordering.",
"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])(?:[ .]*\\.[^/]*)?(?:/|$))(?!.*\\\\)(?!.*:)(?!.*[<>\"|?*])(?!.+(?:[. ])(?:/|$))[^/]+(?:/[^/]+)*)$"
}
}
}
+81
View File
@@ -0,0 +1,81 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:comparison:v1",
"title": "DurkaHelper snapshot comparison v1",
"type": "object",
"additionalProperties": false,
"required": ["schema", "tool", "compared_at", "baseline", "current", "profile", "scope", "comparable", "partial", "reasons", "drift", "summary", "exit_code"],
"properties": {
"schema": {"const": "durkahelper.comparison.v1"},
"tool": {"$ref": "#/$defs/tool"},
"compared_at": {"type": "string", "format": "date-time"},
"baseline": {"$ref": "#/$defs/input"},
"current": {"$ref": "#/$defs/input"},
"profile": {"$ref": "#/$defs/profileRef"},
"scope": {
"type": "object", "additionalProperties": false,
"required": ["baseline_sha256", "current_sha256"],
"properties": {
"baseline_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"current_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
},
"comparable": {"type": "boolean"},
"partial": {"type": "boolean"},
"reasons": {"type": "array", "maxItems": 16, "uniqueItems": true, "items": {"type": "string", "minLength": 1, "maxLength": 120}},
"drift": {
"type": "object", "additionalProperties": false,
"required": ["adapters_changed", "files_added", "files_content_changed", "files_metadata_changed", "files_removed"],
"properties": {
"adapters_changed": {"type": "array", "uniqueItems": true, "items": {"enum": ["platform", "processes", "listeners", "services"]}},
"files_added": {"$ref": "#/$defs/paths"},
"files_content_changed": {"$ref": "#/$defs/paths"},
"files_metadata_changed": {"$ref": "#/$defs/paths"},
"files_removed": {"$ref": "#/$defs/paths"}
}
},
"summary": {
"type": "object", "additionalProperties": false,
"required": ["adapter_changes", "drift_count", "files_added", "files_content_changed", "files_metadata_changed", "files_removed"],
"properties": {
"adapter_changes": {"type": "integer", "minimum": 0},
"drift_count": {"type": "integer", "minimum": 0},
"files_added": {"type": "integer", "minimum": 0},
"files_content_changed": {"type": "integer", "minimum": 0},
"files_metadata_changed": {"type": "integer", "minimum": 0},
"files_removed": {"type": "integer", "minimum": 0}
}
},
"exit_code": {"enum": [0, 1, 2]}
},
"$defs": {
"tool": {
"type": "object", "additionalProperties": false, "required": ["name", "version"],
"properties": {
"name": {"const": "DurkaHelper defense_ops"},
"version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:[-+][0-9A-Za-z.-]+)?$"}
}
},
"profileRef": {
"type": "object", "additionalProperties": false, "required": ["name", "sha256"],
"properties": {
"name": {"type": "string", "minLength": 1, "maxLength": 120},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
},
"input": {
"type": "object", "additionalProperties": false, "required": ["created_at", "sha256"],
"properties": {
"created_at": {"type": "string", "format": "date-time"},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
},
"paths": {
"type": "array", "maxItems": 100000, "uniqueItems": true,
"items": {
"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])(?:[ .]*\\.[^/]*)?(?:/|$))(?!.*\\\\)(?!.*:)(?!.*[<>\"|?*])(?!.+(?:[. ])(?:/|$))[^/]+(?:/[^/]+)*$"
}
}
}
}
+126
View File
@@ -0,0 +1,126 @@
{
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"checked_at",
"scope",
"model_sha256",
"policy_sha256",
"source_sha256",
"services",
"findings",
"issues",
"status",
"exit_code"
],
"properties": {
"schema": {
"const": "durkahelper.deployment-audit.v1"
},
"checked_at": {
"type": "string",
"format": "date-time"
},
"scope": {
"const": "declared-model-only"
},
"model_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"policy_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"source_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"services": {
"type": "integer",
"minimum": 1,
"maximum": 64
},
"findings": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"service_sha256",
"check",
"kind"
],
"properties": {
"service_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"check": {
"type": "string",
"maxLength": 80
},
"kind": {
"enum": [
"deployment",
"security",
"availability",
"coverage"
]
}
}
},
"maxItems": 4096
},
"issues": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"service_sha256",
"check",
"kind"
],
"properties": {
"service_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"check": {
"type": "string",
"maxLength": 80
},
"kind": {
"enum": [
"deployment",
"security",
"availability",
"coverage"
]
}
}
},
"maxItems": 4096
},
"status": {
"enum": [
"pass",
"fail",
"partial"
]
},
"exit_code": {
"enum": [
0,
1,
2
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:deployment-audit:v1",
"title": "Sanitized model-only audit",
"$comment": "Runtime enforces allowed check IDs and consistency between issues/findings/status/exit_code. Model/policy are recomputed when used by patch-check."
}
+244
View File
@@ -0,0 +1,244 @@
{
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"source_sha256",
"platform",
"services"
],
"properties": {
"schema": {
"const": "durkahelper.deployment-model.v1"
},
"source_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"platform": {
"type": "object",
"additionalProperties": false,
"required": [
"os",
"architecture",
"runtime"
],
"properties": {
"os": {
"enum": [
"linux",
"darwin"
]
},
"architecture": {
"enum": [
"amd64",
"arm64"
]
},
"runtime": {
"enum": [
"docker-engine",
"docker-desktop"
]
}
}
},
"services": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"role",
"image",
"architectures",
"mode",
"ports",
"mounts",
"privileged",
"network_mode",
"capabilities",
"nonroot",
"healthcheck",
"memory_limit_mb",
"cpu_limit",
"restart"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"
},
"role": {
"enum": [
"ui",
"api",
"backend",
"worker",
"capture"
]
},
"image": {
"type": "string",
"maxLength": 256,
"pattern": "^[a-z0-9][a-z0-9._/:@-]*$"
},
"architectures": {
"type": "array",
"items": {
"enum": [
"amd64",
"arm64"
]
},
"maxItems": 2,
"uniqueItems": true
},
"mode": {
"enum": [
"none",
"file",
"live"
]
},
"ports": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"host_port",
"container_port",
"protocol",
"host_ip"
],
"properties": {
"host_port": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"container_port": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"protocol": {
"enum": [
"tcp",
"udp"
]
},
"host_ip": {
"type": "string",
"maxLength": 45
}
}
},
"maxItems": 128
},
"mounts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"kind",
"target",
"source_scope",
"read_only"
],
"properties": {
"kind": {
"enum": [
"bind",
"volume",
"tmpfs"
]
},
"target": {
"type": "string",
"maxLength": 1024,
"pattern": "^/"
},
"source_scope": {
"enum": [
"approved-data",
"approved-config",
"outside",
"socket",
"host-root",
"unknown"
]
},
"read_only": {
"type": "boolean"
}
}
},
"maxItems": 64
},
"privileged": {
"type": "boolean"
},
"network_mode": {
"enum": [
"bridge",
"host",
"none"
]
},
"capabilities": {
"type": "array",
"items": {
"type": "string",
"pattern": "^(CAP_)?[A-Z][A-Z0-9_]{0,63}$"
},
"maxItems": 64
},
"nonroot": {
"type": [
"boolean",
"null"
]
},
"healthcheck": {
"type": "boolean"
},
"memory_limit_mb": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 1048576
},
"cpu_limit": {
"type": [
"number",
"null"
],
"exclusiveMinimum": 0,
"maximum": 1024
},
"restart": {
"enum": [
"no",
"always",
"on-failure",
"unless-stopped"
]
}
}
},
"maxItems": 64,
"minItems": 1
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:deployment-model:v1",
"title": "Declared deployment metadata; never runtime proof",
"$comment": "Runtime additionally requires canonical literal IPs, unique service ids, safe mount paths, and no secret or command fields."
}
+104
View File
@@ -0,0 +1,104 @@
{
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"team_lan",
"approved_bind_addresses",
"approved_publications",
"approved_images",
"require_healthcheck",
"require_resource_limits",
"require_nonroot",
"require_restart",
"allow_amd64_emulation",
"approved_live_capture"
],
"properties": {
"schema": {
"const": "durkahelper.deployment-policy.v1"
},
"team_lan": {
"type": "boolean"
},
"approved_bind_addresses": {
"type": "array",
"items": {
"type": "string",
"maxLength": 45
},
"maxItems": 128
},
"approved_publications": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"host_port",
"container_port",
"protocol",
"service"
],
"properties": {
"host_port": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"container_port": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"protocol": {
"enum": [
"tcp",
"udp"
]
},
"service": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"
}
}
},
"maxItems": 128
},
"approved_images": {
"type": "array",
"items": {
"type": "string",
"maxLength": 256,
"pattern": "(?:@|^)sha256:[0-9a-f]{64}$"
},
"maxItems": 128
},
"require_healthcheck": {
"type": "boolean"
},
"require_resource_limits": {
"type": "boolean"
},
"require_nonroot": {
"type": "boolean"
},
"require_restart": {
"type": "boolean"
},
"allow_amd64_emulation": {
"type": "boolean"
},
"approved_live_capture": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"
},
"maxItems": 128
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:deployment-policy:v1",
"title": "Explicit deployment audit policy"
}
+37
View File
@@ -0,0 +1,37 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:event:v1",
"title": "DurkaHelper normalized defense event v1",
"type": "object",
"additionalProperties": false,
"required": ["schema", "timestamp", "source", "kind", "severity", "summary"],
"properties": {
"schema": {"const": "durkahelper.event.v1"},
"id": {"type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"},
"timestamp": {"type": "string", "format": "date-time"},
"source": {"type": "string", "minLength": 1, "maxLength": 120},
"kind": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"},
"severity": {"enum": ["info", "low", "medium", "high", "critical"]},
"summary": {"type": "string", "minLength": 1, "maxLength": 512},
"attributes": {"$ref": "#/$defs/attributes"}
},
"$defs": {
"attributes": {
"type": "object",
"maxProperties": 64,
"propertyNames": {
"minLength": 1,
"maxLength": 64,
"not": {"pattern": "(?:[Pp][Aa][Ss][Ss][Ww][Oo][Rr][Dd]|[Pp][Aa][Ss][Ss][Ww][Dd]|[Pp][Ww][Dd]|[Ss][Ee][Cc][Rr][Ee][Tt]|[Tt][Oo][Kk][Ee][Nn]|[Cc][Rr][Ee][Dd][Ee][Nn][Tt][Ii][Aa][Ll]|[Aa][Uu][Tt][Hh][Oo][Rr][Ii][Zz][Aa][Tt][Ii][Oo][Nn]|[Cc][Oo][Oo][Kk][Ii][Ee]|[Pp][Rr][Ii][Vv][Aa][Tt][Ee].?[Kk][Ee][Yy]|[Aa][Pp][Ii].?[Kk][Ee][Yy]|[Aa][Cc][Cc][Ee][Ss][Ss].?[Kk][Ee][Yy]|[Ss][Ee][Ss][Ss][Ii][Oo][Nn]|[Dd][Ss][Nn]|[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii][Oo][Nn].?[Ss][Tt][Rr][Ii][Nn][Gg]|[Cc][Oo][Mm][Mm][Aa][Nn][Dd]|[Ee][Xx][Ee][Cc]|[Aa][Rr][Gg][Vv]|[Ss][Hh][Ee][Ll][Ll])"}
},
"additionalProperties": {
"anyOf": [
{"type": "string", "maxLength": 4096},
{"type": "number"},
{"type": "boolean"},
{"type": "null"}
]
}
}
}
}
+31
View File
@@ -0,0 +1,31 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "durkahelper.image-export.v1",
"title": "Private image export profile (not redistribution authorization)",
"type": "object",
"additionalProperties": false,
"required": ["schema", "release_commit", "images", "max_archive_bytes", "max_total_bytes", "timeout_seconds"],
"properties": {
"schema": {"const": "durkahelper.image-export.v1"},
"release_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"max_archive_bytes": {"type": "integer", "minimum": 1, "maximum": 34359738368},
"max_total_bytes": {"type": "integer", "minimum": 1, "maximum": 103079215104},
"timeout_seconds": {"type": "integer", "minimum": 1, "maximum": 1800},
"images": {
"type": "array", "minItems": 1, "maxItems": 64,
"items": {
"type": "object", "additionalProperties": false,
"required": ["id", "component", "architecture", "image_id", "license", "redistribution", "reviewed_for_secrets"],
"properties": {
"id": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"},
"component": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"},
"architecture": {"enum": ["linux/amd64", "linux/arm64"]},
"image_id": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"license": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9.+() -]{0,127}$"},
"redistribution": {"const": "local-only"},
"reviewed_for_secrets": {"const": true}
}
}
}
}
}
+128
View File
@@ -0,0 +1,128 @@
{
"$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": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)(?!.*:).+$"
}
}
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:scanner-context:v1",
"title": "Non-secret scanner infrastructure context v1",
"$comment": "Context only changes review priority and static explanations. It never disables rules, grants permission, starts processes or makes network requests. The runtime normalizes infrastructure enum ordering before hashing.",
"type": "object",
"additionalProperties": false,
"required": ["schema", "infrastructure", "role"],
"properties": {
"schema": {"const": "durkahelper.scanner-context.v1"},
"infrastructure": {
"type": "array", "maxItems": 7, "uniqueItems": true,
"items": {"enum": ["docker-desktop", "compose", "vulnbox", "team-lan", "s4dfarm", "neo", "packmate"]}
},
"role": {"enum": ["defender", "administrator", "both"]}
}
}
+27
View File
@@ -0,0 +1,27 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:scanner-scope:v2",
"title": "Scanner comparability scope v2",
"$comment": "SHA256 covers canonical ASCII JSON with sorted keys and compact separators, excluding the sha256 field. Root is an opaque identity, not a path. Context digest covers normalized context including the empty default. A v1/v2 or context/semantics mismatch is incomparable, not a clean result. Exclusions must also be sorted/unique and all digests are verified by runtime.",
"type": "object", "additionalProperties": false,
"required": ["schema", "root", "rules_sha256", "exclude", "limits", "path_semantics", "semantic_revision", "context_sha256", "sha256"],
"properties": {
"schema": {"const": "durkahelper.scanner-scope.v2"},
"root": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"rules_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"context_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"path_semantics": {"const": "root-relative-posix.v1"},
"semantic_revision": {"enum": ["bounded-source-signals.v2", "bounded-source-signals.v3"]},
"exclude": {"type": "array", "maxItems": 10000, "uniqueItems": true, "items": {"type": "string", "maxLength": 4096, "pattern": "^[^\u0000]*$"}},
"limits": {
"type": "object", "additionalProperties": false,
"required": ["max_bytes", "max_files", "max_findings"],
"properties": {
"max_bytes": {"type": "integer", "minimum": 1, "maximum": 9223372036854775807},
"max_files": {"type": "integer", "minimum": 1, "maximum": 9223372036854775807},
"max_findings": {"type": "integer", "minimum": 1, "maximum": 9223372036854775807}
}
}
}
}
+224
View File
@@ -0,0 +1,224 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:snapshot:v1",
"title": "DurkaHelper defense snapshot v1",
"type": "object",
"additionalProperties": false,
"required": ["schema", "tool", "created_at", "profile", "root", "scope", "partial", "issues", "limits", "files", "adapters", "skipped", "summary"],
"properties": {
"schema": {"const": "durkahelper.snapshot.v1"},
"tool": {"$ref": "#/$defs/tool"},
"created_at": {"type": "string", "format": "date-time"},
"profile": {"$ref": "#/$defs/profileRef"},
"root": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"scope": {"$ref": "#/$defs/scope"},
"partial": {"type": "boolean"},
"issues": {
"type": "array", "maxItems": 100000,
"items": {
"type": "object", "additionalProperties": false,
"required": ["component", "path", "reason"],
"properties": {
"component": {"type": "string", "minLength": 1, "maxLength": 120},
"path": {"type": ["string", "null"], "maxLength": 4096},
"reason": {"type": "string", "minLength": 1, "maxLength": 120}
}
}
},
"limits": {"$ref": "#/$defs/limits"},
"files": {"type": "array", "maxItems": 100000, "items": {"$ref": "#/$defs/file"}},
"adapters": {
"type": "object", "additionalProperties": false,
"properties": {
"platform": {"oneOf": [{"$ref": "#/$defs/platform"}, {"type": "null"}]},
"processes": {"oneOf": [{"$ref": "#/$defs/processes"}, {"type": "null"}]},
"listeners": {"oneOf": [{"$ref": "#/$defs/listeners"}, {"type": "null"}]},
"services": {"oneOf": [{"$ref": "#/$defs/services"}, {"type": "null"}]},
"compose": {"oneOf": [{"$ref": "#/$defs/compose"}, {"type": "null"}]}
}
},
"skipped": {
"type": "object", "maxProperties": 128,
"propertyNames": {"minLength": 1, "maxLength": 120},
"additionalProperties": {"type": "integer", "minimum": 0}
},
"summary": {
"type": "object", "additionalProperties": false,
"required": ["files", "total_bytes"],
"properties": {
"files": {"type": "integer", "minimum": 0, "maximum": 100000},
"total_bytes": {"type": "integer", "minimum": 0, "maximum": 21474836480}
}
}
},
"$defs": {
"tool": {
"type": "object", "additionalProperties": false, "required": ["name", "version"],
"properties": {
"name": {"const": "DurkaHelper defense_ops"},
"version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:[-+][0-9A-Za-z.-]+)?$"}
}
},
"profileRef": {
"type": "object", "additionalProperties": false, "required": ["name", "sha256"],
"properties": {
"name": {"type": "string", "minLength": 1, "maxLength": 120},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
},
"limits": {
"type": "object", "additionalProperties": false,
"required": ["max_files", "max_file_bytes", "max_total_bytes"],
"properties": {
"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}
}
},
"portablePath": {
"$comment": "The runtime additionally enforces NFC, case-fold uniqueness, and reserved-device names.",
"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])(?:[ .]*\\.[^/]*)?(?:/|$))(?!.*\\\\)(?!.*:)(?!.*[<>\"|?*])(?!.+(?:[. ])(?:/|$))[^/]+(?:/[^/]+)*$"
},
"file": {
"type": "object", "additionalProperties": false,
"required": ["path", "size", "mtime_ns", "mode", "sha256"],
"properties": {
"path": {"$ref": "#/$defs/portablePath"},
"size": {"type": "integer", "minimum": 0, "maximum": 1073741824},
"mtime_ns": {"type": "integer", "minimum": 0, "maximum": 253402300799999999999},
"mode": {"type": "integer", "minimum": 0, "maximum": 4095},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
},
"scope": {
"type": "object", "additionalProperties": false,
"required": ["schema", "tool_compatibility", "adapter_semantics", "adapter_config", "files", "sha256"],
"properties": {
"schema": {"const": "durkahelper.snapshot-scope.v1"},
"tool_compatibility": {"const": "durkahelper-defense-ops-major-2"},
"adapter_semantics": {
"type": "object", "additionalProperties": false,
"properties": {
"platform": {"const": "platform-system-machine-release-python-v1"},
"processes": {"const": "process-name-uid-count-v1"},
"listeners": {"const": "listener-endpoint-no-pid-v1"},
"services": {"const": "service-state-no-pid-v1"},
"compose": {"const": "compose-explicit-project-config-hash-service-state-v1"}
}
},
"adapter_config": {
"type": "object", "additionalProperties": false,
"properties": {
"compose": {
"type": "object", "additionalProperties": false,
"required": ["config_files", "project_sha256", "services"],
"properties": {
"config_files": {"type": "array", "minItems": 1, "maxItems": 8, "uniqueItems": true, "items": {"$ref": "#/$defs/portablePath"}},
"project_sha256": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"services": {"type": "array", "minItems": 1, "maxItems": 128, "uniqueItems": true, "items": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"}}
}
}
}
},
"files": {
"type": "object", "additionalProperties": false,
"required": ["content_semantics", "exclude", "include", "max_file_bytes", "max_files", "max_total_bytes", "path_semantics"],
"properties": {
"content_semantics": {"const": "sha256-size-mode-mtime-v1"},
"exclude": {"$ref": "#/$defs/globs"},
"include": {"$ref": "#/$defs/globs"},
"max_file_bytes": {"type": "integer", "minimum": 1, "maximum": 1073741824},
"max_files": {"type": "integer", "minimum": 1, "maximum": 100000},
"max_total_bytes": {"type": "integer", "minimum": 1, "maximum": 21474836480},
"path_semantics": {"const": "portable-nfc-casefold-v1"}
}
},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
},
"globs": {
"type": "array", "maxItems": 128, "uniqueItems": true,
"items": {"type": "string", "minLength": 1, "maxLength": 512}
},
"platform": {
"type": "object", "additionalProperties": false, "required": ["machine", "system"],
"properties": {
"machine": {"type": "string", "maxLength": 512},
"python": {"type": "string", "maxLength": 512},
"release": {"type": "string", "maxLength": 512},
"system": {"type": "string", "maxLength": 512}
}
},
"processes": {
"type": "array", "maxItems": 100000,
"items": {
"type": "object", "additionalProperties": false, "required": ["name", "pid", "ppid", "uid"],
"properties": {
"name": {"type": "string", "maxLength": 1024},
"pid": {"type": ["integer", "null"]}, "ppid": {"type": ["integer", "null"]},
"uid": {"type": ["integer", "null"]}
}
}
},
"listeners": {
"type": "array", "maxItems": 100000,
"items": {
"type": "object", "additionalProperties": false,
"required": ["address", "port", "protocol", "state"],
"properties": {
"address": {"type": "string", "minLength": 1, "maxLength": 256},
"name": {"type": ["string", "null"], "maxLength": 1024},
"pid": {"type": ["integer", "null"]},
"port": {"type": "integer", "minimum": 0, "maximum": 65535},
"protocol": {"type": "string", "minLength": 1, "maxLength": 32},
"state": {"type": "string", "minLength": 1, "maxLength": 64}
}
}
},
"services": {
"type": "array", "maxItems": 100000,
"items": {
"type": "object", "additionalProperties": false, "required": ["name"],
"properties": {
"active": {"type": "string", "maxLength": 256}, "load": {"type": "string", "maxLength": 256},
"name": {"type": "string", "minLength": 1, "maxLength": 1024},
"pid": {"type": ["integer", "null"]}, "state": {"type": "string", "maxLength": 256},
"status": {"type": "string", "maxLength": 256}, "sub": {"type": "string", "maxLength": 256}
}
}
},
"compose": {
"type": "object", "additionalProperties": false,
"required": ["config_files", "project_sha256", "services"],
"properties": {
"project_sha256": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"config_files": {
"type": "array", "minItems": 1, "maxItems": 8,
"items": {
"type": "object", "additionalProperties": false,
"required": ["path", "sha256", "size"],
"properties": {
"path": {"$ref": "#/$defs/portablePath"},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"size": {"type": "integer", "minimum": 0, "maximum": 16777216}
}
}
},
"services": {
"type": "array", "maxItems": 100000,
"items": {
"type": "object", "additionalProperties": false,
"required": ["count", "health", "service", "state"],
"properties": {
"count": {"type": "integer", "minimum": 0, "maximum": 100000},
"health": {"enum": ["healthy", "unhealthy", "starting", "none"]},
"service": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"},
"state": {"type": "string", "minLength": 1, "maxLength": 64}
}
}
}
}
}
}
}
@@ -0,0 +1,63 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:toolchain-inventory:v1",
"title": "Operator-reviewed private cache recipe; not a runtime acceptance record",
"type": "object",
"additionalProperties": false,
"required": ["schema", "release_commit", "target", "receipt", "image_export", "artifacts"],
"properties": {
"schema": {"const": "durkahelper.toolchain-inventory.v1"},
"release_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"target": {
"type": "object",
"additionalProperties": false,
"required": ["id", "platform"],
"properties": {
"id": {"$ref": "#/$defs/id"},
"platform": {"enum": ["darwin/arm64", "linux/amd64", "linux/arm64", "windows/amd64"]}
}
},
"receipt": {"$ref": "#/$defs/reference"},
"image_export": {"$ref": "#/$defs/reference"},
"artifacts": {"type": "array", "maxItems": 128, "items": {"$ref": "#/$defs/artifact"}}
},
"$defs": {
"id": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"path": {
"type": "string",
"minLength": 1,
"maxLength": 4096,
"description": "Portable relative POSIX path. Runtime validation additionally rejects traversal, links, private-data paths and collisions."
},
"reference": {
"type": "object",
"additionalProperties": false,
"required": ["path", "sha256"],
"properties": {"path": {"$ref": "#/$defs/path"}, "sha256": {"$ref": "#/$defs/sha256"}}
},
"artifact": {
"type": "object",
"additionalProperties": false,
"required": ["id", "path", "kind", "component", "architecture", "version", "sha256", "size", "license", "redistribution", "source_pins"],
"properties": {
"id": {"$ref": "#/$defs/id"},
"path": {"$ref": "#/$defs/path"},
"kind": {"enum": ["core", "source", "client", "license", "installer", "runtime"]},
"component": {"enum": ["durkahelper", "postgres", "redis", "s4dfarm", "neo", "packmate", "container-runtime", "python", "ripgrep"]},
"architecture": {"enum": ["all", "darwin/arm64", "linux/amd64", "linux/arm64", "windows/amd64"]},
"version": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._+:/@-]{0,127}$", "description": "Exact pin; floating names are rejected by runtime validation."},
"sha256": {"$ref": "#/$defs/sha256"},
"size": {"type": "integer", "minimum": 1, "maximum": 34359738368},
"license": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9.+() -]{0,127}$"},
"redistribution": {"const": "local-only"},
"source_pins": {
"type": "object",
"maxProperties": 32,
"additionalProperties": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"description": "For source archives only: dot is the root commit; every pinned submodule path must be present. Empty for other artifact kinds. Declarations do not independently authenticate archive provenance."
}
}
}
}
}
+132
View File
@@ -0,0 +1,132 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:toolchain-manifest:v1",
"title": "Operator-local external toolchain inventory",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"release_commit",
"required_ids",
"artifacts"
],
"properties": {
"schema": {
"const": "durkahelper.toolchain-manifest.v1"
},
"release_commit": {
"type": "string",
"pattern": "^[0-9a-f]{40}$"
},
"required_ids": {
"type": "array",
"minItems": 1,
"maxItems": 256,
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"
}
},
"artifacts": {
"type": "array",
"minItems": 1,
"maxItems": 256,
"items": {
"type": "object",
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"kind": {"const": "image"}
},
"required": ["kind"]
},
"then": {
"properties": {
"architecture": {
"enum": ["linux/amd64", "linux/arm64"]
}
}
}
}
],
"required": [
"id",
"path",
"kind",
"component",
"architecture",
"sha256",
"size",
"license",
"redistribution",
"image_ids"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"
},
"path": {
"type": "string",
"minLength": 1,
"maxLength": 1024
},
"kind": {
"enum": [
"core",
"image",
"source",
"client",
"license"
]
},
"component": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"
},
"architecture": {
"enum": [
"all",
"linux/amd64",
"linux/arm64",
"darwin/arm64",
"windows/amd64"
]
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"size": {
"type": "integer",
"minimum": 1,
"maximum": 34359738368
},
"license": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9.+() -]{0,127}$"
},
"redistribution": {
"enum": [
"local-only",
"reviewed"
]
},
"image_ids": {
"type": "array",
"maxItems": 64,
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^sha256:[0-9a-f]{64}$"
}
}
}
}
}
},
"$comment": "CLI additionally enforces relative portable/private-path rules, exact inventory identities, byte budget, checksum matching and tag-free Docker-save structure. No redistribution or offline-runtime attestation is implied."
}
+260
View File
@@ -0,0 +1,260 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:toolchain-manifest:v2",
"title": "DurkaHelper complete target or partial image-export inventory",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"release_commit",
"scope",
"targets",
"required_ids",
"artifacts"
],
"properties": {
"schema": {"const": "durkahelper.toolchain-manifest.v2"},
"release_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"scope": {"enum": ["complete-target", "image-export"]},
"targets": {
"type": "array",
"maxItems": 16,
"items": {"$ref": "#/$defs/target"}
},
"required_ids": {
"type": "array",
"minItems": 1,
"maxItems": 256,
"uniqueItems": true,
"items": {"$ref": "#/$defs/id"}
},
"artifacts": {
"type": "array",
"minItems": 1,
"maxItems": 256,
"items": {"$ref": "#/$defs/artifact"}
}
},
"$defs": {
"id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"
},
"imageId": {
"type": "string",
"pattern": "^sha256:[0-9a-f]{64}$"
},
"containerPlatform": {
"enum": ["linux/amd64", "linux/arm64"]
},
"role": {
"type": "object",
"additionalProperties": false,
"required": ["id", "component", "platform", "image_id"],
"properties": {
"id": {
"enum": [
"postgres",
"redis",
"neo-redis",
"farm",
"celery",
"front",
"neo-server",
"neo-worker",
"packmate-db",
"packmate"
]
},
"component": {"enum": ["s4dfarm", "neo", "packmate"]},
"platform": {"$ref": "#/$defs/containerPlatform"},
"image_id": {"$ref": "#/$defs/imageId"}
}
},
"target": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"platform",
"container_platforms",
"deployment_contract_sha256",
"runtime_roles",
"artifact_ids"
],
"properties": {
"id": {"$ref": "#/$defs/id"},
"platform": {
"enum": ["linux/amd64", "linux/arm64", "darwin/arm64", "windows/amd64"]
},
"container_platforms": {
"type": "array",
"minItems": 1,
"maxItems": 2,
"uniqueItems": true,
"items": {"$ref": "#/$defs/containerPlatform"}
},
"deployment_contract_sha256": {
"const": "a2327cb0dd091d387d33b283337c048778b6b7aa9bef5a344d19aa48c0d9322b"
},
"runtime_roles": {
"type": "array",
"minItems": 10,
"maxItems": 10,
"uniqueItems": true,
"items": {"$ref": "#/$defs/role"},
"allOf": [
{"contains": {"properties": {"id": {"const": "postgres"}, "component": {"const": "s4dfarm"}}, "required": ["id", "component"]}, "minContains": 1, "maxContains": 1},
{"contains": {"properties": {"id": {"const": "redis"}, "component": {"const": "s4dfarm"}}, "required": ["id", "component"]}, "minContains": 1, "maxContains": 1},
{"contains": {"properties": {"id": {"const": "neo-redis"}, "component": {"const": "neo"}}, "required": ["id", "component"]}, "minContains": 1, "maxContains": 1},
{"contains": {"properties": {"id": {"const": "farm"}, "component": {"const": "s4dfarm"}}, "required": ["id", "component"]}, "minContains": 1, "maxContains": 1},
{"contains": {"properties": {"id": {"const": "celery"}, "component": {"const": "s4dfarm"}}, "required": ["id", "component"]}, "minContains": 1, "maxContains": 1},
{"contains": {"properties": {"id": {"const": "front"}, "component": {"const": "s4dfarm"}}, "required": ["id", "component"]}, "minContains": 1, "maxContains": 1},
{"contains": {"properties": {"id": {"const": "neo-server"}, "component": {"const": "neo"}}, "required": ["id", "component"]}, "minContains": 1, "maxContains": 1},
{"contains": {"properties": {"id": {"const": "neo-worker"}, "component": {"const": "neo"}}, "required": ["id", "component"]}, "minContains": 1, "maxContains": 1},
{"contains": {"properties": {"id": {"const": "packmate-db"}, "component": {"const": "packmate"}}, "required": ["id", "component"]}, "minContains": 1, "maxContains": 1},
{"contains": {"properties": {"id": {"const": "packmate"}, "component": {"const": "packmate"}, "platform": {"const": "linux/amd64"}}, "required": ["id", "component", "platform"]}, "minContains": 1, "maxContains": 1}
]
},
"artifact_ids": {
"type": "array",
"minItems": 1,
"maxItems": 256,
"uniqueItems": true,
"items": {"$ref": "#/$defs/id"}
}
}
},
"artifact": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"path",
"kind",
"component",
"architecture",
"version",
"compatible_with",
"runtime_roles",
"sha256",
"size",
"license",
"redistribution",
"image_ids"
],
"properties": {
"id": {"$ref": "#/$defs/id"},
"path": {"type": "string", "minLength": 1, "maxLength": 1024},
"kind": {
"enum": ["core", "image", "source", "client", "license", "installer", "runtime"]
},
"component": {"$ref": "#/$defs/id"},
"architecture": {
"enum": ["all", "linux/amd64", "linux/arm64", "darwin/arm64", "windows/amd64"]
},
"version": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._+:/@-]{0,127}$"
},
"compatible_with": {
"type": "array",
"maxItems": 64,
"uniqueItems": true,
"items": {"$ref": "#/$defs/id"}
},
"runtime_roles": {
"type": "array",
"maxItems": 10,
"uniqueItems": true,
"items": {
"enum": [
"postgres",
"redis",
"neo-redis",
"farm",
"celery",
"front",
"neo-server",
"neo-worker",
"packmate-db",
"packmate"
]
}
},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"size": {"type": "integer", "minimum": 1, "maximum": 34359738368},
"license": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9.+() -]{0,127}$"
},
"redistribution": {"enum": ["local-only", "reviewed"]},
"image_ids": {
"type": "array",
"maxItems": 64,
"uniqueItems": true,
"items": {"$ref": "#/$defs/imageId"}
}
},
"allOf": [
{
"if": {"properties": {"kind": {"const": "image"}}, "required": ["kind"]},
"then": {
"properties": {
"architecture": {"$ref": "#/$defs/containerPlatform"},
"image_ids": {"minItems": 1},
"runtime_roles": {"minItems": 0}
}
},
"else": {
"properties": {
"image_ids": {"maxItems": 0},
"runtime_roles": {"maxItems": 0}
}
}
},
{
"if": {"properties": {"kind": {"const": "client"}}, "required": ["kind"]},
"then": {"properties": {"compatible_with": {"minItems": 2, "maxItems": 2}}},
"else": {
"if": {"properties": {"kind": {"const": "image"}}, "required": ["kind"]},
"else": {"properties": {"compatible_with": {"maxItems": 0}}}
}
},
{
"if": {"properties": {"kind": {"const": "source"}}, "required": ["kind"]},
"then": {"properties": {"version": {"pattern": "^[0-9a-f]{40}$"}}}
}
]
}
},
"allOf": [
{
"if": {"properties": {"scope": {"const": "complete-target"}}, "required": ["scope"]},
"then": {"properties": {"targets": {"minItems": 1}}}
},
{
"if": {"properties": {"scope": {"const": "image-export"}}, "required": ["scope"]},
"then": {
"properties": {
"targets": {"maxItems": 0},
"artifacts": {
"items": {
"allOf": [
{"$ref": "#/$defs/artifact"},
{
"properties": {
"kind": {"const": "image"},
"compatible_with": {"maxItems": 0},
"runtime_roles": {"maxItems": 0}
}
}
]
}
}
}
}
}
],
"$comment": "The parser additionally enforces portable/private paths, exact inventory identity, byte budgets, fixed component/kind coverage, global and per-target compatibility/provenance edges, release/source pins, image-role identity coverage, target-derived role platforms, shared Redis image identity, and the fixed maintained-deployment contract. complete-target verification requires a trusted detached manifest SHA-256. image-export remains partial."
}
+47
View File
@@ -0,0 +1,47 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:durkahelper:schema:validation-record:v1",
"title": "DurkaHelper validation record v1",
"type": "object",
"additionalProperties": false,
"required": ["schema", "id", "timestamp", "check", "status", "summary"],
"properties": {
"schema": {"const": "durkahelper.validation-record.v1"},
"id": {"type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"},
"timestamp": {"type": "string", "format": "date-time"},
"check": {"type": "string", "minLength": 1, "maxLength": 120},
"status": {"enum": ["pass", "fail", "partial", "blocked", "not_run", "skipped_not_applicable"]},
"summary": {"type": "string", "minLength": 1, "maxLength": 512},
"evidence": {
"$comment": "NFC normalization is additionally enforced by the runtime.",
"type": "array",
"maxItems": 128,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 1024,
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)(?!.*:)[^/]+(?:/[^/]+)*$"
}
},
"attributes": {"$ref": "#/$defs/attributes"}
},
"$defs": {
"attributes": {
"type": "object",
"maxProperties": 64,
"propertyNames": {
"minLength": 1,
"maxLength": 64,
"not": {"pattern": "(?:[Pp][Aa][Ss][Ss][Ww][Oo][Rr][Dd]|[Pp][Aa][Ss][Ss][Ww][Dd]|[Pp][Ww][Dd]|[Ss][Ee][Cc][Rr][Ee][Tt]|[Tt][Oo][Kk][Ee][Nn]|[Cc][Rr][Ee][Dd][Ee][Nn][Tt][Ii][Aa][Ll]|[Aa][Uu][Tt][Hh][Oo][Rr][Ii][Zz][Aa][Tt][Ii][Oo][Nn]|[Cc][Oo][Oo][Kk][Ii][Ee]|[Pp][Rr][Ii][Vv][Aa][Tt][Ee].?[Kk][Ee][Yy]|[Aa][Pp][Ii].?[Kk][Ee][Yy]|[Aa][Cc][Cc][Ee][Ss][Ss].?[Kk][Ee][Yy]|[Ss][Ee][Ss][Ss][Ii][Oo][Nn]|[Dd][Ss][Nn]|[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii][Oo][Nn].?[Ss][Tt][Rr][Ii][Nn][Gg]|[Cc][Oo][Mm][Mm][Aa][Nn][Dd]|[Ee][Xx][Ee][Cc]|[Aa][Rr][Gg][Vv]|[Ss][Hh][Ee][Ll][Ll])"}
},
"additionalProperties": {
"anyOf": [
{"type": "string", "maxLength": 4096},
{"type": "number"},
{"type": "boolean"},
{"type": "null"}
]
}
}
}
}