Type object
Schema URL https://catalog.lintel.tools/schemas/schemastore/sarif-1-0-0-json/latest.json
Source https://www.schemastore.org/sarif-1.0.0.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Static Analysis Results Format (SARIF) Version 1.0.0 JSON Schema: a standard format for the output of static analysis and other tools.

Properties

version enum required

The SARIF format version of this log file.

Values: "1.0.0"
runs run[] required

The set of runs contained in this log file.

minItems=1
$schema string

The URI of the JSON schema corresponding to the version.

format=uri

Definitions

annotatedCodeLocation object

An annotation used to express code flows through a method or other locations that are related to a result.

id integer | string

OBSOLETE (use "step" instead): An identifier for the location, unique within the scope of the code flow within which it occurs.

pattern=^[1-9][0-9]*$min=1
step integer

The 0-based sequence number of the location in the code flow within which it occurs.

min=0
physicalLocation object

A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.

3 nested properties
uri string

The location of the file as a valid URI.

format=uri
uriBaseId string

A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.

region object

A region within a file where a result was detected.

6 nested properties
startLine integer

The line number of the first character in the region.

min=1
startColumn integer

The column number of the first character in the region.

min=1
endLine integer

The line number of the last character in the region.

min=1
endColumn integer

The column number of the last character in the region.

min=1
offset integer

The zero-based offset from the beginning of the file of the first byte or character in the region.

min=0
length integer

The length of the region in bytes or characters.

min=0
fullyQualifiedLogicalName string

The fully qualified name of the method or function that is executing.

logicalLocationKey string

A key used to retrieve the annotation's logicalLocation from the logicalLocations dictionary.

module string

The name of the module that contains the code that is executing.

threadId integer

The thread identifier of the code that is executing.

message string

A message relevant to this annotation.

kind enum

Categorizes the location.

Values: "alias" "assignment" "branch" "call" "callReturn" "continuation" "declaration" "functionEnter" "functionExit" "functionReturn" "usage"
taintKind enum

Classifies state transitions in code locations relevant to a taint analysis.

Values: "source" "sink" "sanitizer"
target string

The fully qualified name of the target on which this location operates. For an annotation of kind 'call', for example, the target refers to the fully qualified logical name of the function called from this location.

values string[]

An ordered set of strings that comprise input or return values for the current operation. For an annotation of kind 'call', for example, this property may hold the ordered list of arguments passed to the callee.

Default:
[]
state object

A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.

targetKey string

A key used to retrieve the target's logicalLocation from the logicalLocations dictionary.

essential boolean

OBSOLETE (use "importance" instead): True if this location is essential to understanding the code flow in which it occurs.

importance enum

Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important".

Values: "important" "essential" "unimportant"
snippet string

The source code at the specified location.

annotations annotation[]

A set of messages relevant to the current annotated code location.

minItems=1uniqueItems=true
properties object

Key/value pairs that provide additional information about the code location.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
annotation object
message string required

A message relevant to a code location

locations physicalLocation[] required

An array of 'physicalLocation' objects associated with the annotation.

minItems=1
codeFlow object
locations annotatedCodeLocation[] required

An array of 'annotatedCodeLocation' objects, each of which describes a single location visited by the tool in the course of producing the result.

minItems=1
message string

A message relevant to the code flow

properties object

Key/value pairs that provide additional information about the code flow.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
exception object
kind string

A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal.

message string

A string that describes the exception.

stack object

A call stack that is relevant to a result.

3 nested properties
frames stackFrame[] required

An array of stack frames that represent a sequence of calls, rendered in reverse chronological order, that comprise the call stack.

minItems=1
message string

A message relevant to this call stack.

properties object

Key/value pairs that provide additional information about the stack.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
innerExceptions exception[]

An array of exception objects each of which is considered a cause of this exception.

fileChange object

A change to a single file.

uri string required

A string that represents the location of the file to change as a valid URI.

format=uri
replacements replacement[] required

An array of replacement objects, each of which represents the replacement of a single range of bytes in a single file specified by 'uri'.

