Skip to content

Commit

Permalink
Merge pull request #9 from cerberauth/refactor-report-schemas
Browse files Browse the repository at this point in the history
Refactor VulnAPI report schemas
  • Loading branch information
emmanuelgautier authored Oct 14, 2024
2 parents d1ef8b1 + a040483 commit 076902b
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 53 deletions.
40 changes: 40 additions & 0 deletions schemas/vulnapi/draft/2024-10/curl-report.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/curl-report.schema.json",
"title": "cURL Report",
"description": "",
"type": "object",
"required": ["method", "url", "securitySchemes", "issues"],
"properties": {
"method": {
"type": "string"
},
"url": {
"type": "string"
},
"data": {
"type": "object"
},
"headers": {
"type": "object"
},
"cookies": {
"type": "array",
"items": {
"type": "object"
}
},
"securitySchemes": {
"type": "array",
"items": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/security-scheme-report.schema.json"
}
},
"issues": {
"type": "array",
"items": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/issue-report.schema.json"
}
}
}
}
23 changes: 23 additions & 0 deletions schemas/vulnapi/draft/2024-10/graphql-report.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/graphql-report.schema.json",
"title": "GraphQL Report",
"description": "",
"type": "object",
"required": [
"url",
"queries",
"mutations"
],
"properties": {
"url": {
"type": "string"
},
"queries": {
"type": "object"
},
"mutations": {
"type": "object"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/vulnerability.schema.json",
"title": "Vulnerability",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/issue-report.schema.json",
"title": "Issue",
"description": "",
"type": "object",
"required": [
Expand Down
35 changes: 35 additions & 0 deletions schemas/vulnapi/draft/2024-10/openapi-operation-report.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/openapi-operation-report.schema.json",
"title": "OpenAPI Operation Report",
"description": "",
"type": "object",
"required": [
"operationId",
"securitySchemes",
"issues"
],
"properties": {
"operationId": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"securitySchemes": {
"type": "array",
"items": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/security-scheme-report.schema.json"
}
},
"issues": {
"type": "array",
"items": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/issue-report.schema.json"
}
}
}
}
25 changes: 25 additions & 0 deletions schemas/vulnapi/draft/2024-10/openapi-report.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/openapi-report.schema.json",
"title": "OpenAPI Report",
"description": "",
"type": "object",
"required": ["paths"],
"properties": {
"paths": {
"title": "Map<string, PathItem object>",
"type": "object",
"patternProperties": {
"^.*$": {
"title": "Map<string, Operation object>",
"type": "object",
"patternProperties": {
"^.*$": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/openapi-operation-report.schema.json"
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/operation.schema.json",
"title": "Report Operation",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/operation-report.schema.json",
"title": "Operation Report",
"description": "",
"type": "object",
"required": [
"id",
"tags",
"method",
"url",
"securitySchemes"
Expand Down Expand Up @@ -42,7 +41,7 @@
"securitySchemes": {
"type": "array",
"items": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/security-scheme.schema.json"
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/security-scheme-report.schema.json"
}
}
}
Expand Down
109 changes: 66 additions & 43 deletions schemas/vulnapi/draft/2024-10/report.schema.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,73 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.cerberauth.com/vulnapi/report/draft/2024-10/report.schema.json",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/report.schema.json",
"title": "Report",
"description": "",
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name",
"startTime",
"operation",
"scans",
"vulnerabilities"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"startTime": {
"type": "string",
"format": "date-time"
},
"endTime": {
"type": "string",
"format": "date-time"
},
"operation": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/operation.schema.json"
},
"data": {
"type": "object"
},
"scans": {
"type": "array",
"items": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/scan.schema.json"
}
},
"vulnerabilities": {
"type": "array",
"items": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/vulnerability.schema.json"
"type": "object",
"required": ["options", "reports"],
"properties": {
"options": {
"type": "object"
},
"curl": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/curl-report.schema.json"
},
"openapi": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/openapi-report.schema.json"
},
"graphql": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/graphql-report.schema.json"
},
"reports": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name",
"startTime",
"scans",
"issues"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"startTime": {
"type": "string",
"format": "date-time"
},
"endTime": {
"type": "string",
"format": "date-time"
},
"operation": {
"type": "object",
"required": ["id"],
"properties": {
"id": {
"type": "string"
}
}
},
"data": {
"type": "object"
},
"scans": {
"type": "array",
"items": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/scan-report.schema.json"
}
},
"issues": {
"type": "array",
"items": {
"$ref": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/issue-report.schema.json"
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/scan.schema.json",
"title": "Report Scan",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/scan-report.schema.json",
"title": "Scan Report",
"description": "",
"type": "object",
"required": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/security-scheme.schema.json",
"title": "Reporty Operation Security Scheme",
"$id": "https://schemas.cerberauth.com/vulnapi/draft/2024-10/security-scheme-report.schema.json",
"title": "Operation Security Scheme Report",
"description": "",
"type": "object",
"required": [
Expand Down

0 comments on commit 076902b

Please sign in to comment.