Skip to content

Commit

Permalink
#179, #311: Add sample SARIF file to illustrate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry Golding committed Feb 13, 2019
1 parent 2e8bf05 commit 85ee39f
Show file tree
Hide file tree
Showing 2 changed files with 201 additions and 0 deletions.
198 changes: 198 additions & 0 deletions Documents/ScratchSamples/179-311.sarif
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
{
"$schema": "http://json.schemastore.org/sarif-2.0.0",
"version": "2.0.0",
"runs": [
{
"tool": {
"driver": {
"name": "CodeScanner",
"version": "2.17.0",
"fileIndex": 0,
"globalMessageStrings": {
"emptyFile": "The file {0} is empty."
},
"ruleDescriptors": [
{
"id": "CS4011",
"shortDescription": {
"text": "Mark fields readonly if possible."
},
"messageStrings": {
"default": "The field {0} can be marked readonly."
},
"defaultConfiguration": {
"enabled": "true",
"level": "note",
"rank": 95.0
}
}
],
"notificationDescriptors": [
{
"id": "MSG0001",
"shortDescription": {
"text": "Emitted at the start of a scan."
},
"messageStrings": {
"default": "CodeScanner run started."
},
"defaultConfiguration": {
"enabled": "true",
"level": "note"
}
},
{
"id": "ERR0001",
"fullDescription": {
"text": "Indicates that a rule threw an unhandled exception. Other rules will continue to run."
},
"messageStrings": {
"text": "The rule {0} threw an exception and has been disabled."
},
"defaultConfiguration": {
"enabled": "true",
"level": "error"
}
}
]
},
"extensions": [
{
"name": "CodeScanner Security Rules",
"version": "3.1",
"fileIndex": 1,
"ruleDetails": [
{
"id": "SEC0001",
"shortDescription": {
"text": "Don't use weak crypto."
},
"messageStrings": {
"default": "Crypto algorithm {0} is known to be weak."
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"rank": 65.0
}
}
]
}
],
"language": "en-US"
},

"invocations": [
{
"startTimeUtc": "2019-02-12T09:35.020Z",
"endTimeUtc": "2019-02-12T09:35.020Z",
"reportingConfigurationOverrides": [
{
"ruleIndex": 0,
"configuration": {
"enabled": false
}
},
{
"ruleIndex": 0,
"extensionIndex": 0,
"configuration": {
"enabled": true,
"level": "error"
}
}
],
"toolNotifications": [
{
"id": "CS0001",
"notificationIndex": 0,
"message": {
"messageId": "default"
},
"level": "note",
"timeUtc": "2019-02-13T15:00.09.736"
},
{
"id": "ERR0001",
"notificationIndex": 1,
"associatedRuleId": "SEC0001",
"associatedRuleIndex": 0,
"associatedRuleExtensionIndex": 0,
"message": {
"messageId": "default",
"arguments": [
"SEC0001"
]
},
"level": "error",
"timeUtc": "2019-02-13T15:00.28.055"
}
]
}
],

"files": [
{
"fileLocation": {
"uri": "CodeScanner.exe",
"uriBaseId": "TOOLS_DIR"
},
"roles": [ "toolComponent" ],
"hashes": {
"value": "777BC3EBAE01867A7BC30658C25F85CC",
"algorithm": "md5"
}
},
{
"fileLocation": {
"uri": "CodeScanner.Security.dll",
"uriBaseId": "PLUGINS_DIR"
},
"roles": [ "toolComponent" ],
"hashes": {
"value": "88FDF924FDB2E109F5F5A9644EDD1BF2",
"algorithm": "md5"
}
},
{
"fileLocation": {
"uri": "crypto/hash.cs",
"uriBaseId": "SRCROOT"
},
"roles": [ "analysisTarget" ],
"hashes": {
"value": "88FDF924FDB2E109F5F5A9644EDD1BF2",
"algorithm": "md5"
}
}
],

"results": [
{
"ruleId": "SEC0001",
"ruleIndex": 0,
"extensionIndex": 0,
"kind": "fail",
"level": "error",
"message": {
"messageId": "default",
"arguments": [ "sha-1" ]
},
"locations": [
{
"physicalLocation": {
"fileLocation": {
"fileIndex": 2
},
"region": {
"startLine": 12,
"startColumn": 15
}
}
}
]
}
]
}
]
}
3 changes: 3 additions & 0 deletions Documents/ScratchSamples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This directory contains sample files that illustrate proposed SARIF features.
The files are generally named for the issue or issues they address, for example,
179-311.sarif illustrates a design proposal to address issues 179 and 311.

0 comments on commit 85ee39f

Please sign in to comment.