minItems=1
uriBaseId string

A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.

file object

A single file. In some cases, this file might be nested within another file.

uri string

The path to the file within its containing file.

format=uri
uriBaseId string

A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.

parentKey string

Identifies the key of the immediate parent of the file, if this file is nested.

offset integer

The offset in bytes of the file within its containing file.

length integer

The length of the file in bytes.

mimeType string

The MIME type (RFC 2045) of the file.

pattern=[^/]+/.+
contents string

The contents of the file, expressed as a MIME Base64-encoded byte sequence.

hashes hash[]

An array of hash objects, each of which specifies a hashed value for the file, along with the name of the algorithm used to compute the hash.

minItems=1uniqueItems=true
properties object

Key/value pairs that provide additional information about the file.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
fix object

A proposed fix for the problem represented by a result object. A fix specifies a set of file to modify. For each file, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.

description string required

A string that describes the proposed fix, enabling viewers to present a proposed change to an end user.

fileChanges fileChange[] required

One or more file changes that comprise a fix for a result.

formattedRuleMessage object

Contains information that can be used to construct a formatted message that describes a result.

formatId string required

A string that identifies the message format used to format the message that describes this result. The value of formatId must correspond to one of the names in the set of name/value pairs contained in the 'messageFormats' property of the rule object whose 'id' property matches the 'ruleId' property of this result.

arguments string[]

An array of strings that will be used, in combination with a message format, to construct a result message.

hash object

A hash value of some file or collection of files, together with the algorithm used to compute the hash.

value string required

The hash value of some file or collection of files, computed by the algorithm named in the 'algorithm' property.

algorithm enum required

The name of the algorithm used to compute the hash value specified in the 'value' property.

Values: "authentihash" "blake256" "blake512" "ecoh" "fsb" "gost" "groestl" "has160" "haval" "jh" "md2" "md4" "md5" "md6" "radioGatun" "ripeMD" "ripeMD128" "ripeMD160" "ripeMD320" "sdhash" "sha1" "sha224" "sha256" "sha384" "sha512" "sha3" "skein" "snefru" "spectralHash" "ssdeep" "swifft" "tiger" "tlsh" "whirlpool"
invocation object

The runtime environment of the analysis tool run.

commandLine string

The command line used to invoke the tool.

responseFiles object

The contents of any response files specified on the tool's command line.

startTime string

The date and time at which the run started. See "Date/time properties" in the SARIF spec for the required format.

format=date-time
endTime string

The date and time at which the run ended. See "Date/time properties" in the SARIF spec for the required format.

format=date-time
machine string

The machine that hosted the analysis tool run.

account string

The account that ran the analysis tool.

processId integer

The process id for the analysis tool run.

fileName string

The fully qualified path to the analysis tool.

workingDirectory string

The working directory for the analysis rool run.

environmentVariables object

The environment variables associated with the analysis tool process, expressed as key/value pairs.

Default:
{}
properties object

Key/value pairs that provide additional information about the run.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
location object

The location where an analysis tool produced a result.

analysisTarget object

A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.

3 nested properties
uri string

The location of the file as a valid URI.

format=uri
uriBaseId string

A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.

region object

A region within a file where a result was detected.

6 nested properties
startLine integer

The line number of the first character in the region.

min=1
startColumn integer

The column number of the first character in the region.

min=1
endLine integer

The line number of the last character in the region.

min=1
endColumn integer

The column number of the last character in the region.

min=1
offset integer

The zero-based offset from the beginning of the file of the first byte or character in the region.

min=0
length integer

The length of the region in bytes or characters.

min=0
resultFile object

A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.

3 nested properties
uri string

The location of the file as a valid URI.

format=uri
uriBaseId string

A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.

region object

A region within a file where a result was detected.

6 nested properties
startLine integer

The line number of the first character in the region.

min=1
startColumn integer

The column number of the first character in the region.

min=1
endLine integer

The line number of the last character in the region.

min=1
endColumn integer

