feat: Add CleanBrowsing analyzer #3122
Open
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
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:
dnspythonorscapyto keep the build light.FREE_TO_USE_ANALYZERSplaybook.Changes
Analyzer
CleanBrowsingclass inapi_app/analyzers_manager/observable_analyzers/CleanBrowsing.py.Configuration
family,adult, orsecurityfilters.Testing
tests/api_app/analyzers_manager/observable_analyzers/test_CleanBrowsing.pycovering all routing paths and blocked/allowed scenarios._monkeypatch()method with binary mock responses for internal health checks.Migrations
0157_analyzer_config_cleanbrowsing.py).0060_playbook_config_free_to_use_analyzers.py).Status
intelowlproject/docs)Type of change
Checklist
develop.dumpplugincommand and added it in the project as a data migration.test_files.zipand you added the default tests for that mimetype intest_classes.py.FREE_TO_USE_ANALYZERSplaybook.urlthat contains this information. This is required for Health Checks (HEAD HTTP requests)._monkeypatch()was used in its class to apply the necessary decorators.MockUpResponseof the_monkeypatch()method.DataModelfor the new analyzer following the documentation.Proof of Concept
1. Screenshot
2. Analysis Result (JSON)
{ "report": { "is_blocked": true, "filter_used": "family", "status_code": 200, "raw_response_length": 103 } }