@fabasoad/sarif-to-slack 0.1.1 → 0.2.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 (99) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  2. package/.github/pull_request_template.md +3 -3
  3. package/.github/workflows/linting.yml +14 -0
  4. package/.github/workflows/release.yml +5 -1
  5. package/.github/workflows/send-sarif-to-slack.yml +214 -0
  6. package/.github/workflows/unit-tests.yml +1 -0
  7. package/.pre-commit-config.yaml +3 -3
  8. package/.tool-versions +1 -1
  9. package/CONTRIBUTING.md +1 -1
  10. package/Makefile +10 -3
  11. package/README.md +36 -5
  12. package/biome.json +15 -12
  13. package/dist/Logger.js +17 -6
  14. package/dist/Processors.js +23 -22
  15. package/dist/SarifToSlackService.d.ts.map +1 -1
  16. package/dist/SarifToSlackService.js +6 -7
  17. package/dist/SlackMessageBuilder.js +51 -55
  18. package/dist/index.d.ts +9 -4
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +10 -5
  21. package/dist/model/SarifModelPerRun.d.ts +17 -0
  22. package/dist/model/SarifModelPerRun.d.ts.map +1 -0
  23. package/dist/model/SarifModelPerRun.js +84 -0
  24. package/dist/model/SarifModelPerSarif.d.ts +20 -0
  25. package/dist/model/SarifModelPerSarif.d.ts.map +1 -0
  26. package/dist/model/SarifModelPerSarif.js +97 -0
  27. package/dist/model/types.d.ts +17 -0
  28. package/dist/model/types.d.ts.map +1 -0
  29. package/dist/model/types.js +31 -0
  30. package/dist/sarif-to-slack.d.ts +121 -18
  31. package/dist/tsdoc-metadata.json +1 -1
  32. package/dist/types.d.ts +107 -15
  33. package/dist/types.d.ts.map +1 -1
  34. package/dist/types.js +73 -7
  35. package/dist/utils/SarifUtils.d.ts +5 -0
  36. package/dist/utils/SarifUtils.d.ts.map +1 -0
  37. package/dist/utils/SarifUtils.js +32 -0
  38. package/dist/utils/SortUtils.d.ts +5 -0
  39. package/dist/utils/SortUtils.d.ts.map +1 -0
  40. package/dist/utils/SortUtils.js +8 -0
  41. package/dist/version.d.ts +2 -0
  42. package/dist/version.d.ts.map +1 -0
  43. package/dist/version.js +4 -0
  44. package/etc/sarif-to-slack.api.md +47 -9
  45. package/jest.config.json +4 -4
  46. package/package.json +14 -10
  47. package/scripts/save-version.sh +6 -0
  48. package/src/Logger.ts +22 -17
  49. package/src/Processors.ts +22 -22
  50. package/src/SarifToSlackService.ts +6 -7
  51. package/src/SlackMessageBuilder.ts +85 -68
  52. package/src/index.ts +17 -6
  53. package/src/model/SarifModelPerRun.ts +114 -0
  54. package/src/model/SarifModelPerSarif.ts +116 -0
  55. package/src/model/types.ts +31 -0
  56. package/src/types.ts +113 -15
  57. package/src/utils/SarifUtils.ts +44 -0
  58. package/src/utils/SortUtils.ts +21 -0
  59. package/src/version.ts +3 -0
  60. package/test-data/sarif/codeql-csharp.sarif +1 -0
  61. package/test-data/sarif/codeql-go.sarif +1 -0
  62. package/test-data/sarif/codeql-python.sarif +1 -0
  63. package/test-data/sarif/codeql-ruby.sarif +1 -0
  64. package/test-data/sarif/codeql-typescript.sarif +1 -0
  65. package/test-data/sarif/grype-container.sarif +1774 -0
  66. package/test-data/sarif/runs-1-tools-1-results-0.sarif +18 -0
  67. package/test-data/sarif/runs-2-tools-1-results-0.sarif +30 -0
  68. package/test-data/sarif/runs-2-tools-1.sarif +656 -0
  69. package/test-data/sarif/runs-2-tools-2-results-0.sarif +44 -0
  70. package/test-data/sarif/runs-2-tools-2.sarif +686 -0
  71. package/test-data/sarif/runs-3-tools-2-results-0.sarif +48 -0
  72. package/test-data/sarif/runs-3-tools-2.sarif +278 -0
  73. package/test-data/sarif/snyk-composer.sarif +934 -0
  74. package/test-data/sarif/snyk-container.sarif +313 -0
  75. package/test-data/sarif/snyk-gomodules.sarif +388 -0
  76. package/test-data/sarif/snyk-gradle.sarif +274 -0
  77. package/test-data/sarif/snyk-hex.sarif +66 -0
  78. package/test-data/sarif/snyk-maven.sarif +274 -0
  79. package/test-data/sarif/snyk-npm.sarif +896 -0
  80. package/test-data/sarif/snyk-nuget.sarif +90 -0
  81. package/test-data/sarif/snyk-pip.sarif +66 -0
  82. package/test-data/sarif/snyk-pnpm.sarif +90 -0
  83. package/test-data/sarif/snyk-poetry.sarif +1952 -0
  84. package/test-data/sarif/snyk-rubygems.sarif +440 -0
  85. package/test-data/sarif/snyk-sbt.sarif +178 -0
  86. package/test-data/sarif/snyk-swift.sarif +112 -0
  87. package/test-data/sarif/snyk-yarn.sarif +2900 -0
  88. package/test-data/sarif/trivy-iac.sarif +134 -0
  89. package/test-data/sarif/wiz-container.sarif +30916 -0
  90. package/test-data/sarif/wiz-iac.sarif +558 -0
  91. package/tests/Processors.spec.ts +3 -3
  92. package/tests/integration/SendSarifToSlack.spec.ts +56 -0
  93. package/tsconfig.json +14 -14
  94. package/dist/Logger.js.map +0 -1
  95. package/dist/Processors.js.map +0 -1
  96. package/dist/SarifToSlackService.js.map +0 -1
  97. package/dist/SlackMessageBuilder.js.map +0 -1
  98. package/dist/index.js.map +0 -1
  99. package/dist/types.js.map +0 -1
