docs: describe how the preStop exec cache and network event dedup affect the runtime rules

オープン 初心者向け
#1,093 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
documentation

調査の方向性

docs/にある既存の重複排除と設定に関する説明を読み、続いてpkg/rulemanager/cel/libraries/containerprofile/exec.goとpkg/dedupcache/keys.goで記載された動作を確認してください。preStopトリガー、5分間のウィンドウ、影響を受けるCEL関数、イベントキーとTTL、重複排除されたイベントでスキップされる処理を網羅するドキュメントを追加してください。ルール作成者が両方の動作とその実行時の影響をドキュメントから見つけられれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

  1. 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 its lifecycle.preStop.exec.command. While it's marked, which lasts DefaultPreStopCacheTTL (5 minutes), was_executed treats every exec in that container as expected. With a common hook like ["/bin/sh", "-c", "sleep 5"], this window starts whenever /bin/sh runs, not only when the pod terminates. That's worth stating next to the rules that use ap.was_executed / cp.was_executed.
  2. 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.

主要言語
Go
スター
39
フォーク
42
平均マージ
1日 18時間
マージ済み PR(30日)
40

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kubescape/node-agent のほかの issue

kubescape/node-agent の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。