feat(enforcer): capability-specific alert throttling at BPF level - #2819
Open
Rucha0901 wants to merge 5 commits into
Open
feat(enforcer): capability-specific alert throttling at BPF level#2819Rucha0901 wants to merge 5 commits into
Rucha0901 wants to merge 5 commits into
Conversation
Rucha0901
requested review from
Aryan-sharma11,
AryanBakliwal,
achrefbensaad,
daemon1024 and
rksharma95
as code owners
July 30, 2026 10:46
Signed-off-by: Rucha0901 <imt_2025071@iiitm.ac.in>
…PF code Signed-off-by: Rucha0901 <imt_2025071@iiitm.ac.in>
…nment Signed-off-by: Rucha0901 <imt_2025071@iiitm.ac.in>
Signed-off-by: Rucha0901 <imt_2025071@iiitm.ac.in>
Rucha0901
force-pushed
the
capable-alert-throttling
branch
from
August 1, 2026 11:20
d666894 to
8e6fbb2
Compare
Signed-off-by: Rucha0901 <imt_2025071@iiitm.ac.in>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of PR?:
This PR implements granular, capability-specific alert throttling at the eBPF/LSM kernel level inside the
lsm/capablehook (enforce_cap). By checking capability violations against a token-bucket rate limiter map keyed by container ID and capability number, we drop user-space alerts when the rate is exceeded while still enforcing the policy (-EPERM).Fixes #2818
Does this PR introduce a breaking change?
No.
If the changes in this PR are manually verified, list down the scenarios covered::
GOOS=linux go test -exec=true ./....Additional information for reviewer? :
Key modifications:
struct cap_throttle_keyandstruct cap_throttle_stateinthrottling.h.kubearmor_capable_throttleinthrottling.h.should_drop_capable_alertstoken-bucket rate limiting helper inshared.h.enforce_capinenforcer.bpf.cto useshould_drop_capable_alerts(okey, cap).BPFCapableThrottleMapinenforcer.go.BPFCapableThrottleMapon container deletion inmapHelpers.go.Checklist:
<type>(<scope>): <subject>