Skip to content

Attack wave samples#360

Merged
tudor-timcu merged 12 commits intomainfrom
attack-wave-samples
Dec 4, 2025
Merged

Attack wave samples#360
tudor-timcu merged 12 commits intomainfrom
attack-wave-samples

Conversation

@PopoviciMarian
Copy link
Copy Markdown
Contributor

No description provided.

@PopoviciMarian PopoviciMarian marked this pull request as ready for review December 2, 2025 15:48
// 5. If threshold exceeded: records the event time on the queue, logs the detection, and sends event to cloud
func updateAttackWaveCountsAndDetect(server *ServerData, isWebScanner bool, ip string, userId string, userAgent string) bool {
// 5. If threshold exceeded: records the event time on the queue, logs the detection, and sends event with samples to cloud
func updateAttackWaveCountsAndDetect(server *ServerData, isWebScanner bool, ip string, userId string, userAgent string, method string, url string) bool {
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.

Function updateAttackWaveCountsAndDetect now mixes attack detection, sample collection, and JSON serialization/metadata construction.

Details

🔧 How do I fix it?
Split classes that handle database, HTTP, and UI concerns into separate, focused classes.

More info - Comment @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.

// updateAttackWaveCountsAndDetect implements the attack wave detection logic:
// 1. Validates the request is from a web scanner and has a valid IP address
// 2. Increments the sliding window counter for this IP
// 2. Increments the sliding window counter for this IP and collects request samples
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.

Comment for step 2 in updateAttackWaveCountsAndDetect merely restates that the sliding window is incremented and samples are collected, which duplicates the code's mechanics.

Details

🔧 How do I fix it?
Write comments that explain the purpose, reasoning, or business logic behind the code using words like 'because', 'so that', or 'in order to'.

More info - Comment @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.

@tudor-timcu tudor-timcu merged commit 406ff86 into main Dec 4, 2025
115 checks passed
@tudor-timcu tudor-timcu deleted the attack-wave-samples branch December 4, 2025 14:56
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