Skip to content

Commit b9e854b

Browse files
authored
Merge pull request #24 from SecureCodeWarrior/master
Added phrase support and updated dependencies
2 parents 4c9c202 + ec7e1e1 commit b9e854b

File tree

14 files changed

+1081
-471
lines changed

14 files changed

+1081
-471
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ jobs:
2424
with:
2525
inputSarifFile: ./fixtures/test002.sarif
2626
outputSarifFile: ./fixtures/test002.out.sarif
27+
githubToken: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This GitHub Action adds Secure Code Warrior contextual application security training material to SARIF files. This training material will be displayed within Code Scanning alerts if the resulting SARIF file is imported using the `github/codeql-action/upload-sarif` Action, and includes links to secure coding exercises and short explainer videos where available.
44

5-
This Action currently supports adding training material based on CWE references included in static analysis findings.
5+
This Action currently supports adding training material based on CWE references (e.g. CWE 89) and common vulnerability phrases (e.g. use-after-free vulnerability) included in static analysis findings.
66

77
## Usage
88

dist/index.js

Lines changed: 46 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fixtures/test005.sarif

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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": "Tool Name 3",
9+
"rules": [
10+
{
11+
"id": "TEST01 CWE-22",
12+
"name": "Test 01 rule name cwe: 23",
13+
"messageStrings": {
14+
"default": {
15+
"text": "This is the message text. It might be very long."
16+
}
17+
},
18+
"shortDescription": {
19+
"text": "SQL injection in some component"
20+
},
21+
"fullDescription": {
22+
"text": "There is a use-after-free vulnerability in there somewhere too"
23+
},
24+
"help": {
25+
"text": "some help text",
26+
"markdown": "markdown version some link [here](https://github.com)"
27+
},
28+
"properties": {
29+
"tags": [
30+
"Tag A",
31+
"cwE-24",
32+
"Tag B",
33+
"ssrF"
34+
]
35+
}
36+
}
37+
]
38+
}
39+
},
40+
"results": [
41+
{
42+
"ruleId": "TEST01",
43+
"level": "error",
44+
"message": {
45+
"text": "Result text. This result does not have a rule associated."
46+
},
47+
"locations": [
48+
{
49+
"physicalLocation": {
50+
"artifactLocation": {
51+
"uri": "app.js"
52+
},
53+
"region": {
54+
"startLine": 5,
55+
"startColumn": 4,
56+
"endColumn": 10
57+
}
58+
}
59+
}
60+
],
61+
"partialFingerprints": {
62+
"primaryLocationLineHash": "39fa2ee980eb94b0:1"
63+
}
64+
},
65+
{
66+
"ruleId": "TEST01",
67+
"level": "note",
68+
"message": {
69+
"text": "more different text."
70+
},
71+
"locations": [
72+
{
73+
"physicalLocation": {
74+
"artifactLocation": {
75+
"uri": "app.js"
76+
},
77+
"region": {
78+
"startLine": 15,
79+
"startColumn": 5,
80+
"endColumn": 8
81+
}
82+
}
83+
}
84+
],
85+
"partialFingerprints": {
86+
"primaryLocationLineHash": "39fa2ee980eb94d0:1"
87+
}
88+
}
89+
]
90+
}
91+
]
92+
}

0 commit comments

Comments
 (0)