Skip to content

Support for custom labels/descriptions in the Sensor model.Closes #1060#1086

Open
R1sh0bh-1 wants to merge 1 commit intointelowlproject:developfrom
R1sh0bh-1:feature/sensor-label-and-api-exposure
Open

Support for custom labels/descriptions in the Sensor model.Closes #1060#1086
R1sh0bh-1 wants to merge 1 commit intointelowlproject:developfrom
R1sh0bh-1:feature/sensor-label-and-api-exposure

Conversation

@R1sh0bh-1
Copy link
Contributor

@R1sh0bh-1 R1sh0bh-1 commented Mar 18, 2026

Description

This PR adds support for custom labels/descriptions in the Sensor model, allowing users to better identify and distinguish sensors (e.g., "Home Office Pi" vs "Cloud AWS-EU") when running multiple honeypots.

Related issues

Closes #1060

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 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.

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 docs. If so, I also created a pull request in the docs repository.
  • 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

  • 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.

Changes

Backend (Django)

  • Added an optional label field (CharField, max 128 chars) to the Sensor model (blank=True, default="") to avoid breaking the existing extraction pipeline.
  • Updated SensorsModelAdmin to include the label in the list view, allow inline editing, and support searching by label.
  • Created SensorSerializer and integrated it into IOCSerializer, so the sensors field now returns structured objects with addresses and labels.

Frontend (React)

  • Updated Feeds Table to include sensor address and label in the "Details" popover.
  • Updated Enrichment Lookup view to display all sensors detecting the IOC, including their labels.
  • Improved styling so labels appear in italics and muted text for better readability.

Tests & Quality

  • Verified with 778 backend tests and 119 frontend tests all passing.
  • Added integration tests for TableColumns and EnrichmentLookup to ensure correct rendering of new fields.
  • Fixed a data-type mismatch in tests/__init__.py where datetime objects were being passed to DateField.
  • Ensured full compliance with linters.

Verification

Everything has been tested end-to-end sensors auto-create correctly, labels are manageable in the admin, the API returns the expected nested data, and the UI displays everything consistently.

@regulartim, please let me know if everything looks correct or if there’s anything I should improve.

Copy link
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.

Hey @R1sh0bh-1 ! Looks good all in all! Please, in addition to my comments, resolve the merge conflicts.

raise serializers.ValidationError("Observable is not a valid IP address or domain")

try:
required_object = IOC.objects.prefetch_related("tags").get(name=observable)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should add "sensors" to the prefetch_related() call.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please provide a screenshot of the frontend changes?

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