-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #394 from kubescape/feature/processtree
Feature/processtree
- Loading branch information
Showing
12 changed files
with
1,722 additions
and
163 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,20 @@ | ||
package processmanager | ||
|
||
import ( | ||
apitypes "github.com/armosec/armoapi-go/armotypes" | ||
containercollection "github.com/inspektor-gadget/inspektor-gadget/pkg/container-collection" | ||
"github.com/kubescape/node-agent/pkg/utils" | ||
) | ||
|
||
// ProcessManagerClient is the interface for the process manager client. | ||
// It provides methods to get process tree for a container or a PID. | ||
// The manager is responsible for maintaining the process tree for all containers. | ||
type ProcessManagerClient interface { | ||
GetProcessTreeForPID(containerID string, pid int) (apitypes.Process, error) | ||
// PopulateInitialProcesses is called to populate the initial process tree (parsed from /proc) for all containers. | ||
PopulateInitialProcesses() error | ||
|
||
// ReportEvent will be called to report new exec events to the process manager. | ||
ReportEvent(eventType utils.EventType, event utils.K8sEvent) | ||
ContainerCallback(notif containercollection.PubSubEvent) | ||
} |
This file contains 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,32 @@ | ||
package processmanager | ||
|
||
import ( | ||
apitypes "github.com/armosec/armoapi-go/armotypes" | ||
containercollection "github.com/inspektor-gadget/inspektor-gadget/pkg/container-collection" | ||
"github.com/kubescape/node-agent/pkg/utils" | ||
) | ||
|
||
type ProcessManagerMock struct { | ||
} | ||
|
||
var _ ProcessManagerClient = (*ProcessManagerMock)(nil) | ||
|
||
func CreateProcessManagerMock() *ProcessManagerMock { | ||
return &ProcessManagerMock{} | ||
} | ||
|
||
func (p *ProcessManagerMock) GetProcessTreeForPID(containerID string, pid int) (apitypes.Process, error) { | ||
return apitypes.Process{}, nil | ||
} | ||
|
||
func (p *ProcessManagerMock) PopulateInitialProcesses() error { | ||
return nil | ||
} | ||
|
||
func (p *ProcessManagerMock) ReportEvent(eventType utils.EventType, event utils.K8sEvent) { | ||
// no-op | ||
} | ||
|
||
func (p *ProcessManagerMock) ContainerCallback(notif containercollection.PubSubEvent) { | ||
// no-op | ||
} |
Oops, something went wrong.