The column number of the last character in the region.

min=1
offset integer

The zero-based offset from the beginning of the file of the first byte or character in the region.

min=0
length integer

The length of the region in bytes or characters.

min=0
fullyQualifiedLogicalName string

The human-readable fully qualified name of the logical location where the analysis tool produced the result. If 'logicalLocationKey' is not specified, this member is can used to retrieve the location logicalLocation from the logicalLocations dictionary, if one exists.

logicalLocationKey string

A key used to retrieve the location logicalLocation from the logicalLocations dictionary, when the string specified by 'fullyQualifiedLogicalName' is not unique.

decoratedName string

The machine-readable fully qualified name for the logical location where the analysis tool produced the result, such as the mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.

properties object

Key/value pairs that provide additional information about the location.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
logicalLocation object

A logical location of a construct that produced a result.

name string

Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.

parentKey string

Identifies the key of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.

kind string

The type of construct this logicalLocationComponent refers to. Should be one of 'function', 'member', 'module', 'namespace', 'package', 'resource', or 'type', if any of those accurately describe the construct.

notification object

Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.

message string required

A string that describes the condition that was encountered.

id string

An identifier for the condition that was encountered.

ruleId string

The stable, unique identifier of the rule (if any) to which this notification is relevant. If 'ruleKey' is not specified, this member can be used to retrieve rule metadata from the rules dictionary, if it exists.

ruleKey string

A key used to retrieve the rule metadata from the rules dictionary that is relevant to the notification.

physicalLocation object

A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.

3 nested properties
uri string

The location of the file as a valid URI.

format=uri
uriBaseId string

A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.

region object

A region within a file where a result was detected.

6 nested properties
startLine integer

The line number of the first character in the region.

min=1
startColumn integer

The column number of the first character in the region.

min=1
endLine integer

The line number of the last character in the region.

min=1
endColumn integer

The column number of the last character in the region.

min=1
offset integer

The zero-based offset from the beginning of the file of the first byte or character in the region.

min=0
length integer

The length of the region in bytes or characters.

min=0
level enum

A value specifying the severity level of the notification.

Default: "warning"
Values: "note" "warning" "error"
threadId integer

The thread identifier of the code that generated the notification.

time string

The date and time at which the analysis tool generated the notification.

format=date-time
exception object
4 nested properties
kind string

A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal.

message string

A string that describes the exception.

stack object

A call stack that is relevant to a result.

3 nested properties
frames stackFrame[] required

An array of stack frames that represent a sequence of calls, rendered in reverse chronological order, that comprise the call stack.

minItems=1
message string

A message relevant to this call stack.

properties object

Key/value pairs that provide additional information about the stack.

innerExceptions exception[]

An array of exception objects each of which is considered a cause of this exception.

properties object

Key/value pairs that provide additional information about the notification.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
physicalLocation object

A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.

uri string

The location of the file as a valid URI.

format=uri
uriBaseId string

A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.

region object

A region within a file where a result was detected.

6 nested properties
startLine integer

The line number of the first character in the region.

min=1
startColumn integer

The column number of the first character in the region.

min=1
endLine integer

The line number of the last character in the region.

min=1
endColumn integer

The column number of the last character in the region.

min=1
offset integer

The zero-based offset from the beginning of the file of the first byte or character in the region.

min=0
length integer

The length of the region in bytes or characters.

min=0
region object

A region within a file where a result was detected.

startLine integer

The line number of the first character in the region.

min=1
startColumn integer

The column number of the first character in the region.

min=1
endLine integer

The line number of the last character in the region.

min=1
endColumn integer

The column number of the last character in the region.

min=1
offset integer

The zero-based offset from the beginning of the file of the first byte or character in the region.

min=0
length integer

The length of the region in bytes or characters.

min=0
replacement object

The replacement of a single range of bytes in a file. Specifies the location within the file where the replacement is to be made, the number of bytes to remove at that location, and a sequence of bytes to insert at that location.

offset integer required

