Skip to content

Conversation

@bitterpanda63
Copy link
Member

@bitterpanda63 bitterpanda63 self-assigned this Sep 10, 2025
"""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):
Copy link

@aikido-pr-checks aikido-pr-checks bot Oct 8, 2025

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 = {
Copy link

@aikido-pr-checks aikido-pr-checks bot Oct 8, 2025

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:
Copy link

@aikido-pr-checks aikido-pr-checks bot Oct 8, 2025

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 = {}
Copy link
Member

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()
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated change?

Copy link
Member Author

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)
Copy link
Member

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?

Copy link
Member Author

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},
Copy link
Member

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?

Copy link
Member Author

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?

@bitterpanda63 bitterpanda63 marked this pull request as draft October 14, 2025 19:51
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