Skip to content

Implement Layer 3: rate limiting and time-limited access#2

Merged
sdimitro merged 2 commits into
developfrom
claude/layer-3-drgn-mitigation-DjJ9a
Feb 8, 2026
Merged

Implement Layer 3: rate limiting and time-limited access#2
sdimitro merged 2 commits into
developfrom
claude/layer-3-drgn-mitigation-DjJ9a

Conversation

@sdimitro

@sdimitro sdimitro commented Feb 8, 2026

Copy link
Copy Markdown
Owner

Add per-session and cross-session rate controls to limit bulk data
extraction through /proc/kcore_filtered.

Per-session controls:

  • max_session_bytes (default 64M): caps bytes per open fd
  • max_session_secs (default 300): caps session duration

Global controls (address rapid-restart attacks):

  • max_opens_per_min (default 10): caps open() rate across all processes
  • max_global_bytes_per_min (default 128M): caps aggregate read rate

All parameters are runtime-tunable via sysfs and setting 0 disables
the limit. Rate-limit events emit audit records and increment
counters in /proc/kcore_filtered_stats.

https://claude.ai/code/session_01JnpSAhxxEZsVqN8JG5uvqn

Add per-session and cross-session rate controls to limit bulk data
extraction through /proc/kcore_filtered.

Per-session controls:
- max_session_bytes (default 64M): caps bytes per open fd
- max_session_secs (default 300): caps session duration

Global controls (address rapid-restart attacks):
- max_opens_per_min (default 10): caps open() rate across all processes
- max_global_bytes_per_min (default 128M): caps aggregate read rate

All parameters are runtime-tunable via sysfs and setting 0 disables
the limit. Rate-limit events emit audit records and increment
counters in /proc/kcore_filtered_stats.

https://claude.ai/code/session_01JnpSAhxxEZsVqN8JG5uvqn
Tests added (Tests 18-23 in test_basic.sh):
- sysfs parameter verification for all 4 rate-limit params
- stats file contains rl_* counter fields
- session byte budget enforcement (load with 8K budget, verify cap)
- open rate limit enforcement (load with 3/min, verify 4th denied)
- rl_denied_opens counter increments after denied open

All behavioral tests use volume-based limits only (no sleeps/timing),
avoiding flakiness from CI/VM timing jitter. Time-based limits
(max_session_secs) and window-reset behavior are not tested for this
reason.

Also shortened rl_sessions_expired/budget to rl_sess_expired/budget
in stats output so all fields have whitespace-delimited values for
reliable awk parsing.

https://claude.ai/code/session_01JnpSAhxxEZsVqN8JG5uvqn
@sdimitro sdimitro merged commit 925538c into develop Feb 8, 2026
10 checks passed
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