Repository navigation
Feature/refactor container watcher #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
97 commits
Select commit
Hold shift + click to select a range
78d658f
started process tree refactor process
afek854 e91c6e5
completed process tree creator
afek854 bde54eb
added tests
afek854 466d609
added proc fs feeder
afek854 8651d54
added exit process track
afek854 e51af88
fixed tests
afek854 7924e40
added process tree manager and container to main
afek854 b9668cb
added ebpf event feeder
afek854 2497c5f
added initial process manager to main
afek854 e5d807e
added logs and exec to report to feeder
afek854 facbe0d
replace old process tree
afek854 7d8778d
WIP: fixed lock
afek854 affb441
fixed tests
afek854 2625ef2
fixed container tree find
afek854 a53b6ed
handle parent bug
afek854 f5550b4
ensure efficiency and more test cases
afek854 5794655
return the correct node, use the correct shim pid
afek854 d0b7108
WIP: fork tracer
afek854 5a98196
WIP: fork tracer new hook
afek854 88f5653
WIP: dedup fork & exec
afek854 159630f
WIP: Handle runc ppid changes
afek854 a90054b
do retry until tree ready
afek854 0cd6c4b
added reparenting logic
afek854 9e1bf7f
WIP: Added exit strategy and tracer
afek854 4aef8e3
WIP: remove set creator
afek854 f6934be
WIP: added logs
afek854 c12f495
WIP: added strategies
afek854 872faaa
WIP: optimize parenting and inserting
afek854 ca38ec3
WIP: optimize walking and updating ppid
afek854 2c5e8b9
WIP: Optimize trees
afek854 e9fffe8
WIP: Added mutexes
afek854 120a2ab
WIP: tree process before rule manager
afek854 ecffc36
WIP: tree process before rule manager
afek854 cfed2df
WIP: added exit cleanup
afek854 af4d17b
WIP: fixed race conditions
afek854 05c75bc
WIP: fixed race conditions in exit, docker
afek854 72a8962
refactor container watcher
afek854 5ec2855
finished infrastructure
afek854 86a0f8b
added tests and tree enrichment
afek854 e8b8bcb
WIP: Process tree as a single thread
afek854 b485978
WIP: Use new container watcher
afek854 085ab17
WIP: fixed container watcher
afek854 3fa08f8
WIP: added procfs events
afek854 eb7f7e7
WIP: fixed feeders issues
afek854 3231066
WIP: enriched events
afek854 a88074d
WIP: enriched events
afek854 66ede31
WIP: simple reparenting
afek854 2fc0612
WIP: added event enricher
afek854 3fc5332
WIP: improved process tree
afek854 1d5f1b2
WIP: Simplified process tree
afek854 87a6e15
WIP: fixed sync issues
afek854 c1bd2ee
WIP: added exit delayed cleanup
afek854 b6076cb
WIP: extract tree branch
afek854 acefe6a
Merge branch 'main' of github.com:kubescape/node-agent into feature/r…
afek854 603d09d
WIP: remove v1 and fix v2 to new version
afek854 d312187
WIP: addd syscall numbers
afek854 ece2da8
WIP: report ap
afek854 0d371e8
WIP: fixed dns & rule policy
afek854 657b878
WIP: added ignore container
afek854 f835e13
fixed r0001
afek854 fb5985e
fallback process tree
afek854 6322cbe
fixed handler
afek854 81b2880
skip empty container name
afek854 ecbf6ee
added debug logs
afek854 6159fe7
added fallback to exec not under containerd-shim
afek854 3c35808
added syscall to rule_manager
afek854 3561b5a
added logs
afek854 81d5e57
fixed rule failure
afek854 e7e6d5f
fixed syscall
afek854 9978a94
fixed traces filters
afek854 2f0c0f3
added enrichment for events
afek854 4284de6
added get host pid
afek854 4e52156
handle kubernetes mode
afek854 0a9d333
modify enrichment interface
afek854 b795741
updated test image
afek854 815c30e
added component test
afek854 0b3c5b7
fixed naming
afek854 e7b3932
fixed naming and logs
afek854 5e4c2e4
added more workers and channels
afek854 70dd2ce
fixed test
afek854 f21e0ce
added logs
afek854 9ae1901
improved mutex and usage of process tree
afek854 f64c653
orgenized container watcher
afek854 2566c31
orgenized processtree
afek854 b00f372
added tests
afek854 6b27779
fixed ordered event queue
afek854 297e339
fixed timestamp
afek854 69547d2
fixed worker pool
afek854 3e7dc77
removed debug logs
afek854 0a4f1b3
added tree depth
afek854 42f1d16
fix test
afek854 8c7e923
use cache only for not update events
afek854 9b09400
removed types without manager
afek854 f7a6f7b
renaming due to cr
afek854 d08cbf6
fixed traces factory and naming
afek854 b45333a
fixed fork & exit tracers
afek854 74b9e97
removed event feeder
afek854 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package containerwatcher | ||
|
|
||
| // TracerRegistrer defines the interface for registering tracers | ||
| type TracerRegistrer interface { | ||
| RegisterTracer(tracer TracerInterface) | ||
| } | ||
|
|
||
| // TracerFactoryInterface defines the interface for creating tracers | ||
| type TracerFactoryInterface interface { | ||
| CreateAllTracers(manager TracerRegistrer) | ||
| GetThirdPartyTracers() []CustomTracer | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package containerwatcher | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/kubescape/node-agent/pkg/utils" | ||
| ) | ||
|
|
||
| // TracerInterface defines the common interface for all eBPF tracers | ||
| type TracerInterface interface { | ||
| // Start initializes and starts the tracer | ||
| Start(ctx context.Context) error | ||
|
|
||
| // Stop gracefully stops the tracer | ||
| Stop() error | ||
|
|
||
| // GetName returns the unique name of the tracer | ||
| GetName() string | ||
|
|
||
| // GetEventType returns the event type this tracer produces | ||
| GetEventType() utils.EventType | ||
|
|
||
| // IsEnabled checks if this tracer should be enabled based on configuration | ||
| IsEnabled(cfg interface{}) bool | ||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why v2?