privalint 0.3.0 → 0.4.1

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.
Files changed (64) hide show
  1. package/README.de.md +38 -0
  2. package/README.md +49 -11
  3. package/dist/assessment.d.ts +1 -1
  4. package/dist/assessment.js +45 -9
  5. package/dist/assessment.js.map +1 -1
  6. package/dist/capture.js +10 -3
  7. package/dist/capture.js.map +1 -1
  8. package/dist/cli.js +44 -11
  9. package/dist/cli.js.map +1 -1
  10. package/dist/config.d.ts +21 -0
  11. package/dist/config.js +113 -0
  12. package/dist/config.js.map +1 -0
  13. package/dist/consent.js +70 -8
  14. package/dist/consent.js.map +1 -1
  15. package/dist/coverage.d.ts +13 -0
  16. package/dist/coverage.js +86 -0
  17. package/dist/coverage.js.map +1 -0
  18. package/dist/data/third-parties.js +9 -0
  19. package/dist/data/third-parties.js.map +1 -1
  20. package/dist/diagnostics.d.ts +7 -3
  21. package/dist/diagnostics.js +36 -8
  22. package/dist/diagnostics.js.map +1 -1
  23. package/dist/index.d.ts +3 -0
  24. package/dist/index.js +3 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/network.d.ts +3 -2
  27. package/dist/network.js +6 -4
  28. package/dist/network.js.map +1 -1
  29. package/dist/observations.d.ts +5 -1
  30. package/dist/observations.js +6 -1
  31. package/dist/observations.js.map +1 -1
  32. package/dist/policy.d.ts +6 -0
  33. package/dist/policy.js +37 -0
  34. package/dist/policy.js.map +1 -0
  35. package/dist/report-contract.d.ts +13 -0
  36. package/dist/report-contract.js +16 -0
  37. package/dist/report-contract.js.map +1 -0
  38. package/dist/reporters/capture.js +56 -4
  39. package/dist/reporters/capture.js.map +1 -1
  40. package/dist/reporters/markdown.js +6 -1
  41. package/dist/reporters/markdown.js.map +1 -1
  42. package/dist/reporters/messages.d.ts +1 -0
  43. package/dist/reporters/messages.js +6 -0
  44. package/dist/reporters/messages.js.map +1 -1
  45. package/dist/reporters/sarif.js +25 -11
  46. package/dist/reporters/sarif.js.map +1 -1
  47. package/dist/reporters/shared.js +3 -2
  48. package/dist/reporters/shared.js.map +1 -1
  49. package/dist/reporters/text.js +4 -0
  50. package/dist/reporters/text.js.map +1 -1
  51. package/dist/rules/reject-option.js +3 -1
  52. package/dist/rules/reject-option.js.map +1 -1
  53. package/dist/rules/third-party-embeds.js +2 -2
  54. package/dist/rules/third-party-embeds.js.map +1 -1
  55. package/dist/scan-options.d.ts +7 -1
  56. package/dist/scan-options.js.map +1 -1
  57. package/dist/scanner.js +95 -7
  58. package/dist/scanner.js.map +1 -1
  59. package/dist/types.d.ts +61 -2
  60. package/package.json +7 -1
  61. package/schemas/report-1.0.0.schema.json +813 -0
  62. package/schemas/report-1.1.0.schema.json +833 -0
  63. package/schemas/sarif-properties-1.0.0.schema.json +785 -0
  64. package/schemas/sarif-properties-1.1.0.schema.json +810 -0
