Skip to content

Commit 71f3255

Browse files
authored
Merge pull request #83 from advanced-security/add-category-tags
Add category tags
2 parents ed701be + 5198358 commit 71f3255

13 files changed

+33222
-8476
lines changed

.eslintrc.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
"semi": "off",
4646
"@typescript-eslint/semi": ["error", "never"],
4747
"@typescript-eslint/type-annotation-spacing": "error",
48-
"@typescript-eslint/unbound-method": "error"
48+
"@typescript-eslint/unbound-method": "error",
49+
"no-shadow": "off",
50+
"@typescript-eslint/no-shadow": "warn"
4951
},
5052
"env": {
5153
"node": true,

.github/workflows/test.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: 'build-test'
2-
on: # rebuild any PRs and main branch changes
2+
3+
on:
34
pull_request:
45
push:
56
branches:
@@ -19,12 +20,22 @@ jobs:
1920
runs-on: ubuntu-latest
2021
steps:
2122
- uses: actions/checkout@v3
22-
- uses: ./
23+
- name: Run action
24+
uses: ./
2325
with:
2426
sarifFile: test-data/webgoat.sarif
25-
- run: grep -c '"owasp-top10-2021"' test-data/webgoat.sarif
27+
outputFile: test-data/webgoat-with-security-standard-tag.sarif
28+
- name: Check output
29+
run: |
30+
grep -c '"owasp-top10-2021"' test-data/webgoat-with-security-standard-tag.sarif
31+
diff test-data/webgoat-with-security-standard-tag.sarif test-data/webgoat-with-security-standard-tag.sarif.expected
32+
- name: Check error handling
33+
uses: ./
34+
continue-on-error: true
35+
with:
36+
sarifFile: test-data/webgoat1.sarif
2637
- name: Archive SARIF output
2738
uses: actions/upload-artifact@v3
2839
with:
2940
name: sarif-output
30-
path: test-data/webgoat.sarif
41+
path: test-data/webgoat-with-security-standard-tag.sarif

.vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"label": "Remove output SARIF file",
88
"type": "shell",
9-
"command": "rm ${workspaceFolder}/test-data/webgoat-with-security-standard-tag.sarif"
9+
"command": "rm -f ${workspaceFolder}/test-data/webgoat-with-security-standard-tag.sarif"
1010
},
1111
{
1212
"label": "Build & remove output SARIF file",

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Compare a CodeQL SARIF results file to a security standard CWE list and annotate the SARIF rules with a tag to highlight results applicable to the security standard
44

55
- Defaults to a comparison against the OWASP Top 10 2021 CWE mapping taken from https://cwe.mitre.org/data/xml/views/1344.xml.zip
6-
- Any XML file can be provided as an alternative, with the option to provide an XPath query that identifies the CWE ID values to use in the conparison
6+
- Any XML file can be provided as an alternative, with the option to provide an XPath query that identifies the CWE ID values to use in the comparison
77
- Tag value is configurable
88

99
This supports the ability to filter the Security dashboards by `tag`

design/requirements.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
### Requirements ###
22

33
* Input a SARIF file
4-
* Output a report detailing alerts that map to the OWASP Top 10 2021
5-
* And include alerts that are above a configurable (default high) severity rating that are not in the OWASP Top 10 2021.
4+
* Output a SARIF file with alerts tagged that map to the OWASP Top 10 2021
65
* Allow to be run as an Action
7-
8-
#### Stretch Goals ####
9-
10-
* Allow timestamping via online service using hash of report

0 commit comments

Comments
 (0)