Repository navigation
Stamp queued events with the time they were built #736
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,6 @@ | |||||||||||||||||||||||
| from aikido_zen.storage.hostnames import Hostnames | ||||||||||||||||||||||||
| from ..realtime.start_polling_for_changes import start_polling_for_changes | ||||||||||||||||||||||||
| from ..realtime.listen_for_config_updates import listen_for_config_updates | ||||||||||||||||||||||||
| from ...helpers.get_current_unixtime_ms import get_unixtime_ms | ||||||||||||||||||||||||
| from ...storage.ai_statistics import AIStatistics | ||||||||||||||||||||||||
| from ...storage.firewall_lists import FirewallLists | ||||||||||||||||||||||||
| from ...storage.statistics import Statistics | ||||||||||||||||||||||||
|
|
@@ -88,10 +87,7 @@ def report_api_event(self, event): | |||||||||||||||||||||||
| if not self.token: | ||||||||||||||||||||||||
| return {"success": False, "error": "invalid_token"} | ||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||
| payload = { | ||||||||||||||||||||||||
| "time": get_unixtime_ms(), | ||||||||||||||||||||||||
| "agent": get_manager_info(self), | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| payload = {"agent": get_manager_info(self)} | ||||||||||||||||||||||||
| payload.update(event) # Merge default fields with event fields | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| result = self.api.report(self.token, payload, self.timeout_in_sec) | ||||||||||||||||||||||||
|
Comment on lines
+90
to
93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium - A missing timestamp poisons the attack-event rate limiter A local process can submit two Show fix
Suggested change
More info - Reply on this comment to give feedback or ignore the issue.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not relevant
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 We were not able to ignore this issue because of the following reason:
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the default
timechanges reports without an event-supplied timestamp; events with an explicit creation time already override the default duringpayload.update(event).Details
✨ AI Reasoning
The intended behavior is to record event creation time for selected events. Those events already include a time field, and merging them into the payload replaces the default send-time value. Removing the default therefore changes behavior for reports that do not supply their own time, without being needed for the intended change.
🔧 How do I fix it?
Limit the change to what's needed to achieve its intent. Avoid bundling unrelated reformatting or refactoring, and don't rewrite code that didn't need to change.
Reply on this comment to give feedback or ignore the issue.
More info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All five event types now set their own time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔ You don't have permission to ignore issues.