Skip to content

Commit

Permalink
feat: update json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
yywing committed Oct 8, 2021
1 parent ef626e8 commit 826ea12
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## 😘 POC 语法

json schema: [schema](./static/schema.json)
json schema: [schema](./static/schema/schema.json)

文档:https://docs.xray.cool/#/guide/poc

Expand Down
148 changes: 148 additions & 0 deletions static/schema/schema-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/chaitin/gamma/master/static/schema/schema-v1.json",
"title": "POC Check",
"description": "A tool that checks XRay POC",
"type": "object",
"definitions": {
"rules": {
"description": "POC rules",
"type": "array",
"minItems": 1,
"items": {
"description": "A rule",
"type": "object",
"properties": {
"method": {
"description": "request method",
"type": "string",
"enum": [
"HEAD",
"GET",
"POST",
"PUT",
"PATCH",
"DELETE",
"OPTIONS",
"CONNECT",
"MOVE",
"TRACE",
"PROPFIND"
]
},
"path": {
"description": "request path",
"type": "string",
"pattern": "^/.*"
},
"headers": {
"description": "request HTTP headers",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"body": {
"description": "request body",
"type": "string"
},
"follow_redirects": {
"description": "This option determines whether the HTTP request will follow the jump",
"type": "boolean"
},
"expression": {
"description": "a CEL expression what determines whether the vulnerability exists",
"type": "string"
},
"search": {
"description": "a pattern to search the keywords in last response body",
"type": "string"
}
},
"required": [
"expression"
],
"additionalProperties": false
}
}
},
"properties": {
"name": {
"description": "POC name",
"type": "string",
"pattern": "^(?:poc-yaml|custom)-[a-z0-9\\-]+$"
},
"set": {
"description": "set variables",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"rules": {
"$ref": "#/definitions/rules"
},
"groups": {
"description": "Group Rules",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/rules"
}
},
"detail": {
"description": "output details",
"type": "object",
"properties": {
"author": {
"description": "POC author",
"type": "string"
},
"links": {
"description": "some links that describe or reproduce the vulnerability",
"type": "array",
"items": {
"description": "link",
"type": "string",
"format": "iri"
},
"minItems": 1
}
},
"additionalProperties": true,
"required": [
"links"
]
},
"test": {
"description": "for unittest",
"type": "object",
"properties": {
"target": {
"description": "test env target",
"type": "string",
"format": "iri"
},
"skip": {
"description": "This option determines whether the test is skip",
"type": "boolean"
}
},
"additionalProperties": false
}
},
"oneOf": [
{
"required": [
"name",
"rules"
]
},
{
"required": [
"name",
"groups"
]
}
],
"additionalProperties": false
}
2 changes: 1 addition & 1 deletion static/schema.json → static/schema/schema-v2.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/chaitin/gamma/blob/master/static/schema.json",
"$id": "https://raw.githubusercontent.com/chaitin/gamma/master/static/schema/schema-v2.json",
"title": "POC Check",
"description": "A tool that checks XRay POC",
"type": "object",
Expand Down
1 change: 1 addition & 0 deletions static/schema/schema.json

0 comments on commit 826ea12

Please sign in to comment.