@@ -0,0 +1,810 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/JExcellence/privalint/raw/refs/heads/main/schemas/sarif-properties-1.1.0.schema.json",
4
+ "title": "PrivaLint SARIF run properties 1.1.0",
5
+ "description": "Validates PrivaLint run.properties only, not the enclosing SARIF 2.1.0 standard.",
6
+ "type": "object",
7
+ "properties": {
8
+ "scanId": {
9
+ "type": "string",
10
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
11
+ },
12
+ "schemaVersion": {
13
+ "const": "1.1.0"
14
+ },
15
+ "scannerVersion": {
16
+ "type": "string"
17
+ },
18
+ "options": {
19
+ "$ref": "#/$defs/options"
20
+ },
21
+ "coverage": {
22
+ "type": "string",
23
+ "enum": [
24
+ "complete",
25
+ "partial"
26
+ ]
27
+ },
28
+ "observations": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "object",
32
+ "properties": {
33
+ "pageId": {
34
+ "type": "string",
35
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
36
+ },
37
+ "url": {
38
+ "type": "string"
39
+ },
40
+ "capture": {
41
+ "$ref": "#/$defs/capture"
42
+ },
43
+ "ruleEvaluations": {
44
+ "type": "array",
45
+ "items": {
46
+ "$ref": "#/$defs/evaluation"
47
+ }
48
+ }
49
+ },
50
+ "required": [
51
+ "pageId",
52
+ "url",
53
+ "capture",
54
+ "ruleEvaluations"
55
+ ]
56
+ }
57
+ },
58
+ "consent": {
59
+ "$ref": "#/$defs/consent"
60
+ }
61
+ },
62
+ "required": [
63
+ "scanId",
64
+ "schemaVersion",
65
+ "scannerVersion",
66
+ "options",
67
+ "coverage",
68
+ "observations"
69
+ ],
70
+ "$defs": {
71
+ "diagnostic": {
72
+ "type": "object",
73
+ "properties": {
74
+ "kind": {
75
+ "type": "string",
76
+ "enum": [
77
+ "security-blocked",
78
+ "unsupported-method",
79
+ "unsupported-protocol",
80
+ "dns",
81
+ "tls",
82
+ "connection",
83
+ "timeout",
84
+ "resource-limit",
85
+ "http-error",
86
+ "browser-failure",
87
+ "skipped",
88
+ "aborted"
89
+ ]
90
+ },
91
+ "phase": {
92
+ "type": "string",
93
+ "enum": [
94
+ "before-consent",
95
+ "after-reject"
96
+ ]
97
+ },
98
+ "url": {
99
+ "type": "string",
100
+ "pattern": "^(https?://[^/?#@\\s]+/\\[redacted\\]|\\[redacted\\])$"
101
+ },
102
+ "status": {
103
+ "type": "integer",
104
+ "minimum": 100,
105
+ "maximum": 599
106
+ },
107
+ "limit": {
108
+ "type": "string",
109
+ "enum": [
110
+ "requests",
111
+ "response-bytes",
112
+ "total-bytes",
113
+ "redirects"
114
+ ]
115
+ },
116
+ "skippedReason": {
117
+ "type": "string",
118
+ "enum": [
119
+ "beacon",
120
+ "unsupported-method",
121
+ "unsupported-protocol",
122
+ "policy"
123
+ ]
124
+ }
125
+ },
126
+ "required": [
127
+ "kind",
128
+ "phase",
129
+ "url"
130
+ ]
131
+ },
132
+ "diagnostics": {
133
+ "type": "object",
134
+ "properties": {
135
+ "requests": {
136
+ "type": "integer",
137
+ "minimum": 0
138
+ },
139
+ "omittedRequests": {
140
+ "type": "integer",
141
+ "minimum": 0
142
+ },
143
+ "responses": {
144
+ "type": "integer",
145
+ "minimum": 0
146
+ },
147
+ "finished": {
148
+ "type": "integer",
149
+ "minimum": 0
150
+ },
151
+ "failed": {
152
+ "type": "integer",
153
+ "minimum": 0
154
+ },
155
+ "blocked": {
156
+ "type": "integer",
157
+ "minimum": 0
158
+ },
159
+ "skippedRequests": {
160
+ "type": "integer",
161
+ "minimum": 0
162
+ },
163
+ "failedRequests": {
164
+ "type": "integer",
165
+ "minimum": 0
166
+ },
167
+ "securityBlockedRequests": {
168
+ "type": "integer",
169
+ "minimum": 0
170
+ },
171
+ "httpErrors": {
172
+ "type": "integer",
173
+ "minimum": 0
174
+ },
175
+ "bytes": {
176
+ "type": "integer",
177
+ "minimum": 0
178
+ },
179
+ "issueCount": {
180
+ "type": "integer",
181
+ "minimum": 0
182
+ },
183
+ "dropped": {
184
+ "type": "integer",
185
+ "minimum": 0
186
+ },
187
+ "issues": {
188
+ "type": "array",
189
+ "items": {
190
+ "$ref": "#/$defs/diagnostic"
191
+ }
192
+ }
193
+ },
194
+ "required": [
195
+ "requests",
196
+ "omittedRequests",
197
+ "responses",
198
+ "finished",
199
+ "failed",
200
+ "blocked",
201
+ "skippedRequests",
202
+ "failedRequests",
203
+ "securityBlockedRequests",
204
+ "httpErrors",
205
+ "bytes",
206
+ "issueCount",
207
+ "dropped",
208
+ "issues"
209
+ ]
210
+ },
211
+ "capture": {
212
+ "type": "object",
213
+ "properties": {
214
+ "complete": {
215
+ "type": "boolean"
216
+ },
217
+ "beforeConsentComplete": {
218
+ "type": "boolean"
219
+ },
220
+ "document": {
221
+ "type": "boolean"
222
+ },
223
+ "diagnostics": {
224
+ "$ref": "#/$defs/diagnostics"
225
+ }
226
+ },
227
+ "required": [
228
+ "complete",
229
+ "beforeConsentComplete",
230
+ "document",
231
+ "diagnostics"
232
+ ],
233
+ "allOf": [
234
+ {
235
+ "if": {
236
+ "properties": {
237
+ "complete": {
238
+ "const": true
239
+ }
240
+ },
241
+ "required": [
242
+ "complete"
243
+ ]
244
+ },
245
+ "then": {
246
+ "properties": {
247
+ "document": {
248
+ "const": true
249
+ },
250
+ "beforeConsentComplete": {
251
+ "const": true
252
+ },
253
+ "diagnostics": {
254
+ "type": "object",
255
+ "properties": {
256
+ "omittedRequests": {
257
+ "const": 0
258
+ },
259
+ "failed": {
260
+ "const": 0
261
+ },
262
+ "blocked": {
263
+ "const": 0
264
+ },
265
+ "skippedRequests": {
266
+ "const": 0
267
+ },
268
+ "failedRequests": {
269
+ "const": 0
270
+ },
271
+ "securityBlockedRequests": {
272
+ "const": 0
273
+ },
274
+ "httpErrors": {
275
+ "const": 0
276
+ },
277
+ "issueCount": {
278
+ "const": 0
279
+ },
280
+ "dropped": {
281
+ "const": 0
282
+ }
283
+ }
284
+ }
285
+ }
286
+ }
287
+ }
288
+ ]
289
+ },
290
+ "evaluation": {
291
+ "type": "object",
292
+ "properties": {
293
+ "pageId": {
294
+ "type": "string",
295
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
296
+ },
297
+ "ruleId": {
298
+ "type": "string"
299
+ },
300
+ "status": {
301
+ "type": "string",
302
+ "enum": [
303
+ "executed",
304
+ "skipped",
305
+ "not-evaluable"
306
+ ]
307
+ },
308
+ "reason": {
309
+ "type": "string",
310
+ "enum": [
311
+ "disabled",
312
+ "consent-disabled",
313
+ "not-start-page",
314
+ "missing-observation"
315
+ ]
316
+ },
317
+ "partial": {
318
+ "type": "boolean"
319
+ },
320
+ "outcome": {
321
+ "type": "string",
322
+ "enum": [
323
+ "checked-no-finding",
324
+ "finding-detected",
325
+ "not-evaluable"
326
+ ]
327
+ },
328
+ "explanation": {
329
+ "type": "string",
330
+ "enum": [
331
+ "disabled",
332
+ "not-start-page",
333
+ "consent-disabled",
334
+ "missing-reject-observation",
335
+ "missing-consent-observation",
336
+ "incomplete-document",
337
+ "positive-evidence",
338
+ "incomplete-observation",
339
+ "required-observations-available",
340
+ "no-supported-banner",
341
+ "no-supported-reject-control",
342
+ "unsupported-banner-markup",
343
+ "browser-interaction-failed",
344
+ "reject-clicked-and-reloaded"
345
+ ]
346
+ },
347
+ "findingCount": {
348
+ "type": "integer",
349
+ "minimum": 0
350
+ }
351
+ },
352
+ "required": [
353
+ "pageId",
354
+ "ruleId",
355
+ "status",
356
+ "partial",
357
+ "outcome",
358
+ "explanation",
359
+ "findingCount"
360
+ ],
361
+ "allOf": [
362
+ {
363
+ "if": {
364
+ "properties": {
365
+ "outcome": {
366
+ "const": "checked-no-finding"
367
+ }
368
+ },
369
+ "required": [
370
+ "outcome"
371
+ ]
372
+ },
373
+ "then": {
374
+ "properties": {
375
+ "findingCount": {
376
+ "const": 0
377
+ },
378
+ "partial": {
379
+ "const": false
380
+ },
381
+ "status": {
382
+ "const": "executed"
383
+ }
384
+ }
385
+ }
386
+ },
387
+ {
388
+ "if": {
389
+ "properties": {
390
+ "outcome": {
391
+ "const": "finding-detected"
392
+ }
393
+ },
394
+ "required": [
395
+ "outcome"
396
+ ]
397
+ },
398
+ "then": {
399
+ "properties": {
400
+ "findingCount": {
401
+ "type": "integer",
402
+ "minimum": 1
403
+ },
404
+ "status": {
405
+ "const": "executed"
406
+ }
407
+ }
408
+ }
409
+ }
410
+ ]
411
+ },
412
+ "page": {
413
+ "type": "object",
414
+ "properties": {
415
+ "pageId": {
416
+ "type": "string",
417
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
418
+ },
419
+ "url": {
420
+ "type": "string"
421
+ },
422
+ "finalUrl": {
423
+ "type": "string"
424
+ },
425
+ "status": {
426
+ "anyOf": [
427
+ {
428
+ "type": "integer",
429
+ "minimum": 100,
430
+ "maximum": 599
431
+ },
432
+ {
433
+ "type": "null"
434
+ }
435
+ ]
436
+ },
437
+ "requestCount": {
438
+ "type": "integer",
439
+ "minimum": 0
440
+ },
441
+ "cookieCount": {
442
+ "type": "integer",
443
+ "minimum": 0
444
+ },
445
+ "error": {
446
+ "type": "string"
447
+ },
448
+ "capture": {
449
+ "$ref": "#/$defs/capture"
450
+ },
451
+ "ruleEvaluations": {
452
+ "type": "array",
453
+ "items": {
454
+ "$ref": "#/$defs/evaluation"
455
+ }
456
+ }
457
+ },
458
+ "required": [
459
+ "pageId",
460
+ "url",
461
+ "finalUrl",
462
+ "status",
463
+ "requestCount",
464
+ "cookieCount",
465
+ "capture",
466
+ "ruleEvaluations"
467
+ ]
468
+ },
469
+ "finding": {
470
+ "type": "object",
471
+ "properties": {
472
+ "pageId": {
473
+ "type": "string",
474
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
475
+ },
476
+ "ruleId": {
477
+ "type": "string"
478
+ },
479
+ "severity": {
480
+ "type": "string",
481
+ "enum": [
482
+ "error",
483
+ "warning",
484
+ "info"
485
+ ]
486
+ },
487
+ "message": {
488
+ "type": "string"
489
+ },
490
+ "pageUrl": {
491
+ "type": "string"
492
+ },
493
+ "evidence": {
494
+ "type": "array",
495
+ "items": {
496
+ "type": "string"
497
+ }
498
+ },
499
+ "fix": {
500
+ "type": "string"
501
+ },
502
+ "subject": {
503
+ "type": "string"
504
+ },
505
+ "references": {
506
+ "type": "array",
507
+ "items": {
508
+ "type": "string"
509
+ }
510
+ },
511
+ "policy": {
512
+ "type": "object",
513
+ "properties": {
514
+ "allowed": {
515
+ "type": "boolean"
516
+ },
517
+ "originalSeverity": {
518
+ "type": "string",
519
+ "enum": [
520
+ "error",
521
+ "warning",
522
+ "info"
523
+ ]
524
+ }
525
+ },
526
+ "required": [
527
+ "allowed",
528
+ "originalSeverity"
529
+ ]
530
+ }
531
+ },
532
+ "required": [
533
+ "pageId",
534
+ "ruleId",
535
+ "severity",
536
+ "message",
537
+ "pageUrl",
538
+ "evidence"
539
+ ]
540
+ },
541
+ "consent": {
542
+ "type": "object",
543
+ "properties": {
544
+ "bannerFound": {
545
+ "type": "boolean"
546
+ },
547
+ "rejected": {
548
+ "type": "boolean"
549
+ },
550
+ "state": {
551
+ "type": "string",
552
+ "enum": [
553
+ "not-detected",
554
+ "reject-unavailable",
555
+ "interaction-failed",
556
+ "reject-tested"
557
+ ]
558
+ },
559
+ "outcome": {
560
+ "type": "string",
561
+ "enum": [
562
+ "no-banner-detected",
563
+ "unsupported-banner",
564
+ "interaction-failed",
565
+ "reject-succeeded"
566
+ ]
567
+ },
568
+ "reason": {
569
+ "type": "string",
570
+ "enum": [
571
+ "no-supported-banner",
572
+ "no-supported-reject-control",
573
+ "unsupported-banner-markup",
574
+ "browser-interaction-failed",
575
+ "reject-clicked-and-reloaded"
576
+ ]
577
+ },
578
+ "cmp": {
579
+ "type": "string"
580
+ },
581
+ "acceptLabel": {
582
+ "type": "string"
583
+ },
584
+ "rejectLabel": {
585
+ "type": "string"
586
+ },
587
+ "payOrOk": {
588
+ "type": "boolean"
589
+ },
590
+ "afterRejectComplete": {
591
+ "type": "boolean"
592
+ },
593
+ "error": {
594
+ "type": "string"
595
+ }
596
+ },
597
+ "required": [
598
+ "bannerFound",
599
+ "rejected",
600
+ "state",
601
+ "outcome",
602
+ "reason"
603
+ ]
604
+ },
605
+ "rule": {
606
+ "type": "object",
607
+ "properties": {
608
+ "id": {
609
+ "type": "string"
610
+ },
611
+ "title": {
612
+ "type": "string"
613
+ },
614
+ "description": {
615
+ "type": "string"
616
+ },
617
+ "references": {
618
+ "type": "array",
619
+ "items": {
620
+ "type": "string"
621
+ }
622
+ },
623
+ "requires": {
624
+ "type": "array",
625
+ "items": {
626
+ "type": "string",
627
+ "enum": [
628
+ "document",
629
+ "network",
630
+ "consent",
631
+ "after-reject"
632
+ ]
633
+ }
634
+ }
635
+ },
636
+ "required": [
637
+ "id",
638
+ "title",
639
+ "description",
640
+ "references"
641
+ ]
642
+ },
643
+ "networkLimits": {
644
+ "type": "object",
645
+ "properties": {
646
+ "concurrency": {
647
+ "type": "integer",
648
+ "minimum": 1
649
+ },
650
+ "maxRequests": {
651
+ "type": "integer",
652
+ "minimum": 1
653
+ },
654
+ "maxResponseBytes": {
655
+ "type": "integer",
656
+ "minimum": 1
657
+ },
658
+ "maxTotalBytes": {
659
+ "type": "integer",
660
+ "minimum": 1
661
+ },
662
+ "maxRedirects": {
663
+ "type": "integer",
664
+ "minimum": 0
665
+ },
666
+ "requestTimeoutMs": {
667
+ "type": "integer",
668
+ "minimum": 1
669
+ }
670
+ },
671
+ "required": [
672
+ "concurrency",
673
+ "maxRequests",
674
+ "maxResponseBytes",
675
+ "maxTotalBytes",
676
+ "maxRedirects",
677
+ "requestTimeoutMs"
678
+ ]
679
+ },
680
+ "options": {
681
+ "type": "object",
682
+ "properties": {
683
+ "maxPages": {
684
+ "type": "integer",
685
+ "minimum": 1
686
+ },
687
+ "settleMs": {
688
+ "type": "integer",
689
+ "minimum": 0
690
+ },
691
+ "timeoutMs": {
692
+ "type": "integer",
693
+ "minimum": 1
694
+ },
695
+ "locale": {
696
+ "type": "string"
697
+ },
698
+ "lang": {
699
+ "type": "string",
700
+ "enum": [
701
+ "en",
702
+ "de"
703
+ ]
704
+ },
705
+ "region": {
706
+ "type": "string",
707
+ "enum": [
708
+ "de",
709
+ "at",
710
+ "ch",
711
+ "eu"
712
+ ]
713
+ },
714
+ "consentCheck": {
715
+ "type": "boolean"
716
+ },
717
+ "headed": {
718
+ "type": "boolean"
719
+ },
720
+ "channel": {
721
+ "type": "string"
722
+ },
723
+ "captureTimeoutMs": {
724
+ "anyOf": [
725
+ {
726
+ "type": "integer",
727
+ "minimum": 1
728
+ },
729
+ {
730
+ "type": "null"
731
+ }
732
+ ]
733
+ },
734
+ "maxDiagnostics": {
735
+ "type": "integer",
736
+ "minimum": 0
737
+ },
738
+ "failureMode": {
739
+ "type": "string",
740
+ "enum": [
741
+ "throw",
742
+ "report"
743
+ ]
744
+ },
745
+ "captureMode": {
746
+ "type": "string",
747
+ "enum": [
748
+ "native",
749
+ "adapter",
750
+ "offline-fixture"
751
+ ]
752
+ },
753
+ "networkLimits": {
754
+ "anyOf": [
755
+ {
756
+ "$ref": "#/$defs/networkLimits"
757
+ },
758
+ {
759
+ "type": "null"
760
+ }
761
+ ]
762
+ },
763
+ "selectedRules": {
764
+ "type": "array",
765
+ "items": {
766
+ "type": "string"
767
+ },
768
+ "uniqueItems": true
769
+ },
770
+ "ruleSettings": {
771
+ "type": "object",
772
+ "additionalProperties": {
773
+ "type": "string",
774
+ "enum": [
775
+ "error",
776
+ "warning",
777
+ "info",
778
+ "off"
779
+ ]
780
+ }
781
+ },
782
+ "allowedVendors": {
783
+ "type": "array",
784
+ "items": {
785
+ "type": "string"
786
+ }
787
+ }
788
+ },
789
+ "required": [
790
+ "maxPages",
791
+ "settleMs",
792
+ "timeoutMs",
793
+ "locale",
794
+ "lang",
795
+ "region",
796
+ "consentCheck",
797
+ "headed",
798
+ "channel",
799
+ "captureTimeoutMs",
800
+ "maxDiagnostics",
801
+ "failureMode",
802
+ "captureMode",
803
+ "networkLimits",
804
+ "selectedRules",
805
+ "ruleSettings",
806
+ "allowedVendors"
807
+ ]
808
+ }
809
+ }
810
+ }