Skip to content

Commit

Permalink
Add support for log enricher profile recording
Browse files Browse the repository at this point in the history
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
  • Loading branch information
saschagrunert authored and k8s-ci-robot committed Jul 2, 2021
1 parent 19e1088 commit a05df79
Show file tree
Hide file tree
Showing 26 changed files with 948 additions and 145 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ linters:
# - testpackage
# - wsl
linters-settings:
nestif:
min-complexity: 10
gci:
local-prefixes: sigs.k8s.io/security-profiles-operator
errcheck:
Expand Down
11 changes: 11 additions & 0 deletions api/profilerecording/v1alpha1/profilerecording_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,23 @@ const (
ProfileRecordingKindSeccompProfile ProfileRecordingKind = "SeccompProfile"
)

type ProfileRecorder string

const (
ProfileRecorderHook ProfileRecorder = "hook"
ProfileRecorderLogs ProfileRecorder = "logs"
)

// ProfileRecordingSpec defines the desired state of ProfileRecording.
type ProfileRecordingSpec struct {
// Kind of object to be recorded.
// +kubebuilder:validation:Enum=SeccompProfile
Kind ProfileRecordingKind `json:"kind"`

// Recorder to be used.
// +kubebuilder:validation:Enum=hook;logs
Recorder ProfileRecorder `json:"recorder"`

// PodSelector selects the pods to record. This field follows standard
// label selector semantics. An empty podSelector matches all pods in this
// namespace.
Expand Down
254 changes: 235 additions & 19 deletions api/server/api.pb.go

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

16 changes: 16 additions & 0 deletions api/server/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ option go_package = "/api";

service SecurityProfilesOperator {
rpc MetricsAuditInc(MetricsAuditRequest) returns (EmptyResponse) {}
rpc RecordSyscall(RecordSyscallRequest) returns (EmptyResponse) {}
rpc Syscalls(SyscallsRequest) returns (SyscallsResponse) {}
rpc ResetSyscalls(SyscallsRequest) returns (EmptyResponse) {}
}

message MetricsAuditRequest {
Expand All @@ -37,4 +40,17 @@ message MetricsAuditRequest {
string syscall = 7;
}

message RecordSyscallRequest {
string profile = 1;
string syscall = 2;
}

message SyscallsRequest {
string profile = 1;
}

message SyscallsResponse {
repeated string syscalls = 1;
}

message EmptyResponse {}

0 comments on commit a05df79

Please sign in to comment.