Skip to content

Commit

Permalink
Changed structure of OpenService draft
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikP committed Jul 29, 2020
1 parent 57002ca commit 5b73cc0
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 11 deletions.
5 changes: 4 additions & 1 deletion samples/negative/development/invalid_openservice.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"ReportClass": "Vulnerability",
"FirstSeen": "2020-03-15T15:17:10Z",
"Date": "2020-07-24T14:17:10Z",
"Service": 6,
"Service": {
"Name": 6,
"Version": 2
},
"SourceIp": "192.0.2.55",
"SourcePort": 54321,
"Protocol": "thisisnoprotocol",
Expand Down
34 changes: 34 additions & 0 deletions samples/negative/development/invalid_openservice2json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"Version": "development",
"ReporterInfo": {
"ReporterOrg": "ExampleOrg",
"ReporterOrgDomain": "example.com",
"ReporterOrgEmail": "[email protected]",
"ReporterContactEmail": "[email protected]",
"ReporterContactName": "Mr. Example",
"ReporterContactPhone": "+ 01 000 1234567"
},
"Disclosure": true,
"Report": {
"ReportType": "OpenService",
"ReportClass": "Vulnerability",
"FirstSeen": "2020-03-15T15:17:10Z",
"Date": "2020-07-24T14:17:10Z",
"SourceIp": "192.0.2.55",
"SourcePort": 54321,
"Service": "bla",
"Protocol": "thisisnoprotocol",
"Samples": [
{
"ContentType": "text/plain",
"Base64Encoded": false,
"Description": "Log line",
"Payload": "EXAMPLE Nmap done: 1 IP address (1 host up) scanned in 5.58 seconds EXAMPLE"
}
],
"Custom": {
"whatever": "examplevalue",
"whatever2": "examplevalue2"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"Version": "development",
"ReporterInfo": {
"ReporterOrg": "ExampleOrg",
"ReporterOrgDomain": "example.com",
"ReporterOrgEmail": "[email protected]",
"ReporterContactEmail": "[email protected]",
"ReporterContactName": "Mr. Example",
"ReporterContactPhone": "+ 01 000 1234567"
},
"Disclosure": true,
"Report": {
"ReportType": "OpenService",
"ReportClass": "Vulnerability",
"FirstSeen": "2020-03-15T15:17:10Z",
"Date": "2020-07-24T14:17:10Z",
"SourceIp": "192.0.2.55",
"SourcePort": 54321,
"Protocol": "thisisnoprotocol",
"Samples": [
{
"ContentType": "text/plain",
"Base64Encoded": false,
"Description": "Log line",
"Payload": "EXAMPLE Nmap done: 1 IP address (1 host up) scanned in 5.58 seconds EXAMPLE"
}
],
"Custom": {
"whatever": "examplevalue",
"whatever2": "examplevalue2"
}
}
}
7 changes: 5 additions & 2 deletions samples/positive/development/openservice_sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"ReportClass": "Vulnerability",
"FirstSeen": "2020-03-15T15:17:10Z",
"Date": "2020-07-24T14:17:10Z",
"Service": "redis",
"Service": {
"Name": "redis",
"Version": "1.2.4"
},
"SourceIp": "192.0.2.55",
"SourcePort": 54321,
"Protocol": "tcp",
"Samples": [
{
"ContentType": "text/plain",
Expand All @@ -27,6 +29,7 @@
}
],
"Custom": {
"Protocol": "tcp",
"whatever": "examplevalue",
"whatever2": "examplevalue2"
}
Expand Down
11 changes: 3 additions & 8 deletions schemas/development/openservice.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@
"enum": ["OpenService"]
},
"Service": {
"type": "string",
"description": "name of the service (e.g. redis)"
},
"Protocol": {
"type": "string",
"enum": ["tcp", "udp"],
"description": "transport protocol"
"$ref": "xarf_shared.schema.json#/Service"
}
}
},
"required": ["Service"]
},
{
"$ref": "xarf_shared.schema.json#/CommonProps"
Expand Down
12 changes: 12 additions & 0 deletions schemas/development/xarf_shared.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,5 +423,17 @@
}
}
]
},
"Service": {
"type": "object",
"description": "Describes a service running on the network",
"properties": {
"Name": {
"type": "string"
},
"Version": {
"type": "string"
}
}
}
}

0 comments on commit 5b73cc0

Please sign in to comment.