Newer
Older
{/* Copyright 2025 Zentrum für Digitale Souveränität der Öffentlichen Verwaltung (ZenDiS) GmbH.
SPDX-License-Identifier: MIT */}
import { Tabs, Callout } from 'nextra/components'
# SARIF per Repository
<Callout type="info">

Sebastian Kawelke
committed
`GET /api/v1/repositories/{repositoryUrl}/sarif`

Sebastian Kawelke
committed
This endpoint gets parameterized with the **full repository URL**. The repository URL is the URL of the repository that should be scanned.
**The URL must be URL encoded**
(`https://gitlab.opencode.de/zendis-repo-scanner` → `https%3A%2F%2Fgitlab.opencode.de%2Fzendis-repo-scanner`).

Sebastian Kawelke
committed
Using this format opens the possibility to scan repositories from other platforms like GitHub, Bitbucket, etc. Besides
that, caching is simplified because the URL is unique (instead of using the project ID and a platform URL as query string for
example) and the URL is human-readable, at least after URL decoding. This might improve debugging in the future.
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
The result is returned in [SARIF format](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning).
**SARIF simplifies possible later integration with other tools. It is an open standard and widely supported.**
### Example Request
<Tabs items={['GO', 'JavaScript', 'curl']}>
<Tabs.Tab>
```go filename="main.go" copy
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://scanner.zend.is/api/v1/repositories/https%3A%2F%2Fgitlab.opencode.de%2Fzendis-repo-scanner/sarif"
resp, err := http.Get(url)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
```
</Tabs.Tab>
<Tabs.Tab>
```js filename="main.js" copy
const fetch = require('node-fetch');
const url = 'https://scanner.zend.is/api/v1/repositories/https%3A%2F%2Fgitlab.opencode.de%2Fzendis-repo-scanner/sarif';
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
```
</Tabs.Tab>
<Tabs.Tab>
```bash filename="cli" copy
curl -X GET "https://scanner.zend.is/api/v1/repositories/https%3A%2F%2Fgitlab.opencode.de%2Fzendis-repo-scanner/sarif"
```
</Tabs.Tab>
</Tabs>
### Example JSON Response
```json
{
"$schema": "https://www.schemastore.org/schemas/json/sarif-2.1.0.json",
"runs": [
{
"properties": {
"badges": [
{

Sebastian Kawelke
committed
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
"badgeId": "MAINTAINED",
"badgeLevel": "BRONZE",
"badgeUrl": "https://gitlab.opencode.de/open-code/badgebackend/badge-api/-/raw/main/assets/MAINTAINED-1.svg",
"badgeGranted": true,
"badgeInformationUri": "",
"isHighestGrantedBadge": false,
"badgeExplanation": {
"criteria": [
{
"description": "The number of commits in the last 6 months. (The current value is 39)",
"value": "39",
"status": "pass",
"ruleId": "COMMITS",
"threshold": {
"min": 5,
"timeRangeInMonths": 6
},
"badgeId": "MAINTAINED",
"badgeLevel": "BRONZE",
"evidence": "The number of commits in the last 6 months is 39. First commit dd519848, last commit e5eaf6c4"
}
]
}
},
{
"badgeId": "MAINTAINED",
"badgeLevel": "SILVER",
"badgeUrl": "https://gitlab.opencode.de/open-code/badgebackend/badge-api/-/raw/main/assets/MAINTAINED-2.svg",
"badgeGranted": true,
"badgeInformationUri": "",
"isHighestGrantedBadge": false,
"badgeExplanation": {
"criteria": [
{
"description": "The number of commits in the last 6 months. (The current value is 39)",
"value": "39",
"status": "pass",
"ruleId": "COMMITS",
"threshold": {
"min": 5,
"timeRangeInMonths": 6
},
"badgeId": "MAINTAINED",
"badgeLevel": "BRONZE",
"evidence": "The number of commits in the last 6 months is 39. First commit dd519848, last commit e5eaf6c4"
},
{
"description": "The minimum time it takes for a project member to react to an issue in the last 3 months. (The current value is <nil>)",
"value": "<nil>",
"status": "open",
"ruleId": "ISSUE_REACTION_TIME",
"threshold": {
"max": 7,
"timeRangeInMonths": 3
},
"badgeId": "MAINTAINED",
"badgeLevel": "SILVER"
}
]
}
},
{
"badgeId": "MAINTAINED",
"badgeLevel": "GOLD",
"badgeUrl": "https://gitlab.opencode.de/open-code/badgebackend/badge-api/-/raw/main/assets/MAINTAINED-3.svg",
"badgeGranted": true,
"badgeInformationUri": "",
"isHighestGrantedBadge": true,
"badgeExplanation": {
"criteria": [
{

Sebastian Kawelke
committed
"description": "The number of commits in the last 6 months. (The current value is 39)",
"value": "39",
"status": "pass",
"ruleId": "COMMITS",
"threshold": {
"min": 5,
"timeRangeInMonths": 6
},
"badgeId": "MAINTAINED",
"badgeLevel": "BRONZE",
"evidence": "The number of commits in the last 6 months is 39. First commit dd519848, last commit e5eaf6c4"
},
{
"description": "The minimum time it takes for a project member to react to an issue in the last 3 months. (The current value is <nil>)",
"value": "<nil>",
"status": "open",

Sebastian Kawelke
committed
"threshold": {
"max": 7,
"timeRangeInMonths": 3
},
"badgeId": "MAINTAINED",
"badgeLevel": "SILVER"

Sebastian Kawelke
committed
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
"description": "The number of tags/releases in the last 6 months. (The current value is 1)",
"value": "1",
"status": "pass",
"ruleId": "RELEASES",
"threshold": {
"min": 1,
"timeRangeInMonths": 6
},
"badgeId": "MAINTAINED",
"badgeLevel": "GOLD",
"evidence": "The number of tags/releases in the last 6 months is 1 (1 tag(s) of which 0 are releases). The following tags/releases were found: tag:v1.1.0"
}
]
}
},
{
"badgeId": "REUSED",
"badgeLevel": "BRONZE",
"badgeUrl": "https://gitlab.opencode.de/open-code/badgebackend/badge-api/-/raw/main/assets/REUSED-1.svg",
"badgeGranted": false,
"badgeInformationUri": "",
"isHighestGrantedBadge": false,
"badgeExplanation": {
"criteria": [
{
"description": "The project has a packaging system in place and used it during the last 6 months. It checks the container registry, the package registry and the releases. It expects either a release to have assets or packages inside those two registries (The current value is 0)",
"value": "0",
"status": "fail",
"ruleId": "PACKAGES",
"threshold": {
"min": 1,
"timeRangeInMonths": 6
},
"badgeId": "REUSED",
"badgeLevel": "BRONZE",
"evidence": "No container tags, packages or releases with assets found."

Sebastian Kawelke
committed
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
{
"description": "The number of CI pipeline runs in the last 6 months. (The current value is 56)",
"value": "56",
"status": "pass",
"ruleId": "CI_PIPELINE",
"threshold": {
"min": 1,
"timeRangeInMonths": 6
},
"badgeId": "REUSED",
"badgeLevel": "BRONZE",
"evidence": "The number of CI pipeline runs in the last 6 months is 56 (43 of 56 were successful)."
}
]
}
},
{
"badgeId": "DIN-SPEC-XXXX",
"badgeLevel": "BRONZE",
"badgeUrl": "https://gitlab.opencode.de/open-code/badgebackend/manual-badges/-/raw/main/badges/din-spec-xxxx.svg",
"badgeGranted": false,
"badgeInformationUri": "",
"isHighestGrantedBadge": false,
"badgeExplanation": {
"criteria": [
{
"description": "Provides a badge for projects that are compliant with DIN SPEC XXXX. This badge is granted manually trough the DIN SPEC XXXX working group. (The current value is 0)",
"value": "0",
"status": "fail",
"ruleId": "MANUAL/DIN SPEC XXXX compliant",
"threshold": {
"min": 1
},
"badgeId": "DIN-SPEC-XXXX",
"badgeLevel": "BRONZE",
"evidence": "Check was not manually granted"
}
]

Sebastian Kawelke
committed
"badgeId": "OPEN-SOURCE",
"badgeLevel": "GOLD",
"badgeUrl": "https://gitlab.opencode.de/open-code/badgebackend/manual-badges/-/raw/main/badges/open-source.svg",
"badgeGranted": true,
"badgeInformationUri": "",
"isHighestGrantedBadge": true,
"badgeExplanation": {
"criteria": [
{
"description": "Provides a badge for projects that are open-source. This badge is granted manually by the openCode team. (The current value is 1)",

Sebastian Kawelke
committed
"value": "1",
"status": "pass",
"ruleId": "MANUAL/Project is open source",
"threshold": {
"min": 1
},
"badgeId": "OPEN-SOURCE",
"badgeLevel": "GOLD",
"evidence": "Check was manually granted"

Sebastian Kawelke
committed
]

Sebastian Kawelke
committed
],
"testedRepository": "https://gitlab.opencode.de/bmi/ozg-rahmenarchitektur/ozgsec/ozgsec-best-practice-scanner"

Sebastian Kawelke
committed
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
"kind": "pass",
"message": "The number of commits in the last 6 months. (The current value is 39)",
"properties": {
"badgeId": "MAINTAINED",
"badgeLevel": "BRONZE",
"evidence": "The number of commits in the last 6 months is 39. First commit dd519848, last commit e5eaf6c4",
"threshold": {
"min": 5,
"timeRangeInMonths": 6
},
"value": "39"
},
"ruleId": "COMMITS",
"ruleIndex": 0
},
{
"kind": "pass",
"message": "The number of commits in the last 6 months. (The current value is 39)",
"properties": {
"badgeId": "MAINTAINED",
"badgeLevel": "BRONZE",
"evidence": "The number of commits in the last 6 months is 39. First commit dd519848, last commit e5eaf6c4",
"threshold": {
"min": 5,
"timeRangeInMonths": 6
},
"value": "39"
},
"ruleId": "COMMITS",
"ruleIndex": 0
},
{
"kind": "open",
"message": "The minimum time it takes for a project member to react to an issue in the last 3 months. (The current value is <nil>)",
"properties": {
"badgeId": "MAINTAINED",
"badgeLevel": "SILVER",
"evidence": "",
"threshold": {
"max": 7,
"timeRangeInMonths": 3
},
"value": "<nil>"
},

Sebastian Kawelke
committed
"ruleIndex": 1
},
{
"kind": "pass",
"message": "The number of commits in the last 6 months. (The current value is 39)",
"properties": {
"badgeId": "MAINTAINED",
"badgeLevel": "BRONZE",
"evidence": "The number of commits in the last 6 months is 39. First commit dd519848, last commit e5eaf6c4",
"threshold": {
"min": 5,
"timeRangeInMonths": 6
},
"value": "39"

Sebastian Kawelke
committed
"ruleId": "COMMITS",
"ruleIndex": 0
},
{
"kind": "open",
"message": "The minimum time it takes for a project member to react to an issue in the last 3 months. (The current value is <nil>)",

Sebastian Kawelke
committed
"badgeId": "MAINTAINED",
"badgeLevel": "SILVER",
"evidence": "",
"threshold": {
"max": 7,
"timeRangeInMonths": 3
},
"value": "<nil>"
},
"ruleId": "ISSUE_REACTION_TIME",
"ruleIndex": 1

Sebastian Kawelke
committed
"kind": "pass",
"message": "The number of tags/releases in the last 6 months. (The current value is 1)",
"properties": {
"badgeId": "MAINTAINED",
"badgeLevel": "GOLD",
"evidence": "The number of tags/releases in the last 6 months is 1 (1 tag(s) of which 0 are releases). The following tags/releases were found: tag:v1.1.0",
"threshold": {
"min": 1,
"timeRangeInMonths": 6
},
"value": "1"

Sebastian Kawelke
committed
"ruleId": "RELEASES",
"ruleIndex": 2
},
{
"kind": "fail",
"message": "The project has a packaging system in place and used it during the last 6 months. It checks the container registry, the package registry and the releases. It expects either a release to have assets or packages inside those two registries (The current value is 0)",

Sebastian Kawelke
committed
"badgeId": "REUSED",
"badgeLevel": "BRONZE",
"evidence": "No container tags, packages or releases with assets found.",
"threshold": {
"min": 1,
"timeRangeInMonths": 6
},
"value": "0"
},
"ruleId": "PACKAGES",
"ruleIndex": 3

Sebastian Kawelke
committed
"kind": "pass",
"message": "The number of CI pipeline runs in the last 6 months. (The current value is 56)",
"properties": {
"badgeId": "REUSED",
"badgeLevel": "BRONZE",
"evidence": "The number of CI pipeline runs in the last 6 months is 56 (43 of 56 were successful).",
"threshold": {
"min": 1,
"timeRangeInMonths": 6
},
"value": "56"

Sebastian Kawelke
committed
"ruleId": "CI_PIPELINE",
"ruleIndex": 4
},
{
"kind": "fail",
"message": "Provides a badge for projects that are compliant with DIN SPEC XXXX. This badge is granted manually trough the DIN SPEC XXXX working group. (The current value is 0)",

Sebastian Kawelke
committed
"badgeId": "DIN-SPEC-XXXX",
"badgeLevel": "BRONZE",
"evidence": "Check was not manually granted",
"threshold": {
"min": 1
},
"value": "0"
},
"ruleId": "MANUAL/DIN SPEC XXXX compliant",
"ruleIndex": 5
},
{
"kind": "pass",
"message": "Provides a badge for projects that are open-source. This badge is granted manually by the openCode team. (The current value is 1)",

Sebastian Kawelke
committed
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
"properties": {
"badgeId": "OPEN-SOURCE",
"badgeLevel": "GOLD",
"evidence": "Check was manually granted",
"threshold": {
"min": 1
},
"value": "1"
},
"ruleId": "MANUAL/Project is open source",
"ruleIndex": 6
}
],
"tool": {
"driver": {
"informationUri": "https://gitlab.opencode.de/open-code/badgebackend/badge-api",
"name": "badge-api",
"rules": [
{
"id": "COMMITS",
"name": "Commits",
"fullDescription": {
"text": "The number of commits in the last 6 months."
},
"help": {
"text": "The number of commits in the last 6 months."
},
"properties": {
"unit": "commits",
"threshold": {
"min": 5,
"timeRangeInMonths": 6
}
}
},
{
"id": "ISSUE_REACTION_TIME",
"name": "Issue Reaction Time",
"fullDescription": {
"text": "The minimum time it takes for a project member to react to an issue in the last 3 months."
},
"help": {
"text": "The minimum time it takes for a project member to react to an issue in the last 3 months."
},
"properties": {
"unit": "days",
"threshold": {
"max": 7,
"timeRangeInMonths": 3
}
}
},
{
"id": "RELEASES",
"name": "Releases",
"fullDescription": {
"text": "The number of tags/releases in the last 6 months."
},
"help": {
"text": "The number of tags/releases in the last 6 months."
},
"properties": {
"unit": "releases",
"threshold": {
"min": 1,
"timeRangeInMonths": 6
}
}
},
{
"id": "PACKAGES",
"name": "Packaging",
"fullDescription": {
"text": "The project has a packaging system in place and used it during the last 6 months. It checks the container registry, the package registry and the releases. It expects either a release to have assets or packages inside those two registries"
},
"help": {
"text": "Packaging is a way to distribute software. It is important to have a packaging system in place to make it easier for users to install and use the software. Packaging systems can help automate the process of installing software, manage dependencies, and ensure that the software is installed correctly. This check looks for a packaging system in the project and checks if it has been used in the last 6 months."
},
"properties": {
"unit": "packages",
"threshold": {
"min": 1,
"timeRangeInMonths": 6
}
}
},
{
"id": "CI_PIPELINE",
"name": "CI Pipeline Runs",
"fullDescription": {
"text": "The number of CI pipeline runs in the last 6 months."
},
"help": {
"text": "The number of CI pipeline runs the last 6 months."
},
"properties": {
"unit": "runs",
"threshold": {
"min": 1,
"timeRangeInMonths": 6
}
}
},
{
"id": "MANUAL/DIN SPEC XXXX compliant",
"name": "DIN SPEC XXXX compliant",
"fullDescription": {
"text": "Provides a badge for projects that are compliant with DIN SPEC XXXX. This badge is granted manually trough the DIN SPEC XXXX working group."
},
"help": {
"text": "This is a manual check"
},
"properties": {
"unit": "",
"threshold": {
"min": 1
}
}
},
{
"id": "MANUAL/Project is open source",
"name": "Project is open source",
"fullDescription": {
"text": "Provides a badge for projects that are open-source. This badge is granted manually by the openCode team."

Sebastian Kawelke
committed
},
"help": {
"text": "This is a manual check"
},
"properties": {
"unit": "",
"threshold": {
"min": 1
}
}
}
]

Sebastian Kawelke
committed
}

Sebastian Kawelke
committed
],
"version": "2.1.0"