@@ -0,0 +1,112 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
3
+ "version": "2.1.0",
4
+ "runs": [
5
+ {
6
+ "tool": {
7
+ "driver": {
8
+ "name": "Snyk Open Source",
9
+ "properties": {
10
+ "artifactsScanned": 21
11
+ },
12
+ "rules": [
13
+ {
14
+ "id": "SNYK-SWIFT-VAPORVAPOR-5950373",
15
+ "shortDescription": {
16
+ "text": "Medium severity - Improper Handling of Exceptional Conditions vulnerability in github.com/vapor/vapor"
17
+ },
18
+ "fullDescription": {
19
+ "text": "(CVE-2023-44386) github.com/vapor/vapor@4.83.2"
20
+ },
21
+ "help": {
22
+ "text": "",
23
+ "markdown": "* Package Manager: swift\n* Vulnerable module: github.com/vapor/vapor\n* Introduced through: MyProject@unspecified and github.com/vapor/vapor@4.83.2\n### Detailed paths\n* _Introduced through_: MyProject@unspecified › github.com/vapor/vapor@4.83.2\n# Overview\n[vapor/vapor](https://github.com/vapor/vapor) is an a server-side Swift HTTP web framework.\n\nAffected versions of this package are vulnerable to Improper Handling of Exceptional Conditions due to the incorrect handling of `HTTP 1.x` request parsing errors, an attacker can trigger a precondition failure in `swift-nio` by misusing the API, causing an immediate termination of the server process.\n# Remediation\nUpgrade `vapor/vapor` to version 4.84.2 or higher.\n# References\n- [GitHub Commit](https://github.com/vapor/vapor/commit/090464a654b03148b139a81f8f5ac63b0856f6f3)\n- [GitHub Release](https://github.com/vapor/vapor/releases/tag/4.84.2)\n"
24
+ },
25
+ "properties": {
26
+ "tags": [
27
+ "security",
28
+ "CWE-231",
29
+ "swift"
30
+ ],
31
+ "cvssv3_baseScore": 5.3,
32
+ "security-severity": "5.3"
33
+ }
34
+ },
35
+ {
36
+ "id": "SNYK-SWIFT-VAPORVAPOR-6143589",
37
+ "shortDescription": {
38
+ "text": "Medium severity - Integer Overflow or Wraparound vulnerability in github.com/vapor/vapor"
39
+ },
40
+ "fullDescription": {
41
+ "text": "(CVE-2024-21631) github.com/vapor/vapor@4.83.2"
42
+ },
43
+ "help": {
44
+ "text": "",
45
+ "markdown": "* Package Manager: swift\n* Vulnerable module: github.com/vapor/vapor\n* Introduced through: MyProject@unspecified and github.com/vapor/vapor@4.83.2\n### Detailed paths\n* _Introduced through_: MyProject@unspecified › github.com/vapor/vapor@4.83.2\n# Overview\n[vapor/vapor](https://github.com/vapor/vapor) is an a server-side Swift HTTP web framework.\n\nAffected versions of this package are vulnerable to Integer Overflow or Wraparound in the `vapor_urlparser_parse` function. An attacker can spoof the host by padding the port number with zeros, causing an integer overflow when the URL authority is parsed.\n# Remediation\nUpgrade `vapor/vapor` to version 4.90.0 or higher.\n# References\n- [GitHub Commit](https://github.com/vapor/vapor/commit/6db3d917b5ce5024a84eb265ef65691383305d70)\n"
46
+ },
47
+ "properties": {
48
+ "tags": [
49
+ "security",
50
+ "CWE-1104",
51
+ "swift"
52
+ ],
53
+ "cvssv3_baseScore": 6.5,
54
+ "security-severity": "6.5"
55
+ }
56
+ }
57
+ ]
58
+ }
59
+ },
60
+ "results": [
61
+ {
62
+ "ruleId": "SNYK-SWIFT-VAPORVAPOR-5950373",
63
+ "level": "warning",
64
+ "message": {
65
+ "text": "This file introduces a vulnerable github.com/vapor/vapor package with a medium severity vulnerability."
66
+ },
67
+ "locations": [
68
+ {
69
+ "physicalLocation": {
70
+ "artifactLocation": {
71
+ "uri": "./Package.swift"
72
+ },
73
+ "region": {
74
+ "startLine": 1
75
+ }
76
+ },
77
+ "logicalLocations": [
78
+ {
79
+ "fullyQualifiedName": "github.com/vapor/vapor@4.83.2"
80
+ }
81
+ ]
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ "ruleId": "SNYK-SWIFT-VAPORVAPOR-6143589",
87
+ "level": "warning",
88
+ "message": {
89
+ "text": "This file introduces a vulnerable github.com/vapor/vapor package with a medium severity vulnerability."
90
+ },
91
+ "locations": [
92
+ {
93
+ "physicalLocation": {
94
+ "artifactLocation": {
95
+ "uri": "./Package.swift"
96
+ },
97
+ "region": {
98
+ "startLine": 1
99
+ }
100
+ },
101
+ "logicalLocations": [
102
+ {
103
+ "fullyQualifiedName": "github.com/vapor/vapor@4.83.2"
104
+ }
105
+ ]
106
+ }
107
+ ]
108
+ }
109
+ ]
110
+ }
111
+ ]
112
+ }