Skip to content

Clarify Cowrie session retention. Closes #1854 - #1867

Merged
regulartim merged 3 commits into
GreedyBear-Project:developfrom
ABHIGYA0205:docs-cowrie-session-retention
Nov 18, 2026
Merged

regulartim merged 3 commits into
GreedyBear-Project:developfrom
ABHIGYA0205:docs-cowrie-session-retention

Conversation

@ABHIGYA0205

@ABHIGYA0205 ABHIGYA0205 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Clarify the COWRIE_SESSION_RETENTION behavior in documentation, comments, and logs so they accurately reflect that CleanUp only deletes Cowrie sessions with login attempts when they have no associated command sequence.

Changes

  • docker/env_file_template: Documented that sessions with login attempts and a command sequence are retained until the sequence expires or the source IOC is deleted.
  • greedybear/cronjobs/cleanup.py (CleanUp docstring): Updated step 5 to clarify that only sessions without associated commands are deleted after COWRIE_SESSION_RETENTION days.
  • greedybear/cronjobs/cleanup.py (CleanUp.run log): Updated the log message to specify "with login attempts and without associated commands". It was already correct , i only made it clearer.

Note - documentation change only

Related issues

Closes #1854

AI disclosure

Chatgpt helped me fixing the grammatical errors . No code written by LLM.

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Chore (refactoring, dependency updates, CI/CD changes, code cleanup, docs-only changes).

Checklist

Please complete this checklist carefully. It helps guide your contribution and lets maintainers verify that all requirements are met.

Formalities

  • I have read and understood the rules about how to Contribute to this project.
  • I have read and understood the AI policy.
  • I chose an appropriate title for the pull request in the form: <feature name>. Closes #999
  • My branch is based on develop.
  • The pull request is for the branch develop.
  • I have reviewed and verified any LLM-generated code included in this PR.
  • I am interested in participating in GSoC.

Docs and tests

  • I documented my code changes with docstrings and/or comments.
  • I have checked if my changes affect user-facing behavior that is described in the wiki. If so, I also included an update to the wiki in the description of this PR.
  • Linter (Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved.
  • All the tests gave 0 errors.

GUI changes

Ignore this section if you did not make any changes to the GUI.

  • I have provided a screenshot of the result in the PR.
  • I have created new frontend tests for the new component or updated existing ones.

Review process

  • We encourage you to create a draft PR first, even when your changes are incomplete. This way you refine your code while we can track your progress and actively review and help.
  • If you think your draft PR is ready to be reviewed by the maintainers, click the corresponding button. Your draft PR will become a real PR.
  • If your changes decrease the overall tests coverage (you will know after the Codecov CI job is done), you should add the required tests to fix the problem.
  • Every time you make changes to the PR and you think the work is done, you should explicitly ask for a review. After receiving a "change request", address the feedback and click "request re-review" next to the reviewer's profile picture at the top right.

@regulartim regulartim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ABHIGYA0205 ! Good improvement. Only found a nit.

Comment thread greedybear/cronjobs/cleanup.py Outdated
self.log.info(f"{n} objects deleted")

self.log.info(f"deleting all Cowrie sessions without associated commands older then {COWRIE_SESSION_RETENTION} days")
self.log.info(f"deleting all Cowrie sessions with login attempts and without associated commands older then {COWRIE_SESSION_RETENTION} days")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I know what you wanted to say here, but I think the old wording was fine, no? The query doesn't filter on login_attempt. It only matches in practice because step 4 already removed sessions with no login attempts after 30 days. So I think I would prefer if you would revert this line to its previous version. Or am I wrong here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes , you are right , i reverted this line to the previous one :)

@regulartim regulartim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! :)

@regulartim
regulartim marked this pull request as ready for review November 18, 2026 15:05
@regulartim
regulartim merged commit 407fc1d into GreedyBear-Project:develop Nov 18, 2026
7 checks passed
@ABHIGYA0205
ABHIGYA0205 deleted the docs-cowrie-session-retention branch November 18, 2026 15:14
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