Skip to content

Commit

Permalink
[backend] Fix first seen / last seen update in playbook rules (#6322)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Mar 13, 2024
1 parent 14836ee commit 9468171
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,8 @@ const PLAYBOOK_RULE_COMPONENT: PlaybookComponent<RuleConfiguration> = {
const elementsToPatch = elements
.map((e: StixWithSeenDates) => {
// Check if seen dates will be impacted.
const isImpactedBefore = publicationDate.isBefore(e.first_seen ? utcDate(e.first_seen) : utcDate());
const isImpactedAfter = publicationDate.isAfter(e.last_seen ? utcDate(e.last_seen) : utcDate());
const isImpactedBefore = isEmptyField(e.first_seen) || publicationDate.isBefore(e.first_seen);
const isImpactedAfter = isEmptyField(e.last_seen) || publicationDate.isAfter(e.last_seen);
return { element: e, isImpactedBefore, isImpactedAfter };
})
.filter((data: SeenFilter) => {
Expand Down

0 comments on commit 9468171

Please sign in to comment.