Skip to content

Unify and harden HTTP server request limits - #1361

Merged
stefanprodan merged 3 commits into
mainfrom
cap-event-server
Aug 7, 2026
Merged

Unify and harden HTTP server request limits#1361
stefanprodan merged 3 commits into
mainfrom
cap-event-server

Conversation

@stefanprodan

@stefanprodan stefanprodan commented Aug 6, 2026

Copy link
Copy Markdown
Member

This PR applies defense-in-depth hardening to the two HTTP servers exposed by the controller:

  • Limit the event server request body size to 3MiB (ported from receiver server)
  • Unify request body limit enforcement in a shared helper used by both servers, rejecting oversized bodies with HTTP 413 status code.
  • Enforce the receiver body limit before the receiver lookup and payload validation.
  • Set ReadTimeout (30s), ReadHeaderTimeout (10s) and MaxHeaderBytes (256 KiB) on both servers.
  • Bound the event rate limiter store memory by sweeping stale entries at the configured --rate-limit-interval and purging them after 2x interval.
  • Bump sethvargo/go-limiter from v1.1.0 to v1.2.0, which reduces lock contention in the store.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan added area/alerting Alerting related issues and PRs backport:release/v1.9.x To be backported to release/v1.9.x labels Aug 6, 2026
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan changed the title fix: limit the event server request body size Unify and harden HTTP server request limits Aug 7, 2026
@stefanprodan
stefanprodan merged commit 6090d08 into main Aug 7, 2026
5 checks passed
@stefanprodan
stefanprodan deleted the cap-event-server branch August 7, 2026 10:46
@fluxcdbot

Copy link
Copy Markdown
Member

Backport failed for release/v1.9.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/v1.9.x
git worktree add -d .worktree/backport-1361-to-release/v1.9.x origin/release/v1.9.x
cd .worktree/backport-1361-to-release/v1.9.x
git switch --create backport-1361-to-release/v1.9.x
git cherry-pick -x 8bb6b148850ce58d2de938bfa81d35acff56e286 6662c7810314bc5d677785c46caaab77e25d2fb5 c80e3914b5440d6568aeff91649d8deb30294c26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/alerting Alerting related issues and PRs backport:release/v1.9.x To be backported to release/v1.9.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants