JSON Rules Output Schema Reference

This example shows how to create a JSON-formatted output file when using the --output-file flag of the code-analyzer rules command.

1sf code-analyzer rules --rule-selector flow --output-file rules.json

Sample JSON Rules Output 

This sample output shows the two rules associated with the flow engine.

1{
2  "rules": [
3    {
4      "name": "PreventPassingUserDataIntoElementWithoutSharing",
5      "description": "Avoid passing user data into Flow Scanner elements in run mode: Without Sharing",
6      "engine": "flow",
7      "severity": 2,
8      "tags": [
9        "Recommended",
10        "Security",
11        "XML"
12      ],
13      "resources": []
14    },
15    {
16      "name": "PreventPassingUserDataIntoElementWithSharing",
17      "description": "Avoid passing user data into Flow Scanner elements in run mode: With Sharing",
18      "engine": "flow",
19      "severity": 4,
20      "tags": [
21        "Recommended",
22        "Security",
23        "XML"
24      ],
25      "resources": []
26    }
27  ]
28}

Properties of the Top-Level "rules" Object 

Property NameData TypeDescription
namestringThe name of the rule.
descriptionstringThe description of the rule.
enginestringThe engine that’s associated with the rule.
severitystringThe default severity level of the rule: 1 (Critical), 2 (High), 3 (Moderate), 4 (Low), 5 (Info)
tagsstring[]An array of tags that are associated with the rule, such as Recommended, Security, or BestPractices.
resourcesstring[]An array of URLs for additional resources and information about the rule.