json-schema-diff 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +33 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/CONTRIBUTING.md +215 -0
- data/README.md +485 -0
- data/Rakefile +8 -0
- data/SECURITY.md +143 -0
- data/examples/capslock/README.md +27 -0
- data/examples/capslock/capslock-v0.5.0.json +78 -0
- data/examples/capslock/capslock-v0.6.0.json +113 -0
- data/examples/capslock/capslock.schema.json +169 -0
- data/examples/generic/report-v1.2.0.json +63 -0
- data/examples/generic/report-v1.3.0.json +77 -0
- data/examples/generic/security-report.schema.json +149 -0
- data/examples/zizmor/README.md +26 -0
- data/examples/zizmor/zizmor-v0.1.0.json +108 -0
- data/examples/zizmor/zizmor-v0.2.0.json +160 -0
- data/examples/zizmor/zizmor.schema.json +300 -0
- data/exe/json-schema-diff +6 -0
- data/lib/json/schema/diff/cli.rb +101 -0
- data/lib/json/schema/diff/comparer.rb +83 -0
- data/lib/json/schema/diff/formatter.rb +149 -0
- data/lib/json/schema/diff/schema_parser.rb +71 -0
- data/lib/json/schema/diff/version.rb +9 -0
- data/lib/json/schema/diff.rb +17 -0
- data/sig/json/schema/diff.rbs +8 -0
- metadata +70 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"capability_info": [
|
|
3
|
+
{
|
|
4
|
+
"package_name": "github.com/example/myapp",
|
|
5
|
+
"capability": "CAPABILITY_FILES",
|
|
6
|
+
"dep_path": "direct",
|
|
7
|
+
"path": [
|
|
8
|
+
{
|
|
9
|
+
"name": "ReadConfig",
|
|
10
|
+
"site": {
|
|
11
|
+
"filename": "config.go",
|
|
12
|
+
"line": 42,
|
|
13
|
+
"column": 8
|
|
14
|
+
},
|
|
15
|
+
"package": "github.com/example/myapp/config"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "os.ReadFile",
|
|
19
|
+
"site": {
|
|
20
|
+
"filename": "config.go",
|
|
21
|
+
"line": 45,
|
|
22
|
+
"column": 12
|
|
23
|
+
},
|
|
24
|
+
"package": "os"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"package_dir": "/home/user/myapp",
|
|
28
|
+
"capability_type": "CAPABILITY_TYPE_DIRECT"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"package_name": "github.com/example/myapp/server",
|
|
32
|
+
"capability": "CAPABILITY_NETWORK",
|
|
33
|
+
"dep_path": "direct",
|
|
34
|
+
"path": [
|
|
35
|
+
{
|
|
36
|
+
"name": "StartServer",
|
|
37
|
+
"site": {
|
|
38
|
+
"filename": "server.go",
|
|
39
|
+
"line": 25,
|
|
40
|
+
"column": 5
|
|
41
|
+
},
|
|
42
|
+
"package": "github.com/example/myapp/server"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "http.ListenAndServe",
|
|
46
|
+
"site": {
|
|
47
|
+
"filename": "server.go",
|
|
48
|
+
"line": 30,
|
|
49
|
+
"column": 8
|
|
50
|
+
},
|
|
51
|
+
"package": "net/http"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"package_dir": "/home/user/myapp/server",
|
|
55
|
+
"capability_type": "CAPABILITY_TYPE_DIRECT"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"module_info": [
|
|
59
|
+
{
|
|
60
|
+
"path": "github.com/example/myapp",
|
|
61
|
+
"version": "v1.0.0"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"path": "github.com/gorilla/mux",
|
|
65
|
+
"version": "v1.8.0"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"package_info": [
|
|
69
|
+
{
|
|
70
|
+
"path": "github.com/example/myapp",
|
|
71
|
+
"ignored_files": []
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"path": "github.com/example/myapp/server",
|
|
75
|
+
"ignored_files": ["server_test.go"]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"capability_info": [
|
|
3
|
+
{
|
|
4
|
+
"package_name": "github.com/example/myapp",
|
|
5
|
+
"capability": "CAPABILITY_FILES",
|
|
6
|
+
"dep_path": "direct",
|
|
7
|
+
"path": [
|
|
8
|
+
{
|
|
9
|
+
"name": "ReadConfig",
|
|
10
|
+
"site": {
|
|
11
|
+
"filename": "config.go",
|
|
12
|
+
"line": 42,
|
|
13
|
+
"column": 8
|
|
14
|
+
},
|
|
15
|
+
"package": "github.com/example/myapp/config"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "os.ReadFile",
|
|
19
|
+
"site": {
|
|
20
|
+
"filename": "config.go",
|
|
21
|
+
"line": 45,
|
|
22
|
+
"column": 12
|
|
23
|
+
},
|
|
24
|
+
"package": "os"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"package_dir": "/home/user/myapp",
|
|
28
|
+
"capability_type": "CAPABILITY_TYPE_DIRECT"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"package_name": "github.com/example/myapp/server",
|
|
32
|
+
"capability": "CAPABILITY_NETWORK",
|
|
33
|
+
"dep_path": "direct",
|
|
34
|
+
"path": [
|
|
35
|
+
{
|
|
36
|
+
"name": "StartServer",
|
|
37
|
+
"site": {
|
|
38
|
+
"filename": "server.go",
|
|
39
|
+
"line": 25,
|
|
40
|
+
"column": 5
|
|
41
|
+
},
|
|
42
|
+
"package": "github.com/example/myapp/server"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "http.ListenAndServe",
|
|
46
|
+
"site": {
|
|
47
|
+
"filename": "server.go",
|
|
48
|
+
"line": 30,
|
|
49
|
+
"column": 8
|
|
50
|
+
},
|
|
51
|
+
"package": "net/http"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"package_dir": "/home/user/myapp/server",
|
|
55
|
+
"capability_type": "CAPABILITY_TYPE_DIRECT"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"package_name": "github.com/example/myapp/crypto",
|
|
59
|
+
"capability": "CAPABILITY_ARBITRARY_EXECUTION",
|
|
60
|
+
"dep_path": "github.com/suspicious/lib@v1.2.3",
|
|
61
|
+
"path": [
|
|
62
|
+
{
|
|
63
|
+
"name": "ProcessData",
|
|
64
|
+
"site": {
|
|
65
|
+
"filename": "crypto.go",
|
|
66
|
+
"line": 15,
|
|
67
|
+
"column": 10
|
|
68
|
+
},
|
|
69
|
+
"package": "github.com/example/myapp/crypto"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "ExecuteCode",
|
|
73
|
+
"site": {
|
|
74
|
+
"filename": "executor.go",
|
|
75
|
+
"line": 88,
|
|
76
|
+
"column": 2
|
|
77
|
+
},
|
|
78
|
+
"package": "github.com/suspicious/lib/executor"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"package_dir": "/home/user/myapp/crypto",
|
|
82
|
+
"capability_type": "CAPABILITY_TYPE_TRANSITIVE"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"module_info": [
|
|
86
|
+
{
|
|
87
|
+
"path": "github.com/example/myapp",
|
|
88
|
+
"version": "v1.1.0"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"path": "github.com/gorilla/mux",
|
|
92
|
+
"version": "v1.8.1"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"path": "github.com/suspicious/lib",
|
|
96
|
+
"version": "v1.2.3"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"package_info": [
|
|
100
|
+
{
|
|
101
|
+
"path": "github.com/example/myapp",
|
|
102
|
+
"ignored_files": []
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"path": "github.com/example/myapp/server",
|
|
106
|
+
"ignored_files": ["server_test.go"]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"path": "github.com/example/myapp/crypto",
|
|
110
|
+
"ignored_files": []
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://github.com/google/capslock/schema/output.json",
|
|
4
|
+
"title": "Capslock CLI JSON Output Schema",
|
|
5
|
+
"description": "JSON schema for the output of the capslock CLI tool when using -output=json",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"capability_info": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"description": "List of capability information for analyzed packages",
|
|
11
|
+
"items": {
|
|
12
|
+
"$ref": "#/definitions/CapabilityInfo"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"module_info": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"description": "Information about Go modules analyzed",
|
|
18
|
+
"items": {
|
|
19
|
+
"$ref": "#/definitions/ModuleInfo"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"package_info": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"description": "Information about Go packages analyzed",
|
|
25
|
+
"items": {
|
|
26
|
+
"$ref": "#/definitions/PackageInfo"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": [],
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"definitions": {
|
|
33
|
+
"CapabilityInfo": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"description": "Information about a specific capability found in the code",
|
|
36
|
+
"properties": {
|
|
37
|
+
"package_name": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "The name of the package where the capability is found"
|
|
40
|
+
},
|
|
41
|
+
"capability": {
|
|
42
|
+
"$ref": "#/definitions/Capability",
|
|
43
|
+
"description": "The type of capability detected"
|
|
44
|
+
},
|
|
45
|
+
"dep_path": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "The dependency path to where the capability is incurred"
|
|
48
|
+
},
|
|
49
|
+
"path": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"description": "The call path showing how the capability is reached, with each element being a function or method",
|
|
52
|
+
"items": {
|
|
53
|
+
"$ref": "#/definitions/Function"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"package_dir": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "The location/directory of the package"
|
|
59
|
+
},
|
|
60
|
+
"capability_type": {
|
|
61
|
+
"$ref": "#/definitions/CapabilityType",
|
|
62
|
+
"description": "Classification of how the capability was incurred (direct or transitive)"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"additionalProperties": false
|
|
66
|
+
},
|
|
67
|
+
"Function": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"description": "Information about a function in a call path",
|
|
70
|
+
"properties": {
|
|
71
|
+
"name": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "The name of the function"
|
|
74
|
+
},
|
|
75
|
+
"site": {
|
|
76
|
+
"$ref": "#/definitions/FunctionSite",
|
|
77
|
+
"description": "Location information for the function call"
|
|
78
|
+
},
|
|
79
|
+
"package": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"description": "The package containing this function"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"additionalProperties": false
|
|
85
|
+
},
|
|
86
|
+
"FunctionSite": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"description": "Source location information for a function",
|
|
89
|
+
"properties": {
|
|
90
|
+
"filename": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "The source file containing the function"
|
|
93
|
+
},
|
|
94
|
+
"line": {
|
|
95
|
+
"type": "integer",
|
|
96
|
+
"description": "The line number in the source file"
|
|
97
|
+
},
|
|
98
|
+
"column": {
|
|
99
|
+
"type": "integer",
|
|
100
|
+
"description": "The column number in the source file"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
},
|
|
105
|
+
"ModuleInfo": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"description": "Information about a Go module",
|
|
108
|
+
"properties": {
|
|
109
|
+
"path": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "The module path/import path"
|
|
112
|
+
},
|
|
113
|
+
"version": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"description": "The version of the module"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"additionalProperties": false
|
|
119
|
+
},
|
|
120
|
+
"PackageInfo": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"description": "Information about a Go package",
|
|
123
|
+
"properties": {
|
|
124
|
+
"path": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"description": "The package import path"
|
|
127
|
+
},
|
|
128
|
+
"ignored_files": {
|
|
129
|
+
"type": "array",
|
|
130
|
+
"description": "List of source files in the package directory that were ignored due to build configuration and build tags",
|
|
131
|
+
"items": {
|
|
132
|
+
"type": "string"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"additionalProperties": false
|
|
137
|
+
},
|
|
138
|
+
"Capability": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"description": "Types of capabilities that can be detected by capslock",
|
|
141
|
+
"enum": [
|
|
142
|
+
"CAPABILITY_UNSPECIFIED",
|
|
143
|
+
"CAPABILITY_SAFE",
|
|
144
|
+
"CAPABILITY_FILES",
|
|
145
|
+
"CAPABILITY_NETWORK",
|
|
146
|
+
"CAPABILITY_RUNTIME",
|
|
147
|
+
"CAPABILITY_READ_SYSTEM_STATE",
|
|
148
|
+
"CAPABILITY_MODIFY_SYSTEM_STATE",
|
|
149
|
+
"CAPABILITY_OPERATING_SYSTEM",
|
|
150
|
+
"CAPABILITY_SYSTEM_CALLS",
|
|
151
|
+
"CAPABILITY_ARBITRARY_EXECUTION",
|
|
152
|
+
"CAPABILITY_CGO",
|
|
153
|
+
"CAPABILITY_UNANALYZED",
|
|
154
|
+
"CAPABILITY_UNSAFE_POINTER",
|
|
155
|
+
"CAPABILITY_REFLECT",
|
|
156
|
+
"CAPABILITY_EXEC"
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"CapabilityType": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"description": "Classification of how a capability was incurred",
|
|
162
|
+
"enum": [
|
|
163
|
+
"CAPABILITY_TYPE_UNSPECIFIED",
|
|
164
|
+
"CAPABILITY_TYPE_DIRECT",
|
|
165
|
+
"CAPABILITY_TYPE_TRANSITIVE"
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"tool": "zizmor",
|
|
4
|
+
"version": "1.2.0",
|
|
5
|
+
"scan_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
6
|
+
"timestamp": "2023-12-01T10:00:00Z",
|
|
7
|
+
"duration_ms": 1500
|
|
8
|
+
},
|
|
9
|
+
"summary": {
|
|
10
|
+
"total_issues": 3,
|
|
11
|
+
"by_severity": {
|
|
12
|
+
"critical": 1,
|
|
13
|
+
"high": 1,
|
|
14
|
+
"medium": 1,
|
|
15
|
+
"low": 0,
|
|
16
|
+
"info": 0
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"issues": [
|
|
20
|
+
{
|
|
21
|
+
"id": "ZIZ001",
|
|
22
|
+
"severity": "critical",
|
|
23
|
+
"category": "injection",
|
|
24
|
+
"title": "Potential command injection in workflow",
|
|
25
|
+
"description": "User input is passed directly to shell command without sanitization",
|
|
26
|
+
"location": {
|
|
27
|
+
"file": ".github/workflows/ci.yml",
|
|
28
|
+
"line": 42,
|
|
29
|
+
"column": 12
|
|
30
|
+
},
|
|
31
|
+
"confidence": "high",
|
|
32
|
+
"fix_available": true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "ZIZ002",
|
|
36
|
+
"severity": "high",
|
|
37
|
+
"category": "authentication",
|
|
38
|
+
"title": "Secrets exposed in logs",
|
|
39
|
+
"description": "API keys may be leaked through debug output",
|
|
40
|
+
"location": {
|
|
41
|
+
"file": ".github/workflows/deploy.yml",
|
|
42
|
+
"line": 18,
|
|
43
|
+
"column": 8
|
|
44
|
+
},
|
|
45
|
+
"confidence": "medium",
|
|
46
|
+
"fix_available": false
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "ZIZ003",
|
|
50
|
+
"severity": "medium",
|
|
51
|
+
"category": "misc",
|
|
52
|
+
"title": "Outdated action version",
|
|
53
|
+
"description": "Using deprecated version of actions/checkout",
|
|
54
|
+
"location": {
|
|
55
|
+
"file": ".github/workflows/test.yml",
|
|
56
|
+
"line": 12,
|
|
57
|
+
"column": 15
|
|
58
|
+
},
|
|
59
|
+
"confidence": "high",
|
|
60
|
+
"fix_available": true
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"tool": "zizmor",
|
|
4
|
+
"version": "1.3.0",
|
|
5
|
+
"scan_id": "987f6543-e21c-43d5-b789-012345678901",
|
|
6
|
+
"timestamp": "2023-12-15T14:30:00Z",
|
|
7
|
+
"duration_ms": 1200
|
|
8
|
+
},
|
|
9
|
+
"summary": {
|
|
10
|
+
"total_issues": 4,
|
|
11
|
+
"by_severity": {
|
|
12
|
+
"critical": 2,
|
|
13
|
+
"high": 1,
|
|
14
|
+
"medium": 0,
|
|
15
|
+
"low": 1,
|
|
16
|
+
"info": 0
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"issues": [
|
|
20
|
+
{
|
|
21
|
+
"id": "ZIZ001",
|
|
22
|
+
"severity": "critical",
|
|
23
|
+
"category": "injection",
|
|
24
|
+
"title": "Potential command injection in workflow",
|
|
25
|
+
"description": "User input is passed directly to shell command without sanitization",
|
|
26
|
+
"location": {
|
|
27
|
+
"file": ".github/workflows/ci.yml",
|
|
28
|
+
"line": 42,
|
|
29
|
+
"column": 12
|
|
30
|
+
},
|
|
31
|
+
"confidence": "high",
|
|
32
|
+
"fix_available": true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "ZIZ002",
|
|
36
|
+
"severity": "high",
|
|
37
|
+
"category": "authentication",
|
|
38
|
+
"title": "Secrets exposed in logs",
|
|
39
|
+
"description": "API keys may be leaked through debug output",
|
|
40
|
+
"location": {
|
|
41
|
+
"file": ".github/workflows/deploy.yml",
|
|
42
|
+
"line": 18,
|
|
43
|
+
"column": 8
|
|
44
|
+
},
|
|
45
|
+
"confidence": "medium",
|
|
46
|
+
"fix_available": false
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "ZIZ004",
|
|
50
|
+
"severity": "critical",
|
|
51
|
+
"category": "crypto",
|
|
52
|
+
"title": "Weak cryptographic algorithm",
|
|
53
|
+
"description": "Using MD5 hash which is cryptographically insecure",
|
|
54
|
+
"location": {
|
|
55
|
+
"file": "scripts/hash.sh",
|
|
56
|
+
"line": 8,
|
|
57
|
+
"column": 20
|
|
58
|
+
},
|
|
59
|
+
"confidence": "high",
|
|
60
|
+
"fix_available": true
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "ZIZ005",
|
|
64
|
+
"severity": "low",
|
|
65
|
+
"category": "disclosure",
|
|
66
|
+
"title": "Debug information exposed",
|
|
67
|
+
"description": "Stack traces may reveal sensitive information",
|
|
68
|
+
"location": {
|
|
69
|
+
"file": ".github/workflows/debug.yml",
|
|
70
|
+
"line": 25,
|
|
71
|
+
"column": 10
|
|
72
|
+
},
|
|
73
|
+
"confidence": "low",
|
|
74
|
+
"fix_available": false
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Security Report Schema",
|
|
4
|
+
"description": "Schema for security analysis reports from tools like zizmor and capslock",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"metadata": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"title": "Report Metadata",
|
|
10
|
+
"properties": {
|
|
11
|
+
"tool": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"title": "Tool Name",
|
|
14
|
+
"description": "Name of the security analysis tool",
|
|
15
|
+
"enum": ["zizmor", "capslock", "semgrep", "bandit"]
|
|
16
|
+
},
|
|
17
|
+
"version": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"title": "Tool Version",
|
|
20
|
+
"description": "Version of the analysis tool"
|
|
21
|
+
},
|
|
22
|
+
"scan_id": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"title": "Scan ID",
|
|
25
|
+
"format": "uuid",
|
|
26
|
+
"description": "Unique identifier for this scan"
|
|
27
|
+
},
|
|
28
|
+
"timestamp": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"title": "Scan Timestamp",
|
|
31
|
+
"format": "date-time",
|
|
32
|
+
"description": "When the scan was performed",
|
|
33
|
+
"readOnly": true
|
|
34
|
+
},
|
|
35
|
+
"duration_ms": {
|
|
36
|
+
"type": "integer",
|
|
37
|
+
"title": "Duration",
|
|
38
|
+
"description": "Scan duration in milliseconds"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": ["tool", "version", "timestamp"]
|
|
42
|
+
},
|
|
43
|
+
"summary": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"title": "Results Summary",
|
|
46
|
+
"properties": {
|
|
47
|
+
"total_issues": {
|
|
48
|
+
"type": "integer",
|
|
49
|
+
"title": "Total Issues",
|
|
50
|
+
"description": "Total number of security issues found"
|
|
51
|
+
},
|
|
52
|
+
"by_severity": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"title": "Issues by Severity",
|
|
55
|
+
"properties": {
|
|
56
|
+
"critical": {
|
|
57
|
+
"type": "integer",
|
|
58
|
+
"title": "Critical Issues"
|
|
59
|
+
},
|
|
60
|
+
"high": {
|
|
61
|
+
"type": "integer",
|
|
62
|
+
"title": "High Severity Issues"
|
|
63
|
+
},
|
|
64
|
+
"medium": {
|
|
65
|
+
"type": "integer",
|
|
66
|
+
"title": "Medium Severity Issues"
|
|
67
|
+
},
|
|
68
|
+
"low": {
|
|
69
|
+
"type": "integer",
|
|
70
|
+
"title": "Low Severity Issues"
|
|
71
|
+
},
|
|
72
|
+
"info": {
|
|
73
|
+
"type": "integer",
|
|
74
|
+
"title": "Informational Issues"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"issues": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"title": "Security Issues",
|
|
83
|
+
"items": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"properties": {
|
|
86
|
+
"id": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"title": "Issue ID",
|
|
89
|
+
"description": "Unique identifier for the issue"
|
|
90
|
+
},
|
|
91
|
+
"severity": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"title": "Severity Level",
|
|
94
|
+
"enum": ["critical", "high", "medium", "low", "info"]
|
|
95
|
+
},
|
|
96
|
+
"category": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"title": "Issue Category",
|
|
99
|
+
"description": "Type of security issue",
|
|
100
|
+
"enum": ["injection", "authentication", "authorization", "crypto", "disclosure", "dos", "misc"]
|
|
101
|
+
},
|
|
102
|
+
"title": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"title": "Issue Title",
|
|
105
|
+
"description": "Brief description of the issue"
|
|
106
|
+
},
|
|
107
|
+
"description": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"title": "Detailed Description",
|
|
110
|
+
"description": "Full explanation of the security issue"
|
|
111
|
+
},
|
|
112
|
+
"location": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"title": "Issue Location",
|
|
115
|
+
"properties": {
|
|
116
|
+
"file": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"title": "File Path",
|
|
119
|
+
"description": "Path to the file containing the issue"
|
|
120
|
+
},
|
|
121
|
+
"line": {
|
|
122
|
+
"type": "integer",
|
|
123
|
+
"title": "Line Number",
|
|
124
|
+
"description": "Line number where issue occurs"
|
|
125
|
+
},
|
|
126
|
+
"column": {
|
|
127
|
+
"type": "integer",
|
|
128
|
+
"title": "Column Number",
|
|
129
|
+
"description": "Column number where issue occurs"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"confidence": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"title": "Confidence Level",
|
|
136
|
+
"enum": ["high", "medium", "low"]
|
|
137
|
+
},
|
|
138
|
+
"fix_available": {
|
|
139
|
+
"type": "boolean",
|
|
140
|
+
"title": "Fix Available",
|
|
141
|
+
"description": "Whether an automated fix is available"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"required": ["id", "severity", "title", "location"]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"required": ["metadata", "summary", "issues"]
|
|
149
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Zizmor Examples
|
|
2
|
+
|
|
3
|
+
This directory contains examples for [Zizmor](https://github.com/zizmorcore/zizmor), a GitHub Actions security auditor.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- `zizmor.schema.json` - Official zizmor JSON output schema (v1)
|
|
8
|
+
- `zizmor-v0.1.0.json` - Sample audit report from zizmor v0.1.0
|
|
9
|
+
- `zizmor-v0.2.0.json` - Sample audit report from zizmor v0.2.0
|
|
10
|
+
|
|
11
|
+
## Example Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Compare audit results between versions
|
|
15
|
+
json-schema-diff zizmor.schema.json zizmor-v0.1.0.json zizmor-v0.2.0.json
|
|
16
|
+
|
|
17
|
+
# Real-world usage with actual zizmor output
|
|
18
|
+
zizmor --format json --output current-audit.json .
|
|
19
|
+
json-schema-diff zizmor.schema.json previous-audit.json current-audit.json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Key Changes Demonstrated
|
|
23
|
+
|
|
24
|
+
- **New security findings**: v0.2.0 introduces detection of hardcoded credentials
|
|
25
|
+
- **Severity escalation**: Dangerous actions finding upgraded from Medium to High severity
|
|
26
|
+
- **Rich location data**: File paths, line numbers, and byte offsets for precise issue location
|