Skip to content

Commit 2c2f73c

Browse files
authored
Merge pull request #184 from sahibamittal/Issue-1768-policy-cwe-condition
Issue-1768: policy condition cwe
2 parents 6778394 + e4c9432 commit 2c2f73c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/i18n/locales/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"name": "Name",
6060
"published": "Published",
6161
"cwe": "CWE",
62+
"cwe_full": "Common Weakness Enumeration (CWE)",
6263
"cwe_id": "CWE ID",
6364
"cwe_desc": "Common Weakness Enumeration (CWE) is a taxonomy of software and hardware weakness types",
6465
"select_cwe": "Select CWE",
@@ -547,7 +548,9 @@
547548
"is": "is",
548549
"is_not": "is not",
549550
"matches": "matches",
550-
"no_match": "does not match"
551+
"no_match": "does not match",
552+
"contains_any": "contains any",
553+
"contains_all": "contains all"
551554
},
552555
"policy_violation": {
553556
"fails": "Violation Failures",

src/views/policy/PolicyCondition.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
{value: 'PACKAGE_URL', text: this.$t('message.package_url')},
7474
{value: 'CPE', text: this.$t('message.cpe_full')},
7575
{value: 'SWID_TAGID', text: this.$t('message.swid_tagid')},
76-
{value: 'VERSION', text: this.$t('message.version')}
76+
{value: 'VERSION', text: this.$t('message.version')},
77+
{value: 'CWE', text: this.$t('message.cwe_full')}
7778
],
7879
objectOperators: [
7980
{value: 'IS', text: this.$t('operator.is')},
@@ -91,6 +92,10 @@
9192
{value: 'NUMERIC_GREATER_THAN_OR_EQUAL', text: ''},
9293
{value: 'NUMERIC_LESSER_THAN_OR_EQUAL', text: ''}
9394
],
95+
listOperators: [
96+
{value: 'CONTAINS_ANY', text: this.$t('operator.contains_any')},
97+
{value: 'CONTAINS_ALL', text: this.$t('operator.contains_all')}
98+
],
9499
operators: [],
95100
possibleValues: []
96101
}
@@ -120,6 +125,8 @@
120125
return false;
121126
case 'VERSION':
122127
return false;
128+
case 'CWE':
129+
return false;
123130
default:
124131
return false;
125132
}
@@ -174,6 +181,9 @@
174181
case 'VERSION':
175182
this.operators = this.numericOperators;
176183
break;
184+
case 'CWE':
185+
this.operators = this.listOperators;
186+
break;
177187
default:
178188
this.operators = [];
179189
}

0 commit comments

Comments
 (0)