Skip to content

Commit

Permalink
[backend] inferred data always have the Rule Manager's confidence (#6093
Browse files Browse the repository at this point in the history
)
  • Loading branch information
labo-flg committed Feb 23, 2024
1 parent 7a75b3a commit b03e0b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions opencti-platform/opencti-graphql/src/database/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,9 @@ const createRuleDataPatch = (instance) => {
if (isBasicRelationship(instance.entity_type)) {
patch.i_inference_weight = weight;
}
// patch confidence is the Rule Manager's confidence
patch.confidence = RULE_MANAGER_USER.effective_confidence_level.max_confidence;

// list supported attributes [{name: string, operation: string}] by entity type
const supportedAttributes = RULES_ATTRIBUTES_BEHAVIOR.supportedAttributes(instance.entity_type);
for (let index = 0; index < supportedAttributes.length; index += 1) {
Expand Down
3 changes: 0 additions & 3 deletions opencti-platform/opencti-graphql/src/rules/rules-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const RULES_ATTRIBUTES_BEHAVIOR = {
return [
{ name: 'first_seen', operation: 'MIN' },
{ name: 'last_seen', operation: 'MAX' },
{ name: 'confidence', operation: 'AVG' },
{ name: 'attribute_count', operation: 'SUM' },
{ name: 'objectMarking', operation: 'AGG' },
];
Expand All @@ -25,15 +24,13 @@ export const RULES_ATTRIBUTES_BEHAVIOR = {
return [
{ name: 'start_time', operation: 'MIN' },
{ name: 'stop_time', operation: 'MAX' },
{ name: 'confidence', operation: 'AVG' },
{ name: 'objectMarking', operation: 'AGG' },
];
}
if (entityType === ENTITY_TYPE_INCIDENT) { // RuleSightingIncident
return [
{ name: 'first_seen', operation: 'MIN' },
{ name: 'last_seen', operation: 'MAX' },
{ name: 'confidence', operation: 'AVG' },
{ name: 'objectMarking', operation: 'AGG' },
];
}
Expand Down

0 comments on commit b03e0b0

Please sign in to comment.