Skip to content

Conversation

@Kautuk-Adarsh
Copy link

@Kautuk-Adarsh Kautuk-Adarsh commented Dec 17, 2025

Description

Implements a new analyzer for CleanBrowsing DNS.

This analyzer allows users to check if a domain is blocked by CleanBrowsing's content filters. It supports the Family (default), Adult, and Security filters.

Key Technical Details:

  • Privacy-First: Uses DNS-over-HTTPS (DoH) to query the CleanBrowsing API securely.
  • Zero Dependencies: Manually constructs RFC 8484 Binary DNS packets, avoiding heavy external libraries like dnspython or scapy to keep the build light.
  • Custom Parsing: Implements manual binary parsing to detect RCODE 3 (NXDOMAIN), which CleanBrowsing uses to indicate a blocked domain.
  • Integration: Fully integrated into the FREE_TO_USE_ANALYZERS playbook.

Changes

Analyzer

  • Added CleanBrowsing class in api_app/analyzers_manager/observable_analyzers/CleanBrowsing.py.

Configuration

  • Added options to choose between family, adult, or security filters.

Testing

  • Added comprehensive unit tests in tests/api_app/analyzers_manager/observable_analyzers/test_CleanBrowsing.py covering all routing paths and blocked/allowed scenarios.
  • Implemented _monkeypatch() method with binary mock responses for internal health checks.

Migrations

  • Added Analyzer registration migration (0157_analyzer_config_cleanbrowsing.py).
  • Added Playbook update migration (0060_playbook_config_free_to_use_analyzers.py).

Status

  • Core Logic Implemented
  • Copyright Headers added
  • Tests / Monkeypatching
  • Plugin Registration (Data Migration)
  • Documentation (Will open separate PR to intelowlproject/docs)

Type of change

  • New feature (non-breaking change which adds functionality).

Checklist

  • I have read and understood the rules about how to Contribute to this project.
  • The pull request is for the branch develop.
  • A new plugin (analyzer, connector, visualizer, playbook, pivot or ingestor) was added or changed, in which case:
    • I strictly followed the documentation "How to create a Plugin".
    • Usage file was updated. A link to the PR to the docs repo has been added as a comment here.
    • Advanced-Usage was updated (in case the plugin provides additional optional configuration). A link to the PR to the docs repo has been added as a comment here.
    • I have dumped the configuration from Django Admin using the dumpplugin command and added it in the project as a data migration.
  • If a File analyzer was added and it supports a mimetype which is not already supported, you added a sample of that type inside the archive test_files.zip and you added the default tests for that mimetype in test_classes.py.
  • If you created a new analyzer and it is free (does not require any API key), please add it in the FREE_TO_USE_ANALYZERS playbook.
  • Check if it could make sense to add that analyzer/connector to other freely available playbooks.
  • I have provided the resulting raw JSON of a finished analysis and a screenshot of the results.
  • If the plugin interacts with an external service, I have created an attribute called precisely url that contains this information. This is required for Health Checks (HEAD HTTP requests).
  • If the plugin requires mocked testing, _monkeypatch() was used in its class to apply the necessary decorators.
  • I have added that raw JSON sample to the MockUpResponse of the _monkeypatch() method.
  • I have created the corresponding DataModel for the new analyzer following the documentation.
  • I have inserted the copyright banner at the start of the file:

    # This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl
    # See the file 'LICENSE' for copying permission.

  • Please avoid adding new libraries as requirements whenever it is possible.
  • If external libraries/packages with restrictive licenses were added, they were added in the Legal Notice section.
  • Linters (Black, Flake, Isort) gave 0 errors.
  • I have added tests for the feature/bug I solved. All the tests (new and old ones) gave 0 errors.
  • 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.
  • After you had submitted the PR, if DeepSource, Django Doctors or other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.

Proof of Concept

1. Screenshot

image

2. Analysis Result (JSON)

{
  "report": {
    "is_blocked": true,
    "filter_used": "family",
    "status_code": 200,
    "raw_response_length": 103
  }
}

@Kautuk-Adarsh Kautuk-Adarsh marked this pull request as ready for review December 20, 2025 15:37
@Kautuk-Adarsh
Copy link
Author

Regarding the Documentation and Next Steps:

I have left the Documentation checklist items unchecked for now. I am currently drafting the updates and will submit a separate PR to the intelowlproject/docs repository shortly to keep this PR focused on the code and logic.

Additionally, regarding the Data Model, I have utilized the dynamic dictionary approach and generated the necessary migration using dumpplugin. If a strict DataModel class is preferred for this analyzer, please let me know and I will add it!

Copy link
Contributor

@fgibertoni fgibertoni left a comment

Choose a reason for hiding this comment

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

Hey @Kautuk-Adarsh, thanks for your contribution! Before review there are still some details of the checklist that should be addressed, like linters. I'd also prefer to keep file name consistent with the rest of the analyzers. Also, I think the migration for adding the analyzer to free to use can be strongly simplified; you can take a look at other similar migrations for this purpose.
Can you please take a look?

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