Skip to content

Align HTTP timeouts with other agents - #372

Draft
hansott wants to merge 1 commit into
mainfrom
increase-cloud-timeouts
Draft

hansott wants to merge 1 commit into
mainfrom
increase-cloud-timeouts

Conversation

@hansott

@hansott hansott commented Oct 7, 2026

Copy link
Copy Markdown
Member

No description provided.


public class BackgroundProcess extends Thread {
private static final int API_TIMEOUT = 10; // 10 seconds
private static final int API_TIMEOUT = 30; // 30 seconds

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium - Startup now leaves cloud firewall controls uninitialized for up to 60 seconds

When the Aikido API is slow or unreachable as the instrumented application starts, the background thread waits up to 30 seconds for the startup event and then up to another 30 seconds for blocked lists before scheduling the remaining work. The application is already instrumented and serving requests during these synchronous calls, while the local configuration starts with no cloud-provided lists or endpoints, so requests can pass IP, user-agent, and endpoint controls for up to roughly 60 seconds instead of the previous roughly 20-second window.

Suggested change
private static final int API_TIMEOUT = 30; // 30 seconds
private static final int API_TIMEOUT = 10; // 10 seconds

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

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hansott
hansott force-pushed the increase-cloud-timeouts branch from 7202147 to b5e8cad Compare October 7, 2026 12:06
@hansott
hansott force-pushed the increase-cloud-timeouts branch 2 times, most recently from d2a388c to 20a8c94 Compare October 19, 2026 13:42
@hansott hansott changed the title Increase timeout to 30s for API calls (align with other agents) Align HTTP timeouts with other agents Oct 19, 2026
@hansott
hansott added this pull request to stack #392 October 19, 2026 14:22
@hansott
hansott force-pushed the increase-cloud-timeouts branch from 20a8c94 to 9c8a105 Compare October 19, 2026 15:12
public class BackgroundProcess extends Thread {
private static final int API_TIMEOUT = 10; // 10 seconds
private static final int API_TIMEOUT = 30; // GET config and lists
private static final int EVENTS_API_TIMEOUT = 60; // POST events

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium - 60-second event timeout lets stalled reporting exhaust the attack queue

When the event endpoint accepts a connection but stalls, an attacker can keep generating detected attacks while the sole queue consumer waits up to 60 seconds on each POST. The queue is unbounded and producers continue accepting events, so sustained attack traffic can retain enough event payloads to exhaust the agent heap and degrade the instrumented application; the previous 10-second timeout drained six times faster.

Suggested change
private static final int EVENTS_API_TIMEOUT = 60; // POST events
private static final int EVENTS_API_TIMEOUT = 10; // POST events

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

@hansott
hansott marked this pull request as draft October 20, 2026 08:03
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