@@ -484,59 +484,43 @@ var schema = `
484484var rulesSchema = `
485485{
486486 "$schema": "http://json-schema.org/draft-07/schema#",
487- "definitions": {"rules": {"$id": "#rules", "type": "object", "type": "array",
488- "items":
489- {
490- "type": "object",
491- "properties": {
492- "name": {"type": "string", "minLength": 3},
493- "description": {"type": "string"},
494- "output": {"type": "string", "minLength": 5},
495- "severity": {"type": "string", "enum": ["low", "medium", "high", "critical"]},
496- "min-engine-version": {"type": "string", "minLength": 5, "pattern": "^([0-9]+.)([0-9]+.)([0-9]+)$"},
497- "condition": {"type": "string", "minLength": 3},
498- "action": {
499- "type": "array",
500- "items": [
501- {
502- "type": "object",
503- "properties": {
504- "kill": {
505- "type": "object",
506- "properties": {
507- "pid": {"type": "string", "minLength": 4}
508- }
509- }
510- }
511- }
512- ]
513- },
514- "additionalProperties": false
515- }
516- },
517- "required": ["name", "condition", "min-engine-version"],
518- "minItems": 1,
519- "additionalProperties": false
520- }}},
521-
522-
523487 "type": "object",
524488 "properties": {
525489 "group": {"type": "string", "minLength": 1},
526490 "description": {"type": "string"},
527491 "enabled": {"type": "boolean"},
528492 "tags": {"type": "array", "items": [{"type": "string", "minLength": 1}]},
529- "rules": {"$ref": "#rules"},
493+ "rules": {"type": "array", "items": {
494+ "type": "object",
495+ "properties": {
496+ "name": {"type": "string", "minLength": 3},
497+ "description": {"type": "string"},
498+ "output": {"type": "string", "minLength": 5},
499+ "severity": {"type": "string", "enum": ["low", "medium", "high", "critical"]},
500+ "min-engine-version": {"type": "string", "minLength": 5, "pattern": "^([0-9]+.)([0-9]+.)([0-9]+)$"},
501+ "condition": {"type": "string", "minLength": 3},
502+ "action": {
503+ "type": "array",
504+ "items": {
505+ "type": "object",
506+ "properties": {
507+ "name": {"type": "string", "enum": ["kill"]},
508+ "pid": {"type": "string", "minLength": 5}
509+ },
510+ "required": ["name"],
511+ "additionalProperties": false
512+ }
513+ }
514+ },
515+ "required": ["name", "condition", "min-engine-version"],
516+ "minItems": 1,
517+ "additionalProperties": false}},
530518 "labels": {
531519 "type": "object",
532520 "additionalProperties": { "type": "string" }
533521 }
534522 },
535- "required": ["group"],
536- "oneOf": [
537- {"required": ["from-strings"]},
538- {"required": ["rules"]}
539- ],
523+ "required": ["group", "rules"],
540524 "additionalProperties": false
541525}
542526`
0 commit comments