Skip to content

Commit 7d0a912

Browse files
authored
fix: Made it possible to have nullable spec and allowlists. Also enforced allowed reason types (#49)
1 parent f9d4fb5 commit 7d0a912

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

.github/workflows/code-scan.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,19 @@ jobs:
392392
'spec': {
393393
'type': 'dict',
394394
'required': True,
395+
'nullable': True,
395396
'schema': {
396397
'inherit': {'type': 'string', 'required' : False},
397398
'allowlist': {
398399
'required' : False,
400+
'nullable': True,
399401
'type': 'list',
400402
'schema': {
401403
'type': 'dict',
402404
'schema': {
403405
'cwe': {'type': 'string', 'required': True},
404406
'comment': {'type': 'string', 'required': True},
405-
'reason': {'type': 'string', 'required': True},
407+
'reason': {'type': 'string', 'required': True, 'allowed': ['false_positive', 'wont_fix', 'test']},
406408
},
407409
},
408410
},

.github/workflows/docker-scan.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,19 @@ jobs:
131131
'spec': {
132132
'type': 'dict',
133133
'required': True,
134+
'nullable': True,
134135
'schema': {
135136
'inherit': {'type': 'string', 'required': False},
136137
'allowlist': {
137138
'required': False,
139+
'nullable': True,
138140
'type': 'list',
139141
'schema': {
140142
'type': 'dict',
141143
'schema': {
142144
'cve': {'type': 'string', 'required': True},
143145
'comment': {'type': 'string', 'required': True},
144-
'reason': {'type': 'string', 'required': True},
146+
'reason': {'type': 'string', 'required': True, 'allowed': ['false_positive', 'wont_fix', 'test']},
145147
},
146148
},
147149
},

README-code-scan.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ The OPTIONAL `allowlist` field MUST be a list of vulnerabilities that you want t
138138
- The `cwe` field corresponds to the CWE-ID of the vulnerability you want to dismiss,
139139
- The `comment` field is a comment explaining why the vulnerability is dismissed.
140140
- The `reason` field MUST be one of the following types:
141-
- `false_positive`
142-
- `wont_fix`
143-
- `test`
141+
- `false_positive` This alert is not valid
142+
- `wont_fix` This alert is not relevant
143+
- `test` This alert is not in production code
144144

145145
*Note:* `inherit` and `allowlist` are NOT mutually exclusive. Any items in `allowlist` takes presedence over allowlist.
146146

README-docker-scan.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ The OPTIONAL `allowlist` field MUST be a list of vulnerabilities that you want t
147147
- The `cve` field corresponds to the CWE-ID of the vulnerability you want to dismiss,
148148
- The `comment` field is a comment explaining why the vulnerability is dismissed.
149149
- The `reason` field MUST be one of the following types:
150-
- `false_positive`
151-
- `wont_fix`
152-
- `test`
150+
- `false_positive` This alert is not valid
151+
- `wont_fix` This alert is not relevant
152+
- `test` This alert is not in production code
153153

154154
*Note:* `inherit` and `allowlist` are NOT mutually exclusive. Any items in `allowlist` takes presedence over allowlist.
155155

0 commit comments

Comments
 (0)