A non-negative integer specifying the offset in bytes from the beginning of the file at which bytes are to be removed, inserted or both. An offset of 0 shall denote the first byte in the file.

min=0
deletedLength integer

The number of bytes to delete, starting at the byte offset specified by offset, measured from the beginning of the file.

min=1
insertedBytes string

The MIME Base64-encoded byte sequence to be inserted at the byte offset specified by the 'offset' property, measured from the beginning of the file.

result object

A result produced by an analysis tool.

ruleId string

The stable, unique identifier of the rule (if any) to which this notification is relevant. If 'ruleKey' is not specified, this member can be used to retrieve rule metadata from the rules dictionary, if it exists.

ruleKey string

A key used to retrieve the rule metadata from the rules dictionary that is relevant to the notification.

level enum

A value specifying the severity level of the result. If this property is not present, its implied value is 'warning'.

Default: "warning"
Values: "notApplicable" "pass" "note" "warning" "error"
message string

A string that describes the result. The first sentence of the message only will be displayed when visible space is limited.

formattedRuleMessage object

Contains information that can be used to construct a formatted message that describes a result.

2 nested properties
formatId string required

A string that identifies the message format used to format the message that describes this result. The value of formatId must correspond to one of the names in the set of name/value pairs contained in the 'messageFormats' property of the rule object whose 'id' property matches the 'ruleId' property of this result.

arguments string[]

An array of strings that will be used, in combination with a message format, to construct a result message.

locations location[]

One or more locations where the result occurred. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.

minItems=1uniqueItems=true
snippet string

A source code or other file fragment that illustrates the result.

id string

A unique identifier for the result.

toolFingerprintContribution string

A string that contributes to the unique identity of the result.

stacks stack[]

An array of 'stack' objects relevant to the result.

minItems=1uniqueItems=true
codeFlows codeFlow[]

An array of 'codeFlow' objects relevant to the result.

minItems=1uniqueItems=true
relatedLocations annotatedCodeLocation[]

A grouped set of locations and messages, if available, that represent code areas that are related to this result.

minItems=1uniqueItems=true
suppressionStates enum[]
baselineState enum

The state of a result relative to a baseline of a previous run.

Values: "new" "existing" "absent"
fixes fix[]

An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.

minItems=1uniqueItems=true
properties object

Key/value pairs that provide additional information about the result.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
rule object

Describes an analysis rule.

id string required

A stable, opaque identifier for the rule.

name string

A rule identifier that is understandable to an end user.

shortDescription string

A concise description of the rule. Should be a single sentence that is understandable when visible space is limited to a single line of text.

fullDescription string

A string that describes the rule. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.

messageFormats object

A set of name/value pairs with arbitrary names. The value within each name/value pair shall consist of plain text interspersed with placeholders, which can be used to format a message in combination with an arbitrary number of additional string arguments.

defaultLevel enum

A value specifying the default severity level of the result.

Default: "warning"
Values: "note" "warning" "error"
helpUri string

A URI where the primary documentation for the rule can be found.

format=uri
properties object

Key/value pairs that provide additional information about the rule.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
run object

Describes a single run of an analysis tool, and contains the output of that run.

tool object required

The analysis tool that was run.

8 nested properties
name string required

The name of the tool.

fullName string

The name of the tool along with its version and any other useful identifying information, such as its locale.

version string

The tool version, in whatever format the tool natively provides.

semanticVersion string

The tool version in the format specified by Semantic Versioning 2.0.

fileVersion string

The binary version of the tool's primary executable file (for operating systems such as Windows that provide that information).

pattern=[0-9]+(\.[0-9]+){3}
sarifLoggerVersion string

A version that uniquely identifies the SARIF logging component that generated this file, if it is versioned separately from the tool.

language string

The tool language (expressed as an ISO 649 two-letter lowercase culture code) and region (expressed as an ISO 3166 two-letter uppercase subculture code associated with a country or region).

properties object

Key/value pairs that provide additional information about the tool.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
invocation object

The runtime environment of the analysis tool run.

