Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,7 @@
"vulnerability_updated_desc": "The date the vulnerability record was last updated",
"vulnerability_vuln_id": "Vulnerability ID",
"vulnerability_vuln_id_desc": "The identifier which uniquely identifies this vulnerability within the same source",
"vulnerability_id_pattern_tooltip": "Use * as wildcard (e.g., CVE-2024-* or MAL-*) or regular expressions (e.g., ^CVE-202[34]-.*)",
"vulnerable": "Vulnerable",
"vulnerable_components": "Vulnerable Components",
"vulnerable_projects": "Vulnerable Projects",
Expand Down
13 changes: 12 additions & 1 deletion src/views/policy/PolicyCondition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ export default {
{ value: 'MATCHES', text: this.$t('operator.matches') },
{ value: 'NO_MATCH', text: this.$t('operator.no_match') },
],
objectAndRegexOperators: [
{ value: 'IS', text: this.$t('operator.is') },
{ value: 'IS_NOT', text: this.$t('operator.is_not') },
{ value: 'MATCHES', text: this.$t('operator.matches') },
{ value: 'NO_MATCH', text: this.$t('operator.no_match') },
],
numericOperators: [
{ value: 'NUMERIC_GREATER_THAN', text: '>' },
{ value: 'NUMERIC_LESS_THAN', text: '<' },
Expand Down Expand Up @@ -503,7 +509,7 @@ export default {
this.operators = this.listOperators;
break;
case 'VULNERABILITY_ID':
this.operators = this.objectOperators;
this.operators = this.objectAndRegexOperators;
break;
case 'VERSION_DISTANCE':
this.operators = this.numericOperators;
Expand Down Expand Up @@ -744,6 +750,11 @@ export default {
switch (this.subject) {
case 'AGE':
return this.$t('message.age_tooltip');
case 'VULNERABILITY_ID':
if (this.operator === 'MATCHES' || this.operator === 'NO_MATCH') {
return this.$t('message.vulnerability_id_pattern_tooltip');
}
return '';
default:
return '';
}
Expand Down