Skip to content

Remove unused Log4pot from GeneralHoneypot. Closes #773#780

Merged
regulartim merged 2 commits intointelowlproject:developfrom
opbot-xd:fix/773-remove-unused-log4pot
Feb 5, 2026
Merged

Remove unused Log4pot from GeneralHoneypot. Closes #773#780
regulartim merged 2 commits intointelowlproject:developfrom
opbot-xd:fix/773-remove-unused-log4pot

Conversation

@opbot-xd
Copy link
Copy Markdown
Contributor

@opbot-xd opbot-xd commented Feb 5, 2026

Description

This PR fixes an issue where Log4pot appears as an active honeypot in the admin interface and dashboard, despite having no data and not being run on the attached T-Pot instance.

Root Cause: Migration 0030_migrate_cowrie_log4j.py creates Log4pot with active=True unconditionally, regardless of whether any IOC data exists.

Solution: Add a new data migration (0034_remove_unused_log4pot.py) that removes Log4pot from GeneralHoneypot if it has no associated IOCs. This is preferred over setting active=False because:

  • If a user later enables Log4Pot on their T-Pot instance, the extraction pipeline will automatically create the GeneralHoneypot entry when it encounters Log4pot data
  • No empty placeholder is needed

Related issues

Closes #773

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Checklist

  • I have read and understood the rules about how to Contribute to this project.
  • The pull request is for the branch develop.
  • I have added documentation of the new features. (in comments)
  • 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 (new and old ones) gave 0 errors.
  • If changes were made to an existing model/serializer/view, the docs were updated and regenerated (check CONTRIBUTE.md).
  • If the GUI has been modified:
    • I have a provided a screenshot of the result in the PR.
    • I have created new frontend tests for the new component or updated existing ones.

…roject#773)

- Add data migration 0034_remove_unused_log4pot to delete Log4pot
  entries that have no associated IOCs
- Migration 0030 created Log4pot with active=True unconditionally,
  causing empty honeypots to appear in admin/dashboard
- If user later enables Log4Pot on T-Pot, extraction pipeline will
  auto-create the entry when it encounters Log4pot data
- Add tests to verify Log4pot is deleted when unused and kept when
  it has IOCs
Copilot AI review requested due to automatic review settings February 5, 2026 12:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #773 where Log4pot appears as an active honeypot in the admin interface and dashboard despite having no data and not running on the attached T-Pot instance.

Changes:

  • Added a new data migration (0034_remove_unused_log4pot.py) that removes Log4pot from GeneralHoneypot if it has no associated IOCs
  • Added comprehensive tests covering both scenarios: Log4pot deletion when unused and preservation when it has IOCs

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
greedybear/migrations/0034_remove_unused_log4pot.py New data migration that removes unused Log4pot honeypot entries created unconditionally by migration 0030
tests/test_migrations.py Added TestRemoveUnusedLog4pot test class with two test methods validating the migration behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ception handling and rephrase previous migration reference.
@opbot-xd
Copy link
Copy Markdown
Contributor Author

opbot-xd commented Feb 5, 2026

hi @regulartim The PR is ready to review. Please review it when you get time.

Copy link
Copy Markdown
Collaborator

@regulartim regulartim left a comment

Choose a reason for hiding this comment

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

Very nice, thanks a lot! :)

@regulartim regulartim merged commit 298ee0d into intelowlproject:develop Feb 5, 2026
4 checks passed
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.

3 participants