11 nested properties
commandLine string

The command line used to invoke the tool.

responseFiles object

The contents of any response files specified on the tool's command line.

startTime string

The date and time at which the run started. See "Date/time properties" in the SARIF spec for the required format.

format=date-time
endTime string

The date and time at which the run ended. See "Date/time properties" in the SARIF spec for the required format.

format=date-time
machine string

The machine that hosted the analysis tool run.

account string

The account that ran the analysis tool.

processId integer

The process id for the analysis tool run.

fileName string

The fully qualified path to the analysis tool.

workingDirectory string

The working directory for the analysis rool run.

environmentVariables object

The environment variables associated with the analysis tool process, expressed as key/value pairs.

Default:
{}
properties object

Key/value pairs that provide additional information about the run.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
files Record<string, object>

A dictionary, each of whose keys is a URI and each of whose values is an array of file objects representing the location of a single file scanned during the run.

logicalLocations Record<string, object>

A dictionary, each of whose keys specifies a logical location such as a namespace, type or function.

results result[]

The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) in the event that a log file represents an actual scan.

minItems=0uniqueItems=true
toolNotifications notification[]

A list of runtime conditions detected by the tool in the course of the analysis.

configurationNotifications notification[]

A list of conditions detected by the tool that are relevant to the tool's configuration.

rules Record<string, object>

A dictionary, each of whose keys is a string and each of whose values is a 'rule' object, that describe all rules associated with an analysis tool or a specific run of an analysis tool.

id string

An identifier for the run.

stableId string

A stable identifier for a run, for example, 'nightly Clang analyzer run'. Multiple runs of the same type can have the same stableId.

automationId string

A global identifier that allows the run to be correlated with other artifacts produced by a larger automation process.

baselineId string

The 'id' property of a separate (potentially external) SARIF 'run' instance that comprises the baseline that was used to compute result 'baselineState' properties for the run.

architecture string

The hardware architecture for which the run was targeted.

stack object

A call stack that is relevant to a result.

frames stackFrame[] required

An array of stack frames that represent a sequence of calls, rendered in reverse chronological order, that comprise the call stack.

minItems=1
message string

A message relevant to this call stack.

properties object

Key/value pairs that provide additional information about the stack.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
stackFrame object

A function call within a stack trace.

fullyQualifiedLogicalName string required

The fully qualified name of the method or function that is executing.

message string

A message relevant to this stack frame.

uri string

The uri of the source code file to which this stack frame refers.

format=uri
uriBaseId string

A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.

line integer

The line of the location to which this stack frame refers.

column integer

The line of the location to which this stack frame refers.

module string

The name of the module that contains the code of this stack frame.

threadId integer

The thread identifier of the stack frame.

logicalLocationKey string

A key used to retrieve the stack frame logicalLocation from the logicalLocations dictionary, when the 'fullyQualifiedLogicalName' is not unique.

address integer

The address of the method or function that is executing.

offset integer

The offset from the method or function that is executing.

parameters string[]

The parameters of the call that is executing.

properties object

Key/value pairs that provide additional information about the stack frame.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true
tool object

The analysis tool that was run.

name string required

The name of the tool.

fullName string

The name of the tool along with its version and any other useful identifying information, such as its locale.

version string

The tool version, in whatever format the tool natively provides.

semanticVersion string

The tool version in the format specified by Semantic Versioning 2.0.

fileVersion string

The binary version of the tool's primary executable file (for operating systems such as Windows that provide that information).

pattern=[0-9]+(\.[0-9]+){3}
sarifLoggerVersion string

A version that uniquely identifies the SARIF logging component that generated this file, if it is versioned separately from the tool.

language string

The tool language (expressed as an ISO 649 two-letter lowercase culture code) and region (expressed as an ISO 3166 two-letter uppercase subculture code associated with a country or region).

properties object

Key/value pairs that provide additional information about the tool.

1 nested properties
tags string[]

A set of distinct strings that provide additional information.

Default:
[]
uniqueItems=true