-
Notifications
You must be signed in to change notification settings - Fork 9
AIK-6314 Attack Wave Detection & Stats #474
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
base: main
Are you sure you want to change the base?
Conversation
also renames wrongly named "query_params_contain_dangerous_payload"
…tack wave detector
aikido_zen/vulnerabilities/attack_wave_detection/attack_wave_detector.py
Outdated
Show resolved
Hide resolved
aikido_zen/background_process/cloud_connection_manager/on_detected_attack_wave.py
Show resolved
Hide resolved
aikido_zen/vulnerabilities/attack_wave_detection/is_web_scan_method.py
Outdated
Show resolved
Hide resolved
aikido_zen/vulnerabilities/attack_wave_detection/query_params_contain_dangerous_strings.py
Outdated
Show resolved
Hide resolved
aikido_zen/vulnerabilities/attack_wave_detection/is_web_scan_path.py
Outdated
Show resolved
Hide resolved
…cify it contains malicious HTTP methods for web scan detection. More info
| """This will send something to the API when an attack is detected""" | ||
| return on_detected_attack(self, attack, context, blocked, stack) | ||
|
|
||
| def on_detected_attack_wave(self, context: Context, metadata): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CloudConnectionManager class handles too many unrelated concerns: API communication, configuration, statistics, rate limiting, user management, and attack detection.
Feedback
Post a comment with the following structure to provide feedback on this finding:
@AikidoSec feedback: [FEEDBACK]
Aikido will process this feedback into learnings to give better review comments in the future.
More info
| extract_strings_from_user_input_cached, | ||
| ) | ||
|
|
||
| keywords = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable 'keywords' is too generic for a security context - should specify it contains malicious patterns for attack detection.
Feedback
Post a comment with the following structure to provide feedback on this finding:
@AikidoSec feedback: [FEEDBACK]
Aikido will process this feedback into learnings to give better review comments in the future.
More info
| time_to_live_in_ms=self.min_time_between_events, | ||
| ) | ||
|
|
||
| def is_attack_wave(self, ip: str) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Complex attack detection algorithm lacks explanatory comments about threshold logic and detection strategy.
Feedback
Post a comment with the following structure to provide feedback on this finding:
@AikidoSec feedback: [FEEDBACK]
Aikido will process this feedback into learnings to give better review comments in the future.
More info
| logger.debug("Exception occurred whilst setting body: %s", e) | ||
|
|
||
| def reset_cache(self): | ||
| self.parsed_userinput = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change?
| Set the current context | ||
| Set the current context, called every time we change the context. | ||
| """ | ||
| self.reset_cache() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best to extract
| # Check if the item is still valid based on TTL | ||
| if ( | ||
| get_unixtime_ms(monotonic=True) - self.cache[key]["startTime"] | ||
| internal_time.get_unixtime_ms(monotonic=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract this to another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is so we kan monkeypatch, doesnt change anything about the behaviour
| { | ||
| "aborted": 0, | ||
| "attacksDetected": {"blocked": 2, "total": 2}, | ||
| "attackWaves": {"total": 0, "blocked": 0}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e2e test might be nice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm rather rely on the qa tests here?
https://aikido.atlassian.net/browse/AIK-6314