Repository navigation
Document that include_similar is not bounded by the date window. Closes #1729 - #1811
Merged
regulartim merged 1 commit intoNov 3, 2026
Conversation
GreedyBear-Project#1729 The cluster expansion in the Cowrie session view deliberately ignores start_date and end_date, but nothing said so. The help text for include_similar now states it, and both date fields point back at the exception, so it is visible from either side of the API docs. Because commands, sources and credentials are aggregated after the expansion, out-of-window data reaches them too, even without include_session_data. The help text says that as well. Three tests pin the behaviour, which the suite did not cover before: the expansion crossing the window, the aggregated fields crossing it, and an empty window staying empty because the expansion has no in-window session to take its clusters from. No behaviour change.
regulartim
approved these changes
Nov 3, 2026
regulartim
left a comment
Member
There was a problem hiding this comment.
Hey @dev-aditya-hub ! Nice and small fix, thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In #1729 I reported that
include_similarreturns sessions from outsidestart_date/end_date. regulartim said this is on purpose and was chosen in #1515. So this PR does not change any behaviour, it only documents it and adds the missing tests.api/views/cowrie_session.pyis untouched.What I changed in
api/serializers/cowrie_session.py:include_similarnow says the sessions it adds are not bounded by the date window.start_dateandend_datenow say the window does not apply to sessions added byinclude_similar, so you can see it from both sides of the docs.You wrote the sentence about the
sessionsarray. I made it a little wider, becausecommands,sourcesandcredentialsare built after the union atcowrie_session.py:111-127, so they also get data from outside the window. If you prefer your shorter sentence, I will cut it back.What I added in
tests/api/views/test_cowrie_session_view.py(the suite tested the date window andinclude_similarseparately, never together):01-15..01-25withinclude_similarreturns all three cluster sessions (01-10, 01-20, 01-30).commands,sourcesandcredentials.How I verified:
ruff check,ruff format --checkandty check: clean.Related issues
Closes #1729. The date window itself comes from #1515 and PR #1621.
Wiki
The Cowrie Session API section in
Usage.mddoes not documentstart_date/end_dateat all, so there is no place there yet to put this note. Tell me if you want me to add those parameters plus one line aboutinclude_similar, and I will write it the way you want.Type of change
Checklist
Formalities
<feature name>. Closes #999develop.develop.Docs and tests
Ruff) gave 0 errors.GUI changes
No GUI changes.