docs: describe how the preStop exec cache and network event dedup affect the runtime rules
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go
- Domain
- documentation
Research direction
Read the existing dedup and configuration notes under docs/, then check pkg/rulemanager/cel/libraries/containerprofile/exec.go and pkg/dedupcache/keys.go for the stated behavior. Add documentation covering the preStop trigger, five-minute window, affected CEL functions, event keys and TTLs, and what deduplicated events skip. Done when rule authors can find both behaviors and their runtime effects in the docs.
Written by the indexing model from the issue text.
Description
Description
Two behaviours of the rule engine aren't documented, and both change which events the runtime rules see. They're intended, but someone writing or tuning rules has no way to know about them except by reading the code.
- preStop exec cache.
isExecInPodSpec(pkg/rulemanager/cel/libraries/containerprofile/exec.go) marks a container's preStop hook as triggered when an executed path appears in itslifecycle.preStop.exec.command. While it's marked, which lastsDefaultPreStopCacheTTL(5 minutes),was_executedtreats every exec in that container as expected. With a common hook like["/bin/sh", "-c", "sleep 5"], this window starts whenever/bin/shruns, not only when the pod terminates. That's worth stating next to the rules that useap.was_executed/cp.was_executed. - Network event dedup.
ComputeNetworkKey(mntns, pid, dstAddr, dstPort, proto)(pkg/dedupcache/keys.go) has no packet direction, and network events dedup for 5s. So within that window, a second event with the same process, remote address, port and protocol is dropped before the rule manager, profile learning and malware scan see it.
Proposal
Add a short section, for example in docs/ next to the existing dedup and configuration notes, that explains:
- the preStop exec window: what triggers it, how long it lasts, and which CEL functions it affects;
- the dedup keys and TTLs per event type, and what a deduplicated event skips.
I'm happy to write the doc PR if that sounds useful, and to adjust it to how you'd like these described.
- Dominant language
- Go
- Stars
- 39
- Forks
- 42
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 40
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kubescape/node-agent
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
kubescape/node-agent#1099 ·
Maintainers usually reply within 1 day
-
Upgrade Inspektor Gadget to v0.57.0 via kubescape fork and preserve exec/path semanticsPossibly taken @ANAMASGARD claimed this 18 days ago. Openenhancement
kubescape/node-agent#1050 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
kubescape/node-agent#1014 ·
Maintainers usually reply within 1 day
-
Scan container images for misplaced secretsMay be free again @khuswant18 claimed this 48 days ago, and no pull request is open. Open
kubescape/node-agent#987 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
kubescape/node-agent#963 · 1 comment ·
Maintainers usually reply within 1 day
All issues in kubescape/node-agent
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
evener-transcript-v2-upgrade tool still scans transcript files through bufio's 4 KiB default bufferOpen
Difficulty 1/5 Under an hour Newbie friendliness 78/100
prime-radiant-inc/evener#6370 ·
Maintainers usually reply within 1 day
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Mend: dependency security vulnerability
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Mend: dependency security vulnerability
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ManageIQ/manageiq-pods#1476 ·
Maintainers usually reply within 1 day