Skip to content

Report firewall list hits in the heartbeat - #768

Open
iacobdaniel wants to merge 4 commits into
mainfrom
feat/firewall-list-breakdown
Open

iacobdaniel wants to merge 4 commits into
mainfrom
feat/firewall-list-breakdown

Conversation

@iacobdaniel

Copy link
Copy Markdown
Contributor

Count how many requests match each monitored and blocked IP list and each bot list, and send the counts as stats.ipAddresses.breakdown and stats.userAgents.breakdown. The counts are taken in the background process, where the firewall lists are checked.

Comment thread aikido_zen/background_process/commands/check_firewall_lists.py Outdated
Comment thread aikido_zen/background_process/cloud_connection_manager/update_firewall_lists.py Outdated
Comment thread aikido_zen/storage/statistics/__init__.py Outdated
reason = connection_manager.firewall_lists.is_blocked_ip(ip)
reason = firewall_lists.is_blocked_ip(ip)

statistics.on_ip_address_matches(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium - Malformed firewall metadata can fail open the blocking check

A firewall-list response containing an array/object as a list or user-agent detail key can reach the per-request matcher because the refresh accepts those keys without validation. The new breakdown update uses each key as a dictionary key before returning the block result, so the unhashable value raises in the background IPC handler and the request-side failure path treats the check as non-blocking. A remote request matching the affected IP or user-agent therefore proceeds despite an active global block rule.

Show fix

Validate list and user-agent detail keys as strings (and reject or skip malformed entries) before publishing them to the live firewall state; additionally keep statistics collection non-fatal to the block decision so a reporting error cannot suppress a deny result.

More info - Reply on this comment to give feedback or ignore the issue.

This branch has not been deployed

No deployments
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