Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocklist blocks scanning, not only reporting #585

Merged
merged 10 commits into from
Oct 18, 2023

Conversation

kazet
Copy link
Member

@kazet kazet commented Oct 18, 2023

No description provided.

Copy link
Collaborator

@bulkowy bulkowy left a comment

Choose a reason for hiding this comment

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

Generally, ok. But I would opt for putting blocklist in some form of DB with easy key retrieval. This would allow code to be simplified, eg blocklist_reports could use only one for loop, now it is really O(N*M)


for item in data:
# Assert there are no additional or missing keys
unexpected_keys = set(item.keys()) - {
Copy link
Collaborator

Choose a reason for hiding this comment

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

put differenced set as a variable, no need for it to be initialized every item

artemis/module_base.py Outdated Show resolved Hide resolved
else:
if should_block_scanning(domain=domain, ip=None, karton_name=self.identity, blocklist=self._blocklist):
return True
else:
Copy link
Collaborator

Choose a reason for hiding this comment

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

elif is_ip_address(host), and then delete assert below

bulkowy
bulkowy previously approved these changes Oct 18, 2023
@kazet kazet merged commit e28b2d6 into main Oct 18, 2023
@kazet kazet deleted the blocklist-scanning-not-reporting branch October 18, 2023 08:17
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