Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event confidence #1655

Merged
merged 8 commits into from
Aug 16, 2024
Merged

Event confidence #1655

merged 8 commits into from
Aug 16, 2024

Conversation

TheTechromancer
Copy link
Collaborator

@TheTechromancer TheTechromancer commented Aug 12, 2024

This PR modifies event confidence to be a value between 1 and 100. It also adds a cumulative_confidence attribute which will take into consideration the confidence of parents.

E.g. an event with a confidence of 50, if its parent's confidence was also 50, would have a cumulative_confidence of 25.

# override the confidence (by default it's 100)
async def handle_event(self, event):
    await self.emit_event("evilcorp.com", "DNS_NAME", parent=event, confidence=90)

# filter out overly speculative events
async def filter_event(self, event):
    if event.cumulative_confidence < 50:
        return False, "Event's confidence is too low"
    return True

Addresses #1647.

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93%. Comparing base (4279621) to head (b59dfd9).
Report is 44 commits behind head on dev.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #1655   +/-   ##
=====================================
+ Coverage     93%     93%   +1%     
=====================================
  Files        341     341           
  Lines      25807   25885   +78     
=====================================
+ Hits       23782   23859   +77     
- Misses      2025    2026    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheTechromancer TheTechromancer merged commit 703d048 into dev Aug 16, 2024
8 checks passed
@TheTechromancer TheTechromancer deleted the event-confidence branch October 28, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants