Skip to content

Commit

Permalink
adding process tree to AP
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <[email protected]>
  • Loading branch information
matthyx committed Jan 9, 2025
1 parent 5d7cdf3 commit dd18e95
Show file tree
Hide file tree
Showing 9 changed files with 1,698 additions and 630 deletions.
2 changes: 2 additions & 0 deletions pkg/apis/softwarecomposition/knownserversfinder.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import (
var _ IKnownServersFinder = (*KnownServersFinderImpl)(nil)
var _ IKnownServerEntry = (*KnownServersFinderEntry)(nil)

// +k8s:deepcopy-gen=false
type KnownServersFinderImpl struct {
ranger cidranger.Ranger
}

// +k8s:deepcopy-gen=false
type KnownServersFinderEntry struct {
knownServer KnownServerEntry
network net.IPNet
Expand Down
26 changes: 21 additions & 5 deletions pkg/apis/softwarecomposition/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ type RulePolicy struct {
}

type ExecCalls struct {
Path string
Args []string
Envs []string
Path string
Args []string
Envs []string
ProcessTree StackTrace
}

const sep = "␟"
Expand All @@ -267,8 +268,9 @@ func (e ExecCalls) String() string {
}

type OpenCalls struct {
Path string
Flags []string
Path string
Flags []string
ProcessTree StackTrace
}

func (e OpenCalls) String() string {
Expand All @@ -282,6 +284,20 @@ func (e OpenCalls) String() string {
return s.String()
}

type StackTrace struct {
Root FileName
Nodes map[FileName]StackFrame
}

type StackFrame struct {
File FileName
Address uint64
Children []FileName
Parents []FileName
}

type FileName string

type ApplicationProfileStatus struct {
}

Expand Down
1,963 changes: 1,343 additions & 620 deletions pkg/apis/softwarecomposition/v1beta1/generated.pb.go

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions pkg/apis/softwarecomposition/v1beta1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 21 additions & 5 deletions pkg/apis/softwarecomposition/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,32 @@ type ApplicationProfileContainer struct {
}

type ExecCalls struct {
Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
Args []string `json:"args,omitempty" protobuf:"bytes,2,opt,name=args"`
Envs []string `json:"envs,omitempty" protobuf:"bytes,3,opt,name=envs"`
Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
Args []string `json:"args,omitempty" protobuf:"bytes,2,opt,name=args"`
Envs []string `json:"envs,omitempty" protobuf:"bytes,3,opt,name=envs"`
ProcessTree StackTrace `json:"processTree,omitempty" protobuf:"bytes,4,opt,name=processTree"`
}

type OpenCalls struct {
Path string `json:"path" yaml:"path" protobuf:"bytes,1,req,name=path"`
Flags []string `json:"flags" yaml:"flags" protobuf:"bytes,2,rep,name=flags"`
Path string `json:"path" yaml:"path" protobuf:"bytes,1,req,name=path"`
Flags []string `json:"flags" yaml:"flags" protobuf:"bytes,2,rep,name=flags"`
ProcessTree StackTrace `json:"processTree,omitempty" protobuf:"bytes,4,opt,name=processTree"`
}

type StackTrace struct {
Root FileName `json:"root" protobuf:"bytes,1,opt,name=root"`
Nodes map[FileName]StackFrame `json:"nodes" protobuf:"bytes,2,rep,name=nodes"`
}

type StackFrame struct {
File FileName `json:"file" protobuf:"bytes,1,opt,name=file"`
Address uint64 `json:"address" protobuf:"bytes,2,opt,name=address"`
Children []FileName `json:"children" protobuf:"bytes,3,rep,name=children"`
Parents []FileName `json:"parents" protobuf:"bytes,4,rep,name=parents"`
}

type FileName string

type ApplicationProfileStatus struct {
}

Expand Down
80 changes: 80 additions & 0 deletions pkg/apis/softwarecomposition/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions pkg/apis/softwarecomposition/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dd18e95

Please sign in to comment.