From f29acf63929ed34efd6b7e186c08a3ab825cb2d8 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 5 Aug 2026 21:41:06 +0200 Subject: [PATCH 01/65] chore(deps): Add cilium/ebpf dependency Pull in cilium/ebpf v0.20.0 for the Linux CO-RE instrumentation spike and future event source work. --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 77416beba..e97fbeb49 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/rivo/uniseg v0.4.2 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/secDre4mer/pkcs7 v0.0.0-20240322103146-665324a4461d // indirect go4.org/netipx v0.0.0-20220725152314-7e7bdc8411bf // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect diff --git a/go.sum b/go.sum index b1ad4f534..b767df3f3 100644 --- a/go.sum +++ b/go.sum @@ -176,8 +176,8 @@ github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/saferwall/pe v1.5.6 h1:DrRLnoQFxHWJ5lJUmrH7X2L0xeUu6SUS95Dc61eW2Yc= github.com/saferwall/pe v1.5.6/go.mod h1:mJx+PuptmNpoPFBNhWs/uDMFL/kTHVZIkg0d4OUJFbQ= github.com/secDre4mer/pkcs7 v0.0.0-20240322103146-665324a4461d h1:RQqyEogx5J6wPdoxqL132b100j8KjcVHO1c0KLRoIhc= From c0f504a30d5aae13116ff3760307297ae05775b7 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 5 Aug 2026 21:41:06 +0200 Subject: [PATCH 02/65] chore(ebpf): Add feature probes and race-safe process reconciler Encode the hard Linux runtime contract (kernel >=5.9, runtime BTF, ringbuf, tracing/iter support) and prototype ProcessKey-based startup reconciliation with bounded pending-queue and drop metrics. --- internal/ebpf/doc.go | 22 ++++ internal/ebpf/features.go | 167 ++++++++++++++++++++++++ internal/ebpf/features_test.go | 43 ++++++ internal/ebpf/reconcile.go | 223 ++++++++++++++++++++++++++++++++ internal/ebpf/reconcile_test.go | 86 ++++++++++++ 5 files changed, 541 insertions(+) create mode 100644 internal/ebpf/doc.go create mode 100644 internal/ebpf/features.go create mode 100644 internal/ebpf/features_test.go create mode 100644 internal/ebpf/reconcile.go create mode 100644 internal/ebpf/reconcile_test.go diff --git a/internal/ebpf/doc.go b/internal/ebpf/doc.go new file mode 100644 index 000000000..6b50b1917 --- /dev/null +++ b/internal/ebpf/doc.go @@ -0,0 +1,22 @@ +/* + * Copyright 2026 Fibratus contributors + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Package ebpf hosts the Linux eBPF instrumentation backend and supporting +// feasibility prototypes used to validate CO-RE load, feature probes, and +// race-safe process-state reconciliation. +package ebpf diff --git a/internal/ebpf/features.go b/internal/ebpf/features.go new file mode 100644 index 000000000..8ef430124 --- /dev/null +++ b/internal/ebpf/features.go @@ -0,0 +1,167 @@ +//go:build linux + +/* + * Copyright 2026 Fibratus contributors + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "errors" + "fmt" + "os" + "strings" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/asm" + "github.com/cilium/ebpf/features" + "golang.org/x/sys/unix" +) + +const ( + // MinKernelVersion is the hard policy floor for the Linux eBPF backend. + // BPF task iterators require Linux 5.9. bpf_d_path is intentionally unused + // because it only appears in 5.10+. + MinKernelVersion = "5.9" + + kernelBTFPath = "/sys/kernel/btf/vmlinux" +) + +// PrerequisiteReport captures runtime probe results for the Linux eBPF backend. +type PrerequisiteReport struct { + KernelRelease string + KernelOK bool + BTFPath string + BTFOK bool + RingbufOK bool + TracingOK bool + IterOK bool + RingbufHelper bool + Errors []string +} + +// ProbePrerequisites verifies the hard runtime contract for the Linux eBPF backend. +// Missing features produce an error; there is no BTFHub or build-host BTF fallback. +func ProbePrerequisites() (*PrerequisiteReport, error) { + report := &PrerequisiteReport{BTFPath: kernelBTFPath} + + var uts unix.Utsname + if err := unix.Uname(&uts); err != nil { + return nil, fmt.Errorf("reading kernel release: %w", err) + } + report.KernelRelease = unix.ByteSliceToString(uts.Release[:]) + + if err := checkKernelVersion(report.KernelRelease, MinKernelVersion); err != nil { + report.Errors = append(report.Errors, err.Error()) + } else { + report.KernelOK = true + } + + if st, err := os.Stat(kernelBTFPath); err != nil || st.IsDir() || st.Size() == 0 { + report.Errors = append(report.Errors, fmt.Sprintf("usable kernel BTF required at %s", kernelBTFPath)) + } else { + report.BTFOK = true + } + + if err := features.HaveMapType(ebpf.RingBuf); err != nil { + report.Errors = append(report.Errors, fmt.Sprintf("ring buffer maps unavailable: %v", err)) + } else { + report.RingbufOK = true + } + + if err := features.HaveProgramType(ebpf.TracePoint); err != nil { + report.Errors = append(report.Errors, fmt.Sprintf("tracepoint programs unavailable: %v", err)) + } + if err := features.HaveProgramType(ebpf.Tracing); err != nil { + report.Errors = append(report.Errors, fmt.Sprintf("tracing programs unavailable: %v", err)) + } else { + report.TracingOK = true + } + + // Helper probes are program-type specific in cilium/ebpf. TracePoint covers the + // hot-path helpers; Tracing covers the iterator program class. + if err := features.HaveProgramHelper(ebpf.TracePoint, asm.FnGetCurrentTask); err != nil { + report.Errors = append(report.Errors, fmt.Sprintf("bpf_get_current_task helper unavailable: %v", err)) + } + if err := features.HaveProgramHelper(ebpf.TracePoint, asm.FnRingbufReserve); err != nil { + report.Errors = append(report.Errors, fmt.Sprintf("ringbuf helpers unavailable: %v", err)) + } else { + report.RingbufHelper = true + } + + // Task iterators attach as Tracing + AttachTraceIter against a kernel BTF target. + if report.TracingOK && report.BTFOK { + report.IterOK = true + } else { + report.Errors = append(report.Errors, "iter/task requires tracing programs and runtime kernel BTF") + } + + if len(report.Errors) > 0 { + return report, errors.New(strings.Join(report.Errors, "; ")) + } + return report, nil +} + +func checkKernelVersion(current, minimum string) error { + cur, err := parseKernelVersion(current) + if err != nil { + return fmt.Errorf("parsing kernel version %q: %w", current, err) + } + min, err := parseKernelVersion(minimum) + if err != nil { + return fmt.Errorf("parsing minimum kernel version %q: %w", minimum, err) + } + if compareKernelVersion(cur, min) < 0 { + return fmt.Errorf("kernel %s is below required %s", current, minimum) + } + return nil +} + +type kernelVersion struct { + major int + minor int + patch int +} + +func parseKernelVersion(v string) (kernelVersion, error) { + v = strings.SplitN(v, "-", 2)[0] + parts := strings.Split(v, ".") + if len(parts) < 2 { + return kernelVersion{}, fmt.Errorf("invalid version %q", v) + } + var kv kernelVersion + if _, err := fmt.Sscanf(parts[0], "%d", &kv.major); err != nil { + return kernelVersion{}, err + } + if _, err := fmt.Sscanf(parts[1], "%d", &kv.minor); err != nil { + return kernelVersion{}, err + } + if len(parts) > 2 { + _, _ = fmt.Sscanf(parts[2], "%d", &kv.patch) + } + return kv, nil +} + +func compareKernelVersion(a, b kernelVersion) int { + if a.major != b.major { + return a.major - b.major + } + if a.minor != b.minor { + return a.minor - b.minor + } + return a.patch - b.patch +} diff --git a/internal/ebpf/features_test.go b/internal/ebpf/features_test.go new file mode 100644 index 000000000..430767e2d --- /dev/null +++ b/internal/ebpf/features_test.go @@ -0,0 +1,43 @@ +//go:build linux + +/* + * Copyright 2026 Fibratus contributors + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import "testing" + +func TestCheckKernelVersion(t *testing.T) { + tests := []struct { + current string + minimum string + wantErr bool + }{ + {current: "5.9.0", minimum: "5.9", wantErr: false}, + {current: "5.10.1", minimum: "5.9", wantErr: false}, + {current: "6.12.76-linuxkit", minimum: "5.9", wantErr: false}, + {current: "5.8.18", minimum: "5.9", wantErr: true}, + {current: "4.18.0-553.el8", minimum: "5.9", wantErr: true}, + } + for _, tt := range tests { + err := checkKernelVersion(tt.current, tt.minimum) + if (err != nil) != tt.wantErr { + t.Fatalf("checkKernelVersion(%q, %q) err=%v wantErr=%v", tt.current, tt.minimum, err, tt.wantErr) + } + } +} diff --git a/internal/ebpf/reconcile.go b/internal/ebpf/reconcile.go new file mode 100644 index 000000000..31184d0d6 --- /dev/null +++ b/internal/ebpf/reconcile.go @@ -0,0 +1,223 @@ +/* + * Copyright 2026 Fibratus contributors + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "fmt" + "sync" + "sync/atomic" +) + +// ProcessKey uniquely identifies a process instance across PID reuse. +type ProcessKey struct { + PID uint32 + StartBootTime uint64 +} + +// HotEvent is a timestamped ring-buffer record received while the task +// iterator baseline is still being established. +type HotEvent struct { + Key ProcessKey + Kind uint32 + Timestamp uint64 + Comm string + Filename string + ExePath string + Cmdline string +} + +// Metrics accounts for every pressure-induced drop during startup/live capture. +type Metrics struct { + PendingQueued atomic.Uint64 + PendingDropped atomic.Uint64 + RingbufDropped atomic.Uint64 + EnrichmentMiss atomic.Uint64 + ReplayApplied atomic.Uint64 + SnapshotUpserts atomic.Uint64 +} + +// ProcessRecord is the reconciled userspace view of a process instance. +type ProcessRecord struct { + Key ProcessKey + Comm string + Filename string + ExePath string + Cmdline string + FromSnap bool + FromHot bool +} + +// StartupReconciler prototypes the race-safe startup sequence: +// queue hot events, upsert iterator baseline by ProcessKey, replay pending +// events idempotently, then switch to live updates. +type StartupReconciler struct { + mu sync.Mutex + pending []HotEvent + live bool + capacity int + procs map[ProcessKey]*ProcessRecord + Metrics Metrics +} + +// NewStartupReconciler creates a reconciler with a bounded pending queue. +func NewStartupReconciler(capacity int) *StartupReconciler { + if capacity <= 0 { + capacity = 1024 + } + return &StartupReconciler{ + capacity: capacity, + procs: make(map[ProcessKey]*ProcessRecord), + } +} + +// EnqueueHot queues a hot event while baseline capture is in progress. +// Returns false when the bounded queue drops the event. +func (r *StartupReconciler) EnqueueHot(ev HotEvent) bool { + r.mu.Lock() + defer r.mu.Unlock() + if r.live { + r.applyLocked(ev, true) + return true + } + if len(r.pending) >= r.capacity { + r.Metrics.PendingDropped.Add(1) + return false + } + r.pending = append(r.pending, ev) + r.Metrics.PendingQueued.Add(1) + return true +} + +// UpsertSnapshot installs an iterator baseline record keyed by ProcessKey. +func (r *StartupReconciler) UpsertSnapshot(rec ProcessRecord) { + r.mu.Lock() + defer r.mu.Unlock() + rec.FromSnap = true + existing, ok := r.procs[rec.Key] + if !ok { + cp := rec + r.procs[rec.Key] = &cp + r.Metrics.SnapshotUpserts.Add(1) + return + } + mergeSnapshot(existing, rec) + r.Metrics.SnapshotUpserts.Add(1) +} + +// FinishBaseline replays queued hot events in order and switches to live mode. +func (r *StartupReconciler) FinishBaseline() { + r.mu.Lock() + defer r.mu.Unlock() + for _, ev := range r.pending { + r.applyLocked(ev, true) + r.Metrics.ReplayApplied.Add(1) + } + r.pending = nil + r.live = true +} + +// Get returns the reconciled process record for key, if present. +func (r *StartupReconciler) Get(key ProcessKey) (ProcessRecord, bool) { + r.mu.Lock() + defer r.mu.Unlock() + rec, ok := r.procs[key] + if !ok { + return ProcessRecord{}, false + } + return *rec, true +} + +// Size returns the number of reconciled process records. +func (r *StartupReconciler) Size() int { + r.mu.Lock() + defer r.mu.Unlock() + return len(r.procs) +} + +// AccountRingbufDrop records a ring-buffer reserve failure observed in-kernel. +func (r *StartupReconciler) AccountRingbufDrop(n uint64) { + if n == 0 { + return + } + r.Metrics.RingbufDropped.Add(n) +} + +// AccountEnrichmentMiss records a failed best-effort /proc enrichment. +func (r *StartupReconciler) AccountEnrichmentMiss() { + r.Metrics.EnrichmentMiss.Add(1) +} + +func (r *StartupReconciler) applyLocked(ev HotEvent, fromHot bool) { + rec, ok := r.procs[ev.Key] + if !ok { + r.procs[ev.Key] = &ProcessRecord{ + Key: ev.Key, + Comm: ev.Comm, + Filename: ev.Filename, + ExePath: ev.ExePath, + Cmdline: ev.Cmdline, + FromHot: fromHot, + } + return + } + if ev.Comm != "" { + rec.Comm = ev.Comm + } + if ev.Filename != "" { + rec.Filename = ev.Filename + } + if ev.ExePath != "" { + rec.ExePath = ev.ExePath + } + if ev.Cmdline != "" { + rec.Cmdline = ev.Cmdline + } + if fromHot { + rec.FromHot = true + } +} + +func mergeSnapshot(dst *ProcessRecord, src ProcessRecord) { + dst.FromSnap = true + if src.Comm != "" { + dst.Comm = src.Comm + } + if src.Filename != "" { + dst.Filename = src.Filename + } + if src.ExePath != "" { + dst.ExePath = src.ExePath + } + if src.Cmdline != "" { + dst.Cmdline = src.Cmdline + } +} + +// String returns a compact metrics summary for spike diagnostics. +func (m *Metrics) String() string { + return fmt.Sprintf( + "pending_queued=%d pending_dropped=%d ringbuf_dropped=%d enrichment_miss=%d replay_applied=%d snapshot_upserts=%d", + m.PendingQueued.Load(), + m.PendingDropped.Load(), + m.RingbufDropped.Load(), + m.EnrichmentMiss.Load(), + m.ReplayApplied.Load(), + m.SnapshotUpserts.Load(), + ) +} diff --git a/internal/ebpf/reconcile_test.go b/internal/ebpf/reconcile_test.go new file mode 100644 index 000000000..3e8c7031a --- /dev/null +++ b/internal/ebpf/reconcile_test.go @@ -0,0 +1,86 @@ +/* + * Copyright 2026 Fibratus contributors + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import "testing" + +func TestStartupReconcilerRaceSafeBaseline(t *testing.T) { + r := NewStartupReconciler(8) + + keyA := ProcessKey{PID: 42, StartBootTime: 100} + keyB := ProcessKey{PID: 42, StartBootTime: 200} // PID reuse with different start time + + if !r.EnqueueHot(HotEvent{Key: keyA, Kind: 1, Comm: "hot-a", Filename: "/bin/hot-a"}) { + t.Fatal("expected hot event to be queued") + } + + r.UpsertSnapshot(ProcessRecord{Key: keyA, Comm: "snap-a"}) + r.UpsertSnapshot(ProcessRecord{Key: keyB, Comm: "snap-b"}) + r.FinishBaseline() + + gotA, ok := r.Get(keyA) + if !ok { + t.Fatal("missing keyA after baseline") + } + if gotA.Comm != "hot-a" { + t.Fatalf("keyA comm=%q want hot-a (hot replay should win over snapshot comm)", gotA.Comm) + } + if gotA.Filename != "/bin/hot-a" { + t.Fatalf("keyA filename=%q", gotA.Filename) + } + if !gotA.FromSnap || !gotA.FromHot { + t.Fatalf("keyA flags snap=%v hot=%v", gotA.FromSnap, gotA.FromHot) + } + + gotB, ok := r.Get(keyB) + if !ok { + t.Fatal("missing keyB after baseline") + } + if gotB.Comm != "snap-b" { + t.Fatalf("keyB comm=%q want snap-b", gotB.Comm) + } + + // Live update for reused PID must not clobber the other instance. + r.EnqueueHot(HotEvent{Key: keyB, Kind: 1, Comm: "live-b", ExePath: "/bin/live-b"}) + gotB, _ = r.Get(keyB) + if gotB.Comm != "live-b" || gotB.ExePath != "/bin/live-b" { + t.Fatalf("live update failed: %+v", gotB) + } + gotA, _ = r.Get(keyA) + if gotA.Comm != "hot-a" { + t.Fatalf("PID reuse clobbered keyA: %+v", gotA) + } +} + +func TestStartupReconcilerPendingBackpressure(t *testing.T) { + r := NewStartupReconciler(2) + key := ProcessKey{PID: 1, StartBootTime: 1} + if !r.EnqueueHot(HotEvent{Key: key, Kind: 1}) { + t.Fatal("first enqueue failed") + } + if !r.EnqueueHot(HotEvent{Key: key, Kind: 1}) { + t.Fatal("second enqueue failed") + } + if r.EnqueueHot(HotEvent{Key: key, Kind: 1}) { + t.Fatal("expected bounded queue drop") + } + if r.Metrics.PendingDropped.Load() != 1 { + t.Fatalf("pending_dropped=%d want 1", r.Metrics.PendingDropped.Load()) + } +} From c24ea9d7456e0da873cb58b2d680667877de512f Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 5 Aug 2026 21:41:07 +0200 Subject: [PATCH 03/65] chore(ebpf): Add CO-RE spike for exec and task iterator Prove sched_process_exec ringbuf capture, iter/task baseline without bpf_d_path, shared-map replacement across separately generated objects, best-effort /proc enrichment, and race-safe startup on a real kernel. --- internal/ebpf/spike/c/LICENSE.BSD-2-Clause | 32 + internal/ebpf/spike/c/bpf_core_read.h | 561 +++ internal/ebpf/spike/c/bpf_endian.h | 99 + internal/ebpf/spike/c/bpf_helper_defs.h | 4139 ++++++++++++++++++++ internal/ebpf/spike/c/bpf_helpers.h | 262 ++ internal/ebpf/spike/c/bpf_tracing.h | 492 +++ internal/ebpf/spike/c/events.h | 49 + internal/ebpf/spike/c/execve.bpf.c | 53 + internal/ebpf/spike/c/proc_iter.bpf.c | 63 + internal/ebpf/spike/c/vmlinux.h | 149 + internal/ebpf/spike/cmd/spike/main.go | 47 + internal/ebpf/spike/enrich.go | 53 + internal/ebpf/spike/event.go | 35 + internal/ebpf/spike/execve_bpfeb.go | 136 + internal/ebpf/spike/execve_bpfeb.o | Bin 0 -> 6960 bytes internal/ebpf/spike/execve_bpfel.go | 136 + internal/ebpf/spike/execve_bpfel.o | Bin 0 -> 6960 bytes internal/ebpf/spike/gen.go | 26 + internal/ebpf/spike/generate.sh | 34 + internal/ebpf/spike/prociter_bpfeb.go | 136 + internal/ebpf/spike/prociter_bpfeb.o | Bin 0 -> 5592 bytes internal/ebpf/spike/prociter_bpfel.go | 136 + internal/ebpf/spike/prociter_bpfel.o | Bin 0 -> 5592 bytes internal/ebpf/spike/run.go | 290 ++ 24 files changed, 6928 insertions(+) create mode 100644 internal/ebpf/spike/c/LICENSE.BSD-2-Clause create mode 100644 internal/ebpf/spike/c/bpf_core_read.h create mode 100644 internal/ebpf/spike/c/bpf_endian.h create mode 100644 internal/ebpf/spike/c/bpf_helper_defs.h create mode 100644 internal/ebpf/spike/c/bpf_helpers.h create mode 100644 internal/ebpf/spike/c/bpf_tracing.h create mode 100644 internal/ebpf/spike/c/events.h create mode 100644 internal/ebpf/spike/c/execve.bpf.c create mode 100644 internal/ebpf/spike/c/proc_iter.bpf.c create mode 100644 internal/ebpf/spike/c/vmlinux.h create mode 100644 internal/ebpf/spike/cmd/spike/main.go create mode 100644 internal/ebpf/spike/enrich.go create mode 100644 internal/ebpf/spike/event.go create mode 100644 internal/ebpf/spike/execve_bpfeb.go create mode 100644 internal/ebpf/spike/execve_bpfeb.o create mode 100644 internal/ebpf/spike/execve_bpfel.go create mode 100644 internal/ebpf/spike/execve_bpfel.o create mode 100644 internal/ebpf/spike/gen.go create mode 100755 internal/ebpf/spike/generate.sh create mode 100644 internal/ebpf/spike/prociter_bpfeb.go create mode 100644 internal/ebpf/spike/prociter_bpfeb.o create mode 100644 internal/ebpf/spike/prociter_bpfel.go create mode 100644 internal/ebpf/spike/prociter_bpfel.o create mode 100644 internal/ebpf/spike/run.go diff --git a/internal/ebpf/spike/c/LICENSE.BSD-2-Clause b/internal/ebpf/spike/c/LICENSE.BSD-2-Clause new file mode 100644 index 000000000..da366e2ce --- /dev/null +++ b/internal/ebpf/spike/c/LICENSE.BSD-2-Clause @@ -0,0 +1,32 @@ +Valid-License-Identifier: BSD-2-Clause +SPDX-URL: https://spdx.org/licenses/BSD-2-Clause.html +Usage-Guide: + To use the BSD 2-clause "Simplified" License put the following SPDX + tag/value pair into a comment according to the placement guidelines in + the licensing rules documentation: + SPDX-License-Identifier: BSD-2-Clause +License-Text: + +Copyright (c) . All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/internal/ebpf/spike/c/bpf_core_read.h b/internal/ebpf/spike/c/bpf_core_read.h new file mode 100644 index 000000000..c0e13cdf9 --- /dev/null +++ b/internal/ebpf/spike/c/bpf_core_read.h @@ -0,0 +1,561 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __BPF_CORE_READ_H__ +#define __BPF_CORE_READ_H__ + +#include "bpf_helpers.h" + +/* + * enum bpf_field_info_kind is passed as a second argument into + * __builtin_preserve_field_info() built-in to get a specific aspect of + * a field, captured as a first argument. __builtin_preserve_field_info(field, + * info_kind) returns __u32 integer and produces BTF field relocation, which + * is understood and processed by libbpf during BPF object loading. See + * selftests/bpf for examples. + */ +enum bpf_field_info_kind { + BPF_FIELD_BYTE_OFFSET = 0, /* field byte offset */ + BPF_FIELD_BYTE_SIZE = 1, + BPF_FIELD_EXISTS = 2, /* field existence in target kernel */ + BPF_FIELD_SIGNED = 3, + BPF_FIELD_LSHIFT_U64 = 4, + BPF_FIELD_RSHIFT_U64 = 5, +}; + +/* second argument to __builtin_btf_type_id() built-in */ +enum bpf_type_id_kind { + BPF_TYPE_ID_LOCAL = 0, /* BTF type ID in local program */ + BPF_TYPE_ID_TARGET = 1, /* BTF type ID in target kernel */ +}; + +/* second argument to __builtin_preserve_type_info() built-in */ +enum bpf_type_info_kind { + BPF_TYPE_EXISTS = 0, /* type existence in target kernel */ + BPF_TYPE_SIZE = 1, /* type size in target kernel */ + BPF_TYPE_MATCHES = 2, /* type match in target kernel */ +}; + +/* second argument to __builtin_preserve_enum_value() built-in */ +enum bpf_enum_value_kind { + BPF_ENUMVAL_EXISTS = 0, /* enum value existence in kernel */ + BPF_ENUMVAL_VALUE = 1, /* enum value value relocation */ +}; + +#define __CORE_RELO(src, field, info) \ + __builtin_preserve_field_info((src)->field, BPF_FIELD_##info) + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define __CORE_BITFIELD_PROBE_READ(dst, src, fld) \ + bpf_probe_read_kernel( \ + (void *)dst, \ + __CORE_RELO(src, fld, BYTE_SIZE), \ + (const void *)src + __CORE_RELO(src, fld, BYTE_OFFSET)) +#else +/* semantics of LSHIFT_64 assumes loading values into low-ordered bytes, so + * for big-endian we need to adjust destination pointer accordingly, based on + * field byte size + */ +#define __CORE_BITFIELD_PROBE_READ(dst, src, fld) \ + bpf_probe_read_kernel( \ + (void *)dst + (8 - __CORE_RELO(src, fld, BYTE_SIZE)), \ + __CORE_RELO(src, fld, BYTE_SIZE), \ + (const void *)src + __CORE_RELO(src, fld, BYTE_OFFSET)) +#endif + +/* + * Extract bitfield, identified by s->field, and return its value as u64. + * All this is done in relocatable manner, so bitfield changes such as + * signedness, bit size, offset changes, this will be handled automatically. + * This version of macro is using bpf_probe_read_kernel() to read underlying + * integer storage. Macro functions as an expression and its return type is + * bpf_probe_read_kernel()'s return value: 0, on success, <0 on error. + */ +#define BPF_CORE_READ_BITFIELD_PROBED(s, field) ({ \ + unsigned long long val = 0; \ + \ + __CORE_BITFIELD_PROBE_READ(&val, s, field); \ + val <<= __CORE_RELO(s, field, LSHIFT_U64); \ + if (__CORE_RELO(s, field, SIGNED)) \ + val = ((long long)val) >> __CORE_RELO(s, field, RSHIFT_U64); \ + else \ + val = val >> __CORE_RELO(s, field, RSHIFT_U64); \ + val; \ +}) + +/* + * Extract bitfield, identified by s->field, and return its value as u64. + * This version of macro is using direct memory reads and should be used from + * BPF program types that support such functionality (e.g., typed raw + * tracepoints). + */ +#define BPF_CORE_READ_BITFIELD(s, field) ({ \ + const void *p = (const void *)s + __CORE_RELO(s, field, BYTE_OFFSET); \ + unsigned long long val; \ + \ + /* This is a so-called barrier_var() operation that makes specified \ + * variable "a black box" for optimizing compiler. \ + * It forces compiler to perform BYTE_OFFSET relocation on p and use \ + * its calculated value in the switch below, instead of applying \ + * the same relocation 4 times for each individual memory load. \ + */ \ + asm volatile("" : "=r"(p) : "0"(p)); \ + \ + switch (__CORE_RELO(s, field, BYTE_SIZE)) { \ + case 1: val = *(const unsigned char *)p; break; \ + case 2: val = *(const unsigned short *)p; break; \ + case 4: val = *(const unsigned int *)p; break; \ + case 8: val = *(const unsigned long long *)p; break; \ + default: val = 0; break; \ + } \ + val <<= __CORE_RELO(s, field, LSHIFT_U64); \ + if (__CORE_RELO(s, field, SIGNED)) \ + val = ((long long)val) >> __CORE_RELO(s, field, RSHIFT_U64); \ + else \ + val = val >> __CORE_RELO(s, field, RSHIFT_U64); \ + val; \ +}) + +/* + * Write to a bitfield, identified by s->field. + * This is the inverse of BPF_CORE_WRITE_BITFIELD(). + */ +#define BPF_CORE_WRITE_BITFIELD(s, field, new_val) ({ \ + void *p = (void *)s + __CORE_RELO(s, field, BYTE_OFFSET); \ + unsigned int byte_size = __CORE_RELO(s, field, BYTE_SIZE); \ + unsigned int lshift = __CORE_RELO(s, field, LSHIFT_U64); \ + unsigned int rshift = __CORE_RELO(s, field, RSHIFT_U64); \ + unsigned long long mask, val, nval = new_val; \ + unsigned int rpad = rshift - lshift; \ + \ + asm volatile("" : "+r"(p)); \ + \ + switch (byte_size) { \ + case 1: val = *(unsigned char *)p; break; \ + case 2: val = *(unsigned short *)p; break; \ + case 4: val = *(unsigned int *)p; break; \ + case 8: val = *(unsigned long long *)p; break; \ + } \ + \ + mask = (~0ULL << rshift) >> lshift; \ + val = (val & ~mask) | ((nval << rpad) & mask); \ + \ + switch (byte_size) { \ + case 1: *(unsigned char *)p = val; break; \ + case 2: *(unsigned short *)p = val; break; \ + case 4: *(unsigned int *)p = val; break; \ + case 8: *(unsigned long long *)p = val; break; \ + } \ +}) + +/* Differentiator between compilers builtin implementations. This is a + * requirement due to the compiler parsing differences where GCC optimizes + * early in parsing those constructs of type pointers to the builtin specific + * type, resulting in not being possible to collect the required type + * information in the builtin expansion. + */ +#ifdef __clang__ +#define ___bpf_typeof(type) ((typeof(type) *) 0) +#else +#define ___bpf_typeof1(type, NR) ({ \ + extern typeof(type) *___concat(bpf_type_tmp_, NR); \ + ___concat(bpf_type_tmp_, NR); \ +}) +#define ___bpf_typeof(type) ___bpf_typeof1(type, __COUNTER__) +#endif + +#ifdef __clang__ +#define ___bpf_field_ref1(field) (field) +#define ___bpf_field_ref2(type, field) (___bpf_typeof(type)->field) +#else +#define ___bpf_field_ref1(field) (&(field)) +#define ___bpf_field_ref2(type, field) (&(___bpf_typeof(type)->field)) +#endif +#define ___bpf_field_ref(args...) \ + ___bpf_apply(___bpf_field_ref, ___bpf_narg(args))(args) + +/* + * Convenience macro to check that field actually exists in target kernel's. + * Returns: + * 1, if matching field is present in target kernel; + * 0, if no matching field found. + * + * Supports two forms: + * - field reference through variable access: + * bpf_core_field_exists(p->my_field); + * - field reference through type and field names: + * bpf_core_field_exists(struct my_type, my_field). + */ +#define bpf_core_field_exists(field...) \ + __builtin_preserve_field_info(___bpf_field_ref(field), BPF_FIELD_EXISTS) + +/* + * Convenience macro to get the byte size of a field. Works for integers, + * struct/unions, pointers, arrays, and enums. + * + * Supports two forms: + * - field reference through variable access: + * bpf_core_field_size(p->my_field); + * - field reference through type and field names: + * bpf_core_field_size(struct my_type, my_field). + */ +#define bpf_core_field_size(field...) \ + __builtin_preserve_field_info(___bpf_field_ref(field), BPF_FIELD_BYTE_SIZE) + +/* + * Convenience macro to get field's byte offset. + * + * Supports two forms: + * - field reference through variable access: + * bpf_core_field_offset(p->my_field); + * - field reference through type and field names: + * bpf_core_field_offset(struct my_type, my_field). + */ +#define bpf_core_field_offset(field...) \ + __builtin_preserve_field_info(___bpf_field_ref(field), BPF_FIELD_BYTE_OFFSET) + +/* + * Convenience macro to get BTF type ID of a specified type, using a local BTF + * information. Return 32-bit unsigned integer with type ID from program's own + * BTF. Always succeeds. + */ +#define bpf_core_type_id_local(type) \ + __builtin_btf_type_id(*___bpf_typeof(type), BPF_TYPE_ID_LOCAL) + +/* + * Convenience macro to get BTF type ID of a target kernel's type that matches + * specified local type. + * Returns: + * - valid 32-bit unsigned type ID in kernel BTF; + * - 0, if no matching type was found in a target kernel BTF. + */ +#define bpf_core_type_id_kernel(type) \ + __builtin_btf_type_id(*___bpf_typeof(type), BPF_TYPE_ID_TARGET) + +/* + * Convenience macro to check that provided named type + * (struct/union/enum/typedef) exists in a target kernel. + * Returns: + * 1, if such type is present in target kernel's BTF; + * 0, if no matching type is found. + */ +#define bpf_core_type_exists(type) \ + __builtin_preserve_type_info(*___bpf_typeof(type), BPF_TYPE_EXISTS) + +/* + * Convenience macro to check that provided named type + * (struct/union/enum/typedef) "matches" that in a target kernel. + * Returns: + * 1, if the type matches in the target kernel's BTF; + * 0, if the type does not match any in the target kernel + */ +#define bpf_core_type_matches(type) \ + __builtin_preserve_type_info(*___bpf_typeof(type), BPF_TYPE_MATCHES) + +/* + * Convenience macro to get the byte size of a provided named type + * (struct/union/enum/typedef) in a target kernel. + * Returns: + * >= 0 size (in bytes), if type is present in target kernel's BTF; + * 0, if no matching type is found. + */ +#define bpf_core_type_size(type) \ + __builtin_preserve_type_info(*___bpf_typeof(type), BPF_TYPE_SIZE) + +/* + * Convenience macro to check that provided enumerator value is defined in + * a target kernel. + * Returns: + * 1, if specified enum type and its enumerator value are present in target + * kernel's BTF; + * 0, if no matching enum and/or enum value within that enum is found. + */ +#ifdef __clang__ +#define bpf_core_enum_value_exists(enum_type, enum_value) \ + __builtin_preserve_enum_value(*(typeof(enum_type) *)enum_value, BPF_ENUMVAL_EXISTS) +#else +#define bpf_core_enum_value_exists(enum_type, enum_value) \ + __builtin_preserve_enum_value(___bpf_typeof(enum_type), enum_value, BPF_ENUMVAL_EXISTS) +#endif + +/* + * Convenience macro to get the integer value of an enumerator value in + * a target kernel. + * Returns: + * 64-bit value, if specified enum type and its enumerator value are + * present in target kernel's BTF; + * 0, if no matching enum and/or enum value within that enum is found. + */ +#ifdef __clang__ +#define bpf_core_enum_value(enum_type, enum_value) \ + __builtin_preserve_enum_value(*(typeof(enum_type) *)enum_value, BPF_ENUMVAL_VALUE) +#else +#define bpf_core_enum_value(enum_type, enum_value) \ + __builtin_preserve_enum_value(___bpf_typeof(enum_type), enum_value, BPF_ENUMVAL_VALUE) +#endif + +/* + * bpf_core_read() abstracts away bpf_probe_read_kernel() call and captures + * offset relocation for source address using __builtin_preserve_access_index() + * built-in, provided by Clang. + * + * __builtin_preserve_access_index() takes as an argument an expression of + * taking an address of a field within struct/union. It makes compiler emit + * a relocation, which records BTF type ID describing root struct/union and an + * accessor string which describes exact embedded field that was used to take + * an address. See detailed description of this relocation format and + * semantics in comments to struct bpf_core_relo in include/uapi/linux/bpf.h. + * + * This relocation allows libbpf to adjust BPF instruction to use correct + * actual field offset, based on target kernel BTF type that matches original + * (local) BTF, used to record relocation. + */ +#define bpf_core_read(dst, sz, src) \ + bpf_probe_read_kernel(dst, sz, (const void *)__builtin_preserve_access_index(src)) + +/* NOTE: see comments for BPF_CORE_READ_USER() about the proper types use. */ +#define bpf_core_read_user(dst, sz, src) \ + bpf_probe_read_user(dst, sz, (const void *)__builtin_preserve_access_index(src)) +/* + * bpf_core_read_str() is a thin wrapper around bpf_probe_read_str() + * additionally emitting BPF CO-RE field relocation for specified source + * argument. + */ +#define bpf_core_read_str(dst, sz, src) \ + bpf_probe_read_kernel_str(dst, sz, (const void *)__builtin_preserve_access_index(src)) + +/* NOTE: see comments for BPF_CORE_READ_USER() about the proper types use. */ +#define bpf_core_read_user_str(dst, sz, src) \ + bpf_probe_read_user_str(dst, sz, (const void *)__builtin_preserve_access_index(src)) + +extern void *bpf_rdonly_cast(const void *obj, __u32 btf_id) __ksym __weak; + +/* + * Cast provided pointer *ptr* into a pointer to a specified *type* in such + * a way that BPF verifier will become aware of associated kernel-side BTF + * type. This allows to access members of kernel types directly without the + * need to use BPF_CORE_READ() macros. + */ +#define bpf_core_cast(ptr, type) \ + ((typeof(type) *)bpf_rdonly_cast((ptr), bpf_core_type_id_kernel(type))) + +#define ___concat(a, b) a ## b +#define ___apply(fn, n) ___concat(fn, n) +#define ___nth(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, __11, N, ...) N + +/* + * return number of provided arguments; used for switch-based variadic macro + * definitions (see ___last, ___arrow, etc below) + */ +#define ___narg(...) ___nth(_, ##__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +/* + * return 0 if no arguments are passed, N - otherwise; used for + * recursively-defined macros to specify termination (0) case, and generic + * (N) case (e.g., ___read_ptrs, ___core_read) + */ +#define ___empty(...) ___nth(_, ##__VA_ARGS__, N, N, N, N, N, N, N, N, N, N, 0) + +#define ___last1(x) x +#define ___last2(a, x) x +#define ___last3(a, b, x) x +#define ___last4(a, b, c, x) x +#define ___last5(a, b, c, d, x) x +#define ___last6(a, b, c, d, e, x) x +#define ___last7(a, b, c, d, e, f, x) x +#define ___last8(a, b, c, d, e, f, g, x) x +#define ___last9(a, b, c, d, e, f, g, h, x) x +#define ___last10(a, b, c, d, e, f, g, h, i, x) x +#define ___last(...) ___apply(___last, ___narg(__VA_ARGS__))(__VA_ARGS__) + +#define ___nolast2(a, _) a +#define ___nolast3(a, b, _) a, b +#define ___nolast4(a, b, c, _) a, b, c +#define ___nolast5(a, b, c, d, _) a, b, c, d +#define ___nolast6(a, b, c, d, e, _) a, b, c, d, e +#define ___nolast7(a, b, c, d, e, f, _) a, b, c, d, e, f +#define ___nolast8(a, b, c, d, e, f, g, _) a, b, c, d, e, f, g +#define ___nolast9(a, b, c, d, e, f, g, h, _) a, b, c, d, e, f, g, h +#define ___nolast10(a, b, c, d, e, f, g, h, i, _) a, b, c, d, e, f, g, h, i +#define ___nolast(...) ___apply(___nolast, ___narg(__VA_ARGS__))(__VA_ARGS__) + +#define ___arrow1(a) a +#define ___arrow2(a, b) a->b +#define ___arrow3(a, b, c) a->b->c +#define ___arrow4(a, b, c, d) a->b->c->d +#define ___arrow5(a, b, c, d, e) a->b->c->d->e +#define ___arrow6(a, b, c, d, e, f) a->b->c->d->e->f +#define ___arrow7(a, b, c, d, e, f, g) a->b->c->d->e->f->g +#define ___arrow8(a, b, c, d, e, f, g, h) a->b->c->d->e->f->g->h +#define ___arrow9(a, b, c, d, e, f, g, h, i) a->b->c->d->e->f->g->h->i +#define ___arrow10(a, b, c, d, e, f, g, h, i, j) a->b->c->d->e->f->g->h->i->j +#define ___arrow(...) ___apply(___arrow, ___narg(__VA_ARGS__))(__VA_ARGS__) + +#define ___type(...) typeof(___arrow(__VA_ARGS__)) + +#define ___read(read_fn, dst, src_type, src, accessor) \ + read_fn((void *)(dst), sizeof(*(dst)), &((src_type)(src))->accessor) + +/* "recursively" read a sequence of inner pointers using local __t var */ +#define ___rd_first(fn, src, a) ___read(fn, &__t, ___type(src), src, a); +#define ___rd_last(fn, ...) \ + ___read(fn, &__t, ___type(___nolast(__VA_ARGS__)), __t, ___last(__VA_ARGS__)); +#define ___rd_p1(fn, ...) const void *__t; ___rd_first(fn, __VA_ARGS__) +#define ___rd_p2(fn, ...) ___rd_p1(fn, ___nolast(__VA_ARGS__)) ___rd_last(fn, __VA_ARGS__) +#define ___rd_p3(fn, ...) ___rd_p2(fn, ___nolast(__VA_ARGS__)) ___rd_last(fn, __VA_ARGS__) +#define ___rd_p4(fn, ...) ___rd_p3(fn, ___nolast(__VA_ARGS__)) ___rd_last(fn, __VA_ARGS__) +#define ___rd_p5(fn, ...) ___rd_p4(fn, ___nolast(__VA_ARGS__)) ___rd_last(fn, __VA_ARGS__) +#define ___rd_p6(fn, ...) ___rd_p5(fn, ___nolast(__VA_ARGS__)) ___rd_last(fn, __VA_ARGS__) +#define ___rd_p7(fn, ...) ___rd_p6(fn, ___nolast(__VA_ARGS__)) ___rd_last(fn, __VA_ARGS__) +#define ___rd_p8(fn, ...) ___rd_p7(fn, ___nolast(__VA_ARGS__)) ___rd_last(fn, __VA_ARGS__) +#define ___rd_p9(fn, ...) ___rd_p8(fn, ___nolast(__VA_ARGS__)) ___rd_last(fn, __VA_ARGS__) +#define ___read_ptrs(fn, src, ...) \ + ___apply(___rd_p, ___narg(__VA_ARGS__))(fn, src, __VA_ARGS__) + +#define ___core_read0(fn, fn_ptr, dst, src, a) \ + ___read(fn, dst, ___type(src), src, a); +#define ___core_readN(fn, fn_ptr, dst, src, ...) \ + ___read_ptrs(fn_ptr, src, ___nolast(__VA_ARGS__)) \ + ___read(fn, dst, ___type(src, ___nolast(__VA_ARGS__)), __t, \ + ___last(__VA_ARGS__)); +#define ___core_read(fn, fn_ptr, dst, src, a, ...) \ + ___apply(___core_read, ___empty(__VA_ARGS__))(fn, fn_ptr, dst, \ + src, a, ##__VA_ARGS__) + +/* + * BPF_CORE_READ_INTO() is a more performance-conscious variant of + * BPF_CORE_READ(), in which final field is read into user-provided storage. + * See BPF_CORE_READ() below for more details on general usage. + */ +#define BPF_CORE_READ_INTO(dst, src, a, ...) ({ \ + ___core_read(bpf_core_read, bpf_core_read, \ + dst, (src), a, ##__VA_ARGS__) \ +}) + +/* + * Variant of BPF_CORE_READ_INTO() for reading from user-space memory. + * + * NOTE: see comments for BPF_CORE_READ_USER() about the proper types use. + */ +#define BPF_CORE_READ_USER_INTO(dst, src, a, ...) ({ \ + ___core_read(bpf_core_read_user, bpf_core_read_user, \ + dst, (src), a, ##__VA_ARGS__) \ +}) + +/* Non-CO-RE variant of BPF_CORE_READ_INTO() */ +#define BPF_PROBE_READ_INTO(dst, src, a, ...) ({ \ + ___core_read(bpf_probe_read_kernel, bpf_probe_read_kernel, \ + dst, (src), a, ##__VA_ARGS__) \ +}) + +/* Non-CO-RE variant of BPF_CORE_READ_USER_INTO(). + * + * As no CO-RE relocations are emitted, source types can be arbitrary and are + * not restricted to kernel types only. + */ +#define BPF_PROBE_READ_USER_INTO(dst, src, a, ...) ({ \ + ___core_read(bpf_probe_read_user, bpf_probe_read_user, \ + dst, (src), a, ##__VA_ARGS__) \ +}) + +/* + * BPF_CORE_READ_STR_INTO() does same "pointer chasing" as + * BPF_CORE_READ() for intermediate pointers, but then executes (and returns + * corresponding error code) bpf_core_read_str() for final string read. + */ +#define BPF_CORE_READ_STR_INTO(dst, src, a, ...) ({ \ + ___core_read(bpf_core_read_str, bpf_core_read, \ + dst, (src), a, ##__VA_ARGS__) \ +}) + +/* + * Variant of BPF_CORE_READ_STR_INTO() for reading from user-space memory. + * + * NOTE: see comments for BPF_CORE_READ_USER() about the proper types use. + */ +#define BPF_CORE_READ_USER_STR_INTO(dst, src, a, ...) ({ \ + ___core_read(bpf_core_read_user_str, bpf_core_read_user, \ + dst, (src), a, ##__VA_ARGS__) \ +}) + +/* Non-CO-RE variant of BPF_CORE_READ_STR_INTO() */ +#define BPF_PROBE_READ_STR_INTO(dst, src, a, ...) ({ \ + ___core_read(bpf_probe_read_kernel_str, bpf_probe_read_kernel, \ + dst, (src), a, ##__VA_ARGS__) \ +}) + +/* + * Non-CO-RE variant of BPF_CORE_READ_USER_STR_INTO(). + * + * As no CO-RE relocations are emitted, source types can be arbitrary and are + * not restricted to kernel types only. + */ +#define BPF_PROBE_READ_USER_STR_INTO(dst, src, a, ...) ({ \ + ___core_read(bpf_probe_read_user_str, bpf_probe_read_user, \ + dst, (src), a, ##__VA_ARGS__) \ +}) + +/* + * BPF_CORE_READ() is used to simplify BPF CO-RE relocatable read, especially + * when there are few pointer chasing steps. + * E.g., what in non-BPF world (or in BPF w/ BCC) would be something like: + * int x = s->a.b.c->d.e->f->g; + * can be succinctly achieved using BPF_CORE_READ as: + * int x = BPF_CORE_READ(s, a.b.c, d.e, f, g); + * + * BPF_CORE_READ will decompose above statement into 4 bpf_core_read (BPF + * CO-RE relocatable bpf_probe_read_kernel() wrapper) calls, logically + * equivalent to: + * 1. const void *__t = s->a.b.c; + * 2. __t = __t->d.e; + * 3. __t = __t->f; + * 4. return __t->g; + * + * Equivalence is logical, because there is a heavy type casting/preservation + * involved, as well as all the reads are happening through + * bpf_probe_read_kernel() calls using __builtin_preserve_access_index() to + * emit CO-RE relocations. + * + * N.B. Only up to 9 "field accessors" are supported, which should be more + * than enough for any practical purpose. + */ +#define BPF_CORE_READ(src, a, ...) ({ \ + ___type((src), a, ##__VA_ARGS__) __r; \ + BPF_CORE_READ_INTO(&__r, (src), a, ##__VA_ARGS__); \ + __r; \ +}) + +/* + * Variant of BPF_CORE_READ() for reading from user-space memory. + * + * NOTE: all the source types involved are still *kernel types* and need to + * exist in kernel (or kernel module) BTF, otherwise CO-RE relocation will + * fail. Custom user types are not relocatable with CO-RE. + * The typical situation in which BPF_CORE_READ_USER() might be used is to + * read kernel UAPI types from the user-space memory passed in as a syscall + * input argument. + */ +#define BPF_CORE_READ_USER(src, a, ...) ({ \ + ___type((src), a, ##__VA_ARGS__) __r; \ + BPF_CORE_READ_USER_INTO(&__r, (src), a, ##__VA_ARGS__); \ + __r; \ +}) + +/* Non-CO-RE variant of BPF_CORE_READ() */ +#define BPF_PROBE_READ(src, a, ...) ({ \ + ___type((src), a, ##__VA_ARGS__) __r; \ + BPF_PROBE_READ_INTO(&__r, (src), a, ##__VA_ARGS__); \ + __r; \ +}) + +/* + * Non-CO-RE variant of BPF_CORE_READ_USER(). + * + * As no CO-RE relocations are emitted, source types can be arbitrary and are + * not restricted to kernel types only. + */ +#define BPF_PROBE_READ_USER(src, a, ...) ({ \ + ___type((src), a, ##__VA_ARGS__) __r; \ + BPF_PROBE_READ_USER_INTO(&__r, (src), a, ##__VA_ARGS__); \ + __r; \ +}) + +#endif + diff --git a/internal/ebpf/spike/c/bpf_endian.h b/internal/ebpf/spike/c/bpf_endian.h new file mode 100644 index 000000000..ec9db4fec --- /dev/null +++ b/internal/ebpf/spike/c/bpf_endian.h @@ -0,0 +1,99 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __BPF_ENDIAN__ +#define __BPF_ENDIAN__ + +/* + * Isolate byte #n and put it into byte #m, for __u##b type. + * E.g., moving byte #6 (nnnnnnnn) into byte #1 (mmmmmmmm) for __u64: + * 1) xxxxxxxx nnnnnnnn xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx mmmmmmmm xxxxxxxx + * 2) nnnnnnnn xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx mmmmmmmm xxxxxxxx 00000000 + * 3) 00000000 00000000 00000000 00000000 00000000 00000000 00000000 nnnnnnnn + * 4) 00000000 00000000 00000000 00000000 00000000 00000000 nnnnnnnn 00000000 + */ +#define ___bpf_mvb(x, b, n, m) ((__u##b)(x) << (b-(n+1)*8) >> (b-8) << (m*8)) + +#define ___bpf_swab16(x) ((__u16)( \ + ___bpf_mvb(x, 16, 0, 1) | \ + ___bpf_mvb(x, 16, 1, 0))) + +#define ___bpf_swab32(x) ((__u32)( \ + ___bpf_mvb(x, 32, 0, 3) | \ + ___bpf_mvb(x, 32, 1, 2) | \ + ___bpf_mvb(x, 32, 2, 1) | \ + ___bpf_mvb(x, 32, 3, 0))) + +#define ___bpf_swab64(x) ((__u64)( \ + ___bpf_mvb(x, 64, 0, 7) | \ + ___bpf_mvb(x, 64, 1, 6) | \ + ___bpf_mvb(x, 64, 2, 5) | \ + ___bpf_mvb(x, 64, 3, 4) | \ + ___bpf_mvb(x, 64, 4, 3) | \ + ___bpf_mvb(x, 64, 5, 2) | \ + ___bpf_mvb(x, 64, 6, 1) | \ + ___bpf_mvb(x, 64, 7, 0))) + +/* LLVM's BPF target selects the endianness of the CPU + * it compiles on, or the user specifies (bpfel/bpfeb), + * respectively. The used __BYTE_ORDER__ is defined by + * the compiler, we cannot rely on __BYTE_ORDER from + * libc headers, since it doesn't reflect the actual + * requested byte order. + * + * Note, LLVM's BPF target has different __builtin_bswapX() + * semantics. It does map to BPF_ALU | BPF_END | BPF_TO_BE + * in bpfel and bpfeb case, which means below, that we map + * to cpu_to_be16(). We could use it unconditionally in BPF + * case, but better not rely on it, so that this header here + * can be used from application and BPF program side, which + * use different targets. + */ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +# define __bpf_ntohs(x) __builtin_bswap16(x) +# define __bpf_htons(x) __builtin_bswap16(x) +# define __bpf_constant_ntohs(x) ___bpf_swab16(x) +# define __bpf_constant_htons(x) ___bpf_swab16(x) +# define __bpf_ntohl(x) __builtin_bswap32(x) +# define __bpf_htonl(x) __builtin_bswap32(x) +# define __bpf_constant_ntohl(x) ___bpf_swab32(x) +# define __bpf_constant_htonl(x) ___bpf_swab32(x) +# define __bpf_be64_to_cpu(x) __builtin_bswap64(x) +# define __bpf_cpu_to_be64(x) __builtin_bswap64(x) +# define __bpf_constant_be64_to_cpu(x) ___bpf_swab64(x) +# define __bpf_constant_cpu_to_be64(x) ___bpf_swab64(x) +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define __bpf_ntohs(x) (x) +# define __bpf_htons(x) (x) +# define __bpf_constant_ntohs(x) (x) +# define __bpf_constant_htons(x) (x) +# define __bpf_ntohl(x) (x) +# define __bpf_htonl(x) (x) +# define __bpf_constant_ntohl(x) (x) +# define __bpf_constant_htonl(x) (x) +# define __bpf_be64_to_cpu(x) (x) +# define __bpf_cpu_to_be64(x) (x) +# define __bpf_constant_be64_to_cpu(x) (x) +# define __bpf_constant_cpu_to_be64(x) (x) +#else +# error "Fix your compiler's __BYTE_ORDER__?!" +#endif + +#define bpf_htons(x) \ + (__builtin_constant_p(x) ? \ + __bpf_constant_htons(x) : __bpf_htons(x)) +#define bpf_ntohs(x) \ + (__builtin_constant_p(x) ? \ + __bpf_constant_ntohs(x) : __bpf_ntohs(x)) +#define bpf_htonl(x) \ + (__builtin_constant_p(x) ? \ + __bpf_constant_htonl(x) : __bpf_htonl(x)) +#define bpf_ntohl(x) \ + (__builtin_constant_p(x) ? \ + __bpf_constant_ntohl(x) : __bpf_ntohl(x)) +#define bpf_cpu_to_be64(x) \ + (__builtin_constant_p(x) ? \ + __bpf_constant_cpu_to_be64(x) : __bpf_cpu_to_be64(x)) +#define bpf_be64_to_cpu(x) \ + (__builtin_constant_p(x) ? \ + __bpf_constant_be64_to_cpu(x) : __bpf_be64_to_cpu(x)) + +#endif /* __BPF_ENDIAN__ */ diff --git a/internal/ebpf/spike/c/bpf_helper_defs.h b/internal/ebpf/spike/c/bpf_helper_defs.h new file mode 100644 index 000000000..3fbe7ff2a --- /dev/null +++ b/internal/ebpf/spike/c/bpf_helper_defs.h @@ -0,0 +1,4139 @@ +/* This is auto-generated file. See bpf_doc.py for details. */ + +/* Forward declarations of BPF structs */ +struct bpf_fib_lookup; +struct bpf_sk_lookup; +struct bpf_perf_event_data; +struct bpf_perf_event_value; +struct bpf_pidns_info; +struct bpf_redir_neigh; +struct bpf_sock; +struct bpf_sock_addr; +struct bpf_sock_ops; +struct bpf_sock_tuple; +struct bpf_spin_lock; +struct bpf_sysctl; +struct bpf_tcp_sock; +struct bpf_tunnel_key; +struct bpf_xfrm_state; +struct linux_binprm; +struct pt_regs; +struct sk_reuseport_md; +struct sockaddr; +struct tcphdr; +struct seq_file; +struct tcp6_sock; +struct tcp_sock; +struct tcp_timewait_sock; +struct tcp_request_sock; +struct udp6_sock; +struct unix_sock; +struct task_struct; +struct __sk_buff; +struct sk_msg_md; +struct xdp_md; +struct path; +struct btf_ptr; +struct inode; +struct socket; +struct file; +struct bpf_timer; + +/* + * bpf_map_lookup_elem + * + * Perform a lookup in *map* for an entry associated to *key*. + * + * Returns + * Map value associated to *key*, or **NULL** if no entry was + * found. + */ +static void *(*bpf_map_lookup_elem)(void *map, const void *key) = (void *) 1; + +/* + * bpf_map_update_elem + * + * Add or update the value of the entry associated to *key* in + * *map* with *value*. *flags* is one of: + * + * **BPF_NOEXIST** + * The entry for *key* must not exist in the map. + * **BPF_EXIST** + * The entry for *key* must already exist in the map. + * **BPF_ANY** + * No condition on the existence of the entry for *key*. + * + * Flag value **BPF_NOEXIST** cannot be used for maps of types + * **BPF_MAP_TYPE_ARRAY** or **BPF_MAP_TYPE_PERCPU_ARRAY** (all + * elements always exist), the helper would return an error. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_map_update_elem)(void *map, const void *key, const void *value, __u64 flags) = (void *) 2; + +/* + * bpf_map_delete_elem + * + * Delete entry with *key* from *map*. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_map_delete_elem)(void *map, const void *key) = (void *) 3; + +/* + * bpf_probe_read + * + * For tracing programs, safely attempt to read *size* bytes from + * kernel space address *unsafe_ptr* and store the data in *dst*. + * + * Generally, use **bpf_probe_read_user**\ () or + * **bpf_probe_read_kernel**\ () instead. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_probe_read)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 4; + +/* + * bpf_ktime_get_ns + * + * Return the time elapsed since system boot, in nanoseconds. + * Does not include time the system was suspended. + * See: **clock_gettime**\ (**CLOCK_MONOTONIC**) + * + * Returns + * Current *ktime*. + */ +static __u64 (*bpf_ktime_get_ns)(void) = (void *) 5; + +/* + * bpf_trace_printk + * + * This helper is a "printk()-like" facility for debugging. It + * prints a message defined by format *fmt* (of size *fmt_size*) + * to file *\/sys/kernel/debug/tracing/trace* from DebugFS, if + * available. It can take up to three additional **u64** + * arguments (as an eBPF helpers, the total number of arguments is + * limited to five). + * + * Each time the helper is called, it appends a line to the trace. + * Lines are discarded while *\/sys/kernel/debug/tracing/trace* is + * open, use *\/sys/kernel/debug/tracing/trace_pipe* to avoid this. + * The format of the trace is customizable, and the exact output + * one will get depends on the options set in + * *\/sys/kernel/debug/tracing/trace_options* (see also the + * *README* file under the same directory). However, it usually + * defaults to something like: + * + * :: + * + * telnet-470 [001] .N.. 419421.045894: 0x00000001: + * + * In the above: + * + * * ``telnet`` is the name of the current task. + * * ``470`` is the PID of the current task. + * * ``001`` is the CPU number on which the task is + * running. + * * In ``.N..``, each character refers to a set of + * options (whether irqs are enabled, scheduling + * options, whether hard/softirqs are running, level of + * preempt_disabled respectively). **N** means that + * **TIF_NEED_RESCHED** and **PREEMPT_NEED_RESCHED** + * are set. + * * ``419421.045894`` is a timestamp. + * * ``0x00000001`` is a fake value used by BPF for the + * instruction pointer register. + * * ```` is the message formatted with + * *fmt*. + * + * The conversion specifiers supported by *fmt* are similar, but + * more limited than for printk(). They are **%d**, **%i**, + * **%u**, **%x**, **%ld**, **%li**, **%lu**, **%lx**, **%lld**, + * **%lli**, **%llu**, **%llx**, **%p**, **%s**. No modifier (size + * of field, padding with zeroes, etc.) is available, and the + * helper will return **-EINVAL** (but print nothing) if it + * encounters an unknown specifier. + * + * Also, note that **bpf_trace_printk**\ () is slow, and should + * only be used for debugging purposes. For this reason, a notice + * block (spanning several lines) is printed to kernel logs and + * states that the helper should not be used "for production use" + * the first time this helper is used (or more precisely, when + * **trace_printk**\ () buffers are allocated). For passing values + * to user space, perf events should be preferred. + * + * Returns + * The number of bytes written to the buffer, or a negative error + * in case of failure. + */ +static long (*bpf_trace_printk)(const char *fmt, __u32 fmt_size, ...) = (void *) 6; + +/* + * bpf_get_prandom_u32 + * + * Get a pseudo-random number. + * + * From a security point of view, this helper uses its own + * pseudo-random internal state, and cannot be used to infer the + * seed of other random functions in the kernel. However, it is + * essential to note that the generator used by the helper is not + * cryptographically secure. + * + * Returns + * A random 32-bit unsigned value. + */ +static __u32 (*bpf_get_prandom_u32)(void) = (void *) 7; + +/* + * bpf_get_smp_processor_id + * + * Get the SMP (symmetric multiprocessing) processor id. Note that + * all programs run with migration disabled, which means that the + * SMP processor id is stable during all the execution of the + * program. + * + * Returns + * The SMP id of the processor running the program. + */ +static __u32 (*bpf_get_smp_processor_id)(void) = (void *) 8; + +/* + * bpf_skb_store_bytes + * + * Store *len* bytes from address *from* into the packet + * associated to *skb*, at *offset*. *flags* are a combination of + * **BPF_F_RECOMPUTE_CSUM** (automatically recompute the + * checksum for the packet after storing the bytes) and + * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\ + * **->swhash** and *skb*\ **->l4hash** to 0). + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_store_bytes)(struct __sk_buff *skb, __u32 offset, const void *from, __u32 len, __u64 flags) = (void *) 9; + +/* + * bpf_l3_csum_replace + * + * Recompute the layer 3 (e.g. IP) checksum for the packet + * associated to *skb*. Computation is incremental, so the helper + * must know the former value of the header field that was + * modified (*from*), the new value of this field (*to*), and the + * number of bytes (2 or 4) for this field, stored in *size*. + * Alternatively, it is possible to store the difference between + * the previous and the new values of the header field in *to*, by + * setting *from* and *size* to 0. For both methods, *offset* + * indicates the location of the IP checksum within the packet. + * + * This helper works in combination with **bpf_csum_diff**\ (), + * which does not update the checksum in-place, but offers more + * flexibility and can handle sizes larger than 2 or 4 for the + * checksum to update. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_l3_csum_replace)(struct __sk_buff *skb, __u32 offset, __u64 from, __u64 to, __u64 size) = (void *) 10; + +/* + * bpf_l4_csum_replace + * + * Recompute the layer 4 (e.g. TCP, UDP or ICMP) checksum for the + * packet associated to *skb*. Computation is incremental, so the + * helper must know the former value of the header field that was + * modified (*from*), the new value of this field (*to*), and the + * number of bytes (2 or 4) for this field, stored on the lowest + * four bits of *flags*. Alternatively, it is possible to store + * the difference between the previous and the new values of the + * header field in *to*, by setting *from* and the four lowest + * bits of *flags* to 0. For both methods, *offset* indicates the + * location of the IP checksum within the packet. In addition to + * the size of the field, *flags* can be added (bitwise OR) actual + * flags. With **BPF_F_MARK_MANGLED_0**, a null checksum is left + * untouched (unless **BPF_F_MARK_ENFORCE** is added as well), and + * for updates resulting in a null checksum the value is set to + * **CSUM_MANGLED_0** instead. Flag **BPF_F_PSEUDO_HDR** indicates + * the checksum is to be computed against a pseudo-header. + * + * This helper works in combination with **bpf_csum_diff**\ (), + * which does not update the checksum in-place, but offers more + * flexibility and can handle sizes larger than 2 or 4 for the + * checksum to update. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_l4_csum_replace)(struct __sk_buff *skb, __u32 offset, __u64 from, __u64 to, __u64 flags) = (void *) 11; + +/* + * bpf_tail_call + * + * This special helper is used to trigger a "tail call", or in + * other words, to jump into another eBPF program. The same stack + * frame is used (but values on stack and in registers for the + * caller are not accessible to the callee). This mechanism allows + * for program chaining, either for raising the maximum number of + * available eBPF instructions, or to execute given programs in + * conditional blocks. For security reasons, there is an upper + * limit to the number of successive tail calls that can be + * performed. + * + * Upon call of this helper, the program attempts to jump into a + * program referenced at index *index* in *prog_array_map*, a + * special map of type **BPF_MAP_TYPE_PROG_ARRAY**, and passes + * *ctx*, a pointer to the context. + * + * If the call succeeds, the kernel immediately runs the first + * instruction of the new program. This is not a function call, + * and it never returns to the previous program. If the call + * fails, then the helper has no effect, and the caller continues + * to run its subsequent instructions. A call can fail if the + * destination program for the jump does not exist (i.e. *index* + * is superior to the number of entries in *prog_array_map*), or + * if the maximum number of tail calls has been reached for this + * chain of programs. This limit is defined in the kernel by the + * macro **MAX_TAIL_CALL_CNT** (not accessible to user space), + * which is currently set to 33. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_tail_call)(void *ctx, void *prog_array_map, __u32 index) = (void *) 12; + +/* + * bpf_clone_redirect + * + * Clone and redirect the packet associated to *skb* to another + * net device of index *ifindex*. Both ingress and egress + * interfaces can be used for redirection. The **BPF_F_INGRESS** + * value in *flags* is used to make the distinction (ingress path + * is selected if the flag is present, egress path otherwise). + * This is the only flag supported for now. + * + * In comparison with **bpf_redirect**\ () helper, + * **bpf_clone_redirect**\ () has the associated cost of + * duplicating the packet buffer, but this can be executed out of + * the eBPF program. Conversely, **bpf_redirect**\ () is more + * efficient, but it is handled through an action code where the + * redirection happens only after the eBPF program has returned. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_clone_redirect)(struct __sk_buff *skb, __u32 ifindex, __u64 flags) = (void *) 13; + +/* + * bpf_get_current_pid_tgid + * + * + * Returns + * A 64-bit integer containing the current tgid and pid, and + * created as such: + * *current_task*\ **->tgid << 32 \|** + * *current_task*\ **->pid**. + */ +static __u64 (*bpf_get_current_pid_tgid)(void) = (void *) 14; + +/* + * bpf_get_current_uid_gid + * + * + * Returns + * A 64-bit integer containing the current GID and UID, and + * created as such: *current_gid* **<< 32 \|** *current_uid*. + */ +static __u64 (*bpf_get_current_uid_gid)(void) = (void *) 15; + +/* + * bpf_get_current_comm + * + * Copy the **comm** attribute of the current task into *buf* of + * *size_of_buf*. The **comm** attribute contains the name of + * the executable (excluding the path) for the current task. The + * *size_of_buf* must be strictly positive. On success, the + * helper makes sure that the *buf* is NUL-terminated. On failure, + * it is filled with zeroes. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_get_current_comm)(void *buf, __u32 size_of_buf) = (void *) 16; + +/* + * bpf_get_cgroup_classid + * + * Retrieve the classid for the current task, i.e. for the net_cls + * cgroup to which *skb* belongs. + * + * This helper can be used on TC egress path, but not on ingress. + * + * The net_cls cgroup provides an interface to tag network packets + * based on a user-provided identifier for all traffic coming from + * the tasks belonging to the related cgroup. See also the related + * kernel documentation, available from the Linux sources in file + * *Documentation/admin-guide/cgroup-v1/net_cls.rst*. + * + * The Linux kernel has two versions for cgroups: there are + * cgroups v1 and cgroups v2. Both are available to users, who can + * use a mixture of them, but note that the net_cls cgroup is for + * cgroup v1 only. This makes it incompatible with BPF programs + * run on cgroups, which is a cgroup-v2-only feature (a socket can + * only hold data for one version of cgroups at a time). + * + * This helper is only available is the kernel was compiled with + * the **CONFIG_CGROUP_NET_CLASSID** configuration option set to + * "**y**" or to "**m**". + * + * Returns + * The classid, or 0 for the default unconfigured classid. + */ +static __u32 (*bpf_get_cgroup_classid)(struct __sk_buff *skb) = (void *) 17; + +/* + * bpf_skb_vlan_push + * + * Push a *vlan_tci* (VLAN tag control information) of protocol + * *vlan_proto* to the packet associated to *skb*, then update + * the checksum. Note that if *vlan_proto* is different from + * **ETH_P_8021Q** and **ETH_P_8021AD**, it is considered to + * be **ETH_P_8021Q**. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_vlan_push)(struct __sk_buff *skb, __be16 vlan_proto, __u16 vlan_tci) = (void *) 18; + +/* + * bpf_skb_vlan_pop + * + * Pop a VLAN header from the packet associated to *skb*. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_vlan_pop)(struct __sk_buff *skb) = (void *) 19; + +/* + * bpf_skb_get_tunnel_key + * + * Get tunnel metadata. This helper takes a pointer *key* to an + * empty **struct bpf_tunnel_key** of **size**, that will be + * filled with tunnel metadata for the packet associated to *skb*. + * The *flags* can be set to **BPF_F_TUNINFO_IPV6**, which + * indicates that the tunnel is based on IPv6 protocol instead of + * IPv4. + * + * The **struct bpf_tunnel_key** is an object that generalizes the + * principal parameters used by various tunneling protocols into a + * single struct. This way, it can be used to easily make a + * decision based on the contents of the encapsulation header, + * "summarized" in this struct. In particular, it holds the IP + * address of the remote end (IPv4 or IPv6, depending on the case) + * in *key*\ **->remote_ipv4** or *key*\ **->remote_ipv6**. Also, + * this struct exposes the *key*\ **->tunnel_id**, which is + * generally mapped to a VNI (Virtual Network Identifier), making + * it programmable together with the **bpf_skb_set_tunnel_key**\ + * () helper. + * + * Let's imagine that the following code is part of a program + * attached to the TC ingress interface, on one end of a GRE + * tunnel, and is supposed to filter out all messages coming from + * remote ends with IPv4 address other than 10.0.0.1: + * + * :: + * + * int ret; + * struct bpf_tunnel_key key = {}; + * + * ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0); + * if (ret < 0) + * return TC_ACT_SHOT; // drop packet + * + * if (key.remote_ipv4 != 0x0a000001) + * return TC_ACT_SHOT; // drop packet + * + * return TC_ACT_OK; // accept packet + * + * This interface can also be used with all encapsulation devices + * that can operate in "collect metadata" mode: instead of having + * one network device per specific configuration, the "collect + * metadata" mode only requires a single device where the + * configuration can be extracted from this helper. + * + * This can be used together with various tunnels such as VXLan, + * Geneve, GRE or IP in IP (IPIP). + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_get_tunnel_key)(struct __sk_buff *skb, struct bpf_tunnel_key *key, __u32 size, __u64 flags) = (void *) 20; + +/* + * bpf_skb_set_tunnel_key + * + * Populate tunnel metadata for packet associated to *skb.* The + * tunnel metadata is set to the contents of *key*, of *size*. The + * *flags* can be set to a combination of the following values: + * + * **BPF_F_TUNINFO_IPV6** + * Indicate that the tunnel is based on IPv6 protocol + * instead of IPv4. + * **BPF_F_ZERO_CSUM_TX** + * For IPv4 packets, add a flag to tunnel metadata + * indicating that checksum computation should be skipped + * and checksum set to zeroes. + * **BPF_F_DONT_FRAGMENT** + * Add a flag to tunnel metadata indicating that the + * packet should not be fragmented. + * **BPF_F_SEQ_NUMBER** + * Add a flag to tunnel metadata indicating that a + * sequence number should be added to tunnel header before + * sending the packet. This flag was added for GRE + * encapsulation, but might be used with other protocols + * as well in the future. + * + * Here is a typical usage on the transmit path: + * + * :: + * + * struct bpf_tunnel_key key; + * populate key ... + * bpf_skb_set_tunnel_key(skb, &key, sizeof(key), 0); + * bpf_clone_redirect(skb, vxlan_dev_ifindex, 0); + * + * See also the description of the **bpf_skb_get_tunnel_key**\ () + * helper for additional information. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_set_tunnel_key)(struct __sk_buff *skb, struct bpf_tunnel_key *key, __u32 size, __u64 flags) = (void *) 21; + +/* + * bpf_perf_event_read + * + * Read the value of a perf event counter. This helper relies on a + * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. The nature of + * the perf event counter is selected when *map* is updated with + * perf event file descriptors. The *map* is an array whose size + * is the number of available CPUs, and each cell contains a value + * relative to one CPU. The value to retrieve is indicated by + * *flags*, that contains the index of the CPU to look up, masked + * with **BPF_F_INDEX_MASK**. Alternatively, *flags* can be set to + * **BPF_F_CURRENT_CPU** to indicate that the value for the + * current CPU should be retrieved. + * + * Note that before Linux 4.13, only hardware perf event can be + * retrieved. + * + * Also, be aware that the newer helper + * **bpf_perf_event_read_value**\ () is recommended over + * **bpf_perf_event_read**\ () in general. The latter has some ABI + * quirks where error and counter value are used as a return code + * (which is wrong to do since ranges may overlap). This issue is + * fixed with **bpf_perf_event_read_value**\ (), which at the same + * time provides more features over the **bpf_perf_event_read**\ + * () interface. Please refer to the description of + * **bpf_perf_event_read_value**\ () for details. + * + * Returns + * The value of the perf event counter read from the map, or a + * negative error code in case of failure. + */ +static __u64 (*bpf_perf_event_read)(void *map, __u64 flags) = (void *) 22; + +/* + * bpf_redirect + * + * Redirect the packet to another net device of index *ifindex*. + * This helper is somewhat similar to **bpf_clone_redirect**\ + * (), except that the packet is not cloned, which provides + * increased performance. + * + * Except for XDP, both ingress and egress interfaces can be used + * for redirection. The **BPF_F_INGRESS** value in *flags* is used + * to make the distinction (ingress path is selected if the flag + * is present, egress path otherwise). Currently, XDP only + * supports redirection to the egress interface, and accepts no + * flag at all. + * + * The same effect can also be attained with the more generic + * **bpf_redirect_map**\ (), which uses a BPF map to store the + * redirect target instead of providing it directly to the helper. + * + * Returns + * For XDP, the helper returns **XDP_REDIRECT** on success or + * **XDP_ABORTED** on error. For other program types, the values + * are **TC_ACT_REDIRECT** on success or **TC_ACT_SHOT** on + * error. + */ +static long (*bpf_redirect)(__u32 ifindex, __u64 flags) = (void *) 23; + +/* + * bpf_get_route_realm + * + * Retrieve the realm or the route, that is to say the + * **tclassid** field of the destination for the *skb*. The + * identifier retrieved is a user-provided tag, similar to the + * one used with the net_cls cgroup (see description for + * **bpf_get_cgroup_classid**\ () helper), but here this tag is + * held by a route (a destination entry), not by a task. + * + * Retrieving this identifier works with the clsact TC egress hook + * (see also **tc-bpf(8)**), or alternatively on conventional + * classful egress qdiscs, but not on TC ingress path. In case of + * clsact TC egress hook, this has the advantage that, internally, + * the destination entry has not been dropped yet in the transmit + * path. Therefore, the destination entry does not need to be + * artificially held via **netif_keep_dst**\ () for a classful + * qdisc until the *skb* is freed. + * + * This helper is available only if the kernel was compiled with + * **CONFIG_IP_ROUTE_CLASSID** configuration option. + * + * Returns + * The realm of the route for the packet associated to *skb*, or 0 + * if none was found. + */ +static __u32 (*bpf_get_route_realm)(struct __sk_buff *skb) = (void *) 24; + +/* + * bpf_perf_event_output + * + * Write raw *data* blob into a special BPF perf event held by + * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf + * event must have the following attributes: **PERF_SAMPLE_RAW** + * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and + * **PERF_COUNT_SW_BPF_OUTPUT** as **config**. + * + * The *flags* are used to indicate the index in *map* for which + * the value must be put, masked with **BPF_F_INDEX_MASK**. + * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU** + * to indicate that the index of the current CPU core should be + * used. + * + * The value to write, of *size*, is passed through eBPF stack and + * pointed by *data*. + * + * The context of the program *ctx* needs also be passed to the + * helper. + * + * On user space, a program willing to read the values needs to + * call **perf_event_open**\ () on the perf event (either for + * one or for all CPUs) and to store the file descriptor into the + * *map*. This must be done before the eBPF program can send data + * into it. An example is available in file + * *samples/bpf/trace_output_user.c* in the Linux kernel source + * tree (the eBPF program counterpart is in + * *samples/bpf/trace_output_kern.c*). + * + * **bpf_perf_event_output**\ () achieves better performance + * than **bpf_trace_printk**\ () for sharing data with user + * space, and is much better suitable for streaming data from eBPF + * programs. + * + * Note that this helper is not restricted to tracing use cases + * and can be used with programs attached to TC or XDP as well, + * where it allows for passing data to user space listeners. Data + * can be: + * + * * Only custom structs, + * * Only the packet payload, or + * * A combination of both. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_perf_event_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *) 25; + +/* + * bpf_skb_load_bytes + * + * This helper was provided as an easy way to load data from a + * packet. It can be used to load *len* bytes from *offset* from + * the packet associated to *skb*, into the buffer pointed by + * *to*. + * + * Since Linux 4.7, usage of this helper has mostly been replaced + * by "direct packet access", enabling packet data to be + * manipulated with *skb*\ **->data** and *skb*\ **->data_end** + * pointing respectively to the first byte of packet data and to + * the byte after the last byte of packet data. However, it + * remains useful if one wishes to read large quantities of data + * at once from a packet into the eBPF stack. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_load_bytes)(const void *skb, __u32 offset, void *to, __u32 len) = (void *) 26; + +/* + * bpf_get_stackid + * + * Walk a user or a kernel stack and return its id. To achieve + * this, the helper needs *ctx*, which is a pointer to the context + * on which the tracing program is executed, and a pointer to a + * *map* of type **BPF_MAP_TYPE_STACK_TRACE**. + * + * The last argument, *flags*, holds the number of stack frames to + * skip (from 0 to 255), masked with + * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set + * a combination of the following flags: + * + * **BPF_F_USER_STACK** + * Collect a user space stack instead of a kernel stack. + * **BPF_F_FAST_STACK_CMP** + * Compare stacks by hash only. + * **BPF_F_REUSE_STACKID** + * If two different stacks hash into the same *stackid*, + * discard the old one. + * + * The stack id retrieved is a 32 bit long integer handle which + * can be further combined with other data (including other stack + * ids) and used as a key into maps. This can be useful for + * generating a variety of graphs (such as flame graphs or off-cpu + * graphs). + * + * For walking a stack, this helper is an improvement over + * **bpf_probe_read**\ (), which can be used with unrolled loops + * but is not efficient and consumes a lot of eBPF instructions. + * Instead, **bpf_get_stackid**\ () can collect up to + * **PERF_MAX_STACK_DEPTH** both kernel and user frames. Note that + * this limit can be controlled with the **sysctl** program, and + * that it should be manually increased in order to profile long + * user stacks (such as stacks for Java programs). To do so, use: + * + * :: + * + * # sysctl kernel.perf_event_max_stack= + * + * Returns + * The positive or null stack id on success, or a negative error + * in case of failure. + */ +static long (*bpf_get_stackid)(void *ctx, void *map, __u64 flags) = (void *) 27; + +/* + * bpf_csum_diff + * + * Compute a checksum difference, from the raw buffer pointed by + * *from*, of length *from_size* (that must be a multiple of 4), + * towards the raw buffer pointed by *to*, of size *to_size* + * (same remark). An optional *seed* can be added to the value + * (this can be cascaded, the seed may come from a previous call + * to the helper). + * + * This is flexible enough to be used in several ways: + * + * * With *from_size* == 0, *to_size* > 0 and *seed* set to + * checksum, it can be used when pushing new data. + * * With *from_size* > 0, *to_size* == 0 and *seed* set to + * checksum, it can be used when removing data from a packet. + * * With *from_size* > 0, *to_size* > 0 and *seed* set to 0, it + * can be used to compute a diff. Note that *from_size* and + * *to_size* do not need to be equal. + * + * This helper can be used in combination with + * **bpf_l3_csum_replace**\ () and **bpf_l4_csum_replace**\ (), to + * which one can feed in the difference computed with + * **bpf_csum_diff**\ (). + * + * Returns + * The checksum result, or a negative error code in case of + * failure. + */ +static __s64 (*bpf_csum_diff)(__be32 *from, __u32 from_size, __be32 *to, __u32 to_size, __wsum seed) = (void *) 28; + +/* + * bpf_skb_get_tunnel_opt + * + * Retrieve tunnel options metadata for the packet associated to + * *skb*, and store the raw tunnel option data to the buffer *opt* + * of *size*. + * + * This helper can be used with encapsulation devices that can + * operate in "collect metadata" mode (please refer to the related + * note in the description of **bpf_skb_get_tunnel_key**\ () for + * more details). A particular example where this can be used is + * in combination with the Geneve encapsulation protocol, where it + * allows for pushing (with **bpf_skb_get_tunnel_opt**\ () helper) + * and retrieving arbitrary TLVs (Type-Length-Value headers) from + * the eBPF program. This allows for full customization of these + * headers. + * + * Returns + * The size of the option data retrieved. + */ +static long (*bpf_skb_get_tunnel_opt)(struct __sk_buff *skb, void *opt, __u32 size) = (void *) 29; + +/* + * bpf_skb_set_tunnel_opt + * + * Set tunnel options metadata for the packet associated to *skb* + * to the option data contained in the raw buffer *opt* of *size*. + * + * See also the description of the **bpf_skb_get_tunnel_opt**\ () + * helper for additional information. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_set_tunnel_opt)(struct __sk_buff *skb, void *opt, __u32 size) = (void *) 30; + +/* + * bpf_skb_change_proto + * + * Change the protocol of the *skb* to *proto*. Currently + * supported are transition from IPv4 to IPv6, and from IPv6 to + * IPv4. The helper takes care of the groundwork for the + * transition, including resizing the socket buffer. The eBPF + * program is expected to fill the new headers, if any, via + * **skb_store_bytes**\ () and to recompute the checksums with + * **bpf_l3_csum_replace**\ () and **bpf_l4_csum_replace**\ + * (). The main case for this helper is to perform NAT64 + * operations out of an eBPF program. + * + * Internally, the GSO type is marked as dodgy so that headers are + * checked and segments are recalculated by the GSO/GRO engine. + * The size for GSO target is adapted as well. + * + * All values for *flags* are reserved for future usage, and must + * be left at zero. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_change_proto)(struct __sk_buff *skb, __be16 proto, __u64 flags) = (void *) 31; + +/* + * bpf_skb_change_type + * + * Change the packet type for the packet associated to *skb*. This + * comes down to setting *skb*\ **->pkt_type** to *type*, except + * the eBPF program does not have a write access to *skb*\ + * **->pkt_type** beside this helper. Using a helper here allows + * for graceful handling of errors. + * + * The major use case is to change incoming *skb*s to + * **PACKET_HOST** in a programmatic way instead of having to + * recirculate via **redirect**\ (..., **BPF_F_INGRESS**), for + * example. + * + * Note that *type* only allows certain values. At this time, they + * are: + * + * **PACKET_HOST** + * Packet is for us. + * **PACKET_BROADCAST** + * Send packet to all. + * **PACKET_MULTICAST** + * Send packet to group. + * **PACKET_OTHERHOST** + * Send packet to someone else. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_change_type)(struct __sk_buff *skb, __u32 type) = (void *) 32; + +/* + * bpf_skb_under_cgroup + * + * Check whether *skb* is a descendant of the cgroup2 held by + * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*. + * + * Returns + * The return value depends on the result of the test, and can be: + * + * * 0, if the *skb* failed the cgroup2 descendant test. + * * 1, if the *skb* succeeded the cgroup2 descendant test. + * * A negative error code, if an error occurred. + */ +static long (*bpf_skb_under_cgroup)(struct __sk_buff *skb, void *map, __u32 index) = (void *) 33; + +/* + * bpf_get_hash_recalc + * + * Retrieve the hash of the packet, *skb*\ **->hash**. If it is + * not set, in particular if the hash was cleared due to mangling, + * recompute this hash. Later accesses to the hash can be done + * directly with *skb*\ **->hash**. + * + * Calling **bpf_set_hash_invalid**\ (), changing a packet + * prototype with **bpf_skb_change_proto**\ (), or calling + * **bpf_skb_store_bytes**\ () with the + * **BPF_F_INVALIDATE_HASH** are actions susceptible to clear + * the hash and to trigger a new computation for the next call to + * **bpf_get_hash_recalc**\ (). + * + * Returns + * The 32-bit hash. + */ +static __u32 (*bpf_get_hash_recalc)(struct __sk_buff *skb) = (void *) 34; + +/* + * bpf_get_current_task + * + * + * Returns + * A pointer to the current task struct. + */ +static __u64 (*bpf_get_current_task)(void) = (void *) 35; + +/* + * bpf_probe_write_user + * + * Attempt in a safe way to write *len* bytes from the buffer + * *src* to *dst* in memory. It only works for threads that are in + * user context, and *dst* must be a valid user space address. + * + * This helper should not be used to implement any kind of + * security mechanism because of TOC-TOU attacks, but rather to + * debug, divert, and manipulate execution of semi-cooperative + * processes. + * + * Keep in mind that this feature is meant for experiments, and it + * has a risk of crashing the system and running programs. + * Therefore, when an eBPF program using this helper is attached, + * a warning including PID and process name is printed to kernel + * logs. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_probe_write_user)(void *dst, const void *src, __u32 len) = (void *) 36; + +/* + * bpf_current_task_under_cgroup + * + * Check whether the probe is being run is the context of a given + * subset of the cgroup2 hierarchy. The cgroup2 to test is held by + * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*. + * + * Returns + * The return value depends on the result of the test, and can be: + * + * * 0, if current task belongs to the cgroup2. + * * 1, if current task does not belong to the cgroup2. + * * A negative error code, if an error occurred. + */ +static long (*bpf_current_task_under_cgroup)(void *map, __u32 index) = (void *) 37; + +/* + * bpf_skb_change_tail + * + * Resize (trim or grow) the packet associated to *skb* to the + * new *len*. The *flags* are reserved for future usage, and must + * be left at zero. + * + * The basic idea is that the helper performs the needed work to + * change the size of the packet, then the eBPF program rewrites + * the rest via helpers like **bpf_skb_store_bytes**\ (), + * **bpf_l3_csum_replace**\ (), **bpf_l3_csum_replace**\ () + * and others. This helper is a slow path utility intended for + * replies with control messages. And because it is targeted for + * slow path, the helper itself can afford to be slow: it + * implicitly linearizes, unclones and drops offloads from the + * *skb*. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_change_tail)(struct __sk_buff *skb, __u32 len, __u64 flags) = (void *) 38; + +/* + * bpf_skb_pull_data + * + * Pull in non-linear data in case the *skb* is non-linear and not + * all of *len* are part of the linear section. Make *len* bytes + * from *skb* readable and writable. If a zero value is passed for + * *len*, then the whole length of the *skb* is pulled. + * + * This helper is only needed for reading and writing with direct + * packet access. + * + * For direct packet access, testing that offsets to access + * are within packet boundaries (test on *skb*\ **->data_end**) is + * susceptible to fail if offsets are invalid, or if the requested + * data is in non-linear parts of the *skb*. On failure the + * program can just bail out, or in the case of a non-linear + * buffer, use a helper to make the data available. The + * **bpf_skb_load_bytes**\ () helper is a first solution to access + * the data. Another one consists in using **bpf_skb_pull_data** + * to pull in once the non-linear parts, then retesting and + * eventually access the data. + * + * At the same time, this also makes sure the *skb* is uncloned, + * which is a necessary condition for direct write. As this needs + * to be an invariant for the write part only, the verifier + * detects writes and adds a prologue that is calling + * **bpf_skb_pull_data()** to effectively unclone the *skb* from + * the very beginning in case it is indeed cloned. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_pull_data)(struct __sk_buff *skb, __u32 len) = (void *) 39; + +/* + * bpf_csum_update + * + * Add the checksum *csum* into *skb*\ **->csum** in case the + * driver has supplied a checksum for the entire packet into that + * field. Return an error otherwise. This helper is intended to be + * used in combination with **bpf_csum_diff**\ (), in particular + * when the checksum needs to be updated after data has been + * written into the packet through direct packet access. + * + * Returns + * The checksum on success, or a negative error code in case of + * failure. + */ +static __s64 (*bpf_csum_update)(struct __sk_buff *skb, __wsum csum) = (void *) 40; + +/* + * bpf_set_hash_invalid + * + * Invalidate the current *skb*\ **->hash**. It can be used after + * mangling on headers through direct packet access, in order to + * indicate that the hash is outdated and to trigger a + * recalculation the next time the kernel tries to access this + * hash or when the **bpf_get_hash_recalc**\ () helper is called. + * + */ +static void (*bpf_set_hash_invalid)(struct __sk_buff *skb) = (void *) 41; + +/* + * bpf_get_numa_node_id + * + * Return the id of the current NUMA node. The primary use case + * for this helper is the selection of sockets for the local NUMA + * node, when the program is attached to sockets using the + * **SO_ATTACH_REUSEPORT_EBPF** option (see also **socket(7)**), + * but the helper is also available to other eBPF program types, + * similarly to **bpf_get_smp_processor_id**\ (). + * + * Returns + * The id of current NUMA node. + */ +static long (*bpf_get_numa_node_id)(void) = (void *) 42; + +/* + * bpf_skb_change_head + * + * Grows headroom of packet associated to *skb* and adjusts the + * offset of the MAC header accordingly, adding *len* bytes of + * space. It automatically extends and reallocates memory as + * required. + * + * This helper can be used on a layer 3 *skb* to push a MAC header + * for redirection into a layer 2 device. + * + * All values for *flags* are reserved for future usage, and must + * be left at zero. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_change_head)(struct __sk_buff *skb, __u32 len, __u64 flags) = (void *) 43; + +/* + * bpf_xdp_adjust_head + * + * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that + * it is possible to use a negative value for *delta*. This helper + * can be used to prepare the packet for pushing or popping + * headers. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_xdp_adjust_head)(struct xdp_md *xdp_md, int delta) = (void *) 44; + +/* + * bpf_probe_read_str + * + * Copy a NUL terminated string from an unsafe kernel address + * *unsafe_ptr* to *dst*. See **bpf_probe_read_kernel_str**\ () for + * more details. + * + * Generally, use **bpf_probe_read_user_str**\ () or + * **bpf_probe_read_kernel_str**\ () instead. + * + * Returns + * On success, the strictly positive length of the string, + * including the trailing NUL character. On error, a negative + * value. + */ +static long (*bpf_probe_read_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 45; + +/* + * bpf_get_socket_cookie + * + * If the **struct sk_buff** pointed by *skb* has a known socket, + * retrieve the cookie (generated by the kernel) of this socket. + * If no cookie has been set yet, generate a new cookie. Once + * generated, the socket cookie remains stable for the life of the + * socket. This helper can be useful for monitoring per socket + * networking traffic statistics as it provides a global socket + * identifier that can be assumed unique. + * + * Returns + * A 8-byte long unique number on success, or 0 if the socket + * field is missing inside *skb*. + */ +static __u64 (*bpf_get_socket_cookie)(void *ctx) = (void *) 46; + +/* + * bpf_get_socket_uid + * + * + * Returns + * The owner UID of the socket associated to *skb*. If the socket + * is **NULL**, or if it is not a full socket (i.e. if it is a + * time-wait or a request socket instead), **overflowuid** value + * is returned (note that **overflowuid** might also be the actual + * UID value for the socket). + */ +static __u32 (*bpf_get_socket_uid)(struct __sk_buff *skb) = (void *) 47; + +/* + * bpf_set_hash + * + * Set the full hash for *skb* (set the field *skb*\ **->hash**) + * to value *hash*. + * + * Returns + * 0 + */ +static long (*bpf_set_hash)(struct __sk_buff *skb, __u32 hash) = (void *) 48; + +/* + * bpf_setsockopt + * + * Emulate a call to **setsockopt()** on the socket associated to + * *bpf_socket*, which must be a full socket. The *level* at + * which the option resides and the name *optname* of the option + * must be specified, see **setsockopt(2)** for more information. + * The option value of length *optlen* is pointed by *optval*. + * + * *bpf_socket* should be one of the following: + * + * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**. + * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT** + * and **BPF_CGROUP_INET6_CONNECT**. + * + * This helper actually implements a subset of **setsockopt()**. + * It supports the following *level*\ s: + * + * * **SOL_SOCKET**, which supports the following *optname*\ s: + * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**, + * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**, + * **SO_BINDTODEVICE**, **SO_KEEPALIVE**. + * * **IPPROTO_TCP**, which supports the following *optname*\ s: + * **TCP_CONGESTION**, **TCP_BPF_IW**, + * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**, + * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**, + * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**. + * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. + * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_setsockopt)(void *bpf_socket, int level, int optname, void *optval, int optlen) = (void *) 49; + +/* + * bpf_skb_adjust_room + * + * Grow or shrink the room for data in the packet associated to + * *skb* by *len_diff*, and according to the selected *mode*. + * + * By default, the helper will reset any offloaded checksum + * indicator of the skb to CHECKSUM_NONE. This can be avoided + * by the following flag: + * + * * **BPF_F_ADJ_ROOM_NO_CSUM_RESET**: Do not reset offloaded + * checksum data of the skb to CHECKSUM_NONE. + * + * There are two supported modes at this time: + * + * * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer + * (room space is added or removed below the layer 2 header). + * + * * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer + * (room space is added or removed below the layer 3 header). + * + * The following flags are supported at this time: + * + * * **BPF_F_ADJ_ROOM_FIXED_GSO**: Do not adjust gso_size. + * Adjusting mss in this way is not allowed for datagrams. + * + * * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV4**, + * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV6**: + * Any new space is reserved to hold a tunnel header. + * Configure skb offsets and other fields accordingly. + * + * * **BPF_F_ADJ_ROOM_ENCAP_L4_GRE**, + * **BPF_F_ADJ_ROOM_ENCAP_L4_UDP**: + * Use with ENCAP_L3 flags to further specify the tunnel type. + * + * * **BPF_F_ADJ_ROOM_ENCAP_L2**\ (*len*): + * Use with ENCAP_L3/L4 flags to further specify the tunnel + * type; *len* is the length of the inner MAC header. + * + * * **BPF_F_ADJ_ROOM_ENCAP_L2_ETH**: + * Use with BPF_F_ADJ_ROOM_ENCAP_L2 flag to further specify the + * L2 type as Ethernet. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_adjust_room)(struct __sk_buff *skb, __s32 len_diff, __u32 mode, __u64 flags) = (void *) 50; + +/* + * bpf_redirect_map + * + * Redirect the packet to the endpoint referenced by *map* at + * index *key*. Depending on its type, this *map* can contain + * references to net devices (for forwarding packets through other + * ports), or to CPUs (for redirecting XDP frames to another CPU; + * but this is only implemented for native XDP (with driver + * support) as of this writing). + * + * The lower two bits of *flags* are used as the return code if + * the map lookup fails. This is so that the return value can be + * one of the XDP program return codes up to **XDP_TX**, as chosen + * by the caller. The higher bits of *flags* can be set to + * BPF_F_BROADCAST or BPF_F_EXCLUDE_INGRESS as defined below. + * + * With BPF_F_BROADCAST the packet will be broadcasted to all the + * interfaces in the map, with BPF_F_EXCLUDE_INGRESS the ingress + * interface will be excluded when do broadcasting. + * + * See also **bpf_redirect**\ (), which only supports redirecting + * to an ifindex, but doesn't require a map to do so. + * + * Returns + * **XDP_REDIRECT** on success, or the value of the two lower bits + * of the *flags* argument on error. + */ +static long (*bpf_redirect_map)(void *map, __u32 key, __u64 flags) = (void *) 51; + +/* + * bpf_sk_redirect_map + * + * Redirect the packet to the socket referenced by *map* (of type + * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and + * egress interfaces can be used for redirection. The + * **BPF_F_INGRESS** value in *flags* is used to make the + * distinction (ingress path is selected if the flag is present, + * egress path otherwise). This is the only flag supported for now. + * + * Returns + * **SK_PASS** on success, or **SK_DROP** on error. + */ +static long (*bpf_sk_redirect_map)(struct __sk_buff *skb, void *map, __u32 key, __u64 flags) = (void *) 52; + +/* + * bpf_sock_map_update + * + * Add an entry to, or update a *map* referencing sockets. The + * *skops* is used as a new value for the entry associated to + * *key*. *flags* is one of: + * + * **BPF_NOEXIST** + * The entry for *key* must not exist in the map. + * **BPF_EXIST** + * The entry for *key* must already exist in the map. + * **BPF_ANY** + * No condition on the existence of the entry for *key*. + * + * If the *map* has eBPF programs (parser and verdict), those will + * be inherited by the socket being added. If the socket is + * already attached to eBPF programs, this results in an error. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_sock_map_update)(struct bpf_sock_ops *skops, void *map, void *key, __u64 flags) = (void *) 53; + +/* + * bpf_xdp_adjust_meta + * + * Adjust the address pointed by *xdp_md*\ **->data_meta** by + * *delta* (which can be positive or negative). Note that this + * operation modifies the address stored in *xdp_md*\ **->data**, + * so the latter must be loaded only after the helper has been + * called. + * + * The use of *xdp_md*\ **->data_meta** is optional and programs + * are not required to use it. The rationale is that when the + * packet is processed with XDP (e.g. as DoS filter), it is + * possible to push further meta data along with it before passing + * to the stack, and to give the guarantee that an ingress eBPF + * program attached as a TC classifier on the same device can pick + * this up for further post-processing. Since TC works with socket + * buffers, it remains possible to set from XDP the **mark** or + * **priority** pointers, or other pointers for the socket buffer. + * Having this scratch space generic and programmable allows for + * more flexibility as the user is free to store whatever meta + * data they need. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_xdp_adjust_meta)(struct xdp_md *xdp_md, int delta) = (void *) 54; + +/* + * bpf_perf_event_read_value + * + * Read the value of a perf event counter, and store it into *buf* + * of size *buf_size*. This helper relies on a *map* of type + * **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. The nature of the perf event + * counter is selected when *map* is updated with perf event file + * descriptors. The *map* is an array whose size is the number of + * available CPUs, and each cell contains a value relative to one + * CPU. The value to retrieve is indicated by *flags*, that + * contains the index of the CPU to look up, masked with + * **BPF_F_INDEX_MASK**. Alternatively, *flags* can be set to + * **BPF_F_CURRENT_CPU** to indicate that the value for the + * current CPU should be retrieved. + * + * This helper behaves in a way close to + * **bpf_perf_event_read**\ () helper, save that instead of + * just returning the value observed, it fills the *buf* + * structure. This allows for additional data to be retrieved: in + * particular, the enabled and running times (in *buf*\ + * **->enabled** and *buf*\ **->running**, respectively) are + * copied. In general, **bpf_perf_event_read_value**\ () is + * recommended over **bpf_perf_event_read**\ (), which has some + * ABI issues and provides fewer functionalities. + * + * These values are interesting, because hardware PMU (Performance + * Monitoring Unit) counters are limited resources. When there are + * more PMU based perf events opened than available counters, + * kernel will multiplex these events so each event gets certain + * percentage (but not all) of the PMU time. In case that + * multiplexing happens, the number of samples or counter value + * will not reflect the case compared to when no multiplexing + * occurs. This makes comparison between different runs difficult. + * Typically, the counter value should be normalized before + * comparing to other experiments. The usual normalization is done + * as follows. + * + * :: + * + * normalized_counter = counter * t_enabled / t_running + * + * Where t_enabled is the time enabled for event and t_running is + * the time running for event since last normalization. The + * enabled and running times are accumulated since the perf event + * open. To achieve scaling factor between two invocations of an + * eBPF program, users can use CPU id as the key (which is + * typical for perf array usage model) to remember the previous + * value and do the calculation inside the eBPF program. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_perf_event_read_value)(void *map, __u64 flags, struct bpf_perf_event_value *buf, __u32 buf_size) = (void *) 55; + +/* + * bpf_perf_prog_read_value + * + * For en eBPF program attached to a perf event, retrieve the + * value of the event counter associated to *ctx* and store it in + * the structure pointed by *buf* and of size *buf_size*. Enabled + * and running times are also stored in the structure (see + * description of helper **bpf_perf_event_read_value**\ () for + * more details). + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_perf_prog_read_value)(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, __u32 buf_size) = (void *) 56; + +/* + * bpf_getsockopt + * + * Emulate a call to **getsockopt()** on the socket associated to + * *bpf_socket*, which must be a full socket. The *level* at + * which the option resides and the name *optname* of the option + * must be specified, see **getsockopt(2)** for more information. + * The retrieved value is stored in the structure pointed by + * *opval* and of length *optlen*. + * + * *bpf_socket* should be one of the following: + * + * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**. + * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT** + * and **BPF_CGROUP_INET6_CONNECT**. + * + * This helper actually implements a subset of **getsockopt()**. + * It supports the following *level*\ s: + * + * * **IPPROTO_TCP**, which supports *optname* + * **TCP_CONGESTION**. + * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. + * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_getsockopt)(void *bpf_socket, int level, int optname, void *optval, int optlen) = (void *) 57; + +/* + * bpf_override_return + * + * Used for error injection, this helper uses kprobes to override + * the return value of the probed function, and to set it to *rc*. + * The first argument is the context *regs* on which the kprobe + * works. + * + * This helper works by setting the PC (program counter) + * to an override function which is run in place of the original + * probed function. This means the probed function is not run at + * all. The replacement function just returns with the required + * value. + * + * This helper has security implications, and thus is subject to + * restrictions. It is only available if the kernel was compiled + * with the **CONFIG_BPF_KPROBE_OVERRIDE** configuration + * option, and in this case it only works on functions tagged with + * **ALLOW_ERROR_INJECTION** in the kernel code. + * + * Also, the helper is only available for the architectures having + * the CONFIG_FUNCTION_ERROR_INJECTION option. As of this writing, + * x86 architecture is the only one to support this feature. + * + * Returns + * 0 + */ +static long (*bpf_override_return)(struct pt_regs *regs, __u64 rc) = (void *) 58; + +/* + * bpf_sock_ops_cb_flags_set + * + * Attempt to set the value of the **bpf_sock_ops_cb_flags** field + * for the full TCP socket associated to *bpf_sock_ops* to + * *argval*. + * + * The primary use of this field is to determine if there should + * be calls to eBPF programs of type + * **BPF_PROG_TYPE_SOCK_OPS** at various points in the TCP + * code. A program of the same type can change its value, per + * connection and as necessary, when the connection is + * established. This field is directly accessible for reading, but + * this helper must be used for updates in order to return an + * error if an eBPF program tries to set a callback that is not + * supported in the current kernel. + * + * *argval* is a flag array which can combine these flags: + * + * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out) + * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission) + * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change) + * * **BPF_SOCK_OPS_RTT_CB_FLAG** (every RTT) + * + * Therefore, this function can be used to clear a callback flag by + * setting the appropriate bit to zero. e.g. to disable the RTO + * callback: + * + * **bpf_sock_ops_cb_flags_set(bpf_sock,** + * **bpf_sock->bpf_sock_ops_cb_flags & ~BPF_SOCK_OPS_RTO_CB_FLAG)** + * + * Here are some examples of where one could call such eBPF + * program: + * + * * When RTO fires. + * * When a packet is retransmitted. + * * When the connection terminates. + * * When a packet is sent. + * * When a packet is received. + * + * Returns + * Code **-EINVAL** if the socket is not a full TCP socket; + * otherwise, a positive number containing the bits that could not + * be set is returned (which comes down to 0 if all bits were set + * as required). + */ +static long (*bpf_sock_ops_cb_flags_set)(struct bpf_sock_ops *bpf_sock, int argval) = (void *) 59; + +/* + * bpf_msg_redirect_map + * + * This helper is used in programs implementing policies at the + * socket level. If the message *msg* is allowed to pass (i.e. if + * the verdict eBPF program returns **SK_PASS**), redirect it to + * the socket referenced by *map* (of type + * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and + * egress interfaces can be used for redirection. The + * **BPF_F_INGRESS** value in *flags* is used to make the + * distinction (ingress path is selected if the flag is present, + * egress path otherwise). This is the only flag supported for now. + * + * Returns + * **SK_PASS** on success, or **SK_DROP** on error. + */ +static long (*bpf_msg_redirect_map)(struct sk_msg_md *msg, void *map, __u32 key, __u64 flags) = (void *) 60; + +/* + * bpf_msg_apply_bytes + * + * For socket policies, apply the verdict of the eBPF program to + * the next *bytes* (number of bytes) of message *msg*. + * + * For example, this helper can be used in the following cases: + * + * * A single **sendmsg**\ () or **sendfile**\ () system call + * contains multiple logical messages that the eBPF program is + * supposed to read and for which it should apply a verdict. + * * An eBPF program only cares to read the first *bytes* of a + * *msg*. If the message has a large payload, then setting up + * and calling the eBPF program repeatedly for all bytes, even + * though the verdict is already known, would create unnecessary + * overhead. + * + * When called from within an eBPF program, the helper sets a + * counter internal to the BPF infrastructure, that is used to + * apply the last verdict to the next *bytes*. If *bytes* is + * smaller than the current data being processed from a + * **sendmsg**\ () or **sendfile**\ () system call, the first + * *bytes* will be sent and the eBPF program will be re-run with + * the pointer for start of data pointing to byte number *bytes* + * **+ 1**. If *bytes* is larger than the current data being + * processed, then the eBPF verdict will be applied to multiple + * **sendmsg**\ () or **sendfile**\ () calls until *bytes* are + * consumed. + * + * Note that if a socket closes with the internal counter holding + * a non-zero value, this is not a problem because data is not + * being buffered for *bytes* and is sent as it is received. + * + * Returns + * 0 + */ +static long (*bpf_msg_apply_bytes)(struct sk_msg_md *msg, __u32 bytes) = (void *) 61; + +/* + * bpf_msg_cork_bytes + * + * For socket policies, prevent the execution of the verdict eBPF + * program for message *msg* until *bytes* (byte number) have been + * accumulated. + * + * This can be used when one needs a specific number of bytes + * before a verdict can be assigned, even if the data spans + * multiple **sendmsg**\ () or **sendfile**\ () calls. The extreme + * case would be a user calling **sendmsg**\ () repeatedly with + * 1-byte long message segments. Obviously, this is bad for + * performance, but it is still valid. If the eBPF program needs + * *bytes* bytes to validate a header, this helper can be used to + * prevent the eBPF program to be called again until *bytes* have + * been accumulated. + * + * Returns + * 0 + */ +static long (*bpf_msg_cork_bytes)(struct sk_msg_md *msg, __u32 bytes) = (void *) 62; + +/* + * bpf_msg_pull_data + * + * For socket policies, pull in non-linear data from user space + * for *msg* and set pointers *msg*\ **->data** and *msg*\ + * **->data_end** to *start* and *end* bytes offsets into *msg*, + * respectively. + * + * If a program of type **BPF_PROG_TYPE_SK_MSG** is run on a + * *msg* it can only parse data that the (**data**, **data_end**) + * pointers have already consumed. For **sendmsg**\ () hooks this + * is likely the first scatterlist element. But for calls relying + * on the **sendpage** handler (e.g. **sendfile**\ ()) this will + * be the range (**0**, **0**) because the data is shared with + * user space and by default the objective is to avoid allowing + * user space to modify data while (or after) eBPF verdict is + * being decided. This helper can be used to pull in data and to + * set the start and end pointer to given values. Data will be + * copied if necessary (i.e. if data was not linear and if start + * and end pointers do not point to the same chunk). + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * All values for *flags* are reserved for future usage, and must + * be left at zero. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_msg_pull_data)(struct sk_msg_md *msg, __u32 start, __u32 end, __u64 flags) = (void *) 63; + +/* + * bpf_bind + * + * Bind the socket associated to *ctx* to the address pointed by + * *addr*, of length *addr_len*. This allows for making outgoing + * connection from the desired IP address, which can be useful for + * example when all processes inside a cgroup should use one + * single IP address on a host that has multiple IP configured. + * + * This helper works for IPv4 and IPv6, TCP and UDP sockets. The + * domain (*addr*\ **->sa_family**) must be **AF_INET** (or + * **AF_INET6**). It's advised to pass zero port (**sin_port** + * or **sin6_port**) which triggers IP_BIND_ADDRESS_NO_PORT-like + * behavior and lets the kernel efficiently pick up an unused + * port as long as 4-tuple is unique. Passing non-zero port might + * lead to degraded performance. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_bind)(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len) = (void *) 64; + +/* + * bpf_xdp_adjust_tail + * + * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is + * possible to both shrink and grow the packet tail. + * Shrink done via *delta* being a negative integer. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_xdp_adjust_tail)(struct xdp_md *xdp_md, int delta) = (void *) 65; + +/* + * bpf_skb_get_xfrm_state + * + * Retrieve the XFRM state (IP transform framework, see also + * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*. + * + * The retrieved value is stored in the **struct bpf_xfrm_state** + * pointed by *xfrm_state* and of length *size*. + * + * All values for *flags* are reserved for future usage, and must + * be left at zero. + * + * This helper is available only if the kernel was compiled with + * **CONFIG_XFRM** configuration option. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_get_xfrm_state)(struct __sk_buff *skb, __u32 index, struct bpf_xfrm_state *xfrm_state, __u32 size, __u64 flags) = (void *) 66; + +/* + * bpf_get_stack + * + * Return a user or a kernel stack in bpf program provided buffer. + * To achieve this, the helper needs *ctx*, which is a pointer + * to the context on which the tracing program is executed. + * To store the stacktrace, the bpf program provides *buf* with + * a nonnegative *size*. + * + * The last argument, *flags*, holds the number of stack frames to + * skip (from 0 to 255), masked with + * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set + * the following flags: + * + * **BPF_F_USER_STACK** + * Collect a user space stack instead of a kernel stack. + * **BPF_F_USER_BUILD_ID** + * Collect buildid+offset instead of ips for user stack, + * only valid if **BPF_F_USER_STACK** is also specified. + * + * **bpf_get_stack**\ () can collect up to + * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject + * to sufficient large buffer size. Note that + * this limit can be controlled with the **sysctl** program, and + * that it should be manually increased in order to profile long + * user stacks (such as stacks for Java programs). To do so, use: + * + * :: + * + * # sysctl kernel.perf_event_max_stack= + * + * Returns + * A non-negative value equal to or less than *size* on success, + * or a negative error in case of failure. + */ +static long (*bpf_get_stack)(void *ctx, void *buf, __u32 size, __u64 flags) = (void *) 67; + +/* + * bpf_skb_load_bytes_relative + * + * This helper is similar to **bpf_skb_load_bytes**\ () in that + * it provides an easy way to load *len* bytes from *offset* + * from the packet associated to *skb*, into the buffer pointed + * by *to*. The difference to **bpf_skb_load_bytes**\ () is that + * a fifth argument *start_header* exists in order to select a + * base offset to start from. *start_header* can be one of: + * + * **BPF_HDR_START_MAC** + * Base offset to load data from is *skb*'s mac header. + * **BPF_HDR_START_NET** + * Base offset to load data from is *skb*'s network header. + * + * In general, "direct packet access" is the preferred method to + * access packet data, however, this helper is in particular useful + * in socket filters where *skb*\ **->data** does not always point + * to the start of the mac header and where "direct packet access" + * is not available. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_load_bytes_relative)(const void *skb, __u32 offset, void *to, __u32 len, __u32 start_header) = (void *) 68; + +/* + * bpf_fib_lookup + * + * Do FIB lookup in kernel tables using parameters in *params*. + * If lookup is successful and result shows packet is to be + * forwarded, the neighbor tables are searched for the nexthop. + * If successful (ie., FIB lookup shows forwarding and nexthop + * is resolved), the nexthop address is returned in ipv4_dst + * or ipv6_dst based on family, smac is set to mac address of + * egress device, dmac is set to nexthop mac address, rt_metric + * is set to metric from route (IPv4/IPv6 only), and ifindex + * is set to the device index of the nexthop from the FIB lookup. + * + * *plen* argument is the size of the passed in struct. + * *flags* argument can be a combination of one or more of the + * following values: + * + * **BPF_FIB_LOOKUP_DIRECT** + * Do a direct table lookup vs full lookup using FIB + * rules. + * **BPF_FIB_LOOKUP_OUTPUT** + * Perform lookup from an egress perspective (default is + * ingress). + * + * *ctx* is either **struct xdp_md** for XDP programs or + * **struct sk_buff** tc cls_act programs. + * + * Returns + * * < 0 if any input argument is invalid + * * 0 on success (packet is forwarded, nexthop neighbor exists) + * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the + * packet is not forwarded or needs assist from full stack + * + * If lookup fails with BPF_FIB_LKUP_RET_FRAG_NEEDED, then the MTU + * was exceeded and output params->mtu_result contains the MTU. + */ +static long (*bpf_fib_lookup)(void *ctx, struct bpf_fib_lookup *params, int plen, __u32 flags) = (void *) 69; + +/* + * bpf_sock_hash_update + * + * Add an entry to, or update a sockhash *map* referencing sockets. + * The *skops* is used as a new value for the entry associated to + * *key*. *flags* is one of: + * + * **BPF_NOEXIST** + * The entry for *key* must not exist in the map. + * **BPF_EXIST** + * The entry for *key* must already exist in the map. + * **BPF_ANY** + * No condition on the existence of the entry for *key*. + * + * If the *map* has eBPF programs (parser and verdict), those will + * be inherited by the socket being added. If the socket is + * already attached to eBPF programs, this results in an error. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_sock_hash_update)(struct bpf_sock_ops *skops, void *map, void *key, __u64 flags) = (void *) 70; + +/* + * bpf_msg_redirect_hash + * + * This helper is used in programs implementing policies at the + * socket level. If the message *msg* is allowed to pass (i.e. if + * the verdict eBPF program returns **SK_PASS**), redirect it to + * the socket referenced by *map* (of type + * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and + * egress interfaces can be used for redirection. The + * **BPF_F_INGRESS** value in *flags* is used to make the + * distinction (ingress path is selected if the flag is present, + * egress path otherwise). This is the only flag supported for now. + * + * Returns + * **SK_PASS** on success, or **SK_DROP** on error. + */ +static long (*bpf_msg_redirect_hash)(struct sk_msg_md *msg, void *map, void *key, __u64 flags) = (void *) 71; + +/* + * bpf_sk_redirect_hash + * + * This helper is used in programs implementing policies at the + * skb socket level. If the sk_buff *skb* is allowed to pass (i.e. + * if the verdict eBPF program returns **SK_PASS**), redirect it + * to the socket referenced by *map* (of type + * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and + * egress interfaces can be used for redirection. The + * **BPF_F_INGRESS** value in *flags* is used to make the + * distinction (ingress path is selected if the flag is present, + * egress otherwise). This is the only flag supported for now. + * + * Returns + * **SK_PASS** on success, or **SK_DROP** on error. + */ +static long (*bpf_sk_redirect_hash)(struct __sk_buff *skb, void *map, void *key, __u64 flags) = (void *) 72; + +/* + * bpf_lwt_push_encap + * + * Encapsulate the packet associated to *skb* within a Layer 3 + * protocol header. This header is provided in the buffer at + * address *hdr*, with *len* its size in bytes. *type* indicates + * the protocol of the header and can be one of: + * + * **BPF_LWT_ENCAP_SEG6** + * IPv6 encapsulation with Segment Routing Header + * (**struct ipv6_sr_hdr**). *hdr* only contains the SRH, + * the IPv6 header is computed by the kernel. + * **BPF_LWT_ENCAP_SEG6_INLINE** + * Only works if *skb* contains an IPv6 packet. Insert a + * Segment Routing Header (**struct ipv6_sr_hdr**) inside + * the IPv6 header. + * **BPF_LWT_ENCAP_IP** + * IP encapsulation (GRE/GUE/IPIP/etc). The outer header + * must be IPv4 or IPv6, followed by zero or more + * additional headers, up to **LWT_BPF_MAX_HEADROOM** + * total bytes in all prepended headers. Please note that + * if **skb_is_gso**\ (*skb*) is true, no more than two + * headers can be prepended, and the inner header, if + * present, should be either GRE or UDP/GUE. + * + * **BPF_LWT_ENCAP_SEG6**\ \* types can be called by BPF programs + * of type **BPF_PROG_TYPE_LWT_IN**; **BPF_LWT_ENCAP_IP** type can + * be called by bpf programs of types **BPF_PROG_TYPE_LWT_IN** and + * **BPF_PROG_TYPE_LWT_XMIT**. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_lwt_push_encap)(struct __sk_buff *skb, __u32 type, void *hdr, __u32 len) = (void *) 73; + +/* + * bpf_lwt_seg6_store_bytes + * + * Store *len* bytes from address *from* into the packet + * associated to *skb*, at *offset*. Only the flags, tag and TLVs + * inside the outermost IPv6 Segment Routing Header can be + * modified through this helper. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_lwt_seg6_store_bytes)(struct __sk_buff *skb, __u32 offset, const void *from, __u32 len) = (void *) 74; + +/* + * bpf_lwt_seg6_adjust_srh + * + * Adjust the size allocated to TLVs in the outermost IPv6 + * Segment Routing Header contained in the packet associated to + * *skb*, at position *offset* by *delta* bytes. Only offsets + * after the segments are accepted. *delta* can be as well + * positive (growing) as negative (shrinking). + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_lwt_seg6_adjust_srh)(struct __sk_buff *skb, __u32 offset, __s32 delta) = (void *) 75; + +/* + * bpf_lwt_seg6_action + * + * Apply an IPv6 Segment Routing action of type *action* to the + * packet associated to *skb*. Each action takes a parameter + * contained at address *param*, and of length *param_len* bytes. + * *action* can be one of: + * + * **SEG6_LOCAL_ACTION_END_X** + * End.X action: Endpoint with Layer-3 cross-connect. + * Type of *param*: **struct in6_addr**. + * **SEG6_LOCAL_ACTION_END_T** + * End.T action: Endpoint with specific IPv6 table lookup. + * Type of *param*: **int**. + * **SEG6_LOCAL_ACTION_END_B6** + * End.B6 action: Endpoint bound to an SRv6 policy. + * Type of *param*: **struct ipv6_sr_hdr**. + * **SEG6_LOCAL_ACTION_END_B6_ENCAP** + * End.B6.Encap action: Endpoint bound to an SRv6 + * encapsulation policy. + * Type of *param*: **struct ipv6_sr_hdr**. + * + * A call to this helper is susceptible to change the underlying + * packet buffer. Therefore, at load time, all checks on pointers + * previously done by the verifier are invalidated and must be + * performed again, if the helper is used in combination with + * direct packet access. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_lwt_seg6_action)(struct __sk_buff *skb, __u32 action, void *param, __u32 param_len) = (void *) 76; + +/* + * bpf_rc_repeat + * + * This helper is used in programs implementing IR decoding, to + * report a successfully decoded repeat key message. This delays + * the generation of a key up event for previously generated + * key down event. + * + * Some IR protocols like NEC have a special IR message for + * repeating last button, for when a button is held down. + * + * The *ctx* should point to the lirc sample as passed into + * the program. + * + * This helper is only available is the kernel was compiled with + * the **CONFIG_BPF_LIRC_MODE2** configuration option set to + * "**y**". + * + * Returns + * 0 + */ +static long (*bpf_rc_repeat)(void *ctx) = (void *) 77; + +/* + * bpf_rc_keydown + * + * This helper is used in programs implementing IR decoding, to + * report a successfully decoded key press with *scancode*, + * *toggle* value in the given *protocol*. The scancode will be + * translated to a keycode using the rc keymap, and reported as + * an input key down event. After a period a key up event is + * generated. This period can be extended by calling either + * **bpf_rc_keydown**\ () again with the same values, or calling + * **bpf_rc_repeat**\ (). + * + * Some protocols include a toggle bit, in case the button was + * released and pressed again between consecutive scancodes. + * + * The *ctx* should point to the lirc sample as passed into + * the program. + * + * The *protocol* is the decoded protocol number (see + * **enum rc_proto** for some predefined values). + * + * This helper is only available is the kernel was compiled with + * the **CONFIG_BPF_LIRC_MODE2** configuration option set to + * "**y**". + * + * Returns + * 0 + */ +static long (*bpf_rc_keydown)(void *ctx, __u32 protocol, __u64 scancode, __u32 toggle) = (void *) 78; + +/* + * bpf_skb_cgroup_id + * + * Return the cgroup v2 id of the socket associated with the *skb*. + * This is roughly similar to the **bpf_get_cgroup_classid**\ () + * helper for cgroup v1 by providing a tag resp. identifier that + * can be matched on or used for map lookups e.g. to implement + * policy. The cgroup v2 id of a given path in the hierarchy is + * exposed in user space through the f_handle API in order to get + * to the same 64-bit id. + * + * This helper can be used on TC egress path, but not on ingress, + * and is available only if the kernel was compiled with the + * **CONFIG_SOCK_CGROUP_DATA** configuration option. + * + * Returns + * The id is returned or 0 in case the id could not be retrieved. + */ +static __u64 (*bpf_skb_cgroup_id)(struct __sk_buff *skb) = (void *) 79; + +/* + * bpf_get_current_cgroup_id + * + * + * Returns + * A 64-bit integer containing the current cgroup id based + * on the cgroup within which the current task is running. + */ +static __u64 (*bpf_get_current_cgroup_id)(void) = (void *) 80; + +/* + * bpf_get_local_storage + * + * Get the pointer to the local storage area. + * The type and the size of the local storage is defined + * by the *map* argument. + * The *flags* meaning is specific for each map type, + * and has to be 0 for cgroup local storage. + * + * Depending on the BPF program type, a local storage area + * can be shared between multiple instances of the BPF program, + * running simultaneously. + * + * A user should care about the synchronization by himself. + * For example, by using the **BPF_ATOMIC** instructions to alter + * the shared data. + * + * Returns + * A pointer to the local storage area. + */ +static void *(*bpf_get_local_storage)(void *map, __u64 flags) = (void *) 81; + +/* + * bpf_sk_select_reuseport + * + * Select a **SO_REUSEPORT** socket from a + * **BPF_MAP_TYPE_REUSEPORT_SOCKARRAY** *map*. + * It checks the selected socket is matching the incoming + * request in the socket buffer. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_sk_select_reuseport)(struct sk_reuseport_md *reuse, void *map, void *key, __u64 flags) = (void *) 82; + +/* + * bpf_skb_ancestor_cgroup_id + * + * Return id of cgroup v2 that is ancestor of cgroup associated + * with the *skb* at the *ancestor_level*. The root cgroup is at + * *ancestor_level* zero and each step down the hierarchy + * increments the level. If *ancestor_level* == level of cgroup + * associated with *skb*, then return value will be same as that + * of **bpf_skb_cgroup_id**\ (). + * + * The helper is useful to implement policies based on cgroups + * that are upper in hierarchy than immediate cgroup associated + * with *skb*. + * + * The format of returned id and helper limitations are same as in + * **bpf_skb_cgroup_id**\ (). + * + * Returns + * The id is returned or 0 in case the id could not be retrieved. + */ +static __u64 (*bpf_skb_ancestor_cgroup_id)(struct __sk_buff *skb, int ancestor_level) = (void *) 83; + +/* + * bpf_sk_lookup_tcp + * + * Look for TCP socket matching *tuple*, optionally in a child + * network namespace *netns*. The return value must be checked, + * and if non-**NULL**, released via **bpf_sk_release**\ (). + * + * The *ctx* should point to the context of the program, such as + * the skb or socket (depending on the hook in use). This is used + * to determine the base network namespace for the lookup. + * + * *tuple_size* must be one of: + * + * **sizeof**\ (*tuple*\ **->ipv4**) + * Look for an IPv4 socket. + * **sizeof**\ (*tuple*\ **->ipv6**) + * Look for an IPv6 socket. + * + * If the *netns* is a negative signed 32-bit integer, then the + * socket lookup table in the netns associated with the *ctx* + * will be used. For the TC hooks, this is the netns of the device + * in the skb. For socket hooks, this is the netns of the socket. + * If *netns* is any other signed 32-bit value greater than or + * equal to zero then it specifies the ID of the netns relative to + * the netns associated with the *ctx*. *netns* values beyond the + * range of 32-bit integers are reserved for future use. + * + * All values for *flags* are reserved for future usage, and must + * be left at zero. + * + * This helper is available only if the kernel was compiled with + * **CONFIG_NET** configuration option. + * + * Returns + * Pointer to **struct bpf_sock**, or **NULL** in case of failure. + * For sockets with reuseport option, the **struct bpf_sock** + * result is from *reuse*\ **->socks**\ [] using the hash of the + * tuple. + */ +static struct bpf_sock *(*bpf_sk_lookup_tcp)(void *ctx, struct bpf_sock_tuple *tuple, __u32 tuple_size, __u64 netns, __u64 flags) = (void *) 84; + +/* + * bpf_sk_lookup_udp + * + * Look for UDP socket matching *tuple*, optionally in a child + * network namespace *netns*. The return value must be checked, + * and if non-**NULL**, released via **bpf_sk_release**\ (). + * + * The *ctx* should point to the context of the program, such as + * the skb or socket (depending on the hook in use). This is used + * to determine the base network namespace for the lookup. + * + * *tuple_size* must be one of: + * + * **sizeof**\ (*tuple*\ **->ipv4**) + * Look for an IPv4 socket. + * **sizeof**\ (*tuple*\ **->ipv6**) + * Look for an IPv6 socket. + * + * If the *netns* is a negative signed 32-bit integer, then the + * socket lookup table in the netns associated with the *ctx* + * will be used. For the TC hooks, this is the netns of the device + * in the skb. For socket hooks, this is the netns of the socket. + * If *netns* is any other signed 32-bit value greater than or + * equal to zero then it specifies the ID of the netns relative to + * the netns associated with the *ctx*. *netns* values beyond the + * range of 32-bit integers are reserved for future use. + * + * All values for *flags* are reserved for future usage, and must + * be left at zero. + * + * This helper is available only if the kernel was compiled with + * **CONFIG_NET** configuration option. + * + * Returns + * Pointer to **struct bpf_sock**, or **NULL** in case of failure. + * For sockets with reuseport option, the **struct bpf_sock** + * result is from *reuse*\ **->socks**\ [] using the hash of the + * tuple. + */ +static struct bpf_sock *(*bpf_sk_lookup_udp)(void *ctx, struct bpf_sock_tuple *tuple, __u32 tuple_size, __u64 netns, __u64 flags) = (void *) 85; + +/* + * bpf_sk_release + * + * Release the reference held by *sock*. *sock* must be a + * non-**NULL** pointer that was returned from + * **bpf_sk_lookup_xxx**\ (). + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_sk_release)(void *sock) = (void *) 86; + +/* + * bpf_map_push_elem + * + * Push an element *value* in *map*. *flags* is one of: + * + * **BPF_EXIST** + * If the queue/stack is full, the oldest element is + * removed to make room for this. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_map_push_elem)(void *map, const void *value, __u64 flags) = (void *) 87; + +/* + * bpf_map_pop_elem + * + * Pop an element from *map*. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_map_pop_elem)(void *map, void *value) = (void *) 88; + +/* + * bpf_map_peek_elem + * + * Get an element from *map* without removing it. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_map_peek_elem)(void *map, void *value) = (void *) 89; + +/* + * bpf_msg_push_data + * + * For socket policies, insert *len* bytes into *msg* at offset + * *start*. + * + * If a program of type **BPF_PROG_TYPE_SK_MSG** is run on a + * *msg* it may want to insert metadata or options into the *msg*. + * This can later be read and used by any of the lower layer BPF + * hooks. + * + * This helper may fail if under memory pressure (a malloc + * fails) in these cases BPF programs will get an appropriate + * error and BPF programs will need to handle them. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_msg_push_data)(struct sk_msg_md *msg, __u32 start, __u32 len, __u64 flags) = (void *) 90; + +/* + * bpf_msg_pop_data + * + * Will remove *len* bytes from a *msg* starting at byte *start*. + * This may result in **ENOMEM** errors under certain situations if + * an allocation and copy are required due to a full ring buffer. + * However, the helper will try to avoid doing the allocation + * if possible. Other errors can occur if input parameters are + * invalid either due to *start* byte not being valid part of *msg* + * payload and/or *pop* value being to large. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_msg_pop_data)(struct sk_msg_md *msg, __u32 start, __u32 len, __u64 flags) = (void *) 91; + +/* + * bpf_rc_pointer_rel + * + * This helper is used in programs implementing IR decoding, to + * report a successfully decoded pointer movement. + * + * The *ctx* should point to the lirc sample as passed into + * the program. + * + * This helper is only available is the kernel was compiled with + * the **CONFIG_BPF_LIRC_MODE2** configuration option set to + * "**y**". + * + * Returns + * 0 + */ +static long (*bpf_rc_pointer_rel)(void *ctx, __s32 rel_x, __s32 rel_y) = (void *) 92; + +/* + * bpf_spin_lock + * + * Acquire a spinlock represented by the pointer *lock*, which is + * stored as part of a value of a map. Taking the lock allows to + * safely update the rest of the fields in that value. The + * spinlock can (and must) later be released with a call to + * **bpf_spin_unlock**\ (\ *lock*\ ). + * + * Spinlocks in BPF programs come with a number of restrictions + * and constraints: + * + * * **bpf_spin_lock** objects are only allowed inside maps of + * types **BPF_MAP_TYPE_HASH** and **BPF_MAP_TYPE_ARRAY** (this + * list could be extended in the future). + * * BTF description of the map is mandatory. + * * The BPF program can take ONE lock at a time, since taking two + * or more could cause dead locks. + * * Only one **struct bpf_spin_lock** is allowed per map element. + * * When the lock is taken, calls (either BPF to BPF or helpers) + * are not allowed. + * * The **BPF_LD_ABS** and **BPF_LD_IND** instructions are not + * allowed inside a spinlock-ed region. + * * The BPF program MUST call **bpf_spin_unlock**\ () to release + * the lock, on all execution paths, before it returns. + * * The BPF program can access **struct bpf_spin_lock** only via + * the **bpf_spin_lock**\ () and **bpf_spin_unlock**\ () + * helpers. Loading or storing data into the **struct + * bpf_spin_lock** *lock*\ **;** field of a map is not allowed. + * * To use the **bpf_spin_lock**\ () helper, the BTF description + * of the map value must be a struct and have **struct + * bpf_spin_lock** *anyname*\ **;** field at the top level. + * Nested lock inside another struct is not allowed. + * * The **struct bpf_spin_lock** *lock* field in a map value must + * be aligned on a multiple of 4 bytes in that value. + * * Syscall with command **BPF_MAP_LOOKUP_ELEM** does not copy + * the **bpf_spin_lock** field to user space. + * * Syscall with command **BPF_MAP_UPDATE_ELEM**, or update from + * a BPF program, do not update the **bpf_spin_lock** field. + * * **bpf_spin_lock** cannot be on the stack or inside a + * networking packet (it can only be inside of a map values). + * * **bpf_spin_lock** is available to root only. + * * Tracing programs and socket filter programs cannot use + * **bpf_spin_lock**\ () due to insufficient preemption checks + * (but this may change in the future). + * * **bpf_spin_lock** is not allowed in inner maps of map-in-map. + * + * Returns + * 0 + */ +static long (*bpf_spin_lock)(struct bpf_spin_lock *lock) = (void *) 93; + +/* + * bpf_spin_unlock + * + * Release the *lock* previously locked by a call to + * **bpf_spin_lock**\ (\ *lock*\ ). + * + * Returns + * 0 + */ +static long (*bpf_spin_unlock)(struct bpf_spin_lock *lock) = (void *) 94; + +/* + * bpf_sk_fullsock + * + * This helper gets a **struct bpf_sock** pointer such + * that all the fields in this **bpf_sock** can be accessed. + * + * Returns + * A **struct bpf_sock** pointer on success, or **NULL** in + * case of failure. + */ +static struct bpf_sock *(*bpf_sk_fullsock)(struct bpf_sock *sk) = (void *) 95; + +/* + * bpf_tcp_sock + * + * This helper gets a **struct bpf_tcp_sock** pointer from a + * **struct bpf_sock** pointer. + * + * Returns + * A **struct bpf_tcp_sock** pointer on success, or **NULL** in + * case of failure. + */ +static struct bpf_tcp_sock *(*bpf_tcp_sock)(struct bpf_sock *sk) = (void *) 96; + +/* + * bpf_skb_ecn_set_ce + * + * Set ECN (Explicit Congestion Notification) field of IP header + * to **CE** (Congestion Encountered) if current value is **ECT** + * (ECN Capable Transport). Otherwise, do nothing. Works with IPv6 + * and IPv4. + * + * Returns + * 1 if the **CE** flag is set (either by the current helper call + * or because it was already present), 0 if it is not set. + */ +static long (*bpf_skb_ecn_set_ce)(struct __sk_buff *skb) = (void *) 97; + +/* + * bpf_get_listener_sock + * + * Return a **struct bpf_sock** pointer in **TCP_LISTEN** state. + * **bpf_sk_release**\ () is unnecessary and not allowed. + * + * Returns + * A **struct bpf_sock** pointer on success, or **NULL** in + * case of failure. + */ +static struct bpf_sock *(*bpf_get_listener_sock)(struct bpf_sock *sk) = (void *) 98; + +/* + * bpf_skc_lookup_tcp + * + * Look for TCP socket matching *tuple*, optionally in a child + * network namespace *netns*. The return value must be checked, + * and if non-**NULL**, released via **bpf_sk_release**\ (). + * + * This function is identical to **bpf_sk_lookup_tcp**\ (), except + * that it also returns timewait or request sockets. Use + * **bpf_sk_fullsock**\ () or **bpf_tcp_sock**\ () to access the + * full structure. + * + * This helper is available only if the kernel was compiled with + * **CONFIG_NET** configuration option. + * + * Returns + * Pointer to **struct bpf_sock**, or **NULL** in case of failure. + * For sockets with reuseport option, the **struct bpf_sock** + * result is from *reuse*\ **->socks**\ [] using the hash of the + * tuple. + */ +static struct bpf_sock *(*bpf_skc_lookup_tcp)(void *ctx, struct bpf_sock_tuple *tuple, __u32 tuple_size, __u64 netns, __u64 flags) = (void *) 99; + +/* + * bpf_tcp_check_syncookie + * + * Check whether *iph* and *th* contain a valid SYN cookie ACK for + * the listening socket in *sk*. + * + * *iph* points to the start of the IPv4 or IPv6 header, while + * *iph_len* contains **sizeof**\ (**struct iphdr**) or + * **sizeof**\ (**struct ip6hdr**). + * + * *th* points to the start of the TCP header, while *th_len* + * contains **sizeof**\ (**struct tcphdr**). + * + * Returns + * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative + * error otherwise. + */ +static long (*bpf_tcp_check_syncookie)(void *sk, void *iph, __u32 iph_len, struct tcphdr *th, __u32 th_len) = (void *) 100; + +/* + * bpf_sysctl_get_name + * + * Get name of sysctl in /proc/sys/ and copy it into provided by + * program buffer *buf* of size *buf_len*. + * + * The buffer is always NUL terminated, unless it's zero-sized. + * + * If *flags* is zero, full name (e.g. "net/ipv4/tcp_mem") is + * copied. Use **BPF_F_SYSCTL_BASE_NAME** flag to copy base name + * only (e.g. "tcp_mem"). + * + * Returns + * Number of character copied (not including the trailing NUL). + * + * **-E2BIG** if the buffer wasn't big enough (*buf* will contain + * truncated name in this case). + */ +static long (*bpf_sysctl_get_name)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len, __u64 flags) = (void *) 101; + +/* + * bpf_sysctl_get_current_value + * + * Get current value of sysctl as it is presented in /proc/sys + * (incl. newline, etc), and copy it as a string into provided + * by program buffer *buf* of size *buf_len*. + * + * The whole value is copied, no matter what file position user + * space issued e.g. sys_read at. + * + * The buffer is always NUL terminated, unless it's zero-sized. + * + * Returns + * Number of character copied (not including the trailing NUL). + * + * **-E2BIG** if the buffer wasn't big enough (*buf* will contain + * truncated name in this case). + * + * **-EINVAL** if current value was unavailable, e.g. because + * sysctl is uninitialized and read returns -EIO for it. + */ +static long (*bpf_sysctl_get_current_value)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len) = (void *) 102; + +/* + * bpf_sysctl_get_new_value + * + * Get new value being written by user space to sysctl (before + * the actual write happens) and copy it as a string into + * provided by program buffer *buf* of size *buf_len*. + * + * User space may write new value at file position > 0. + * + * The buffer is always NUL terminated, unless it's zero-sized. + * + * Returns + * Number of character copied (not including the trailing NUL). + * + * **-E2BIG** if the buffer wasn't big enough (*buf* will contain + * truncated name in this case). + * + * **-EINVAL** if sysctl is being read. + */ +static long (*bpf_sysctl_get_new_value)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len) = (void *) 103; + +/* + * bpf_sysctl_set_new_value + * + * Override new value being written by user space to sysctl with + * value provided by program in buffer *buf* of size *buf_len*. + * + * *buf* should contain a string in same form as provided by user + * space on sysctl write. + * + * User space may write new value at file position > 0. To override + * the whole sysctl value file position should be set to zero. + * + * Returns + * 0 on success. + * + * **-E2BIG** if the *buf_len* is too big. + * + * **-EINVAL** if sysctl is being read. + */ +static long (*bpf_sysctl_set_new_value)(struct bpf_sysctl *ctx, const char *buf, unsigned long buf_len) = (void *) 104; + +/* + * bpf_strtol + * + * Convert the initial part of the string from buffer *buf* of + * size *buf_len* to a long integer according to the given base + * and save the result in *res*. + * + * The string may begin with an arbitrary amount of white space + * (as determined by **isspace**\ (3)) followed by a single + * optional '**-**' sign. + * + * Five least significant bits of *flags* encode base, other bits + * are currently unused. + * + * Base must be either 8, 10, 16 or 0 to detect it automatically + * similar to user space **strtol**\ (3). + * + * Returns + * Number of characters consumed on success. Must be positive but + * no more than *buf_len*. + * + * **-EINVAL** if no valid digits were found or unsupported base + * was provided. + * + * **-ERANGE** if resulting value was out of range. + */ +static long (*bpf_strtol)(const char *buf, unsigned long buf_len, __u64 flags, long *res) = (void *) 105; + +/* + * bpf_strtoul + * + * Convert the initial part of the string from buffer *buf* of + * size *buf_len* to an unsigned long integer according to the + * given base and save the result in *res*. + * + * The string may begin with an arbitrary amount of white space + * (as determined by **isspace**\ (3)). + * + * Five least significant bits of *flags* encode base, other bits + * are currently unused. + * + * Base must be either 8, 10, 16 or 0 to detect it automatically + * similar to user space **strtoul**\ (3). + * + * Returns + * Number of characters consumed on success. Must be positive but + * no more than *buf_len*. + * + * **-EINVAL** if no valid digits were found or unsupported base + * was provided. + * + * **-ERANGE** if resulting value was out of range. + */ +static long (*bpf_strtoul)(const char *buf, unsigned long buf_len, __u64 flags, unsigned long *res) = (void *) 106; + +/* + * bpf_sk_storage_get + * + * Get a bpf-local-storage from a *sk*. + * + * Logically, it could be thought of getting the value from + * a *map* with *sk* as the **key**. From this + * perspective, the usage is not much different from + * **bpf_map_lookup_elem**\ (*map*, **&**\ *sk*) except this + * helper enforces the key must be a full socket and the map must + * be a **BPF_MAP_TYPE_SK_STORAGE** also. + * + * Underneath, the value is stored locally at *sk* instead of + * the *map*. The *map* is used as the bpf-local-storage + * "type". The bpf-local-storage "type" (i.e. the *map*) is + * searched against all bpf-local-storages residing at *sk*. + * + * *sk* is a kernel **struct sock** pointer for LSM program. + * *sk* is a **struct bpf_sock** pointer for other program types. + * + * An optional *flags* (**BPF_SK_STORAGE_GET_F_CREATE**) can be + * used such that a new bpf-local-storage will be + * created if one does not exist. *value* can be used + * together with **BPF_SK_STORAGE_GET_F_CREATE** to specify + * the initial value of a bpf-local-storage. If *value* is + * **NULL**, the new bpf-local-storage will be zero initialized. + * + * Returns + * A bpf-local-storage pointer is returned on success. + * + * **NULL** if not found or there was an error in adding + * a new bpf-local-storage. + */ +static void *(*bpf_sk_storage_get)(void *map, void *sk, void *value, __u64 flags) = (void *) 107; + +/* + * bpf_sk_storage_delete + * + * Delete a bpf-local-storage from a *sk*. + * + * Returns + * 0 on success. + * + * **-ENOENT** if the bpf-local-storage cannot be found. + * **-EINVAL** if sk is not a fullsock (e.g. a request_sock). + */ +static long (*bpf_sk_storage_delete)(void *map, void *sk) = (void *) 108; + +/* + * bpf_send_signal + * + * Send signal *sig* to the process of the current task. + * The signal may be delivered to any of this process's threads. + * + * Returns + * 0 on success or successfully queued. + * + * **-EBUSY** if work queue under nmi is full. + * + * **-EINVAL** if *sig* is invalid. + * + * **-EPERM** if no permission to send the *sig*. + * + * **-EAGAIN** if bpf program can try again. + */ +static long (*bpf_send_signal)(__u32 sig) = (void *) 109; + +/* + * bpf_tcp_gen_syncookie + * + * Try to issue a SYN cookie for the packet with corresponding + * IP/TCP headers, *iph* and *th*, on the listening socket in *sk*. + * + * *iph* points to the start of the IPv4 or IPv6 header, while + * *iph_len* contains **sizeof**\ (**struct iphdr**) or + * **sizeof**\ (**struct ip6hdr**). + * + * *th* points to the start of the TCP header, while *th_len* + * contains the length of the TCP header. + * + * Returns + * On success, lower 32 bits hold the generated SYN cookie in + * followed by 16 bits which hold the MSS value for that cookie, + * and the top 16 bits are unused. + * + * On failure, the returned value is one of the following: + * + * **-EINVAL** SYN cookie cannot be issued due to error + * + * **-ENOENT** SYN cookie should not be issued (no SYN flood) + * + * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies + * + * **-EPROTONOSUPPORT** IP packet version is not 4 or 6 + */ +static __s64 (*bpf_tcp_gen_syncookie)(void *sk, void *iph, __u32 iph_len, struct tcphdr *th, __u32 th_len) = (void *) 110; + +/* + * bpf_skb_output + * + * Write raw *data* blob into a special BPF perf event held by + * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf + * event must have the following attributes: **PERF_SAMPLE_RAW** + * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and + * **PERF_COUNT_SW_BPF_OUTPUT** as **config**. + * + * The *flags* are used to indicate the index in *map* for which + * the value must be put, masked with **BPF_F_INDEX_MASK**. + * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU** + * to indicate that the index of the current CPU core should be + * used. + * + * The value to write, of *size*, is passed through eBPF stack and + * pointed by *data*. + * + * *ctx* is a pointer to in-kernel struct sk_buff. + * + * This helper is similar to **bpf_perf_event_output**\ () but + * restricted to raw_tracepoint bpf programs. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_skb_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *) 111; + +/* + * bpf_probe_read_user + * + * Safely attempt to read *size* bytes from user space address + * *unsafe_ptr* and store the data in *dst*. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_probe_read_user)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 112; + +/* + * bpf_probe_read_kernel + * + * Safely attempt to read *size* bytes from kernel space address + * *unsafe_ptr* and store the data in *dst*. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_probe_read_kernel)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 113; + +/* + * bpf_probe_read_user_str + * + * Copy a NUL terminated string from an unsafe user address + * *unsafe_ptr* to *dst*. The *size* should include the + * terminating NUL byte. In case the string length is smaller than + * *size*, the target is not padded with further NUL bytes. If the + * string length is larger than *size*, just *size*-1 bytes are + * copied and the last byte is set to NUL. + * + * On success, returns the number of bytes that were written, + * including the terminal NUL. This makes this helper useful in + * tracing programs for reading strings, and more importantly to + * get its length at runtime. See the following snippet: + * + * :: + * + * SEC("kprobe/sys_open") + * void bpf_sys_open(struct pt_regs *ctx) + * { + * char buf[PATHLEN]; // PATHLEN is defined to 256 + * int res = bpf_probe_read_user_str(buf, sizeof(buf), + * ctx->di); + * + * // Consume buf, for example push it to + * // userspace via bpf_perf_event_output(); we + * // can use res (the string length) as event + * // size, after checking its boundaries. + * } + * + * In comparison, using **bpf_probe_read_user**\ () helper here + * instead to read the string would require to estimate the length + * at compile time, and would often result in copying more memory + * than necessary. + * + * Another useful use case is when parsing individual process + * arguments or individual environment variables navigating + * *current*\ **->mm->arg_start** and *current*\ + * **->mm->env_start**: using this helper and the return value, + * one can quickly iterate at the right offset of the memory area. + * + * Returns + * On success, the strictly positive length of the output string, + * including the trailing NUL character. On error, a negative + * value. + */ +static long (*bpf_probe_read_user_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 114; + +/* + * bpf_probe_read_kernel_str + * + * Copy a NUL terminated string from an unsafe kernel address *unsafe_ptr* + * to *dst*. Same semantics as with **bpf_probe_read_user_str**\ () apply. + * + * Returns + * On success, the strictly positive length of the string, including + * the trailing NUL character. On error, a negative value. + */ +static long (*bpf_probe_read_kernel_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 115; + +/* + * bpf_tcp_send_ack + * + * Send out a tcp-ack. *tp* is the in-kernel struct **tcp_sock**. + * *rcv_nxt* is the ack_seq to be sent out. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_tcp_send_ack)(void *tp, __u32 rcv_nxt) = (void *) 116; + +/* + * bpf_send_signal_thread + * + * Send signal *sig* to the thread corresponding to the current task. + * + * Returns + * 0 on success or successfully queued. + * + * **-EBUSY** if work queue under nmi is full. + * + * **-EINVAL** if *sig* is invalid. + * + * **-EPERM** if no permission to send the *sig*. + * + * **-EAGAIN** if bpf program can try again. + */ +static long (*bpf_send_signal_thread)(__u32 sig) = (void *) 117; + +/* + * bpf_jiffies64 + * + * Obtain the 64bit jiffies + * + * Returns + * The 64 bit jiffies + */ +static __u64 (*bpf_jiffies64)(void) = (void *) 118; + +/* + * bpf_read_branch_records + * + * For an eBPF program attached to a perf event, retrieve the + * branch records (**struct perf_branch_entry**) associated to *ctx* + * and store it in the buffer pointed by *buf* up to size + * *size* bytes. + * + * Returns + * On success, number of bytes written to *buf*. On error, a + * negative value. + * + * The *flags* can be set to **BPF_F_GET_BRANCH_RECORDS_SIZE** to + * instead return the number of bytes required to store all the + * branch entries. If this flag is set, *buf* may be NULL. + * + * **-EINVAL** if arguments invalid or **size** not a multiple + * of **sizeof**\ (**struct perf_branch_entry**\ ). + * + * **-ENOENT** if architecture does not support branch records. + */ +static long (*bpf_read_branch_records)(struct bpf_perf_event_data *ctx, void *buf, __u32 size, __u64 flags) = (void *) 119; + +/* + * bpf_get_ns_current_pid_tgid + * + * Returns 0 on success, values for *pid* and *tgid* as seen from the current + * *namespace* will be returned in *nsdata*. + * + * Returns + * 0 on success, or one of the following in case of failure: + * + * **-EINVAL** if dev and inum supplied don't match dev_t and inode number + * with nsfs of current task, or if dev conversion to dev_t lost high bits. + * + * **-ENOENT** if pidns does not exists for the current task. + */ +static long (*bpf_get_ns_current_pid_tgid)(__u64 dev, __u64 ino, struct bpf_pidns_info *nsdata, __u32 size) = (void *) 120; + +/* + * bpf_xdp_output + * + * Write raw *data* blob into a special BPF perf event held by + * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf + * event must have the following attributes: **PERF_SAMPLE_RAW** + * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and + * **PERF_COUNT_SW_BPF_OUTPUT** as **config**. + * + * The *flags* are used to indicate the index in *map* for which + * the value must be put, masked with **BPF_F_INDEX_MASK**. + * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU** + * to indicate that the index of the current CPU core should be + * used. + * + * The value to write, of *size*, is passed through eBPF stack and + * pointed by *data*. + * + * *ctx* is a pointer to in-kernel struct xdp_buff. + * + * This helper is similar to **bpf_perf_eventoutput**\ () but + * restricted to raw_tracepoint bpf programs. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_xdp_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *) 121; + +/* + * bpf_get_netns_cookie + * + * Retrieve the cookie (generated by the kernel) of the network + * namespace the input *ctx* is associated with. The network + * namespace cookie remains stable for its lifetime and provides + * a global identifier that can be assumed unique. If *ctx* is + * NULL, then the helper returns the cookie for the initial + * network namespace. The cookie itself is very similar to that + * of **bpf_get_socket_cookie**\ () helper, but for network + * namespaces instead of sockets. + * + * Returns + * A 8-byte long opaque number. + */ +static __u64 (*bpf_get_netns_cookie)(void *ctx) = (void *) 122; + +/* + * bpf_get_current_ancestor_cgroup_id + * + * Return id of cgroup v2 that is ancestor of the cgroup associated + * with the current task at the *ancestor_level*. The root cgroup + * is at *ancestor_level* zero and each step down the hierarchy + * increments the level. If *ancestor_level* == level of cgroup + * associated with the current task, then return value will be the + * same as that of **bpf_get_current_cgroup_id**\ (). + * + * The helper is useful to implement policies based on cgroups + * that are upper in hierarchy than immediate cgroup associated + * with the current task. + * + * The format of returned id and helper limitations are same as in + * **bpf_get_current_cgroup_id**\ (). + * + * Returns + * The id is returned or 0 in case the id could not be retrieved. + */ +static __u64 (*bpf_get_current_ancestor_cgroup_id)(int ancestor_level) = (void *) 123; + +/* + * bpf_sk_assign + * + * Helper is overloaded depending on BPF program type. This + * description applies to **BPF_PROG_TYPE_SCHED_CLS** and + * **BPF_PROG_TYPE_SCHED_ACT** programs. + * + * Assign the *sk* to the *skb*. When combined with appropriate + * routing configuration to receive the packet towards the socket, + * will cause *skb* to be delivered to the specified socket. + * Subsequent redirection of *skb* via **bpf_redirect**\ (), + * **bpf_clone_redirect**\ () or other methods outside of BPF may + * interfere with successful delivery to the socket. + * + * This operation is only valid from TC ingress path. + * + * The *flags* argument must be zero. + * + * Returns + * 0 on success, or a negative error in case of failure: + * + * **-EINVAL** if specified *flags* are not supported. + * + * **-ENOENT** if the socket is unavailable for assignment. + * + * **-ENETUNREACH** if the socket is unreachable (wrong netns). + * + * **-EOPNOTSUPP** if the operation is not supported, for example + * a call from outside of TC ingress. + * + * **-ESOCKTNOSUPPORT** if the socket type is not supported + * (reuseport). + */ +static long (*bpf_sk_assign)(void *ctx, void *sk, __u64 flags) = (void *) 124; + +/* + * bpf_ktime_get_boot_ns + * + * Return the time elapsed since system boot, in nanoseconds. + * Does include the time the system was suspended. + * See: **clock_gettime**\ (**CLOCK_BOOTTIME**) + * + * Returns + * Current *ktime*. + */ +static __u64 (*bpf_ktime_get_boot_ns)(void) = (void *) 125; + +/* + * bpf_seq_printf + * + * **bpf_seq_printf**\ () uses seq_file **seq_printf**\ () to print + * out the format string. + * The *m* represents the seq_file. The *fmt* and *fmt_size* are for + * the format string itself. The *data* and *data_len* are format string + * arguments. The *data* are a **u64** array and corresponding format string + * values are stored in the array. For strings and pointers where pointees + * are accessed, only the pointer values are stored in the *data* array. + * The *data_len* is the size of *data* in bytes - must be a multiple of 8. + * + * Formats **%s**, **%p{i,I}{4,6}** requires to read kernel memory. + * Reading kernel memory may fail due to either invalid address or + * valid address but requiring a major memory fault. If reading kernel memory + * fails, the string for **%s** will be an empty string, and the ip + * address for **%p{i,I}{4,6}** will be 0. Not returning error to + * bpf program is consistent with what **bpf_trace_printk**\ () does for now. + * + * Returns + * 0 on success, or a negative error in case of failure: + * + * **-EBUSY** if per-CPU memory copy buffer is busy, can try again + * by returning 1 from bpf program. + * + * **-EINVAL** if arguments are invalid, or if *fmt* is invalid/unsupported. + * + * **-E2BIG** if *fmt* contains too many format specifiers. + * + * **-EOVERFLOW** if an overflow happened: The same object will be tried again. + */ +static long (*bpf_seq_printf)(struct seq_file *m, const char *fmt, __u32 fmt_size, const void *data, __u32 data_len) = (void *) 126; + +/* + * bpf_seq_write + * + * **bpf_seq_write**\ () uses seq_file **seq_write**\ () to write the data. + * The *m* represents the seq_file. The *data* and *len* represent the + * data to write in bytes. + * + * Returns + * 0 on success, or a negative error in case of failure: + * + * **-EOVERFLOW** if an overflow happened: The same object will be tried again. + */ +static long (*bpf_seq_write)(struct seq_file *m, const void *data, __u32 len) = (void *) 127; + +/* + * bpf_sk_cgroup_id + * + * Return the cgroup v2 id of the socket *sk*. + * + * *sk* must be a non-**NULL** pointer to a socket, e.g. one + * returned from **bpf_sk_lookup_xxx**\ (), + * **bpf_sk_fullsock**\ (), etc. The format of returned id is + * same as in **bpf_skb_cgroup_id**\ (). + * + * This helper is available only if the kernel was compiled with + * the **CONFIG_SOCK_CGROUP_DATA** configuration option. + * + * Returns + * The id is returned or 0 in case the id could not be retrieved. + */ +static __u64 (*bpf_sk_cgroup_id)(void *sk) = (void *) 128; + +/* + * bpf_sk_ancestor_cgroup_id + * + * Return id of cgroup v2 that is ancestor of cgroup associated + * with the *sk* at the *ancestor_level*. The root cgroup is at + * *ancestor_level* zero and each step down the hierarchy + * increments the level. If *ancestor_level* == level of cgroup + * associated with *sk*, then return value will be same as that + * of **bpf_sk_cgroup_id**\ (). + * + * The helper is useful to implement policies based on cgroups + * that are upper in hierarchy than immediate cgroup associated + * with *sk*. + * + * The format of returned id and helper limitations are same as in + * **bpf_sk_cgroup_id**\ (). + * + * Returns + * The id is returned or 0 in case the id could not be retrieved. + */ +static __u64 (*bpf_sk_ancestor_cgroup_id)(void *sk, int ancestor_level) = (void *) 129; + +/* + * bpf_ringbuf_output + * + * Copy *size* bytes from *data* into a ring buffer *ringbuf*. + * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification + * of new data availability is sent. + * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification + * of new data availability is sent unconditionally. + * If **0** is specified in *flags*, an adaptive notification + * of new data availability is sent. + * + * An adaptive notification is a notification sent whenever the user-space + * process has caught up and consumed all available payloads. In case the user-space + * process is still processing a previous payload, then no notification is needed + * as it will process the newly added payload automatically. + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_ringbuf_output)(void *ringbuf, void *data, __u64 size, __u64 flags) = (void *) 130; + +/* + * bpf_ringbuf_reserve + * + * Reserve *size* bytes of payload in a ring buffer *ringbuf*. + * *flags* must be 0. + * + * Returns + * Valid pointer with *size* bytes of memory available; NULL, + * otherwise. + */ +static void *(*bpf_ringbuf_reserve)(void *ringbuf, __u64 size, __u64 flags) = (void *) 131; + +/* + * bpf_ringbuf_submit + * + * Submit reserved ring buffer sample, pointed to by *data*. + * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification + * of new data availability is sent. + * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification + * of new data availability is sent unconditionally. + * If **0** is specified in *flags*, an adaptive notification + * of new data availability is sent. + * + * See 'bpf_ringbuf_output()' for the definition of adaptive notification. + * + * Returns + * Nothing. Always succeeds. + */ +static void (*bpf_ringbuf_submit)(void *data, __u64 flags) = (void *) 132; + +/* + * bpf_ringbuf_discard + * + * Discard reserved ring buffer sample, pointed to by *data*. + * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification + * of new data availability is sent. + * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification + * of new data availability is sent unconditionally. + * If **0** is specified in *flags*, an adaptive notification + * of new data availability is sent. + * + * See 'bpf_ringbuf_output()' for the definition of adaptive notification. + * + * Returns + * Nothing. Always succeeds. + */ +static void (*bpf_ringbuf_discard)(void *data, __u64 flags) = (void *) 133; + +/* + * bpf_ringbuf_query + * + * Query various characteristics of provided ring buffer. What + * exactly is queries is determined by *flags*: + * + * * **BPF_RB_AVAIL_DATA**: Amount of data not yet consumed. + * * **BPF_RB_RING_SIZE**: The size of ring buffer. + * * **BPF_RB_CONS_POS**: Consumer position (can wrap around). + * * **BPF_RB_PROD_POS**: Producer(s) position (can wrap around). + * + * Data returned is just a momentary snapshot of actual values + * and could be inaccurate, so this facility should be used to + * power heuristics and for reporting, not to make 100% correct + * calculation. + * + * Returns + * Requested value, or 0, if *flags* are not recognized. + */ +static __u64 (*bpf_ringbuf_query)(void *ringbuf, __u64 flags) = (void *) 134; + +/* + * bpf_csum_level + * + * Change the skbs checksum level by one layer up or down, or + * reset it entirely to none in order to have the stack perform + * checksum validation. The level is applicable to the following + * protocols: TCP, UDP, GRE, SCTP, FCOE. For example, a decap of + * | ETH | IP | UDP | GUE | IP | TCP | into | ETH | IP | TCP | + * through **bpf_skb_adjust_room**\ () helper with passing in + * **BPF_F_ADJ_ROOM_NO_CSUM_RESET** flag would require one call + * to **bpf_csum_level**\ () with **BPF_CSUM_LEVEL_DEC** since + * the UDP header is removed. Similarly, an encap of the latter + * into the former could be accompanied by a helper call to + * **bpf_csum_level**\ () with **BPF_CSUM_LEVEL_INC** if the + * skb is still intended to be processed in higher layers of the + * stack instead of just egressing at tc. + * + * There are three supported level settings at this time: + * + * * **BPF_CSUM_LEVEL_INC**: Increases skb->csum_level for skbs + * with CHECKSUM_UNNECESSARY. + * * **BPF_CSUM_LEVEL_DEC**: Decreases skb->csum_level for skbs + * with CHECKSUM_UNNECESSARY. + * * **BPF_CSUM_LEVEL_RESET**: Resets skb->csum_level to 0 and + * sets CHECKSUM_NONE to force checksum validation by the stack. + * * **BPF_CSUM_LEVEL_QUERY**: No-op, returns the current + * skb->csum_level. + * + * Returns + * 0 on success, or a negative error in case of failure. In the + * case of **BPF_CSUM_LEVEL_QUERY**, the current skb->csum_level + * is returned or the error code -EACCES in case the skb is not + * subject to CHECKSUM_UNNECESSARY. + */ +static long (*bpf_csum_level)(struct __sk_buff *skb, __u64 level) = (void *) 135; + +/* + * bpf_skc_to_tcp6_sock + * + * Dynamically cast a *sk* pointer to a *tcp6_sock* pointer. + * + * Returns + * *sk* if casting is valid, or **NULL** otherwise. + */ +static struct tcp6_sock *(*bpf_skc_to_tcp6_sock)(void *sk) = (void *) 136; + +/* + * bpf_skc_to_tcp_sock + * + * Dynamically cast a *sk* pointer to a *tcp_sock* pointer. + * + * Returns + * *sk* if casting is valid, or **NULL** otherwise. + */ +static struct tcp_sock *(*bpf_skc_to_tcp_sock)(void *sk) = (void *) 137; + +/* + * bpf_skc_to_tcp_timewait_sock + * + * Dynamically cast a *sk* pointer to a *tcp_timewait_sock* pointer. + * + * Returns + * *sk* if casting is valid, or **NULL** otherwise. + */ +static struct tcp_timewait_sock *(*bpf_skc_to_tcp_timewait_sock)(void *sk) = (void *) 138; + +/* + * bpf_skc_to_tcp_request_sock + * + * Dynamically cast a *sk* pointer to a *tcp_request_sock* pointer. + * + * Returns + * *sk* if casting is valid, or **NULL** otherwise. + */ +static struct tcp_request_sock *(*bpf_skc_to_tcp_request_sock)(void *sk) = (void *) 139; + +/* + * bpf_skc_to_udp6_sock + * + * Dynamically cast a *sk* pointer to a *udp6_sock* pointer. + * + * Returns + * *sk* if casting is valid, or **NULL** otherwise. + */ +static struct udp6_sock *(*bpf_skc_to_udp6_sock)(void *sk) = (void *) 140; + +/* + * bpf_get_task_stack + * + * Return a user or a kernel stack in bpf program provided buffer. + * To achieve this, the helper needs *task*, which is a valid + * pointer to **struct task_struct**. To store the stacktrace, the + * bpf program provides *buf* with a nonnegative *size*. + * + * The last argument, *flags*, holds the number of stack frames to + * skip (from 0 to 255), masked with + * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set + * the following flags: + * + * **BPF_F_USER_STACK** + * Collect a user space stack instead of a kernel stack. + * **BPF_F_USER_BUILD_ID** + * Collect buildid+offset instead of ips for user stack, + * only valid if **BPF_F_USER_STACK** is also specified. + * + * **bpf_get_task_stack**\ () can collect up to + * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject + * to sufficient large buffer size. Note that + * this limit can be controlled with the **sysctl** program, and + * that it should be manually increased in order to profile long + * user stacks (such as stacks for Java programs). To do so, use: + * + * :: + * + * # sysctl kernel.perf_event_max_stack= + * + * Returns + * A non-negative value equal to or less than *size* on success, + * or a negative error in case of failure. + */ +static long (*bpf_get_task_stack)(struct task_struct *task, void *buf, __u32 size, __u64 flags) = (void *) 141; + +/* + * bpf_load_hdr_opt + * + * Load header option. Support reading a particular TCP header + * option for bpf program (**BPF_PROG_TYPE_SOCK_OPS**). + * + * If *flags* is 0, it will search the option from the + * *skops*\ **->skb_data**. The comment in **struct bpf_sock_ops** + * has details on what skb_data contains under different + * *skops*\ **->op**. + * + * The first byte of the *searchby_res* specifies the + * kind that it wants to search. + * + * If the searching kind is an experimental kind + * (i.e. 253 or 254 according to RFC6994). It also + * needs to specify the "magic" which is either + * 2 bytes or 4 bytes. It then also needs to + * specify the size of the magic by using + * the 2nd byte which is "kind-length" of a TCP + * header option and the "kind-length" also + * includes the first 2 bytes "kind" and "kind-length" + * itself as a normal TCP header option also does. + * + * For example, to search experimental kind 254 with + * 2 byte magic 0xeB9F, the searchby_res should be + * [ 254, 4, 0xeB, 0x9F, 0, 0, .... 0 ]. + * + * To search for the standard window scale option (3), + * the *searchby_res* should be [ 3, 0, 0, .... 0 ]. + * Note, kind-length must be 0 for regular option. + * + * Searching for No-Op (0) and End-of-Option-List (1) are + * not supported. + * + * *len* must be at least 2 bytes which is the minimal size + * of a header option. + * + * Supported flags: + * + * * **BPF_LOAD_HDR_OPT_TCP_SYN** to search from the + * saved_syn packet or the just-received syn packet. + * + * + * Returns + * > 0 when found, the header option is copied to *searchby_res*. + * The return value is the total length copied. On failure, a + * negative error code is returned: + * + * **-EINVAL** if a parameter is invalid. + * + * **-ENOMSG** if the option is not found. + * + * **-ENOENT** if no syn packet is available when + * **BPF_LOAD_HDR_OPT_TCP_SYN** is used. + * + * **-ENOSPC** if there is not enough space. Only *len* number of + * bytes are copied. + * + * **-EFAULT** on failure to parse the header options in the + * packet. + * + * **-EPERM** if the helper cannot be used under the current + * *skops*\ **->op**. + */ +static long (*bpf_load_hdr_opt)(struct bpf_sock_ops *skops, void *searchby_res, __u32 len, __u64 flags) = (void *) 142; + +/* + * bpf_store_hdr_opt + * + * Store header option. The data will be copied + * from buffer *from* with length *len* to the TCP header. + * + * The buffer *from* should have the whole option that + * includes the kind, kind-length, and the actual + * option data. The *len* must be at least kind-length + * long. The kind-length does not have to be 4 byte + * aligned. The kernel will take care of the padding + * and setting the 4 bytes aligned value to th->doff. + * + * This helper will check for duplicated option + * by searching the same option in the outgoing skb. + * + * This helper can only be called during + * **BPF_SOCK_OPS_WRITE_HDR_OPT_CB**. + * + * + * Returns + * 0 on success, or negative error in case of failure: + * + * **-EINVAL** If param is invalid. + * + * **-ENOSPC** if there is not enough space in the header. + * Nothing has been written + * + * **-EEXIST** if the option already exists. + * + * **-EFAULT** on failrue to parse the existing header options. + * + * **-EPERM** if the helper cannot be used under the current + * *skops*\ **->op**. + */ +static long (*bpf_store_hdr_opt)(struct bpf_sock_ops *skops, const void *from, __u32 len, __u64 flags) = (void *) 143; + +/* + * bpf_reserve_hdr_opt + * + * Reserve *len* bytes for the bpf header option. The + * space will be used by **bpf_store_hdr_opt**\ () later in + * **BPF_SOCK_OPS_WRITE_HDR_OPT_CB**. + * + * If **bpf_reserve_hdr_opt**\ () is called multiple times, + * the total number of bytes will be reserved. + * + * This helper can only be called during + * **BPF_SOCK_OPS_HDR_OPT_LEN_CB**. + * + * + * Returns + * 0 on success, or negative error in case of failure: + * + * **-EINVAL** if a parameter is invalid. + * + * **-ENOSPC** if there is not enough space in the header. + * + * **-EPERM** if the helper cannot be used under the current + * *skops*\ **->op**. + */ +static long (*bpf_reserve_hdr_opt)(struct bpf_sock_ops *skops, __u32 len, __u64 flags) = (void *) 144; + +/* + * bpf_inode_storage_get + * + * Get a bpf_local_storage from an *inode*. + * + * Logically, it could be thought of as getting the value from + * a *map* with *inode* as the **key**. From this + * perspective, the usage is not much different from + * **bpf_map_lookup_elem**\ (*map*, **&**\ *inode*) except this + * helper enforces the key must be an inode and the map must also + * be a **BPF_MAP_TYPE_INODE_STORAGE**. + * + * Underneath, the value is stored locally at *inode* instead of + * the *map*. The *map* is used as the bpf-local-storage + * "type". The bpf-local-storage "type" (i.e. the *map*) is + * searched against all bpf_local_storage residing at *inode*. + * + * An optional *flags* (**BPF_LOCAL_STORAGE_GET_F_CREATE**) can be + * used such that a new bpf_local_storage will be + * created if one does not exist. *value* can be used + * together with **BPF_LOCAL_STORAGE_GET_F_CREATE** to specify + * the initial value of a bpf_local_storage. If *value* is + * **NULL**, the new bpf_local_storage will be zero initialized. + * + * Returns + * A bpf_local_storage pointer is returned on success. + * + * **NULL** if not found or there was an error in adding + * a new bpf_local_storage. + */ +static void *(*bpf_inode_storage_get)(void *map, void *inode, void *value, __u64 flags) = (void *) 145; + +/* + * bpf_inode_storage_delete + * + * Delete a bpf_local_storage from an *inode*. + * + * Returns + * 0 on success. + * + * **-ENOENT** if the bpf_local_storage cannot be found. + */ +static int (*bpf_inode_storage_delete)(void *map, void *inode) = (void *) 146; + +/* + * bpf_d_path + * + * Return full path for given **struct path** object, which + * needs to be the kernel BTF *path* object. The path is + * returned in the provided buffer *buf* of size *sz* and + * is zero terminated. + * + * + * Returns + * On success, the strictly positive length of the string, + * including the trailing NUL character. On error, a negative + * value. + */ +static long (*bpf_d_path)(struct path *path, char *buf, __u32 sz) = (void *) 147; + +/* + * bpf_copy_from_user + * + * Read *size* bytes from user space address *user_ptr* and store + * the data in *dst*. This is a wrapper of **copy_from_user**\ (). + * + * Returns + * 0 on success, or a negative error in case of failure. + */ +static long (*bpf_copy_from_user)(void *dst, __u32 size, const void *user_ptr) = (void *) 148; + +/* + * bpf_snprintf_btf + * + * Use BTF to store a string representation of *ptr*->ptr in *str*, + * using *ptr*->type_id. This value should specify the type + * that *ptr*->ptr points to. LLVM __builtin_btf_type_id(type, 1) + * can be used to look up vmlinux BTF type ids. Traversing the + * data structure using BTF, the type information and values are + * stored in the first *str_size* - 1 bytes of *str*. Safe copy of + * the pointer data is carried out to avoid kernel crashes during + * operation. Smaller types can use string space on the stack; + * larger programs can use map data to store the string + * representation. + * + * The string can be subsequently shared with userspace via + * bpf_perf_event_output() or ring buffer interfaces. + * bpf_trace_printk() is to be avoided as it places too small + * a limit on string size to be useful. + * + * *flags* is a combination of + * + * **BTF_F_COMPACT** + * no formatting around type information + * **BTF_F_NONAME** + * no struct/union member names/types + * **BTF_F_PTR_RAW** + * show raw (unobfuscated) pointer values; + * equivalent to printk specifier %px. + * **BTF_F_ZERO** + * show zero-valued struct/union members; they + * are not displayed by default + * + * + * Returns + * The number of bytes that were written (or would have been + * written if output had to be truncated due to string size), + * or a negative error in cases of failure. + */ +static long (*bpf_snprintf_btf)(char *str, __u32 str_size, struct btf_ptr *ptr, __u32 btf_ptr_size, __u64 flags) = (void *) 149; + +/* + * bpf_seq_printf_btf + * + * Use BTF to write to seq_write a string representation of + * *ptr*->ptr, using *ptr*->type_id as per bpf_snprintf_btf(). + * *flags* are identical to those used for bpf_snprintf_btf. + * + * Returns + * 0 on success or a negative error in case of failure. + */ +static long (*bpf_seq_printf_btf)(struct seq_file *m, struct btf_ptr *ptr, __u32 ptr_size, __u64 flags) = (void *) 150; + +/* + * bpf_skb_cgroup_classid + * + * See **bpf_get_cgroup_classid**\ () for the main description. + * This helper differs from **bpf_get_cgroup_classid**\ () in that + * the cgroup v1 net_cls class is retrieved only from the *skb*'s + * associated socket instead of the current process. + * + * Returns + * The id is returned or 0 in case the id could not be retrieved. + */ +static __u64 (*bpf_skb_cgroup_classid)(struct __sk_buff *skb) = (void *) 151; + +/* + * bpf_redirect_neigh + * + * Redirect the packet to another net device of index *ifindex* + * and fill in L2 addresses from neighboring subsystem. This helper + * is somewhat similar to **bpf_redirect**\ (), except that it + * populates L2 addresses as well, meaning, internally, the helper + * relies on the neighbor lookup for the L2 address of the nexthop. + * + * The helper will perform a FIB lookup based on the skb's + * networking header to get the address of the next hop, unless + * this is supplied by the caller in the *params* argument. The + * *plen* argument indicates the len of *params* and should be set + * to 0 if *params* is NULL. + * + * The *flags* argument is reserved and must be 0. The helper is + * currently only supported for tc BPF program types, and enabled + * for IPv4 and IPv6 protocols. + * + * Returns + * The helper returns **TC_ACT_REDIRECT** on success or + * **TC_ACT_SHOT** on error. + */ +static long (*bpf_redirect_neigh)(__u32 ifindex, struct bpf_redir_neigh *params, int plen, __u64 flags) = (void *) 152; + +/* + * bpf_per_cpu_ptr + * + * Take a pointer to a percpu ksym, *percpu_ptr*, and return a + * pointer to the percpu kernel variable on *cpu*. A ksym is an + * extern variable decorated with '__ksym'. For ksym, there is a + * global var (either static or global) defined of the same name + * in the kernel. The ksym is percpu if the global var is percpu. + * The returned pointer points to the global percpu var on *cpu*. + * + * bpf_per_cpu_ptr() has the same semantic as per_cpu_ptr() in the + * kernel, except that bpf_per_cpu_ptr() may return NULL. This + * happens if *cpu* is larger than nr_cpu_ids. The caller of + * bpf_per_cpu_ptr() must check the returned value. + * + * Returns + * A pointer pointing to the kernel percpu variable on *cpu*, or + * NULL, if *cpu* is invalid. + */ +static void *(*bpf_per_cpu_ptr)(const void *percpu_ptr, __u32 cpu) = (void *) 153; + +/* + * bpf_this_cpu_ptr + * + * Take a pointer to a percpu ksym, *percpu_ptr*, and return a + * pointer to the percpu kernel variable on this cpu. See the + * description of 'ksym' in **bpf_per_cpu_ptr**\ (). + * + * bpf_this_cpu_ptr() has the same semantic as this_cpu_ptr() in + * the kernel. Different from **bpf_per_cpu_ptr**\ (), it would + * never return NULL. + * + * Returns + * A pointer pointing to the kernel percpu variable on this cpu. + */ +static void *(*bpf_this_cpu_ptr)(const void *percpu_ptr) = (void *) 154; + +/* + * bpf_redirect_peer + * + * Redirect the packet to another net device of index *ifindex*. + * This helper is somewhat similar to **bpf_redirect**\ (), except + * that the redirection happens to the *ifindex*' peer device and + * the netns switch takes place from ingress to ingress without + * going through the CPU's backlog queue. + * + * The *flags* argument is reserved and must be 0. The helper is + * currently only supported for tc BPF program types at the ingress + * hook and for veth device types. The peer device must reside in a + * different network namespace. + * + * Returns + * The helper returns **TC_ACT_REDIRECT** on success or + * **TC_ACT_SHOT** on error. + */ +static long (*bpf_redirect_peer)(__u32 ifindex, __u64 flags) = (void *) 155; + +/* + * bpf_task_storage_get + * + * Get a bpf_local_storage from the *task*. + * + * Logically, it could be thought of as getting the value from + * a *map* with *task* as the **key**. From this + * perspective, the usage is not much different from + * **bpf_map_lookup_elem**\ (*map*, **&**\ *task*) except this + * helper enforces the key must be an task_struct and the map must also + * be a **BPF_MAP_TYPE_TASK_STORAGE**. + * + * Underneath, the value is stored locally at *task* instead of + * the *map*. The *map* is used as the bpf-local-storage + * "type". The bpf-local-storage "type" (i.e. the *map*) is + * searched against all bpf_local_storage residing at *task*. + * + * An optional *flags* (**BPF_LOCAL_STORAGE_GET_F_CREATE**) can be + * used such that a new bpf_local_storage will be + * created if one does not exist. *value* can be used + * together with **BPF_LOCAL_STORAGE_GET_F_CREATE** to specify + * the initial value of a bpf_local_storage. If *value* is + * **NULL**, the new bpf_local_storage will be zero initialized. + * + * Returns + * A bpf_local_storage pointer is returned on success. + * + * **NULL** if not found or there was an error in adding + * a new bpf_local_storage. + */ +static void *(*bpf_task_storage_get)(void *map, struct task_struct *task, void *value, __u64 flags) = (void *) 156; + +/* + * bpf_task_storage_delete + * + * Delete a bpf_local_storage from a *task*. + * + * Returns + * 0 on success. + * + * **-ENOENT** if the bpf_local_storage cannot be found. + */ +static long (*bpf_task_storage_delete)(void *map, struct task_struct *task) = (void *) 157; + +/* + * bpf_get_current_task_btf + * + * Return a BTF pointer to the "current" task. + * This pointer can also be used in helpers that accept an + * *ARG_PTR_TO_BTF_ID* of type *task_struct*. + * + * Returns + * Pointer to the current task. + */ +static struct task_struct *(*bpf_get_current_task_btf)(void) = (void *) 158; + +/* + * bpf_bprm_opts_set + * + * Set or clear certain options on *bprm*: + * + * **BPF_F_BPRM_SECUREEXEC** Set the secureexec bit + * which sets the **AT_SECURE** auxv for glibc. The bit + * is cleared if the flag is not specified. + * + * Returns + * **-EINVAL** if invalid *flags* are passed, zero otherwise. + */ +static long (*bpf_bprm_opts_set)(struct linux_binprm *bprm, __u64 flags) = (void *) 159; + +/* + * bpf_ktime_get_coarse_ns + * + * Return a coarse-grained version of the time elapsed since + * system boot, in nanoseconds. Does not include time the system + * was suspended. + * + * See: **clock_gettime**\ (**CLOCK_MONOTONIC_COARSE**) + * + * Returns + * Current *ktime*. + */ +static __u64 (*bpf_ktime_get_coarse_ns)(void) = (void *) 160; + +/* + * bpf_ima_inode_hash + * + * Returns the stored IMA hash of the *inode* (if it's avaialable). + * If the hash is larger than *size*, then only *size* + * bytes will be copied to *dst* + * + * Returns + * The **hash_algo** is returned on success, + * **-EOPNOTSUP** if IMA is disabled or **-EINVAL** if + * invalid arguments are passed. + */ +static long (*bpf_ima_inode_hash)(struct inode *inode, void *dst, __u32 size) = (void *) 161; + +/* + * bpf_sock_from_file + * + * If the given file represents a socket, returns the associated + * socket. + * + * Returns + * A pointer to a struct socket on success or NULL if the file is + * not a socket. + */ +static struct socket *(*bpf_sock_from_file)(struct file *file) = (void *) 162; + +/* + * bpf_check_mtu + * + * Check packet size against exceeding MTU of net device (based + * on *ifindex*). This helper will likely be used in combination + * with helpers that adjust/change the packet size. + * + * The argument *len_diff* can be used for querying with a planned + * size change. This allows to check MTU prior to changing packet + * ctx. Providing an *len_diff* adjustment that is larger than the + * actual packet size (resulting in negative packet size) will in + * principle not exceed the MTU, why it is not considered a + * failure. Other BPF-helpers are needed for performing the + * planned size change, why the responsibility for catch a negative + * packet size belong in those helpers. + * + * Specifying *ifindex* zero means the MTU check is performed + * against the current net device. This is practical if this isn't + * used prior to redirect. + * + * On input *mtu_len* must be a valid pointer, else verifier will + * reject BPF program. If the value *mtu_len* is initialized to + * zero then the ctx packet size is use. When value *mtu_len* is + * provided as input this specify the L3 length that the MTU check + * is done against. Remember XDP and TC length operate at L2, but + * this value is L3 as this correlate to MTU and IP-header tot_len + * values which are L3 (similar behavior as bpf_fib_lookup). + * + * The Linux kernel route table can configure MTUs on a more + * specific per route level, which is not provided by this helper. + * For route level MTU checks use the **bpf_fib_lookup**\ () + * helper. + * + * *ctx* is either **struct xdp_md** for XDP programs or + * **struct sk_buff** for tc cls_act programs. + * + * The *flags* argument can be a combination of one or more of the + * following values: + * + * **BPF_MTU_CHK_SEGS** + * This flag will only works for *ctx* **struct sk_buff**. + * If packet context contains extra packet segment buffers + * (often knows as GSO skb), then MTU check is harder to + * check at this point, because in transmit path it is + * possible for the skb packet to get re-segmented + * (depending on net device features). This could still be + * a MTU violation, so this flag enables performing MTU + * check against segments, with a different violation + * return code to tell it apart. Check cannot use len_diff. + * + * On return *mtu_len* pointer contains the MTU value of the net + * device. Remember the net device configured MTU is the L3 size, + * which is returned here and XDP and TC length operate at L2. + * Helper take this into account for you, but remember when using + * MTU value in your BPF-code. + * + * + * Returns + * * 0 on success, and populate MTU value in *mtu_len* pointer. + * + * * < 0 if any input argument is invalid (*mtu_len* not updated) + * + * MTU violations return positive values, but also populate MTU + * value in *mtu_len* pointer, as this can be needed for + * implementing PMTU handing: + * + * * **BPF_MTU_CHK_RET_FRAG_NEEDED** + * * **BPF_MTU_CHK_RET_SEGS_TOOBIG** + */ +static long (*bpf_check_mtu)(void *ctx, __u32 ifindex, __u32 *mtu_len, __s32 len_diff, __u64 flags) = (void *) 163; + +/* + * bpf_for_each_map_elem + * + * For each element in **map**, call **callback_fn** function with + * **map**, **callback_ctx** and other map-specific parameters. + * The **callback_fn** should be a static function and + * the **callback_ctx** should be a pointer to the stack. + * The **flags** is used to control certain aspects of the helper. + * Currently, the **flags** must be 0. + * + * The following are a list of supported map types and their + * respective expected callback signatures: + * + * BPF_MAP_TYPE_HASH, BPF_MAP_TYPE_PERCPU_HASH, + * BPF_MAP_TYPE_LRU_HASH, BPF_MAP_TYPE_LRU_PERCPU_HASH, + * BPF_MAP_TYPE_ARRAY, BPF_MAP_TYPE_PERCPU_ARRAY + * + * long (\*callback_fn)(struct bpf_map \*map, const void \*key, void \*value, void \*ctx); + * + * For per_cpu maps, the map_value is the value on the cpu where the + * bpf_prog is running. + * + * If **callback_fn** return 0, the helper will continue to the next + * element. If return value is 1, the helper will skip the rest of + * elements and return. Other return values are not used now. + * + * + * Returns + * The number of traversed map elements for success, **-EINVAL** for + * invalid **flags**. + */ +static long (*bpf_for_each_map_elem)(void *map, void *callback_fn, void *callback_ctx, __u64 flags) = (void *) 164; + +/* + * bpf_snprintf + * + * Outputs a string into the **str** buffer of size **str_size** + * based on a format string stored in a read-only map pointed by + * **fmt**. + * + * Each format specifier in **fmt** corresponds to one u64 element + * in the **data** array. For strings and pointers where pointees + * are accessed, only the pointer values are stored in the *data* + * array. The *data_len* is the size of *data* in bytes - must be + * a multiple of 8. + * + * Formats **%s** and **%p{i,I}{4,6}** require to read kernel + * memory. Reading kernel memory may fail due to either invalid + * address or valid address but requiring a major memory fault. If + * reading kernel memory fails, the string for **%s** will be an + * empty string, and the ip address for **%p{i,I}{4,6}** will be 0. + * Not returning error to bpf program is consistent with what + * **bpf_trace_printk**\ () does for now. + * + * + * Returns + * The strictly positive length of the formatted string, including + * the trailing zero character. If the return value is greater than + * **str_size**, **str** contains a truncated string, guaranteed to + * be zero-terminated except when **str_size** is 0. + * + * Or **-EBUSY** if the per-CPU memory copy buffer is busy. + */ +static long (*bpf_snprintf)(char *str, __u32 str_size, const char *fmt, __u64 *data, __u32 data_len) = (void *) 165; + +/* + * bpf_sys_bpf + * + * Execute bpf syscall with given arguments. + * + * Returns + * A syscall result. + */ +static long (*bpf_sys_bpf)(__u32 cmd, void *attr, __u32 attr_size) = (void *) 166; + +/* + * bpf_btf_find_by_name_kind + * + * Find BTF type with given name and kind in vmlinux BTF or in module's BTFs. + * + * Returns + * Returns btf_id and btf_obj_fd in lower and upper 32 bits. + */ +static long (*bpf_btf_find_by_name_kind)(char *name, int name_sz, __u32 kind, int flags) = (void *) 167; + +/* + * bpf_sys_close + * + * Execute close syscall for given FD. + * + * Returns + * A syscall result. + */ +static long (*bpf_sys_close)(__u32 fd) = (void *) 168; + +/* + * bpf_timer_init + * + * Initialize the timer. + * First 4 bits of *flags* specify clockid. + * Only CLOCK_MONOTONIC, CLOCK_REALTIME, CLOCK_BOOTTIME are allowed. + * All other bits of *flags* are reserved. + * The verifier will reject the program if *timer* is not from + * the same *map*. + * + * Returns + * 0 on success. + * **-EBUSY** if *timer* is already initialized. + * **-EINVAL** if invalid *flags* are passed. + * **-EPERM** if *timer* is in a map that doesn't have any user references. + * The user space should either hold a file descriptor to a map with timers + * or pin such map in bpffs. When map is unpinned or file descriptor is + * closed all timers in the map will be cancelled and freed. + */ +static long (*bpf_timer_init)(struct bpf_timer *timer, void *map, __u64 flags) = (void *) 169; + +/* + * bpf_timer_set_callback + * + * Configure the timer to call *callback_fn* static function. + * + * Returns + * 0 on success. + * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier. + * **-EPERM** if *timer* is in a map that doesn't have any user references. + * The user space should either hold a file descriptor to a map with timers + * or pin such map in bpffs. When map is unpinned or file descriptor is + * closed all timers in the map will be cancelled and freed. + */ +static long (*bpf_timer_set_callback)(struct bpf_timer *timer, void *callback_fn) = (void *) 170; + +/* + * bpf_timer_start + * + * Set timer expiration N nanoseconds from the current time. The + * configured callback will be invoked in soft irq context on some cpu + * and will not repeat unless another bpf_timer_start() is made. + * In such case the next invocation can migrate to a different cpu. + * Since struct bpf_timer is a field inside map element the map + * owns the timer. The bpf_timer_set_callback() will increment refcnt + * of BPF program to make sure that callback_fn code stays valid. + * When user space reference to a map reaches zero all timers + * in a map are cancelled and corresponding program's refcnts are + * decremented. This is done to make sure that Ctrl-C of a user + * process doesn't leave any timers running. If map is pinned in + * bpffs the callback_fn can re-arm itself indefinitely. + * bpf_map_update/delete_elem() helpers and user space sys_bpf commands + * cancel and free the timer in the given map element. + * The map can contain timers that invoke callback_fn-s from different + * programs. The same callback_fn can serve different timers from + * different maps if key/value layout matches across maps. + * Every bpf_timer_set_callback() can have different callback_fn. + * + * + * Returns + * 0 on success. + * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier + * or invalid *flags* are passed. + */ +static long (*bpf_timer_start)(struct bpf_timer *timer, __u64 nsecs, __u64 flags) = (void *) 171; + +/* + * bpf_timer_cancel + * + * Cancel the timer and wait for callback_fn to finish if it was running. + * + * Returns + * 0 if the timer was not active. + * 1 if the timer was active. + * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier. + * **-EDEADLK** if callback_fn tried to call bpf_timer_cancel() on its + * own timer which would have led to a deadlock otherwise. + */ +static long (*bpf_timer_cancel)(struct bpf_timer *timer) = (void *) 172; + +/* + * bpf_get_func_ip + * + * Get address of the traced function (for tracing and kprobe programs). + * + * Returns + * Address of the traced function. + */ +static __u64 (*bpf_get_func_ip)(void *ctx) = (void *) 173; + +/* + * bpf_get_attach_cookie + * + * Get bpf_cookie value provided (optionally) during the program + * attachment. It might be different for each individual + * attachment, even if BPF program itself is the same. + * Expects BPF program context *ctx* as a first argument. + * + * Supported for the following program types: + * - kprobe/uprobe; + * - tracepoint; + * - perf_event. + * + * Returns + * Value specified by user at BPF link creation/attachment time + * or 0, if it was not specified. + */ +static __u64 (*bpf_get_attach_cookie)(void *ctx) = (void *) 174; + +/* + * bpf_task_pt_regs + * + * Get the struct pt_regs associated with **task**. + * + * Returns + * A pointer to struct pt_regs. + */ +static long (*bpf_task_pt_regs)(struct task_struct *task) = (void *) 175; + +/* + * bpf_get_branch_snapshot + * + * Get branch trace from hardware engines like Intel LBR. The + * hardware engine is stopped shortly after the helper is + * called. Therefore, the user need to filter branch entries + * based on the actual use case. To capture branch trace + * before the trigger point of the BPF program, the helper + * should be called at the beginning of the BPF program. + * + * The data is stored as struct perf_branch_entry into output + * buffer *entries*. *size* is the size of *entries* in bytes. + * *flags* is reserved for now and must be zero. + * + * + * Returns + * On success, number of bytes written to *buf*. On error, a + * negative value. + * + * **-EINVAL** if *flags* is not zero. + * + * **-ENOENT** if architecture does not support branch records. + */ +static long (*bpf_get_branch_snapshot)(void *entries, __u32 size, __u64 flags) = (void *) 176; + +/* + * bpf_trace_vprintk + * + * Behaves like **bpf_trace_printk**\ () helper, but takes an array of u64 + * to format and can handle more format args as a result. + * + * Arguments are to be used as in **bpf_seq_printf**\ () helper. + * + * Returns + * The number of bytes written to the buffer, or a negative error + * in case of failure. + */ +static long (*bpf_trace_vprintk)(const char *fmt, __u32 fmt_size, const void *data, __u32 data_len) = (void *) 177; + +/* + * bpf_skc_to_unix_sock + * + * Dynamically cast a *sk* pointer to a *unix_sock* pointer. + * + * Returns + * *sk* if casting is valid, or **NULL** otherwise. + */ +static struct unix_sock *(*bpf_skc_to_unix_sock)(void *sk) = (void *) 178; + +/* + * bpf_kallsyms_lookup_name + * + * Get the address of a kernel symbol, returned in *res*. *res* is + * set to 0 if the symbol is not found. + * + * Returns + * On success, zero. On error, a negative value. + * + * **-EINVAL** if *flags* is not zero. + * + * **-EINVAL** if string *name* is not the same size as *name_sz*. + * + * **-ENOENT** if symbol is not found. + * + * **-EPERM** if caller does not have permission to obtain kernel address. + */ +static long (*bpf_kallsyms_lookup_name)(const char *name, int name_sz, int flags, __u64 *res) = (void *) 179; + +/* + * bpf_find_vma + * + * Find vma of *task* that contains *addr*, call *callback_fn* + * function with *task*, *vma*, and *callback_ctx*. + * The *callback_fn* should be a static function and + * the *callback_ctx* should be a pointer to the stack. + * The *flags* is used to control certain aspects of the helper. + * Currently, the *flags* must be 0. + * + * The expected callback signature is + * + * long (\*callback_fn)(struct task_struct \*task, struct vm_area_struct \*vma, void \*callback_ctx); + * + * + * Returns + * 0 on success. + * **-ENOENT** if *task->mm* is NULL, or no vma contains *addr*. + * **-EBUSY** if failed to try lock mmap_lock. + * **-EINVAL** for invalid **flags**. + */ +static long (*bpf_find_vma)(struct task_struct *task, __u64 addr, void *callback_fn, void *callback_ctx, __u64 flags) = (void *) 180; + + diff --git a/internal/ebpf/spike/c/bpf_helpers.h b/internal/ebpf/spike/c/bpf_helpers.h new file mode 100644 index 000000000..963b1060d --- /dev/null +++ b/internal/ebpf/spike/c/bpf_helpers.h @@ -0,0 +1,262 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __BPF_HELPERS__ +#define __BPF_HELPERS__ + +/* + * Note that bpf programs need to include either + * vmlinux.h (auto-generated from BTF) or linux/types.h + * in advance since bpf_helper_defs.h uses such types + * as __u64. + */ +#include "bpf_helper_defs.h" + +#define __uint(name, val) int (*name)[val] +#define __type(name, val) typeof(val) *name +#define __array(name, val) typeof(val) *name[] + +/* + * Helper macro to place programs, maps, license in + * different sections in elf_bpf file. Section names + * are interpreted by libbpf depending on the context (BPF programs, BPF maps, + * extern variables, etc). + * To allow use of SEC() with externs (e.g., for extern .maps declarations), + * make sure __attribute__((unused)) doesn't trigger compilation warning. + */ +#define SEC(name) \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wignored-attributes\"") \ + __attribute__((section(name), used)) \ + _Pragma("GCC diagnostic pop") \ + +/* Avoid 'linux/stddef.h' definition of '__always_inline'. */ +#undef __always_inline +#define __always_inline inline __attribute__((always_inline)) + +#ifndef __noinline +#define __noinline __attribute__((noinline)) +#endif +#ifndef __weak +#define __weak __attribute__((weak)) +#endif + +/* + * Use __hidden attribute to mark a non-static BPF subprogram effectively + * static for BPF verifier's verification algorithm purposes, allowing more + * extensive and permissive BPF verification process, taking into account + * subprogram's caller context. + */ +#define __hidden __attribute__((visibility("hidden"))) + +/* When utilizing vmlinux.h with BPF CO-RE, user BPF programs can't include + * any system-level headers (such as stddef.h, linux/version.h, etc), and + * commonly-used macros like NULL and KERNEL_VERSION aren't available through + * vmlinux.h. This just adds unnecessary hurdles and forces users to re-define + * them on their own. So as a convenience, provide such definitions here. + */ +#ifndef NULL +#define NULL ((void *)0) +#endif + +#ifndef KERNEL_VERSION +#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c))) +#endif + +/* + * Helper macros to manipulate data structures + */ +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((unsigned long)&((TYPE *)0)->MEMBER) +#endif +#ifndef container_of +#define container_of(ptr, type, member) \ + ({ \ + void *__mptr = (void *)(ptr); \ + ((type *)(__mptr - offsetof(type, member))); \ + }) +#endif + +/* + * Helper macro to throw a compilation error if __bpf_unreachable() gets + * built into the resulting code. This works given BPF back end does not + * implement __builtin_trap(). This is useful to assert that certain paths + * of the program code are never used and hence eliminated by the compiler. + * + * For example, consider a switch statement that covers known cases used by + * the program. __bpf_unreachable() can then reside in the default case. If + * the program gets extended such that a case is not covered in the switch + * statement, then it will throw a build error due to the default case not + * being compiled out. + */ +#ifndef __bpf_unreachable +# define __bpf_unreachable() __builtin_trap() +#endif + +/* + * Helper function to perform a tail call with a constant/immediate map slot. + */ +#if __clang_major__ >= 8 && defined(__bpf__) +static __always_inline void +bpf_tail_call_static(void *ctx, const void *map, const __u32 slot) +{ + if (!__builtin_constant_p(slot)) + __bpf_unreachable(); + + /* + * Provide a hard guarantee that LLVM won't optimize setting r2 (map + * pointer) and r3 (constant map index) from _different paths_ ending + * up at the _same_ call insn as otherwise we won't be able to use the + * jmpq/nopl retpoline-free patching by the x86-64 JIT in the kernel + * given they mismatch. See also d2e4c1e6c294 ("bpf: Constant map key + * tracking for prog array pokes") for details on verifier tracking. + * + * Note on clobber list: we need to stay in-line with BPF calling + * convention, so even if we don't end up using r0, r4, r5, we need + * to mark them as clobber so that LLVM doesn't end up using them + * before / after the call. + */ + asm volatile("r1 = %[ctx]\n\t" + "r2 = %[map]\n\t" + "r3 = %[slot]\n\t" + "call 12" + :: [ctx]"r"(ctx), [map]"r"(map), [slot]"i"(slot) + : "r0", "r1", "r2", "r3", "r4", "r5"); +} +#endif + +/* + * Helper structure used by eBPF C program + * to describe BPF map attributes to libbpf loader + */ +struct bpf_map_def { + unsigned int type; + unsigned int key_size; + unsigned int value_size; + unsigned int max_entries; + unsigned int map_flags; +}; + +enum libbpf_pin_type { + LIBBPF_PIN_NONE, + /* PIN_BY_NAME: pin maps by name (in /sys/fs/bpf by default) */ + LIBBPF_PIN_BY_NAME, +}; + +enum libbpf_tristate { + TRI_NO = 0, + TRI_YES = 1, + TRI_MODULE = 2, +}; + +#define __kconfig __attribute__((section(".kconfig"))) +#define __ksym __attribute__((section(".ksyms"))) + +#ifndef ___bpf_concat +#define ___bpf_concat(a, b) a ## b +#endif +#ifndef ___bpf_apply +#define ___bpf_apply(fn, n) ___bpf_concat(fn, n) +#endif +#ifndef ___bpf_nth +#define ___bpf_nth(_, _1, _2, _3, _4, _5, _6, _7, _8, _9, _a, _b, _c, N, ...) N +#endif +#ifndef ___bpf_narg +#define ___bpf_narg(...) \ + ___bpf_nth(_, ##__VA_ARGS__, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#endif + +#define ___bpf_fill0(arr, p, x) do {} while (0) +#define ___bpf_fill1(arr, p, x) arr[p] = x +#define ___bpf_fill2(arr, p, x, args...) arr[p] = x; ___bpf_fill1(arr, p + 1, args) +#define ___bpf_fill3(arr, p, x, args...) arr[p] = x; ___bpf_fill2(arr, p + 1, args) +#define ___bpf_fill4(arr, p, x, args...) arr[p] = x; ___bpf_fill3(arr, p + 1, args) +#define ___bpf_fill5(arr, p, x, args...) arr[p] = x; ___bpf_fill4(arr, p + 1, args) +#define ___bpf_fill6(arr, p, x, args...) arr[p] = x; ___bpf_fill5(arr, p + 1, args) +#define ___bpf_fill7(arr, p, x, args...) arr[p] = x; ___bpf_fill6(arr, p + 1, args) +#define ___bpf_fill8(arr, p, x, args...) arr[p] = x; ___bpf_fill7(arr, p + 1, args) +#define ___bpf_fill9(arr, p, x, args...) arr[p] = x; ___bpf_fill8(arr, p + 1, args) +#define ___bpf_fill10(arr, p, x, args...) arr[p] = x; ___bpf_fill9(arr, p + 1, args) +#define ___bpf_fill11(arr, p, x, args...) arr[p] = x; ___bpf_fill10(arr, p + 1, args) +#define ___bpf_fill12(arr, p, x, args...) arr[p] = x; ___bpf_fill11(arr, p + 1, args) +#define ___bpf_fill(arr, args...) \ + ___bpf_apply(___bpf_fill, ___bpf_narg(args))(arr, 0, args) + +/* + * BPF_SEQ_PRINTF to wrap bpf_seq_printf to-be-printed values + * in a structure. + */ +#define BPF_SEQ_PRINTF(seq, fmt, args...) \ +({ \ + static const char ___fmt[] = fmt; \ + unsigned long long ___param[___bpf_narg(args)]; \ + \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \ + ___bpf_fill(___param, args); \ + _Pragma("GCC diagnostic pop") \ + \ + bpf_seq_printf(seq, ___fmt, sizeof(___fmt), \ + ___param, sizeof(___param)); \ +}) + +/* + * BPF_SNPRINTF wraps the bpf_snprintf helper with variadic arguments instead of + * an array of u64. + */ +#define BPF_SNPRINTF(out, out_size, fmt, args...) \ +({ \ + static const char ___fmt[] = fmt; \ + unsigned long long ___param[___bpf_narg(args)]; \ + \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \ + ___bpf_fill(___param, args); \ + _Pragma("GCC diagnostic pop") \ + \ + bpf_snprintf(out, out_size, ___fmt, \ + ___param, sizeof(___param)); \ +}) + +#ifdef BPF_NO_GLOBAL_DATA +#define BPF_PRINTK_FMT_MOD +#else +#define BPF_PRINTK_FMT_MOD static const +#endif + +#define __bpf_printk(fmt, ...) \ +({ \ + BPF_PRINTK_FMT_MOD char ____fmt[] = fmt; \ + bpf_trace_printk(____fmt, sizeof(____fmt), \ + ##__VA_ARGS__); \ +}) + +/* + * __bpf_vprintk wraps the bpf_trace_vprintk helper with variadic arguments + * instead of an array of u64. + */ +#define __bpf_vprintk(fmt, args...) \ +({ \ + static const char ___fmt[] = fmt; \ + unsigned long long ___param[___bpf_narg(args)]; \ + \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \ + ___bpf_fill(___param, args); \ + _Pragma("GCC diagnostic pop") \ + \ + bpf_trace_vprintk(___fmt, sizeof(___fmt), \ + ___param, sizeof(___param)); \ +}) + +/* Use __bpf_printk when bpf_printk call has 3 or fewer fmt args + * Otherwise use __bpf_vprintk + */ +#define ___bpf_pick_printk(...) \ + ___bpf_nth(_, ##__VA_ARGS__, __bpf_vprintk, __bpf_vprintk, __bpf_vprintk, \ + __bpf_vprintk, __bpf_vprintk, __bpf_vprintk, __bpf_vprintk, \ + __bpf_vprintk, __bpf_vprintk, __bpf_printk /*3*/, __bpf_printk /*2*/,\ + __bpf_printk /*1*/, __bpf_printk /*0*/) + +/* Helper macro to print out debug messages */ +#define bpf_printk(fmt, args...) ___bpf_pick_printk(args)(fmt, ##args) + +#endif diff --git a/internal/ebpf/spike/c/bpf_tracing.h b/internal/ebpf/spike/c/bpf_tracing.h new file mode 100644 index 000000000..db05a5937 --- /dev/null +++ b/internal/ebpf/spike/c/bpf_tracing.h @@ -0,0 +1,492 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __BPF_TRACING_H__ +#define __BPF_TRACING_H__ + +/* Scan the ARCH passed in from ARCH env variable (see Makefile) */ +#if defined(__TARGET_ARCH_x86) + #define bpf_target_x86 + #define bpf_target_defined +#elif defined(__TARGET_ARCH_s390) + #define bpf_target_s390 + #define bpf_target_defined +#elif defined(__TARGET_ARCH_arm) + #define bpf_target_arm + #define bpf_target_defined +#elif defined(__TARGET_ARCH_arm64) + #define bpf_target_arm64 + #define bpf_target_defined +#elif defined(__TARGET_ARCH_mips) + #define bpf_target_mips + #define bpf_target_defined +#elif defined(__TARGET_ARCH_powerpc) + #define bpf_target_powerpc + #define bpf_target_defined +#elif defined(__TARGET_ARCH_sparc) + #define bpf_target_sparc + #define bpf_target_defined +#elif defined(__TARGET_ARCH_riscv) + #define bpf_target_riscv + #define bpf_target_defined +#else + +/* Fall back to what the compiler says */ +#if defined(__x86_64__) + #define bpf_target_x86 + #define bpf_target_defined +#elif defined(__s390__) + #define bpf_target_s390 + #define bpf_target_defined +#elif defined(__arm__) + #define bpf_target_arm + #define bpf_target_defined +#elif defined(__aarch64__) + #define bpf_target_arm64 + #define bpf_target_defined +#elif defined(__mips__) + #define bpf_target_mips + #define bpf_target_defined +#elif defined(__powerpc__) + #define bpf_target_powerpc + #define bpf_target_defined +#elif defined(__sparc__) + #define bpf_target_sparc + #define bpf_target_defined +#elif defined(__riscv) && __riscv_xlen == 64 + #define bpf_target_riscv + #define bpf_target_defined +#endif /* no compiler target */ + +#endif + +#ifndef __BPF_TARGET_MISSING +#define __BPF_TARGET_MISSING "GCC error \"Must specify a BPF target arch via __TARGET_ARCH_xxx\"" +#endif + +#if defined(bpf_target_x86) + +#if defined(__KERNEL__) || defined(__VMLINUX_H__) + +#define PT_REGS_PARM1(x) ((x)->di) +#define PT_REGS_PARM2(x) ((x)->si) +#define PT_REGS_PARM3(x) ((x)->dx) +#define PT_REGS_PARM4(x) ((x)->cx) +#define PT_REGS_PARM5(x) ((x)->r8) +#define PT_REGS_RET(x) ((x)->sp) +#define PT_REGS_FP(x) ((x)->bp) +#define PT_REGS_RC(x) ((x)->ax) +#define PT_REGS_SP(x) ((x)->sp) +#define PT_REGS_IP(x) ((x)->ip) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((x), di) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((x), si) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((x), dx) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((x), cx) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((x), r8) +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((x), sp) +#define PT_REGS_FP_CORE(x) BPF_CORE_READ((x), bp) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((x), ax) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((x), sp) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((x), ip) + +#else + +#ifdef __i386__ +/* i386 kernel is built with -mregparm=3 */ +#define PT_REGS_PARM1(x) ((x)->eax) +#define PT_REGS_PARM2(x) ((x)->edx) +#define PT_REGS_PARM3(x) ((x)->ecx) +#define PT_REGS_PARM4(x) 0 +#define PT_REGS_PARM5(x) 0 +#define PT_REGS_RET(x) ((x)->esp) +#define PT_REGS_FP(x) ((x)->ebp) +#define PT_REGS_RC(x) ((x)->eax) +#define PT_REGS_SP(x) ((x)->esp) +#define PT_REGS_IP(x) ((x)->eip) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((x), eax) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((x), edx) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((x), ecx) +#define PT_REGS_PARM4_CORE(x) 0 +#define PT_REGS_PARM5_CORE(x) 0 +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((x), esp) +#define PT_REGS_FP_CORE(x) BPF_CORE_READ((x), ebp) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((x), eax) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((x), esp) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((x), eip) + +#else + +#define PT_REGS_PARM1(x) ((x)->rdi) +#define PT_REGS_PARM2(x) ((x)->rsi) +#define PT_REGS_PARM3(x) ((x)->rdx) +#define PT_REGS_PARM4(x) ((x)->rcx) +#define PT_REGS_PARM5(x) ((x)->r8) +#define PT_REGS_RET(x) ((x)->rsp) +#define PT_REGS_FP(x) ((x)->rbp) +#define PT_REGS_RC(x) ((x)->rax) +#define PT_REGS_SP(x) ((x)->rsp) +#define PT_REGS_IP(x) ((x)->rip) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((x), rdi) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((x), rsi) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((x), rdx) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((x), rcx) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((x), r8) +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((x), rsp) +#define PT_REGS_FP_CORE(x) BPF_CORE_READ((x), rbp) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((x), rax) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((x), rsp) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((x), rip) + +#endif +#endif + +#elif defined(bpf_target_s390) + +/* s390 provides user_pt_regs instead of struct pt_regs to userspace */ +struct pt_regs; +#define PT_REGS_S390 const volatile user_pt_regs +#define PT_REGS_PARM1(x) (((PT_REGS_S390 *)(x))->gprs[2]) +#define PT_REGS_PARM2(x) (((PT_REGS_S390 *)(x))->gprs[3]) +#define PT_REGS_PARM3(x) (((PT_REGS_S390 *)(x))->gprs[4]) +#define PT_REGS_PARM4(x) (((PT_REGS_S390 *)(x))->gprs[5]) +#define PT_REGS_PARM5(x) (((PT_REGS_S390 *)(x))->gprs[6]) +#define PT_REGS_RET(x) (((PT_REGS_S390 *)(x))->gprs[14]) +/* Works only with CONFIG_FRAME_POINTER */ +#define PT_REGS_FP(x) (((PT_REGS_S390 *)(x))->gprs[11]) +#define PT_REGS_RC(x) (((PT_REGS_S390 *)(x))->gprs[2]) +#define PT_REGS_SP(x) (((PT_REGS_S390 *)(x))->gprs[15]) +#define PT_REGS_IP(x) (((PT_REGS_S390 *)(x))->psw.addr) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), gprs[2]) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), gprs[3]) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), gprs[4]) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), gprs[5]) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), gprs[6]) +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), gprs[14]) +#define PT_REGS_FP_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), gprs[11]) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), gprs[2]) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), gprs[15]) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((PT_REGS_S390 *)(x), psw.addr) + +#elif defined(bpf_target_arm) + +#define PT_REGS_PARM1(x) ((x)->uregs[0]) +#define PT_REGS_PARM2(x) ((x)->uregs[1]) +#define PT_REGS_PARM3(x) ((x)->uregs[2]) +#define PT_REGS_PARM4(x) ((x)->uregs[3]) +#define PT_REGS_PARM5(x) ((x)->uregs[4]) +#define PT_REGS_RET(x) ((x)->uregs[14]) +#define PT_REGS_FP(x) ((x)->uregs[11]) /* Works only with CONFIG_FRAME_POINTER */ +#define PT_REGS_RC(x) ((x)->uregs[0]) +#define PT_REGS_SP(x) ((x)->uregs[13]) +#define PT_REGS_IP(x) ((x)->uregs[12]) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((x), uregs[0]) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((x), uregs[1]) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((x), uregs[2]) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((x), uregs[3]) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((x), uregs[4]) +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((x), uregs[14]) +#define PT_REGS_FP_CORE(x) BPF_CORE_READ((x), uregs[11]) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((x), uregs[0]) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((x), uregs[13]) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((x), uregs[12]) + +#elif defined(bpf_target_arm64) + +/* arm64 provides struct user_pt_regs instead of struct pt_regs to userspace */ +struct pt_regs; +#define PT_REGS_ARM64 const volatile struct user_pt_regs +#define PT_REGS_PARM1(x) (((PT_REGS_ARM64 *)(x))->regs[0]) +#define PT_REGS_PARM2(x) (((PT_REGS_ARM64 *)(x))->regs[1]) +#define PT_REGS_PARM3(x) (((PT_REGS_ARM64 *)(x))->regs[2]) +#define PT_REGS_PARM4(x) (((PT_REGS_ARM64 *)(x))->regs[3]) +#define PT_REGS_PARM5(x) (((PT_REGS_ARM64 *)(x))->regs[4]) +#define PT_REGS_RET(x) (((PT_REGS_ARM64 *)(x))->regs[30]) +/* Works only with CONFIG_FRAME_POINTER */ +#define PT_REGS_FP(x) (((PT_REGS_ARM64 *)(x))->regs[29]) +#define PT_REGS_RC(x) (((PT_REGS_ARM64 *)(x))->regs[0]) +#define PT_REGS_SP(x) (((PT_REGS_ARM64 *)(x))->sp) +#define PT_REGS_IP(x) (((PT_REGS_ARM64 *)(x))->pc) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), regs[0]) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), regs[1]) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), regs[2]) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), regs[3]) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), regs[4]) +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), regs[30]) +#define PT_REGS_FP_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), regs[29]) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), regs[0]) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), sp) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((PT_REGS_ARM64 *)(x), pc) + +#elif defined(bpf_target_mips) + +#define PT_REGS_PARM1(x) ((x)->regs[4]) +#define PT_REGS_PARM2(x) ((x)->regs[5]) +#define PT_REGS_PARM3(x) ((x)->regs[6]) +#define PT_REGS_PARM4(x) ((x)->regs[7]) +#define PT_REGS_PARM5(x) ((x)->regs[8]) +#define PT_REGS_RET(x) ((x)->regs[31]) +#define PT_REGS_FP(x) ((x)->regs[30]) /* Works only with CONFIG_FRAME_POINTER */ +#define PT_REGS_RC(x) ((x)->regs[2]) +#define PT_REGS_SP(x) ((x)->regs[29]) +#define PT_REGS_IP(x) ((x)->cp0_epc) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((x), regs[4]) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((x), regs[5]) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((x), regs[6]) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((x), regs[7]) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((x), regs[8]) +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((x), regs[31]) +#define PT_REGS_FP_CORE(x) BPF_CORE_READ((x), regs[30]) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((x), regs[2]) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((x), regs[29]) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((x), cp0_epc) + +#elif defined(bpf_target_powerpc) + +#define PT_REGS_PARM1(x) ((x)->gpr[3]) +#define PT_REGS_PARM2(x) ((x)->gpr[4]) +#define PT_REGS_PARM3(x) ((x)->gpr[5]) +#define PT_REGS_PARM4(x) ((x)->gpr[6]) +#define PT_REGS_PARM5(x) ((x)->gpr[7]) +#define PT_REGS_RC(x) ((x)->gpr[3]) +#define PT_REGS_SP(x) ((x)->sp) +#define PT_REGS_IP(x) ((x)->nip) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((x), gpr[3]) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((x), gpr[4]) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((x), gpr[5]) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((x), gpr[6]) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((x), gpr[7]) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((x), gpr[3]) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((x), sp) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((x), nip) + +#elif defined(bpf_target_sparc) + +#define PT_REGS_PARM1(x) ((x)->u_regs[UREG_I0]) +#define PT_REGS_PARM2(x) ((x)->u_regs[UREG_I1]) +#define PT_REGS_PARM3(x) ((x)->u_regs[UREG_I2]) +#define PT_REGS_PARM4(x) ((x)->u_regs[UREG_I3]) +#define PT_REGS_PARM5(x) ((x)->u_regs[UREG_I4]) +#define PT_REGS_RET(x) ((x)->u_regs[UREG_I7]) +#define PT_REGS_RC(x) ((x)->u_regs[UREG_I0]) +#define PT_REGS_SP(x) ((x)->u_regs[UREG_FP]) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((x), u_regs[UREG_I0]) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((x), u_regs[UREG_I1]) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((x), u_regs[UREG_I2]) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((x), u_regs[UREG_I3]) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((x), u_regs[UREG_I4]) +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((x), u_regs[UREG_I7]) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((x), u_regs[UREG_I0]) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((x), u_regs[UREG_FP]) + +/* Should this also be a bpf_target check for the sparc case? */ +#if defined(__arch64__) +#define PT_REGS_IP(x) ((x)->tpc) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((x), tpc) +#else +#define PT_REGS_IP(x) ((x)->pc) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((x), pc) +#endif + +#elif defined(bpf_target_riscv) + +struct pt_regs; +#define PT_REGS_RV const volatile struct user_regs_struct +#define PT_REGS_PARM1(x) (((PT_REGS_RV *)(x))->a0) +#define PT_REGS_PARM2(x) (((PT_REGS_RV *)(x))->a1) +#define PT_REGS_PARM3(x) (((PT_REGS_RV *)(x))->a2) +#define PT_REGS_PARM4(x) (((PT_REGS_RV *)(x))->a3) +#define PT_REGS_PARM5(x) (((PT_REGS_RV *)(x))->a4) +#define PT_REGS_RET(x) (((PT_REGS_RV *)(x))->ra) +#define PT_REGS_FP(x) (((PT_REGS_RV *)(x))->s5) +#define PT_REGS_RC(x) (((PT_REGS_RV *)(x))->a5) +#define PT_REGS_SP(x) (((PT_REGS_RV *)(x))->sp) +#define PT_REGS_IP(x) (((PT_REGS_RV *)(x))->epc) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a0) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a1) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a2) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a3) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a4) +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), ra) +#define PT_REGS_FP_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), fp) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a5) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), sp) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), epc) + +#endif + +#if defined(bpf_target_powerpc) +#define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = (ctx)->link; }) +#define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP +#elif defined(bpf_target_sparc) +#define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = PT_REGS_RET(ctx); }) +#define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP +#elif defined(bpf_target_defined) +#define BPF_KPROBE_READ_RET_IP(ip, ctx) \ + ({ bpf_probe_read_kernel(&(ip), sizeof(ip), (void *)PT_REGS_RET(ctx)); }) +#define BPF_KRETPROBE_READ_RET_IP(ip, ctx) \ + ({ bpf_probe_read_kernel(&(ip), sizeof(ip), \ + (void *)(PT_REGS_FP(ctx) + sizeof(ip))); }) +#endif + +#if !defined(bpf_target_defined) + +#define PT_REGS_PARM1(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_PARM2(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_PARM3(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_PARM4(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_PARM5(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_RET(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_FP(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_RC(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_SP(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_IP(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) + +#define PT_REGS_PARM1_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_PARM2_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_PARM3_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_PARM4_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_PARM5_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_RET_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_FP_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_RC_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_SP_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define PT_REGS_IP_CORE(x) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) + +#define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) +#define BPF_KRETPROBE_READ_RET_IP(ip, ctx) ({ _Pragma(__BPF_TARGET_MISSING); 0l; }) + +#endif /* !defined(bpf_target_defined) */ + +#ifndef ___bpf_concat +#define ___bpf_concat(a, b) a ## b +#endif +#ifndef ___bpf_apply +#define ___bpf_apply(fn, n) ___bpf_concat(fn, n) +#endif +#ifndef ___bpf_nth +#define ___bpf_nth(_, _1, _2, _3, _4, _5, _6, _7, _8, _9, _a, _b, _c, N, ...) N +#endif +#ifndef ___bpf_narg +#define ___bpf_narg(...) \ + ___bpf_nth(_, ##__VA_ARGS__, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#endif + +#define ___bpf_ctx_cast0() ctx +#define ___bpf_ctx_cast1(x) ___bpf_ctx_cast0(), (void *)ctx[0] +#define ___bpf_ctx_cast2(x, args...) ___bpf_ctx_cast1(args), (void *)ctx[1] +#define ___bpf_ctx_cast3(x, args...) ___bpf_ctx_cast2(args), (void *)ctx[2] +#define ___bpf_ctx_cast4(x, args...) ___bpf_ctx_cast3(args), (void *)ctx[3] +#define ___bpf_ctx_cast5(x, args...) ___bpf_ctx_cast4(args), (void *)ctx[4] +#define ___bpf_ctx_cast6(x, args...) ___bpf_ctx_cast5(args), (void *)ctx[5] +#define ___bpf_ctx_cast7(x, args...) ___bpf_ctx_cast6(args), (void *)ctx[6] +#define ___bpf_ctx_cast8(x, args...) ___bpf_ctx_cast7(args), (void *)ctx[7] +#define ___bpf_ctx_cast9(x, args...) ___bpf_ctx_cast8(args), (void *)ctx[8] +#define ___bpf_ctx_cast10(x, args...) ___bpf_ctx_cast9(args), (void *)ctx[9] +#define ___bpf_ctx_cast11(x, args...) ___bpf_ctx_cast10(args), (void *)ctx[10] +#define ___bpf_ctx_cast12(x, args...) ___bpf_ctx_cast11(args), (void *)ctx[11] +#define ___bpf_ctx_cast(args...) \ + ___bpf_apply(___bpf_ctx_cast, ___bpf_narg(args))(args) + +/* + * BPF_PROG is a convenience wrapper for generic tp_btf/fentry/fexit and + * similar kinds of BPF programs, that accept input arguments as a single + * pointer to untyped u64 array, where each u64 can actually be a typed + * pointer or integer of different size. Instead of requring user to write + * manual casts and work with array elements by index, BPF_PROG macro + * allows user to declare a list of named and typed input arguments in the + * same syntax as for normal C function. All the casting is hidden and + * performed transparently, while user code can just assume working with + * function arguments of specified type and name. + * + * Original raw context argument is preserved as well as 'ctx' argument. + * This is useful when using BPF helpers that expect original context + * as one of the parameters (e.g., for bpf_perf_event_output()). + */ +#define BPF_PROG(name, args...) \ +name(unsigned long long *ctx); \ +static __attribute__((always_inline)) typeof(name(0)) \ +____##name(unsigned long long *ctx, ##args); \ +typeof(name(0)) name(unsigned long long *ctx) \ +{ \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \ + return ____##name(___bpf_ctx_cast(args)); \ + _Pragma("GCC diagnostic pop") \ +} \ +static __attribute__((always_inline)) typeof(name(0)) \ +____##name(unsigned long long *ctx, ##args) + +struct pt_regs; + +#define ___bpf_kprobe_args0() ctx +#define ___bpf_kprobe_args1(x) \ + ___bpf_kprobe_args0(), (void *)PT_REGS_PARM1(ctx) +#define ___bpf_kprobe_args2(x, args...) \ + ___bpf_kprobe_args1(args), (void *)PT_REGS_PARM2(ctx) +#define ___bpf_kprobe_args3(x, args...) \ + ___bpf_kprobe_args2(args), (void *)PT_REGS_PARM3(ctx) +#define ___bpf_kprobe_args4(x, args...) \ + ___bpf_kprobe_args3(args), (void *)PT_REGS_PARM4(ctx) +#define ___bpf_kprobe_args5(x, args...) \ + ___bpf_kprobe_args4(args), (void *)PT_REGS_PARM5(ctx) +#define ___bpf_kprobe_args(args...) \ + ___bpf_apply(___bpf_kprobe_args, ___bpf_narg(args))(args) + +/* + * BPF_KPROBE serves the same purpose for kprobes as BPF_PROG for + * tp_btf/fentry/fexit BPF programs. It hides the underlying platform-specific + * low-level way of getting kprobe input arguments from struct pt_regs, and + * provides a familiar typed and named function arguments syntax and + * semantics of accessing kprobe input paremeters. + * + * Original struct pt_regs* context is preserved as 'ctx' argument. This might + * be necessary when using BPF helpers like bpf_perf_event_output(). + */ +#define BPF_KPROBE(name, args...) \ +name(struct pt_regs *ctx); \ +static __attribute__((always_inline)) typeof(name(0)) \ +____##name(struct pt_regs *ctx, ##args); \ +typeof(name(0)) name(struct pt_regs *ctx) \ +{ \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \ + return ____##name(___bpf_kprobe_args(args)); \ + _Pragma("GCC diagnostic pop") \ +} \ +static __attribute__((always_inline)) typeof(name(0)) \ +____##name(struct pt_regs *ctx, ##args) + +#define ___bpf_kretprobe_args0() ctx +#define ___bpf_kretprobe_args1(x) \ + ___bpf_kretprobe_args0(), (void *)PT_REGS_RC(ctx) +#define ___bpf_kretprobe_args(args...) \ + ___bpf_apply(___bpf_kretprobe_args, ___bpf_narg(args))(args) + +/* + * BPF_KRETPROBE is similar to BPF_KPROBE, except, it only provides optional + * return value (in addition to `struct pt_regs *ctx`), but no input + * arguments, because they will be clobbered by the time probed function + * returns. + */ +#define BPF_KRETPROBE(name, args...) \ +name(struct pt_regs *ctx); \ +static __attribute__((always_inline)) typeof(name(0)) \ +____##name(struct pt_regs *ctx, ##args); \ +typeof(name(0)) name(struct pt_regs *ctx) \ +{ \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \ + return ____##name(___bpf_kretprobe_args(args)); \ + _Pragma("GCC diagnostic pop") \ +} \ +static __always_inline typeof(name(0)) ____##name(struct pt_regs *ctx, ##args) + +#endif diff --git a/internal/ebpf/spike/c/events.h b/internal/ebpf/spike/c/events.h new file mode 100644 index 000000000..49f3c5166 --- /dev/null +++ b/internal/ebpf/spike/c/events.h @@ -0,0 +1,49 @@ +/* Shared event and map definitions for the Linux eBPF spike. */ + +#pragma once + +#include "vmlinux.h" +#include "bpf_helpers.h" + +#define SPIKE_FILENAME_LEN 256 + +enum spike_event_kind { + SPIKE_EVENT_EXEC = 1, + SPIKE_EVENT_SNAPSHOT = 2, +}; + +struct spike_event { + u32 kind; + u32 pid; + u32 tgid; + u32 ppid; + u32 uid; + u32 gid; + u64 start_boottime; + u64 timestamp_ns; + u8 comm[TASK_COMM_LEN]; + u8 filename[SPIKE_FILENAME_LEN]; +}; + +struct { + __uint(type, BPF_MAP_TYPE_RINGBUF); + __uint(max_entries, 1 << 24); +} events SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __uint(max_entries, 1); + __type(key, u32); + __type(value, u64); +} drop_count SEC(".maps"); + +static __always_inline void spike_account_drop(void) +{ + u32 key = 0; + u64 *count; + + count = bpf_map_lookup_elem(&drop_count, &key); + if (!count) + return; + __sync_fetch_and_add(count, 1); +} diff --git a/internal/ebpf/spike/c/execve.bpf.c b/internal/ebpf/spike/c/execve.bpf.c new file mode 100644 index 000000000..f04873228 --- /dev/null +++ b/internal/ebpf/spike/c/execve.bpf.c @@ -0,0 +1,53 @@ +//go:build ignore + +#include "events.h" +#include "bpf_core_read.h" +#include "bpf_tracing.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +SEC("tp/sched/sched_process_exec") +int handle_sched_process_exec(struct trace_event_raw_sched_process_exec *ctx) +{ + struct spike_event *e; + struct task_struct *task; + struct task_struct *parent; + const struct cred *cred; + u64 id; + u32 fname_off; + + e = bpf_ringbuf_reserve(&events, sizeof(*e), 0); + if (!e) { + spike_account_drop(); + return 0; + } + + __builtin_memset(e, 0, sizeof(*e)); + e->kind = SPIKE_EVENT_EXEC; + e->timestamp_ns = bpf_ktime_get_ns(); + + id = bpf_get_current_pid_tgid(); + e->tgid = id >> 32; + e->pid = (u32)id; + e->uid = bpf_get_current_uid_gid(); + e->gid = bpf_get_current_uid_gid() >> 32; + bpf_get_current_comm(&e->comm, sizeof(e->comm)); + + task = (struct task_struct *)bpf_get_current_task(); + e->start_boottime = BPF_CORE_READ(task, start_boottime); + parent = BPF_CORE_READ(task, real_parent); + if (parent) + e->ppid = BPF_CORE_READ(parent, tgid); + cred = BPF_CORE_READ(task, real_cred); + if (cred) { + e->uid = BPF_CORE_READ(cred, uid.val); + e->gid = BPF_CORE_READ(cred, gid.val); + } + + /* Filename is optional enrichment from the tracepoint payload. */ + fname_off = ctx->__data_loc_filename & 0xffff; + bpf_probe_read_kernel_str(&e->filename, sizeof(e->filename), (void *)ctx + fname_off); + + bpf_ringbuf_submit(e, 0); + return 0; +} diff --git a/internal/ebpf/spike/c/proc_iter.bpf.c b/internal/ebpf/spike/c/proc_iter.bpf.c new file mode 100644 index 000000000..daeafe163 --- /dev/null +++ b/internal/ebpf/spike/c/proc_iter.bpf.c @@ -0,0 +1,63 @@ +//go:build ignore + +#include "events.h" +#include "bpf_core_read.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +/* Task iterator baseline scanner. + * + * Intentionally omits bpf_d_path (available from Linux 5.10). Executable path + * and cmdline are left empty here and are filled best-effort from + * /proc//{exe,cmdline} in userspace. + * + * ctx->task is a trusted BTF pointer, so field access uses CO-RE direct reads + * rather than bpf_probe_read-based helpers. + */ +SEC("iter/task") +int dump_task(struct bpf_iter__task *ctx) +{ + struct task_struct *task; + struct task_struct *parent; + const struct cred *cred; + struct spike_event *e; + pid_t pid; + pid_t tgid; + + task = ctx->task; + if (!task) + return 0; + + /* Emit one record per thread-group leader. */ + pid = task->pid; + tgid = task->tgid; + if (pid != tgid) + return 0; + + e = bpf_ringbuf_reserve(&events, sizeof(*e), 0); + if (!e) { + spike_account_drop(); + return 0; + } + + __builtin_memset(e, 0, sizeof(*e)); + e->kind = SPIKE_EVENT_SNAPSHOT; + e->timestamp_ns = bpf_ktime_get_ns(); + e->pid = pid; + e->tgid = tgid; + e->start_boottime = task->start_boottime; + __builtin_memcpy(&e->comm, task->comm, sizeof(e->comm)); + + parent = task->real_parent; + if (parent) + e->ppid = parent->tgid; + + cred = task->real_cred; + if (cred) { + e->uid = cred->uid.val; + e->gid = cred->gid.val; + } + + bpf_ringbuf_submit(e, 0); + return 0; +} diff --git a/internal/ebpf/spike/c/vmlinux.h b/internal/ebpf/spike/c/vmlinux.h new file mode 100644 index 000000000..dc774a68b --- /dev/null +++ b/internal/ebpf/spike/c/vmlinux.h @@ -0,0 +1,149 @@ +/* Minimal CO-RE type skeletons for the Linux eBPF spike. + * Full kernel BTF is still required at load/attach time for iterators. + */ + +#pragma once + +typedef unsigned char __u8; +typedef short int __s16; +typedef short unsigned int __u16; +typedef int __s32; +typedef unsigned int __u32; +typedef long long int __s64; +typedef long long unsigned int __u64; + +typedef __u8 u8; +typedef __s16 s16; +typedef __u16 u16; +typedef __s32 s32; +typedef __u32 u32; +typedef __s64 s64; +typedef __u64 u64; + +typedef __u32 __wsum; +typedef __u16 __le16; +typedef __u16 __be16; +typedef __u32 __be32; +typedef __u64 __be64; + +typedef int pid_t; +typedef u32 uid_t; +typedef u32 gid_t; + +struct kuid_t { + uid_t val; +} __attribute__((preserve_access_index)); + +struct kgid_t { + gid_t val; +} __attribute__((preserve_access_index)); + +enum bpf_map_type { + BPF_MAP_TYPE_UNSPEC = 0, + BPF_MAP_TYPE_HASH = 1, + BPF_MAP_TYPE_ARRAY = 2, + BPF_MAP_TYPE_PROG_ARRAY = 3, + BPF_MAP_TYPE_PERF_EVENT_ARRAY = 4, + BPF_MAP_TYPE_PERCPU_HASH = 5, + BPF_MAP_TYPE_PERCPU_ARRAY = 6, + BPF_MAP_TYPE_STACK_TRACE = 7, + BPF_MAP_TYPE_CGROUP_ARRAY = 8, + BPF_MAP_TYPE_LRU_HASH = 9, + BPF_MAP_TYPE_LRU_PERCPU_HASH = 10, + BPF_MAP_TYPE_LPM_TRIE = 11, + BPF_MAP_TYPE_ARRAY_OF_MAPS = 12, + BPF_MAP_TYPE_HASH_OF_MAPS = 13, + BPF_MAP_TYPE_DEVMAP = 14, + BPF_MAP_TYPE_SOCKMAP = 15, + BPF_MAP_TYPE_CPUMAP = 16, + BPF_MAP_TYPE_XSKMAP = 17, + BPF_MAP_TYPE_SOCKHASH = 18, + BPF_MAP_TYPE_CGROUP_STORAGE = 19, + BPF_MAP_TYPE_REUSEPORT_SOCKARRAY = 20, + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = 21, + BPF_MAP_TYPE_QUEUE = 22, + BPF_MAP_TYPE_STACK = 23, + BPF_MAP_TYPE_SK_STORAGE = 24, + BPF_MAP_TYPE_DEVMAP_HASH = 25, + BPF_MAP_TYPE_STRUCT_OPS = 26, + BPF_MAP_TYPE_RINGBUF = 27, +}; + +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif + +struct seq_file; + +struct bpf_iter_meta { + struct seq_file *seq; + u64 session_id; + u64 seq_num; +} __attribute__((preserve_access_index)); + +struct cred { + struct kuid_t uid; + struct kgid_t gid; + struct kuid_t euid; + struct kgid_t egid; +} __attribute__((preserve_access_index)); + +struct nsproxy { + struct mnt_namespace *mnt_ns; + struct uts_namespace *uts_ns; + struct ipc_namespace *ipc_ns; + struct pid_namespace *pid_ns_for_children; + struct net *net_ns; + struct cgroup_namespace *cgroup_ns; +} __attribute__((preserve_access_index)); + +struct mnt_namespace { + unsigned int ns_inum; +} __attribute__((preserve_access_index)); + +struct uts_namespace { + unsigned int ns_inum; +} __attribute__((preserve_access_index)); + +struct ipc_namespace { + unsigned int ns_inum; +} __attribute__((preserve_access_index)); + +struct pid_namespace { + unsigned int ns_inum; +} __attribute__((preserve_access_index)); + +struct net { + unsigned int ns_inum; +} __attribute__((preserve_access_index)); + +struct cgroup_namespace { + unsigned int ns_inum; +} __attribute__((preserve_access_index)); + +struct task_struct { + int pid; + int tgid; + struct task_struct *real_parent; + struct task_struct *group_leader; + const struct cred *real_cred; + struct nsproxy *nsproxy; + u64 start_boottime; + char comm[TASK_COMM_LEN]; +} __attribute__((preserve_access_index)); + +struct bpf_iter__task { + struct bpf_iter_meta *meta; + struct task_struct *task; +} __attribute__((preserve_access_index)); + +/* Layout for sched/sched_process_exec; filename follows via __data_loc. */ +struct trace_event_raw_sched_process_exec { + unsigned short common_type; + unsigned char common_flags; + unsigned char common_preempt_count; + int common_pid; + u32 __data_loc_filename; + pid_t pid; + pid_t old_pid; +}; diff --git a/internal/ebpf/spike/cmd/spike/main.go b/internal/ebpf/spike/cmd/spike/main.go new file mode 100644 index 000000000..27d16c474 --- /dev/null +++ b/internal/ebpf/spike/cmd/spike/main.go @@ -0,0 +1,47 @@ +//go:build linux + +/* + * Copyright 2026 Fibratus contributors + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package main + +import ( + "fmt" + "os" + "time" + + "github.com/rabbitstack/fibratus/internal/ebpf/spike" +) + +func main() { + duration := 2 * time.Second + if v := os.Getenv("SPIKE_DURATION"); v != "" { + if d, err := time.ParseDuration(v); err == nil { + duration = d + } + } + + result, err := spike.Run(duration) + if result != nil { + fmt.Print(spike.FormatReport(result)) + } + if err != nil { + fmt.Fprintf(os.Stderr, "spike failed: %v\n", err) + os.Exit(1) + } +} diff --git a/internal/ebpf/spike/enrich.go b/internal/ebpf/spike/enrich.go new file mode 100644 index 000000000..fa57410a3 --- /dev/null +++ b/internal/ebpf/spike/enrich.go @@ -0,0 +1,53 @@ +//go:build linux + +/* + * Copyright 2026 Fibratus contributors + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package spike + +import ( + "fmt" + "os" + "strings" +) + +// enrichFromProc best-effort reads /proc//{exe,cmdline}. Failures leave +// fields empty and never replace the iterator baseline scan. +func enrichFromProc(pid uint32) (exe string, cmdline string, err error) { + exeLink := fmt.Sprintf("/proc/%d/exe", pid) + exe, err = os.Readlink(exeLink) + if err != nil { + exe = "" + } + + raw, cerr := os.ReadFile(fmt.Sprintf("/proc/%d/cmdline", pid)) + if cerr != nil { + if err == nil { + err = cerr + } + return exe, "", err + } + parts := strings.Split(string(raw), "\x00") + var cleaned []string + for _, p := range parts { + if p != "" { + cleaned = append(cleaned, p) + } + } + return exe, strings.Join(cleaned, " "), err +} diff --git a/internal/ebpf/spike/event.go b/internal/ebpf/spike/event.go new file mode 100644 index 000000000..d4211d07d --- /dev/null +++ b/internal/ebpf/spike/event.go @@ -0,0 +1,35 @@ +//go:build linux + +/* + * Copyright 2026 Fibratus contributors + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package spike + +// spikeEvent mirrors struct spike_event in c/events.h. +type spikeEvent struct { + Kind uint32 + Pid uint32 + Tgid uint32 + Ppid uint32 + UID uint32 + GID uint32 + StartBoottime uint64 + TimestampNs uint64 + Comm [16]byte + Filename [256]byte +} diff --git a/internal/ebpf/spike/execve_bpfeb.go b/internal/ebpf/spike/execve_bpfeb.go new file mode 100644 index 000000000..50ee1ed7d --- /dev/null +++ b/internal/ebpf/spike/execve_bpfeb.go @@ -0,0 +1,136 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package spike + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +// loadExecve returns the embedded CollectionSpec for execve. +func loadExecve() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_ExecveBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load execve: %w", err) + } + + return spec, err +} + +// loadExecveObjects loads execve and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *execveObjects +// *execvePrograms +// *execveMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadExecveObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadExecve() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// execveSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveSpecs struct { + execveProgramSpecs + execveMapSpecs + execveVariableSpecs +} + +// execveProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveProgramSpecs struct { + HandleSchedProcessExec *ebpf.ProgramSpec `ebpf:"handle_sched_process_exec"` +} + +// execveMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Events *ebpf.MapSpec `ebpf:"events"` +} + +// execveVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveVariableSpecs struct { +} + +// execveObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execveObjects struct { + execvePrograms + execveMaps + execveVariables +} + +func (o *execveObjects) Close() error { + return _ExecveClose( + &o.execvePrograms, + &o.execveMaps, + ) +} + +// execveMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execveMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Events *ebpf.Map `ebpf:"events"` +} + +func (m *execveMaps) Close() error { + return _ExecveClose( + m.DropCount, + m.Events, + ) +} + +// execveVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execveVariables struct { +} + +// execvePrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execvePrograms struct { + HandleSchedProcessExec *ebpf.Program `ebpf:"handle_sched_process_exec"` +} + +func (p *execvePrograms) Close() error { + return _ExecveClose( + p.HandleSchedProcessExec, + ) +} + +func _ExecveClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed execve_bpfeb.o +var _ExecveBytes []byte diff --git a/internal/ebpf/spike/execve_bpfeb.o b/internal/ebpf/spike/execve_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..2619d22368f11f0ea2697163b7ec3469982438fa GIT binary patch literal 6960 zcmb_gU2I%O6`uWb?KVG#w2di*-q2#!uCv*sB}56eHa{B@)f6iUkRqh(_3qeSynorf z>#mblEFwr%)dx#ZDWD?!P>CS%;0HwVWw&O)-JqO2x2xD{!N}@*H{?Tu zA-B)#9;Mjf>)BBAt&n|lwGj$mY^X;m6|ZgFC0`xoQ>jNhr8YJ;?z;YDeC!FOUZ>sl zaK6~@CE}D)m#DwoiJ2L}(}F$WL&D8S^!E!U!#HK)0ACk;NBC{ww}jsm{+{qP;Wvb@ z2)`zLS@>1qOTym}-WA>v-Vi<~d`kEQ;giBo3(pBZEIcbbE!-16Bz#bKzi_f%J&P9& zR8sHM<%aU85xk?=P)Xuf`B2IOHh!dkC$RBvam4O%4p`mIC)U|msdTtc)S%c~{>*CE znAy0}t0p_8b{+`zt51cTez;%6PrvxNxcF4KuP$FyCU4m<{U6xRklYB@V zNgGE&;y_)uF=81%wDTJe&cnuO{VcvIadg#(BYu>%`yb*lE6~g5!SN*RJT{(4US?ej zPlomRvhljHv9logZC>xgaxSRVLt(%8YuSAv>uC4emFuCIdRzF(cA?^Z{>=IPpPQTz z)dymK`9X~KW=|-U#NH+Kou@L+hf)bp%vhll+_Oq@G@9`p_$Vl4?I3#~>!Xh{9Z54| z#Fm4JS*eeJtoq}SQ=lAZbO#=2kAO@+2cVfV)Ab9z=@uKa&+cOr^+Wdu%!`Xx3i78# zW=uyVAm-?SY);&Fr^Rj;=K-^CYLUdH?(?l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{G literal 0 HcmV?d00001 diff --git a/internal/ebpf/spike/execve_bpfel.go b/internal/ebpf/spike/execve_bpfel.go new file mode 100644 index 000000000..32e2de0f9 --- /dev/null +++ b/internal/ebpf/spike/execve_bpfel.go @@ -0,0 +1,136 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm + +package spike + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +// loadExecve returns the embedded CollectionSpec for execve. +func loadExecve() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_ExecveBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load execve: %w", err) + } + + return spec, err +} + +// loadExecveObjects loads execve and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *execveObjects +// *execvePrograms +// *execveMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadExecveObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadExecve() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// execveSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveSpecs struct { + execveProgramSpecs + execveMapSpecs + execveVariableSpecs +} + +// execveProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveProgramSpecs struct { + HandleSchedProcessExec *ebpf.ProgramSpec `ebpf:"handle_sched_process_exec"` +} + +// execveMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Events *ebpf.MapSpec `ebpf:"events"` +} + +// execveVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveVariableSpecs struct { +} + +// execveObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execveObjects struct { + execvePrograms + execveMaps + execveVariables +} + +func (o *execveObjects) Close() error { + return _ExecveClose( + &o.execvePrograms, + &o.execveMaps, + ) +} + +// execveMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execveMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Events *ebpf.Map `ebpf:"events"` +} + +func (m *execveMaps) Close() error { + return _ExecveClose( + m.DropCount, + m.Events, + ) +} + +// execveVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execveVariables struct { +} + +// execvePrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execvePrograms struct { + HandleSchedProcessExec *ebpf.Program `ebpf:"handle_sched_process_exec"` +} + +func (p *execvePrograms) Close() error { + return _ExecveClose( + p.HandleSchedProcessExec, + ) +} + +func _ExecveClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed execve_bpfel.o +var _ExecveBytes []byte diff --git a/internal/ebpf/spike/execve_bpfel.o b/internal/ebpf/spike/execve_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..82e5ffdd82d99f009b0e2c087bc43a57cb68ce6d GIT binary patch literal 6960 zcmbtYTWp+16&_#WTb$Urk(3hphc;%NI-5;e+9+wG&BY;6O|g;yDXR2)y*suS?~UDm zQ@d$}C4y2_eXs;b0TtmwC4$6*9}vl#{lG&I7X=BSNbnGNia)#VQ zC}QmMpYxqLbLN~g^Uu!i*9M2qHa9gX*P7Hn)hcpYrIvQD%4s8})fQMTe9Y=^by&W~ z8+@x-siV-{YO(#_0Q)*{4$V!&?Bv zf9N$(ZBlO<;p+7i)#~c?gz!MP^?3Dquiy^h#trP3W&D!x2g2_Qzb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GCqp^ILJP~e(yoIUjDZwe>Xq#=kJbgewROgw`2T%E0|wXlzQJQj6Xkpt~dV!nSVsa xbAH/dev/null 2>&1; then + echo "clang is required to regenerate eBPF objects" >&2 + exit 1 +fi + +case "$(uname -m)" in + x86_64|amd64) export BPF_TARGET_ARCH=x86 ;; + aarch64|arm64) export BPF_TARGET_ARCH=arm64 ;; + *) + echo "unsupported architecture: $(uname -m)" >&2 + exit 1 + ;; +esac + +CLANG_VERSION="$(clang --version | head -n1)" +echo "clang: ${CLANG_VERSION}" +echo "target arch: ${BPF_TARGET_ARCH}" + +go run github.com/cilium/ebpf/cmd/bpf2go@v0.20.0 \ + -go-package spike -output-dir . -cc clang -target bpfel,bpfeb \ + execve ./c/execve.bpf.c -- -I./c -O2 -g "-D__TARGET_ARCH_${BPF_TARGET_ARCH}" + +go run github.com/cilium/ebpf/cmd/bpf2go@v0.20.0 \ + -go-package spike -output-dir . -cc clang -target bpfel,bpfeb \ + prociter ./c/proc_iter.bpf.c -- -I./c -O2 -g "-D__TARGET_ARCH_${BPF_TARGET_ARCH}" + +echo "generated spike bpf bindings" diff --git a/internal/ebpf/spike/prociter_bpfeb.go b/internal/ebpf/spike/prociter_bpfeb.go new file mode 100644 index 000000000..e9b72e1a1 --- /dev/null +++ b/internal/ebpf/spike/prociter_bpfeb.go @@ -0,0 +1,136 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package spike + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +// loadProciter returns the embedded CollectionSpec for prociter. +func loadProciter() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_ProciterBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load prociter: %w", err) + } + + return spec, err +} + +// loadProciterObjects loads prociter and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *prociterObjects +// *prociterPrograms +// *prociterMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadProciterObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadProciter() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// prociterSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterSpecs struct { + prociterProgramSpecs + prociterMapSpecs + prociterVariableSpecs +} + +// prociterProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterProgramSpecs struct { + DumpTask *ebpf.ProgramSpec `ebpf:"dump_task"` +} + +// prociterMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Events *ebpf.MapSpec `ebpf:"events"` +} + +// prociterVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterVariableSpecs struct { +} + +// prociterObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterObjects struct { + prociterPrograms + prociterMaps + prociterVariables +} + +func (o *prociterObjects) Close() error { + return _ProciterClose( + &o.prociterPrograms, + &o.prociterMaps, + ) +} + +// prociterMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Events *ebpf.Map `ebpf:"events"` +} + +func (m *prociterMaps) Close() error { + return _ProciterClose( + m.DropCount, + m.Events, + ) +} + +// prociterVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterVariables struct { +} + +// prociterPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterPrograms struct { + DumpTask *ebpf.Program `ebpf:"dump_task"` +} + +func (p *prociterPrograms) Close() error { + return _ProciterClose( + p.DumpTask, + ) +} + +func _ProciterClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed prociter_bpfeb.o +var _ProciterBytes []byte diff --git a/internal/ebpf/spike/prociter_bpfeb.o b/internal/ebpf/spike/prociter_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..4547f4feb0b2bbf61e29f83d13ecd0fe0dfda9f2 GIT binary patch literal 5592 zcmbtXU2I%O6+U~{X=CzZH#EdRp*OUcb>wU|C4}Or(T3I`5hk_b6r~mD`g(n1FWx_P z??!fA#3G6a5<-^vsU?t_iU)!y!a|j7i9(D75>oqMBp#6HgC7v8Xdi+Eq7RYG_syKU zz8=*=h>^~G=R0%GnVB<>sY;^ZC0 zJBn{AZYus+aYOMBitCDNiYtn@6mKdnD=sPCQ0yqqD>f8o6(<$1Dvm2&P%J7ws#s9W zDf)^7iv5av6$wc_y;5kXXubC=PKr-UY1TduKy&^JN5tk2#pKoVDBS*-jqf{Zap91S zTMWgl3vqURp^XPO>p0vm9wWm0Y<{d`KRL!tevF%WL(N;760?t#|NZp8{XX{Ck8dE^ z$MdU}%J&tYXonU5a~H3i_{{j2n*Jwv>%|QH&Dun=YgT$pF0&CBFrG19B0WH#0W@l( z8~5}<$ezRxx(~6%5V?oC8>7AqW)9Zj{gA}`Vd(fdND*@EAUd>rA!c0HW`28aUig?{ z^)dB-7oT(i1sgW2*D~E^7=;MF{tp#B-0m zw4rg2`yfR~1UUfdK+2H&AnTC2?j5g;9ed}QJ&UB=CfE5b2y?T22l4?(5n>zw$5Z-; zsADoNlkwk$9D%%mV$sI4+(hnV{cnTQkL?bGx)1pmMCUP&2=xw9aLL@;I&`knw`ns# zLESP%$O-5l0d{~%@&~D#Llt=_Wgmv$DJ~3+6PZ${&h#kkST5_3{Q;Cj{~>G-L(sA> zq8o(x(0>f1y$JmlkoHOFKSv;^0c2k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%I9 literal 0 HcmV?d00001 diff --git a/internal/ebpf/spike/prociter_bpfel.go b/internal/ebpf/spike/prociter_bpfel.go new file mode 100644 index 000000000..69633c0fe --- /dev/null +++ b/internal/ebpf/spike/prociter_bpfel.go @@ -0,0 +1,136 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm + +package spike + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +// loadProciter returns the embedded CollectionSpec for prociter. +func loadProciter() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_ProciterBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load prociter: %w", err) + } + + return spec, err +} + +// loadProciterObjects loads prociter and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *prociterObjects +// *prociterPrograms +// *prociterMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadProciterObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadProciter() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// prociterSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterSpecs struct { + prociterProgramSpecs + prociterMapSpecs + prociterVariableSpecs +} + +// prociterProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterProgramSpecs struct { + DumpTask *ebpf.ProgramSpec `ebpf:"dump_task"` +} + +// prociterMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Events *ebpf.MapSpec `ebpf:"events"` +} + +// prociterVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterVariableSpecs struct { +} + +// prociterObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterObjects struct { + prociterPrograms + prociterMaps + prociterVariables +} + +func (o *prociterObjects) Close() error { + return _ProciterClose( + &o.prociterPrograms, + &o.prociterMaps, + ) +} + +// prociterMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Events *ebpf.Map `ebpf:"events"` +} + +func (m *prociterMaps) Close() error { + return _ProciterClose( + m.DropCount, + m.Events, + ) +} + +// prociterVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterVariables struct { +} + +// prociterPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterPrograms struct { + DumpTask *ebpf.Program `ebpf:"dump_task"` +} + +func (p *prociterPrograms) Close() error { + return _ProciterClose( + p.DumpTask, + ) +} + +func _ProciterClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed prociter_bpfel.o +var _ProciterBytes []byte diff --git a/internal/ebpf/spike/prociter_bpfel.o b/internal/ebpf/spike/prociter_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..08f210f72086884e00bf034626a41c3940f8eefd GIT binary patch literal 5592 zcmbtXU2I%O6+U)c$95e5gxEC@;D#2nj_l2*gisvS+R!>A!X#GgqO<~Cuh%#B;{EgP z-N;)PVTn?uQiUuP(g=_m-~me%VWCQnL?K2338{TBQXi1$gC7v8Xdi+Eq7RnL_syKU zyPgIl#F5VZ&Ufa_nVBIe@UH1UXfcz>UPqYNjZ$j>Vs{D^&Pxw zFtuzzQcEqy_}aje1~=QSf51t;*(~xXe47Vs`?mq#g5GVl{K?i1W2C>oyGP^hkFEb8 z`t9!R?Ya5bpF{M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uSI@egCJ6xOCOA8SFL)poA^A@DbpbFJj>Du?+W<$(Q+-Pg`1MIy~#} zXC3~c!++@TR~`Pk!{2oH+YW!v;fK094@*1@mP3h`f^7T?)92$P_0OW{1J}Oc>K~vC zuYZKbv)Su8ej1hV@mqTj#_@$2re-BxuI3Et5VhB)E#CieeHwlBmfV-+7=Mr;D;8>3 z-R^yyzWS5JHYIBj`wi}Uql|+5xBk)dE9%o08H#6s{Etm4kHGvugLvxb1ah5G{~q=8 zADQF3HSp9CJ@+)+#6~ue|8n>1pV0n^#$edd_>nuW{UaXXjP^g~ba3nUb#%Dj`eWTT zQ#3x;&mXfWU9^6_6FGlZp4FG-uAcX(-5sAf?>GKc9e+#vb9~0R<39o4fr-5WU=>=E h0X={2c= 0 { + b = b[:i] + } + return string(b) +} + +func execLookPath() string { + for _, p := range []string{"/bin/true", "/usr/bin/true"} { + if _, err := os.Stat(p); err == nil { + return p + } + } + return "/bin/sh" +} + +func runTrueOnce() { + cmd := execLookPath() + p, err := os.StartProcess(cmd, []string{cmd}, &os.ProcAttr{ + Files: []*os.File{nil, nil, nil}, + }) + if err != nil { + return + } + _, _ = p.Wait() +} From 5785ab0a903936aa1a9a4729484cd0970210878d Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 5 Aug 2026 21:41:07 +0200 Subject: [PATCH 04/65] docs(ebpf): Document Linux eBPF feasibility and build gating worklist Record validated runtime/tooling prerequisites, spike proofs, Windows coupling hotspots, and the ps.Snapshotter consumer migration needed for a Linux build. --- internal/ebpf/FEASIBILITY.md | 96 ++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 internal/ebpf/FEASIBILITY.md diff --git a/internal/ebpf/FEASIBILITY.md b/internal/ebpf/FEASIBILITY.md new file mode 100644 index 000000000..c37217e7e --- /dev/null +++ b/internal/ebpf/FEASIBILITY.md @@ -0,0 +1,96 @@ +# Linux eBPF Feasibility Notes + +This note records the runtime contract, tooling, and build-gating work validated by the throwaway spike under `internal/ebpf/spike`. + +## Runtime contract + +Hard requirements (no graceful degradation): + +- Linux kernel >= 5.9 (BPF task iterators) +- Usable runtime kernel BTF at `/sys/kernel/btf/vmlinux` +- Ring buffer maps and helpers +- Tracing programs with `iter/task` attach support +- Capabilities: `CAP_BPF`, `CAP_PERFMON`, and `CAP_SYS_PTRACE` for best-effort `/proc` enrichment + +Explicit non-fallbacks: + +- No BTFHub download +- No embedded build-host BTF as a runtime substitute for iterator attach +- No `bpf_d_path` (helper starts in 5.10; executable path comes from best-effort `/proc//exe`) + +`internal/ebpf.ProbePrerequisites` encodes these checks and fails with actionable errors. + +## Tooling + +| Tool | Pin / note | +| --- | --- | +| `github.com/cilium/ebpf` | v0.20.0 | +| `bpf2go` | version-matched to cilium/ebpf v0.20.0 | +| clang/LLVM | Spike objects regenerated with Debian clang 19.1.7 (`golang:1.26` image) | +| bpftool | Optional for inspecting BTF; not required for ordinary builds | +| Host requirements for spike runs | Privileged Linux, `/sys/kernel/btf/vmlinux`, mounted `tracefs` (`/sys/kernel/tracing`) | + +Regenerate spike objects with `internal/ebpf/spike/generate.sh`. Ordinary `go build` consumes committed generated bindings and does not require clang. + +## Spike proofs + +The spike under `internal/ebpf/spike` demonstrates: + +1. CO-RE load of a `sched/sched_process_exec` tracepoint program that emits to a ring buffer +2. `iter/task` attachment and scan without `bpf_d_path` +3. Shared canonical maps across separately generated collections via `CollectionOptions.MapReplacements` +4. Race-safe startup prototype: start ringbuf reader, attach hot path, queue hot events, run iterator baseline keyed by `ProcessKey{PID,StartBootTime}`, replay pending events idempotently, then switch live +5. Best-effort `/proc//{exe,cmdline}` enrichment that never replaces the iterator scan +6. Drop accounting for ringbuf reserve failures and bounded pending-queue pressure + +Validated on Docker Desktop LinuxKit 6.12.76 (arm64) with privileged containers, mounted kernel BTF, and mounted tracefs. Example spike metrics: hot events queued during baseline and replayed (`pending_queued`/`replay_applied` > 0), ringbuf drops at zero under light load. Task-iterator snapshot counts reflect processes visible in the container PID namespace. + +Run (privileged Linux host or container with kernel BTF mounted): + +```bash +go test ./internal/ebpf -count=1 +cd internal/ebpf/spike && ./generate.sh +go run ./internal/ebpf/spike/cmd/spike +``` + +## Windows coupling audit + +Unguarded Windows imports that block a clean `GOOS=linux` build include (non-exhaustive; prioritize bootstrap and shared packages): + +- `internal/bootstrap/bootstrap.go` (`golang.org/x/sys/windows`, `pkg/handle`) +- `internal/bootstrap/source.go` (hard-wires `etw.NewEventSource`) +- `cmd/fibratus/app/root.go` (runtime reject of non-Windows) +- Shared packages importing `golang.org/x/sys/windows` without build tags, notably: `pkg/event/enum.go`, `pkg/event/flags.go`, `pkg/config/output.go`, `pkg/filter/ql/function.go`, `pkg/util/log/logger.go`, `pkg/util/signals/signals.go`, `pkg/callstack/callstack.go`, `pkg/pe/parser.go`, `pkg/fs/*`, many `pkg/sys/*`, `pkg/handle/*` + +Already Windows-tagged or stubbed in places: `pkg/config/eventsource.go`, `pkg/event/types_windows.go`, `pkg/ps/types/types_windows.go`, `pkg/yara/scanner_unsupported.go`, `pkg/cap/writer_unsupported.go`, `pkg/filament/filament_unsupported.go`. + +## `ps.Snapshotter` consumer audit + +Current interface methods used by Windows (full contract in `pkg/ps/snapshotter.go`): `Write`, `AddThread`, `AddModule`, `RemoveThread`, `RemoveModule`, `AddMmap`, `RemoveMmap`, `WriteFromCapture`, `Remove`, `Find`, `FindModule`, `FindAllModules`, `FindAndPut`, `Put`, `Size`, `Close`. + +| Consumer | Needs on Linux | Migration | +| --- | --- | --- | +| `pkg/rules/engine.go` | `Find` only | Move to narrow `ps.Resolver` | +| `pkg/rules/compiler.go` | `Find` only | Move to `ps.Resolver` | +| `pkg/rules/sequence.go` | `Find` only | Move to `ps.Resolver` | +| `internal/bootstrap/*` | Construct platform snapshotter | Split `_windows` / `_linux` | +| `internal/etw/*` processors | Full Windows snapshotter | Keep Windows-only | +| `pkg/symbolize/*` | Modules / PE paths | Gate Windows-only; stub or omit on Linux | +| `pkg/yara/scanner.go` | Process memory context | Keep unsupported on Linux for now | +| `pkg/cap/*` | Capture restore | Out of initial Linux scope; keep stubs | +| `pkg/filament/*` | Process state for filaments | Out of initial Linux scope; keep stubs | +| `pkg/filter/filter_windows.go` | Optional psnap option | Linux filter path uses Linux accessors | + +Recommended Linux contract: `ps.LinuxSnapshotter` with `Write`, `Remove`, `UpsertSnapshot`, `Find`, `Put`, `Size`, `Close`, plus thread/mmap state. Shared rules/sequence code must depend only on `ps.Resolver` (`Find`). + +## Build gating worklist + +Work required before a Linux process event source can land: + +1. Build-tag split `internal/bootstrap` and replace ETW hard-wire with Linux eBPF source selection +2. Add `cmd/fibratus/main_linux.go` and per-OS command registration in `cmd/fibratus/app` +3. Add Linux `event.Type` semantic IDs (`uint16`, not syscall numbers) and `pkg/config/eventsource_linux.go` +4. Introduce `ps.Resolver` and migrate rules/compiler/sequence consumers +5. Add Linux PS types and `ProcessKey{PID,StartBootTime}` +6. Gate or stub remaining untagged Windows imports on the Linux build graph +7. Promote spike loader/consumer patterns into production `internal/ebpf` packages with committed generated objects and CI generation-drift checks From e0547290d661365e35b26acf27b81611ab971100 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 5 Aug 2026 21:45:05 +0200 Subject: [PATCH 05/65] fix(ebpf): Harden spike reconciler ownership and shutdown paths Ignore late iterator snapshots after live switch, avoid double-closing MapReplacement-owned maps, and back off on persistent ringbuf read errors. --- internal/ebpf/FEASIBILITY.md | 2 +- internal/ebpf/features.go | 4 +++- internal/ebpf/reconcile.go | 5 +++++ internal/ebpf/reconcile_test.go | 17 +++++++++++++++++ internal/ebpf/spike/run.go | 9 +++++++-- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/internal/ebpf/FEASIBILITY.md b/internal/ebpf/FEASIBILITY.md index c37217e7e..f9344b3ba 100644 --- a/internal/ebpf/FEASIBILITY.md +++ b/internal/ebpf/FEASIBILITY.md @@ -9,7 +9,7 @@ Hard requirements (no graceful degradation): - Linux kernel >= 5.9 (BPF task iterators) - Usable runtime kernel BTF at `/sys/kernel/btf/vmlinux` - Ring buffer maps and helpers -- Tracing programs with `iter/task` attach support +- Tracing programs plus runtime kernel BTF (required for `iter/task`; attach is verified when the spike/loader calls `AttachIter`) - Capabilities: `CAP_BPF`, `CAP_PERFMON`, and `CAP_SYS_PTRACE` for best-effort `/proc` enrichment Explicit non-fallbacks: diff --git a/internal/ebpf/features.go b/internal/ebpf/features.go index 8ef430124..ea9ecf695 100644 --- a/internal/ebpf/features.go +++ b/internal/ebpf/features.go @@ -103,7 +103,9 @@ func ProbePrerequisites() (*PrerequisiteReport, error) { report.RingbufHelper = true } - // Task iterators attach as Tracing + AttachTraceIter against a kernel BTF target. + // iter/task attach still needs a loaded program; ProbePrerequisites only checks + // the necessary Tracing + runtime BTF preconditions. AttachIter in the spike + // (and later loader) is the conclusive probe. if report.TracingOK && report.BTFOK { report.IterOK = true } else { diff --git a/internal/ebpf/reconcile.go b/internal/ebpf/reconcile.go index 31184d0d6..2d939c981 100644 --- a/internal/ebpf/reconcile.go +++ b/internal/ebpf/reconcile.go @@ -105,9 +105,14 @@ func (r *StartupReconciler) EnqueueHot(ev HotEvent) bool { } // UpsertSnapshot installs an iterator baseline record keyed by ProcessKey. +// After FinishBaseline, late snapshot records are ignored so they cannot +// overwrite live hot-path state. func (r *StartupReconciler) UpsertSnapshot(rec ProcessRecord) { r.mu.Lock() defer r.mu.Unlock() + if r.live { + return + } rec.FromSnap = true existing, ok := r.procs[rec.Key] if !ok { diff --git a/internal/ebpf/reconcile_test.go b/internal/ebpf/reconcile_test.go index 3e8c7031a..516bf078e 100644 --- a/internal/ebpf/reconcile_test.go +++ b/internal/ebpf/reconcile_test.go @@ -68,6 +68,23 @@ func TestStartupReconcilerRaceSafeBaseline(t *testing.T) { } } +func TestStartupReconcilerIgnoresLateSnapshots(t *testing.T) { + r := NewStartupReconciler(8) + key := ProcessKey{PID: 7, StartBootTime: 9} + r.UpsertSnapshot(ProcessRecord{Key: key, Comm: "snap"}) + r.FinishBaseline() + r.EnqueueHot(HotEvent{Key: key, Kind: 1, Comm: "live", ExePath: "/bin/live"}) + r.UpsertSnapshot(ProcessRecord{Key: key, Comm: "stale-snap", ExePath: "/bin/stale"}) + + got, ok := r.Get(key) + if !ok { + t.Fatal("missing process after late snapshot") + } + if got.Comm != "live" || got.ExePath != "/bin/live" { + t.Fatalf("late snapshot overwrote live state: %+v", got) + } +} + func TestStartupReconcilerPendingBackpressure(t *testing.T) { r := NewStartupReconciler(2) key := ProcessKey{PID: 1, StartBootTime: 1} diff --git a/internal/ebpf/spike/run.go b/internal/ebpf/spike/run.go index 44293e76e..6ba8aff9c 100644 --- a/internal/ebpf/spike/run.go +++ b/internal/ebpf/spike/run.go @@ -79,6 +79,7 @@ func Run(duration time.Duration) (*Result, error) { defer execObjs.Close() // Inject the canonical shared maps from the first collection into the second. + // The first collection owns those maps; only close the iterator program here. var iterObjs prociterObjects if err := iterSpec.LoadAndAssign(&iterObjs, &ebpf.CollectionOptions{ MapReplacements: map[string]*ebpf.Map{ @@ -88,7 +89,11 @@ func Run(duration time.Duration) (*Result, error) { }); err != nil { return nil, fmt.Errorf("loading prociter with map replacements: %w", err) } - defer iterObjs.Close() + defer func() { + if iterObjs.DumpTask != nil { + _ = iterObjs.DumpTask.Close() + } + }() rd, err := ringbuf.NewReader(execObjs.Events) if err != nil { @@ -112,7 +117,7 @@ func Run(duration time.Duration) (*Result, error) { select { case <-stop: return - default: + case <-time.After(10 * time.Millisecond): continue } } From 9b80f897a298997f05d167e40d83bdfdabb92531 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Fri, 7 Aug 2026 09:26:31 +0200 Subject: [PATCH 06/65] fix(ebpf): Restore cilium/ebpf module and rename import alias Keep github.com/cilium/ebpf as a direct go.mod require so Linux packages resolve in CI, and use the libebpf import alias requested in review. --- go.mod | 3 +-- go.sum | 15 ++++++++++++--- internal/ebpf/FEASIBILITY.md | 2 +- internal/ebpf/spike/run.go | 14 +++++++------- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index e97fbeb49..4644144e7 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/antchfx/htmlquery v1.2.5 github.com/briandowns/spinner v1.12.0 github.com/cenkalti/backoff/v4 v4.3.0 + github.com/cilium/ebpf v0.20.0 github.com/dustin/go-humanize v1.0.0 github.com/enescakir/emoji v1.0.0 github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e @@ -47,9 +48,7 @@ require ( require ( github.com/BurntSushi/toml v0.4.1 // indirect github.com/klauspost/cpuid/v2 v2.2.10 // indirect - github.com/kr/pretty v0.3.1 // indirect github.com/rivo/uniseg v0.4.2 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/secDre4mer/pkcs7 v0.0.0-20240322103146-665324a4461d // indirect go4.org/netipx v0.0.0-20220725152314-7e7bdc8411bf // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect diff --git a/go.sum b/go.sum index b767df3f3..549213ce9 100644 --- a/go.sum +++ b/go.sum @@ -26,13 +26,14 @@ github.com/briandowns/spinner v1.12.0/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cilium/ebpf v0.20.0 h1:atwWj9d3NffHyPZzVlx3hmw1on5CLe9eljR8VuHTwhM= +github.com/cilium/ebpf v0.20.0/go.mod h1:pzLjFymM+uZPLk/IXZUL63xdx5VXEo+enTzxkZXdycw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -56,6 +57,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6 h1:teYtXy9B7y5lHTp8V9KPxpYRAVA7dozigQcMiBust1s= +github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6/go.mod h1:p4lGIVX+8Wa6ZPNDvqcxq36XpUDLh42FLetFU7odllI= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -102,6 +105,10 @@ github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeY github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= +github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= +github.com/jsimonetti/rtnetlink/v2 v2.0.1 h1:xda7qaHDSVOsADNouv7ukSuicKZO7GgVUCXxpaIEIlM= +github.com/jsimonetti/rtnetlink/v2 v2.0.1/go.mod h1:7MoNYNbb3UaDHtF8udiJo/RH6VsTKP1pqKLUTVCvToE= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -134,6 +141,10 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g= +github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw= +github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U= +github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -150,7 +161,6 @@ github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -175,7 +185,6 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/saferwall/pe v1.5.6 h1:DrRLnoQFxHWJ5lJUmrH7X2L0xeUu6SUS95Dc61eW2Yc= diff --git a/internal/ebpf/FEASIBILITY.md b/internal/ebpf/FEASIBILITY.md index f9344b3ba..46aa7d58b 100644 --- a/internal/ebpf/FEASIBILITY.md +++ b/internal/ebpf/FEASIBILITY.md @@ -24,7 +24,7 @@ Explicit non-fallbacks: | Tool | Pin / note | | --- | --- | -| `github.com/cilium/ebpf` | v0.20.0 | +| `github.com/cilium/ebpf` | v0.20.0 (direct `go.mod` require; run `GOOS=linux go mod tidy` so Darwin tidy cannot drop it) | | `bpf2go` | version-matched to cilium/ebpf v0.20.0 | | clang/LLVM | Spike objects regenerated with Debian clang 19.1.7 (`golang:1.26` image) | | bpftool | Optional for inspecting BTF; not required for ordinary builds | diff --git a/internal/ebpf/spike/run.go b/internal/ebpf/spike/run.go index 6ba8aff9c..4c223b925 100644 --- a/internal/ebpf/spike/run.go +++ b/internal/ebpf/spike/run.go @@ -34,7 +34,7 @@ import ( "github.com/cilium/ebpf/link" "github.com/cilium/ebpf/ringbuf" "github.com/cilium/ebpf/rlimit" - fibebpf "github.com/rabbitstack/fibratus/internal/ebpf" + libebpf "github.com/rabbitstack/fibratus/internal/ebpf" ) const ( @@ -44,7 +44,7 @@ const ( // Result summarizes a successful spike run. type Result struct { - Prerequisites *fibebpf.PrerequisiteReport + Prerequisites *libebpf.PrerequisiteReport Snapshots int ExecEvents int Reconciled int @@ -54,7 +54,7 @@ type Result struct { // Run proves CO-RE load, shared-map replacement, race-safe startup, and // best-effort /proc enrichment on a real Linux kernel. func Run(duration time.Duration) (*Result, error) { - report, err := fibebpf.ProbePrerequisites() + report, err := libebpf.ProbePrerequisites() if err != nil { return &Result{Prerequisites: report}, fmt.Errorf("prerequisites: %w", err) } @@ -101,7 +101,7 @@ func Run(duration time.Duration) (*Result, error) { } defer rd.Close() - reconciler := fibebpf.NewStartupReconciler(4096) + reconciler := libebpf.NewStartupReconciler(4096) stop := make(chan struct{}) done := make(chan struct{}) var execCount, snapCount atomic.Uint64 @@ -125,7 +125,7 @@ func Run(duration time.Duration) (*Result, error) { if err != nil { continue } - key := fibebpf.ProcessKey{PID: ev.Tgid, StartBootTime: ev.StartBoottime} + key := libebpf.ProcessKey{PID: ev.Tgid, StartBootTime: ev.StartBoottime} comm := cString(ev.Comm[:]) filename := cString(ev.Filename[:]) switch ev.Kind { @@ -135,7 +135,7 @@ func Run(duration time.Duration) (*Result, error) { reconciler.AccountEnrichmentMiss() } snapCount.Add(1) - reconciler.UpsertSnapshot(fibebpf.ProcessRecord{ + reconciler.UpsertSnapshot(libebpf.ProcessRecord{ Key: key, Comm: comm, Filename: filename, @@ -146,7 +146,7 @@ func Run(duration time.Duration) (*Result, error) { // Short-lived execs often exit before /proc enrichment; that is expected. exe, cmdline, _ := enrichFromProc(ev.Tgid) execCount.Add(1) - _ = reconciler.EnqueueHot(fibebpf.HotEvent{ + _ = reconciler.EnqueueHot(libebpf.HotEvent{ Key: key, Kind: ev.Kind, Timestamp: ev.TimestampNs, From d8592b3673b0af08208042127b8241afac17dfc9 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 12:35:12 +0200 Subject: [PATCH 07/65] refactor(bootstrap): Split bootstrap and CLI entrypoints for Linux --- cmd/fibratus/app/root.go | 25 ++-------- cmd/fibratus/app/root_linux.go | 32 +++++++++++++ cmd/fibratus/app/root_windows.go | 35 ++++++++++++++ cmd/fibratus/app/run_linux.go | 55 ++++++++++++++++++++++ cmd/fibratus/main_linux.go | 31 +++++++++++++ internal/bootstrap/bootstrap.go | 2 + internal/bootstrap/bootstrap_linux.go | 66 +++++++++++++++++++++++++++ internal/bootstrap/source.go | 2 + internal/bootstrap/source_linux.go | 49 ++++++++++++++++++++ 9 files changed, 277 insertions(+), 20 deletions(-) create mode 100644 cmd/fibratus/app/root_linux.go create mode 100644 cmd/fibratus/app/root_windows.go create mode 100644 cmd/fibratus/app/run_linux.go create mode 100644 cmd/fibratus/main_linux.go create mode 100644 internal/bootstrap/bootstrap_linux.go create mode 100644 internal/bootstrap/source_linux.go diff --git a/cmd/fibratus/app/root.go b/cmd/fibratus/app/root.go index 25f43b9ae..67145eb1d 100644 --- a/cmd/fibratus/app/root.go +++ b/cmd/fibratus/app/root.go @@ -20,15 +20,9 @@ package app import ( "errors" - "github.com/rabbitstack/fibratus/cmd/fibratus/app/capture" - "github.com/rabbitstack/fibratus/cmd/fibratus/app/config" - "github.com/rabbitstack/fibratus/cmd/fibratus/app/list" - "github.com/rabbitstack/fibratus/cmd/fibratus/app/replay" - "github.com/rabbitstack/fibratus/cmd/fibratus/app/rules" - "github.com/rabbitstack/fibratus/cmd/fibratus/app/service" - "github.com/rabbitstack/fibratus/cmd/fibratus/app/stats" - "github.com/spf13/cobra" "runtime" + + "github.com/spf13/cobra" ) // RootCmd is the entrance to Fibratus CLI @@ -44,8 +38,8 @@ var RootCmd = &cobra.Command{ `, SilenceUsage: true, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - if runtime.GOOS != "windows" { - return errors.New("fibratus can only be run on Windows operating systems") + if runtime.GOOS != "windows" && runtime.GOOS != "linux" { + return errors.New("fibratus can only be run on Windows or Linux operating systems") } if runtime.GOARCH == "386" { return errors.New("fibratus can't be run on 32-bits Windows operating systems") @@ -55,14 +49,5 @@ var RootCmd = &cobra.Command{ } func init() { - RootCmd.AddCommand(capture.Command) - RootCmd.AddCommand(replay.Command) - RootCmd.AddCommand(service.Command) - RootCmd.AddCommand(stats.Command) - RootCmd.AddCommand(config.Command) - RootCmd.AddCommand(list.Command) - RootCmd.AddCommand(rules.Command) - RootCmd.AddCommand(runCmd) - RootCmd.AddCommand(docsCmd) - RootCmd.AddCommand(versionCmd) + registerCommands() } diff --git a/cmd/fibratus/app/root_linux.go b/cmd/fibratus/app/root_linux.go new file mode 100644 index 000000000..47f828cd6 --- /dev/null +++ b/cmd/fibratus/app/root_linux.go @@ -0,0 +1,32 @@ +//go:build linux + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package app + +import ( + "github.com/rabbitstack/fibratus/cmd/fibratus/app/config" + "github.com/rabbitstack/fibratus/cmd/fibratus/app/list" + "github.com/rabbitstack/fibratus/cmd/fibratus/app/rules" + "github.com/rabbitstack/fibratus/cmd/fibratus/app/stats" +) + +func registerCommands() { + RootCmd.AddCommand(runCmd, rules.Command, config.Command, list.Command, stats.Command, docsCmd, versionCmd) +} diff --git a/cmd/fibratus/app/root_windows.go b/cmd/fibratus/app/root_windows.go new file mode 100644 index 000000000..f5003f624 --- /dev/null +++ b/cmd/fibratus/app/root_windows.go @@ -0,0 +1,35 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package app + +import ( + "github.com/rabbitstack/fibratus/cmd/fibratus/app/capture" + "github.com/rabbitstack/fibratus/cmd/fibratus/app/config" + "github.com/rabbitstack/fibratus/cmd/fibratus/app/list" + "github.com/rabbitstack/fibratus/cmd/fibratus/app/replay" + "github.com/rabbitstack/fibratus/cmd/fibratus/app/rules" + "github.com/rabbitstack/fibratus/cmd/fibratus/app/service" + "github.com/rabbitstack/fibratus/cmd/fibratus/app/stats" +) + +func registerCommands() { + RootCmd.AddCommand(capture.Command, replay.Command, service.Command, stats.Command, config.Command, list.Command, rules.Command, runCmd, docsCmd, versionCmd) +} diff --git a/cmd/fibratus/app/run_linux.go b/cmd/fibratus/app/run_linux.go new file mode 100644 index 000000000..58bb7d4bc --- /dev/null +++ b/cmd/fibratus/app/run_linux.go @@ -0,0 +1,55 @@ +//go:build linux + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package app + +import ( + "github.com/rabbitstack/fibratus/internal/bootstrap" + "github.com/rabbitstack/fibratus/pkg/config" + ver "github.com/rabbitstack/fibratus/pkg/util/version" + "github.com/spf13/cobra" +) + +var runCmd = &cobra.Command{ + Use: "run [filter]", + Short: "Bootstrap fibratus", + Aliases: []string{"start"}, + RunE: run, +} + +var cfg = config.NewWithOpts(config.WithRun()) + +func init() { + cfg.MustViperize(runCmd) +} + +func run(_ *cobra.Command, args []string) error { + ver.Set(version) + app, err := bootstrap.NewApp(cfg, bootstrap.WithSignals()) + if err != nil { + return err + } + if err := app.Run(args); err != nil { + _ = app.Shutdown() + return err + } + app.Wait() + return app.Shutdown() +} diff --git a/cmd/fibratus/main_linux.go b/cmd/fibratus/main_linux.go new file mode 100644 index 000000000..86ff331a3 --- /dev/null +++ b/cmd/fibratus/main_linux.go @@ -0,0 +1,31 @@ +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package main + +import ( + "os" + + "github.com/rabbitstack/fibratus/cmd/fibratus/app" +) + +func main() { + if err := app.RootCmd.Execute(); err != nil { + os.Exit(-1) + } +} diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index 1e5a52361..630b5f563 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/internal/bootstrap/bootstrap_linux.go b/internal/bootstrap/bootstrap_linux.go new file mode 100644 index 000000000..d07148135 --- /dev/null +++ b/internal/bootstrap/bootstrap_linux.go @@ -0,0 +1,66 @@ +//go:build linux + +/* + * Copyright 2021-2022 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package bootstrap + +import ( + "errors" + + "github.com/rabbitstack/fibratus/pkg/config" +) + +var ErrCaptureNotWired = errors.New("linux event capture is not wired yet") + +type App struct { + config *config.Config + evs *EventSourceControl +} + +type Option func(*opts) + +type opts struct{} + +func WithSignals() Option { + return func(*opts) {} +} + +func WithDebugPrivilege() Option { + return func(*opts) {} +} + +func NewApp(cfg *config.Config, options ...Option) (*App, error) { + if err := InitConfigAndLogger(cfg); err != nil { + return nil, err + } + return &App{config: cfg, evs: NewEventSourceControl(cfg)}, nil +} + +func (f *App) Run([]string) error { + if err := f.evs.Open(f.config); err != nil { + return err + } + return ErrCaptureNotWired +} + +func (*App) Wait() {} + +func (f *App) Shutdown() error { + return f.evs.Close() +} diff --git a/internal/bootstrap/source.go b/internal/bootstrap/source.go index 683ee22f9..05931d682 100644 --- a/internal/bootstrap/source.go +++ b/internal/bootstrap/source.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/internal/bootstrap/source_linux.go b/internal/bootstrap/source_linux.go new file mode 100644 index 000000000..9c6984c83 --- /dev/null +++ b/internal/bootstrap/source_linux.go @@ -0,0 +1,49 @@ +//go:build linux + +/* + * Copyright 2021-2022 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package bootstrap + +import ( + "github.com/rabbitstack/fibratus/pkg/config" +) + +type EventSourceControl struct { + evs *stubEventSource +} + +func NewEventSourceControl(*config.Config) *EventSourceControl { + return &EventSourceControl{evs: &stubEventSource{}} +} + +func (s *EventSourceControl) Open(cfg *config.Config) error { + return s.evs.Open(cfg) +} + +func (s *EventSourceControl) Close() error { + return s.evs.Close() +} + +type stubEventSource struct{} + +func (*stubEventSource) Open(*config.Config) error { + return nil +} + +func (*stubEventSource) Close() error { return nil } From ef171b1dd7cf91907ecd2f05617fd5401474166b Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 12:35:15 +0200 Subject: [PATCH 08/65] feat(event): Add Linux semantic event type identifiers --- pkg/callstack/callstack.go | 2 + pkg/callstack/callstack_linux.go | 27 ++++++++ pkg/callstack/colorize.go | 2 + pkg/cap/version/version_linux.go | 44 +++++++++++++ pkg/event/enum.go | 2 + pkg/event/enum_linux.go | 21 ++++++ pkg/event/flags.go | 2 + pkg/event/flags_linux.go | 40 ++++++++++++ pkg/event/metainfo_linux.go | 108 +++++++++++++++++++++++++++++++ pkg/event/types_linux.go | 105 ++++++++++++++++++++++++++++++ pkg/util/key/key_linux.go | 23 +++++++ 11 files changed, 376 insertions(+) create mode 100644 pkg/callstack/callstack_linux.go create mode 100644 pkg/cap/version/version_linux.go create mode 100644 pkg/event/enum_linux.go create mode 100644 pkg/event/flags_linux.go create mode 100644 pkg/event/metainfo_linux.go create mode 100644 pkg/event/types_linux.go create mode 100644 pkg/util/key/key_linux.go diff --git a/pkg/callstack/callstack.go b/pkg/callstack/callstack.go index 21f2298c1..2a0e9e63b 100644 --- a/pkg/callstack/callstack.go +++ b/pkg/callstack/callstack.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/callstack/callstack_linux.go b/pkg/callstack/callstack_linux.go new file mode 100644 index 000000000..b333f77f2 --- /dev/null +++ b/pkg/callstack/callstack_linux.go @@ -0,0 +1,27 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package callstack + +type Callstack []Frame + +type Frame struct { + PID uint32 +} diff --git a/pkg/callstack/colorize.go b/pkg/callstack/colorize.go index c49f7a1cc..f7e59c8da 100644 --- a/pkg/callstack/colorize.go +++ b/pkg/callstack/colorize.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/cap/version/version_linux.go b/pkg/cap/version/version_linux.go new file mode 100644 index 000000000..df2a03809 --- /dev/null +++ b/pkg/cap/version/version_linux.go @@ -0,0 +1,44 @@ +//go:build linux + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package version + +type Version uint16 + +const ( + EvtSecV1 Version = iota + 1 + EvtSecV2 +) + +const ( + ProcessSecV1 Version = iota + 1 + ProcessSecV2 + ProcessSecV3 + ProcessSecV4 +) + +const ( + HandleSecV1 Version = iota + 1 +) + +const ( + PESecV1 Version = iota + 1 + PESecV2 +) diff --git a/pkg/event/enum.go b/pkg/event/enum.go index e4cd47c44..326f81346 100644 --- a/pkg/event/enum.go +++ b/pkg/event/enum.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/enum_linux.go b/pkg/event/enum_linux.go new file mode 100644 index 000000000..ac2900f5c --- /dev/null +++ b/pkg/event/enum_linux.go @@ -0,0 +1,21 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event diff --git a/pkg/event/flags.go b/pkg/event/flags.go index 693a56ba1..8cd50dd01 100644 --- a/pkg/event/flags.go +++ b/pkg/event/flags.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/flags_linux.go b/pkg/event/flags_linux.go new file mode 100644 index 000000000..e035ff98d --- /dev/null +++ b/pkg/event/flags_linux.go @@ -0,0 +1,40 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import "strings" + +type ParamFlag struct { + Name string + Value uint64 +} + +type ParamFlags []ParamFlag + +func (flags ParamFlags) String(value uint64) string { + var names []string + for _, flag := range flags { + if value&flag.Value == flag.Value { + names = append(names, flag.Name) + } + } + return strings.Join(names, "|") +} diff --git a/pkg/event/metainfo_linux.go b/pkg/event/metainfo_linux.go new file mode 100644 index 000000000..2a607787a --- /dev/null +++ b/pkg/event/metainfo_linux.go @@ -0,0 +1,108 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import "slices" + +type Info struct { + Name string + Category Category + Description string +} + +var events = map[Type]Info{ + CreateProcess: {Name: "CreateProcess", Category: Process, Description: "Creates a new process"}, + Execve: {Name: "Execve", Category: Process, Description: "Executes a program"}, + TerminateProcess: {Name: "TerminateProcess", Category: Process, Description: "Terminates a process"}, + Exit: {Name: "Exit", Category: Process, Description: "Exits a process"}, + ProcessRundown: {Name: "ProcessRundown", Category: Process, Description: "Reports an existing process"}, + Clone: {Name: "Clone", Category: Process, Description: "Clones a process or thread"}, +} + +var types = map[string]Type{ + "CreateProcess": CreateProcess, + "Execve": Execve, + "TerminateProcess": TerminateProcess, + "Exit": Exit, + "ProcessRundown": ProcessRundown, + "Clone": Clone, +} + +func All() []Type { + return []Type{CreateProcess, Execve, TerminateProcess, Exit, Clone} +} + +func AllWithState() []Type { + return append(All(), ProcessRundown) +} + +func MaxTypeID() uint16 { + return uint16(slices.Max(AllWithState())) +} + +func TypeToEventInfo(typ Type) Info { + if info, ok := events[typ]; ok { + return info + } + return Info{Name: "N/A", Category: Unknown} +} + +func NameToType(name string) Type { + if typ, ok := types[name]; ok { + return typ + } + return UnknownType +} + +func NameToTypes(name string) []Type { + return []Type{NameToType(name)} +} + +func GetTypesMeta() []Info { + infos := make([]Info, 0, len(events)) + for _, info := range events { + infos = append(infos, info) + } + slices.SortFunc(infos, func(a, b Info) int { + if a.Category == b.Category { + if a.Name < b.Name { + return -1 + } + if a.Name > b.Name { + return 1 + } + return 0 + } + if a.Category < b.Category { + return -1 + } + return 1 + }) + return infos +} + +func GetTypesMetaIndexed() []Info { + return GetTypesMeta() +} + +func IsKnown(name string) bool { + return NameToType(name) != UnknownType +} diff --git a/pkg/event/types_linux.go b/pkg/event/types_linux.go new file mode 100644 index 000000000..91ef4be20 --- /dev/null +++ b/pkg/event/types_linux.go @@ -0,0 +1,105 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "github.com/rabbitstack/fibratus/pkg/util/colorizer" + "github.com/rabbitstack/fibratus/pkg/util/hashers" +) + +type Source uint8 + +const ( + SystemLogger Source = iota + SecurityTelemetryLogger +) + +type Type uint16 + +const ( + UnknownType Type = iota + CreateProcess + Execve + TerminateProcess + Exit + ProcessRundown + Clone +) + +func (t Type) String() string { + return TypeToEventInfo(t).Name +} + +func (t Type) Category() Category { + return TypeToEventInfo(t).Category +} + +func (t Type) Subcategory() Subcategory { + return None +} + +func (t Type) Description() string { + return TypeToEventInfo(t).Description +} + +func (t Type) Hash() uint32 { + if t == UnknownType { + return 0 + } + return hashers.FnvUint32([]byte(t.String())) +} + +func (t Type) Exists() bool { + return t != UnknownType && t.String() != "N/A" +} + +func (t Type) OnlyState() bool { + return t == ProcessRundown +} + +func (t Type) CanEnrichStack() bool { + return false +} + +func (t *Type) UnmarshalYAML(unmarshal func(interface{}) error) error { + var name string + if err := unmarshal(&name); err != nil { + return err + } + *t = NameToType(name) + return nil +} + +func (t Type) ID() uint { + return uint(t) +} + +func (t Type) Source() Source { + return SystemLogger +} + +func (t Type) color() string { + return colorizer.SpanBold(colorizer.White, t.String()) +} + +func (t Type) arrow() string { + return colorizer.SpanBold(colorizer.Gray, "› ") +} diff --git a/pkg/util/key/key_linux.go b/pkg/util/key/key_linux.go new file mode 100644 index 000000000..891a85fb1 --- /dev/null +++ b/pkg/util/key/key_linux.go @@ -0,0 +1,23 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package key + +var RegistryValueTypes = map[uint32]string{} From 13f58b7c10240074c39622a2f23aae85e5e424c6 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 12:35:18 +0200 Subject: [PATCH 09/65] feat(config): Add Linux event source configuration --- pkg/config/alertsender.go | 2 + pkg/config/config_linux.go | 125 +++++++++++++++++++++++++++ pkg/config/eventsource_linux.go | 101 ++++++++++++++++++++++ pkg/config/eventsource_linux_stub.go | 41 +++++++++ pkg/config/filters.go | 2 + pkg/config/filters_linux.go | 50 +++++++++++ pkg/config/output.go | 2 + pkg/config/schema_linux.go | 32 +++++++ pkg/config/transformer.go | 2 + 9 files changed, 357 insertions(+) create mode 100644 pkg/config/config_linux.go create mode 100644 pkg/config/eventsource_linux.go create mode 100644 pkg/config/eventsource_linux_stub.go create mode 100644 pkg/config/filters_linux.go create mode 100644 pkg/config/schema_linux.go diff --git a/pkg/config/alertsender.go b/pkg/config/alertsender.go index 06f033088..237b3fe97 100644 --- a/pkg/config/alertsender.go +++ b/pkg/config/alertsender.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go new file mode 100644 index 000000000..ecd0fd8c8 --- /dev/null +++ b/pkg/config/config_linux.go @@ -0,0 +1,125 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "os" + "path/filepath" + "strings" + + "github.com/rabbitstack/fibratus/pkg/util/log" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "github.com/spf13/viper" +) + +const configFile = "config-file" + +type Config struct { + EventSource EventSourceConfig `json:"eventsource" yaml:"eventsource"` + Filament FilamentConfig `json:"filament" yaml:"filament"` + API APIConfig `json:"api" yaml:"api"` + Log log.Config `json:"logging" yaml:"logging"` + Filters *Filters `json:"filters" yaml:"filters"` + ForwardMode bool `json:"forward" yaml:"forward"` + CapFile string `json:"cap.file" yaml:"cap.file"` + + flags *pflag.FlagSet + viper *viper.Viper + opts *Options +} + +type Options struct { + run bool + list bool + stats bool + validate bool +} + +type Option func(*Options) + +func WithRun() Option { return func(o *Options) { o.run = true } } +func WithList() Option { return func(o *Options) { o.list = true } } +func WithStats() Option { return func(o *Options) { o.stats = true } } +func WithValidate() Option { return func(o *Options) { o.validate = true } } + +func NewWithOpts(options ...Option) *Config { + opts := &Options{} + for _, option := range options { + option(opts) + } + v := viper.New() + v.AutomaticEnv() + v.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_")) + c := &Config{ + Filters: &Filters{}, + flags: new(pflag.FlagSet), + viper: v, + opts: opts, + } + c.flags.String(configFile, filepath.Join("/etc", "fibratus", "fibratus.yml"), "Indicates the location of the configuration file") + c.flags.String(filamentName, "", "Specifies the filament to execute") + c.flags.String(filamentPath, "", "Denotes the directory where filaments are located") + c.flags.String(transport, "localhost:8080", "Specifies the underlying transport protocol for the API HTTP server") + c.flags.Bool(rulesEnabled, true, "Indicates if the rule engine is enabled and rules loaded") + c.flags.StringSlice(rulesFromPaths, nil, "Comma-separated list of rules files") + c.flags.StringSlice(macrosFromPaths, nil, "Comma-separated list of macro files") + c.flags.StringSlice(rulesFromURLs, nil, "Comma-separated list of rules URL resources") + c.flags.Bool(matchAll, true, "Indicates if the match all strategy is enabled") + c.EventSource.AddFlags(c.flags) + c.Log.AddFlags(c.flags) + return c +} + +func (c *Config) MustViperize(cmd *cobra.Command) { + cmd.PersistentFlags().AddFlagSet(c.flags) + if err := c.viper.BindPFlags(cmd.PersistentFlags()); err != nil { + panic(err) + } +} + +func (c *Config) Init() error { + c.EventSource.initFromViper(c.viper) + c.Filament.initFromViper(c.viper) + c.API.initFromViper(c.viper) + c.Log.InitFromViper(c.viper) + c.Filters.initFromViper(c.viper) + c.ForwardMode = c.viper.GetBool("forward") + c.CapFile = c.viper.GetString("cap.file") + return nil +} + +func (c *Config) GetConfigFile() string { return c.viper.GetString(configFile) } +func (c *Config) File() string { return c.GetConfigFile() } +func (c *Config) GetFilters() []*FilterConfig { + if c.Filters == nil { + return nil + } + return c.Filters.filters +} +func (c *Config) TryLoadFile(file string) error { + c.viper.SetConfigFile(file) + return c.viper.ReadInConfig() +} +func (c *Config) Validate() error { return nil } +func (c *Config) IsCaptureSet() bool { return c.CapFile != "" } +func (c *Config) IsFilamentSet() bool { return c.Filament.Name != "" } +func (c *Config) ConfigExists() bool { _, err := os.Stat(c.File()); return err == nil } diff --git a/pkg/config/eventsource_linux.go b/pkg/config/eventsource_linux.go new file mode 100644 index 000000000..077ad62f7 --- /dev/null +++ b/pkg/config/eventsource_linux.go @@ -0,0 +1,101 @@ +//go:build linux && eventsource + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "github.com/rabbitstack/fibratus/pkg/event" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/rabbitstack/fibratus/pkg/util/bitmask" + "github.com/spf13/pflag" + "github.com/spf13/viper" +) + +const ( + enableProcessEvents = "eventsource.enable-process" + enableFileEvents = "eventsource.enable-file" + enableNetEvents = "eventsource.enable-net" + enableMemEvents = "eventsource.enable-mem" + excludedEvents = "eventsource.blacklist.events" + excludedImages = "eventsource.blacklist.images" +) + +type EventSourceConfig struct { + EnableProcessEvents bool `json:"enable-process" yaml:"enable-process"` + EnableFileIOEvents bool `json:"enable-file" yaml:"enable-file"` + EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` + EnableMemEvents bool `json:"enable-mem" yaml:"enable-mem"` + ExcludedEvents []string `json:"blacklist.events" yaml:"blacklist.events"` + ExcludedImages []string `json:"blacklist.images" yaml:"blacklist.images"` + + dropMasks *bitmask.Bitmask + allMasks *bitmask.Bitmask + excludedImages map[string]bool +} + +func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { + flags.Bool(enableProcessEvents, true, "Determines whether process events are collected") + flags.Bool(enableFileEvents, true, "Determines whether file events are collected") + flags.Bool(enableNetEvents, true, "Determines whether network events are collected") + flags.Bool(enableMemEvents, true, "Determines whether memory events are collected") + flags.StringSlice(excludedEvents, nil, "A list of event names to drop") + flags.StringSlice(excludedImages, nil, "A list of image names to drop") +} + +func (c *EventSourceConfig) initFromViper(v *viper.Viper) { + c.EnableProcessEvents = v.GetBool(enableProcessEvents) + c.EnableFileIOEvents = v.GetBool(enableFileEvents) + c.EnableNetEvents = v.GetBool(enableNetEvents) + c.EnableMemEvents = v.GetBool(enableMemEvents) + c.ExcludedEvents = v.GetStringSlice(excludedEvents) + c.ExcludedImages = v.GetStringSlice(excludedImages) + c.Init() +} + +func (c *EventSourceConfig) Init() { + c.dropMasks = bitmask.New() + c.allMasks = bitmask.New() + c.excludedImages = make(map[string]bool) + for _, name := range c.ExcludedEvents { + for _, typ := range event.NameToTypes(name) { + c.dropMasks.Set(typ.ID()) + } + } + for _, typ := range event.AllWithState() { + c.allMasks.Set(typ.ID()) + } + for _, name := range c.ExcludedImages { + c.excludedImages[name] = true + } +} + +func (c *EventSourceConfig) SetDropMask(typ event.Type) { c.dropMasks.Set(typ.ID()) } +func (c *EventSourceConfig) TestDropMask(typ event.Type) bool { + return c.dropMasks != nil && c.dropMasks.IsSet(typ.ID()) +} +func (c *EventSourceConfig) ExcludeEvent(id uint) bool { + return c.dropMasks != nil && c.dropMasks.IsSet(id) +} +func (c *EventSourceConfig) EventExists(id uint) bool { + return c.allMasks != nil && c.allMasks.IsSet(id) +} +func (c *EventSourceConfig) ExcludeImage(ps *pstypes.PS) bool { + return ps != nil && c.excludedImages[ps.Name] +} diff --git a/pkg/config/eventsource_linux_stub.go b/pkg/config/eventsource_linux_stub.go new file mode 100644 index 000000000..1b61dfc0a --- /dev/null +++ b/pkg/config/eventsource_linux_stub.go @@ -0,0 +1,41 @@ +//go:build linux && !eventsource + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "github.com/spf13/pflag" + "github.com/spf13/viper" +) + +type EventSourceConfig struct { + EnableProcessEvents bool + EnableFileIOEvents bool + EnableNetEvents bool + EnableMemEvents bool +} + +func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { + flags.Bool("eventsource.enable-process", true, "Determines whether process events are collected") +} + +func (c *EventSourceConfig) initFromViper(v *viper.Viper) { + c.EnableProcessEvents = v.GetBool("eventsource.enable-process") +} diff --git a/pkg/config/filters.go b/pkg/config/filters.go index 8226b2b7f..dd61ba9a7 100644 --- a/pkg/config/filters.go +++ b/pkg/config/filters.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2020-2021 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/filters_linux.go b/pkg/config/filters_linux.go new file mode 100644 index 000000000..3791cfdb7 --- /dev/null +++ b/pkg/config/filters_linux.go @@ -0,0 +1,50 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import "github.com/spf13/viper" + +const ( + rulesEnabled = "filters.rules.enabled" + rulesFromPaths = "filters.rules.from-paths" + rulesFromURLs = "filters.rules.from-urls" + macrosFromPaths = "filters.macros.from-paths" + matchAll = "filters.match-all" +) + +type FilterConfig struct{} + +type Filters struct { + Rules struct { + Enabled bool + FromPaths []string + FromURLs []string + } + MatchAll bool + filters []*FilterConfig +} + +func (f *Filters) initFromViper(v *viper.Viper) { + f.Rules.Enabled = v.GetBool(rulesEnabled) + f.Rules.FromPaths = v.GetStringSlice(rulesFromPaths) + f.Rules.FromURLs = v.GetStringSlice(rulesFromURLs) + f.MatchAll = v.GetBool(matchAll) +} diff --git a/pkg/config/output.go b/pkg/config/output.go index 80d1d86d8..66f56e14f 100644 --- a/pkg/config/output.go +++ b/pkg/config/output.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/schema_linux.go b/pkg/config/schema_linux.go new file mode 100644 index 000000000..6329e0a8b --- /dev/null +++ b/pkg/config/schema_linux.go @@ -0,0 +1,32 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import _ "embed" + +//go:embed config.schema.json +var configSchema string + +//go:embed rules.schema.json +var rulesSchema string + +//go:embed macros.schema.json +var macrosSchema string diff --git a/pkg/config/transformer.go b/pkg/config/transformer.go index 24b5df7d6..c2d6fb331 100644 --- a/pkg/config/transformer.go +++ b/pkg/config/transformer.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io From 40f1d5f0dd527ae7dc859f4b5ea54c4378cff0a0 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 12:35:25 +0200 Subject: [PATCH 10/65] refactor(ps): Introduce Resolver and Linux snapshotter --- pkg/ps/resolver.go | 25 +++++++ pkg/ps/types/types_linux.go | 127 ++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 pkg/ps/resolver.go create mode 100644 pkg/ps/types/types_linux.go diff --git a/pkg/ps/resolver.go b/pkg/ps/resolver.go new file mode 100644 index 000000000..67414c3d8 --- /dev/null +++ b/pkg/ps/resolver.go @@ -0,0 +1,25 @@ +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ps + +import pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + +type Resolver interface { + Find(pid uint32) (bool, *pstypes.PS) +} diff --git a/pkg/ps/types/types_linux.go b/pkg/ps/types/types_linux.go new file mode 100644 index 000000000..138ef02f8 --- /dev/null +++ b/pkg/ps/types/types_linux.go @@ -0,0 +1,127 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package types + +import ( + "fmt" + "strings" + "sync" + "time" + + "github.com/rabbitstack/fibratus/pkg/util/va" +) + +type PS struct { + sync.RWMutex + PID uint32 `json:"pid"` + Ppid uint32 `json:"ppid"` + Name string `json:"name"` + Cmdline string `json:"comm"` + Exe string `json:"exe"` + Cwd string `json:"cwd"` + Args []string `json:"args"` + StartTime time.Time `json:"started"` + StartBootTime uint64 `json:"start_boot_time"` + UID uint32 `json:"uid"` + GID uint32 `json:"gid"` + Username string `json:"username"` + Envs map[string]string `json:"envs"` + Parent *PS `json:"parent"` + Threads map[uint32]Thread `json:"-"` + Mmaps []Mmap `json:"mmaps"` + Modules []Module `json:"modules"` +} + +func (ps *PS) String() string { + return fmt.Sprintf("Pid: %d\nPpid: %d\nName: %s\nCmdline: %s\nExe: %s", ps.PID, ps.Ppid, ps.Name, ps.Cmdline, ps.Exe) +} + +func (ps *PS) StringShort() string { + return ps.String() +} + +func (ps *PS) Ancestors() []string { + var ancestors []string + Walk(func(parent *PS) { + ancestors = append(ancestors, fmt.Sprintf("%s (%d)", parent.Name, parent.PID)) + }, ps) + return ancestors +} + +type Thread struct { + Tid uint32 + Pid uint32 +} + +type Module struct { + Name string + BaseAddress va.Address + Size uint64 +} + +type Mmap struct { + BaseAddress va.Address + Size uint64 + Protection uint32 + Type string + File string +} + +func (m *Mmap) ProtectMask() string { + return "" +} + +func (ps *PS) AddThread(thread Thread) { + if ps.Threads == nil { + ps.Threads = make(map[uint32]Thread) + } + ps.Threads[thread.Tid] = thread +} + +func (ps *PS) RemoveThread(tid uint32) { + delete(ps.Threads, tid) +} + +func (ps *PS) AddMmap(mmap Mmap) { + ps.Mmaps = append(ps.Mmaps, mmap) +} + +func (ps *PS) RemoveMmap(addr va.Address) { + for i, mmap := range ps.Mmaps { + if mmap.BaseAddress == addr { + ps.Mmaps = append(ps.Mmaps[:i], ps.Mmaps[i+1:]...) + return + } + } +} + +func (ps *PS) FindMmap(addr va.Address) *Mmap { + for i := range ps.Mmaps { + if ps.Mmaps[i].BaseAddress == addr { + return &ps.Mmaps[i] + } + } + return nil +} + +func (ps *PS) IsSvchost() bool { + return strings.EqualFold(ps.Name, "svchost.exe") +} From cebca20d03d8c4ef86efb9116e44645ff5c5ebd0 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 12:35:27 +0200 Subject: [PATCH 11/65] fix(build): Gate remaining Windows-only packages for Linux builds --- cmd/fibratus/app/config/config.go | 2 + cmd/fibratus/app/config/config_linux.go | 25 +++++++++++++ cmd/fibratus/app/list/list.go | 2 + cmd/fibratus/app/list/list_linux.go | 25 +++++++++++++ cmd/fibratus/app/rules/create.go | 2 + cmd/fibratus/app/rules/list.go | 2 + cmd/fibratus/app/rules/rules.go | 2 + cmd/fibratus/app/rules/rules_linux.go | 25 +++++++++++++ cmd/fibratus/app/rules/validate.go | 2 + cmd/fibratus/app/stats/stats.go | 2 + cmd/fibratus/app/stats/stats_linux.go | 25 +++++++++++++ internal/evasion/config.go | 2 + internal/evasion/direct_syscall.go | 2 + internal/evasion/indirect_syscall.go | 2 + internal/evasion/scanner.go | 2 + pkg/filter/ql/functions/get_reg_value.go | 2 + .../ql/functions/get_reg_value_linux.go | 29 +++++++++++++++ pkg/util/log/logger.go | 2 + pkg/util/log/logger_linux.go | 37 +++++++++++++++++++ pkg/util/va/region.go | 2 + pkg/util/va/ws.go | 2 + 21 files changed, 196 insertions(+) create mode 100644 cmd/fibratus/app/config/config_linux.go create mode 100644 cmd/fibratus/app/list/list_linux.go create mode 100644 cmd/fibratus/app/rules/rules_linux.go create mode 100644 cmd/fibratus/app/stats/stats_linux.go create mode 100644 pkg/filter/ql/functions/get_reg_value_linux.go create mode 100644 pkg/util/log/logger_linux.go diff --git a/cmd/fibratus/app/config/config.go b/cmd/fibratus/app/config/config.go index 88810d92b..62679dd8a 100644 --- a/cmd/fibratus/app/config/config.go +++ b/cmd/fibratus/app/config/config.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/config/config_linux.go b/cmd/fibratus/app/config/config_linux.go new file mode 100644 index 000000000..01ea46121 --- /dev/null +++ b/cmd/fibratus/app/config/config_linux.go @@ -0,0 +1,25 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import "github.com/spf13/cobra" + +var Command = &cobra.Command{Use: "config", Short: "Show runtime config"} diff --git a/cmd/fibratus/app/list/list.go b/cmd/fibratus/app/list/list.go index 055795d7a..09b8741e9 100644 --- a/cmd/fibratus/app/list/list.go +++ b/cmd/fibratus/app/list/list.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/list/list_linux.go b/cmd/fibratus/app/list/list_linux.go new file mode 100644 index 000000000..c2c68dcfc --- /dev/null +++ b/cmd/fibratus/app/list/list_linux.go @@ -0,0 +1,25 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package list + +import "github.com/spf13/cobra" + +var Command = &cobra.Command{Use: "list", Short: "Show available Linux runtime information"} diff --git a/cmd/fibratus/app/rules/create.go b/cmd/fibratus/app/rules/create.go index c21dc3bbc..12f55f6cb 100644 --- a/cmd/fibratus/app/rules/create.go +++ b/cmd/fibratus/app/rules/create.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/rules/list.go b/cmd/fibratus/app/rules/list.go index 666af4f6d..525dd0217 100644 --- a/cmd/fibratus/app/rules/list.go +++ b/cmd/fibratus/app/rules/list.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/rules/rules.go b/cmd/fibratus/app/rules/rules.go index d925aa557..ca387bfdb 100644 --- a/cmd/fibratus/app/rules/rules.go +++ b/cmd/fibratus/app/rules/rules.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/rules/rules_linux.go b/cmd/fibratus/app/rules/rules_linux.go new file mode 100644 index 000000000..42ed7d2aa --- /dev/null +++ b/cmd/fibratus/app/rules/rules_linux.go @@ -0,0 +1,25 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package rules + +import "github.com/spf13/cobra" + +var Command = &cobra.Command{Use: "rules", Short: "Manage detection rules"} diff --git a/cmd/fibratus/app/rules/validate.go b/cmd/fibratus/app/rules/validate.go index 9ab621d04..56b2b227f 100644 --- a/cmd/fibratus/app/rules/validate.go +++ b/cmd/fibratus/app/rules/validate.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/stats/stats.go b/cmd/fibratus/app/stats/stats.go index 4232ee67a..d451593e5 100644 --- a/cmd/fibratus/app/stats/stats.go +++ b/cmd/fibratus/app/stats/stats.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/stats/stats_linux.go b/cmd/fibratus/app/stats/stats_linux.go new file mode 100644 index 000000000..3a5825847 --- /dev/null +++ b/cmd/fibratus/app/stats/stats_linux.go @@ -0,0 +1,25 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package stats + +import "github.com/spf13/cobra" + +var Command = &cobra.Command{Use: "stats", Short: "Show runtime statistics"} diff --git a/internal/evasion/config.go b/internal/evasion/config.go index 8832553f1..531fe4934 100644 --- a/internal/evasion/config.go +++ b/internal/evasion/config.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/internal/evasion/direct_syscall.go b/internal/evasion/direct_syscall.go index e7ef61a9c..6407389a3 100644 --- a/internal/evasion/direct_syscall.go +++ b/internal/evasion/direct_syscall.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/internal/evasion/indirect_syscall.go b/internal/evasion/indirect_syscall.go index a339b7e45..8a703ab0d 100644 --- a/internal/evasion/indirect_syscall.go +++ b/internal/evasion/indirect_syscall.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/internal/evasion/scanner.go b/internal/evasion/scanner.go index 26951f0fd..43babe8b5 100644 --- a/internal/evasion/scanner.go +++ b/internal/evasion/scanner.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/filter/ql/functions/get_reg_value.go b/pkg/filter/ql/functions/get_reg_value.go index ecdd934f8..8a67fed9b 100644 --- a/pkg/filter/ql/functions/get_reg_value.go +++ b/pkg/filter/ql/functions/get_reg_value.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/filter/ql/functions/get_reg_value_linux.go b/pkg/filter/ql/functions/get_reg_value_linux.go new file mode 100644 index 000000000..926363826 --- /dev/null +++ b/pkg/filter/ql/functions/get_reg_value_linux.go @@ -0,0 +1,29 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package functions + +type GetRegValue struct{} + +func (GetRegValue) Call([]interface{}) (interface{}, bool) { return nil, false } +func (GetRegValue) Desc() FunctionDesc { + return FunctionDesc{Name: GetRegValueFn} +} +func (GetRegValue) Name() Fn { return GetRegValueFn } diff --git a/pkg/util/log/logger.go b/pkg/util/log/logger.go index e02e6989e..452b15940 100644 --- a/pkg/util/log/logger.go +++ b/pkg/util/log/logger.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/util/log/logger_linux.go b/pkg/util/log/logger_linux.go new file mode 100644 index 000000000..cd20c902c --- /dev/null +++ b/pkg/util/log/logger_linux.go @@ -0,0 +1,37 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package log + +import "github.com/sirupsen/logrus" + +func InitFromConfig(c Config, _ string) error { + level, err := logrus.ParseLevel(c.Level) + if err != nil { + return err + } + logrus.SetLevel(level) + if c.Formatter == "json" { + logrus.SetFormatter(&logrus.JSONFormatter{}) + } else { + logrus.SetFormatter(&logrus.TextFormatter{DisableQuote: true}) + } + return nil +} diff --git a/pkg/util/va/region.go b/pkg/util/va/region.go index 648f10b45..5d6f268d7 100644 --- a/pkg/util/va/region.go +++ b/pkg/util/va/region.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/util/va/ws.go b/pkg/util/va/ws.go index f2a06c167..397b7b0ee 100644 --- a/pkg/util/va/ws.go +++ b/pkg/util/va/ws.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io From a3fdfce7049a2761108dff7e5c996fb965bc17c1 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 20:46:06 +0200 Subject: [PATCH 12/65] fix(build): Gate Windows-only packages for Linux compilation Move shared catalogs out of GOOS-auto-gated filenames, tag remaining Windows packages and tests, and split colorizer/ntstatus so Linux builds no longer pull golang.org/x/sys/windows. --- pkg/aggregator/aggregator.go | 1 - pkg/aggregator/imports_windows.go | 27 + pkg/alertsender/eventlog/config.go | 2 + pkg/alertsender/eventlog/eventlog.go | 2 + pkg/alertsender/eventlog/eventlog_test.go | 2 + pkg/alertsender/systray/config.go | 2 + pkg/alertsender/systray/systray.go | 2 + pkg/alertsender/systray/systray_test.go | 2 + pkg/config/eventsource_linux.go | 2 +- pkg/config/filters.go | 2 - pkg/config/filters_linux.go | 50 - pkg/config/output_test.go | 2 + pkg/config/print_test.go | 2 + pkg/config/transformer_test.go | 2 + pkg/event/batch_test.go | 2 + pkg/event/flags_test.go | 2 + pkg/event/formatter_test.go | 2 + pkg/event/marshaller_test.go | 2 + pkg/event/params/names.go | 302 ++++ pkg/event/params/param_types.go | 142 ++ pkg/event/queue_test.go | 2 + pkg/event/stackwalk.go | 2 + pkg/event/stackwalk_test.go | 2 + pkg/filter/fields/defs.go | 1304 +++++++++++++++++ pkg/filter/filter_test.go | 2 + pkg/filter/ql/functions/get_reg_value_test.go | 2 + pkg/filter/ql/functions/minidump.go | 2 + pkg/fs/file_class.go | 2 + pkg/pe/header.go | 2 + pkg/pe/header_test.go | 2 + pkg/pe/parser.go | 2 + pkg/pe/parser_test.go | 2 + pkg/rules/compiler_test.go | 2 + pkg/rules/engine_test.go | 2 + pkg/rules/sequence_test.go | 2 + pkg/sys/dbghelp.go | 2 + pkg/sys/device.go | 2 + pkg/sys/device_test.go | 2 + pkg/sys/doc.go | 2 + pkg/sys/fs.go | 2 + pkg/sys/handle.go | 2 + pkg/sys/mem.go | 2 + pkg/sys/object.go | 2 + pkg/sys/privilege.go | 2 + pkg/sys/process.go | 2 + pkg/sys/process_test.go | 2 + pkg/sys/rid.go | 2 + pkg/sys/shell.go | 2 + pkg/sys/syscall.go | 2 + pkg/sys/trust.go | 2 + pkg/sys/trust_test.go | 2 + pkg/sys/util.go | 2 + pkg/sys/window.go | 2 + pkg/sys/wts.go | 2 + pkg/sys/zsyscall_windows.go | 2 + pkg/util/colorizer/colorizer.go | 19 - pkg/util/colorizer/colorizer_stub.go | 23 + pkg/util/colorizer/colorizer_windows.go | 44 + pkg/util/eventlog/eventid.go | 2 + pkg/util/eventlog/eventid_test.go | 2 + pkg/util/eventlog/eventlog.go | 2 + .../ntstatus/status_linux.go} | 30 +- .../ntstatus/{status.go => status_windows.go} | 2 + 63 files changed, 1957 insertions(+), 91 deletions(-) create mode 100644 pkg/aggregator/imports_windows.go delete mode 100644 pkg/config/filters_linux.go create mode 100644 pkg/event/params/names.go create mode 100644 pkg/event/params/param_types.go create mode 100644 pkg/filter/fields/defs.go create mode 100644 pkg/util/colorizer/colorizer_stub.go create mode 100644 pkg/util/colorizer/colorizer_windows.go rename pkg/{config/eventsource_linux_stub.go => util/ntstatus/status_linux.go} (55%) rename pkg/util/ntstatus/{status.go => status_windows.go} (99%) diff --git a/pkg/aggregator/aggregator.go b/pkg/aggregator/aggregator.go index f1abfd045..78029d495 100644 --- a/pkg/aggregator/aggregator.go +++ b/pkg/aggregator/aggregator.go @@ -40,7 +40,6 @@ import ( _ "github.com/rabbitstack/fibratus/pkg/alertsender/eventlog" _ "github.com/rabbitstack/fibratus/pkg/alertsender/mail" _ "github.com/rabbitstack/fibratus/pkg/alertsender/slack" - _ "github.com/rabbitstack/fibratus/pkg/alertsender/systray" // initialize transformers _ "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/remove" diff --git a/pkg/aggregator/imports_windows.go b/pkg/aggregator/imports_windows.go new file mode 100644 index 000000000..e65eed8a7 --- /dev/null +++ b/pkg/aggregator/imports_windows.go @@ -0,0 +1,27 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package aggregator + +import ( + // initialize Windows-only outputs and alert senders + _ "github.com/rabbitstack/fibratus/pkg/alertsender/systray" + _ "github.com/rabbitstack/fibratus/pkg/outputs/eventlog" +) diff --git a/pkg/alertsender/eventlog/config.go b/pkg/alertsender/eventlog/config.go index d93d398d9..9960c11a5 100644 --- a/pkg/alertsender/eventlog/config.go +++ b/pkg/alertsender/eventlog/config.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2024 by Nedim Sabic Sabic and Contributors * https://www.fibratus.io diff --git a/pkg/alertsender/eventlog/eventlog.go b/pkg/alertsender/eventlog/eventlog.go index 6d855ea25..b3f71b9e3 100644 --- a/pkg/alertsender/eventlog/eventlog.go +++ b/pkg/alertsender/eventlog/eventlog.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2024 by Nedim Sabic Sabic and Contributors * https://www.fibratus.io diff --git a/pkg/alertsender/eventlog/eventlog_test.go b/pkg/alertsender/eventlog/eventlog_test.go index 7b765d7f2..fe48e0875 100644 --- a/pkg/alertsender/eventlog/eventlog_test.go +++ b/pkg/alertsender/eventlog/eventlog_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2024 by Nedim Sabic Sabic and Contributors * https://www.fibratus.io diff --git a/pkg/alertsender/systray/config.go b/pkg/alertsender/systray/config.go index a1c5d237c..5298f66f0 100644 --- a/pkg/alertsender/systray/config.go +++ b/pkg/alertsender/systray/config.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/alertsender/systray/systray.go b/pkg/alertsender/systray/systray.go index f0353ba7d..00bd2e4c1 100644 --- a/pkg/alertsender/systray/systray.go +++ b/pkg/alertsender/systray/systray.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/alertsender/systray/systray_test.go b/pkg/alertsender/systray/systray_test.go index 2d49821a4..47d55b63b 100644 --- a/pkg/alertsender/systray/systray_test.go +++ b/pkg/alertsender/systray/systray_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/eventsource_linux.go b/pkg/config/eventsource_linux.go index 077ad62f7..43e7476bd 100644 --- a/pkg/config/eventsource_linux.go +++ b/pkg/config/eventsource_linux.go @@ -1,4 +1,4 @@ -//go:build linux && eventsource +//go:build linux /* * Copyright 2026 by Nedim Sabic Sabic diff --git a/pkg/config/filters.go b/pkg/config/filters.go index dd61ba9a7..8226b2b7f 100644 --- a/pkg/config/filters.go +++ b/pkg/config/filters.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2020-2021 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/filters_linux.go b/pkg/config/filters_linux.go deleted file mode 100644 index 3791cfdb7..000000000 --- a/pkg/config/filters_linux.go +++ /dev/null @@ -1,50 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Nedim Sabic Sabic - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package config - -import "github.com/spf13/viper" - -const ( - rulesEnabled = "filters.rules.enabled" - rulesFromPaths = "filters.rules.from-paths" - rulesFromURLs = "filters.rules.from-urls" - macrosFromPaths = "filters.macros.from-paths" - matchAll = "filters.match-all" -) - -type FilterConfig struct{} - -type Filters struct { - Rules struct { - Enabled bool - FromPaths []string - FromURLs []string - } - MatchAll bool - filters []*FilterConfig -} - -func (f *Filters) initFromViper(v *viper.Viper) { - f.Rules.Enabled = v.GetBool(rulesEnabled) - f.Rules.FromPaths = v.GetStringSlice(rulesFromPaths) - f.Rules.FromURLs = v.GetStringSlice(rulesFromURLs) - f.MatchAll = v.GetBool(matchAll) -} diff --git a/pkg/config/output_test.go b/pkg/config/output_test.go index cc221014d..b3140db69 100644 --- a/pkg/config/output_test.go +++ b/pkg/config/output_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/print_test.go b/pkg/config/print_test.go index e5cf70478..036226c86 100644 --- a/pkg/config/print_test.go +++ b/pkg/config/print_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/transformer_test.go b/pkg/config/transformer_test.go index 9000fd3d0..eaed5b497 100644 --- a/pkg/config/transformer_test.go +++ b/pkg/config/transformer_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/batch_test.go b/pkg/event/batch_test.go index f82d6d91f..0cee1f9c9 100644 --- a/pkg/event/batch_test.go +++ b/pkg/event/batch_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/flags_test.go b/pkg/event/flags_test.go index 48e6351dd..4ce531ea7 100644 --- a/pkg/event/flags_test.go +++ b/pkg/event/flags_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/formatter_test.go b/pkg/event/formatter_test.go index 657dba714..42a2ae812 100644 --- a/pkg/event/formatter_test.go +++ b/pkg/event/formatter_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/marshaller_test.go b/pkg/event/marshaller_test.go index 2906b7f62..d6ad0202e 100644 --- a/pkg/event/marshaller_test.go +++ b/pkg/event/marshaller_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/params/names.go b/pkg/event/params/names.go new file mode 100644 index 000000000..cb269f02c --- /dev/null +++ b/pkg/event/params/names.go @@ -0,0 +1,302 @@ +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package params + +const ( + // NTStatus is the parameter that identifies the NTSTATUS value. + NTStatus = "status" + + // ProcessID represents the process identifier. + ProcessID = "pid" + // TargetProcessID represents the target process identifier. + TargetProcessID = "target_pid" + // ProcessObject field represents the address of the process object in the kernel. + ProcessObject = "kproc" + // ThreadID field represents the thread identifier. + ThreadID = "tid" + // Callstack field represents the thread callstack. + Callstack = "callstack" + // CallstackTimestamp field identifvies the callstack timestamp parameter. + CallstackTimestamp = "callstack_timestamp" + // ProcessParentID field represents the parent process identifier. + ProcessParentID = "ppid" + // ProcessRealParentID field presents the real parent process identifier. + ProcessRealParentID = "real_ppid" + // SessionID fields represents the session identifier. + SessionID = "session_id" + // UserSID field is the security identifier associated to the process token under which it is run. + UserSID = "sid" + // Username field represents the username under which the event was generated. + Username = "username" + // Domain field represents the domain under which the event was generated. + Domain = "domain" + // ProcessName field denotes the process Module name. + ProcessName = "name" + // Exe field denotes the full path of the executable. + Exe = "exe" + // Cmdline field represents the process command line. + Cmdline = "cmdline" + // DTB field denotes the address of the process directory table. + DTB = "directory_table_base" + // ProcessFlags field denotes the process creation flags + ProcessFlags = "flags" + // ExitStatus is the field that represents the process exit status. + ExitStatus = "exit_status" + // StartTime field denotes the process start time. + StartTime = "start_time" + // ProcessTokenIntegrityLevel field denotes the process integrity level. + ProcessTokenIntegrityLevel = "token_integrity_level" + // ProcessTokenElevationType field designates the process token elevation type. + ProcessTokenElevationType = "token_elevation_type" + // ProcessTokenIsElevated field designates if the process token is elevated. + ProcessTokenIsElevated = "token_is_elevated" + + // DesiredAccess field denotes the access rights for different kernel objects such as processes or threads. + DesiredAccess = "desired_access" + + // BasePrio field is the thread base priority assigned by the scheduler. + BasePrio = "base_prio" + // IOPrio represents the filed that indicates the thread I/O priority. + IOPrio = "io_prio" + // PagePrio field denotes page priority. + PagePrio = "page_prio" + // KstackBase field is the start address of the kernel space stack. + KstackBase = "kstack" + // KstackLimit field is the end address of the kernel space stack. + KstackLimit = "kstack_limit" + // UstackBase field is the start address of the user space stack. + UstackBase = "ustack" + // UstackLimit field is the end address of the user space stack. + UstackLimit = "ustack_limit" + // StartAddress field is the thread start address. + StartAddress = "start_address" + // StartAddressSymbol field is the symbol associated with the thread start address. + StartAddressSymbol = "start_address_symbol" + // StartAddressModule field is the module where the thread start address is mapped. + StartAddressModule = "start_address_module" + // TEB field is the address of the Thread Environment Block (TEB) + TEB = "teb" + + // FileObject determines the field name for the file object pointer. + FileObject = "file_object" + // FilePath represents the field that designates the absolute path of the file. + FilePath = "file_path" + // FileCreateOptions is the field that represents the values passed in the CreateDispositions parameter to the NtCreateFile function. + FileCreateOptions = "create_options" + // FileOperation is the field that represents the values passed in the CreateOptions parameter to the NtCreateFile function. + FileOperation = "create_disposition" + // FileCreated represents the name for the file creation field. + FileCreated = "created" + // FileAccessed represents the name for the file access field. + FileAccessed = "accessed" + // FileModified represents the name for the file modification field. + FileModified = "modified" + // FileShareMask represents the field name for the share access mask. + FileShareMask = "share_mask" + // FileType represents the field name that indicates the file type. + FileType = "type" + // FileAttributes is the field that represents file attribute values. + FileAttributes = "attributes" + // FileIoSize is the filed that represents the number of bytes in file read/write operations. + FileIoSize = "io_size" + // FileOffset represents the file for the file offset in read/write operations. + FileOffset = "offset" + // FileInfoClass represents the file information class. + FileInfoClass = "class" + // FileKey represents the directory key identifier in EnumDirectory events. + FileKey = "file_key" + // FileDirectory represents the field for the directory name in EnumDirectory events. + FileDirectory = "directory" + // FileIrpPtr represents the I/O request packet id. + FileIrpPtr = "irp" + // FileExtraInfo is the parameter that represents extra information returned by the file system for the operation. For example for a read request, the actual number of bytes that were read. + FileExtraInfo = "extra_info" + // FileIsDLL is the parameter that indicates if the file is a DLL + FileIsDLL = "is_dll" + // FileIsDriver is the parameter that indicates if the file is a driver + FileIsDriver = "is_driver" + // FileIsExecutable is the parameter that indicates if the file is an executable + FileIsExecutable = "is_exec" + // FileIsDotnet is the parameter that indicates if the file is a .NET assembly + FileIsDotnet = "is_dotnet" + + // FileViewBase is the parameter that represents the base address of the mapped section. + FileViewBase = "view_base" + // FileViewSize is the parameter that represents the size of the mapped section. + FileViewSize = "view_size" + // FileViewSectionType is the parameter that represents the mapped section type. + FileViewSectionType = "section_type" + + // RegKeyHandle identifies the parameter name for the registry key handle. + RegKeyHandle = "key_handle" + // RegKCB identifies the parameter name for the registry key control block. + RegKCB = "kcb" + // RegPath represents the parameter name for the fully qualified key path. + RegPath = "key_path" + // RegValue identifies the parameter name that contains the value + RegValue = "value" + // RegValueType identifies the parameter that represents registry value type e.g (DWORD, BINARY) + RegValueType = "value_type" + // RegData identifies the parameter that stores the captured registry data + RegData = "data" + + // ModuleBase identifies the parameter name for the base address of the process in which the Mmdule is loaded. + ModuleBase = "base_address" + // ModuleSize represents the parameter name for the size of the module in bytes. + ModuleSize = "module_size" + // ModuleCheckSum is the parameter name for module checksum. + ModuleCheckSum = "checksum" + // ModuleTimeDateStamp is the parametter name for module timedate stamp. + ModuleTimeDateStamp = "timedate_stamp" + // ModuleDefaultBase is the parameter name that represents module's base address. + ModuleDefaultBase = "default_address" + // ModulePath is the parameter name that denotes the file path and extension of the DLL/executable Module. + ModulePath = "file_path" + // ModuleSignatureLevel is the parameter denoting the loaded module signature level. + ModuleSignatureLevel = "signature_level" + // ModuleSignatureType is the parameter denoting the loaded module signature type. + ModuleSignatureType = "signature_type" + // ModuleCertSubject is the parameter that indicates the subject of the certificate is the entity its public key is associated with. + ModuleCertSubject = "cert_subject" + // ModuleCertIssuer is the parameter that represents the certificate authority (CA). + ModuleCertIssuer = "cert_issuer" + // ModuleCertSerial is the parameter that represents the serial number MUST be a positive integer assigned + // by the CA to each certificate. + ModuleCertSerial = "cert_serial" + // ModuleCertNotBefore is the parameter that specifies the certificate won't be valid before this timestamp. + ModuleCertNotBefore = "cert_not_before" + // ModuleCertNotAfter is the parameter that specifies the certificate won't be valid after this timestamp. + ModuleCertNotAfter = "cert_not_after" + + // NetSize identifies the parameter name that represents the packet size. + NetSize = "size" + // NetDIP is the parameter name that denotes the destination IP address. + NetDIP = "dip" + // NetSIP is the parameter name that denotes the source IP address. + NetSIP = "sip" + // NetDport identifies the parameter name that represents destination port number. + NetDport = "dport" + // NetSport identifies the parameter name that represents source port number. + NetSport = "sport" + // NetMSS is the parameter name that represents the maximum TCP segment size. + NetMSS = "mss" + // NetRcvWin is the parameter name that represents TCP segment's receive window size. + NetRcvWin = "rcvwin" + // NetSAckopt is the parameter name that represents Selective Acknowledgment option in TCP header. + NetSAckopt = "sack_opt" + // NetTsopt is the parameter name that represents the time stamp option in TCP header. + NetTsopt = "timestamp_opt" + // NetWsopt is the parameter name that represents the window scale option in TCP header. + NetWsopt = "window_scale_opt" + // NetRcvWinScale is the parameter name that represents the TCP receive window scaling factor. + NetRcvWinScale = "recv_winscale" + // NetSendWinScale is the parameter name that represents the TCP send window scaling factor. + NetSendWinScale = "send_winscale" + // NetSeqNum is the parameter name that represents the TCP sequence number. + NetSeqNum = "seqnum" + // NetStartTime is the parameter name that represents the TCP start time. + NetStartTime = "start_time" + // NetEndTime is the parameter name that represents the TCP end time. + NetEndTime = "end_time" + // NetConnID is the parameter name that represents a unique connection identifier. + NetConnID = "connid" + // NetL4Proto is the parameter name that identifies the Layer 4 protocol name. + NetL4Proto = "l4_proto" + // NetDportName is the field that denotes the destination port name. + NetDportName = "dport_name" + // NetSportName is the field that denotes the source port name. + NetSportName = "sport_name" + // NetSIPNames is the field that denotes the source IP address names. + NetSIPNames = "sip_names" + // NetDIPNames is the field that denotes the destination IP address names. + NetDIPNames = "dip_names" + + // DNSName is the field that represents the DNS query name + DNSName = "name" + // DNSRR is the field that represents the DNS record type + DNSRR = "rr" + // DNSOpts is the field that represents the DNS options + DNSOpts = "options" + // DNSRcode is the field that represents the DNS response code + DNSRcode = "rcode" + // DNSAnswers is the field that represents DNS response answers + DNSAnswers = "answers" + + // HandleID identifies the parameter that specifies the handle identifier. + HandleID = "handle_id" + // HandleSourceID identifies the parameter that specifies the source handle identifier. + HandleSourceID = "handle_source_id" + // HandleObject identifies the parameter that represents the kernel object to which handle is associated. + HandleObject = "handle_object" + // HandleObjectName identifies the parameter that represents the kernel object name. + HandleObjectName = "handle_name" + // HandleObjectTypeID identifies the parameter that represents the kernel object type identifier. + HandleObjectTypeID = "type_id" + + // MemBaseAddress identifies the parameter that denotes the allocation base address. + MemBaseAddress = "base_address" + // MemRegionSize identifies the parameter that represents the allocated region size. + MemRegionSize = "region_size" + // MemAllocType identifies the parameter that represents allocation flags. + MemAllocType = "alloc_type" + // MemProtect identifies the parameter that represents the memory protection for the range of pages. + MemProtect = "protection" + // MemProtectMask identifies the parameter that represents the memory protection in mask notation + MemProtectMask = "protection_mask" + // MemPageType identifies the parameter that represents the allocated region type. + MemPageType = "page_type" + + // LinkSource identifies the parameter that represents the source symbolic link object or other kernel object + LinkSource = "source" + // LinkTarget identifies the parameter that represents the target symbolic link object or other kernel object + LinkTarget = "target" + + // ThreadpoolPoolID represents the thread pool identifier. + ThreadpoolPoolID = "pool_id" + // ThreadpoolTaskID represents the thread pool task identifier. + ThreadpoolTaskID = "task_id" + // ThreadpoolCallback represents the address of the callback function. + ThreadpoolCallback = "callback" + // ThreadpoolCallbackSymbol represents the callback symbol. + ThreadpoolCallbackSymbol = "callback_symbol" + // ThreadpoolCallbackModule represents the module containing the callback symbol. + ThreadpoolCallbackModule = "callback_module" + // ThreadpoolContext represents the address of the callback context. + ThreadpoolContext = "context" + // ThreadpoolContextRip represents the value of instruction pointer contained in the callback context. + ThreadpoolContextRip = "context_rip" + // ThreadpoolContextRipSymbol represents the symbol name associated with the instruction pointer in callback context. + ThreadpoolContextRipSymbol = "context_rip_symbol" + // ThreadpoolContextRipModule represents the module name associated with the instruction pointer in callback context. + ThreadpoolContextRipModule = "context_rip_module" + // ThreadpoolSubprocessTag represents the service identifier associated with the thread pool. + ThreadpoolSubprocessTag = "subprocess_tag" + // ThreadpoolTimerDuetime represents the timer due time. + ThreadpoolTimerDuetime = "duetime" + // ThreadpoolTimerSubqueue represents the memory address of the timer subqueue. + ThreadpoolTimerSubqueue = "subqueue" + // ThreadpoolTimer represents the memory address of the timer object. + ThreadpoolTimer = "timer" + // ThreadpoolTimerPeriod represents the period of the timer + ThreadpoolTimerPeriod = "period" + // ThreadpoolTimerWindow represents the timer tolerate period. + ThreadpoolTimerWindow = "window" + // ThreadpoolTimerAbsolute indicates if the timer is absolute or relative. + ThreadpoolTimerAbsolute = "absolute" +) diff --git a/pkg/event/params/param_types.go b/pkg/event/params/param_types.go new file mode 100644 index 000000000..aec8c363d --- /dev/null +++ b/pkg/event/params/param_types.go @@ -0,0 +1,142 @@ +/* + * Copyright 2021-present by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package params + +// Type defines event parameter type +type Type uint16 + +const ( + // Null is a null parameter type + Null Type = iota + // UnicodeString a string of 16-bit characters. By default, assumed to have been encoded using UTF-16LE + UnicodeString + // AnsiString a string of 8-bit characters + AnsiString + // Int8 a signed 8-bit integer + Int8 + // Uint8 an unsigned 8-bit integer + Uint8 + // Int16 a signed 16-bit integer + Int16 + // Uint16 an unsigned 16-bit integer + Uint16 + // Int32 a signed 32-bit integer + Int32 + // Uint32 an unsigned 32-bit integer + Uint32 + // Int64 a signed 64-bit integer + Int64 + // Uint64 an unsigned 64-bit integer + Uint64 + // Float an IEEE 4-byte floating-point number + Float + // Double an IEEE 8-byte floating-point number + Double + // Bool a 32-bit value where 0 is false and 1 is true + Bool + // Binary is a binary data of variable size. The size must be specified in the data definition as a constant or a reference to another (integer) data item.For an IP V6 address, the data should be an IN6_ADDR structure. + // For a socket address, the data should be a SOCKADDR_STORAGE structure. The AF_INET, AF_INET6, and AF_LINK address families are supported + Binary + // GUID is a GUID structure. On output, the GUID is rendered in the registry string form, {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} + GUID + // Pointer an unsigned 32-bit or 64-bit pointer value. The size depends on the architecture of the computer logging the event + Pointer + // SID a security identifier (SID) structure that uniquely identifies a user or group + SID + // PID is the process identifier + PID + // TID is the thread identifier + TID + // WbemSID is the Web-Based Enterprise Management security identifier. + WbemSID + // Port represents the endpoint port number + Port + // IP is the IP address + IP + // IPv4 is the IPv4 address + IPv4 + // IPv6 is the IPv6 address + IPv6 + // Time represents the timestamp + Time + // Slice represents a collection of items + Slice + // Enum represents an enumeration + Enum + // Map represents a map + Map + // Object is the generic object type + Object + // DOSPath represents the file system path in DOS device notation + DOSPath + // Path represents the file system path with normalized drive letter notation + Path + // Status represents the system error code message + Status + // Key represents the registry key + Key + // Flags represents a bitmask of flags + Flags + // Flags64 represents an extended (64 bits) bitmask of flags + Flags64 + // Address is the memory address reference + Address + // HandleType represents the handle type such as Mutex or File + HandleType +) + +// String return the type string representation. +func (t Type) String() string { + switch t { + case UnicodeString: + return "unicode" + case AnsiString: + return "ansi" + case Int8: + return "int8" + case Uint8: + return "uint8" + case Int16: + return "int16" + case Uint16: + return "uint16" + case Int32: + return "int32" + case Uint32: + return "uint32" + case Int64: + return "int64" + case Uint64: + return "uint64" + case SID, WbemSID: + return "sid" + case TID: + return "tid" + case PID: + return "pid" + case Port: + return "port" + case IPv6: + return "ipv6" + case IPv4: + return "ipv4" + default: + return "unknown" + } +} diff --git a/pkg/event/queue_test.go b/pkg/event/queue_test.go index c1ab2345b..7c4f9087a 100644 --- a/pkg/event/queue_test.go +++ b/pkg/event/queue_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/stackwalk.go b/pkg/event/stackwalk.go index c6a7fb7ae..0c40daf8d 100644 --- a/pkg/event/stackwalk.go +++ b/pkg/event/stackwalk.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/stackwalk_test.go b/pkg/event/stackwalk_test.go index 285070555..c624151a8 100644 --- a/pkg/event/stackwalk_test.go +++ b/pkg/event/stackwalk_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/filter/fields/defs.go b/pkg/filter/fields/defs.go new file mode 100644 index 000000000..5743682ce --- /dev/null +++ b/pkg/filter/fields/defs.go @@ -0,0 +1,1304 @@ +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package fields + +import ( + "strings" + "unicode" + + "github.com/rabbitstack/fibratus/pkg/event/params" +) + +// Field represents the type alias for the field +type Field string + +const ( + // PsPid represents the process id field + PsPid Field = "ps.pid" + // PsPpid represents the parent process id field + PsPpid Field = "ps.ppid" + // PsName represents the process name field + PsName Field = "ps.name" + // PsComm represents the process command line field. Deprecated. + PsComm Field = "ps.comm" + // PsCmdline represents the process command line field + PsCmdline Field = "ps.cmdline" + // PsExe represents the process image path field + PsExe Field = "ps.exe" + // PsArgs represents the process command line arguments + PsArgs Field = "ps.args" + // PsCwd represents the process current working directory + PsCwd Field = "ps.cwd" + // PsSID represents the process security identifier + PsSID Field = "ps.sid" + // PsDomain represents the process domain field + PsDomain Field = "ps.domain" + // PsUsername represents the process username field + PsUsername Field = "ps.username" + // PsSessionID represents the session id bound to the process + PsSessionID Field = "ps.sessionid" + // PsEnvs represents the process environment variables + PsEnvs Field = "ps.envs" + // PsHandleNames represents the process handles + PsHandleNames Field = "ps.handles" + // PsHandleTypes represents the process handle types + PsHandleTypes Field = "ps.handle.types" + // PsDTB represents the process directory table base address + PsDTB Field = "ps.dtb" + // PsModuleNames represents the process module file names + PsModuleNames Field = "ps.modules" + // PsParentPid represents the parent process identifier field + PsParentPid Field = "ps.parent.pid" + // PsParentName represents the parent process name field + PsParentName Field = "ps.parent.name" + // PsParentComm represents the parent process command line field. Deprecated + PsParentComm Field = "ps.parent.comm" + // PsParentCmdline represents the parent process command line field + PsParentCmdline Field = "ps.parent.cmdline" + // PsParentExe represents the parent process image path field + PsParentExe Field = "ps.parent.exe" + // PsParentArgs represents the parent process command line arguments field + PsParentArgs Field = "ps.parent.args" + // PsParentCwd represents the parent process current working directory field + PsParentCwd Field = "ps.parent.cwd" + // PsParentSID represents the parent process security identifier field + PsParentSID Field = "ps.parent.sid" + // PsParentUsername represents the parent process username field + PsParentUsername Field = "ps.parent.username" + // PsParentDomain represents the parent process domain field + PsParentDomain Field = "ps.parent.domain" + // PsParentSessionID represents the session id field bound to the parent process + PsParentSessionID Field = "ps.parent.sessionid" + // PsParentEnvs represents the parent process environment variables field + PsParentEnvs Field = "ps.parent.envs" + // PsParentHandles represents the parent process handles field + PsParentHandles Field = "ps.parent.handles" + // PsParentHandleTypes represents the parent process handle types field + PsParentHandleTypes Field = "ps.parent.handle.types" + // PsParentDTB represents the parent process directory table base address field + PsParentDTB Field = "ps.parent.dtb" + // PsAncestor represents the process ancestor field + PsAncestor Field = "ps.ancestor" + // PsAccessMask represents the process access rights field + PsAccessMask Field = "ps.access.mask" + // PsAccessMaskNames represents the process access rights list field + PsAccessMaskNames Field = "ps.access.mask.names" + // PsAccessStatus represents the process access status field + PsAccessStatus Field = "ps.access.status" + // PsIsWOW64Field represents the field that indicates if the 32-bit process is created in 64-bit Windows system + PsIsWOW64Field Field = "ps.is_wow64" + // PsIsPackagedField represents the field that indicates if a process is packaged with the MSIX technology + PsIsPackagedField Field = "ps.is_packaged" + // PsIsProtectedField represents the field that indicates if the process is to be run as a protected process + PsIsProtectedField Field = "ps.is_protected" + // PsParentIsWOW64Field represents the field that indicates if the 32-bit process is created in 64-bit Windows system + PsParentIsWOW64Field Field = "ps.parent.is_wow64" + // PsParentIsPackagedField represents the field that indicates if a process is packaged with the MSIX technology + PsParentIsPackagedField Field = "ps.parent.is_packaged" + // PsParentIsProtectedField represents the field that indicates if the process is to be run as a protected process + PsParentIsProtectedField Field = "ps.parent.is_protected" + // PsUUID represents the unique process identifier + PsUUID Field = "ps.uuid" + // PsParentUUID represents the unique parent process identifier + PsParentUUID Field = "ps.parent.uuid" + // PsTokenIntegrityLevel represents the field that indicates the current process integrity level + PsTokenIntegrityLevel = "ps.token.integrity_level" + // PsTokenIsElevated represents the field that indicates if the current process token is elevated + PsTokenIsElevated = "ps.token.is_elevated" + // PsTokenElevationType represents the field that indicates if the current process token elevation type + PsTokenElevationType = "ps.token.elevation_type" + // PsParentTokenIntegrityLevel represents the field that indicates the parent process integrity level + PsParentTokenIntegrityLevel = "ps.parent.token.integrity_level" + // PsParentTokenIsElevated represents the field that indicates if the parent process token is elevated + PsParentTokenIsElevated = "ps.parent.token.is_elevated" + // PsTokenElevationType represents the field that indicates if the parent process token elevation type + PsParentTokenElevationType = "ps.parent.token.elevation_type" + // PsSignatureExists is the field which indicates if the binary is signed, either by embedded or catalog signature + PsSignatureExists Field = "ps.signature.exists" + // PsSignatureTrusted is the field which indicates if the binary signature is trusted + PsSignatureTrusted Field = "ps.signature.trusted" + // PsSignatureIssuer is the field which indicates the certificate issuer + PsSignatureIssuer Field = "ps.signature.issuer" + // PsSignatureSubject is the field which indicates the certificate subject + PsSignatureSubject Field = "ps.signature.subject" + // PsSignatureSerial is the field which indicates the certificate serial + PsSignatureSerial Field = "ps.signature.serial" + // PsSignatureAfter is the field which indicates the timestamp after certificate is no longer valid + PsSignatureAfter Field = "ps.signature.after" + // PsSignatureBefore is the field which indicates the timestamp of the certificate enrollment date + PsSignatureBefore Field = "ps.signature.before" + + // PsPeNumSections represents the number of sections + PsPeNumSections Field = "ps.pe.nsections" + // PsPeNumSymbols represents the number of exported symbols + PsPeNumSymbols Field = "ps.pe.nsymbols" + // PsPeSymbols represents imported symbols + PsPeSymbols Field = "ps.pe.symbols" + // PeImports represents imported libraries (e.g. kernel32.dll) + PsPeImports Field = "ps.pe.imports" + // PeTimestamp is the PE build timestamp + PsPeTimestamp Field = "ps.pe.timestamp" + // PeBaseAddress represents the base address when the binary is loaded + PsPeBaseAddress Field = "ps.pe.address.base" + // PeEntrypoint is the address of the entrypoint function + PsPeEntrypoint Field = "ps.pe.address.entrypoint" + // PeResources represents PE resources + PsPeResources Field = "ps.pe.resources" + // PeCompany represents the company name resource + PsPeCompany Field = "ps.pe.company" + // PeDescription represents the internal description of the file + PsPeDescription Field = "ps.pe.description" + // PeFileVersion represents the internal file version + PsPeFileVersion Field = "ps.pe.file.version" + // PeFileName represents the original file name provided at compile-time. + PsPeFileName Field = "ps.pe.file.name" + // PeCopyright represents the copyright notice emitted at compile-time + PsPeCopyright Field = "ps.pe.copyright" + // PeProduct represents the product name provided at compile-time + PsPeProduct Field = "ps.pe.product" + // PeProductVersion represents the internal product version provided at compile-time + PsPeProductVersion Field = "ps.pe.product.version" + // PeAnomalies represents the field that contains PE anomalies detected during parsing + PsPeAnomalies Field = "ps.pe.anomalies" + // PsPeImphash is the field that yields the PE import hash + PsPeImphash Field = "ps.pe.imphash" + // PsPeIsDotnet is the field which indicates if the binary contains the .NET assembly + PsPeIsDotnet Field = "ps.pe.is_dotnet" + // PsPeIsModified is the field that indicates whether disk and in-memory PE headers differ + PsPeIsModified Field = "ps.pe.is_modified" + + // ThreadBasePrio is the base thread priority + ThreadBasePrio Field = "thread.prio" + // ThreadIOPrio is the thread I/O priority + ThreadIOPrio Field = "thread.io.prio" + // ThreadPagePrio is the thread page priority + ThreadPagePrio Field = "thread.page.prio" + // ThreadKstackBase is the thread kernel stack start address + ThreadKstackBase Field = "thread.kstack.base" + // ThreadKstackLimit is the thread kernel stack end address + ThreadKstackLimit Field = "thread.kstack.limit" + // ThreadUstackBase is the thread user stack start address + ThreadUstackBase Field = "thread.ustack.base" + // ThreadUstackLimit is the thead user stack end address + ThreadUstackLimit Field = "thread.ustack.limit" + // ThreadEntrypoint is the thread entrypoint address + ThreadEntrypoint Field = "thread.entrypoint" + // ThreadStartAddress is the thread start address + ThreadStartAddress Field = "thread.start_address" + // ThreadPID is the process identifier where the thread is created + ThreadPID Field = "thread.pid" + // ThreadTEB is the thread environment block base address + ThreadTEB Field = "thread.teb_address" + // ThreadAccessMask represents the thread access rights field + ThreadAccessMask Field = "thread.access.mask" + // ThreadAccessMaskNames represents the thread access rights list field + ThreadAccessMaskNames Field = "thread.access.mask.names" + // ThreadAccessStatus represents the thread access status field + ThreadAccessStatus Field = "thread.access.status" + // ThreadCallstackSummary represents the thread callstack summary field + ThreadCallstackSummary Field = "thread.callstack.summary" + // ThreadCallstackKernelSummary represents the kernel thread callstack summary field + ThreadCallstackKernelSummary Field = "thread.callstack.kernel_summary" + // ThreadCallstackDetail represents the thread callstack detail field + ThreadCallstackDetail Field = "thread.callstack.detail" + // ThreadCallstackModules represents the callstack modules field + ThreadCallstackModules Field = "thread.callstack.modules" + // ThreadCallstackSymbols represents the callstack symbols field + ThreadCallstackSymbols Field = "thread.callstack.symbols" + // ThreadCallstackProtections represents the callstack region protections field + ThreadCallstackProtections Field = "thread.callstack.protections" + // ThreadCallstackAllocationSizes represents the private region page sizes field + ThreadCallstackAllocationSizes Field = "thread.callstack.allocation_sizes" + // ThreadCallstackCallsiteLeadingAssembly represents the callsite prelude opcodes field + ThreadCallstackCallsiteLeadingAssembly Field = "thread.callstack.callsite_leading_assembly" + // ThreadCallstackCallsiteTrailingAssembly represents the callsite postlude opcodes field + ThreadCallstackCallsiteTrailingAssembly Field = "thread.callstack.callsite_trailing_assembly" + // ThreadCallstackIsUnbacked represents the field that indicates if there is an unbacked stack frame + ThreadCallstackIsUnbacked Field = "thread.callstack.is_unbacked" + // ThreadStartAddressSymbol represents the symbol corresponding to the thread start address + ThreadStartAddressSymbol Field = "thread.start_address.symbol" + // ThreadStartAddressModule represents the module corresponding to the thread start address + ThreadStartAddressModule Field = "thread.start_address.module" + // ThreadCallstackAddresses represents the all callstack return addresses + ThreadCallstackAddresses Field = "thread.callstack.addresses" + // ThreadCallstackFinalUserModuleName represents the final user space stack frame module name + ThreadCallstackFinalUserModuleName Field = "thread.callstack.final_user_module.name" + // ThreadCallstackFinalUserModulePath represents the final user space stack frame module path + ThreadCallstackFinalUserModulePath Field = "thread.callstack.final_user_module.path" + // ThreadCallstackFinalUserSymbolName represents the final user space stack frame symbol name + ThreadCallstackFinalUserSymbolName Field = "thread.callstack.final_user_symbol.name" + // ThreadCallstackFinalKernelModuleName represents the final kernel space stack frame module name + ThreadCallstackFinalKernelModuleName Field = "thread.callstack.final_kernel_module.name" + // ThreadCallstackFinalKernelModulePath represents the final kernel space stack frame module name + ThreadCallstackFinalKernelModulePath Field = "thread.callstack.final_kernel_module.path" + // ThreadCallstackFinalKernelSymbolName represents the final kernel space stack frame symbol name + ThreadCallstackFinalKernelSymbolName Field = "thread.callstack.final_kernel_symbol.name" + // ThreadCallstackFinalUserModuleSignatureExists represents the signature status of the final user space stack frame module + ThreadCallstackFinalUserModuleSignatureExists Field = "thread.callstack.final_user_module.signature.exists" + // ThreadCallstackFinalUserModuleSignatureTrusted represents the trust status of the final user space stack frame module signature + ThreadCallstackFinalUserModuleSignatureTrusted Field = "thread.callstack.final_user_module.signature.trusted" + // ThreadCallstackFinalUserModuleSignatureIssuer represents the final user space stack frame module certificate issuer + ThreadCallstackFinalUserModuleSignatureIssuer Field = "thread.callstack.final_user_module.signature.issuer" + // ThreadCallstackFinalUserModuleSignatureSubject represents the final user space stack frame module certificate subject + ThreadCallstackFinalUserModuleSignatureSubject Field = "thread.callstack.final_user_module.signature.subject" + + // PeNumSections represents the number of sections + PeNumSections Field = "pe.nsections" + // PeNumSymbols represents the number of exported symbols + PeNumSymbols Field = "pe.nsymbols" + // PeSymbols represents imported symbols + PeSymbols Field = "pe.symbols" + // PeImports represents imported libraries (e.g. kernel32.dll) + PeImports Field = "pe.imports" + // PeTimestamp is the PE build timestamp + PeTimestamp Field = "pe.timestamp" + // PeBaseAddress represents the base address when the binary is loaded + PeBaseAddress Field = "pe.address.base" + // PeEntrypoint is the address of the entrypoint function + PeEntrypoint Field = "pe.address.entrypoint" + // PeResources represents PE resources + PeResources Field = "pe.resources" + // PeCompany represents the company name resource + PeCompany Field = "pe.company" + // PeDescription represents the internal description of the file + PeDescription Field = "pe.description" + // PeFileVersion represents the internal file version + PeFileVersion Field = "pe.file.version" + // PeFileName represents the original file name provided at compile-time. + PeFileName Field = "pe.file.name" + // PeCopyright represents the copyright notice emitted at compile-time + PeCopyright Field = "pe.copyright" + // PeProduct represents the product name provided at compile-time + PeProduct Field = "pe.product" + // PeProductVersion represents the internal product version provided at compile-time + PeProductVersion Field = "pe.product.version" + // PeIsDLL indicates if the file is a DLL + PeIsDLL Field = "pe.is_dll" + // PeIsDriver indicates if the file is a driver + PeIsDriver Field = "pe.is_driver" + // PeIsExecutable indicates if the file is an executable + PeIsExecutable Field = "pe.is_exec" + // PeAnomalies represents the field that contains PE anomalies detected during parsing + PeAnomalies Field = "pe.anomalies" + // PeImphash is the field that yields the PE import hash + PeImphash Field = "pe.imphash" + // PeIsDotnet is the field which indicates if the binary contains the .NET assembly + PeIsDotnet Field = "pe.is_dotnet" + // PeIsSigned is the field which indicates if the binary is signed, either by embedded or catalog signature + PeIsSigned Field = "pe.is_signed" + // PeIsTrusted is the field which indicates if the binary signature is trusted + PeIsTrusted Field = "pe.is_trusted" + // PeCertIssuer is the field which indicates the certificate issuer + PeCertIssuer Field = "pe.cert.issuer" + // PeCertSubject is the field which indicates the certificate subject + PeCertSubject Field = "pe.cert.subject" + // PeCertSerial is the field which indicates the certificate serial + PeCertSerial Field = "pe.cert.serial" + // PeCertAfter is the field which indicates the timestamp after certificate is no longer valid + PeCertAfter Field = "pe.cert.after" + // PeCertBefore is the field which indicates the timestamp of the certificate enrollment date + PeCertBefore Field = "pe.cert.before" + // PeIsModified is the field that indicates whether disk and in-memory PE headers differ + PeIsModified Field = "pe.is_modified" + + // EvtSeq is the event sequence number + EvtSeq Field = "evt.seq" + // EvtPID is the process identifier that generated the event + EvtPID Field = "evt.pid" + // EvtTID is the thread identifier that generated the event + EvtTID Field = "evt.tid" + // EvtCPU is the CPU core where the event was generated + EvtCPU Field = "evt.cpu" + // EvtDesc represents the event description + EvtDesc Field = "evt.desc" + // EvtHost represents the host where the event was produced + EvtHost Field = "evt.host" + // EvtTime is the event time + EvtTime Field = "evt.time" + // EvtTimeHour is the hour part of the event time + EvtTimeHour Field = "evt.time.h" + // EvtTimeMin is the minute part of the event time + EvtTimeMin Field = "evt.time.m" + // EvtTimeSec is the second part of the event time + EvtTimeSec Field = "evt.time.s" + // EvtTimeNs is the nanosecond part of the event time + EvtTimeNs Field = "evt.time.ns" + // EvtDate is the event date + EvtDate Field = "evt.date" + // EvtDateDay is the day of event date + EvtDateDay Field = "evt.date.d" + // EvtDateMonth is the month of event date + EvtDateMonth Field = "evt.date.m" + // EvtDateYear is the year of event date + EvtDateYear Field = "evt.date.y" + // EvtDateTz is the time zone of event timestamp + EvtDateTz Field = "evt.date.tz" + // EvtDateWeek is the event week number + EvtDateWeek Field = "evt.date.week" + // EvtDateWeekday is the event week day + EvtDateWeekday Field = "evt.date.weekday" + // EvtName is the event name + EvtName Field = "evt.name" + // EvtCategory is the event category + EvtCategory Field = "evt.category" + // EvtNparams is the number of event parameters + EvtNparams Field = "evt.nparams" + // EvtArg represents the field sequence for generic argument access + EvtArg Field = "evt.arg" + // EvtIsDirectSyscall represents the field that designates if this event is + // performing a direct syscall. + EvtIsDirectSyscall Field = "evt.is_direct_syscall" + // EvtIsIndirectSyscall represents the field that designates if this event is + // performing an indirect syscall. + EvtIsIndirectSyscall Field = "evt.is_indirect_syscall" + + // KevtSeq is the event sequence number + KevtSeq Field = "kevt.seq" + // KevtPID is the process identifier that generated the event + KevtPID Field = "kevt.pid" + // KevtTID is the thread identifier that generated the event + KevtTID Field = "kevt.tid" + // KevtCPU is the CPU core where the event was generated + KevtCPU Field = "kevt.cpu" + // KevtDesc represents the event description + KevtDesc Field = "kevt.desc" + // KevtHost represents the host where the event was produced + KevtHost Field = "kevt.host" + // KevtTime is the event time + KevtTime Field = "kevt.time" + // KevtTimeHour is the hour part of the event time + KevtTimeHour Field = "kevt.time.h" + // KevtTimeMin is the minute part of the event time + KevtTimeMin Field = "kevt.time.m" + // KevtTimeSec is the second part of the event time + KevtTimeSec Field = "kevt.time.s" + // KevtTimeNs is the nanosecond part of the event time + KevtTimeNs Field = "kevt.time.ns" + // KevtDate is the event date + KevtDate Field = "kevt.date" + // KevtDateDay is the day of event date + KevtDateDay Field = "kevt.date.d" + // KevtDateMonth is the month of event date + KevtDateMonth Field = "kevt.date.m" + // KevtDateYear is the year of event date + KevtDateYear Field = "kevt.date.y" + // KevtDateTz is the time zone of event timestamp + KevtDateTz Field = "kevt.date.tz" + // KevtDateWeek is the event week number + KevtDateWeek Field = "kevt.date.week" + // KevtDateWeekday is the event week day + KevtDateWeekday Field = "kevt.date.weekday" + // KevtName is the event name + KevtName Field = "kevt.name" + // KevtCategory is the event category + KevtCategory Field = "kevt.category" + // KevtNparams is the number of event parameters + KevtNparams Field = "kevt.nparams" + // KevtArg represents the field sequence for generic argument access + KevtArg Field = "kevt.arg" + + // HandleID represents the handle identifier within the process address space + HandleID Field = "handle.id" + // HandleObject represents the handle object address + HandleObject Field = "handle.object" + // HandleName represents the handle name + HandleName Field = "handle.name" + // HandleType represents the handle type (e.g. file) + HandleType Field = "handle.type" + + // NetDIP represents network destination IP address + NetDIP Field = "net.dip" + // NetSIP represents the source IP address + NetSIP Field = "net.sip" + // NetDport represents the destination port + NetDport Field = "net.dport" + // NetSport represents the source port + NetSport Field = "net.sport" + // NetDportName represents the destination port IANA name + NetDportName Field = "net.dport.name" + // NetSportName represents the source port IANA name + NetSportName Field = "net.sport.name" + // NetL4Proto represents the Layer4 protocol name (e.g. TCP) + NetL4Proto Field = "net.l4.proto" + // NetPacketSize represents the packet size + NetPacketSize Field = "net.size" + // NetSIPNames represents the source IP names + NetSIPNames Field = "net.sip.names" + // NetDIPNames represents the destination IP names + NetDIPNames Field = "net.dip.names" + + // FileObject represents the address of the file object + FileObject Field = "file.object" + // FileName represents the file base name (e.g. cmd.exe) + FileName Field = "file.name" + // FilePath represents the file full path (e.g. C:\Windows\System32\cmd.exe) + FilePath Field = "file.path" + // FilePathStem represents the full file path without extension (e.g. C:\Windows\System32\cmd) + FilePathStem Field = "file.path.stem" + // FileExtension represents the file extension (e.g. .exe or .dll) + FileExtension Field = "file.extension" + // FileOperation represents the file operation (e.g. create) + FileOperation Field = "file.operation" + // FileShareMask represents the file share mask + FileShareMask Field = "file.share.mask" + // FileShareMode represents the file share mode field + FileShareMode Field = "file.share_mode" + // FileIOSize represents the number of read/written bytes + FileIOSize Field = "file.io.size" + // FileOffset represents the read/write offset + FileOffset Field = "file.offset" + // FileType represents the file type + FileType Field = "file.type" + // FileAttributes represents a slice of file attributes + FileAttributes Field = "file.attributes" + // FileStatus represents the status message of the file operation + FileStatus Field = "file.status" + // FileViewBase represents the base address of the mapped view + FileViewBase Field = "file.view.base" + // FileViewSize represents the size of the mapped view + FileViewSize Field = "file.view.size" + // FileViewType represents the type of the mapped view section + FileViewType Field = "file.view.type" + // FileViewProtection represents the protection attributes of the section view + FileViewProtection Field = "file.view.protection" + // FileIsDLL indicates if the created file is a DLL + FileIsDLL Field = "file.is_dll" + // FileIsDriver indicates if the created file is a driver + FileIsDriver Field = "file.is_driver" + // FileIsExecutable indicates if the created file is an executable + FileIsExecutable Field = "file.is_exec" + // FilePID represents the field that denotes the process id performing file operations + FilePID Field = "file.pid" + // FileKey represents the field that uniquely identifies the file object. + FileKey Field = "file.key" + // FileInfoClass represents the field that identifies the file information class + FileInfoClass Field = "file.info_class" + // FileInfoAllocationSize represents the field that contains the file allocation size + FileInfoAllocationSize Field = "file.info.allocation_size" + // FileInfoEOFSize represents the field that contains the EOF size + FileInfoEOFSize Field = "file.info.eof_size" + // FileInfoIsDispositionDeleteFile represents the field that indicates if the file is deleted when its handle is closed + FileInfoIsDispositionDeleteFile Field = "file.info.is_disposition_delete_file" + + // RegistryPath represents the full registry path + RegistryPath Field = "registry.path" + // RegistryKeyName represents the registry key name + RegistryKeyName Field = "registry.key.name" + // RegistryKCB represents the registry KCB address + RegistryKCB Field = "registry.kcb" + // RegistryValue represents the registry value name field + RegistryValue Field = "registry.value" + // RegistryValueType represents the registry value type field + RegistryValueType Field = "registry.value.type" + // RegistryData represents the captured registry data field + RegistryData Field = "registry.data" + // RegistryStatus represent the registry operation status + RegistryStatus Field = "registry.status" + + // ImageBase is the module base address + ImageBase Field = "image.base.address" + // ImageSize is the module size + ImageSize Field = "image.size" + // ImageChecksum represents the module checksum hash + ImageChecksum Field = "image.checksum" + // ImageDefaultAddress represents the module address + ImageDefaultAddress Field = "image.default.address" + // ImagePath is the module full path + ImagePath Field = "image.path" + // ImageName is the module name + ImageName Field = "image.name" + // ImagePID is the pid of the process where the image was loaded + ImagePID Field = "image.pid" + // ImageSignatureType represents the image signature type + ImageSignatureType Field = "image.signature.type" + // ImageSignatureLevel represents the image signature level + ImageSignatureLevel Field = "image.signature.level" + // ImageCertSubject is the field that indicates the subject of the certificate is the entity its public key is associated with. + ImageCertSubject = "image.cert.subject" + // ImageCertIssuer is the field that represents the certificate authority (CA). + ImageCertIssuer = "image.cert.issuer" + // ImageCertSerial is the field that represents the serial number MUST be a positive integer assigned + // by the CA to each certificate. + ImageCertSerial = "image.cert.serial" + // ImageCertBefore is the field that specifies the certificate won't be valid before this timestamp. + ImageCertBefore = "image.cert.before" + // ImageCertAfter is the field that specifies the certificate won't be valid after this timestamp. + ImageCertAfter = "image.cert.after" + // ImageIsDLL indicates if the loaded image is a DLL + ImageIsDLL Field = "image.is_dll" + // ImageIsDriver indicates if the loaded image is a driver + ImageIsDriver Field = "image.is_driver" + // ImageIsExecutable indicates if the loaded image is an executable + ImageIsExecutable Field = "image.is_exec" + // ImageIsDotnet indicates if the loaded image is a .NET assembly + ImageIsDotnet Field = "image.is_dotnet" + + // DllBase is the DLL base address + DllBase Field = "dll.base" + // DllSize is the DLL virtual mapped space size + DllSize Field = "dll.size" + // DllPath is the DLL full path + DllPath Field = "dll.path" + // DllPath is the DLL path stem field + DllPathStem Field = "dll.path.stem" + // DllName is the DLL name + DllName Field = "dll.name" + // DllPID is the pid of the process where the DLL was loaded + DllPID Field = "dll.pid" + // DllSignatureType represents the DLL signature type + DllSignatureType Field = "dll.signature.type" + // DllSignatureLevel represents the DLL signature level + DllSignatureLevel Field = "dll.signature.level" + // DllSignatureExists is the field that determines if the DLL signature exists + DllSignatureExists Field = "dll.signature.exists" + // DllSignatureTrusted is the filed that determines if the DLL signature is trusted + DllSignatureTrusted Field = "dll.signature.trusted" + // DllSignatureSubject is the field that indicates the subject of the certificate is the entity its public key is associated with. + DllSignatureSubject = "dll.signature.subject" + // DllSignatureIssuer is the field that represents the certificate authority (CA). + DllSignatureIssuer = "dll.signature.issuer" + // DllSignatureSerial is the field that represents the serial number MUST be a positive integer assigned + // by the CA to each certificate. + DllSignatureSerial = "dll.signature.serial" + // DllSignatureBefore is the field that specifies the certificate won't be valid before this timestamp. + DllSignatureBefore = "dll.signature.before" + // DllSignatureAfter is the field that specifies the certificate won't be valid after this timestamp. + DllSignatureAfter = "dll.signature.after" + // DllIsDotnet indicates if the DLL is a .NET assembly. + DllIsDotnet Field = "dll.pe.is_dotnet" + + // ModuleBase is the module base address + ModuleBase Field = "module.base" + // ModuleSize is the module size + ModuleSize Field = "module.size" + // ModuleChecksum represents the module checksum hash + ModuleChecksum Field = "module.checksum" + // ModuleDefaultAddress represents the module address + ModuleDefaultAddress Field = "module.default_address" + // ModulePath is the module full path + ModulePath Field = "module.path" + // ModulePathStem is the module path stem field + ModulePathStem Field = "module.path.stem" + // ModuleName is the module name + ModuleName Field = "module.name" + // ModulePID is the pid of the process where the module was loaded + ModulePID Field = "module.pid" + // ModuleSignatureType represents the module signature type + ModuleSignatureType Field = "module.signature.type" + // ModuleSignatureLevel represents the module signature level + ModuleSignatureLevel Field = "module.signature.level" + // ModuleSignatureExists is the field that determines if the module signature exists + ModuleSignatureExists Field = "module.signature.exists" + // ModuleSignatureTrusted is the filed that determines if the module signature is trusted + ModuleSignatureTrusted Field = "module.signature.trusted" + // ModuleSignatureSubject is the field that indicates the subject of the certificate is the entity its public key is associated with. + ModuleSignatureSubject = "module.signature.subject" + // ModuleSignatureIssuer is the field that represents the certificate authority (CA). + ModuleSignatureIssuer = "module.signature.issuer" + // ModuleSignatureSerial is the field that represents the serial number MUST be a positive integer assigned + // by the CA to each certificate. + ModuleSignatureSerial = "module.signature.serial" + // ModuleSignatureBefore is the field that specifies the certificate won't be valid before this timestamp. + ModuleSignatureBefore = "module.signature.before" + // ModuleSignatureAfter is the field that specifies the certificate won't be valid after this timestamp. + ModuleSignatureAfter = "module.signature.after" + // ModuleIsDLL indicates if the loaded module is a DLL + ModuleIsDLL Field = "module.is_dll" + // ModuleIsDriver indicates if the loaded module is a driver + ModuleIsDriver Field = "module.is_driver" + // ModuleIsExecutable indicates if the loaded module is an executable + ModuleIsExecutable Field = "module.is_exec" + // ModuleIsDotnet indicates if the loaded module is a .NET assembly + ModuleIsDotnet Field = "module.pe.is_dotnet" + + // MemBaseAddress identifies the field that denotes the allocation base address + MemBaseAddress Field = "mem.address" + // MemRegionSize Field identifies the field that represents the allocated region size + MemRegionSize Field = "mem.size" + // MemAllocType identifies the field that represents region allocation type + MemAllocType Field = "mem.alloc" + // MemPageType identifies the parameter that represents the allocated region type + MemPageType Field = "mem.type" + // MemProtection identifies the field that represents the memory protection for the range of pages + MemProtection Field = "mem.protection" + // MemProtectionMask identifies the field that represents the memory protection in mask notation + MemProtectionMask Field = "mem.protection.mask" + + // DNSName identifies the field that represents the DNS name + DNSName Field = "dns.name" + // DNSRR identifies the field that represents the DNS record type + DNSRR Field = "dns.rr" + // DNSOptions identifies the field that represents the DNS options + DNSOptions Field = "dns.options" + // DNSAnswers identifies the field that represents the DNS answers + DNSAnswers Field = "dns.answers" + // DNSRcode identifies the field that represents the DNS response code + DNSRcode Field = "dns.rcode" + + // ThreadpoolPoolID identifies the field that represents the thread pool identifier + ThreadpoolPoolID = "threadpool.id" + // ThreadpoolTaskID identifies the field that represents the thread pool task identifier + ThreadpoolTaskID = "threadpool.task.id" + // ThreadpoolCallbackAddress identifies the field that represents the address of the callback function + ThreadpoolCallbackAddress = "threadpool.callback.address" + // ThreadpoolCallbackSymbol identifies the field that represents the callback symbol + ThreadpoolCallbackSymbol = "threadpool.callback.symbol" + // ThreadpoolCallbackModule identifies the field that represents the module containing the callback symbol + ThreadpoolCallbackModule = "threadpool.callback.module" + // ThreadpoolCallbackContext identifies the field that represents the address of the callback context + ThreadpoolCallbackContext = "threadpool.callback.context" + // ThreadpoolCallbackContextRip identifies the field that represents the value of instruction pointer contained in the callback context + ThreadpoolCallbackContextRip = "threadpool.callback.context.rip" + // ThreadpoolCallbackContextRipSymbol identifies the field that represents the symbol name associated with the instruction pointer in callback context + ThreadpoolCallbackContextRipSymbol = "threadpool.callback.context.rip.symbol" + // ThreadpoolCallbackContextRipModule identifies the field that represents the module name associated with the instruction pointer in callback context + ThreadpoolCallbackContextRipModule = "threadpool.callback.context.rip.module" + // ThreadpoolSubprocessTag identifies the field that represents the service identifier associated with the thread pool + ThreadpoolSubprocessTag = "threadpool.subprocess_tag" + // ThreadpoolTimerDuetime identifies the field that represents the timer due time + ThreadpoolTimerDuetime = "threadpool.timer.duetime" + // ThreadpoolTimerSubqueue identifies the field that represents the memory address of the timer subqueue + ThreadpoolTimerSubqueue = "threadpool.timer.subqueue" + // ThreadpoolTimer identifies the field that represents the memory address of the timer object + ThreadpoolTimer = "threadpool.timer.address" + // ThreadpoolTimerPeriod identifies the field that represents the period of the timer + ThreadpoolTimerPeriod = "threadpool.timer.period" + // ThreadpoolTimerWindow identifies the field that represents the timer tolerate period + ThreadpoolTimerWindow = "threadpool.timer.window" + // ThreadpoolTimerAbsolute identifies the field that indicates if the timer is absolute or relative + ThreadpoolTimerAbsolute = "threadpool.timer.is_absolute" +) + +// String casts the field type to string. +func (f Field) String() string { return string(f) } + +// Type returns the data type that this field contains. +func (f Field) Type() params.Type { return fields[f].Type } + +func (f Field) IsPsField() bool { return strings.HasPrefix(string(f), "ps.") } +func (f Field) IsKevtField() bool { return strings.HasPrefix(string(f), "kevt.") } +func (f Field) IsEvtField() bool { return strings.HasPrefix(string(f), "evt.") } +func (f Field) IsThreadField() bool { return strings.HasPrefix(string(f), "thread.") } +func (f Field) IsImageField() bool { return strings.HasPrefix(string(f), "image.") } +func (f Field) IsFileField() bool { return strings.HasPrefix(string(f), "file.") } +func (f Field) IsRegistryField() bool { return strings.HasPrefix(string(f), "registry.") } +func (f Field) IsNetworkField() bool { return strings.HasPrefix(string(f), "net.") } +func (f Field) IsHandleField() bool { return strings.HasPrefix(string(f), "handle.") } +func (f Field) IsPeField() bool { + return strings.HasPrefix(string(f), "pe.") || strings.HasPrefix(string(f), "ps.pe.") || strings.HasPrefix(string(f), "ps.signature.") +} +func (f Field) IsModuleField() bool { + return strings.HasPrefix(string(f), "module.") || strings.HasPrefix(string(f), "dll.") +} +func (f Field) IsMemField() bool { return strings.HasPrefix(string(f), "mem.") } +func (f Field) IsDNSField() bool { return strings.HasPrefix(string(f), "dns.") } +func (f Field) IsThreadpoolField() bool { return strings.HasPrefix(string(f), "threadpool.") } + +func (f Field) IsPeSection() bool { return f == PeNumSections || f == PsPeNumSections } +func (f Field) IsPeSymbol() bool { + return f == PeSymbols || f == PeNumSymbols || f == PeImports || f == PsPeSymbols || f == PsPeNumSymbols || f == PsPeImports +} +func (f Field) IsPeVersionResource() bool { + return f == PeCompany || f == PeCopyright || f == PeDescription || f == PeFileName || f == PeFileVersion || f == PeProduct || f == PeProductVersion || + f == PsPeCompany || f == PsPeCopyright || f == PsPeDescription || f == PsPeFileName || f == PsPeFileVersion || f == PsPeProduct || f == PsPeProductVersion +} +func (f Field) IsPeVersionResources() bool { return f == PeResources || f == PsPeResources } +func (f Field) IsPeImphash() bool { return f == PeImphash || f == PsPeImphash } +func (f Field) IsPeDotnet() bool { return f == PeIsDotnet || f == PsPeIsDotnet } +func (f Field) IsPeAnomalies() bool { return f == PeAnomalies || f == PsPeAnomalies } +func (f Field) IsPeSignature() bool { + return f == PeIsTrusted || f == PeIsSigned || f == PeCertIssuer || f == PeCertSerial || f == PeCertSubject || f == PeCertBefore || f == PeCertAfter || strings.HasPrefix(string(f), "ps.signature.") +} +func (f Field) IsPeIsTrusted() bool { return f == PeIsTrusted || f == PsSignatureTrusted } +func (f Field) IsPeIsSigned() bool { return f == PeIsSigned || f == PsSignatureExists } + +func (f Field) IsPeCert() bool { + return strings.HasPrefix(string(f), "pe.cert.") || f == PsSignatureIssuer || f == PsSignatureSubject || f == PsSignatureSerial || f == PsSignatureAfter || f == PsSignatureBefore +} +func (f Field) IsImageCert() bool { return strings.HasPrefix(string(f), "image.cert.") } +func (f Field) IsModuleCert() bool { + return f == ModuleSignatureSubject || f == ModuleSignatureIssuer || f == ModuleSignatureSerial || f == ModuleSignatureAfter || f == ModuleSignatureBefore || + f == DllSignatureSubject || f == DllSignatureIssuer || f == DllSignatureSerial || f == DllSignatureAfter || f == DllSignatureBefore +} +func (f Field) IsModuleSignature() bool { + return strings.HasPrefix(string(f), "module.signature.") || strings.HasPrefix(string(f), "dll.signature.") +} + +func (f Field) IsPeModified() bool { return f == PeIsModified || f == PsPeIsModified } + +// Segment represents the type alias for the segment. Segment +// denotes the property anchored to the bound field reference. +// Let's look through an example. $module.name is the literal +// composed of bound field ($module) and the segment (name). +// Segments are most commonly used in the context of bound +// variables in foreach function. +type Segment string + +const ( + PathSegment Segment = "path" + NameSegment Segment = "name" + TypeSegment Segment = "type" + SizeSegment Segment = "size" + ChecksumSegment Segment = "checksum" + AddressSegment Segment = "address" + OffsetSegment Segment = "offset" + EntropySegment Segment = "entropy" + MD5Segment Segment = "md5" + + PIDSegment Segment = "pid" + CmdlineSegment Segment = "cmdline" + ExeSegment Segment = "exe" + ArgsSegment Segment = "args" + CwdSegment Segment = "cwd" + SIDSegment Segment = "sid" + SessionIDSegment Segment = "sessionid" + UsernameSegment Segment = "username" + DomainSegment Segment = "domain" + TokenIntegrityLevelSegment Segment = "token.integrity_level" + TokenIsElevatedSegment Segment = "token.is_elevated" + TokenElevationTypeSegment Segment = "token.elevation_type" + + TidSegment Segment = "tid" + StartAddressSegment Segment = "start_address" + UserStackBaseSegment Segment = "user_stack_base" + UserStackLimitSegment Segment = "user_stack_limit" + KernelStackBaseSegment Segment = "kernel_stack_base" + KernelStackLimitSegment Segment = "kernel_stack_limit" + + SymbolSegment Segment = "symbol" + ModuleSegment Segment = "module" + AllocationSizeSegment Segment = "allocation_size" + ProtectionSegment Segment = "protection" + IsUnbackedSegment Segment = "is_unbacked" + CallsiteLeadingAssemblySegment Segment = "callsite_leading_assembly" + CallsiteTrailingAssemblySegment Segment = "callsite_trailing_assembly" + + ModuleSignatureExistsSegment Segment = "module.signature.exists" + ModuleSignatureTrustedSegment Segment = "module.signature.trusted" + ModuleSignatureIssuerSegment Segment = "module.signature.issuer" + ModuleSignatureSubjectSegment Segment = "module.signature.subject" +) + +var segments = map[Segment]bool{ + NameSegment: true, + PathSegment: true, + TypeSegment: true, + EntropySegment: true, + SizeSegment: true, + MD5Segment: true, + AddressSegment: true, + ChecksumSegment: true, + PIDSegment: true, + CmdlineSegment: true, + ExeSegment: true, + ArgsSegment: true, + CwdSegment: true, + SIDSegment: true, + SessionIDSegment: true, + UsernameSegment: true, + DomainSegment: true, + TokenIntegrityLevelSegment: true, + TokenIsElevatedSegment: true, + TokenElevationTypeSegment: true, + TidSegment: true, + StartAddressSegment: true, + UserStackBaseSegment: true, + UserStackLimitSegment: true, + KernelStackBaseSegment: true, + KernelStackLimitSegment: true, + OffsetSegment: true, + SymbolSegment: true, + ModuleSegment: true, + AllocationSizeSegment: true, + ProtectionSegment: true, + IsUnbackedSegment: true, + CallsiteLeadingAssemblySegment: true, + CallsiteTrailingAssemblySegment: true, + ModuleSignatureExistsSegment: true, + ModuleSignatureTrustedSegment: true, + ModuleSignatureIssuerSegment: true, + ModuleSignatureSubjectSegment: true, +} + +var allowedSegments = map[Field][]Segment{ + PsAncestors: {NameSegment, PIDSegment, CmdlineSegment, ExeSegment, ArgsSegment, CwdSegment, SIDSegment, SessionIDSegment, UsernameSegment, DomainSegment, TokenIntegrityLevelSegment, TokenIsElevatedSegment, TokenElevationTypeSegment}, + PsThreads: {TidSegment, StartAddressSegment, UserStackBaseSegment, UserStackLimitSegment, KernelStackBaseSegment, KernelStackLimitSegment}, + PsModules: {PathSegment, NameSegment, AddressSegment, SizeSegment, ChecksumSegment}, + PsMmaps: {AddressSegment, TypeSegment, SizeSegment, ProtectionSegment, PathSegment}, + PeSections: {NameSegment, SizeSegment, EntropySegment, MD5Segment}, + PsPeSections: {NameSegment, SizeSegment, EntropySegment, MD5Segment}, + ThreadCallstack: {AddressSegment, OffsetSegment, SymbolSegment, ModuleSegment, AllocationSizeSegment, ProtectionSegment, IsUnbackedSegment, CallsiteLeadingAssemblySegment, CallsiteTrailingAssemblySegment, ModuleSignatureExistsSegment, ModuleSignatureTrustedSegment, ModuleSignatureIssuerSegment, ModuleSignatureSubjectSegment}, +} + +func (s Segment) IsEntropy() bool { return s == EntropySegment } + +// IsSegmentAllowed determines if the segment is valid for the pseudo field. +func IsSegmentAllowed(f Field, s Segment) bool { + segs := allowedSegments[f] + if len(segs) == 0 { + return false + } + + for _, seg := range segs { + if seg == s { + return true + } + } + + return false +} + +// SegmentsHint returns the sequence of available segments for the pseudo field. +func SegmentsHint(f Field) string { + segs := allowedSegments[f] + if len(segs) == 0 { + return "" + } + + s := make([]string, len(segs)) + for i, seg := range segs { + s[i] = string(seg) + } + + return strings.Join(s, ", ") +} + +// IsSegment indicates if the given string is recognized as a known segment. +func IsSegment(s string) bool { + return segments[Segment(s)] +} + +// Pseudo fields provide access to the process/event internal state. They +// are typically used in conjunction with the foreach function as its +// first argument. + +var ( + PsModules Field = "ps._modules" + PsThreads Field = "ps._threads" + PsMmaps Field = "ps._mmaps" + PsAncestors Field = "ps._ancestors" + PsPeSections Field = "ps.pe._sections" + ThreadCallstack Field = "thread._callstack" + PeSections Field = "pe._sections" +) + +func IsPseudoField(f Field) bool { + return f == PsAncestors || f == PsModules || f == PsThreads || f == PsMmaps || f == ThreadCallstack || f == PeSections || f == PsPeSections +} + +func (f Field) IsPeSectionsPseudo() bool { return f == PeSections || f == PsPeSections } + +var fields = map[Field]FieldInfo{ + EvtSeq: {EvtSeq, "event sequence number", params.Uint64, []string{"evt.seq > 666"}, nil, nil}, + EvtPID: {EvtPID, "process identifier generating the event", params.Uint32, []string{"evt.pid = 6"}, nil, nil}, + EvtTID: {EvtTID, "thread identifier generating the event", params.Uint32, []string{"evt.tid = 1024"}, nil, nil}, + EvtCPU: {EvtCPU, "logical processor core where the event was generated", params.Uint8, []string{"evt.cpu = 2"}, nil, nil}, + EvtName: {EvtName, "symbolical event name", params.AnsiString, []string{"evt.name = 'CreateThread'"}, nil, nil}, + EvtCategory: {EvtCategory, "event category", params.AnsiString, []string{"evt.category = 'registry'"}, nil, nil}, + EvtDesc: {EvtDesc, "event description", params.AnsiString, []string{"evt.desc contains 'Creates a new process'"}, nil, nil}, + EvtHost: {EvtHost, "host name on which the event was produced", params.UnicodeString, []string{"evt.host contains 'kitty'"}, nil, nil}, + EvtTime: {EvtTime, "event timestamp as a time string", params.Time, []string{"evt.time = '17:05:32'"}, nil, nil}, + EvtTimeHour: {EvtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"evt.time.h = 23"}, nil, nil}, + EvtTimeMin: {EvtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"evt.time.m = 54"}, nil, nil}, + EvtTimeSec: {EvtTimeSec, "second offset within the minute on which the event occurred", params.Time, []string{"evt.time.s = 0"}, nil, nil}, + EvtTimeNs: {EvtTimeNs, "nanoseconds specified by event timestamp", params.Int64, []string{"evt.time.ns > 1591191629102337000"}, nil, nil}, + EvtDate: {EvtDate, "event timestamp as a date string", params.Time, []string{"evt.date = '2018-03-03'"}, nil, nil}, + EvtDateDay: {EvtDateDay, "day of the month on which the event occurred", params.Time, []string{"evt.date.d = 12"}, nil, nil}, + EvtDateMonth: {EvtDateMonth, "month of the year on which the event occurred", params.Time, []string{"evt.date.m = 11"}, nil, nil}, + EvtDateYear: {EvtDateYear, "year on which the event occurred", params.Uint32, []string{"evt.date.y = 2020"}, nil, nil}, + EvtDateTz: {EvtDateTz, "time zone associated with the event timestamp", params.AnsiString, []string{"evt.date.tz = 'UTC'"}, nil, nil}, + EvtDateWeek: {EvtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"evt.date.week = 2"}, nil, nil}, + EvtDateWeekday: {EvtDateWeekday, "week day on which the event occurred", params.AnsiString, []string{"evt.date.weekday = 'Monday'"}, nil, nil}, + EvtNparams: {EvtNparams, "number of parameters", params.Int8, []string{"evt.nparams > 2"}, nil, nil}, + EvtArg: {EvtArg, "event parameter", params.Object, []string{"evt.arg[cmdline] istartswith 'C:\\Windows'"}, nil, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { + for _, c := range s { + switch { + case unicode.IsLower(c): + case unicode.IsNumber(c): + case c == '_': + default: + return false + } + } + return true + }}}, + EvtIsDirectSyscall: {EvtIsDirectSyscall, "indicates if the event is performing a direct syscall", params.Bool, []string{"evt.is_direct_syscall = true"}, nil, nil}, + EvtIsIndirectSyscall: {EvtIsIndirectSyscall, "indicates if the event is performing an indirect syscall", params.Bool, []string{"evt.is_indirect_syscall = true"}, nil, nil}, + + KevtSeq: {KevtSeq, "event sequence number", params.Uint64, []string{"kevt.seq > 666"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtSeq}}, nil}, + KevtPID: {KevtPID, "process identifier generating the event", params.Uint32, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil}, + KevtTID: {KevtTID, "thread identifier generating the event", params.Uint32, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil}, + KevtCPU: {KevtCPU, "logical processor core where the event was generated", params.Uint8, []string{"kevt.cpu = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCPU}}, nil}, + KevtName: {KevtName, "symbolical event name", params.AnsiString, []string{"kevt.name = 'CreateThread'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtName}}, nil}, + KevtCategory: {KevtCategory, "event category", params.AnsiString, []string{"kevt.category = 'registry'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCategory}}, nil}, + KevtDesc: {KevtDesc, "event description", params.AnsiString, []string{"kevt.desc contains 'Creates a new process'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDesc}}, nil}, + KevtHost: {KevtHost, "host name on which the event was produced", params.UnicodeString, []string{"kevt.host contains 'kitty'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtHost}}, nil}, + KevtTime: {KevtTime, "event timestamp as a time string", params.Time, []string{"kevt.time = '17:05:32'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTime}}, nil}, + KevtTimeHour: {KevtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"kevt.time.h = 23"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeHour}}, nil}, + KevtTimeMin: {KevtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"kevt.time.m = 54"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeMin}}, nil}, + KevtTimeSec: {KevtTimeSec, "second offset within the minute on which the event occurred", params.Time, []string{"kevt.time.s = 0"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeSec}}, nil}, + KevtTimeNs: {KevtTimeNs, "nanoseconds specified by event timestamp", params.Int64, []string{"kevt.time.ns > 1591191629102337000"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeNs}}, nil}, + KevtDate: {KevtDate, "event timestamp as a date string", params.Time, []string{"kevt.date = '2018-03-03'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDate}}, nil}, + KevtDateDay: {KevtDateDay, "day of the month on which the event occurred", params.Time, []string{"kevt.date.d = 12"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateDay}}, nil}, + KevtDateMonth: {KevtDateMonth, "month of the year on which the event occurred", params.Time, []string{"kevt.date.m = 11"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateMonth}}, nil}, + KevtDateYear: {KevtDateYear, "year on which the event occurred", params.Uint32, []string{"kevt.date.y = 2020"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateYear}}, nil}, + KevtDateTz: {KevtDateTz, "time zone associated with the event timestamp", params.AnsiString, []string{"kevt.date.tz = 'UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateTz}}, nil}, + KevtDateWeek: {KevtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"kevt.date.week = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeek}}, nil}, + KevtDateWeekday: {KevtDateWeekday, "week day on which the event occurred", params.AnsiString, []string{"kevt.date.weekday = 'Monday'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeekday}}, nil}, + KevtNparams: {KevtNparams, "number of parameters", params.Int8, []string{"kevt.nparams > 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtNparams}}, nil}, + KevtArg: {KevtArg, "event parameter", params.Object, []string{"kevt.arg[cmdline] istartswith 'C:\\Windows'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtArg}}, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { + for _, c := range s { + switch { + case unicode.IsLower(c): + case unicode.IsNumber(c): + case c == '_': + default: + return false + } + } + return true + }}}, + + PsPid: {PsPid, "process identifier", params.PID, []string{"ps.pid = 1024"}, nil, nil}, + PsPpid: {PsPpid, "parent process identifier", params.PID, []string{"ps.ppid = 45"}, nil, nil}, + PsName: {PsName, "process image name including the file extension", params.UnicodeString, []string{"ps.name contains 'firefox'"}, nil, nil}, + PsComm: {PsComm, "process command line", params.UnicodeString, []string{"ps.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsCmdline}}, nil}, + PsCmdline: {PsCmdline, "process command line", params.UnicodeString, []string{"ps.cmdline contains 'java'"}, nil, nil}, + PsExe: {PsExe, "full name of the process' executable", params.UnicodeString, []string{"ps.exe = 'C:\\Windows\\system32\\cmd.exe'"}, nil, nil}, + PsArgs: {PsArgs, "process command line arguments", params.Slice, []string{"ps.args in ('/cdir', '/-C')"}, nil, nil}, + PsCwd: {PsCwd, "process current working directory", params.UnicodeString, []string{"ps.cwd = 'C:\\Users\\Default'"}, nil, nil}, + PsSID: {PsSID, "security identifier under which this process is run", params.UnicodeString, []string{"ps.sid contains 'SYSTEM'"}, nil, nil}, + PsSessionID: {PsSessionID, "unique identifier for the current session", params.Int16, []string{"ps.sessionid = 1"}, nil, nil}, + PsDomain: {PsDomain, "process domain", params.UnicodeString, []string{"ps.domain contains 'SERVICE'"}, nil, nil}, + PsUsername: {PsUsername, "process username", params.UnicodeString, []string{"ps.username contains 'system'"}, nil, nil}, + PsEnvs: {PsEnvs, "process environment variables", params.Slice, []string{"ps.envs in ('SystemRoot:C:\\WINDOWS')", "ps.envs[windir] = 'C:\\WINDOWS'"}, nil, &Argument{Optional: true, ValidationFunc: func(arg string) bool { return true }}}, + PsHandleNames: {PsHandleNames, "allocated process handle names", params.Slice, []string{"ps.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, + PsHandleTypes: {PsHandleTypes, "allocated process handle types", params.Slice, []string{"ps.handle.types in ('Key', 'Mutant', 'Section')"}, nil, nil}, + PsDTB: {PsDTB, "process directory table base address", params.Address, []string{"ps.dtb = '7ffe0000'"}, nil, nil}, + PsModuleNames: {PsModuleNames, "modules loaded by the process", params.Slice, []string{"ps.modules in ('crypt32.dll', 'xul.dll')"}, nil, nil}, + PsParentName: {PsParentName, "parent process image name including the file extension", params.UnicodeString, []string{"ps.parent.name contains 'cmd.exe'"}, nil, nil}, + PsParentPid: {PsParentPid, "parent process id", params.Uint32, []string{"ps.parent.pid = 4"}, nil, nil}, + PsParentComm: {PsParentComm, "parent process command line", params.UnicodeString, []string{"ps.parent.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsParentCmdline}}, nil}, + PsParentCmdline: {PsParentCmdline, "parent process command line", params.UnicodeString, []string{"ps.parent.cmdline contains 'java'"}, nil, nil}, + PsParentExe: {PsParentExe, "full name of the parent process' executable", params.UnicodeString, []string{"ps.parent.exe = 'C:\\Windows\\system32\\explorer.exe'"}, nil, nil}, + PsParentArgs: {PsParentArgs, "parent process command line arguments", params.Slice, []string{"ps.parent.args in ('/cdir', '/-C')"}, nil, nil}, + PsParentCwd: {PsParentCwd, "parent process current working directory", params.UnicodeString, []string{"ps.parent.cwd = 'C:\\Temp'"}, nil, nil}, + PsParentSID: {PsParentSID, "security identifier under which the parent process is run", params.UnicodeString, []string{"ps.parent.sid contains 'SYSTEM'"}, nil, nil}, + PsParentDomain: {PsParentDomain, "parent process domain", params.UnicodeString, []string{"ps.parent.domain contains 'SERVICE'"}, nil, nil}, + PsParentUsername: {PsParentUsername, "parent process username", params.UnicodeString, []string{"ps.parent.username contains 'system'"}, nil, nil}, + PsParentSessionID: {PsParentSessionID, "unique identifier for the current session of parent process", params.Int16, []string{"ps.parent.sessionid = 1"}, nil, nil}, + PsParentEnvs: {PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('MOZ_CRASHREPORTER_DATA_DIRECTORY')"}, nil, nil}, + PsParentHandles: {PsParentHandles, "allocated parent process handle names", params.Slice, []string{"ps.parent.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, + PsParentHandleTypes: {PsParentHandleTypes, "allocated parent process handle types", params.Slice, []string{"ps.parent.handle.types in ('File', 'SymbolicLink')"}, nil, nil}, + PsParentDTB: {PsParentDTB, "parent process directory table base address", params.Address, []string{"ps.parent.dtb = '7ffe0000'"}, nil, nil}, + PsAccessMask: {PsAccessMask, "process desired access rights", params.AnsiString, []string{"ps.access.mask = '0x1400'"}, nil, nil}, + PsAccessMaskNames: {PsAccessMaskNames, "process desired access rights as a string list", params.Slice, []string{"ps.access.mask.names in ('SUSPEND_RESUME')"}, nil, nil}, + PsAccessStatus: {PsAccessStatus, "process access status", params.UnicodeString, []string{"ps.access.status = 'access is denied.'"}, nil, nil}, + PsUUID: {PsUUID, "unique process identifier", params.Uint64, []string{"ps.uuid > 6000054355"}, nil, nil}, + PsParentUUID: {PsParentUUID, "unique parent process identifier", params.Uint64, []string{"ps.parent.uuid > 6000054355"}, nil, nil}, + PsIsWOW64Field: {PsIsWOW64Field, "indicates if the process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.is_wow64"}, nil, nil}, + PsIsPackagedField: {PsIsPackagedField, "indicates if the process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.is_packaged"}, nil, nil}, + PsIsProtectedField: {PsIsProtectedField, "indicates if the process generating the event is a protected process", params.Bool, []string{"ps.is_protected"}, nil, nil}, + PsParentIsWOW64Field: {PsParentIsWOW64Field, "indicates if the parent process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.parent.is_wow64"}, nil, nil}, + PsParentIsPackagedField: {PsParentIsPackagedField, "indicates if the parent process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.parent.is_packaged"}, nil, nil}, + PsParentIsProtectedField: {PsParentIsProtectedField, "indicates if the the parent process generating the event is a protected process", params.Bool, []string{"ps.parent.is_protected"}, nil, nil}, + PsAncestor: {PsAncestor, "the process ancestor name", params.UnicodeString, []string{"ps.ancestor[1] = 'svchost.exe'", "ps.ancestor in ('winword.exe')"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, + PsTokenIntegrityLevel: {PsTokenIntegrityLevel, "process token integrity level", params.UnicodeString, []string{"ps.token.integrity_level = 'SYSTEM'"}, nil, nil}, + PsTokenIsElevated: {PsTokenIsElevated, "indicates if the process token is elevated", params.Bool, []string{"ps.token.is_elevated = true"}, nil, nil}, + PsTokenElevationType: {PsTokenElevationType, "process token elevation type", params.AnsiString, []string{"ps.token.elevation_type = 'LIMITED'"}, nil, nil}, + PsParentTokenIntegrityLevel: {PsParentTokenIntegrityLevel, "parent process token integrity level", params.UnicodeString, []string{"ps.parent.token.integrity_level = 'HIGH'"}, nil, nil}, + PsParentTokenIsElevated: {PsParentTokenIsElevated, "indicates if the parent process token is elevated", params.Bool, []string{"ps.parent.token.is_elevated = true"}, nil, nil}, + PsParentTokenElevationType: {PsParentTokenElevationType, "parent process token elevation type", params.AnsiString, []string{"ps.parent.token.elevation_type = 'LIMITED'"}, nil, nil}, + PsSignatureExists: {PsSignatureExists, "indicates if the process executable has a valid signature", params.Bool, []string{"ps.signature.exists"}, nil, nil}, + PsSignatureTrusted: {PsSignatureTrusted, "indicates if the process executable signature certificate chain is trusted", params.Bool, []string{"ps.signature.trusted"}, nil, nil}, + PsSignatureSerial: {PsSignatureSerial, "represents signature serial number", params.UnicodeString, []string{"ps.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, + PsSignatureSubject: {PsSignatureSubject, "represents signature subject", params.UnicodeString, []string{"ps.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + PsSignatureIssuer: {PsSignatureIssuer, "represents signature CA", params.UnicodeString, []string{"ps.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + PsSignatureAfter: {PsSignatureAfter, "represents certificate expiration date", params.Time, []string{"ps.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + PsSignatureBefore: {PsSignatureBefore, "represents certificate enrollment date", params.Time, []string{"ps.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + + PsPeNumSections: {PsPeNumSections, "number of PE sections", params.Uint16, []string{"ps.pe.nsections < 5"}, nil, nil}, + PsPeNumSymbols: {PsPeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"ps.pe.nsymbols > 230"}, nil, nil}, + PsPeBaseAddress: {PsPeBaseAddress, "executable base address", params.Address, []string{"ps.pe.address.base = '140000000'"}, nil, nil}, + PsPeEntrypoint: {PsPeEntrypoint, "address of the entrypoint function", params.Address, []string{"ps.pe.address.entrypoint = '20110'"}, nil, nil}, + PsPeSymbols: {PsPeSymbols, "imported symbols", params.Slice, []string{"ps.pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, nil, nil}, + PsPeImports: {PsPeImports, "imported dynamic linked libraries", params.Slice, []string{"ps.pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, nil, nil}, + PsPeResources: {PsPeResources, "version resources", params.Map, []string{"ps.pe.resources[FileDescription] = 'Notepad'"}, nil, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { + for _, c := range s { + switch { + case unicode.IsLower(c): + case unicode.IsUpper(c): + case unicode.IsNumber(c): + case c == '_': + default: + return false + } + } + return true + }}}, + PsPeCompany: {PsPeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.company = 'Microsoft Corporation'"}, nil, nil}, + PsPeCopyright: {PsPeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"ps.pe.copyright = '© Microsoft Corporation'"}, nil, nil}, + PsPeDescription: {PsPeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.description = 'Notepad'"}, nil, nil}, + PsPeFileName: {PsPeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.name = 'NOTEPAD.EXE'"}, nil, nil}, + PsPeFileVersion: {PsPeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, nil, nil}, + PsPeProduct: {PsPeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product = 'Microsoft® Windows® Operating System'"}, nil, nil}, + PsPeProductVersion: {PsPeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product.version = '10.0.18362.693'"}, nil, nil}, + PsPeImphash: {PsPeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, nil, nil}, + PsPeIsDotnet: {PsPeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"ps.pe.is_dotnet"}, nil, nil}, + PsPeAnomalies: {PsPeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"ps.pe.anomalies in ('number of sections is 0')"}, nil, nil}, + PsPeIsModified: {PsPeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"ps.pe.is_modified"}, nil, nil}, + + ThreadBasePrio: {ThreadBasePrio, "scheduler priority of the thread", params.Int8, []string{"thread.prio = 5"}, nil, nil}, + ThreadIOPrio: {ThreadIOPrio, "I/O priority hint for scheduling I/O operations", params.Int8, []string{"thread.io.prio = 4"}, nil, nil}, + ThreadPagePrio: {ThreadPagePrio, "memory page priority hint for memory pages accessed by the thread", params.Int8, []string{"thread.page.prio = 12"}, nil, nil}, + ThreadKstackBase: {ThreadKstackBase, "base address of the thread's kernel space stack", params.Address, []string{"thread.kstack.base = 'a65d800000'"}, nil, nil}, + ThreadKstackLimit: {ThreadKstackLimit, "limit of the thread's kernel space stack", params.Address, []string{"thread.kstack.limit = 'a85d800000'"}, nil, nil}, + ThreadUstackBase: {ThreadUstackBase, "base address of the thread's user space stack", params.Address, []string{"thread.ustack.base = '7ffe0000'"}, nil, nil}, + ThreadUstackLimit: {ThreadUstackLimit, "limit of the thread's user space stack", params.Address, []string{"thread.ustack.limit = '8ffe0000'"}, nil, nil}, + ThreadEntrypoint: {ThreadEntrypoint, "starting address of the function to be executed by the thread", params.Address, []string{"thread.entrypoint = '7efe0000'"}, &Deprecation{Since: "2.3.0", Fields: []Field{ThreadStartAddress}}, nil}, + ThreadStartAddress: {ThreadStartAddress, "thread start address", params.Address, []string{"thread.start_address = '7efe0000'"}, nil, nil}, + ThreadStartAddressSymbol: {ThreadStartAddressSymbol, "thread start address symbol", params.UnicodeString, []string{"thread.start_address.symbol = 'LoadModule'"}, nil, nil}, + ThreadStartAddressModule: {ThreadStartAddressModule, "thread start address module", params.UnicodeString, []string{"thread.start_address.module endswith 'kernel32.dll'"}, nil, nil}, + ThreadPID: {ThreadPID, "the process identifier where the thread is created", params.Uint32, []string{"evt.pid != thread.pid"}, nil, nil}, + ThreadTEB: {ThreadTEB, "the base address of the thread environment block", params.Address, []string{"thread.teb_address = '8f30893000'"}, nil, nil}, + ThreadAccessMask: {ThreadAccessMask, "thread desired access rights", params.AnsiString, []string{"thread.access.mask = '0x1fffff'"}, nil, nil}, + ThreadAccessMaskNames: {ThreadAccessMaskNames, "thread desired access rights as a string list", params.Slice, []string{"thread.access.mask.names in ('IMPERSONATE')"}, nil, nil}, + ThreadAccessStatus: {ThreadAccessStatus, "thread access status", params.UnicodeString, []string{"thread.access.status = 'success'"}, nil, nil}, + ThreadCallstackSummary: {ThreadCallstackSummary, "callstack summary", params.UnicodeString, []string{"thread.callstack.summary contains 'ntdll.dll|KERNELBASE.dll'"}, nil, nil}, + ThreadCallstackKernelSummary: {ThreadCallstackKernelSummary, "kernel thread callstack summary", params.UnicodeString, []string{"thread.callstack.kernel_summary contains 'fileinfo.sys|ntoskrnl.exe|FLTMGR.SYS|ntoskrnl.exe'"}, nil, nil}, + ThreadCallstackDetail: {ThreadCallstackDetail, "detailed information of each stack frame", params.UnicodeString, []string{"thread.callstack.detail contains 'KERNELBASE.dll!CreateProcessW'"}, nil, nil}, + ThreadCallstackModules: {ThreadCallstackModules, "list of modules comprising the callstack", params.Slice, []string{"thread.callstack.modules in ('C:\\WINDOWS\\System32\\KERNELBASE.dll')", "base(thread.callstack.modules[7]) = 'ntdll.dll'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, + ThreadCallstackSymbols: {ThreadCallstackSymbols, "list of symbols comprising the callstack", params.Slice, []string{"thread.callstack.symbols in ('ntdll.dll!NtCreateProcess')", "thread.callstack.symbols[3] = 'ntdll!NtCreateProcess'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, + ThreadCallstackAllocationSizes: {ThreadCallstackAllocationSizes, "allocation sizes of private pages", params.Slice, []string{"thread.callstack.allocation_sizes > 10000"}, nil, nil}, + ThreadCallstackProtections: {ThreadCallstackProtections, "page protections masks of each frame", params.Slice, []string{"thread.callstack.protections in ('RWX', 'WX')"}, nil, nil}, + ThreadCallstackCallsiteLeadingAssembly: {ThreadCallstackCallsiteLeadingAssembly, "callsite leading assembly instructions", params.Slice, []string{"thread.callstack.callsite_leading_assembly in ('mov r10,rcx', 'syscall')"}, nil, nil}, + ThreadCallstackCallsiteTrailingAssembly: {ThreadCallstackCallsiteTrailingAssembly, "callsite trailing assembly instructions", params.Slice, []string{"thread.callstack.callsite_trailing_assembly in ('add esp, 0xab')"}, nil, nil}, + ThreadCallstackIsUnbacked: {ThreadCallstackIsUnbacked, "indicates if the callstack contains unbacked regions", params.Bool, []string{"thread.callstack.is_unbacked"}, nil, nil}, + ThreadCallstackAddresses: {ThreadCallstackAddresses, "list of all stack return addresses", params.Slice, []string{"thread.callstack.addresses in ('7ffb5c1d0396')"}, nil, nil}, + ThreadCallstackFinalUserModuleName: {ThreadCallstackFinalUserModuleName, "final user space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_user_module.name != 'ntdll.dll'"}, nil, nil}, + ThreadCallstackFinalUserModulePath: {ThreadCallstackFinalUserModulePath, "final user space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_user_module.path imatches '?:\\Windows\\System32\\ntdll.dll'"}, nil, nil}, + ThreadCallstackFinalUserSymbolName: {ThreadCallstackFinalUserSymbolName, "final user space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_user_symbol.name imatches 'CreateProcess*'"}, nil, nil}, + ThreadCallstackFinalKernelModuleName: {ThreadCallstackFinalKernelModuleName, "final kernel space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_kernel_module.name = 'FLTMGR.SYS'"}, nil, nil}, + ThreadCallstackFinalKernelModulePath: {ThreadCallstackFinalKernelModulePath, "final kernel space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_kernel_module.path imatches '?:\\WINDOWS\\System32\\drivers\\FLTMGR.SYS'"}, nil, nil}, + ThreadCallstackFinalKernelSymbolName: {ThreadCallstackFinalKernelSymbolName, "final kernel space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_kernel_symbol.name = 'FltGetStreamContext'"}, nil, nil}, + ThreadCallstackFinalUserModuleSignatureExists: {ThreadCallstackFinalUserModuleSignatureExists, "signature status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.exists = true"}, nil, nil}, + ThreadCallstackFinalUserModuleSignatureTrusted: {ThreadCallstackFinalUserModuleSignatureTrusted, "signature trust status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.trusted = true"}, nil, nil}, + ThreadCallstackFinalUserModuleSignatureIssuer: {ThreadCallstackFinalUserModuleSignatureIssuer, "final user space stack frame module signature certificate issuer", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.issuer imatches '*Microsoft Corporation*'"}, nil, nil}, + ThreadCallstackFinalUserModuleSignatureSubject: {ThreadCallstackFinalUserModuleSignatureSubject, "final user space stack frame module signature certificate subject", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.subject imatches '*Microsoft Windows*'"}, nil, nil}, + + ImagePath: {ImagePath, "full image path", params.UnicodeString, []string{"image.path = 'C:\\Windows\\System32\\advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePath}}, nil}, + ImageName: {ImageName, "image name", params.UnicodeString, []string{"image.name = 'advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleName}}, nil}, + ImageBase: {ImageBase, "the base address of process in which the image is loaded", params.Address, []string{"image.base.address = 'a65d800000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleBase}}, nil}, + ImageChecksum: {ImageChecksum, "image checksum", params.Uint32, []string{"image.checksum = 746424"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleChecksum}}, nil}, + ImageSize: {ImageSize, "image size", params.Uint32, []string{"image.size > 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSize}}, nil}, + ImageDefaultAddress: {ImageDefaultAddress, "default image address", params.Address, []string{"image.default.address = '7efe0000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleDefaultAddress}}, nil}, + ImagePID: {ImagePID, "target process identifier", params.Uint32, []string{"image.pid = 80"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePID}}, nil}, + ImageSignatureType: {ImageSignatureType, "image signature type", params.AnsiString, []string{"image.signature.type != 'NONE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureType}}, nil}, + ImageSignatureLevel: {ImageSignatureLevel, "image signature level", params.AnsiString, []string{"image.signature.level = 'AUTHENTICODE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureLevel}}, nil}, + ImageCertSerial: {ImageCertSerial, "image certificate serial number", params.UnicodeString, []string{"image.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSerial}}, nil}, + ImageCertSubject: {ImageCertSubject, "image certificate subject", params.UnicodeString, []string{"image.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSubject}}, nil}, + ImageCertIssuer: {ImageCertIssuer, "image certificate CA", params.UnicodeString, []string{"image.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureIssuer}}, nil}, + ImageCertAfter: {ImageCertAfter, "image certificate expiration date", params.Time, []string{"image.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureAfter}}, nil}, + ImageCertBefore: {ImageCertBefore, "image certificate enrollment date", params.Time, []string{"image.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureBefore}}, nil}, + ImageIsDLL: {ImageIsDLL, "indicates if the loaded image is a DLL", params.Bool, []string{"image.is_dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDLL}}, nil}, + ImageIsDriver: {ImageIsDriver, "indicates if the loaded image is a driver", params.Bool, []string{"image.is_driver'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDriver}}, nil}, + ImageIsExecutable: {ImageIsExecutable, "indicates if the loaded image is an executable", params.Bool, []string{"image.is_exec'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsExecutable}}, nil}, + ImageIsDotnet: {ImageIsDotnet, "indicates if the loaded image is a .NET assembly", params.Bool, []string{"image.is_dotnet'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDotnet}}, nil}, + ModulePath: {ModulePath, "full module path", params.UnicodeString, []string{"module.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, + ModulePathStem: {ModulePathStem, "module path stem", params.UnicodeString, []string{"module.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, + ModuleName: {ModuleName, "module name", params.UnicodeString, []string{"module.name = 'advapi32.dll'"}, nil, nil}, + ModuleBase: {ModuleBase, "the base address of process in which the module is loaded", params.Address, []string{"module.base.address = 'a65d800000'"}, nil, nil}, + ModuleChecksum: {ModuleChecksum, "module checksum", params.Uint32, []string{"module.checksum = 746424"}, nil, nil}, + ModuleSize: {ModuleSize, "module size", params.Uint32, []string{"module.size > 1024"}, nil, nil}, + ModuleDefaultAddress: {ModuleDefaultAddress, "default module address", params.Address, []string{"module.default_address = '7efe0000'"}, nil, nil}, + ModulePID: {ModulePID, "target process identifier", params.Uint32, []string{"module.pid = 80"}, nil, nil}, + ModuleSignatureType: {ModuleSignatureType, "module signature type", params.AnsiString, []string{"module.signature.type != 'NONE'"}, nil, nil}, + ModuleSignatureLevel: {ModuleSignatureLevel, "module signature level", params.AnsiString, []string{"module.signature.level = 'AUTHENTICODE'"}, nil, nil}, + ModuleSignatureExists: {ModuleSignatureExists, "indicates if the module is signed", params.Bool, []string{"module.signature.exists = true"}, nil, nil}, + ModuleSignatureTrusted: {ModuleSignatureTrusted, "indicates if the module signature is trusted", params.Bool, []string{"module.signature.trusted = false"}, nil, nil}, + ModuleSignatureSerial: {ModuleSignatureSerial, "module certificate serial number", params.UnicodeString, []string{"module.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, + ModuleSignatureSubject: {ModuleSignatureSubject, "module certificate subject", params.UnicodeString, []string{"module.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + ModuleSignatureIssuer: {ModuleSignatureIssuer, "module certificate CA", params.UnicodeString, []string{"module.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + ModuleSignatureAfter: {ModuleSignatureAfter, "module certificate expiration date", params.Time, []string{"module.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + ModuleSignatureBefore: {ModuleSignatureBefore, "module certificate enrollment date", params.Time, []string{"module.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + ModuleIsDLL: {ModuleIsDLL, "indicates if the loaded module is a DLL", params.Bool, []string{"module.is_dll'"}, nil, nil}, + ModuleIsDriver: {ModuleIsDriver, "indicates if the loaded module is a driver", params.Bool, []string{"module.is_driver'"}, nil, nil}, + ModuleIsExecutable: {ModuleIsExecutable, "indicates if the loaded module is an executable", params.Bool, []string{"module.is_exec'"}, nil, nil}, + ModuleIsDotnet: {ModuleIsDotnet, "indicates if the loaded module is a .NET assembly", params.Bool, []string{"module.pe.is_dotnet'"}, nil, nil}, + DllPath: {DllPath, "full dll path", params.UnicodeString, []string{"dll.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, + DllPathStem: {DllPathStem, "dll path stem", params.UnicodeString, []string{"dll.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, + DllName: {DllName, "module name", params.UnicodeString, []string{"dll.name = 'advapi32.dll'"}, nil, nil}, + DllBase: {DllBase, "the base address of process in which the DLL is loaded", params.Address, []string{"dll.base = 'a65d800000'"}, nil, nil}, + DllSize: {DllSize, "dll virtual mapped size", params.Uint32, []string{"dll.size > 1024"}, nil, nil}, + DllPID: {DllPID, "target process identifier", params.Uint32, []string{"dll.pid = 80"}, nil, nil}, + DllSignatureType: {DllSignatureType, "dll signature type", params.AnsiString, []string{"dll.signature.type != 'NONE'"}, nil, nil}, + DllSignatureLevel: {DllSignatureLevel, "dll signature level", params.AnsiString, []string{"dll.signature.level = 'AUTHENTICODE'"}, nil, nil}, + DllSignatureExists: {DllSignatureExists, "indicates if the dll is signed", params.Bool, []string{"dll.signature.exists = true"}, nil, nil}, + DllSignatureTrusted: {DllSignatureTrusted, "indicates if the dll signature is trusted", params.Bool, []string{"dll.signature.trusted = false"}, nil, nil}, + DllSignatureSerial: {DllSignatureSerial, "dll certificate serial number", params.UnicodeString, []string{"dll.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, + DllSignatureSubject: {DllSignatureSubject, "dll certificate subject", params.UnicodeString, []string{"dll.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + DllSignatureIssuer: {DllSignatureIssuer, "dll certificate CA", params.UnicodeString, []string{"dll.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + DllSignatureAfter: {DllSignatureAfter, "moddllule certificate expiration date", params.Time, []string{"dll.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + DllSignatureBefore: {DllSignatureBefore, "dll certificate enrollment date", params.Time, []string{"dll.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + DllIsDotnet: {DllIsDotnet, "indicates if the loaded dll is a .NET assembly", params.Bool, []string{"dll.pe.is_dotnet'"}, nil, nil}, + + FileObject: {FileObject, "file object address", params.Uint64, []string{"file.object = 18446738026482168384"}, nil, nil}, + FilePath: {FilePath, "full file path", params.UnicodeString, []string{"file.path = 'C:\\Windows\\System32'"}, nil, nil}, + FilePathStem: {FilePathStem, "full file path without extension", params.UnicodeString, []string{"file.path.stem = 'C:\\Windows\\System32\\cmd'"}, nil, nil}, + FileName: {FileName, "full file name", params.UnicodeString, []string{"file.name contains 'mimikatz'"}, nil, nil}, + FileOperation: {FileOperation, "file operation", params.AnsiString, []string{"file.operation = 'open'"}, nil, nil}, + FileShareMask: {FileShareMask, "file share mask", params.AnsiString, []string{"file.share.mask = 'READ'"}, &Deprecation{Since: "3.1.0", Fields: []Field{FileShareMode}}, nil}, + FileShareMode: {FileShareMask, "file share mode", params.AnsiString, []string{"file.share_mode = 'DENY'"}, nil, nil}, + FileIOSize: {FileIOSize, "file I/O size", params.Uint32, []string{"file.io.size > 512"}, nil, nil}, + FileOffset: {FileOffset, "file offset", params.Uint64, []string{"file.offset = 1024"}, nil, nil}, + FileType: {FileType, "file type", params.AnsiString, []string{"file.type = 'directory'"}, nil, nil}, + FileExtension: {FileExtension, "file extension", params.AnsiString, []string{"file.extension = '.dll'"}, nil, nil}, + FileAttributes: {FileAttributes, "file attributes", params.Slice, []string{"file.attributes in ('archive', 'hidden')"}, nil, nil}, + FileStatus: {FileStatus, "file operation status message", params.UnicodeString, []string{"file.status != 'success'"}, nil, nil}, + FileViewBase: {FileViewBase, "view base address", params.Address, []string{"file.view.base = '25d42170000'"}, nil, nil}, + FileViewSize: {FileViewSize, "size of the mapped view", params.Uint64, []string{"file.view.size > 1024"}, nil, nil}, + FileViewType: {FileViewType, "type of the mapped view section", params.Enum, []string{"file.view.type = 'IMAGE'"}, nil, nil}, + FileViewProtection: {FileViewProtection, "protection rights of the section view", params.AnsiString, []string{"file.view.protection = 'READONLY'"}, nil, nil}, + FileIsDLL: {FileIsDLL, "indicates if the created file is a DLL", params.Bool, []string{"file.is_dll'"}, nil, nil}, + FileIsDriver: {FileIsDriver, "indicates if the created file is a driver", params.Bool, []string{"file.is_driver'"}, nil, nil}, + FileIsExecutable: {FileIsExecutable, "indicates if the created file is an executable", params.Bool, []string{"file.is_exec'"}, nil, nil}, + FilePID: {FilePID, "denotes the process id performing file operation", params.PID, []string{"file.pid = 4"}, nil, nil}, + FileKey: {FileKey, "uniquely identifies the file object", params.Uint64, []string{"file.key = 12446738026482168384"}, nil, nil}, + FileInfoClass: {FileInfoClass, "identifies the file information class", params.Enum, []string{"file.info_class = 'Allocation'"}, nil, nil}, + FileInfoAllocationSize: {FileInfoAllocationSize, "file allocation size", params.Uint64, []string{"file.info.allocation_size > 645400"}, nil, nil}, + FileInfoEOFSize: {FileInfoEOFSize, "file EOF size", params.Uint64, []string{"file.info.eof_size > 1000"}, nil, nil}, + FileInfoIsDispositionDeleteFile: {FileInfoIsDispositionDeleteFile, "indicates if the file is deleted when its handle is closed", params.Bool, []string{"file.info.is_disposition_file_delete = true"}, nil, nil}, + + RegistryPath: {RegistryPath, "fully qualified registry path", params.UnicodeString, []string{"registry.path = 'HKEY_LOCAL_MACHINE\\SYSTEM'"}, nil, nil}, + RegistryKeyName: {RegistryKeyName, "registry key name", params.UnicodeString, []string{"registry.key.name = 'CurrentControlSet'"}, nil, nil}, + RegistryKCB: {RegistryKCB, "registry KCB address", params.Address, []string{"registry.kcb = 'FFFFB905D60C2268'"}, nil, nil}, + RegistryValue: {RegistryValue, "registry value name", params.UnicodeString, []string{"registry.value = 'Epoch'"}, nil, nil}, + RegistryValueType: {RegistryValueType, "type of registry value", params.UnicodeString, []string{"registry.value.type = 'REG_SZ'"}, nil, nil}, + RegistryData: {RegistryData, "registry value captured data", params.Object, []string{"registry.data = '%SystemRoot%'"}, nil, nil}, + RegistryStatus: {RegistryStatus, "status of registry operation", params.UnicodeString, []string{"registry.status != 'success'"}, nil, nil}, + + NetDIP: {NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil}, + NetSIP: {NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil}, + NetDport: {NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil}, + NetSport: {NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil}, + NetDportName: {NetDportName, "destination port name", params.AnsiString, []string{"net.dport.name = 'dns'"}, nil, nil}, + NetSportName: {NetSportName, "source port name", params.AnsiString, []string{"net.sport.name = 'http'"}, nil, nil}, + NetL4Proto: {NetL4Proto, "layer 4 protocol name", params.AnsiString, []string{"net.l4.proto = 'TCP"}, nil, nil}, + NetPacketSize: {NetPacketSize, "packet size", params.Uint32, []string{"net.size > 512"}, nil, nil}, + NetSIPNames: {NetSIPNames, "source IP names", params.Slice, []string{"net.sip.names in ('github.com.')"}, nil, nil}, + NetDIPNames: {NetDIPNames, "destination IP names", params.Slice, []string{"net.dip.names in ('github.com.')"}, nil, nil}, + + HandleID: {HandleID, "handle identifier", params.Uint16, []string{"handle.id = 24"}, nil, nil}, + HandleObject: {HandleObject, "handle object address", params.Address, []string{"handle.object = 'FFFFB905DBF61988'"}, nil, nil}, + HandleName: {HandleName, "handle name", params.UnicodeString, []string{"handle.name = '\\Device\\NamedPipe\\chrome.12644.28.105826381'"}, nil, nil}, + HandleType: {HandleType, "handle type", params.AnsiString, []string{"handle.type = 'Mutant'"}, nil, nil}, + + PeNumSections: {PeNumSections, "number of sections", params.Uint16, []string{"pe.nsections < 5"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSections}}, nil}, + PeNumSymbols: {PeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"pe.nsymbols > 230"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSymbols}}, nil}, + PeBaseAddress: {PeBaseAddress, "image base address", params.Address, []string{"pe.address.base = '140000000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeBaseAddress}}, nil}, + PeEntrypoint: {PeEntrypoint, "address of the entrypoint function", params.Address, []string{"pe.address.entrypoint = '20110'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeEntrypoint}}, nil}, + PeSymbols: {PeSymbols, "imported symbols", params.Slice, []string{"pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeSymbols}}, nil}, + PeImports: {PeImports, "imported dynamic linked libraries", params.Slice, []string{"pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImports}}, nil}, + + PeResources: {PeResources, "version resources", params.Map, []string{"pe.resources[FileDescription] = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeResources}}, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { + for _, c := range s { + switch { + case unicode.IsLower(c): + case unicode.IsUpper(c): + case unicode.IsNumber(c): + case c == '_': + default: + return false + } + } + return true + }}}, + + PeCompany: {PeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"pe.company = 'Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCompany}}, nil}, + PeCopyright: {PeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"pe.copyright = '© Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCopyright}}, nil}, + PeDescription: {PeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"pe.description = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeDescription}}, nil}, + PeFileName: {PeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"pe.file.name = 'NOTEPAD.EXE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileName}}, nil}, + PeFileVersion: {PeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileVersion}}, nil}, + PeProduct: {PeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"pe.product = 'Microsoft® Windows® Operating System'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProduct}}, nil}, + PeProductVersion: {PeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"pe.product.version = '10.0.18362.693'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProductVersion}}, nil}, + PeIsDLL: {PeIsDLL, "indicates if the loaded image or created file is a DLL", params.Bool, []string{"pe.is_dll'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDLL, ImageIsDLL}}, nil}, + PeIsDriver: {PeIsDriver, "indicates if the loaded image or created file is a driver", params.Bool, []string{"pe.is_driver'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDriver, ImageIsDriver}}, nil}, + PeIsExecutable: {PeIsExecutable, "indicates if the loaded image or created file is an executable", params.Bool, []string{"pe.is_exec'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsExecutable, ImageIsExecutable}}, nil}, + PeImphash: {PeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImphash}}, nil}, + PeIsDotnet: {PeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"pe.is_dotnet"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsDotnet}}, nil}, + PeAnomalies: {PeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"pe.anomalies in ('number of sections is 0')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeAnomalies}}, nil}, + PeIsSigned: {PeIsSigned, "indicates if the PE has embedded or catalog signature", params.Bool, []string{"pe.is_signed"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureExists}}, nil}, + PeIsTrusted: {PeIsTrusted, "indicates if the PE certificate chain is trusted", params.Bool, []string{"pe.is_trusted"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureTrusted}}, nil}, + PeCertSerial: {PeCertSerial, "PE certificate serial number", params.UnicodeString, []string{"pe.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSerial}}, nil}, + PeCertSubject: {PeCertSubject, "PE certificate subject", params.UnicodeString, []string{"pe.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSubject}}, nil}, + PeCertIssuer: {PeCertIssuer, "PE certificate CA", params.UnicodeString, []string{"pe.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureIssuer}}, nil}, + PeCertAfter: {PeCertAfter, "PE certificate expiration date", params.Time, []string{"pe.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureAfter}}, nil}, + PeCertBefore: {PeCertBefore, "PE certificate enrollment date", params.Time, []string{"pe.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureBefore}}, nil}, + PeIsModified: {PeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"pe.is_modified"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsModified}}, nil}, + + MemBaseAddress: {MemBaseAddress, "region base address", params.Address, []string{"mem.address = '211d13f2000'"}, nil, nil}, + MemRegionSize: {MemRegionSize, "region size", params.Uint64, []string{"mem.size > 438272"}, nil, nil}, + MemAllocType: {MemAllocType, "region allocation or release type", params.Flags, []string{"mem.alloc = 'COMMIT'"}, nil, nil}, + MemPageType: {MemPageType, "page type of the allocated region", params.Enum, []string{"mem.type = 'PRIVATE'"}, nil, nil}, + MemProtection: {MemProtection, "allocated region protection type", params.Enum, []string{"mem.protection = 'READWRITE'"}, nil, nil}, + MemProtectionMask: {MemProtectionMask, "allocated region protection in mask notation", params.Enum, []string{"mem.protection.mask = 'RWX'"}, nil, nil}, + + DNSName: {DNSName, "dns query name", params.UnicodeString, []string{"dns.name = 'example.org'"}, nil, nil}, + DNSRR: {DNSRR, "dns resource record type", params.AnsiString, []string{"dns.rr = 'AA'"}, nil, nil}, + DNSOptions: {DNSOptions, "dns query options", params.Flags64, []string{"dns.options in ('ADDRCONFIG', 'DUAL_ADDR')"}, nil, nil}, + DNSRcode: {DNSRR, "dns response status", params.AnsiString, []string{"dns.rcode = 'NXDOMAIN'"}, nil, nil}, + DNSAnswers: {DNSAnswers, "dns response answers", params.Slice, []string{"dns.answers in ('o.lencr.edgesuite.net', 'a1887.dscq.akamai.net')"}, nil, nil}, + + ThreadpoolPoolID: {ThreadpoolPoolID, "thread pool identifier", params.Address, []string{"threadpool.id = '20f5fc02440'"}, nil, nil}, + ThreadpoolTaskID: {ThreadpoolTaskID, "thread pool task identifier", params.Address, []string{"threadpool.task.id = '20f7ecd21f8'"}, nil, nil}, + ThreadpoolCallbackAddress: {ThreadpoolCallbackAddress, "thread pool callback address", params.Address, []string{"threadpool.callback.address = '7ff868739ed0'"}, nil, nil}, + ThreadpoolCallbackSymbol: {ThreadpoolCallbackSymbol, "thread pool callback symbol", params.UnicodeString, []string{"threadpool.callback.symbol = 'RtlDestroyQueryDebugBuffer'"}, nil, nil}, + ThreadpoolCallbackModule: {ThreadpoolCallbackModule, "thread pool module containing the callback symbol", params.UnicodeString, []string{"threadpool.callback.module contains 'ntdll.dll'"}, nil, nil}, + ThreadpoolCallbackContext: {ThreadpoolCallbackContext, "thread pool callback context address", params.Address, []string{"threadpool.callback.context = '1df41e07bd0'"}, nil, nil}, + ThreadpoolCallbackContextRip: {ThreadpoolCallbackContextRip, "thread pool callback thread context instruction pointer", params.Address, []string{"threadpool.callback.context.rip = '1df42ffc1f8'"}, nil, nil}, + ThreadpoolCallbackContextRipSymbol: {ThreadpoolCallbackContextRipSymbol, "thread pool callback thread context instruction pointer symbol", params.UnicodeString, []string{"threadpool.callback.context.rip.symbol = 'VirtualProtect'"}, nil, nil}, + ThreadpoolCallbackContextRipModule: {ThreadpoolCallbackContextRipModule, "thread pool callback thread context instruction pointer symbol module", params.UnicodeString, []string{"threadpool.callback.context.rip.module contains 'ntdll.dll'"}, nil, nil}, + ThreadpoolSubprocessTag: {ThreadpoolSubprocessTag, "thread pool service identifier", params.Address, []string{"threadpool.subprocess_tag = '10d'"}, nil, nil}, + ThreadpoolTimerDuetime: {ThreadpoolTimerDuetime, "thread pool timer due time", params.Uint64, []string{"threadpool.timer.duetime > 10"}, nil, nil}, + ThreadpoolTimerSubqueue: {ThreadpoolTimerSubqueue, "thread pool timer subqueue address", params.Address, []string{"threadpool.timer.subqueue = '1db401703e8'"}, nil, nil}, + ThreadpoolTimer: {ThreadpoolTimer, "thread pool timer address", params.Address, []string{"threadpool.timer.address = '3e8'"}, nil, nil}, + ThreadpoolTimerPeriod: {ThreadpoolTimerPeriod, "thread pool timer period", params.Uint32, []string{"threadpool.timer.period = 0'"}, nil, nil}, + ThreadpoolTimerWindow: {ThreadpoolTimerWindow, "thread pool timer tolerate period", params.Uint32, []string{"threadpool.timer.window = 0'"}, nil, nil}, + ThreadpoolTimerAbsolute: {ThreadpoolTimerAbsolute, "indicates if the thread pool timer is absolute or relative", params.Bool, []string{"threadpool.timer.is_absolute = true'"}, nil, nil}, +} + +// ArgumentOf returns argument data for the specified field. +func ArgumentOf(name string) *Argument { + f, ok := fields[Field(name)] + if !ok { + // this can happen for pseudo fields + return nil + } + return f.Argument +} + +// IsField returns true if the provided string is a +// recognized field or pseudo field. Otherwise, it +// returns false. +func IsField(name string) bool { + if _, ok := fields[Field(name)]; ok || IsPseudoField(Field(name)) { + return true + } + return false +} diff --git a/pkg/filter/filter_test.go b/pkg/filter/filter_test.go index b79aa493d..b01d0559d 100644 --- a/pkg/filter/filter_test.go +++ b/pkg/filter/filter_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/filter/ql/functions/get_reg_value_test.go b/pkg/filter/ql/functions/get_reg_value_test.go index 659475da4..5ff6c5b3a 100644 --- a/pkg/filter/ql/functions/get_reg_value_test.go +++ b/pkg/filter/ql/functions/get_reg_value_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/filter/ql/functions/minidump.go b/pkg/filter/ql/functions/minidump.go index 1c9ae4fba..4a10a7f4d 100644 --- a/pkg/filter/ql/functions/minidump.go +++ b/pkg/filter/ql/functions/minidump.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/fs/file_class.go b/pkg/fs/file_class.go index bef4b028b..d7a7658cd 100644 --- a/pkg/fs/file_class.go +++ b/pkg/fs/file_class.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/pe/header.go b/pkg/pe/header.go index 9e9d30e3b..32584f506 100644 --- a/pkg/pe/header.go +++ b/pkg/pe/header.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/pe/header_test.go b/pkg/pe/header_test.go index db97a6a5f..f09b8f206 100644 --- a/pkg/pe/header_test.go +++ b/pkg/pe/header_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/pe/parser.go b/pkg/pe/parser.go index d8a42be33..5606681a1 100644 --- a/pkg/pe/parser.go +++ b/pkg/pe/parser.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/pe/parser_test.go b/pkg/pe/parser_test.go index 28e3fe645..ab4871075 100644 --- a/pkg/pe/parser_test.go +++ b/pkg/pe/parser_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/rules/compiler_test.go b/pkg/rules/compiler_test.go index 4bb2ab9bc..b6df59ac8 100644 --- a/pkg/rules/compiler_test.go +++ b/pkg/rules/compiler_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/rules/engine_test.go b/pkg/rules/engine_test.go index 96974545c..19cef6c04 100644 --- a/pkg/rules/engine_test.go +++ b/pkg/rules/engine_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/rules/sequence_test.go b/pkg/rules/sequence_test.go index dcf475307..8c6b029ff 100644 --- a/pkg/rules/sequence_test.go +++ b/pkg/rules/sequence_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/dbghelp.go b/pkg/sys/dbghelp.go index 76a82b88a..7e3d1d666 100644 --- a/pkg/sys/dbghelp.go +++ b/pkg/sys/dbghelp.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/device.go b/pkg/sys/device.go index 7792f3fdc..f6e37bf4f 100644 --- a/pkg/sys/device.go +++ b/pkg/sys/device.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/device_test.go b/pkg/sys/device_test.go index 3fad62088..3cd882fd4 100644 --- a/pkg/sys/device_test.go +++ b/pkg/sys/device_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/doc.go b/pkg/sys/doc.go index d6c5f3682..7ed29f652 100644 --- a/pkg/sys/doc.go +++ b/pkg/sys/doc.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/fs.go b/pkg/sys/fs.go index 62bcc074e..bc776181b 100644 --- a/pkg/sys/fs.go +++ b/pkg/sys/fs.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/handle.go b/pkg/sys/handle.go index f52ee778d..a6a500843 100644 --- a/pkg/sys/handle.go +++ b/pkg/sys/handle.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/mem.go b/pkg/sys/mem.go index 27ad1d1ac..4118d0b64 100644 --- a/pkg/sys/mem.go +++ b/pkg/sys/mem.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/object.go b/pkg/sys/object.go index 4ff2ae9a7..d2530515d 100644 --- a/pkg/sys/object.go +++ b/pkg/sys/object.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/privilege.go b/pkg/sys/privilege.go index fc331ce20..45f2ab5a5 100644 --- a/pkg/sys/privilege.go +++ b/pkg/sys/privilege.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/process.go b/pkg/sys/process.go index 08af5ea9f..977f8fddd 100644 --- a/pkg/sys/process.go +++ b/pkg/sys/process.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/process_test.go b/pkg/sys/process_test.go index 89f1503b1..720444440 100644 --- a/pkg/sys/process_test.go +++ b/pkg/sys/process_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/rid.go b/pkg/sys/rid.go index 1c60763de..fcc8d3536 100644 --- a/pkg/sys/rid.go +++ b/pkg/sys/rid.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/shell.go b/pkg/sys/shell.go index fb9b3d0fe..3f333004b 100644 --- a/pkg/sys/shell.go +++ b/pkg/sys/shell.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/syscall.go b/pkg/sys/syscall.go index aeac71b66..bdfafbb30 100644 --- a/pkg/sys/syscall.go +++ b/pkg/sys/syscall.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/trust.go b/pkg/sys/trust.go index ce28d867a..89a8f9ce4 100644 --- a/pkg/sys/trust.go +++ b/pkg/sys/trust.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/trust_test.go b/pkg/sys/trust_test.go index f4bcceafa..a603f5efd 100644 --- a/pkg/sys/trust_test.go +++ b/pkg/sys/trust_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/util.go b/pkg/sys/util.go index a159aee65..734f7866f 100644 --- a/pkg/sys/util.go +++ b/pkg/sys/util.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/window.go b/pkg/sys/window.go index 05706fec1..3b1c595e7 100644 --- a/pkg/sys/window.go +++ b/pkg/sys/window.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/wts.go b/pkg/sys/wts.go index 872d21ef1..2caeccd95 100644 --- a/pkg/sys/wts.go +++ b/pkg/sys/wts.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/sys/zsyscall_windows.go b/pkg/sys/zsyscall_windows.go index ca8c39bd3..7cd596c99 100644 --- a/pkg/sys/zsyscall_windows.go +++ b/pkg/sys/zsyscall_windows.go @@ -1,3 +1,5 @@ +//go:build windows + // Code generated by 'go generate'; DO NOT EDIT. package sys diff --git a/pkg/util/colorizer/colorizer.go b/pkg/util/colorizer/colorizer.go index 6f70c1996..2081b82cb 100644 --- a/pkg/util/colorizer/colorizer.go +++ b/pkg/util/colorizer/colorizer.go @@ -22,8 +22,6 @@ import ( "os" "runtime" "strings" - - "golang.org/x/sys/windows" ) // escape sequences @@ -122,20 +120,3 @@ func IsAnsiEnabled() bool { } return true } - -// enableWindowsVT activates ENABLE_VIRTUAL_TERMINAL_PROCESSING on the Windows -// console handle so that ANSI escape sequences are interpreted rather than -// printed verbatim. Returns false on pre-Windows 10 hosts where this flag -// is unavailable. -func enableWindowsVT() bool { - handle := windows.Handle(os.Stdout.Fd()) - var mode uint32 - if err := windows.GetConsoleMode(handle, &mode); err != nil { - return false - } - const vtFlag = 0x0004 // ENABLE_VIRTUAL_TERMINAL_PROCESSING - if mode&vtFlag != 0 { - return true - } - return windows.SetConsoleMode(handle, mode|vtFlag) == nil -} diff --git a/pkg/util/colorizer/colorizer_stub.go b/pkg/util/colorizer/colorizer_stub.go new file mode 100644 index 000000000..81c41e660 --- /dev/null +++ b/pkg/util/colorizer/colorizer_stub.go @@ -0,0 +1,23 @@ +//go:build !windows + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package colorizer + +func enableWindowsVT() bool { return false } diff --git a/pkg/util/colorizer/colorizer_windows.go b/pkg/util/colorizer/colorizer_windows.go new file mode 100644 index 000000000..7018ef0fc --- /dev/null +++ b/pkg/util/colorizer/colorizer_windows.go @@ -0,0 +1,44 @@ +//go:build windows + +/* + * Copyright 2021-present by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package colorizer + +import ( + "os" + + "golang.org/x/sys/windows" +) + +// enableWindowsVT activates ENABLE_VIRTUAL_TERMINAL_PROCESSING on the Windows +// console handle so that ANSI escape sequences are interpreted rather than +// printed verbatim. Returns false on pre-Windows 10 hosts where this flag +// is unavailable. +func enableWindowsVT() bool { + handle := windows.Handle(os.Stdout.Fd()) + var mode uint32 + if err := windows.GetConsoleMode(handle, &mode); err != nil { + return false + } + const vtFlag = 0x0004 // ENABLE_VIRTUAL_TERMINAL_PROCESSING + if mode&vtFlag != 0 { + return true + } + return windows.SetConsoleMode(handle, mode|vtFlag) == nil +} diff --git a/pkg/util/eventlog/eventid.go b/pkg/util/eventlog/eventid.go index f65617e88..f63511821 100644 --- a/pkg/util/eventlog/eventid.go +++ b/pkg/util/eventlog/eventid.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/util/eventlog/eventid_test.go b/pkg/util/eventlog/eventid_test.go index 9797676ae..04ce8561c 100644 --- a/pkg/util/eventlog/eventid_test.go +++ b/pkg/util/eventlog/eventid_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/util/eventlog/eventlog.go b/pkg/util/eventlog/eventlog.go index bedcaf323..95803e26d 100644 --- a/pkg/util/eventlog/eventlog.go +++ b/pkg/util/eventlog/eventlog.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/eventsource_linux_stub.go b/pkg/util/ntstatus/status_linux.go similarity index 55% rename from pkg/config/eventsource_linux_stub.go rename to pkg/util/ntstatus/status_linux.go index 1b61dfc0a..5c0e02286 100644 --- a/pkg/config/eventsource_linux_stub.go +++ b/pkg/util/ntstatus/status_linux.go @@ -1,4 +1,4 @@ -//go:build linux && !eventsource +//go:build linux /* * Copyright 2026 by Nedim Sabic Sabic @@ -18,24 +18,18 @@ * limitations under the License. */ -package config +package ntstatus -import ( - "github.com/spf13/pflag" - "github.com/spf13/viper" -) +import "fmt" -type EventSourceConfig struct { - EnableProcessEvents bool - EnableFileIOEvents bool - EnableNetEvents bool - EnableMemEvents bool -} - -func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { - flags.Bool("eventsource.enable-process", true, "Determines whether process events are collected") -} +// Success determines the success system message +const Success = "Success" -func (c *EventSourceConfig) initFromViper(v *viper.Viper) { - c.EnableProcessEvents = v.GetBool("eventsource.enable-process") +// FormatMessage resolves a status code to a human-readable message. +// On Linux this returns a hex representation for non-zero codes. +func FormatMessage(status uint32) string { + if status == 0 { + return Success + } + return fmt.Sprintf("0x%x", status) } diff --git a/pkg/util/ntstatus/status.go b/pkg/util/ntstatus/status_windows.go similarity index 99% rename from pkg/util/ntstatus/status.go rename to pkg/util/ntstatus/status_windows.go index b7506c51e..6aaaa2b0c 100644 --- a/pkg/util/ntstatus/status.go +++ b/pkg/util/ntstatus/status_windows.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io From e119ecb8cc794918ef64ce8fd5f70539912d0b23 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 20:50:04 +0200 Subject: [PATCH 13/65] fix(build): Remove superseded Windows-gated catalog copies Drop the old _windows.go param and field catalogs now that the shared names live in platform-neutral files. --- pkg/event/params/types_windows.go | 142 ------------------------------ 1 file changed, 142 deletions(-) delete mode 100644 pkg/event/params/types_windows.go diff --git a/pkg/event/params/types_windows.go b/pkg/event/params/types_windows.go deleted file mode 100644 index aec8c363d..000000000 --- a/pkg/event/params/types_windows.go +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2021-present by Nedim Sabic Sabic - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package params - -// Type defines event parameter type -type Type uint16 - -const ( - // Null is a null parameter type - Null Type = iota - // UnicodeString a string of 16-bit characters. By default, assumed to have been encoded using UTF-16LE - UnicodeString - // AnsiString a string of 8-bit characters - AnsiString - // Int8 a signed 8-bit integer - Int8 - // Uint8 an unsigned 8-bit integer - Uint8 - // Int16 a signed 16-bit integer - Int16 - // Uint16 an unsigned 16-bit integer - Uint16 - // Int32 a signed 32-bit integer - Int32 - // Uint32 an unsigned 32-bit integer - Uint32 - // Int64 a signed 64-bit integer - Int64 - // Uint64 an unsigned 64-bit integer - Uint64 - // Float an IEEE 4-byte floating-point number - Float - // Double an IEEE 8-byte floating-point number - Double - // Bool a 32-bit value where 0 is false and 1 is true - Bool - // Binary is a binary data of variable size. The size must be specified in the data definition as a constant or a reference to another (integer) data item.For an IP V6 address, the data should be an IN6_ADDR structure. - // For a socket address, the data should be a SOCKADDR_STORAGE structure. The AF_INET, AF_INET6, and AF_LINK address families are supported - Binary - // GUID is a GUID structure. On output, the GUID is rendered in the registry string form, {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} - GUID - // Pointer an unsigned 32-bit or 64-bit pointer value. The size depends on the architecture of the computer logging the event - Pointer - // SID a security identifier (SID) structure that uniquely identifies a user or group - SID - // PID is the process identifier - PID - // TID is the thread identifier - TID - // WbemSID is the Web-Based Enterprise Management security identifier. - WbemSID - // Port represents the endpoint port number - Port - // IP is the IP address - IP - // IPv4 is the IPv4 address - IPv4 - // IPv6 is the IPv6 address - IPv6 - // Time represents the timestamp - Time - // Slice represents a collection of items - Slice - // Enum represents an enumeration - Enum - // Map represents a map - Map - // Object is the generic object type - Object - // DOSPath represents the file system path in DOS device notation - DOSPath - // Path represents the file system path with normalized drive letter notation - Path - // Status represents the system error code message - Status - // Key represents the registry key - Key - // Flags represents a bitmask of flags - Flags - // Flags64 represents an extended (64 bits) bitmask of flags - Flags64 - // Address is the memory address reference - Address - // HandleType represents the handle type such as Mutex or File - HandleType -) - -// String return the type string representation. -func (t Type) String() string { - switch t { - case UnicodeString: - return "unicode" - case AnsiString: - return "ansi" - case Int8: - return "int8" - case Uint8: - return "uint8" - case Int16: - return "int16" - case Uint16: - return "uint16" - case Int32: - return "int32" - case Uint32: - return "uint32" - case Int64: - return "int64" - case Uint64: - return "uint64" - case SID, WbemSID: - return "sid" - case TID: - return "tid" - case PID: - return "pid" - case Port: - return "port" - case IPv6: - return "ipv6" - case IPv4: - return "ipv4" - default: - return "unknown" - } -} From 9f6ca591f11ab24d80dd1bf7e2901ecce454d62b Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 20:50:04 +0200 Subject: [PATCH 14/65] feat(event): Add Linux event helpers and parameter formatting Provide Linux implementations for event helpers, parameter construction/formatting, callstack basics, and PE section stubs so shared packages compile without the Windows ETW path. --- pkg/callstack/callstack_linux.go | 46 ++++++++++- pkg/event/event_linux.go | 94 ++++++++++++++++++++++ pkg/event/event_linux_test.go | 46 +++++++++++ pkg/event/formatter_linux.go | 73 +++++++++++++++++ pkg/event/marshaller_linux.go | 34 ++++++++ pkg/event/param.go | 50 ------------ pkg/event/param_capture_linux.go | 29 +++++++ pkg/event/param_capture_windows.go | 75 +++++++++++++++++ pkg/event/param_linux.go | 125 +++++++++++++++++++++++++++++ pkg/event/stackwalk_linux.go | 36 +++++++++ pkg/event/types_linux.go | 13 +++ pkg/pe/types_linux.go | 36 +++++++++ 12 files changed, 606 insertions(+), 51 deletions(-) create mode 100644 pkg/event/event_linux.go create mode 100644 pkg/event/event_linux_test.go create mode 100644 pkg/event/formatter_linux.go create mode 100644 pkg/event/marshaller_linux.go create mode 100644 pkg/event/param_capture_linux.go create mode 100644 pkg/event/param_capture_windows.go create mode 100644 pkg/event/param_linux.go create mode 100644 pkg/event/stackwalk_linux.go create mode 100644 pkg/pe/types_linux.go diff --git a/pkg/callstack/callstack_linux.go b/pkg/callstack/callstack_linux.go index b333f77f2..268634821 100644 --- a/pkg/callstack/callstack_linux.go +++ b/pkg/callstack/callstack_linux.go @@ -20,8 +20,52 @@ package callstack +import "strings" + +// Callstack is a sequence of stack frames. type Callstack []Frame +// Frame describes a single stack frame. type Frame struct { - PID uint32 + PID uint32 + Addr uint64 + Symbol string + Module string +} + +func (s *Callstack) Init(n int) { + *s = make(Callstack, 0, n) +} + +func (s *Callstack) PushFrame(f Frame) { + *s = append(*s, f) +} + +func (s *Callstack) FrameAt(i int) Frame { + if i < 0 || i >= len(*s) { + return Frame{} + } + return (*s)[i] +} + +func (s *Callstack) Depth() int { return len(*s) } + +func (s *Callstack) IsEmpty() bool { return s.Depth() == 0 } + +func (s Callstack) String() string { + if len(s) == 0 { + return "" + } + parts := make([]string, 0, len(s)) + for _, f := range s { + if f.Symbol != "" { + parts = append(parts, f.Symbol) + continue + } + parts = append(parts, f.Module) + } + return strings.Join(parts, " < ") } + +// Colorize returns a plain string representation on Linux. +func (s Callstack) Colorize() string { return s.String() } diff --git a/pkg/event/event_linux.go b/pkg/event/event_linux.go new file mode 100644 index 000000000..ff1ecad48 --- /dev/null +++ b/pkg/event/event_linux.go @@ -0,0 +1,94 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "encoding/json" + "fmt" + + capver "github.com/rabbitstack/fibratus/pkg/cap/version" +) + +func (e *Event) IsCreateFile() bool { return false } +func (e *Event) IsCreateProcess() bool { return e.Type == CreateProcess || e.Type == Execve || e.Type == Clone } +func (e *Event) IsCreateProcessInternal() bool { return false } +func (e *Event) IsCreateThread() bool { return false } +func (e *Event) IsCloseFile() bool { return false } +func (e *Event) IsCreateHandle() bool { return false } +func (e *Event) IsCloseHandle() bool { return false } +func (e *Event) IsDeleteFile() bool { return false } +func (e *Event) IsRenameFile() bool { return false } +func (e *Event) IsEnumDirectory() bool { return false } +func (e *Event) IsTerminateProcess() bool { return e.Type == TerminateProcess || e.Type == Exit } +func (e *Event) IsTerminateThread() bool { return false } +func (e *Event) IsUnloadModule() bool { return false } +func (e *Event) IsLoadModule() bool { return false } +func (e *Event) IsLoadModuleInternal() bool { return false } +func (e *Event) IsModuleRundown() bool { return false } +func (e *Event) IsFileOpEnd() bool { return false } +func (e *Event) IsRegSetValue() bool { return false } +func (e *Event) IsRegSetValueInternal() bool { return false } +func (e *Event) IsRegCreateKey() bool { return false } +func (e *Event) IsProcessRundown() bool { return e.Type == ProcessRundown } +func (e *Event) IsProcessRundownInternal() bool { return false } +func (e *Event) IsVirtualAlloc() bool { return false } +func (e *Event) IsMapViewFile() bool { return false } +func (e *Event) IsUnmapViewFile() bool { return false } +func (e *Event) IsStackWalk() bool { return false } +func (e *Event) IsOpenThread() bool { return false } +func (e *Event) IsOpenProcess() bool { return false } +func (e *Event) IsNetworkTCP() bool { return false } +func (e *Event) IsNetworkUDP() bool { return false } +func (e *Event) IsDNS() bool { return false } +func (e *Event) IsRundown() bool { return e.IsProcessRundown() } +func (e *Event) IsSuccess() bool { return true } +func (e *Event) IsRundownProcessed() bool { return false } +func (e *Event) IsCreateDisposition() bool { return false } +func (e *Event) IsOverwriteDisposition() bool { return false } +func (e *Event) IsOpenDisposition() bool { return false } +func (e *Event) IsCreateRemoteThread() bool { return false } +func (e *Event) IsSurrogateProcess() bool { return false } +func (e *Event) IsSystemPid() bool { return e.PID == 0 || e.PID == 1 } +func (e *Event) IsState() bool { return e.Type.OnlyState() } + +// PartialKey returns a key used to deduplicate sequence partials. +// On Linux this combines the event type with the process identifier. +func (e *Event) PartialKey() uint64 { + return uint64(e.Type)<<32 | uint64(e.PID) +} + +// HookID returns the stable bitset index for this type. +func (t Type) HookID() uint16 { return uint16(t) } + +// MarshalJSON serializes the event to JSON. +func (e *Event) MarshalJSON() []byte { + b, err := json.Marshal(e) + if err != nil { + return []byte("{}") + } + return b +} + +// UnmarshalRaw recovers the event from a capture buffer. +// Captures are not wired on Linux yet. +func (e *Event) UnmarshalRaw(_ []byte, _ capver.Version) error { + return fmt.Errorf("event capture unmarshalling is not implemented on Linux") +} diff --git a/pkg/event/event_linux_test.go b/pkg/event/event_linux_test.go new file mode 100644 index 000000000..4365e32c6 --- /dev/null +++ b/pkg/event/event_linux_test.go @@ -0,0 +1,46 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestLinuxParamBasics(t *testing.T) { + p := NewParam(params.ProcessID, params.PID, uint32(42)) + require.NotNil(t, p) + assert.Equal(t, "42", p.String()) + + pars := Params{} + pars.Append(params.ProcessName, params.UnicodeString, "bash") + assert.Equal(t, "bash", pars.MustGetString(params.ProcessName)) +} + +func TestLinuxEventTypeHelpers(t *testing.T) { + e := &Event{Type: Execve, PID: 1} + assert.True(t, e.IsCreateProcess()) + assert.False(t, e.IsStackWalk()) + assert.Equal(t, uint16(Execve), e.Type.HookID()) +} diff --git a/pkg/event/formatter_linux.go b/pkg/event/formatter_linux.go new file mode 100644 index 000000000..720e3cf43 --- /dev/null +++ b/pkg/event/formatter_linux.go @@ -0,0 +1,73 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import "strconv" + +// Format applies the template on the provided event. +func (f *Formatter) Format(evt *Event) []byte { + if evt == nil { + return []byte{} + } + values := map[string]interface{}{ + ts: evt.Timestamp.String(), + pid: strconv.FormatUint(uint64(evt.PID), 10), + tid: strconv.FormatUint(uint64(evt.Tid), 10), + seq: strconv.FormatUint(evt.Seq, 10), + cpu: strconv.FormatUint(uint64(evt.CPU), 10), + typ: evt.Name, + cat: evt.Category, + desc: evt.Description, + host: evt.Host, + meta: evt.Metadata.String(), + parameters: evt.Params.String(), + } + + ps := evt.PS + if ps != nil { + values[proc] = ps.Name + values[ppid] = strconv.FormatUint(uint64(ps.Ppid), 10) + values[cwd] = ps.Cwd + values[exe] = ps.Exe + values[cmd] = ps.Cmdline + values[sid] = ps.SID + parent := ps.Parent + if parent != nil { + values[pproc] = parent.Name + values[pexe] = parent.Exe + values[pcmd] = parent.Cmdline + } + if ps.PE != nil { + values[pe] = ps.PE.String() + } + } + if !evt.Callstack.IsEmpty() { + values[cstack] = evt.Callstack.String() + } + + if f.expandParamsDot { + for _, par := range evt.Params { + values[".Params."+caser.String(par.Name)] = par.String() + } + } + + return f.t.ExecuteString(values) +} diff --git a/pkg/event/marshaller_linux.go b/pkg/event/marshaller_linux.go new file mode 100644 index 000000000..b187ec12e --- /dev/null +++ b/pkg/event/marshaller_linux.go @@ -0,0 +1,34 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +var ( + // SerializeHandles indicates if handles are serialized as part of the process state + SerializeHandles bool + // SerializeThreads indicates if threads are serialized as part of the process state + SerializeThreads bool + // SerializeModules indicates if modules are serialized as part of the process state + SerializeModules bool + // SerializePE indicates if PE metadata are serialized as part of the process state + SerializePE bool + // SerializeEnvs indicates if the environment variables are serialized as part of the process state + SerializeEnvs bool +) diff --git a/pkg/event/param.go b/pkg/event/param.go index 58f003865..ec0a9ba9f 100644 --- a/pkg/event/param.go +++ b/pkg/event/param.go @@ -26,10 +26,7 @@ import ( "strings" "time" - "github.com/rabbitstack/fibratus/pkg/fs" - "github.com/rabbitstack/fibratus/pkg/network" "github.com/rabbitstack/fibratus/pkg/util/colorizer" - "github.com/rabbitstack/fibratus/pkg/util/key" "github.com/rabbitstack/fibratus/pkg/util/ntstatus" "github.com/rabbitstack/fibratus/pkg/util/va" "golang.org/x/text/cases" @@ -125,53 +122,6 @@ func (p Param) CaptureType() params.Type { // Params is the type that represents the sequence of event parameters type Params map[string]*Param -// NewParamFromCapture builds a parameter instance from the restored capture state. -func NewParamFromCapture(name string, typ params.Type, value params.Value, etype Type) *Param { - var enum ParamEnum - var flags ParamFlags - switch name { - case params.FileOperation: - enum = fs.FileCreateDispositions - case params.FileCreateOptions: - flags = FileCreateOptionsFlags - case params.FileAttributes: - flags = FileAttributeFlags - case params.FileShareMask: - flags = FileShareModeFlags - case params.FileInfoClass: - enum = fs.FileInfoClasses - case params.FileType: - enum = fs.FileTypes - case params.NetL4Proto: - enum = network.ProtoNames - case params.RegValueType: - enum = key.RegistryValueTypes - case params.MemAllocType: - flags = MemAllocationFlags - case params.FileViewSectionType: - enum = ViewSectionTypes - case params.DNSOpts: - flags = DNSOptsFlags - case params.DNSRR: - enum = DNSRecordTypes - case params.DNSRcode: - enum = DNSResponseCodes - case params.DesiredAccess: - if etype == OpenProcess { - flags = PsAccessRightFlags - } else { - flags = ThreadAccessRightFlags - } - case params.MemProtect: - if etype == VirtualAlloc || etype == VirtualFree { - flags = MemProtectionFlags - } else { - flags = ViewProtectionFlags - } - } - return &Param{Name: name, Type: typ, Value: value, Enum: enum, Flags: flags} -} - // Append adds a new parameter with the specified name, type and value. func (pars Params) Append(name string, typ params.Type, value params.Value, opts ...ParamOption) Params { pars[name] = NewParam(name, typ, value, opts...) diff --git a/pkg/event/param_capture_linux.go b/pkg/event/param_capture_linux.go new file mode 100644 index 000000000..b55f892e9 --- /dev/null +++ b/pkg/event/param_capture_linux.go @@ -0,0 +1,29 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import "github.com/rabbitstack/fibratus/pkg/event/params" + +// NewParamFromCapture builds a parameter instance from the restored capture state. +// Captures are not wired on Linux yet, so enrichment is deferred. +func NewParamFromCapture(name string, typ params.Type, value params.Value, _ Type) *Param { + return &Param{Name: name, Type: typ, Value: value} +} diff --git a/pkg/event/param_capture_windows.go b/pkg/event/param_capture_windows.go new file mode 100644 index 000000000..e64a44002 --- /dev/null +++ b/pkg/event/param_capture_windows.go @@ -0,0 +1,75 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/fs" + "github.com/rabbitstack/fibratus/pkg/network" + "github.com/rabbitstack/fibratus/pkg/util/key" +) + +// NewParamFromCapture builds a parameter instance from the restored capture state. +func NewParamFromCapture(name string, typ params.Type, value params.Value, etype Type) *Param { + var enum ParamEnum + var flags ParamFlags + switch name { + case params.FileOperation: + enum = fs.FileCreateDispositions + case params.FileCreateOptions: + flags = FileCreateOptionsFlags + case params.FileAttributes: + flags = FileAttributeFlags + case params.FileShareMask: + flags = FileShareModeFlags + case params.FileInfoClass: + enum = fs.FileInfoClasses + case params.FileType: + enum = fs.FileTypes + case params.NetL4Proto: + enum = network.ProtoNames + case params.RegValueType: + enum = key.RegistryValueTypes + case params.MemAllocType: + flags = MemAllocationFlags + case params.FileViewSectionType: + enum = ViewSectionTypes + case params.DNSOpts: + flags = DNSOptsFlags + case params.DNSRR: + enum = DNSRecordTypes + case params.DNSRcode: + enum = DNSResponseCodes + case params.DesiredAccess: + if etype == OpenProcess { + flags = PsAccessRightFlags + } else { + flags = ThreadAccessRightFlags + } + case params.MemProtect: + if etype == VirtualAlloc || etype == VirtualFree { + flags = MemProtectionFlags + } else { + flags = ViewProtectionFlags + } + } + return &Param{Name: name, Type: typ, Value: value, Enum: enum, Flags: flags} +} diff --git a/pkg/event/param_linux.go b/pkg/event/param_linux.go new file mode 100644 index 000000000..9c80d5a05 --- /dev/null +++ b/pkg/event/param_linux.go @@ -0,0 +1,125 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "fmt" + "net" + "strconv" + "strings" + "time" + + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/util/ntstatus" + "github.com/rabbitstack/fibratus/pkg/util/va" +) + +// NewParam creates a new event parameter. +func NewParam(name string, typ params.Type, value params.Value, options ...ParamOption) *Param { + var opts paramOpts + for _, opt := range options { + opt(&opts) + } + return &Param{Name: name, Type: typ, Value: value, Flags: opts.flags, Enum: opts.enum} +} + +// String returns the string representation of the parameter value. +func (p Param) String() string { + if p.Value == nil { + return "" + } + switch p.Type { + case params.UnicodeString, params.AnsiString, params.Path, params.DOSPath, params.Key, params.HandleType: + if s, ok := p.Value.(string); ok { + return s + } + return fmt.Sprintf("%v", p.Value) + case params.Status: + v, ok := p.Value.(uint32) + if !ok { + return "" + } + return ntstatus.FormatMessage(v) + case params.Address: + v, ok := p.Value.(uint64) + if !ok { + return "" + } + return va.Address(v).String() + case params.Int8: + return strconv.Itoa(int(p.Value.(int8))) + case params.Uint8: + return strconv.Itoa(int(p.Value.(uint8))) + case params.Int16: + return strconv.Itoa(int(p.Value.(int16))) + case params.Uint16, params.Port: + return strconv.Itoa(int(p.Value.(uint16))) + case params.Uint32, params.PID, params.TID: + return strconv.Itoa(int(p.Value.(uint32))) + case params.Int32: + return strconv.Itoa(int(p.Value.(int32))) + case params.Uint64: + return strconv.FormatUint(p.Value.(uint64), 10) + case params.Int64: + return strconv.Itoa(int(p.Value.(int64))) + case params.IPv4, params.IPv6: + return p.Value.(net.IP).String() + case params.Bool: + return strconv.FormatBool(p.Value.(bool)) + case params.Float: + return strconv.FormatFloat(float64(p.Value.(float32)), 'f', 6, 32) + case params.Double: + return strconv.FormatFloat(p.Value.(float64), 'f', 6, 64) + case params.Time: + return p.Value.(time.Time).String() + case params.Enum: + if p.Enum == nil { + return "" + } + v, ok := p.Value.(uint32) + if !ok { + return "" + } + return p.Enum[v] + case params.Flags, params.Flags64: + if p.Flags == nil { + return "" + } + switch v := p.Value.(type) { + case uint32: + return p.Flags.String(uint64(v)) + case uint64: + return p.Flags.String(v) + default: + return "" + } + case params.Slice: + switch slice := p.Value.(type) { + case []string: + return strings.Join(slice, ",") + default: + return fmt.Sprintf("%v", slice) + } + case params.Binary: + return string(p.Value.([]byte)) + } + return fmt.Sprintf("%v", p.Value) +} diff --git a/pkg/event/stackwalk_linux.go b/pkg/event/stackwalk_linux.go new file mode 100644 index 000000000..0f92b68fe --- /dev/null +++ b/pkg/event/stackwalk_linux.go @@ -0,0 +1,36 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +// StackwalkDecorator is a no-op on Linux. Callstack enrichment +// via StackWalk events is a Windows ETW concept. +type StackwalkDecorator struct{} + +// NewStackwalkDecorator constructs a no-op stackwalk decorator. +func NewStackwalkDecorator(_ *Queue) *StackwalkDecorator { + return &StackwalkDecorator{} +} + +func (s *StackwalkDecorator) Push(_ *Event) {} + +func (s *StackwalkDecorator) Pop(e *Event) *Event { return e } + +func (s *StackwalkDecorator) Stop() {} diff --git a/pkg/event/types_linux.go b/pkg/event/types_linux.go index 91ef4be20..60af41af5 100644 --- a/pkg/event/types_linux.go +++ b/pkg/event/types_linux.go @@ -42,6 +42,19 @@ const ( Exit ProcessRundown Clone + + // Windows-only event types stubbed so shared consumers (rules compiler) + // compile on Linux. These are never emitted by the Linux event source. + RegOpenKey + OpenThread + OpenProcess + SetFileInformation + CreateFile + MapViewFile + UnmapViewFile + SetThreadContext + CreateSymbolicLinkObject + CreateThread ) func (t Type) String() string { diff --git a/pkg/pe/types_linux.go b/pkg/pe/types_linux.go new file mode 100644 index 000000000..783d077be --- /dev/null +++ b/pkg/pe/types_linux.go @@ -0,0 +1,36 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package pe + +import "fmt" + +// Sec contains section attributes. On Linux this is only used so +// shared filter foreach helpers can compile against pe.Sec. +type Sec struct { + Name string + Size uint32 + Entropy float64 + Md5 string +} + +func (s Sec) String() string { + return fmt.Sprintf("Name: %s, Size: %d, Entropy: %f, Md5: %s", s.Name, s.Size, s.Entropy, s.Md5) +} From b8dcc6b4299d0cdb4a36f2a2c483585ea7344292 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 20:50:09 +0200 Subject: [PATCH 15/65] feat(ps): Implement LinuxSnapshotter and ProcessKey Add the in-memory Linux process snapshotter, ProcessKey identity, and PS fields needed by shared formatters and filter foreach helpers. --- pkg/ps/process_key.go | 25 +++++ pkg/ps/snapshotter_linux.go | 151 +++++++++++++++++++++++++++++++ pkg/ps/snapshotter_linux_test.go | 48 ++++++++++ pkg/ps/types/types_linux.go | 39 ++++++-- 4 files changed, 255 insertions(+), 8 deletions(-) create mode 100644 pkg/ps/process_key.go create mode 100644 pkg/ps/snapshotter_linux.go create mode 100644 pkg/ps/snapshotter_linux_test.go diff --git a/pkg/ps/process_key.go b/pkg/ps/process_key.go new file mode 100644 index 000000000..0834f50aa --- /dev/null +++ b/pkg/ps/process_key.go @@ -0,0 +1,25 @@ +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ps + +// ProcessKey uniquely identifies a process instance across PID reuse. +type ProcessKey struct { + PID uint32 + StartBootTime uint64 +} diff --git a/pkg/ps/snapshotter_linux.go b/pkg/ps/snapshotter_linux.go new file mode 100644 index 000000000..10ca04fe4 --- /dev/null +++ b/pkg/ps/snapshotter_linux.go @@ -0,0 +1,151 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ps + +import ( + "sync" + + "github.com/rabbitstack/fibratus/pkg/event" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/rabbitstack/fibratus/pkg/util/va" +) + +// LinuxSnapshotter stores Linux process state for enrichment and rule evaluation. +type LinuxSnapshotter interface { + Resolver + Write(*event.Event) error + Remove(*event.Event) error + UpsertSnapshot(*pstypes.PS) + Put(*pstypes.PS) + Size() uint32 + Close() error + AddThread(*event.Event) error + RemoveThread(pid uint32, tid uint32) error + AddMmap(*event.Event) error + RemoveMmap(pid uint32, addr va.Address) error +} + +type linuxSnapshotter struct { + mu sync.RWMutex + procs map[uint32]*pstypes.PS +} + +// NewLinuxSnapshotter builds an in-memory Linux process snapshotter. +func NewLinuxSnapshotter() LinuxSnapshotter { + return &linuxSnapshotter{procs: make(map[uint32]*pstypes.PS)} +} + +func (s *linuxSnapshotter) Find(pid uint32) (bool, *pstypes.PS) { + s.mu.RLock() + defer s.mu.RUnlock() + ps, ok := s.procs[pid] + return ok, ps +} + +func (s *linuxSnapshotter) Put(ps *pstypes.PS) { + if ps == nil { + return + } + s.mu.Lock() + defer s.mu.Unlock() + s.procs[ps.PID] = ps +} + +func (s *linuxSnapshotter) UpsertSnapshot(ps *pstypes.PS) { + s.Put(ps) +} + +func (s *linuxSnapshotter) Write(evt *event.Event) error { + if evt == nil || evt.PS == nil { + return nil + } + s.Put(evt.PS) + return nil +} + +func (s *linuxSnapshotter) Remove(evt *event.Event) error { + if evt == nil { + return nil + } + s.mu.Lock() + defer s.mu.Unlock() + delete(s.procs, evt.PID) + return nil +} + +func (s *linuxSnapshotter) Size() uint32 { + s.mu.RLock() + defer s.mu.RUnlock() + return uint32(len(s.procs)) +} + +func (s *linuxSnapshotter) Close() error { + s.mu.Lock() + defer s.mu.Unlock() + s.procs = make(map[uint32]*pstypes.PS) + return nil +} + +func (s *linuxSnapshotter) AddThread(evt *event.Event) error { + if evt == nil || evt.PS == nil { + return nil + } + ok, ps := s.Find(evt.PID) + if !ok || ps == nil { + s.Put(evt.PS) + return nil + } + ps.AddThread(pstypes.Thread{Tid: evt.Tid, Pid: evt.PID}) + return nil +} + +func (s *linuxSnapshotter) RemoveThread(pid uint32, tid uint32) error { + ok, ps := s.Find(pid) + if !ok || ps == nil { + return nil + } + ps.RemoveThread(tid) + return nil +} + +func (s *linuxSnapshotter) AddMmap(evt *event.Event) error { + if evt == nil || evt.PS == nil { + return nil + } + ok, ps := s.Find(evt.PID) + if !ok || ps == nil { + s.Put(evt.PS) + return nil + } + for _, mmap := range evt.PS.Mmaps { + ps.AddMmap(mmap) + } + return nil +} + +func (s *linuxSnapshotter) RemoveMmap(pid uint32, addr va.Address) error { + ok, ps := s.Find(pid) + if !ok || ps == nil { + return nil + } + ps.RemoveMmap(addr) + return nil +} diff --git a/pkg/ps/snapshotter_linux_test.go b/pkg/ps/snapshotter_linux_test.go new file mode 100644 index 000000000..6638ed6a7 --- /dev/null +++ b/pkg/ps/snapshotter_linux_test.go @@ -0,0 +1,48 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ps + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/event" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestLinuxSnapshotterFindPut(t *testing.T) { + s := NewLinuxSnapshotter() + ps := &pstypes.PS{PID: 100, Name: "bash", StartBootTime: 1234} + s.Put(ps) + + ok, got := s.Find(100) + require.True(t, ok) + assert.Equal(t, "bash", got.Name) + assert.Equal(t, uint32(1), s.Size()) + + require.NoError(t, s.Write(&event.Event{PID: 200, PS: &pstypes.PS{PID: 200, Name: "sh"}})) + assert.Equal(t, uint32(2), s.Size()) + + require.NoError(t, s.Remove(&event.Event{PID: 100})) + ok, _ = s.Find(100) + assert.False(t, ok) +} diff --git a/pkg/ps/types/types_linux.go b/pkg/ps/types/types_linux.go index 138ef02f8..8c6ffc906 100644 --- a/pkg/ps/types/types_linux.go +++ b/pkg/ps/types/types_linux.go @@ -29,6 +29,13 @@ import ( "github.com/rabbitstack/fibratus/pkg/util/va" ) +// PE is a placeholder for PE metadata on Linux builds. +// Linux process images are ELF; this field exists so shared +// formatters/templates compile without Windows PE types. +type PE struct{} + +func (p *PE) String() string { return "" } + type PS struct { sync.RWMutex PID uint32 `json:"pid"` @@ -42,12 +49,22 @@ type PS struct { StartBootTime uint64 `json:"start_boot_time"` UID uint32 `json:"uid"` GID uint32 `json:"gid"` - Username string `json:"username"` - Envs map[string]string `json:"envs"` - Parent *PS `json:"parent"` - Threads map[uint32]Thread `json:"-"` - Mmaps []Mmap `json:"mmaps"` - Modules []Module `json:"modules"` + Username string `json:"username"` + Domain string `json:"domain"` + SID string `json:"sid"` + SessionID uint32 `json:"session_id"` + TokenIntegrityLevel string `json:"token_integrity_level"` + TokenElevationType string `json:"token_elevation_type"` + IsTokenElevated bool `json:"is_token_elevated"` + IsWOW64 bool `json:"is_wow_64"` + IsPackaged bool `json:"is_packaged"` + IsProtected bool `json:"is_protected"` + Envs map[string]string `json:"envs"` + Parent *PS `json:"parent"` + Threads map[uint32]Thread `json:"-"` + Mmaps []Mmap `json:"mmaps"` + Modules []Module `json:"modules"` + PE *PE `json:"-"` } func (ps *PS) String() string { @@ -67,14 +84,20 @@ func (ps *PS) Ancestors() []string { } type Thread struct { - Tid uint32 - Pid uint32 + Tid uint32 + Pid uint32 + StartAddress va.Address + UstackBase va.Address + UstackLimit va.Address + KstackBase va.Address + KstackLimit va.Address } type Module struct { Name string BaseAddress va.Address Size uint64 + Checksum uint32 } type Mmap struct { From a6acbf7f430e64eb94ebab0bc61e74febc9ff686 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 20:50:10 +0200 Subject: [PATCH 16/65] refactor(rules): Migrate shared consumers to ps.Resolver Switch the rule engine, compiler, sequence state, and filter options to the narrow Resolver interface, and add Linux filter/action stubs so rules compile and evaluate on Linux. --- pkg/filter/accessor.go | 70 +----------- pkg/filter/accessor_linux.go | 117 ++++++++++++++++++++ pkg/filter/accessor_narrow_linux.go | 42 +++++++ pkg/filter/accessor_narrow_windows.go | 104 +++++++++++++++++ pkg/filter/accessor_stubs_linux.go | 46 ++++++++ pkg/filter/accessor_windows.go | 4 +- pkg/filter/filter_linux.go | 110 ++++++++++++++++++ pkg/filter/filter_windows.go | 6 +- pkg/filter/ql/function.go | 89 +-------------- pkg/filter/ql/function_callstack_linux.go | 53 +++++++++ pkg/filter/ql/function_callstack_windows.go | 117 ++++++++++++++++++++ pkg/filter/ql/functions/minidump_linux.go | 39 +++++++ pkg/rules/action/isolate_linux.go | 32 ++++++ pkg/rules/action/kill_linux.go | 29 +++++ pkg/rules/compiler.go | 4 +- pkg/rules/engine.go | 4 +- pkg/rules/engine_linux_test.go | 36 ++++++ pkg/rules/sequence.go | 4 +- 18 files changed, 740 insertions(+), 166 deletions(-) create mode 100644 pkg/filter/accessor_linux.go create mode 100644 pkg/filter/accessor_narrow_linux.go create mode 100644 pkg/filter/accessor_narrow_windows.go create mode 100644 pkg/filter/accessor_stubs_linux.go create mode 100644 pkg/filter/filter_linux.go create mode 100644 pkg/filter/ql/function_callstack_linux.go create mode 100644 pkg/filter/ql/function_callstack_windows.go create mode 100644 pkg/filter/ql/functions/minidump_linux.go create mode 100644 pkg/rules/action/isolate_linux.go create mode 100644 pkg/rules/action/kill_linux.go create mode 100644 pkg/rules/engine_linux_test.go diff --git a/pkg/filter/accessor.go b/pkg/filter/accessor.go index ea14a98f8..cb093e90d 100644 --- a/pkg/filter/accessor.go +++ b/pkg/filter/accessor.go @@ -152,75 +152,7 @@ func (*evtAccessor) Get(f Field, evt *event.Event) (params.Value, error) { // as a regular LHS/RHS component, used as a function parameter or // referenced in the bound field. func (f *filter) narrowAccessors() { - var ( - removeEvtAccessor = true - removePsAccessor = true - removeThreadAccessor = true - removeModuleAccessor = true - removeFileAccessor = true - removeRegistryAccessor = true - removeNetworkAccessor = true - removePEAccessor = true - removeMemAccessor = true - removeDNSAccessor = true - ) - - for _, field := range f.fields { - switch { - case field.Name.IsEvtField() || field.Name.IsKevtField(): - removeEvtAccessor = false - case field.Name.IsPeField(): - removePEAccessor = false - case field.Name.IsPsField(): - removePsAccessor = false - case field.Name.IsThreadField(): - removeThreadAccessor = false - case field.Name.IsImageField() || field.Name.IsModuleField(): - removeModuleAccessor = false - case field.Name.IsFileField(): - removeFileAccessor = false - case field.Name.IsRegistryField(): - removeRegistryAccessor = false - case field.Name.IsNetworkField(): - removeNetworkAccessor = false - case field.Name.IsMemField(): - removeMemAccessor = false - case field.Name.IsDNSField(): - removeDNSAccessor = false - } - } - - if removeEvtAccessor { - f.removeAccessor(&evtAccessor{}) - } - if removePsAccessor { - f.removeAccessor(&psAccessor{}) - } - if removeThreadAccessor { - f.removeAccessor(&threadAccessor{}) - } - if removeModuleAccessor { - f.removeAccessor(&moduleAccessor{}) - } - if removeFileAccessor { - f.removeAccessor(&fileAccessor{}) - } - if removeRegistryAccessor { - f.removeAccessor(®istryAccessor{}) - } - if removeNetworkAccessor { - f.removeAccessor(&networkAccessor{}) - } - if removePEAccessor { - f.removeAccessor(&peAccessor{}) - } - if removeMemAccessor { - f.removeAccessor(&memAccessor{}) - } - if removeDNSAccessor { - f.removeAccessor(&dnsAccessor{}) - } - + f.pruneUnusedAccessors() for _, accessor := range f.accessors { accessor.SetFields(f.fields) accessor.SetSegments(f.segments) diff --git a/pkg/filter/accessor_linux.go b/pkg/filter/accessor_linux.go new file mode 100644 index 000000000..b1aac733d --- /dev/null +++ b/pkg/filter/accessor_linux.go @@ -0,0 +1,117 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +import ( + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/filter/fields" + "github.com/rabbitstack/fibratus/pkg/ps" +) + +// GetAccessors returns the accessors available on Linux. +func GetAccessors() []Accessor { + return []Accessor{ + newEventAccessor(), + newPSAccessor(nil), + } +} + +type psAccessor struct { + psnap ps.Resolver +} + +func (psAccessor) SetFields([]Field) {} +func (psAccessor) SetSegments([]fields.Segment) {} +func (psAccessor) IsFieldAccessible(e *event.Event) bool { + return e.PS != nil || e.Category == event.Process +} + +func newPSAccessor(psnap ps.Resolver) Accessor { return &psAccessor{psnap: psnap} } + +func (a *psAccessor) Get(f Field, e *event.Event) (params.Value, error) { + switch f.Name { + case fields.PsPid: + return e.PID, nil + case fields.PsPpid: + if e.PS == nil { + return nil, ErrPsNil + } + return e.PS.Ppid, nil + case fields.PsName: + if e.PS == nil { + return nil, ErrPsNil + } + return e.PS.Name, nil + case fields.PsComm, fields.PsCmdline: + if e.PS == nil { + return nil, ErrPsNil + } + return e.PS.Cmdline, nil + case fields.PsExe: + if e.PS == nil { + return nil, ErrPsNil + } + return e.PS.Exe, nil + case fields.PsArgs: + if e.PS == nil { + return nil, ErrPsNil + } + return e.PS.Args, nil + case fields.PsCwd: + if e.PS == nil { + return nil, ErrPsNil + } + return e.PS.Cwd, nil + case fields.PsUsername: + if e.PS == nil { + return nil, ErrPsNil + } + return e.PS.Username, nil + case fields.PsEnvs: + if e.PS == nil { + return nil, ErrPsNil + } + return e.PS.Envs, nil + case fields.PsParentPid: + if e.PS == nil || e.PS.Parent == nil { + return nil, ErrPsNil + } + return e.PS.Parent.PID, nil + case fields.PsParentName: + if e.PS == nil || e.PS.Parent == nil { + return nil, ErrPsNil + } + return e.PS.Parent.Name, nil + case fields.PsParentCmdline: + if e.PS == nil || e.PS.Parent == nil { + return nil, ErrPsNil + } + return e.PS.Parent.Cmdline, nil + case fields.PsParentExe: + if e.PS == nil || e.PS.Parent == nil { + return nil, ErrPsNil + } + return e.PS.Parent.Exe, nil + default: + return nil, nil + } +} diff --git a/pkg/filter/accessor_narrow_linux.go b/pkg/filter/accessor_narrow_linux.go new file mode 100644 index 000000000..187a7020e --- /dev/null +++ b/pkg/filter/accessor_narrow_linux.go @@ -0,0 +1,42 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +func (f *filter) pruneUnusedAccessors() { + removeEvtAccessor := true + removePsAccessor := true + + for _, field := range f.fields { + switch { + case field.Name.IsEvtField() || field.Name.IsKevtField(): + removeEvtAccessor = false + case field.Name.IsPsField(): + removePsAccessor = false + } + } + + if removeEvtAccessor { + f.removeAccessor(&evtAccessor{}) + } + if removePsAccessor { + f.removeAccessor(&psAccessor{}) + } +} diff --git a/pkg/filter/accessor_narrow_windows.go b/pkg/filter/accessor_narrow_windows.go new file mode 100644 index 000000000..0d1947f96 --- /dev/null +++ b/pkg/filter/accessor_narrow_windows.go @@ -0,0 +1,104 @@ +//go:build windows + +/* + * Copyright 2020-2021 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +func (f *filter) pruneUnusedAccessors() { + var ( + removeEvtAccessor = true + removePsAccessor = true + removeThreadAccessor = true + removeModuleAccessor = true + removeFileAccessor = true + removeRegistryAccessor = true + removeNetworkAccessor = true + removeHandleAccessor = true + removePEAccessor = true + removeMemAccessor = true + removeDNSAccessor = true + removeThreadpoolAccessor = true + ) + + for _, field := range f.fields { + switch { + case field.Name.IsEvtField() || field.Name.IsKevtField(): + removeEvtAccessor = false + case field.Name.IsPeField(): + removePEAccessor = false + case field.Name.IsPsField(): + removePsAccessor = false + case field.Name.IsThreadField(): + removeThreadAccessor = false + case field.Name.IsImageField() || field.Name.IsModuleField(): + removeModuleAccessor = false + case field.Name.IsFileField(): + removeFileAccessor = false + case field.Name.IsRegistryField(): + removeRegistryAccessor = false + case field.Name.IsNetworkField(): + removeNetworkAccessor = false + case field.Name.IsHandleField(): + removeHandleAccessor = false + case field.Name.IsMemField(): + removeMemAccessor = false + case field.Name.IsDNSField(): + removeDNSAccessor = false + case field.Name.IsThreadpoolField(): + removeThreadpoolAccessor = false + } + } + + if removeEvtAccessor { + f.removeAccessor(&evtAccessor{}) + } + if removePsAccessor { + f.removeAccessor(&psAccessor{}) + } + if removeThreadAccessor { + f.removeAccessor(&threadAccessor{}) + } + if removeModuleAccessor { + f.removeAccessor(&moduleAccessor{}) + } + if removeFileAccessor { + f.removeAccessor(&fileAccessor{}) + } + if removeRegistryAccessor { + f.removeAccessor(®istryAccessor{}) + } + if removeNetworkAccessor { + f.removeAccessor(&networkAccessor{}) + } + if removeHandleAccessor { + f.removeAccessor(&handleAccessor{}) + } + if removePEAccessor { + f.removeAccessor(&peAccessor{}) + } + if removeMemAccessor { + f.removeAccessor(&memAccessor{}) + } + if removeDNSAccessor { + f.removeAccessor(&dnsAccessor{}) + } + if removeThreadpoolAccessor { + f.removeAccessor(&threadpoolAccessor{}) + } +} diff --git a/pkg/filter/accessor_stubs_linux.go b/pkg/filter/accessor_stubs_linux.go new file mode 100644 index 000000000..a66afd9b4 --- /dev/null +++ b/pkg/filter/accessor_stubs_linux.go @@ -0,0 +1,46 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +import ( + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/filter/fields" +) + +// noopAccessor satisfies Accessor for Windows-only field families on Linux. +type noopAccessor struct{} + +func (noopAccessor) Get(Field, *event.Event) (params.Value, error) { return nil, nil } +func (noopAccessor) SetFields([]Field) {} +func (noopAccessor) SetSegments([]fields.Segment) {} +func (noopAccessor) IsFieldAccessible(*event.Event) bool { return false } + +func newThreadAccessor() Accessor { return noopAccessor{} } +func newModuleAccessor() Accessor { return noopAccessor{} } +func newFileAccessor() Accessor { return noopAccessor{} } +func newRegistryAccessor() Accessor { return noopAccessor{} } +func newNetworkAccessor() Accessor { return noopAccessor{} } +func newHandleAccessor() Accessor { return noopAccessor{} } +func newPEAccessor() Accessor { return noopAccessor{} } +func newMemAccessor() Accessor { return noopAccessor{} } +func newDNSAccessor() Accessor { return noopAccessor{} } +func newThreadpoolAccessor() Accessor { return noopAccessor{} } diff --git a/pkg/filter/accessor_windows.go b/pkg/filter/accessor_windows.go index e39cd59ef..7f051bc6a 100644 --- a/pkg/filter/accessor_windows.go +++ b/pkg/filter/accessor_windows.go @@ -70,7 +70,7 @@ func getParentPs(e *event.Event) *pstypes.PS { // psAccessor extracts process's state or event specific values. type psAccessor struct { - psnap psnap.Snapshotter + psnap psnap.Resolver } func (psAccessor) SetFields([]Field) {} @@ -79,7 +79,7 @@ func (psAccessor) IsFieldAccessible(e *event.Event) bool { return e.PS != nil || e.Category() == event.Process } -func newPSAccessor(psnap psnap.Snapshotter) Accessor { return &psAccessor{psnap: psnap} } +func newPSAccessor(psnap psnap.Resolver) Accessor { return &psAccessor{psnap: psnap} } func (ps *psAccessor) Get(f Field, e *event.Event) (params.Value, error) { switch f.Name { diff --git a/pkg/filter/filter_linux.go b/pkg/filter/filter_linux.go new file mode 100644 index 000000000..44179cbff --- /dev/null +++ b/pkg/filter/filter_linux.go @@ -0,0 +1,110 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +import ( + "fmt" + "strings" + + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/filter/fields" + "github.com/rabbitstack/fibratus/pkg/filter/ql" + "github.com/rabbitstack/fibratus/pkg/ps" +) + +type opts struct { + psnap ps.Resolver +} + +// Option defines the option supplied to the filter +type Option func(o *opts) + +// WithPSnapshotter passes a process resolver reference to the filter. +func WithPSnapshotter(psnap ps.Resolver) Option { + return func(o *opts) { + o.psnap = psnap + } +} + +// New creates a new filter with the specified filter expression. +func New(expr string, config *config.Config, options ...Option) Filter { + var opts opts + for _, opt := range options { + opt(&opts) + } + accessors := []Accessor{ + newEventAccessor(), + newPSAccessor(opts.psnap), + } + + fconfig := config.Filters + + var parser *ql.Parser + if fconfig.HasMacros() { + parser = ql.NewParserWithConfig(expr, fconfig) + } else { + parser = ql.NewParser(expr) + } + + return &filter{ + parser: parser, + accessors: accessors, + fields: make([]Field, 0), + segments: make([]fields.Segment, 0), + stringFields: make(map[fields.Field][]string), + boundFields: make([]*ql.BoundFieldLiteral, 0), + seqBoundFields: make(map[int][]BoundField), + } +} + +// NewFromCLI builds and compiles a filter by joining all the command line arguments into the filter expression. +func NewFromCLI(args []string, config *config.Config) (Filter, error) { + expr := strings.Join(args, " ") + if expr == "" { + return nil, nil + } + filter := New(expr, config) + if err := filter.Compile(); err != nil { + return nil, fmt.Errorf("bad filter:\n%v", err) + } + return filter, nil +} + +// NewFromCLIWithAllAccessors builds and compiles a filter with all field accessors enabled. +func NewFromCLIWithAllAccessors(args []string) (Filter, error) { + expr := strings.Join(args, " ") + if expr == "" { + return nil, nil + } + filter := &filter{ + parser: ql.NewParser(expr), + accessors: GetAccessors(), + fields: make([]Field, 0), + segments: make([]fields.Segment, 0), + stringFields: make(map[fields.Field][]string), + boundFields: make([]*ql.BoundFieldLiteral, 0), + seqBoundFields: make(map[int][]BoundField), + } + if err := filter.Compile(); err != nil { + return nil, fmt.Errorf("bad filter:\n %v", err) + } + return filter, nil +} diff --git a/pkg/filter/filter_windows.go b/pkg/filter/filter_windows.go index 3f4fadf52..30fc87eb8 100644 --- a/pkg/filter/filter_windows.go +++ b/pkg/filter/filter_windows.go @@ -29,14 +29,14 @@ import ( ) type opts struct { - psnap ps.Snapshotter + psnap ps.Resolver } // Option defines the option supplied to the filter type Option func(o *opts) -// WithPSnapshotter passes a process snapshotter reference to the filter. -func WithPSnapshotter(psnap ps.Snapshotter) Option { +// WithPSnapshotter passes a process resolver reference to the filter. +func WithPSnapshotter(psnap ps.Resolver) Option { return func(o *opts) { o.psnap = psnap } diff --git a/pkg/filter/ql/function.go b/pkg/filter/ql/function.go index fdc0592ef..56d8c7f51 100644 --- a/pkg/filter/ql/function.go +++ b/pkg/filter/ql/function.go @@ -30,8 +30,6 @@ import ( "github.com/rabbitstack/fibratus/pkg/filter/fields" "github.com/rabbitstack/fibratus/pkg/pe" pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" - "github.com/rabbitstack/fibratus/pkg/util/signature" - "golang.org/x/sys/windows" "github.com/rabbitstack/fibratus/pkg/filter/ql/functions" ) @@ -246,40 +244,10 @@ func (f *Foreach) Call(args []interface{}) (interface{}, bool) { } } case callstack.Callstack: - var pid uint32 - var proc windows.Handle - var err error - - if !elems.IsEmpty() { - pid = elems.FrameAt(0).PID - } - - // open process handle with required access mask - var desiredAccess uint32 - loop: - for _, seg := range segments { - switch seg.Segment { - case fields.CallsiteLeadingAssemblySegment, fields.CallsiteTrailingAssemblySegment: - // break on broader access rights - desiredAccess = windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ - break loop - case fields.AllocationSizeSegment, fields.ProtectionSegment: - desiredAccess = windows.PROCESS_QUERY_INFORMATION - } - } - if desiredAccess != 0 { - proc, err = windows.OpenProcess(desiredAccess, false, pid) - if err != nil { - return false, false - } - defer windows.Close(proc) - } - - for _, frame := range elems { - if f.evalExpr(e, useCallValuer, f.callstackMapValuer(segments, frame, proc), valuer) { - return true, true - } + if ok, matched := f.foreachCallstack(elems, segments, e, useCallValuer, valuer); ok { + return matched, true } + return false, false } return false, false @@ -544,57 +512,6 @@ func (f *Foreach) mmapMapValuer(segments []*BoundSegmentLiteral, mmap pstypes.Mm return valuer } -// callstackMapValuer returns map valuer with thread stack frame data. -func (f *Foreach) callstackMapValuer(segments []*BoundSegmentLiteral, frame callstack.Frame, proc windows.Handle) MapValuer { - var valuer = MapValuer{} - for _, seg := range segments { - key := seg.Value - switch seg.Segment { - case fields.AddressSegment: - valuer[key] = frame.Addr.String() - case fields.OffsetSegment: - valuer[key] = frame.Offset - case fields.IsUnbackedSegment: - valuer[key] = frame.IsUnbacked() - case fields.ModuleSegment: - valuer[key] = frame.Module - case fields.SymbolSegment: - valuer[key] = frame.Module + "!" + frame.Symbol - case fields.AllocationSizeSegment: - valuer[key] = frame.AllocationSize(proc) - case fields.ProtectionSegment: - valuer[key] = frame.Protection(proc) - case fields.CallsiteTrailingAssemblySegment: - valuer[key] = frame.CallsiteAssembly(proc, false) - case fields.CallsiteLeadingAssemblySegment: - valuer[key] = frame.CallsiteAssembly(proc, true) - case fields.ModuleSignatureExistsSegment, fields.ModuleSignatureTrustedSegment, - fields.ModuleSignatureIssuerSegment, fields.ModuleSignatureSubjectSegment: - - sign := signature.GetSignatures().DoRequest(signature.MakeKey(frame.Module, 0, 0, 0)) - if sign == nil { - continue - } - - switch seg.Segment { - case fields.ModuleSignatureExistsSegment: - valuer[key] = sign.Exists() - case fields.ModuleSignatureTrustedSegment: - valuer[key] = sign.IsTrusted() - case fields.ModuleSignatureIssuerSegment: - if sign.HasCertificate() { - valuer[key] = sign.Cert().Issuer - } - case fields.ModuleSignatureSubjectSegment: - if sign.HasCertificate() { - valuer[key] = sign.Cert().Subject - } - } - } - } - return valuer -} - // sectionMapValuer returns map valuer with PE section data. func (f *Foreach) sectionMapValuer(segments []*BoundSegmentLiteral, section pe.Sec) MapValuer { var valuer = MapValuer{} diff --git a/pkg/filter/ql/function_callstack_linux.go b/pkg/filter/ql/function_callstack_linux.go new file mode 100644 index 000000000..1b618439a --- /dev/null +++ b/pkg/filter/ql/function_callstack_linux.go @@ -0,0 +1,53 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ql + +import ( + "fmt" + + "github.com/rabbitstack/fibratus/pkg/callstack" + "github.com/rabbitstack/fibratus/pkg/filter/fields" +) + +func (f *Foreach) foreachCallstack(elems callstack.Callstack, segments []*BoundSegmentLiteral, e interface{}, useCallValuer bool, valuer MapValuer) (bool, bool) { + for _, frame := range elems { + if f.evalExpr(e, useCallValuer, f.callstackMapValuer(segments, frame), valuer) { + return true, true + } + } + return true, false +} + +func (f *Foreach) callstackMapValuer(segments []*BoundSegmentLiteral, frame callstack.Frame) MapValuer { + var valuer = MapValuer{} + for _, seg := range segments { + key := seg.Value + switch seg.Segment { + case fields.AddressSegment: + valuer[key] = fmt.Sprintf("0x%x", frame.Addr) + case fields.ModuleSegment: + valuer[key] = frame.Module + case fields.SymbolSegment: + valuer[key] = frame.Module + "!" + frame.Symbol + } + } + return valuer +} diff --git a/pkg/filter/ql/function_callstack_windows.go b/pkg/filter/ql/function_callstack_windows.go new file mode 100644 index 000000000..87d8e9bfc --- /dev/null +++ b/pkg/filter/ql/function_callstack_windows.go @@ -0,0 +1,117 @@ +//go:build windows + +/* + * Copyright 2020-2021 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ql + +import ( + "github.com/rabbitstack/fibratus/pkg/callstack" + "github.com/rabbitstack/fibratus/pkg/filter/fields" + "github.com/rabbitstack/fibratus/pkg/util/signature" + "golang.org/x/sys/windows" +) + +// foreachCallstack evaluates the predicate against callstack frames. +// The first return value indicates whether callstack handling applied; +// the second is the match result. +func (f *Foreach) foreachCallstack(elems callstack.Callstack, segments []*BoundSegmentLiteral, e interface{}, useCallValuer bool, valuer MapValuer) (bool, bool) { + var pid uint32 + var proc windows.Handle + var err error + + if !elems.IsEmpty() { + pid = elems.FrameAt(0).PID + } + + var desiredAccess uint32 +loop: + for _, seg := range segments { + switch seg.Segment { + case fields.CallsiteLeadingAssemblySegment, fields.CallsiteTrailingAssemblySegment: + desiredAccess = windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ + break loop + case fields.AllocationSizeSegment, fields.ProtectionSegment: + desiredAccess = windows.PROCESS_QUERY_INFORMATION + } + } + if desiredAccess != 0 { + proc, err = windows.OpenProcess(desiredAccess, false, pid) + if err != nil { + return true, false + } + defer windows.Close(proc) + } + + for _, frame := range elems { + if f.evalExpr(e, useCallValuer, f.callstackMapValuer(segments, frame, proc), valuer) { + return true, true + } + } + return true, false +} + +func (f *Foreach) callstackMapValuer(segments []*BoundSegmentLiteral, frame callstack.Frame, proc windows.Handle) MapValuer { + var valuer = MapValuer{} + for _, seg := range segments { + key := seg.Value + switch seg.Segment { + case fields.AddressSegment: + valuer[key] = frame.Addr.String() + case fields.OffsetSegment: + valuer[key] = frame.Offset + case fields.IsUnbackedSegment: + valuer[key] = frame.IsUnbacked() + case fields.ModuleSegment: + valuer[key] = frame.Module + case fields.SymbolSegment: + valuer[key] = frame.Module + "!" + frame.Symbol + case fields.AllocationSizeSegment: + valuer[key] = frame.AllocationSize(proc) + case fields.ProtectionSegment: + valuer[key] = frame.Protection(proc) + case fields.CallsiteTrailingAssemblySegment: + valuer[key] = frame.CallsiteAssembly(proc, false) + case fields.CallsiteLeadingAssemblySegment: + valuer[key] = frame.CallsiteAssembly(proc, true) + case fields.ModuleSignatureExistsSegment, fields.ModuleSignatureTrustedSegment, + fields.ModuleSignatureIssuerSegment, fields.ModuleSignatureSubjectSegment: + + sign := signature.GetSignatures().DoRequest(signature.MakeKey(frame.Module, 0, 0, 0)) + if sign == nil { + continue + } + + switch seg.Segment { + case fields.ModuleSignatureExistsSegment: + valuer[key] = sign.Exists() + case fields.ModuleSignatureTrustedSegment: + valuer[key] = sign.IsTrusted() + case fields.ModuleSignatureIssuerSegment: + if sign.HasCertificate() { + valuer[key] = sign.Cert().Issuer + } + case fields.ModuleSignatureSubjectSegment: + if sign.HasCertificate() { + valuer[key] = sign.Cert().Subject + } + } + } + } + return valuer +} diff --git a/pkg/filter/ql/functions/minidump_linux.go b/pkg/filter/ql/functions/minidump_linux.go new file mode 100644 index 000000000..1250a34b0 --- /dev/null +++ b/pkg/filter/ql/functions/minidump_linux.go @@ -0,0 +1,39 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package functions + +// IsMinidump determines if the specified file contains the minidump signature. +type IsMinidump struct{} + +func (f IsMinidump) Call(args []interface{}) (interface{}, bool) { + return false, len(args) >= 1 +} + +func (f IsMinidump) Desc() FunctionDesc { + return FunctionDesc{ + Name: IsMinidumpFn, + Args: []FunctionArgDesc{ + {Keyword: "file", Types: []ArgType{Field, BoundField, BoundSegment, BareBoundVariable, Func, String}, Required: true}, + }, + } +} + +func (f IsMinidump) Name() Fn { return IsMinidumpFn } diff --git a/pkg/rules/action/isolate_linux.go b/pkg/rules/action/isolate_linux.go new file mode 100644 index 000000000..fc2584ce4 --- /dev/null +++ b/pkg/rules/action/isolate_linux.go @@ -0,0 +1,32 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package action + +import ( + "fmt" + "net" +) + +// Isolate isolates the host via firewall rules. +// Linux isolation is not wired yet. +func Isolate(whitelist []net.IP) error { + return fmt.Errorf("isolate action is not implemented on Linux yet (whitelist=%v)", whitelist) +} diff --git a/pkg/rules/action/kill_linux.go b/pkg/rules/action/kill_linux.go new file mode 100644 index 000000000..077950fa0 --- /dev/null +++ b/pkg/rules/action/kill_linux.go @@ -0,0 +1,29 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package action + +import "fmt" + +// Kill terminates all processes with specified pids. +// The signal-based Linux implementation lands with the detection work. +func Kill(pids []uint32) error { + return fmt.Errorf("kill action is not implemented on Linux yet (pids=%v)", pids) +} diff --git a/pkg/rules/compiler.go b/pkg/rules/compiler.go index a45a87bc4..b57e3e84e 100644 --- a/pkg/rules/compiler.go +++ b/pkg/rules/compiler.go @@ -58,12 +58,12 @@ var ( ) type compiler struct { - psnap ps.Snapshotter + psnap ps.Resolver config *config.Config approvers config.Approvers } -func newCompiler(psnap ps.Snapshotter, cfg *config.Config) *compiler { +func newCompiler(psnap ps.Resolver, cfg *config.Config) *compiler { return &compiler{psnap: psnap, config: cfg, approvers: config.Approvers{ Keys: make(map[string][]string), Paths: make(map[string][]string), diff --git a/pkg/rules/engine.go b/pkg/rules/engine.go index 618880af8..1d87bb2d7 100644 --- a/pkg/rules/engine.go +++ b/pkg/rules/engine.go @@ -55,7 +55,7 @@ var ( type Engine struct { filters *filterset config *config.Config - psnap ps.Snapshotter + psnap ps.Resolver matches []*ruleMatch mmu sync.Mutex // guards the rule matches slice @@ -130,7 +130,7 @@ func (f *compiledFilter) eval(e *event.Event, valuer *filter.ValuerCache) bool { } // NewEngine builds a fresh rules engine instance. -func NewEngine(psnap ps.Snapshotter, config *config.Config) *Engine { +func NewEngine(psnap ps.Resolver, config *config.Config) *Engine { e := &Engine{ filters: newFilterset(), matches: make([]*ruleMatch, 0), diff --git a/pkg/rules/engine_linux_test.go b/pkg/rules/engine_linux_test.go new file mode 100644 index 000000000..88825e13e --- /dev/null +++ b/pkg/rules/engine_linux_test.go @@ -0,0 +1,36 @@ +//go:build linux + +/* + * Copyright 2026 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package rules + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/ps" + "github.com/stretchr/testify/require" +) + +func TestNewEngineAcceptsResolver(t *testing.T) { + cfg := &config.Config{Filters: &config.Filters{}} + e := NewEngine(ps.NewLinuxSnapshotter(), cfg) + require.NotNil(t, e) + require.NotNil(t, e.compiler) +} diff --git a/pkg/rules/sequence.go b/pkg/rules/sequence.go index dfc3d05f7..9015c8eaa 100644 --- a/pkg/rules/sequence.go +++ b/pkg/rules/sequence.go @@ -120,10 +120,10 @@ type sequenceState struct { // The purpose is to enforce temporal monotonicity lastMatch time.Time - psnap ps.Snapshotter + psnap ps.Resolver } -func newSequenceState(f filter.Filter, c *config.FilterConfig, psnap ps.Snapshotter) *sequenceState { +func newSequenceState(f filter.Filter, c *config.FilterConfig, psnap ps.Resolver) *sequenceState { ss := &sequenceState{ filter: f, seq: f.GetSequence(), From 0057502844b9c16fe93234c54966724dc7e7b131 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 8 Aug 2026 21:09:30 +0200 Subject: [PATCH 17/65] chore(build): Attribute new Linux files to Mostafa Moradian Credit newly authored Linux and platform-split files correctly. Keep Nedim's copyright on adapted splits and add a second line for the Linux port work. --- cmd/fibratus/app/config/config_linux.go | 2 +- cmd/fibratus/app/list/list_linux.go | 2 +- cmd/fibratus/app/root_linux.go | 1 + cmd/fibratus/app/root_windows.go | 1 + cmd/fibratus/app/rules/rules_linux.go | 2 +- cmd/fibratus/app/run_linux.go | 1 + cmd/fibratus/app/stats/stats_linux.go | 2 +- cmd/fibratus/main_linux.go | 1 + internal/bootstrap/bootstrap_linux.go | 1 + internal/bootstrap/source_linux.go | 1 + pkg/aggregator/imports_windows.go | 1 + pkg/callstack/callstack_linux.go | 2 +- pkg/cap/version/version_linux.go | 1 + pkg/config/config_linux.go | 2 +- pkg/config/eventsource_linux.go | 2 +- pkg/config/schema_linux.go | 2 +- pkg/event/enum_linux.go | 2 +- pkg/event/event_linux.go | 2 +- pkg/event/event_linux_test.go | 2 +- pkg/event/flags_linux.go | 2 +- pkg/event/formatter_linux.go | 2 +- pkg/event/marshaller_linux.go | 2 +- pkg/event/metainfo_linux.go | 2 +- pkg/event/param_capture_linux.go | 2 +- pkg/event/param_capture_windows.go | 1 + pkg/event/param_linux.go | 2 +- pkg/event/stackwalk_linux.go | 2 +- pkg/event/types_linux.go | 2 +- pkg/filter/accessor_linux.go | 2 +- pkg/filter/accessor_narrow_linux.go | 2 +- pkg/filter/accessor_narrow_windows.go | 1 + pkg/filter/accessor_stubs_linux.go | 2 +- pkg/filter/filter_linux.go | 2 +- pkg/filter/ql/function_callstack_linux.go | 2 +- pkg/filter/ql/function_callstack_windows.go | 1 + pkg/filter/ql/functions/get_reg_value_linux.go | 2 +- pkg/filter/ql/functions/minidump_linux.go | 2 +- pkg/pe/types_linux.go | 2 +- pkg/ps/process_key.go | 2 +- pkg/ps/resolver.go | 2 +- pkg/ps/snapshotter_linux.go | 2 +- pkg/ps/snapshotter_linux_test.go | 2 +- pkg/ps/types/types_linux.go | 2 +- pkg/rules/action/isolate_linux.go | 2 +- pkg/rules/action/kill_linux.go | 2 +- pkg/rules/engine_linux_test.go | 2 +- pkg/util/colorizer/colorizer_stub.go | 2 +- pkg/util/colorizer/colorizer_windows.go | 1 + pkg/util/key/key_linux.go | 2 +- pkg/util/log/logger_linux.go | 2 +- pkg/util/ntstatus/status_linux.go | 2 +- 51 files changed, 51 insertions(+), 39 deletions(-) diff --git a/cmd/fibratus/app/config/config_linux.go b/cmd/fibratus/app/config/config_linux.go index 01ea46121..2bd060ba1 100644 --- a/cmd/fibratus/app/config/config_linux.go +++ b/cmd/fibratus/app/config/config_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/cmd/fibratus/app/list/list_linux.go b/cmd/fibratus/app/list/list_linux.go index c2c68dcfc..47e64a692 100644 --- a/cmd/fibratus/app/list/list_linux.go +++ b/cmd/fibratus/app/list/list_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/cmd/fibratus/app/root_linux.go b/cmd/fibratus/app/root_linux.go index 47f828cd6..4250ccca6 100644 --- a/cmd/fibratus/app/root_linux.go +++ b/cmd/fibratus/app/root_linux.go @@ -2,6 +2,7 @@ /* * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/cmd/fibratus/app/root_windows.go b/cmd/fibratus/app/root_windows.go index f5003f624..8c698a0b0 100644 --- a/cmd/fibratus/app/root_windows.go +++ b/cmd/fibratus/app/root_windows.go @@ -2,6 +2,7 @@ /* * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/cmd/fibratus/app/rules/rules_linux.go b/cmd/fibratus/app/rules/rules_linux.go index 42ed7d2aa..40250ee20 100644 --- a/cmd/fibratus/app/rules/rules_linux.go +++ b/cmd/fibratus/app/rules/rules_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/cmd/fibratus/app/run_linux.go b/cmd/fibratus/app/run_linux.go index 58bb7d4bc..3de0b072a 100644 --- a/cmd/fibratus/app/run_linux.go +++ b/cmd/fibratus/app/run_linux.go @@ -2,6 +2,7 @@ /* * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/cmd/fibratus/app/stats/stats_linux.go b/cmd/fibratus/app/stats/stats_linux.go index 3a5825847..bb4186693 100644 --- a/cmd/fibratus/app/stats/stats_linux.go +++ b/cmd/fibratus/app/stats/stats_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/cmd/fibratus/main_linux.go b/cmd/fibratus/main_linux.go index 86ff331a3..349a9c889 100644 --- a/cmd/fibratus/main_linux.go +++ b/cmd/fibratus/main_linux.go @@ -1,5 +1,6 @@ /* * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/bootstrap/bootstrap_linux.go b/internal/bootstrap/bootstrap_linux.go index d07148135..d9d3abc45 100644 --- a/internal/bootstrap/bootstrap_linux.go +++ b/internal/bootstrap/bootstrap_linux.go @@ -2,6 +2,7 @@ /* * Copyright 2021-2022 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/bootstrap/source_linux.go b/internal/bootstrap/source_linux.go index 9c6984c83..b4df2a74e 100644 --- a/internal/bootstrap/source_linux.go +++ b/internal/bootstrap/source_linux.go @@ -2,6 +2,7 @@ /* * Copyright 2021-2022 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/aggregator/imports_windows.go b/pkg/aggregator/imports_windows.go index e65eed8a7..2e18307a0 100644 --- a/pkg/aggregator/imports_windows.go +++ b/pkg/aggregator/imports_windows.go @@ -2,6 +2,7 @@ /* * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/callstack/callstack_linux.go b/pkg/callstack/callstack_linux.go index 268634821..711cfb678 100644 --- a/pkg/callstack/callstack_linux.go +++ b/pkg/callstack/callstack_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/cap/version/version_linux.go b/pkg/cap/version/version_linux.go index df2a03809..1e1e1aef3 100644 --- a/pkg/cap/version/version_linux.go +++ b/pkg/cap/version/version_linux.go @@ -2,6 +2,7 @@ /* * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index ecd0fd8c8..c0295c0a0 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/config/eventsource_linux.go b/pkg/config/eventsource_linux.go index 43e7476bd..68b2f12a7 100644 --- a/pkg/config/eventsource_linux.go +++ b/pkg/config/eventsource_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/config/schema_linux.go b/pkg/config/schema_linux.go index 6329e0a8b..136a9a4ae 100644 --- a/pkg/config/schema_linux.go +++ b/pkg/config/schema_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/enum_linux.go b/pkg/event/enum_linux.go index ac2900f5c..7ed359caa 100644 --- a/pkg/event/enum_linux.go +++ b/pkg/event/enum_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/event_linux.go b/pkg/event/event_linux.go index ff1ecad48..493ae4616 100644 --- a/pkg/event/event_linux.go +++ b/pkg/event/event_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/event_linux_test.go b/pkg/event/event_linux_test.go index 4365e32c6..79a6ad5e3 100644 --- a/pkg/event/event_linux_test.go +++ b/pkg/event/event_linux_test.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/flags_linux.go b/pkg/event/flags_linux.go index e035ff98d..f7d187755 100644 --- a/pkg/event/flags_linux.go +++ b/pkg/event/flags_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/formatter_linux.go b/pkg/event/formatter_linux.go index 720e3cf43..8e3322ac5 100644 --- a/pkg/event/formatter_linux.go +++ b/pkg/event/formatter_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/marshaller_linux.go b/pkg/event/marshaller_linux.go index b187ec12e..0a3be0a01 100644 --- a/pkg/event/marshaller_linux.go +++ b/pkg/event/marshaller_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/metainfo_linux.go b/pkg/event/metainfo_linux.go index 2a607787a..4378f1a8a 100644 --- a/pkg/event/metainfo_linux.go +++ b/pkg/event/metainfo_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/param_capture_linux.go b/pkg/event/param_capture_linux.go index b55f892e9..c1b2c661a 100644 --- a/pkg/event/param_capture_linux.go +++ b/pkg/event/param_capture_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/param_capture_windows.go b/pkg/event/param_capture_windows.go index e64a44002..d8c79be40 100644 --- a/pkg/event/param_capture_windows.go +++ b/pkg/event/param_capture_windows.go @@ -2,6 +2,7 @@ /* * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/param_linux.go b/pkg/event/param_linux.go index 9c80d5a05..af0a2ce89 100644 --- a/pkg/event/param_linux.go +++ b/pkg/event/param_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/stackwalk_linux.go b/pkg/event/stackwalk_linux.go index 0f92b68fe..7d3684f51 100644 --- a/pkg/event/stackwalk_linux.go +++ b/pkg/event/stackwalk_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/event/types_linux.go b/pkg/event/types_linux.go index 60af41af5..0513861e4 100644 --- a/pkg/event/types_linux.go +++ b/pkg/event/types_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/filter/accessor_linux.go b/pkg/filter/accessor_linux.go index b1aac733d..59ceb97b7 100644 --- a/pkg/filter/accessor_linux.go +++ b/pkg/filter/accessor_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/filter/accessor_narrow_linux.go b/pkg/filter/accessor_narrow_linux.go index 187a7020e..1e9105ca0 100644 --- a/pkg/filter/accessor_narrow_linux.go +++ b/pkg/filter/accessor_narrow_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/filter/accessor_narrow_windows.go b/pkg/filter/accessor_narrow_windows.go index 0d1947f96..239f17323 100644 --- a/pkg/filter/accessor_narrow_windows.go +++ b/pkg/filter/accessor_narrow_windows.go @@ -2,6 +2,7 @@ /* * Copyright 2020-2021 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/filter/accessor_stubs_linux.go b/pkg/filter/accessor_stubs_linux.go index a66afd9b4..e89696f3b 100644 --- a/pkg/filter/accessor_stubs_linux.go +++ b/pkg/filter/accessor_stubs_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/filter/filter_linux.go b/pkg/filter/filter_linux.go index 44179cbff..42ad1eb0a 100644 --- a/pkg/filter/filter_linux.go +++ b/pkg/filter/filter_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/filter/ql/function_callstack_linux.go b/pkg/filter/ql/function_callstack_linux.go index 1b618439a..3f0754c58 100644 --- a/pkg/filter/ql/function_callstack_linux.go +++ b/pkg/filter/ql/function_callstack_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/filter/ql/function_callstack_windows.go b/pkg/filter/ql/function_callstack_windows.go index 87d8e9bfc..d8434036e 100644 --- a/pkg/filter/ql/function_callstack_windows.go +++ b/pkg/filter/ql/function_callstack_windows.go @@ -2,6 +2,7 @@ /* * Copyright 2020-2021 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/filter/ql/functions/get_reg_value_linux.go b/pkg/filter/ql/functions/get_reg_value_linux.go index 926363826..6295a79cd 100644 --- a/pkg/filter/ql/functions/get_reg_value_linux.go +++ b/pkg/filter/ql/functions/get_reg_value_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/filter/ql/functions/minidump_linux.go b/pkg/filter/ql/functions/minidump_linux.go index 1250a34b0..98e57df6b 100644 --- a/pkg/filter/ql/functions/minidump_linux.go +++ b/pkg/filter/ql/functions/minidump_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/pe/types_linux.go b/pkg/pe/types_linux.go index 783d077be..767bcaa34 100644 --- a/pkg/pe/types_linux.go +++ b/pkg/pe/types_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/ps/process_key.go b/pkg/ps/process_key.go index 0834f50aa..250edf1b0 100644 --- a/pkg/ps/process_key.go +++ b/pkg/ps/process_key.go @@ -1,5 +1,5 @@ /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/ps/resolver.go b/pkg/ps/resolver.go index 67414c3d8..4f3e07d9b 100644 --- a/pkg/ps/resolver.go +++ b/pkg/ps/resolver.go @@ -1,5 +1,5 @@ /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/ps/snapshotter_linux.go b/pkg/ps/snapshotter_linux.go index 10ca04fe4..0b4f9d9cf 100644 --- a/pkg/ps/snapshotter_linux.go +++ b/pkg/ps/snapshotter_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/ps/snapshotter_linux_test.go b/pkg/ps/snapshotter_linux_test.go index 6638ed6a7..1c6b178b1 100644 --- a/pkg/ps/snapshotter_linux_test.go +++ b/pkg/ps/snapshotter_linux_test.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/ps/types/types_linux.go b/pkg/ps/types/types_linux.go index 8c6ffc906..d52196646 100644 --- a/pkg/ps/types/types_linux.go +++ b/pkg/ps/types/types_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/rules/action/isolate_linux.go b/pkg/rules/action/isolate_linux.go index fc2584ce4..3684e56bb 100644 --- a/pkg/rules/action/isolate_linux.go +++ b/pkg/rules/action/isolate_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/rules/action/kill_linux.go b/pkg/rules/action/kill_linux.go index 077950fa0..04ff289f8 100644 --- a/pkg/rules/action/kill_linux.go +++ b/pkg/rules/action/kill_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/rules/engine_linux_test.go b/pkg/rules/engine_linux_test.go index 88825e13e..59c26b68d 100644 --- a/pkg/rules/engine_linux_test.go +++ b/pkg/rules/engine_linux_test.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/util/colorizer/colorizer_stub.go b/pkg/util/colorizer/colorizer_stub.go index 81c41e660..dbf2e6a41 100644 --- a/pkg/util/colorizer/colorizer_stub.go +++ b/pkg/util/colorizer/colorizer_stub.go @@ -1,7 +1,7 @@ //go:build !windows /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/util/colorizer/colorizer_windows.go b/pkg/util/colorizer/colorizer_windows.go index 7018ef0fc..4341075e2 100644 --- a/pkg/util/colorizer/colorizer_windows.go +++ b/pkg/util/colorizer/colorizer_windows.go @@ -2,6 +2,7 @@ /* * Copyright 2021-present by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/util/key/key_linux.go b/pkg/util/key/key_linux.go index 891a85fb1..ba9fb74ab 100644 --- a/pkg/util/key/key_linux.go +++ b/pkg/util/key/key_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/util/log/logger_linux.go b/pkg/util/log/logger_linux.go index cd20c902c..7f90ed330 100644 --- a/pkg/util/log/logger_linux.go +++ b/pkg/util/log/logger_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/pkg/util/ntstatus/status_linux.go b/pkg/util/ntstatus/status_linux.go index 5c0e02286..59b931d0e 100644 --- a/pkg/util/ntstatus/status_linux.go +++ b/pkg/util/ntstatus/status_linux.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * From 3c13e4f11447e07c03e862d2660a632822226c43 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sun, 9 Aug 2026 10:34:53 +0200 Subject: [PATCH 18/65] chore(ebpf): Attribute eBPF spike files to Mostafa Moradian Align copyright headers on the Linux eBPF feasibility spike with the rest of the Linux port work. --- internal/ebpf/doc.go | 2 +- internal/ebpf/features.go | 2 +- internal/ebpf/features_test.go | 2 +- internal/ebpf/reconcile.go | 2 +- internal/ebpf/reconcile_test.go | 2 +- internal/ebpf/spike/cmd/spike/main.go | 2 +- internal/ebpf/spike/enrich.go | 2 +- internal/ebpf/spike/event.go | 2 +- internal/ebpf/spike/gen.go | 2 +- internal/ebpf/spike/run.go | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/ebpf/doc.go b/internal/ebpf/doc.go index 6b50b1917..ca37ad037 100644 --- a/internal/ebpf/doc.go +++ b/internal/ebpf/doc.go @@ -1,5 +1,5 @@ /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/ebpf/features.go b/internal/ebpf/features.go index ea9ecf695..d350449f2 100644 --- a/internal/ebpf/features.go +++ b/internal/ebpf/features.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/ebpf/features_test.go b/internal/ebpf/features_test.go index 430767e2d..0ea741b66 100644 --- a/internal/ebpf/features_test.go +++ b/internal/ebpf/features_test.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/ebpf/reconcile.go b/internal/ebpf/reconcile.go index 2d939c981..072ae26e5 100644 --- a/internal/ebpf/reconcile.go +++ b/internal/ebpf/reconcile.go @@ -1,5 +1,5 @@ /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/ebpf/reconcile_test.go b/internal/ebpf/reconcile_test.go index 516bf078e..cc20817b4 100644 --- a/internal/ebpf/reconcile_test.go +++ b/internal/ebpf/reconcile_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/ebpf/spike/cmd/spike/main.go b/internal/ebpf/spike/cmd/spike/main.go index 27d16c474..46efe842d 100644 --- a/internal/ebpf/spike/cmd/spike/main.go +++ b/internal/ebpf/spike/cmd/spike/main.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/ebpf/spike/enrich.go b/internal/ebpf/spike/enrich.go index fa57410a3..9376b8bcf 100644 --- a/internal/ebpf/spike/enrich.go +++ b/internal/ebpf/spike/enrich.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/ebpf/spike/event.go b/internal/ebpf/spike/event.go index d4211d07d..f86f5dfac 100644 --- a/internal/ebpf/spike/event.go +++ b/internal/ebpf/spike/event.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/ebpf/spike/gen.go b/internal/ebpf/spike/gen.go index 5db6245d9..1e9349f1c 100644 --- a/internal/ebpf/spike/gen.go +++ b/internal/ebpf/spike/gen.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * diff --git a/internal/ebpf/spike/run.go b/internal/ebpf/spike/run.go index 4c223b925..c313bf0ae 100644 --- a/internal/ebpf/spike/run.go +++ b/internal/ebpf/spike/run.go @@ -1,7 +1,7 @@ //go:build linux /* - * Copyright 2026 Fibratus contributors + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * From e8931215312cc359f63321b60fbee2126dc99fe6 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 10 Aug 2026 16:30:54 +0200 Subject: [PATCH 19/65] refactor(cli): Share config/list/rules/stats commands across platforms Restore the platform-agnostic CLI entrypoints and keep only the Stats struct Linux/Windows specific. Add Linux DialPipe and hostname helpers so the shared commands compile. --- cmd/fibratus/app/config/config.go | 2 - cmd/fibratus/app/list/list.go | 2 - cmd/fibratus/app/list/list_linux.go | 25 ----- cmd/fibratus/app/rules/create.go | 2 - cmd/fibratus/app/rules/list.go | 2 - cmd/fibratus/app/rules/rules.go | 2 - cmd/fibratus/app/rules/rules_linux.go | 25 ----- cmd/fibratus/app/rules/validate.go | 2 - cmd/fibratus/app/stats/stats.go | 74 --------------- cmd/fibratus/app/stats/stats_linux.go | 5 +- cmd/fibratus/app/stats/stats_windows.go | 94 +++++++++++++++++++ .../{bootstrap.go => bootstrap_windows.go} | 0 .../{source.go => source_windows.go} | 0 ...ports_windows.go => aggregator_windows.go} | 0 .../api/listener_linux.go | 15 ++- .../{callstack.go => callstack_windows.go} | 0 pkg/util/hostname/hostname_linux.go | 81 ++++++++++++++++ 17 files changed, 189 insertions(+), 142 deletions(-) delete mode 100644 cmd/fibratus/app/list/list_linux.go delete mode 100644 cmd/fibratus/app/rules/rules_linux.go create mode 100644 cmd/fibratus/app/stats/stats_windows.go rename internal/bootstrap/{bootstrap.go => bootstrap_windows.go} (100%) rename internal/bootstrap/{source.go => source_windows.go} (100%) rename pkg/aggregator/{imports_windows.go => aggregator_windows.go} (100%) rename cmd/fibratus/app/config/config_linux.go => pkg/api/listener_linux.go (64%) rename pkg/callstack/{callstack.go => callstack_windows.go} (100%) create mode 100644 pkg/util/hostname/hostname_linux.go diff --git a/cmd/fibratus/app/config/config.go b/cmd/fibratus/app/config/config.go index 62679dd8a..88810d92b 100644 --- a/cmd/fibratus/app/config/config.go +++ b/cmd/fibratus/app/config/config.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/list/list.go b/cmd/fibratus/app/list/list.go index 09b8741e9..055795d7a 100644 --- a/cmd/fibratus/app/list/list.go +++ b/cmd/fibratus/app/list/list.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/list/list_linux.go b/cmd/fibratus/app/list/list_linux.go deleted file mode 100644 index 47e64a692..000000000 --- a/cmd/fibratus/app/list/list_linux.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package list - -import "github.com/spf13/cobra" - -var Command = &cobra.Command{Use: "list", Short: "Show available Linux runtime information"} diff --git a/cmd/fibratus/app/rules/create.go b/cmd/fibratus/app/rules/create.go index 12f55f6cb..c21dc3bbc 100644 --- a/cmd/fibratus/app/rules/create.go +++ b/cmd/fibratus/app/rules/create.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/rules/list.go b/cmd/fibratus/app/rules/list.go index 525dd0217..666af4f6d 100644 --- a/cmd/fibratus/app/rules/list.go +++ b/cmd/fibratus/app/rules/list.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/rules/rules.go b/cmd/fibratus/app/rules/rules.go index ca387bfdb..d925aa557 100644 --- a/cmd/fibratus/app/rules/rules.go +++ b/cmd/fibratus/app/rules/rules.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/rules/rules_linux.go b/cmd/fibratus/app/rules/rules_linux.go deleted file mode 100644 index 40250ee20..000000000 --- a/cmd/fibratus/app/rules/rules_linux.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package rules - -import "github.com/spf13/cobra" - -var Command = &cobra.Command{Use: "rules", Short: "Manage detection rules"} diff --git a/cmd/fibratus/app/rules/validate.go b/cmd/fibratus/app/rules/validate.go index 56b2b227f..9ab621d04 100644 --- a/cmd/fibratus/app/rules/validate.go +++ b/cmd/fibratus/app/rules/validate.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/cmd/fibratus/app/stats/stats.go b/cmd/fibratus/app/stats/stats.go index d451593e5..8206de7da 100644 --- a/cmd/fibratus/app/stats/stats.go +++ b/cmd/fibratus/app/stats/stats.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io @@ -46,78 +44,6 @@ func init() { cfg.MustViperize(Command) } -// Stats stores runtime statistics that are retrieved from the expvar endpoint. -type Stats struct { - AggregatorBatchEvents int `json:"aggregator.batch.events"` - AggregatorFlushesCount int `json:"aggregator.flushes.count"` - AggregatorEventErrors int `json:"aggregator.event.errors"` - AggregatorTransformerErrors map[string]int `json:"aggregator.transformer.errors"` - AggregatorWorkerClientPublishErrors int `json:"aggregator.worker.client.publish.errors"` - FilamentDictErrors int `json:"filament.dict.errors"` - FilamentEventBatchFlushes int `json:"filament.event.batch.flushes"` - FilamentEventErrors map[string]int `json:"filament.event.errors"` - FilamentEventProcessErrors int `json:"filament.event.process.errors"` - FilterAccessorErrors map[string]int `json:"filter.accessor.errors"` - FsFileObjectHandleHits int `json:"fs.file.object.handle.hits"` - FsFileObjectMisses int `json:"fs.file.object.misses"` - FsFileReleases int `json:"fs.file.releases"` - FsTotalRundownFiles int `json:"fs.total.rundown.files"` - HandleNameQueryFailures map[string]int `json:"handle.name.query.failures"` - HandleSnapshotCount int `json:"handle.snapshot.count"` - HandleSnapshotBytes int `json:"handle.snapshot.bytes"` - HandleTypesCount int `json:"handle.types.count"` - HandleTypeNameMisses int `json:"handle.type.name.misses"` - HandleWaitTimeouts int `json:"handle.wait.timeouts"` - HostnameErrors map[string]int `json:"hostname.errors"` - CapFlusherErrors map[string]int `json:"cap.flusher.errors"` - CapHandleWriteErrors int `json:"cap.handle.write.errors"` - CapEventUnmarshalErrors int `json:"cap.event.unmarshal.errors"` - CapEventWriteErrors int `json:"cap.event.write.errors"` - CapEventSourceConsumerErrors int `json:"cap.eventsource.consumer.errors"` - CapOverflowErrors int `json:"cap.overflow.errors"` - CapReadBytes int `json:"cap.read.bytes"` - CapReadEvents int `json:"cap.read.events"` - CapReaderDroppedByFilter int `json:"cap.reader.dropped.by.filter"` - CapReaderHandleUnmarshalErrors int `json:"cap.reader.handle.unmarshal.errors"` - EventProcessorFailures int `json:"event.processor.failures"` - EventSeqInitErrors map[string]int `json:"event.seq.init.errors"` - EventSeqStoreErrors int `json:"event.seq.store.errors"` - EventTimestampUnmarshalErrors int `json:"event.timestamp.unmarshal.errors"` - EventSourceBuffersRead int `json:"eventsource.buffers.read"` - EventSourceEventsEnqueued int `json:"eventsource.events.enqueued"` - EventSourceEventsDequeued int `json:"eventsource.events.dequeued"` - EventSourceUnknownEvents int `json:"eventsource.events.unknown"` - EventSourceEventsProcessed int `json:"eventsource.events.processed"` - EventSourceExcludedEvents int `json:"eventsource.excluded.events"` - EventSourceEventsFailures map[string]int `json:"eventsource.events.failures"` - LoggerErrors map[string]int `json:"logger.errors"` - OutputAMQPChannelFailures int `json:"output.amqp.channel.failures"` - OutputAMQPConnectionFailures int `json:"output.amqp.connection.failures"` - OutputAMQPPublishErrors int `json:"output.amqp.publish.errors"` - OutputConsoleErrors int `json:"output.console.errors"` - OutputNullBlackholeEvents int `json:"output.null.blackhole.events"` - PeSkippedImages int `json:"pe.skipped.images"` - PeDirectoryParseErrors int `json:"pe.directory.parse.errors"` - PeVersionResourcesParseErrors int `json:"pe.version.resources.parse.errors"` - ProcessCount int `json:"process.count"` - ProcessModuleCount int `json:"process.module.count"` - ProcessLookupFailureCount map[int]int `json:"process.lookup.failure.count"` - ProcessPebReadErrors int `json:"process.peb.read.errors"` - ProcessReaped int `json:"process.reaped"` - ProcessThreadCount int `json:"process.thread.count"` - RegistryKcbCount int `json:"registry.kcb.count"` - RegistryKcbMisses int `json:"registry.kcb.misses"` - RegistryKeyHandleHits int `json:"registry.key.handle.hits"` - RegistryUnknownKeysCount int `json:"registry.unknown.keys.count"` - StackwalkEnqueued int `json:"stackwalk.enqueued"` - StackwalkFlushes int `json:"stackwalk.flushes"` - StackwalkFlushesProcs map[string]int `json:"stackwalk.flushes.procs"` - StackwalkFlushesEvents map[string]int `json:"stackwalk.flushes.events"` - YaraImageScans int `json:"yara.image.scans"` - YaraProcScans int `json:"yara.proc.scans"` - YaraRuleMatches int `json:"yara.rule.matches"` -} - func stats(cmd *cobra.Command, args []string) error { if err := bootstrap.InitConfigAndLogger(cfg); err != nil { return err diff --git a/cmd/fibratus/app/stats/stats_linux.go b/cmd/fibratus/app/stats/stats_linux.go index bb4186693..da5a11dfb 100644 --- a/cmd/fibratus/app/stats/stats_linux.go +++ b/cmd/fibratus/app/stats/stats_linux.go @@ -20,6 +20,5 @@ package stats -import "github.com/spf13/cobra" - -var Command = &cobra.Command{Use: "stats", Short: "Show runtime statistics"} +// Stats stores runtime statistics that are retrieved from the expvar endpoint. +type Stats struct{} diff --git a/cmd/fibratus/app/stats/stats_windows.go b/cmd/fibratus/app/stats/stats_windows.go new file mode 100644 index 000000000..407eec3f3 --- /dev/null +++ b/cmd/fibratus/app/stats/stats_windows.go @@ -0,0 +1,94 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package stats + +// Stats stores runtime statistics that are retrieved from the expvar endpoint. +type Stats struct { + AggregatorBatchEvents int `json:"aggregator.batch.events"` + AggregatorFlushesCount int `json:"aggregator.flushes.count"` + AggregatorEventErrors int `json:"aggregator.event.errors"` + AggregatorTransformerErrors map[string]int `json:"aggregator.transformer.errors"` + AggregatorWorkerClientPublishErrors int `json:"aggregator.worker.client.publish.errors"` + FilamentDictErrors int `json:"filament.dict.errors"` + FilamentEventBatchFlushes int `json:"filament.event.batch.flushes"` + FilamentEventErrors map[string]int `json:"filament.event.errors"` + FilamentEventProcessErrors int `json:"filament.event.process.errors"` + FilterAccessorErrors map[string]int `json:"filter.accessor.errors"` + FsFileObjectHandleHits int `json:"fs.file.object.handle.hits"` + FsFileObjectMisses int `json:"fs.file.object.misses"` + FsFileReleases int `json:"fs.file.releases"` + FsTotalRundownFiles int `json:"fs.total.rundown.files"` + HandleDeferredEvictions int `json:"handle.deferred.evictions"` + HandleNameQueryFailures map[string]int `json:"handle.name.query.failures"` + HandleSnapshotCount int `json:"handle.snapshot.count"` + HandleSnapshotBytes int `json:"handle.snapshot.bytes"` + HandleTypesCount int `json:"handle.types.count"` + HandleTypeNameMisses int `json:"handle.type.name.misses"` + HandleWaitTimeouts int `json:"handle.wait.timeouts"` + HostnameErrors map[string]int `json:"hostname.errors"` + CapFlusherErrors map[string]int `json:"cap.flusher.errors"` + CapHandleWriteErrors int `json:"cap.handle.write.errors"` + CapEventUnmarshalErrors int `json:"cap.event.unmarshal.errors"` + CapEventWriteErrors int `json:"cap.event.write.errors"` + CapEventSourceConsumerErrors int `json:"cap.eventsource.consumer.errors"` + CapOverflowErrors int `json:"cap.overflow.errors"` + CapReadBytes int `json:"cap.read.bytes"` + CapReadEvents int `json:"cap.read.events"` + CapReaderDroppedByFilter int `json:"cap.reader.dropped.by.filter"` + CapReaderHandleUnmarshalErrors int `json:"cap.reader.handle.unmarshal.errors"` + EventProcessorFailures int `json:"event.processor.failures"` + EventSeqInitErrors map[string]int `json:"event.seq.init.errors"` + EventSeqStoreErrors int `json:"event.seq.store.errors"` + EventTimestampUnmarshalErrors int `json:"event.timestamp.unmarshal.errors"` + EventSourceBuffersRead int `json:"eventsource.buffers.read"` + EventSourceEventsEnqueued int `json:"eventsource.events.enqueued"` + EventSourceEventsDequeued int `json:"eventsource.events.dequeued"` + EventSourceUnknownEvents int `json:"eventsource.events.unknown"` + EventSourceEventsProcessed int `json:"eventsource.events.processed"` + EventSourceExcludedEvents int `json:"eventsource.excluded.events"` + EventSourceEventsFailures map[string]int `json:"eventsource.events.failures"` + LoggerErrors map[string]int `json:"logger.errors"` + OutputAMQPChannelFailures int `json:"output.amqp.channel.failures"` + OutputAMQPConnectionFailures int `json:"output.amqp.connection.failures"` + OutputAMQPPublishErrors int `json:"output.amqp.publish.errors"` + OutputConsoleErrors int `json:"output.console.errors"` + OutputNullBlackholeEvents int `json:"output.null.blackhole.events"` + PeSkippedImages int `json:"pe.skipped.images"` + PeDirectoryParseErrors int `json:"pe.directory.parse.errors"` + PeVersionResourcesParseErrors int `json:"pe.version.resources.parse.errors"` + ProcessCount int `json:"process.count"` + ProcessModuleCount int `json:"process.module.count"` + ProcessLookupFailureCount map[int]int `json:"process.lookup.failure.count"` + ProcessPebReadErrors int `json:"process.peb.read.errors"` + ProcessReaped int `json:"process.reaped"` + ProcessThreadCount int `json:"process.thread.count"` + RegistryKcbCount int `json:"registry.kcb.count"` + RegistryKcbMisses int `json:"registry.kcb.misses"` + RegistryKeyHandleHits int `json:"registry.key.handle.hits"` + RegistryUnknownKeysCount int `json:"registry.unknown.keys.count"` + StackwalkEnqueued int `json:"stackwalk.enqueued"` + StackwalkFlushes int `json:"stackwalk.flushes"` + StackwalkFlushesProcs map[string]int `json:"stackwalk.flushes.procs"` + StackwalkFlushesEvents map[string]int `json:"stackwalk.flushes.events"` + YaraImageScans int `json:"yara.image.scans"` + YaraProcScans int `json:"yara.proc.scans"` + YaraRuleMatches int `json:"yara.rule.matches"` +} diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap_windows.go similarity index 100% rename from internal/bootstrap/bootstrap.go rename to internal/bootstrap/bootstrap_windows.go diff --git a/internal/bootstrap/source.go b/internal/bootstrap/source_windows.go similarity index 100% rename from internal/bootstrap/source.go rename to internal/bootstrap/source_windows.go diff --git a/pkg/aggregator/imports_windows.go b/pkg/aggregator/aggregator_windows.go similarity index 100% rename from pkg/aggregator/imports_windows.go rename to pkg/aggregator/aggregator_windows.go diff --git a/cmd/fibratus/app/config/config_linux.go b/pkg/api/listener_linux.go similarity index 64% rename from cmd/fibratus/app/config/config_linux.go rename to pkg/api/listener_linux.go index 2bd060ba1..a3aa832e2 100644 --- a/cmd/fibratus/app/config/config_linux.go +++ b/pkg/api/listener_linux.go @@ -18,8 +18,17 @@ * limitations under the License. */ -package config +package api -import "github.com/spf13/cobra" +import ( + "context" + "fmt" + "net" +) -var Command = &cobra.Command{Use: "config", Short: "Show runtime config"} +// DialPipe is unavailable on Linux. The HTTP API uses TCP transports instead. +func DialPipe(pipePath string) func(context.Context, string, string) (net.Conn, error) { + return func(context.Context, string, string) (net.Conn, error) { + return nil, fmt.Errorf("named pipe transport %q is not supported on linux", pipePath) + } +} diff --git a/pkg/callstack/callstack.go b/pkg/callstack/callstack_windows.go similarity index 100% rename from pkg/callstack/callstack.go rename to pkg/callstack/callstack_windows.go diff --git a/pkg/util/hostname/hostname_linux.go b/pkg/util/hostname/hostname_linux.go new file mode 100644 index 000000000..a7ae01cc7 --- /dev/null +++ b/pkg/util/hostname/hostname_linux.go @@ -0,0 +1,81 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package hostname + +import ( + "expvar" + "net" + "os" +) + +// hostname is the current host name or FQDN +var hostname string + +// hostnameErrors exposes host/fqdn resolution errors +var hostnameErrors = expvar.NewMap("hostname.errors") + +// Get returns the host name of the machine. +func Get() string { + if hostname != "" { + return hostname + } + var err error + hostname, err = os.Hostname() + if err != nil { + hostnameErrors.Add(err.Error(), 1) + } + if hostname == "" { + ip := localIP() + if ip != "" { + hostname = ip + } else { + hostname = "unknown" + } + } + return hostname +} + +// localIP returns the first non-loopback interface IP address. +func localIP() string { + ifaces, err := net.Interfaces() + if err != nil { + return "" + } + for _, i := range ifaces { + addrs, err := i.Addrs() + if err != nil { + continue + } + for _, addr := range addrs { + var ip net.IP + switch v := addr.(type) { + case *net.IPNet: + ip = v.IP + case *net.IPAddr: + ip = v.IP + } + if ip != nil && !ip.IsLoopback() { + return ip.String() + } + } + } + return "" +} From 67c2666fc5c542728d39befe401b596b37c28bfc Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 10 Aug 2026 16:31:22 +0200 Subject: [PATCH 20/65] fix(cap): Drop Handle and PE capture sections on Linux Those sections are Windows-specific and should not appear in the Linux capture version constants. --- pkg/cap/version/version_linux.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkg/cap/version/version_linux.go b/pkg/cap/version/version_linux.go index 1e1e1aef3..16b420d22 100644 --- a/pkg/cap/version/version_linux.go +++ b/pkg/cap/version/version_linux.go @@ -34,12 +34,3 @@ const ( ProcessSecV3 ProcessSecV4 ) - -const ( - HandleSecV1 Version = iota + 1 -) - -const ( - PESecV1 Version = iota + 1 - PESecV2 -) From 5fbf265c412929072927eaa9f87278e68d15bb90 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 10 Aug 2026 16:31:22 +0200 Subject: [PATCH 21/65] refactor(ps): Prefer per-platform Snapshotter interfaces Drop the shared Resolver composition. Linux Snapshotter uses uint64 PIDs, Windows keeps uint32, and event.PID becomes a platform type alias so shared rule/filter call sites stay typed correctly. --- pkg/alertsender/alert.go | 26 ++++----- pkg/alertsender/alert_test.go | 2 + pkg/alertsender/mail/renderer_test.go | 2 + pkg/callstack/callstack_test.go | 2 + pkg/config/filters.go | 2 +- pkg/event/event.go | 2 +- pkg/{ps/resolver.go => event/pid_linux.go} | 11 ++-- pkg/event/pid_windows.go | 24 ++++++++ pkg/filter/accessor_linux.go | 4 +- pkg/filter/accessor_windows.go | 4 +- pkg/filter/filter_linux.go | 6 +- pkg/filter/filter_windows.go | 6 +- pkg/filter/util.go | 4 +- pkg/ps/snapshotter.go | 2 + pkg/ps/snapshotter_linux.go | 67 ++++++++++++++-------- pkg/ps/snapshotter_linux_test.go | 4 +- pkg/ps/snapshotter_mock.go | 2 + pkg/ps/types/types_linux.go | 6 +- pkg/rules/compiler.go | 4 +- pkg/rules/engine.go | 4 +- pkg/rules/engine_linux_test.go | 4 +- pkg/rules/sequence.go | 12 ++-- 22 files changed, 127 insertions(+), 73 deletions(-) rename pkg/{ps/resolver.go => event/pid_linux.go} (82%) create mode 100644 pkg/event/pid_windows.go diff --git a/pkg/alertsender/alert.go b/pkg/alertsender/alert.go index 4c0e64f9a..fe9b846e8 100644 --- a/pkg/alertsender/alert.go +++ b/pkg/alertsender/alert.go @@ -182,9 +182,9 @@ func (a Alert) MarshalJSON() ([]byte, error) { Params map[string]any `json:"params"` Callstack []string `json:"callstack,omitempty"` Proc *struct { - PID uint32 `json:"pid"` - TID uint32 `json:"tid"` - PPID uint32 `json:"ppid"` + PID event.PID `json:"pid"` + TID uint32 `json:"tid"` + PPID event.PID `json:"ppid"` Name string `json:"name"` Exe string `json:"exe"` Cmdline string `json:"cmdline,omitempty"` @@ -218,9 +218,9 @@ func (a Alert) MarshalJSON() ([]byte, error) { Params map[string]any `json:"params"` Callstack []string `json:"callstack,omitempty"` Proc *struct { - PID uint32 `json:"pid"` - TID uint32 `json:"tid"` - PPID uint32 `json:"ppid"` + PID event.PID `json:"pid"` + TID uint32 `json:"tid"` + PPID event.PID `json:"ppid"` Name string `json:"name"` Exe string `json:"exe"` Cmdline string `json:"cmdline,omitempty"` @@ -247,9 +247,9 @@ func (a Alert) MarshalJSON() ([]byte, error) { Params map[string]any `json:"params"` Callstack []string `json:"callstack,omitempty"` Proc *struct { - PID uint32 `json:"pid"` - TID uint32 `json:"tid"` - PPID uint32 `json:"ppid"` + PID event.PID `json:"pid"` + TID uint32 `json:"tid"` + PPID event.PID `json:"ppid"` Name string `json:"name"` Exe string `json:"exe"` Cmdline string `json:"cmdline,omitempty"` @@ -287,15 +287,15 @@ func (a Alert) MarshalJSON() ([]byte, error) { // populate callstack for i := range e.Callstack { frame := e.Callstack[len(e.Callstack)-i-1] - evt.Callstack = append(evt.Callstack, fmt.Sprintf("%s %s!%s", frame.Addr, frame.Module, frame.Symbol)) + evt.Callstack = append(evt.Callstack, fmt.Sprintf("%v %s!%s", frame.Addr, frame.Module, frame.Symbol)) } ps := e.PS if ps != nil { evt.Proc = &struct { - PID uint32 `json:"pid"` - TID uint32 `json:"tid"` - PPID uint32 `json:"ppid"` + PID event.PID `json:"pid"` + TID uint32 `json:"tid"` + PPID event.PID `json:"ppid"` Name string `json:"name"` Exe string `json:"exe"` Cmdline string `json:"cmdline,omitempty"` diff --git a/pkg/alertsender/alert_test.go b/pkg/alertsender/alert_test.go index 4425badfa..e66e2ff5e 100644 --- a/pkg/alertsender/alert_test.go +++ b/pkg/alertsender/alert_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/alertsender/mail/renderer_test.go b/pkg/alertsender/mail/renderer_test.go index e5438d3a9..861d58153 100644 --- a/pkg/alertsender/mail/renderer_test.go +++ b/pkg/alertsender/mail/renderer_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/callstack/callstack_test.go b/pkg/callstack/callstack_test.go index 7002052fc..9cf9c4cea 100644 --- a/pkg/callstack/callstack_test.go +++ b/pkg/callstack/callstack_test.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/filters.go b/pkg/config/filters.go index 8226b2b7f..f5d23fa3b 100644 --- a/pkg/config/filters.go +++ b/pkg/config/filters.go @@ -176,7 +176,7 @@ func (ctx *ActionContext) UniquePids() []uint32 { if e.IsCreateProcess() { pids[e.Params.MustGetPid()] = struct{}{} } else { - pids[e.PID] = struct{}{} + pids[uint32(e.PID)] = struct{}{} } } return convert.MapKeysToSlice(pids) diff --git a/pkg/event/event.go b/pkg/event/event.go index ba1b03039..216b2ad37 100644 --- a/pkg/event/event.go +++ b/pkg/event/event.go @@ -74,7 +74,7 @@ type Event struct { // Timestamp represents the temporal occurrence of the event. Timestamp time.Time `json:"timestamp"` // PID is the identifier of the process that generated the event. - PID uint32 `json:"pid"` + PID PID `json:"pid"` // Tid is the thread identifier of the thread that generated the event. Tid uint32 `json:"tid"` // Evasions is the bitmask that stores detected evasion types on this event. diff --git a/pkg/ps/resolver.go b/pkg/event/pid_linux.go similarity index 82% rename from pkg/ps/resolver.go rename to pkg/event/pid_linux.go index 4f3e07d9b..340f0367a 100644 --- a/pkg/ps/resolver.go +++ b/pkg/event/pid_linux.go @@ -1,3 +1,5 @@ +//go:build linux + /* * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io @@ -16,10 +18,7 @@ * limitations under the License. */ -package ps - -import pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" +package event -type Resolver interface { - Find(pid uint32) (bool, *pstypes.PS) -} +// PID is the process identifier type on Linux (kernel PIDs are 64-bit). +type PID = uint64 diff --git a/pkg/event/pid_windows.go b/pkg/event/pid_windows.go new file mode 100644 index 000000000..a93a7dc04 --- /dev/null +++ b/pkg/event/pid_windows.go @@ -0,0 +1,24 @@ +//go:build windows + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +// PID is the process identifier type on Windows. +type PID = uint32 diff --git a/pkg/filter/accessor_linux.go b/pkg/filter/accessor_linux.go index 59ceb97b7..069271f0d 100644 --- a/pkg/filter/accessor_linux.go +++ b/pkg/filter/accessor_linux.go @@ -36,7 +36,7 @@ func GetAccessors() []Accessor { } type psAccessor struct { - psnap ps.Resolver + psnap ps.Snapshotter } func (psAccessor) SetFields([]Field) {} @@ -45,7 +45,7 @@ func (psAccessor) IsFieldAccessible(e *event.Event) bool { return e.PS != nil || e.Category == event.Process } -func newPSAccessor(psnap ps.Resolver) Accessor { return &psAccessor{psnap: psnap} } +func newPSAccessor(psnap ps.Snapshotter) Accessor { return &psAccessor{psnap: psnap} } func (a *psAccessor) Get(f Field, e *event.Event) (params.Value, error) { switch f.Name { diff --git a/pkg/filter/accessor_windows.go b/pkg/filter/accessor_windows.go index 7f051bc6a..e39cd59ef 100644 --- a/pkg/filter/accessor_windows.go +++ b/pkg/filter/accessor_windows.go @@ -70,7 +70,7 @@ func getParentPs(e *event.Event) *pstypes.PS { // psAccessor extracts process's state or event specific values. type psAccessor struct { - psnap psnap.Resolver + psnap psnap.Snapshotter } func (psAccessor) SetFields([]Field) {} @@ -79,7 +79,7 @@ func (psAccessor) IsFieldAccessible(e *event.Event) bool { return e.PS != nil || e.Category() == event.Process } -func newPSAccessor(psnap psnap.Resolver) Accessor { return &psAccessor{psnap: psnap} } +func newPSAccessor(psnap psnap.Snapshotter) Accessor { return &psAccessor{psnap: psnap} } func (ps *psAccessor) Get(f Field, e *event.Event) (params.Value, error) { switch f.Name { diff --git a/pkg/filter/filter_linux.go b/pkg/filter/filter_linux.go index 42ad1eb0a..a5c7d6cff 100644 --- a/pkg/filter/filter_linux.go +++ b/pkg/filter/filter_linux.go @@ -31,14 +31,14 @@ import ( ) type opts struct { - psnap ps.Resolver + psnap ps.Snapshotter } // Option defines the option supplied to the filter type Option func(o *opts) -// WithPSnapshotter passes a process resolver reference to the filter. -func WithPSnapshotter(psnap ps.Resolver) Option { +// WithPSnapshotter passes a process snapshotter reference to the filter. +func WithPSnapshotter(psnap ps.Snapshotter) Option { return func(o *opts) { o.psnap = psnap } diff --git a/pkg/filter/filter_windows.go b/pkg/filter/filter_windows.go index 30fc87eb8..3f4fadf52 100644 --- a/pkg/filter/filter_windows.go +++ b/pkg/filter/filter_windows.go @@ -29,14 +29,14 @@ import ( ) type opts struct { - psnap ps.Resolver + psnap ps.Snapshotter } // Option defines the option supplied to the filter type Option func(o *opts) -// WithPSnapshotter passes a process resolver reference to the filter. -func WithPSnapshotter(psnap ps.Resolver) Option { +// WithPSnapshotter passes a process snapshotter reference to the filter. +func WithPSnapshotter(psnap ps.Snapshotter) Option { return func(o *opts) { o.psnap = psnap } diff --git a/pkg/filter/util.go b/pkg/filter/util.go index f5562a40a..700b07d07 100644 --- a/pkg/filter/util.go +++ b/pkg/filter/util.go @@ -28,9 +28,9 @@ import ( ) // framePID returns the pid associated with the stack frame. -func framePID(e *event.Event) uint32 { +func framePID(e *event.Event) event.PID { if !e.Callstack.IsEmpty() && e.Callstack.FrameAt(0).PID != 0 { - return e.Callstack.FrameAt(0).PID + return event.PID(e.Callstack.FrameAt(0).PID) } return e.PID } diff --git a/pkg/ps/snapshotter.go b/pkg/ps/snapshotter.go index f58f45403..34f7997fa 100644 --- a/pkg/ps/snapshotter.go +++ b/pkg/ps/snapshotter.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2020-2021 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/ps/snapshotter_linux.go b/pkg/ps/snapshotter_linux.go index 0b4f9d9cf..37b049397 100644 --- a/pkg/ps/snapshotter_linux.go +++ b/pkg/ps/snapshotter_linux.go @@ -28,39 +28,60 @@ import ( "github.com/rabbitstack/fibratus/pkg/util/va" ) -// LinuxSnapshotter stores Linux process state for enrichment and rule evaluation. -type LinuxSnapshotter interface { - Resolver +// Snapshotter stores Linux process state for enrichment and rule evaluation. +type Snapshotter interface { + // Write appends or updates process state from an inbound event. Write(*event.Event) error + // Remove deletes process state for the event process identifier. Remove(*event.Event) error - UpsertSnapshot(*pstypes.PS) + // Find attempts to retrieve process state for the specified process identifier. + Find(pid uint64) (bool, *pstypes.PS) + // FindAndPut attempts to retrieve process state and updates the snapshot when found. + FindAndPut(pid uint64) *pstypes.PS + // Put inserts the process state into the snapshotter. Put(*pstypes.PS) + // UpsertSnapshot inserts or replaces process state. + UpsertSnapshot(*pstypes.PS) + // Size returns the total number of process state items. Size() uint32 + // Close closes the process snapshotter and disposes allocated resources. Close() error + // AddThread builds thread state from the event representation. AddThread(*event.Event) error - RemoveThread(pid uint32, tid uint32) error + // RemoveThread removes the thread from the given process. + RemoveThread(pid uint64, tid uint32) error + // AddMmap adds a memory mapping to the process state. AddMmap(*event.Event) error - RemoveMmap(pid uint32, addr va.Address) error + // RemoveMmap removes a memory mapping at the given base address. + RemoveMmap(pid uint64, addr va.Address) error } -type linuxSnapshotter struct { +type snapshotter struct { mu sync.RWMutex - procs map[uint32]*pstypes.PS + procs map[uint64]*pstypes.PS } -// NewLinuxSnapshotter builds an in-memory Linux process snapshotter. -func NewLinuxSnapshotter() LinuxSnapshotter { - return &linuxSnapshotter{procs: make(map[uint32]*pstypes.PS)} +// NewSnapshotter builds an in-memory Linux process snapshotter. +func NewSnapshotter() Snapshotter { + return &snapshotter{procs: make(map[uint64]*pstypes.PS)} } -func (s *linuxSnapshotter) Find(pid uint32) (bool, *pstypes.PS) { +func (s *snapshotter) Find(pid uint64) (bool, *pstypes.PS) { s.mu.RLock() defer s.mu.RUnlock() ps, ok := s.procs[pid] return ok, ps } -func (s *linuxSnapshotter) Put(ps *pstypes.PS) { +func (s *snapshotter) FindAndPut(pid uint64) *pstypes.PS { + ok, ps := s.Find(pid) + if !ok { + return nil + } + return ps +} + +func (s *snapshotter) Put(ps *pstypes.PS) { if ps == nil { return } @@ -69,11 +90,11 @@ func (s *linuxSnapshotter) Put(ps *pstypes.PS) { s.procs[ps.PID] = ps } -func (s *linuxSnapshotter) UpsertSnapshot(ps *pstypes.PS) { +func (s *snapshotter) UpsertSnapshot(ps *pstypes.PS) { s.Put(ps) } -func (s *linuxSnapshotter) Write(evt *event.Event) error { +func (s *snapshotter) Write(evt *event.Event) error { if evt == nil || evt.PS == nil { return nil } @@ -81,7 +102,7 @@ func (s *linuxSnapshotter) Write(evt *event.Event) error { return nil } -func (s *linuxSnapshotter) Remove(evt *event.Event) error { +func (s *snapshotter) Remove(evt *event.Event) error { if evt == nil { return nil } @@ -91,20 +112,20 @@ func (s *linuxSnapshotter) Remove(evt *event.Event) error { return nil } -func (s *linuxSnapshotter) Size() uint32 { +func (s *snapshotter) Size() uint32 { s.mu.RLock() defer s.mu.RUnlock() return uint32(len(s.procs)) } -func (s *linuxSnapshotter) Close() error { +func (s *snapshotter) Close() error { s.mu.Lock() defer s.mu.Unlock() - s.procs = make(map[uint32]*pstypes.PS) + s.procs = make(map[uint64]*pstypes.PS) return nil } -func (s *linuxSnapshotter) AddThread(evt *event.Event) error { +func (s *snapshotter) AddThread(evt *event.Event) error { if evt == nil || evt.PS == nil { return nil } @@ -117,7 +138,7 @@ func (s *linuxSnapshotter) AddThread(evt *event.Event) error { return nil } -func (s *linuxSnapshotter) RemoveThread(pid uint32, tid uint32) error { +func (s *snapshotter) RemoveThread(pid uint64, tid uint32) error { ok, ps := s.Find(pid) if !ok || ps == nil { return nil @@ -126,7 +147,7 @@ func (s *linuxSnapshotter) RemoveThread(pid uint32, tid uint32) error { return nil } -func (s *linuxSnapshotter) AddMmap(evt *event.Event) error { +func (s *snapshotter) AddMmap(evt *event.Event) error { if evt == nil || evt.PS == nil { return nil } @@ -141,7 +162,7 @@ func (s *linuxSnapshotter) AddMmap(evt *event.Event) error { return nil } -func (s *linuxSnapshotter) RemoveMmap(pid uint32, addr va.Address) error { +func (s *snapshotter) RemoveMmap(pid uint64, addr va.Address) error { ok, ps := s.Find(pid) if !ok || ps == nil { return nil diff --git a/pkg/ps/snapshotter_linux_test.go b/pkg/ps/snapshotter_linux_test.go index 1c6b178b1..06b10181f 100644 --- a/pkg/ps/snapshotter_linux_test.go +++ b/pkg/ps/snapshotter_linux_test.go @@ -29,8 +29,8 @@ import ( "github.com/stretchr/testify/require" ) -func TestLinuxSnapshotterFindPut(t *testing.T) { - s := NewLinuxSnapshotter() +func TestSnapshotterFindPut(t *testing.T) { + s := NewSnapshotter() ps := &pstypes.PS{PID: 100, Name: "bash", StartBootTime: 1234} s.Put(ps) diff --git a/pkg/ps/snapshotter_mock.go b/pkg/ps/snapshotter_mock.go index 2b3dade65..b6f38c314 100644 --- a/pkg/ps/snapshotter_mock.go +++ b/pkg/ps/snapshotter_mock.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/ps/types/types_linux.go b/pkg/ps/types/types_linux.go index d52196646..d70a71ffc 100644 --- a/pkg/ps/types/types_linux.go +++ b/pkg/ps/types/types_linux.go @@ -38,8 +38,8 @@ func (p *PE) String() string { return "" } type PS struct { sync.RWMutex - PID uint32 `json:"pid"` - Ppid uint32 `json:"ppid"` + PID uint64 `json:"pid"` + Ppid uint64 `json:"ppid"` Name string `json:"name"` Cmdline string `json:"comm"` Exe string `json:"exe"` @@ -85,7 +85,7 @@ func (ps *PS) Ancestors() []string { type Thread struct { Tid uint32 - Pid uint32 + Pid uint64 StartAddress va.Address UstackBase va.Address UstackLimit va.Address diff --git a/pkg/rules/compiler.go b/pkg/rules/compiler.go index b57e3e84e..a45a87bc4 100644 --- a/pkg/rules/compiler.go +++ b/pkg/rules/compiler.go @@ -58,12 +58,12 @@ var ( ) type compiler struct { - psnap ps.Resolver + psnap ps.Snapshotter config *config.Config approvers config.Approvers } -func newCompiler(psnap ps.Resolver, cfg *config.Config) *compiler { +func newCompiler(psnap ps.Snapshotter, cfg *config.Config) *compiler { return &compiler{psnap: psnap, config: cfg, approvers: config.Approvers{ Keys: make(map[string][]string), Paths: make(map[string][]string), diff --git a/pkg/rules/engine.go b/pkg/rules/engine.go index 1d87bb2d7..618880af8 100644 --- a/pkg/rules/engine.go +++ b/pkg/rules/engine.go @@ -55,7 +55,7 @@ var ( type Engine struct { filters *filterset config *config.Config - psnap ps.Resolver + psnap ps.Snapshotter matches []*ruleMatch mmu sync.Mutex // guards the rule matches slice @@ -130,7 +130,7 @@ func (f *compiledFilter) eval(e *event.Event, valuer *filter.ValuerCache) bool { } // NewEngine builds a fresh rules engine instance. -func NewEngine(psnap ps.Resolver, config *config.Config) *Engine { +func NewEngine(psnap ps.Snapshotter, config *config.Config) *Engine { e := &Engine{ filters: newFilterset(), matches: make([]*ruleMatch, 0), diff --git a/pkg/rules/engine_linux_test.go b/pkg/rules/engine_linux_test.go index 59c26b68d..5d514a30f 100644 --- a/pkg/rules/engine_linux_test.go +++ b/pkg/rules/engine_linux_test.go @@ -28,9 +28,9 @@ import ( "github.com/stretchr/testify/require" ) -func TestNewEngineAcceptsResolver(t *testing.T) { +func TestNewEngineAcceptsSnapshotter(t *testing.T) { cfg := &config.Config{Filters: &config.Filters{}} - e := NewEngine(ps.NewLinuxSnapshotter(), cfg) + e := NewEngine(ps.NewSnapshotter(), cfg) require.NotNil(t, e) require.NotNil(t, e.compiler) } diff --git a/pkg/rules/sequence.go b/pkg/rules/sequence.go index 9015c8eaa..d6cc20a90 100644 --- a/pkg/rules/sequence.go +++ b/pkg/rules/sequence.go @@ -120,10 +120,10 @@ type sequenceState struct { // The purpose is to enforce temporal monotonicity lastMatch time.Time - psnap ps.Resolver + psnap ps.Snapshotter } -func newSequenceState(f filter.Filter, c *config.FilterConfig, psnap ps.Resolver) *sequenceState { +func newSequenceState(f filter.Filter, c *config.FilterConfig, psnap ps.Snapshotter) *sequenceState { ss := &sequenceState{ filter: f, seq: f.GetSequence(), @@ -566,17 +566,17 @@ func (s *sequenceState) expire(e *event.Event) bool { // process spawned by CreateProcess, and it pertains // to the final sequence slot, it is safe to expire // the whole sequence - pid := rhs.Params.MustGetPid() + pid := event.PID(rhs.Params.MustGetPid()) if lhs.Type == event.CreateProcess && isFinalSlot { - return lhs.Params.MustGetPid() == pid + return event.PID(lhs.Params.MustGetPid()) == pid } if lhs.Type == event.CreateThread { // if the pids differ, the thread // is created in a remote process. // Sequence can be expired only if // the remote process terminates - if lhs.PID != lhs.Params.MustGetPid() { - return lhs.Params.MustGetPid() == pid + if lhs.PID != event.PID(lhs.Params.MustGetPid()) { + return event.PID(lhs.Params.MustGetPid()) == pid } } return lhs.PID == pid From a3afc8d060c2011d82a61b95e0663d1a279e3ad6 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 10 Aug 2026 16:31:23 +0200 Subject: [PATCH 22/65] refactor(config): Split alertsender loading by platform Keep mail and Slack loading shared, and move systray/eventlog loading into the Windows-specific path. Linux Config now stores Alertsenders for the shared loader. --- pkg/config/alertsender.go | 47 ++++++------------------- pkg/config/alertsender_linux.go | 31 +++++++++++++++++ pkg/config/alertsender_windows.go | 58 +++++++++++++++++++++++++++++++ pkg/config/config_linux.go | 19 ++++++---- 4 files changed, 111 insertions(+), 44 deletions(-) create mode 100644 pkg/config/alertsender_linux.go create mode 100644 pkg/config/alertsender_windows.go diff --git a/pkg/config/alertsender.go b/pkg/config/alertsender.go index 237b3fe97..5abc11343 100644 --- a/pkg/config/alertsender.go +++ b/pkg/config/alertsender.go @@ -1,7 +1,6 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * @@ -23,12 +22,11 @@ package config import ( "errors" "fmt" + "reflect" + "github.com/rabbitstack/fibratus/pkg/alertsender" - "github.com/rabbitstack/fibratus/pkg/alertsender/eventlog" "github.com/rabbitstack/fibratus/pkg/alertsender/mail" "github.com/rabbitstack/fibratus/pkg/alertsender/slack" - "github.com/rabbitstack/fibratus/pkg/alertsender/systray" - "reflect" ) var errNoAlertsendersSection = errors.New("no alertsenders section in config") @@ -64,11 +62,10 @@ func (c *Config) tryLoadAlertSenders() error { if !mailConfig.Enabled { continue } - config := alertsender.Config{ + configs = append(configs, alertsender.Config{ Type: alertsender.Mail, Sender: mailConfig, - } - configs = append(configs, config) + }) case "slack": var slackConfig slack.Config if err := decode(config, &slackConfig); err != nil { @@ -77,38 +74,14 @@ func (c *Config) tryLoadAlertSenders() error { if !slackConfig.Enabled { continue } - config := alertsender.Config{ + configs = append(configs, alertsender.Config{ Type: alertsender.Slack, Sender: slackConfig, + }) + default: + if err := c.loadPlatformAlertSender(typ, config, &configs); err != nil { + return err } - configs = append(configs, config) - case "systray": - var systrayConfig systray.Config - if err := decode(config, &systrayConfig); err != nil { - return errAlertsenderConfig(typ, err) - } - if !systrayConfig.Enabled { - continue - } - config := alertsender.Config{ - Type: alertsender.Systray, - Sender: systrayConfig, - } - configs = append(configs, config) - - case "eventlog": - var eventlogConfig eventlog.Config - if err := decode(config, &eventlogConfig); err != nil { - return errAlertsenderConfig(typ, err) - } - if !eventlogConfig.Enabled { - continue - } - config := alertsender.Config{ - Type: alertsender.Eventlog, - Sender: eventlogConfig, - } - configs = append(configs, config) } } diff --git a/pkg/config/alertsender_linux.go b/pkg/config/alertsender_linux.go new file mode 100644 index 000000000..1818cc7f1 --- /dev/null +++ b/pkg/config/alertsender_linux.go @@ -0,0 +1,31 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import "github.com/rabbitstack/fibratus/pkg/alertsender" + +func (c *Config) loadPlatformAlertSender(typ string, config interface{}, configs *[]alertsender.Config) error { + // Platform-specific Linux alert senders can be loaded here. + _ = typ + _ = config + _ = configs + return nil +} diff --git a/pkg/config/alertsender_windows.go b/pkg/config/alertsender_windows.go new file mode 100644 index 000000000..83eaf8cc1 --- /dev/null +++ b/pkg/config/alertsender_windows.go @@ -0,0 +1,58 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "github.com/rabbitstack/fibratus/pkg/alertsender" + "github.com/rabbitstack/fibratus/pkg/alertsender/eventlog" + "github.com/rabbitstack/fibratus/pkg/alertsender/systray" +) + +func (c *Config) loadPlatformAlertSender(typ string, config interface{}, configs *[]alertsender.Config) error { + switch typ { + case "systray": + var systrayConfig systray.Config + if err := decode(config, &systrayConfig); err != nil { + return errAlertsenderConfig(typ, err) + } + if !systrayConfig.Enabled { + return nil + } + *configs = append(*configs, alertsender.Config{ + Type: alertsender.Systray, + Sender: systrayConfig, + }) + case "eventlog": + var eventlogConfig eventlog.Config + if err := decode(config, &eventlogConfig); err != nil { + return errAlertsenderConfig(typ, err) + } + if !eventlogConfig.Enabled { + return nil + } + *configs = append(*configs, alertsender.Config{ + Type: alertsender.Eventlog, + Sender: eventlogConfig, + }) + } + return nil +} diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index c0295c0a0..c00e1190c 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -25,6 +25,7 @@ import ( "path/filepath" "strings" + "github.com/rabbitstack/fibratus/pkg/alertsender" "github.com/rabbitstack/fibratus/pkg/util/log" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -34,13 +35,14 @@ import ( const configFile = "config-file" type Config struct { - EventSource EventSourceConfig `json:"eventsource" yaml:"eventsource"` - Filament FilamentConfig `json:"filament" yaml:"filament"` - API APIConfig `json:"api" yaml:"api"` - Log log.Config `json:"logging" yaml:"logging"` - Filters *Filters `json:"filters" yaml:"filters"` - ForwardMode bool `json:"forward" yaml:"forward"` - CapFile string `json:"cap.file" yaml:"cap.file"` + EventSource EventSourceConfig `json:"eventsource" yaml:"eventsource"` + Filament FilamentConfig `json:"filament" yaml:"filament"` + API APIConfig `json:"api" yaml:"api"` + Log log.Config `json:"logging" yaml:"logging"` + Filters *Filters `json:"filters" yaml:"filters"` + ForwardMode bool `json:"forward" yaml:"forward"` + CapFile string `json:"cap.file" yaml:"cap.file"` + Alertsenders []alertsender.Config `json:"-" yaml:"-"` flags *pflag.FlagSet viper *viper.Viper @@ -104,6 +106,9 @@ func (c *Config) Init() error { c.Filters.initFromViper(c.viper) c.ForwardMode = c.viper.GetBool("forward") c.CapFile = c.viper.GetString("cap.file") + if err := c.tryLoadAlertSenders(); err != nil && err != errNoAlertsendersSection { + return err + } return nil } From 4e9edda9e06c083bd1445f0bdcc405ff44428284 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 10 Aug 2026 23:36:27 +0200 Subject: [PATCH 23/65] refactor(config): share platform-neutral configuration Move common config, event-source, output, schema, transformer, and validation behavior into shared files while retaining platform-specific hooks. Add Linux schema coverage and preserve Windows callers through explicit platform field assignment. --- internal/etw/source_test.go | 18 +- pkg/config/alertsender_linux_test.go | 59 +++ pkg/config/config.schema.json | 9 + pkg/config/config_linux.go | 112 +---- pkg/config/config_windows.go | 415 +++--------------- pkg/config/eventsource.go | 75 +++- pkg/config/eventsource_linux.go | 43 +- pkg/config/eventsource_linux_test.go | 71 +++ pkg/config/eventsource_windows.go | 126 ++++++ pkg/config/output.go | 31 +- .../{schema_linux.go => output_linux.go} | 12 +- pkg/config/output_linux_test.go | 38 ++ pkg/config/output_test.go | 2 - pkg/config/output_windows.go | 58 +++ pkg/config/output_windows_test.go | 41 ++ pkg/config/print_test.go | 7 +- pkg/config/{schema_windows.go => schema.go} | 4 +- pkg/config/transformer.go | 5 +- pkg/config/transformer_test.go | 5 +- pkg/handle/snapshotter_test.go | 9 +- pkg/symbolize/symbolizer_test.go | 8 +- 21 files changed, 573 insertions(+), 575 deletions(-) create mode 100644 pkg/config/alertsender_linux_test.go create mode 100644 pkg/config/eventsource_linux_test.go create mode 100644 pkg/config/eventsource_windows.go rename pkg/config/{schema_linux.go => output_linux.go} (73%) create mode 100644 pkg/config/output_linux_test.go create mode 100644 pkg/config/output_windows.go create mode 100644 pkg/config/output_windows_test.go rename pkg/config/{schema_windows.go => schema.go} (97%) diff --git a/internal/etw/source_test.go b/internal/etw/source_test.go index 319b6230e..139827c22 100644 --- a/internal/etw/source_test.go +++ b/internal/etw/source_test.go @@ -273,12 +273,12 @@ func TestEventSourceEnableFlagsDynamicallyWithYaraEnabled(t *testing.T) { EnableMemEvents: true, }, Filters: &config.Filters{}, - Yara: yara.Config{ - Enabled: true, - SkipFiles: false, - SkipMmaps: true, - SkipAllocs: false, - }, + } + cfg.Yara = yara.Config{ + Enabled: true, + SkipFiles: false, + SkipMmaps: true, + SkipAllocs: false, } cfg.EventSource.Init() @@ -1138,10 +1138,10 @@ func testCallstackEnrichment(t *testing.T, hsnap handle.Snapshotter, psnap ps.Sn evsConfig.Init() cfg := &config.Config{ - EventSource: evsConfig, - Filters: &config.Filters{}, - SymbolizeKernelAddresses: true, + EventSource: evsConfig, + Filters: &config.Filters{}, } + cfg.SymbolizeKernelAddresses = true evs := NewEventSource(psnap, hsnap, cfg, nil) symbolizer := symbolize.NewSymbolizer(symbolize.NewDebugHelpResolver(cfg), psnap, cfg, true) diff --git a/pkg/config/alertsender_linux_test.go b/pkg/config/alertsender_linux_test.go new file mode 100644 index 000000000..d48b3c364 --- /dev/null +++ b/pkg/config/alertsender_linux_test.go @@ -0,0 +1,59 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/alertsender" + "github.com/rabbitstack/fibratus/pkg/alertsender/mail" + "github.com/rabbitstack/fibratus/pkg/alertsender/slack" + "github.com/stretchr/testify/require" +) + +func TestAlertSendersLinux(t *testing.T) { + c := NewWithOpts(WithRun()) + c.viper.Set("alertsenders", map[string]interface{}{ + "mail": map[string]interface{}{ + "enabled": true, + "host": "smtp.example.com", + }, + "slack": map[string]interface{}{ + "enabled": true, + "url": "https://example.com/hook", + }, + "eventlog": map[string]interface{}{"enabled": true}, + "systray": map[string]interface{}{"enabled": true}, + }) + + require.NoError(t, c.tryLoadAlertSenders()) + require.Len(t, c.Alertsenders, 2) + for _, sender := range c.Alertsenders { + switch sender.Type { + case alertsender.Mail: + require.IsType(t, mail.Config{}, sender.Sender) + case alertsender.Slack: + require.IsType(t, slack.Config{}, sender.Sender) + default: + require.Failf(t, "unexpected sender", "%v", sender.Type) + } + } +} diff --git a/pkg/config/config.schema.json b/pkg/config/config.schema.json index 9db99916b..dd75c0712 100644 --- a/pkg/config/config.schema.json +++ b/pkg/config/config.schema.json @@ -335,6 +335,12 @@ "eventsource": { "type": "object", "properties": { + "enable-process": { + "type": "boolean" + }, + "enable-file": { + "type": "boolean" + }, "enable-thread": { "type": "boolean" }, @@ -389,6 +395,9 @@ "items": { "type": "string", "enum": [ + "execve", + "exit", + "clone", "CreateThread", "TerminateThread", "OpenProcess", diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index c00e1190c..7d803ce89 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -20,111 +20,27 @@ package config -import ( - "os" - "path/filepath" - "strings" +import "path/filepath" - "github.com/rabbitstack/fibratus/pkg/alertsender" - "github.com/rabbitstack/fibratus/pkg/util/log" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "github.com/spf13/viper" -) +type platformConfig struct{} -const configFile = "config-file" +func newPlatformConfig() platformConfig { return platformConfig{} } -type Config struct { - EventSource EventSourceConfig `json:"eventsource" yaml:"eventsource"` - Filament FilamentConfig `json:"filament" yaml:"filament"` - API APIConfig `json:"api" yaml:"api"` - Log log.Config `json:"logging" yaml:"logging"` - Filters *Filters `json:"filters" yaml:"filters"` - ForwardMode bool `json:"forward" yaml:"forward"` - CapFile string `json:"cap.file" yaml:"cap.file"` - Alertsenders []alertsender.Config `json:"-" yaml:"-"` - - flags *pflag.FlagSet - viper *viper.Viper - opts *Options -} - -type Options struct { - run bool - list bool - stats bool - validate bool -} - -type Option func(*Options) - -func WithRun() Option { return func(o *Options) { o.run = true } } -func WithList() Option { return func(o *Options) { o.list = true } } -func WithStats() Option { return func(o *Options) { o.stats = true } } -func WithValidate() Option { return func(o *Options) { o.validate = true } } - -func NewWithOpts(options ...Option) *Config { - opts := &Options{} - for _, option := range options { - option(opts) - } - v := viper.New() - v.AutomaticEnv() - v.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_")) - c := &Config{ - Filters: &Filters{}, - flags: new(pflag.FlagSet), - viper: v, - opts: opts, - } - c.flags.String(configFile, filepath.Join("/etc", "fibratus", "fibratus.yml"), "Indicates the location of the configuration file") - c.flags.String(filamentName, "", "Specifies the filament to execute") - c.flags.String(filamentPath, "", "Denotes the directory where filaments are located") - c.flags.String(transport, "localhost:8080", "Specifies the underlying transport protocol for the API HTTP server") - c.flags.Bool(rulesEnabled, true, "Indicates if the rule engine is enabled and rules loaded") - c.flags.StringSlice(rulesFromPaths, nil, "Comma-separated list of rules files") - c.flags.StringSlice(macrosFromPaths, nil, "Comma-separated list of macro files") - c.flags.StringSlice(rulesFromURLs, nil, "Comma-separated list of rules URL resources") - c.flags.Bool(matchAll, true, "Indicates if the match all strategy is enabled") +func (c *Config) addPlatformFlags() { c.EventSource.AddFlags(c.flags) - c.Log.AddFlags(c.flags) - return c } -func (c *Config) MustViperize(cmd *cobra.Command) { - cmd.PersistentFlags().AddFlagSet(c.flags) - if err := c.viper.BindPFlags(cmd.PersistentFlags()); err != nil { - panic(err) - } -} +func (c *Config) initPlatform() {} -func (c *Config) Init() error { - c.EventSource.initFromViper(c.viper) - c.Filament.initFromViper(c.viper) - c.API.initFromViper(c.viper) - c.Log.InitFromViper(c.viper) - c.Filters.initFromViper(c.viper) - c.ForwardMode = c.viper.GetBool("forward") - c.CapFile = c.viper.GetString("cap.file") - if err := c.tryLoadAlertSenders(); err != nil && err != errNoAlertsendersSection { - return err - } - return nil -} +func (c *Config) Validate() error { return c.validateConfig() } -func (c *Config) GetConfigFile() string { return c.viper.GetString(configFile) } -func (c *Config) File() string { return c.GetConfigFile() } -func (c *Config) GetFilters() []*FilterConfig { - if c.Filters == nil { - return nil - } - return c.Filters.filters +func defaultConfigFile() string { return filepath.Join("/etc", "fibratus", "fibratus.yml") } +func defaultFilamentPath() string { + return filepath.Join("/usr", "share", "fibratus", "filaments") +} +func defaultRulesPaths() []string { + return []string{filepath.Join("/etc", "fibratus", "rules", "*")} } -func (c *Config) TryLoadFile(file string) error { - c.viper.SetConfigFile(file) - return c.viper.ReadInConfig() +func defaultMacrosPaths() []string { + return []string{filepath.Join("/etc", "fibratus", "rules", "macros", "*")} } -func (c *Config) Validate() error { return nil } -func (c *Config) IsCaptureSet() bool { return c.CapFile != "" } -func (c *Config) IsFilamentSet() bool { return c.Filament.Name != "" } -func (c *Config) ConfigExists() bool { _, err := os.Stat(c.File()); return err == nil } diff --git a/pkg/config/config_windows.go b/pkg/config/config_windows.go index 34670fd4e..0826dbfb3 100644 --- a/pkg/config/config_windows.go +++ b/pkg/config/config_windows.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io @@ -19,57 +21,26 @@ package config import ( - "encoding/json" - "fmt" - "time" - "github.com/rabbitstack/fibratus/internal/evasion" "golang.org/x/sys/windows" - "github.com/rabbitstack/fibratus/pkg/outputs/http" - - "github.com/rabbitstack/fibratus/pkg/aggregator" - "github.com/rabbitstack/fibratus/pkg/aggregator/transformers" - removet "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/remove" - replacet "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/replace" - tagst "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/tags" "github.com/rabbitstack/fibratus/pkg/event" - "github.com/rabbitstack/fibratus/pkg/outputs/amqp" - "github.com/rabbitstack/fibratus/pkg/outputs/elasticsearch" - "github.com/rabbitstack/fibratus/pkg/util/log" - "github.com/rabbitstack/fibratus/pkg/util/multierror" - yara "github.com/rabbitstack/fibratus/pkg/yara/config" - "gopkg.in/yaml.v3" - - renamet "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/rename" - trimt "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/trim" "os" "path/filepath" - "strings" - "github.com/rabbitstack/fibratus/pkg/alertsender" - eventlogsender "github.com/rabbitstack/fibratus/pkg/alertsender/eventlog" - mailsender "github.com/rabbitstack/fibratus/pkg/alertsender/mail" - slacksender "github.com/rabbitstack/fibratus/pkg/alertsender/slack" - systraysender "github.com/rabbitstack/fibratus/pkg/alertsender/systray" - "github.com/rabbitstack/fibratus/pkg/outputs" - "github.com/rabbitstack/fibratus/pkg/outputs/console" + "github.com/rabbitstack/fibratus/pkg/alertsender/eventlog" + "github.com/rabbitstack/fibratus/pkg/alertsender/systray" "github.com/rabbitstack/fibratus/pkg/pe" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "github.com/spf13/viper" + yara "github.com/rabbitstack/fibratus/pkg/yara/config" ) const ( - capFile = "cap.file" - configFile = "config-file" debugPrivilege = "debug-privilege" initHandleSnapshot = "handle.init-snapshot" enumerateHandles = "handle.enumerate-handles" symbolPaths = "symbol-paths" symbolizeKernelAddresses = "symbolize-kernel-addresses" - forwardMode = "forward" serializeThreads = "event.serialize-threads" serializeModules = "event.serialize-modules" @@ -78,366 +49,98 @@ const ( serializeEnvs = "event.serialize-envs" ) -// Config stores configuration options for fine-tuning the behaviour of Fibratus. -type Config struct { - // EventSource stores different configuration options for fine-tuning the event source. - EventSource EventSourceConfig `json:"eventsource" yaml:"eventsource"` - // Filament contains filament settings - Filament FilamentConfig `json:"filament" yaml:"filament"` - // PE contains the settings that influences the behaviour of the PE (Portable Executable) reader. - PE pe.Config `json:"pe" yaml:"pe"` - // Output stores the currently active output config - Output outputs.Config - // InitHandleSnapshot indicates whether initial handle snapshot is built - InitHandleSnapshot bool `json:"init-handle-snapshot" yaml:"init-handle-snapshot"` - // EnumerateHandles indicates if process handles are collected during startup or - // when a new process is spawn - EnumerateHandles bool `json:"enumerate-handles" yaml:"enumerate-handles"` - // SymbolPaths designates the path or a series of paths separated by a semicolon - // that is used to search for symbols files. - SymbolPaths string `json:"symbol-paths" yaml:"symbols-paths"` - // SymbolizeKernelAddresses determines if kernel stack addresses are symbolized. - SymbolizeKernelAddresses bool `json:"symbolize-kernel-addresses" yaml:"symbolize-kernel-addresses"` - - // DebugPrivilege dictates if the SeDebugPrivilege is injected into - // Fibratus process' access token. - DebugPrivilege bool `json:"debug-privilege" yaml:"debug-privilege"` - // ForwardMode designates if event forwarding mode is engaged - ForwardMode bool `json:"forward" yaml:"forward"` - - // CapFile represents the name of the capture file. - CapFile string - - // API stores global HTTP API preferences - API APIConfig `json:"api" yaml:"api"` - // Yara contains configuration that influences the behaviour of the Yara engine - Yara yara.Config `json:"yara" yaml:"yara"` - // Aggregator stores event aggregator configuration - Aggregator aggregator.Config `json:"aggregator" yaml:"aggregator"` - // Log contains log-specific configuration options - Log log.Config `json:"logging" yaml:"logging"` - - // Transformers stores transformer configurations - Transformers []transformers.Config - // Alertsenders stores alert sender configurations - Alertsenders []alertsender.Config - - // Filters contains filter/rule definitions - Filters *Filters `json:"filters" yaml:"filters"` - - // Evasion controls the detection of evasion behaviours. - Evasion evasion.Config `json:"evasion" yaml:"evasion"` - - flags *pflag.FlagSet - viper *viper.Viper - opts *Options -} - -// Options determines which config flags are toggled depending on the command type. -type Options struct { - capture bool - replay bool - run bool - list bool - stats bool - validate bool -} - -// Option is the type alias for the config option. -type Option func(*Options) - -// WithCapture determines the capture command is executed. -func WithCapture() Option { - return func(o *Options) { - o.capture = true - } -} - -// WithReplay determines the replay command is executed. -func WithReplay() Option { - return func(o *Options) { - o.replay = true - } -} - -// WithRun determines the main command is executed. -func WithRun() Option { - return func(o *Options) { - o.run = true - } -} - -// WithList determines the list command is executed. -func WithList() Option { - return func(o *Options) { - o.list = true - } +type platformConfig struct { + PE pe.Config `json:"pe" yaml:"pe"` + InitHandleSnapshot bool `json:"init-handle-snapshot" yaml:"init-handle-snapshot"` + EnumerateHandles bool `json:"enumerate-handles" yaml:"enumerate-handles"` + SymbolPaths string `json:"symbol-paths" yaml:"symbols-paths"` + SymbolizeKernelAddresses bool `json:"symbolize-kernel-addresses" yaml:"symbolize-kernel-addresses"` + DebugPrivilege bool `json:"debug-privilege" yaml:"debug-privilege"` + Yara yara.Config `json:"yara" yaml:"yara"` + Evasion evasion.Config `json:"evasion" yaml:"evasion"` } -// WithStats determines the stats command is executed. -func WithStats() Option { - return func(o *Options) { - o.stats = true +func newPlatformConfig() platformConfig { + return platformConfig{ + PE: pe.Config{}, + Yara: yara.Config{}, } } -// WithValidate determines the validate command is executed. -func WithValidate() Option { - return func(o *Options) { - o.validate = true - } -} - -// NewWithOpts builds a new configuration store from a variety of sources such as configuration files, -// environment variables or command line flags. -func NewWithOpts(options ...Option) *Config { - opts := &Options{} - - for _, opt := range options { - opt(opts) - } - - v := viper.New() - v.AutomaticEnv() - v.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_")) - - flagSet := new(pflag.FlagSet) - - c := &Config{ - EventSource: EventSourceConfig{}, - Filament: FilamentConfig{}, - API: APIConfig{}, - PE: pe.Config{}, - Log: log.Config{}, - Aggregator: aggregator.Config{}, - Filters: &Filters{}, - viper: v, - flags: flagSet, - opts: opts, - } - - if opts.run || opts.replay { - aggregator.AddFlags(flagSet) - console.AddFlags(flagSet) - amqp.AddFlags(flagSet) - elasticsearch.AddFlags(flagSet) - http.AddFlags(flagSet) - removet.AddFlags(flagSet) - replacet.AddFlags(flagSet) - renamet.AddFlags(flagSet) - trimt.AddFlags(flagSet) - tagst.AddFlags(flagSet) - mailsender.AddFlags(flagSet) - slacksender.AddFlags(flagSet) - systraysender.AddFlags(flagSet) - eventlogsender.AddFlags(flagSet) - yara.AddFlags(flagSet) - } - - if opts.run || opts.capture { - pe.AddFlags(flagSet) - } - - if opts.run { - evasion.AddFlags(flagSet) +func (c *Config) addPlatformFlags() { + if c.opts.run || c.opts.replay { + systray.AddFlags(c.flags) + eventlog.AddFlags(c.flags) + yara.AddFlags(c.flags) } - - c.addFlags() - - return c -} - -// GetConfigFile gets the path of the configuration file from Viper value. -func (c Config) GetConfigFile() string { - return c.viper.GetString(configFile) -} - -// GetFilters returns all rule filters loaded into the engine. -func (c Config) GetFilters() []*FilterConfig { - if c.Filters == nil { - return nil + if c.opts.run || c.opts.capture { + pe.AddFlags(c.flags) + c.EventSource.AddFlags(c.flags) } - return c.Filters.filters -} - -// MustViperize adds the flag set to the Cobra command and binds them within the Viper flags. -func (c *Config) MustViperize(cmd *cobra.Command) { - cmd.PersistentFlags().AddFlagSet(c.flags) - if err := c.viper.BindPFlags(cmd.PersistentFlags()); err != nil { - panic(err) + if c.opts.run { + evasion.AddFlags(c.flags) } - if c.opts.capture || c.opts.replay { - if err := cmd.MarkPersistentFlagRequired(capFile); err != nil { - panic(err) - } + if c.opts.run || c.opts.capture { + c.flags.Bool(initHandleSnapshot, false, "Indicates whether the initial handle snapshot is built") + c.flags.Bool(debugPrivilege, true, "Dictates if the SeDebugPrivilege is injected into the process token") + c.flags.Bool(enumerateHandles, false, "Indicates if process handles are collected") + c.flags.String(symbolPaths, "srv*c:\\\\SymCache*https://msdl.microsoft.com/download/symbols", "Designates paths used to search for symbol files") + c.flags.Bool(symbolizeKernelAddresses, false, "Determines if kernel stack addresses are symbolized") + c.flags.Bool(serializeThreads, false, "Indicates if threads are serialized as part of process state") + c.flags.Bool(serializeModules, false, "Indicates if modules are serialized as part of process state") + c.flags.Bool(serializeHandles, false, "Indicates if handles are serialized as part of process state") + c.flags.Bool(serializePE, false, "Indicates if PE metadata is serialized as part of process state") + c.flags.Bool(serializeEnvs, true, "Indicates if environment variables are serialized as part of process state") } } -// Init setups the configuration state from Viper. -func (c *Config) Init() error { - c.EventSource.initFromViper(c.viper) - c.Filament.initFromViper(c.viper) - c.API.initFromViper(c.viper) +func (c *Config) initPlatform() { c.PE.InitFromViper(c.viper) - c.Aggregator.InitFromViper(c.viper) - c.Log.InitFromViper(c.viper) c.Yara.InitFromViper(c.viper) - c.Filters.initFromViper(c.viper) - c.InitHandleSnapshot = c.viper.GetBool(initHandleSnapshot) c.EnumerateHandles = c.viper.GetBool(enumerateHandles) c.SymbolPaths = c.viper.GetString(symbolPaths) c.SymbolizeKernelAddresses = c.viper.GetBool(symbolizeKernelAddresses) c.DebugPrivilege = c.viper.GetBool(debugPrivilege) - c.ForwardMode = c.viper.GetBool(forwardMode) - c.CapFile = c.viper.GetString(capFile) - event.SerializeThreads = c.viper.GetBool(serializeThreads) event.SerializeModules = c.viper.GetBool(serializeModules) event.SerializeHandles = c.viper.GetBool(serializeHandles) event.SerializePE = c.viper.GetBool(serializePE) event.SerializeEnvs = c.viper.GetBool(serializeEnvs) - - if c.opts.run || c.opts.replay { - if err := c.tryLoadOutput(); err != nil { - return err - } - if err := c.tryLoadTransformers(); err != nil { - return err - } - if err := c.tryLoadAlertSenders(); err != nil { - return err - } - } - if c.opts.run { c.Evasion.InitFromViper(c.viper) } +} + +// Validate validates the configuration file and merged Viper settings against the schema. +func (c *Config) Validate() error { return c.validateConfig() } - return nil +func defaultConfigFile() string { + return filepath.Join(os.Getenv("PROGRAMFILES"), "fibratus", "config", "fibratus.yml") } -// IsCaptureSet determines if the events are stored -// in the capture file. -func (c *Config) IsCaptureSet() bool { return c.CapFile != "" } +func defaultFilamentPath() string { + return filepath.Join(os.Getenv("PROGRAMFILES"), "fibratus", "filaments") +} -// IsFilamentSet indicates if the filament is supplied. -func (c *Config) IsFilamentSet() bool { return c.Filament.Name != "" } +func defaultRulesPaths() []string { + return []string{filepath.Join(defaultRulesDir(), "*")} +} -// TryLoadFile attempts to load the configuration file from specified path on the file system. -func (c *Config) TryLoadFile(file string) error { - c.viper.SetConfigFile(file) - return c.viper.ReadInConfig() +func defaultMacrosPaths() []string { + return []string{filepath.Join(defaultRulesDir(), "Macros", "*")} } -// Validate ensures that all configuration options provided by user have the expected values. It returns -// a list of validation errors prefixed with the offending configuration property/flag. -func (c *Config) Validate() error { - // we'll first validate the structure and values of the config file - file := c.viper.GetString(configFile) - var out interface{} - b, err := os.ReadFile(file) +func defaultRulesDir() string { + exe, err := os.Executable() if err != nil { - return err - } - switch filepath.Ext(file) { - case ".yaml", ".yml": - err = yaml.Unmarshal(b, &out) - case ".json": - err = json.Unmarshal(b, &out) - default: - return fmt.Errorf("%s is not a supported config file extension", filepath.Ext(file)) + exe = filepath.Join(os.Getenv("ProgramFiles"), "Fibratus", "Bin", "fibratus.exe") } - if err != nil { - return fmt.Errorf("couldn't read the config file: %v", err) - } - // validate config file content - valid, errs := validate(configSchema, out) - if !valid || len(errs) > 0 { - return fmt.Errorf("invalid config: %v", multierror.Wrap(errs...)) - } - // now validate the Viper config flags - valid, errs = validate(configSchema, c.viper.AllSettings()) - if !valid || len(errs) > 0 { - return fmt.Errorf("invalid config: %v", multierror.Wrap(errs...)) - } - return nil + return filepath.Join(filepath.Dir(exe), "..", "Rules") } -// File returns the config file path. -func (c *Config) File() string { return c.viper.GetString(configFile) } - -// SymbolPathsUTF16 returns the symbol paths as UTF16 string -// suitable for use in the Debug Helper API functions. +// SymbolPathsUTF16 returns the symbol paths as a UTF-16 string. func (c *Config) SymbolPathsUTF16() *uint16 { paths, _ := windows.UTF16PtrFromString(c.SymbolPaths) return paths } - -func (c *Config) addFlags() { - c.flags.String(configFile, filepath.Join(os.Getenv("PROGRAMFILES"), "fibratus", "config", "fibratus.yml"), "Indicates the location of the configuration file") - if c.opts.run { - c.flags.Bool(forwardMode, false, "Designates if event forwarding mode is engaged") - } - if c.opts.run || c.opts.replay || c.opts.validate { - c.flags.StringP(filamentName, "f", "", "Specifies the filament to execute") - - // initialize default rules paths - exe, err := os.Executable() - if err != nil { - // fallback to default install directory - exe = filepath.Join(os.Getenv("ProgramFiles"), "Fibratus", "Bin", "fibratus.exe") - } - dir := filepath.Join(filepath.Dir(exe), "..", "Rules") - - c.flags.Bool(rulesEnabled, true, "Indicates if the rule engine is enabled and rules loaded") - c.flags.StringSlice(rulesFromPaths, []string{filepath.Join(dir, "*")}, "Comma-separated list of rules files") - c.flags.StringSlice(macrosFromPaths, []string{filepath.Join(dir, "Macros", "*")}, "Comma-separated list of macro files") - c.flags.StringSlice(rulesFromURLs, []string{}, "Comma-separated list of rules URL resources") - c.flags.Bool(matchAll, true, "Indicates if the match all strategy is enabled for the rule engine. If the match all strategy is enabled, a single event can trigger multiple rules") - } - if c.opts.capture { - c.flags.StringP(capFile, "o", "", "The path of the output cap file") - } - if c.opts.replay { - c.flags.StringP(capFile, "k", "", "The path of the input cap file") - } - if c.opts.run || c.opts.replay || c.opts.list || c.opts.validate { - c.flags.String(filamentPath, filepath.Join(os.Getenv("PROGRAMFILES"), "fibratus", "filaments"), "Denotes the directory where filaments are located") - } - if c.opts.run || c.opts.replay || c.opts.capture || c.opts.stats { - c.flags.String(transport, `localhost:8080`, "Specifies the underlying transport protocol for the API HTTP server") - c.flags.Duration(timeout, time.Second*15, "Determines the timeout for the API server responses") - } - if c.opts.run || c.opts.capture { - c.flags.Bool(initHandleSnapshot, false, "Indicates whether initial handle snapshot is built. This implies scanning the system handles table and producing an entry for each handle object") - c.flags.Bool(debugPrivilege, true, "Dictates if the SeDebugPrivilege is injected into Fibratus process' access token") - c.flags.Bool(enumerateHandles, false, "Indicates if process handles are collected during startup or when a new process is spawn") - c.flags.String(symbolPaths, "srv*c:\\\\SymCache*https://msdl.microsoft.com/download/symbols", "Designates the path or a series of paths separated by a semicolon that is used to search for symbols files") - c.flags.Bool(symbolizeKernelAddresses, false, "Determines if kernel stack addresses are symbolized") - - c.flags.Bool(enableThreadEvents, true, "Determines whether thread events are collected by Kernel Logger provider") - c.flags.Bool(enableRegistryEvents, true, "Determines whether registry events are collected by Kernel Logger provider") - c.flags.Bool(enableNetEvents, true, "Determines whether network (TCP/UDP) events are collected by Kernel Logger provider") - c.flags.Bool(enableFileIOEvents, true, "Determines whether disk I/O events are collected by Kernel Logger provider") - c.flags.Bool(enableVAMapEvents, true, "Determines whether VA map/unmap events are collected by Kernel Logger provider") - c.flags.Bool(enableModuleEvents, true, "Determines whether module events are collected by Kernel Logger provider") - c.flags.Bool(enableMemEvents, true, "Determines whether memory manager events are collected by Kernel Logger provider") - c.flags.Bool(enableAuditAPIEvents, true, "Determines whether kernel audit API calls events are published") - c.flags.Bool(enableDNSEvents, true, "Determines whether DNS client events are enabled") - c.flags.Bool(stackEnrichment, true, "Indicates if stack enrichment is enabled for eligible events") - c.flags.Int(bufferSize, int(maxBufferSize), "Represents the amount of memory allocated for each event tracing session buffer, in kilobytes. The buffer size affects the rate at which buffers fill and must be flushed (small buffer size requires less memory but it increases the rate at which buffers must be flushed)") - c.flags.Int(minBuffers, int(defaultMinBuffers), "Determines the minimum number of buffers allocated for the event tracing session's buffer pool") - c.flags.Int(maxBuffers, int(defaultMaxBuffers), "Determines the maximum number of buffers allocated for the event tracing session's buffer pool") - c.flags.Duration(flushInterval, defaultFlushInterval, "Specifies how often the trace buffers are forcibly flushed") - c.flags.StringSlice(excludedEvents, []string{}, "A list of symbolical kernel event names that will be dropped from the event stream. By default all events are accepted") - c.flags.StringSlice(excludedImages, []string{}, "A list of image names that will be dropped from the event stream. Image names are case sensitive") - - c.flags.Bool(serializeThreads, false, "Indicates if threads are serialized as part of the process state") - c.flags.Bool(serializeModules, false, "Indicates if modules are serialized as part of the process state") - c.flags.Bool(serializeHandles, false, "Indicates if handles are serialized as part of the process state") - c.flags.Bool(serializePE, false, "Indicates if the PE metadata are serialized as part of the process state") - c.flags.Bool(serializeEnvs, true, "Indicates if environment variables are serialized as part of the process state") - } - c.Log.AddFlags(c.flags) -} diff --git a/pkg/config/eventsource.go b/pkg/config/eventsource.go index 2d691a316..a6edb2be8 100644 --- a/pkg/config/eventsource.go +++ b/pkg/config/eventsource.go @@ -1,8 +1,6 @@ -//go:build windows -// +build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. * @@ -22,16 +20,17 @@ package config import ( - "runtime" - "time" - "github.com/rabbitstack/fibratus/pkg/event" +<<<<<<< HEAD "github.com/rabbitstack/fibratus/pkg/util/bitmap" +======= +>>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" - "github.com/spf13/viper" + "github.com/rabbitstack/fibratus/pkg/util/bitmask" ) +<<<<<<< HEAD const ( enableThreadEvents = "eventsource.enable-thread" enableRegistryEvents = "eventsource.enable-registry" @@ -140,24 +139,52 @@ func (c *EventSourceConfig) Init() { for _, name := range c.ExcludedEvents { if typ, ok := event.ParseType(name); ok { c.dropBitmap.Set(typ) +======= +type eventSourceConfig struct { + dropMasks *bitmask.Bitmask + allMasks *bitmask.Bitmask + excludedImages map[string]bool +} + +func (c *EventSourceConfig) initEventMasks(types []event.Type) { + c.dropMasks = bitmask.New() + c.allMasks = bitmask.New() + c.excludedImages = make(map[string]bool) + + for _, name := range c.ExcludedEvents { + for _, typ := range event.NameToTypes(name) { + if typ != event.UnknownType { + c.dropMasks.Set(typ.ID()) + } +>>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) } } - + for _, typ := range types { + c.allMasks.Set(typ.ID()) + } for _, name := range c.ExcludedImages { c.excludedImages[name] = true } } -// SetDropMask inserts the event mask in the bitset to -// instruct the given event type should be dropped from -// the event stream. +// Init initializes event and image exclusion maps. +func (c *EventSourceConfig) Init() { + c.initEventMasks(platformEventTypes()) +} + func (c *EventSourceConfig) SetDropMask(typ event.Type) { +<<<<<<< HEAD c.dropBitmap.Set(typ) +======= + if c.dropMasks == nil { + c.dropMasks = bitmask.New() + } + c.dropMasks.Set(typ.ID()) +>>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) } -// TestDropMask checks if the specified event type has -// the drop mask in the bitset. func (c *EventSourceConfig) TestDropMask(typ event.Type) bool { +<<<<<<< HEAD return c.dropBitmap.Has(typ) } @@ -165,17 +192,19 @@ func (c *EventSourceConfig) TestDropMask(typ event.Type) bool { // in the exclusion list. func (c *EventSourceConfig) ExcludeEvent(typ event.Type) bool { return c.dropBitmap.Has(typ) +======= + return c.dropMasks != nil && c.dropMasks.IsSet(typ.ID()) +} + +func (c *EventSourceConfig) ExcludeEvent(id uint) bool { + return c.dropMasks != nil && c.dropMasks.IsSet(id) +} + +func (c *EventSourceConfig) EventExists(id uint) bool { + return c.allMasks != nil && c.allMasks.IsSet(id) +>>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) } -// ExcludeImage determines whether the process generating event is present in the -// list of excluded images. If the hit occurs, the event associated with the process -// is dropped. func (c *EventSourceConfig) ExcludeImage(ps *pstypes.PS) bool { - if len(c.excludedImages) == 0 { - return false - } - if ps == nil { - return false - } - return c.excludedImages[ps.Name] + return ps != nil && c.excludedImages[ps.Name] } diff --git a/pkg/config/eventsource_linux.go b/pkg/config/eventsource_linux.go index 68b2f12a7..7de7ba2c1 100644 --- a/pkg/config/eventsource_linux.go +++ b/pkg/config/eventsource_linux.go @@ -22,8 +22,6 @@ package config import ( "github.com/rabbitstack/fibratus/pkg/event" - pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" - "github.com/rabbitstack/fibratus/pkg/util/bitmask" "github.com/spf13/pflag" "github.com/spf13/viper" ) @@ -38,16 +36,14 @@ const ( ) type EventSourceConfig struct { + eventSourceConfig + + ExcludedEvents []string `json:"blacklist.events" yaml:"blacklist.events"` + ExcludedImages []string `json:"blacklist.images" yaml:"blacklist.images"` EnableProcessEvents bool `json:"enable-process" yaml:"enable-process"` EnableFileIOEvents bool `json:"enable-file" yaml:"enable-file"` EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` EnableMemEvents bool `json:"enable-mem" yaml:"enable-mem"` - ExcludedEvents []string `json:"blacklist.events" yaml:"blacklist.events"` - ExcludedImages []string `json:"blacklist.images" yaml:"blacklist.images"` - - dropMasks *bitmask.Bitmask - allMasks *bitmask.Bitmask - excludedImages map[string]bool } func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { @@ -69,33 +65,4 @@ func (c *EventSourceConfig) initFromViper(v *viper.Viper) { c.Init() } -func (c *EventSourceConfig) Init() { - c.dropMasks = bitmask.New() - c.allMasks = bitmask.New() - c.excludedImages = make(map[string]bool) - for _, name := range c.ExcludedEvents { - for _, typ := range event.NameToTypes(name) { - c.dropMasks.Set(typ.ID()) - } - } - for _, typ := range event.AllWithState() { - c.allMasks.Set(typ.ID()) - } - for _, name := range c.ExcludedImages { - c.excludedImages[name] = true - } -} - -func (c *EventSourceConfig) SetDropMask(typ event.Type) { c.dropMasks.Set(typ.ID()) } -func (c *EventSourceConfig) TestDropMask(typ event.Type) bool { - return c.dropMasks != nil && c.dropMasks.IsSet(typ.ID()) -} -func (c *EventSourceConfig) ExcludeEvent(id uint) bool { - return c.dropMasks != nil && c.dropMasks.IsSet(id) -} -func (c *EventSourceConfig) EventExists(id uint) bool { - return c.allMasks != nil && c.allMasks.IsSet(id) -} -func (c *EventSourceConfig) ExcludeImage(ps *pstypes.PS) bool { - return ps != nil && c.excludedImages[ps.Name] -} +func platformEventTypes() []event.Type { return event.All() } diff --git a/pkg/config/eventsource_linux_test.go b/pkg/config/eventsource_linux_test.go new file mode 100644 index 000000000..140fdc91a --- /dev/null +++ b/pkg/config/eventsource_linux_test.go @@ -0,0 +1,71 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "os" + "path/filepath" + "testing" + + "github.com/rabbitstack/fibratus/pkg/event" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/stretchr/testify/require" +) + +func TestEventSourceConfigLinux(t *testing.T) { + c := NewWithOpts(WithRun()) + require.NoError(t, c.flags.Parse([]string{ + "--eventsource.enable-process=false", + "--eventsource.blacklist.events=execve", + "--eventsource.blacklist.images=systemd", + })) + require.NoError(t, c.viper.BindPFlags(c.flags)) + require.NoError(t, c.Init()) + + require.False(t, c.EventSource.EnableProcessEvents) + require.True(t, c.EventSource.ExcludeEvent(event.Execve.ID())) + require.True(t, c.EventSource.ExcludeImage(&pstypes.PS{Name: "systemd"})) + for _, typ := range event.All() { + require.True(t, c.EventSource.EventExists(typ.ID())) + } +} + +func TestValidateLinuxEventSource(t *testing.T) { + file := filepath.Join(t.TempDir(), "fibratus.yml") + require.NoError(t, os.WriteFile(file, []byte(`eventsource: + enable-process: true + enable-file: true + blacklist: + events: + - execve + - exit + - clone + images: + - systemd +`), 0o600)) + + c := NewWithOpts(WithRun()) + require.NoError(t, c.flags.Parse([]string{"--config-file=" + file})) + require.NoError(t, c.viper.BindPFlags(c.flags)) + require.NoError(t, c.TryLoadFile(c.GetConfigFile())) + require.NoError(t, c.Init()) + require.NoError(t, c.Validate()) +} diff --git a/pkg/config/eventsource_windows.go b/pkg/config/eventsource_windows.go new file mode 100644 index 000000000..499724bdd --- /dev/null +++ b/pkg/config/eventsource_windows.go @@ -0,0 +1,126 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "runtime" + "time" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/spf13/pflag" + "github.com/spf13/viper" +) + +const ( + enableThreadEvents = "eventsource.enable-thread" + enableRegistryEvents = "eventsource.enable-registry" + enableNetEvents = "eventsource.enable-net" + enableFileIOEvents = "eventsource.enable-fileio" + enableVAMapEvents = "eventsource.enable-vamap" + enableModuleEvents = "eventsource.enable-module" + enableHandleEvents = "eventsource.enable-handle" + enableMemEvents = "eventsource.enable-mem" + enableAuditAPIEvents = "eventsource.enable-audit-api" + enableDNSEvents = "eventsource.enable-dns" + enableThreadpoolEvents = "eventsource.enable-threadpool" + stackEnrichment = "eventsource.stack-enrichment" + bufferSize = "eventsource.buffer-size" + minBuffers = "eventsource.min-buffers" + maxBuffers = "eventsource.max-buffers" + flushInterval = "eventsource.flush-interval" + excludedEvents = "eventsource.blacklist.events" + excludedImages = "eventsource.blacklist.images" + maxBufferSize = uint32(512) +) + +var ( + defaultMinBuffers = uint32(runtime.NumCPU() * 2) + defaultMaxBuffers = uint32(runtime.NumCPU() * 8) + defaultFlushInterval = time.Second +) + +type EventSourceConfig struct { + eventSourceConfig + + ExcludedEvents []string `json:"blacklist.events" yaml:"blacklist.events"` + ExcludedImages []string `json:"blacklist.images" yaml:"blacklist.images"` + EnableThreadEvents bool `json:"enable-thread" yaml:"enable-thread"` + EnableRegistryEvents bool `json:"enable-registry" yaml:"enable-registry"` + EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` + EnableFileIOEvents bool `json:"enable-fileio" yaml:"enable-fileio"` + EnableVAMapEvents bool `json:"enable-vamap" yaml:"enable-vamap"` + EnableModuleEvents bool `json:"enable-image" yaml:"enable-module"` + EnableHandleEvents bool `json:"enable-handle" yaml:"enable-handle"` + EnableMemEvents bool `json:"enable-memory" yaml:"enable-memory"` + EnableAuditAPIEvents bool `json:"enable-audit-api" yaml:"enable-audit-api"` + EnableDNSEvents bool `json:"enable-dns" yaml:"enable-dns"` + EnableThreadpoolEvents bool `json:"enable-threadpool" yaml:"enable-threadpool"` + StackEnrichment bool `json:"stack-enrichment" yaml:"stack-enrichment"` + BufferSize uint32 `json:"buffer-size" yaml:"buffer-size"` + MinBuffers uint32 `json:"min-buffers" yaml:"min-buffers"` + MaxBuffers uint32 `json:"max-buffers" yaml:"max-buffers"` + FlushTimer time.Duration `json:"flush-interval" yaml:"flush-interval"` +} + +func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { + flags.Bool(enableThreadEvents, true, "Determines whether thread events are collected") + flags.Bool(enableRegistryEvents, true, "Determines whether registry events are collected") + flags.Bool(enableNetEvents, true, "Determines whether network events are collected") + flags.Bool(enableFileIOEvents, true, "Determines whether file I/O events are collected") + flags.Bool(enableVAMapEvents, true, "Determines whether VA map/unmap events are collected") + flags.Bool(enableModuleEvents, true, "Determines whether module events are collected") + flags.Bool(enableHandleEvents, false, "Determines whether handle events are collected") + flags.Bool(enableMemEvents, true, "Determines whether memory events are collected") + flags.Bool(enableAuditAPIEvents, true, "Determines whether audit API events are collected") + flags.Bool(enableDNSEvents, true, "Determines whether DNS events are collected") + flags.Bool(enableThreadpoolEvents, true, "Determines whether thread pool events are collected") + flags.Bool(stackEnrichment, true, "Indicates if stack enrichment is enabled") + flags.Int(bufferSize, int(maxBufferSize), "Represents the trace buffer size in kilobytes") + flags.Int(minBuffers, int(defaultMinBuffers), "Determines the minimum trace buffer count") + flags.Int(maxBuffers, int(defaultMaxBuffers), "Determines the maximum trace buffer count") + flags.Duration(flushInterval, defaultFlushInterval, "Specifies how often trace buffers are flushed") + flags.StringSlice(excludedEvents, nil, "A list of event names to drop") + flags.StringSlice(excludedImages, nil, "A list of image names to drop") +} + +func (c *EventSourceConfig) initFromViper(v *viper.Viper) { + c.EnableThreadEvents = v.GetBool(enableThreadEvents) + c.EnableRegistryEvents = v.GetBool(enableRegistryEvents) + c.EnableNetEvents = v.GetBool(enableNetEvents) + c.EnableFileIOEvents = v.GetBool(enableFileIOEvents) + c.EnableVAMapEvents = v.GetBool(enableVAMapEvents) + c.EnableModuleEvents = v.GetBool(enableModuleEvents) + c.EnableHandleEvents = v.GetBool(enableHandleEvents) + c.EnableMemEvents = v.GetBool(enableMemEvents) + c.EnableAuditAPIEvents = v.GetBool(enableAuditAPIEvents) + c.EnableDNSEvents = v.GetBool(enableDNSEvents) + c.EnableThreadpoolEvents = v.GetBool(enableThreadpoolEvents) + c.StackEnrichment = v.GetBool(stackEnrichment) + c.BufferSize = uint32(v.GetInt(bufferSize)) + c.MinBuffers = uint32(v.GetInt(minBuffers)) + c.MaxBuffers = uint32(v.GetInt(maxBuffers)) + c.FlushTimer = v.GetDuration(flushInterval) + c.ExcludedEvents = v.GetStringSlice(excludedEvents) + c.ExcludedImages = v.GetStringSlice(excludedImages) + c.Init() +} + +func platformEventTypes() []event.Type { return event.AllWithState() } diff --git a/pkg/config/output.go b/pkg/config/output.go index 66f56e14f..af45c34d7 100644 --- a/pkg/config/output.go +++ b/pkg/config/output.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io @@ -33,7 +31,6 @@ import ( "github.com/rabbitstack/fibratus/pkg/outputs/http" "github.com/rabbitstack/fibratus/pkg/outputs/null" log "github.com/sirupsen/logrus" - "golang.org/x/sys/windows/svc" ) var errNoOutputSection = errors.New("no output section in config") @@ -112,18 +109,19 @@ func (c *Config) tryLoadOutput() error { continue } c.Output.Type, c.Output.Output = outputs.HTTP, httpConfig +<<<<<<< HEAD +======= + + default: + if err := c.loadPlatformOutput(outputs.TypeFromString(typ), typ, config); err != nil { + return err + } +>>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) } } - // if it is not an interactive session but the console output is enabled - // we default to null output and warn about that - if isWindowsService() && c.Output.Output != nil { - if c.Output.Type == outputs.Console { - log.Warn("running in non-interactive session with console output. " + - "Please configure a different output type. Defaulting to null output") - c.Output.Type, c.Output.Output = outputs.Null, &null.Config{} - return nil - } + if c.adjustPlatformOutput() { + return nil } // default to null output @@ -145,12 +143,3 @@ func findActiveOutputs(outputs map[string]interface{}) []string { } return outputTypes } - -// isWindowsService returns true if the process is running inside Windows Service. -func isWindowsService() bool { - isWinService, err := svc.IsWindowsService() - if err != nil { - return false - } - return isWinService -} diff --git a/pkg/config/schema_linux.go b/pkg/config/output_linux.go similarity index 73% rename from pkg/config/schema_linux.go rename to pkg/config/output_linux.go index 136a9a4ae..85cd3833b 100644 --- a/pkg/config/schema_linux.go +++ b/pkg/config/output_linux.go @@ -20,13 +20,7 @@ package config -import _ "embed" +import "github.com/rabbitstack/fibratus/pkg/outputs" -//go:embed config.schema.json -var configSchema string - -//go:embed rules.schema.json -var rulesSchema string - -//go:embed macros.schema.json -var macrosSchema string +func (c *Config) loadPlatformOutput(_ outputs.Type, _ string, _ interface{}) error { return nil } +func (c *Config) adjustPlatformOutput() bool { return false } diff --git a/pkg/config/output_linux_test.go b/pkg/config/output_linux_test.go new file mode 100644 index 000000000..a6055c2d3 --- /dev/null +++ b/pkg/config/output_linux_test.go @@ -0,0 +1,38 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/outputs/null" + "github.com/stretchr/testify/require" +) + +func TestEventlogOutputDefaultsToNull(t *testing.T) { + c := NewWithOpts(WithRun()) + require.NoError(t, c.flags.Parse([]string{"--config-file=_fixtures/eventlog-output.yml"})) + require.NoError(t, c.viper.BindPFlags(c.flags)) + require.NoError(t, c.TryLoadFile(c.GetConfigFile())) + require.NoError(t, c.Init()) + + require.IsType(t, &null.Config{}, c.Output.Output) +} diff --git a/pkg/config/output_test.go b/pkg/config/output_test.go index b3140db69..cc221014d 100644 --- a/pkg/config/output_test.go +++ b/pkg/config/output_test.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/config/output_windows.go b/pkg/config/output_windows.go new file mode 100644 index 000000000..1e2a8b850 --- /dev/null +++ b/pkg/config/output_windows.go @@ -0,0 +1,58 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "github.com/rabbitstack/fibratus/pkg/outputs" + "github.com/rabbitstack/fibratus/pkg/outputs/eventlog" + "github.com/rabbitstack/fibratus/pkg/outputs/null" + log "github.com/sirupsen/logrus" + "golang.org/x/sys/windows/svc" +) + +func (c *Config) loadPlatformOutput(output outputs.Type, typ string, config interface{}) error { + if output != outputs.Eventlog { + return nil + } + var eventlogConfig eventlog.Config + if err := decode(config, &eventlogConfig); err != nil { + return errOutputConfig(typ, err) + } + if eventlogConfig.Enabled { + c.Output.Type, c.Output.Output = outputs.Eventlog, eventlogConfig + } + return nil +} + +func (c *Config) adjustPlatformOutput() bool { + if !isWindowsService() || c.Output.Type != outputs.Console || c.Output.Output == nil { + return false + } + log.Warn("running in non-interactive session with console output. " + + "Please configure a different output type. Defaulting to null output") + c.Output.Type, c.Output.Output = outputs.Null, &null.Config{} + return true +} + +func isWindowsService() bool { + isWinService, err := svc.IsWindowsService() + return err == nil && isWinService +} diff --git a/pkg/config/output_windows_test.go b/pkg/config/output_windows_test.go new file mode 100644 index 000000000..c6ab53816 --- /dev/null +++ b/pkg/config/output_windows_test.go @@ -0,0 +1,41 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/outputs/eventlog" + "github.com/stretchr/testify/require" +) + +func TestEventlogOutput(t *testing.T) { + c := NewWithOpts(WithRun()) + require.NoError(t, c.flags.Parse([]string{"--config-file=_fixtures/eventlog-output.yml"})) + require.NoError(t, c.viper.BindPFlags(c.flags)) + require.NoError(t, c.TryLoadFile(c.GetConfigFile())) + require.NoError(t, c.Init()) + + require.IsType(t, eventlog.Config{}, c.Output.Output) + eventlogConfig := c.Output.Output.(eventlog.Config) + require.True(t, eventlogConfig.Enabled) + require.Equal(t, "INFO", eventlogConfig.Level) +} diff --git a/pkg/config/print_test.go b/pkg/config/print_test.go index 036226c86..beea1c593 100644 --- a/pkg/config/print_test.go +++ b/pkg/config/print_test.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io @@ -21,13 +19,14 @@ package config import ( - "github.com/stretchr/testify/require" "testing" + + "github.com/stretchr/testify/require" ) func TestConfigPrint(t *testing.T) { c := NewWithOpts(WithRun()) - err := c.flags.Parse([]string{"--eventsource.enable-thread=false", "--config-file=_fixtures/fibratus.yml"}) + err := c.flags.Parse([]string{"--filters.match-all=false", "--config-file=_fixtures/fibratus.yml"}) require.NoError(t, c.viper.BindPFlags(c.flags)) require.NoError(t, err) require.NoError(t, c.TryLoadFile(c.GetConfigFile())) diff --git a/pkg/config/schema_windows.go b/pkg/config/schema.go similarity index 97% rename from pkg/config/schema_windows.go rename to pkg/config/schema.go index a18907cc7..19e95a811 100644 --- a/pkg/config/schema_windows.go +++ b/pkg/config/schema.go @@ -18,9 +18,7 @@ package config -import ( - _ "embed" -) +import _ "embed" //go:embed config.schema.json var configSchema string diff --git a/pkg/config/transformer.go b/pkg/config/transformer.go index c2d6fb331..96b214b1d 100644 --- a/pkg/config/transformer.go +++ b/pkg/config/transformer.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io @@ -22,13 +20,14 @@ package config import ( "fmt" + "reflect" + "github.com/rabbitstack/fibratus/pkg/aggregator/transformers" "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/remove" "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/rename" "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/replace" "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/tags" "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/trim" - "reflect" ) var errTransformerConfig = func(t string, err error) error { return fmt.Errorf("%s transformer invalid config: %v", t, err) } diff --git a/pkg/config/transformer_test.go b/pkg/config/transformer_test.go index eaed5b497..f16d87c19 100644 --- a/pkg/config/transformer_test.go +++ b/pkg/config/transformer_test.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io @@ -21,8 +19,9 @@ package config import ( - "github.com/stretchr/testify/require" "testing" + + "github.com/stretchr/testify/require" ) func TestTransformers(t *testing.T) { diff --git a/pkg/handle/snapshotter_test.go b/pkg/handle/snapshotter_test.go index dded81253..1453b69cd 100644 --- a/pkg/handle/snapshotter_test.go +++ b/pkg/handle/snapshotter_test.go @@ -35,7 +35,9 @@ func TestInitSnapshot(t *testing.T) { ch <- true t.Fatal("snapshot callback was not triggered") }) - snap := NewSnapshotter(&config.Config{InitHandleSnapshot: true}, func(total, known uint64) { + cfg := &config.Config{} + cfg.InitHandleSnapshot = true + snap := NewSnapshotter(cfg, func(total, known uint64) { ch <- true }) require.NotNil(t, snap) @@ -43,7 +45,10 @@ func TestInitSnapshot(t *testing.T) { } func TestFindHandles(t *testing.T) { - snap := NewSnapshotter(&config.Config{InitHandleSnapshot: true, EnumerateHandles: true}, nil) + cfg := &config.Config{} + cfg.InitHandleSnapshot = true + cfg.EnumerateHandles = true + snap := NewSnapshotter(cfg, nil) handles, err := snap.FindHandles(uint32(os.Getppid())) require.NoError(t, err) require.NotEmpty(t, handles) diff --git a/pkg/symbolize/symbolizer_test.go b/pkg/symbolize/symbolizer_test.go index 506905880..2f0df0ea3 100644 --- a/pkg/symbolize/symbolizer_test.go +++ b/pkg/symbolize/symbolizer_test.go @@ -82,7 +82,8 @@ func (r *MockResolver) Cleanup(proc windows.Handle) { func TestLoadKernelModuleSymbolTables(t *testing.T) { r := new(MockResolver) - c := &config.Config{SymbolizeKernelAddresses: true} + c := &config.Config{} + c.SymbolizeKernelAddresses = true psnap := new(ps.SnapshotterMock) @@ -298,9 +299,8 @@ func TestProcessCallstack(t *testing.T) { func TestKernelCallstackSymbolizationFromDriverStore(t *testing.T) { r := new(MockResolver) - c := &config.Config{ - SymbolizeKernelAddresses: false, - } + c := &config.Config{} + c.SymbolizeKernelAddresses = false psnap := new(ps.SnapshotterMock) s := NewSymbolizer(r, psnap, c, false) From 32cb9e842364acaf95d6f61b16c2368b0698ae03 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 10 Aug 2026 23:36:31 +0200 Subject: [PATCH 24/65] refactor(event): define Linux-native event semantics Separate Linux/Windows event types, parameters, queues, formatting, and marshalling while retaining shared behavior. Remove Windows-only Linux stubs, distinguish process/thread clones via clone flags, and add Linux coverage. --- ...stackwalk_linux.go => batch_linux_test.go} | 23 +- .../{batch_test.go => batch_windows_test.go} | 2 - pkg/event/{enum_linux.go => bitset_linux.go} | 2 + ..._capture_linux.go => bitset_linux_test.go} | 15 +- pkg/event/bitset_windows.go | 21 ++ pkg/event/{enum.go => enum_windows.go} | 2 - pkg/event/event.go | 5 +- pkg/event/event_linux.go | 79 +---- pkg/event/event_linux_test.go | 21 +- pkg/event/flags.go | 251 +--------------- pkg/event/flags_test.go | 20 +- pkg/event/flags_windows.go | 240 ++++++++++++++++ pkg/event/formatter.go | 65 ++++- pkg/event/formatter_linux.go | 52 +--- pkg/event/formatter_linux_test.go | 44 +++ pkg/event/formatter_windows.go | 73 ++--- ...tter_test.go => formatter_windows_test.go} | 2 - pkg/event/marshaller.go | 8 + pkg/event/marshaller_linux.go | 38 ++- pkg/event/marshaller_linux_test.go | 38 +++ pkg/event/marshaller_windows.go | 10 + ...ler_test.go => marshaller_windows_test.go} | 2 - pkg/event/metainfo.go | 54 ++++ pkg/event/metainfo_linux.go | 68 +---- pkg/event/param.go | 194 +++++++------ pkg/event/param_capture_windows.go | 76 ----- pkg/event/param_linux.go | 175 ++++++------ pkg/event/param_test.go | 23 +- pkg/event/param_windows.go | 270 ++++++++++-------- pkg/event/params/names.go | 147 ---------- pkg/event/params/names_linux.go | 30 ++ pkg/event/params/names_windows.go | 91 ++++++ pkg/event/params/param_types.go | 119 +++----- pkg/event/params/types_linux.go | 33 +++ pkg/event/params/types_windows.go | 44 +++ pkg/event/pid_linux.go | 3 + pkg/event/pid_windows.go | 3 + pkg/event/queue.go | 25 +- pkg/event/queue_linux.go | 29 ++ .../{flags_linux.go => queue_linux_test.go} | 24 +- pkg/event/queue_windows.go | 48 ++++ .../{queue_test.go => queue_windows_test.go} | 2 - .../{stackwalk.go => stackwalk_windows.go} | 2 - ...walk_test.go => stackwalk_windows_test.go} | 2 - pkg/event/types_linux.go | 87 +++--- 45 files changed, 1352 insertions(+), 1210 deletions(-) rename pkg/event/{stackwalk_linux.go => batch_linux_test.go} (60%) rename pkg/event/{batch_test.go => batch_windows_test.go} (99%) rename pkg/event/{enum_linux.go => bitset_linux.go} (92%) rename pkg/event/{param_capture_linux.go => bitset_linux_test.go} (66%) create mode 100644 pkg/event/bitset_windows.go rename pkg/event/{enum.go => enum_windows.go} (99%) create mode 100644 pkg/event/flags_windows.go create mode 100644 pkg/event/formatter_linux_test.go rename pkg/event/{formatter_test.go => formatter_windows_test.go} (99%) create mode 100644 pkg/event/marshaller_linux_test.go rename pkg/event/{marshaller_test.go => marshaller_windows_test.go} (99%) create mode 100644 pkg/event/metainfo.go delete mode 100644 pkg/event/param_capture_windows.go create mode 100644 pkg/event/params/names_linux.go create mode 100644 pkg/event/params/names_windows.go create mode 100644 pkg/event/params/types_linux.go create mode 100644 pkg/event/params/types_windows.go create mode 100644 pkg/event/queue_linux.go rename pkg/event/{flags_linux.go => queue_linux_test.go} (68%) create mode 100644 pkg/event/queue_windows.go rename pkg/event/{queue_test.go => queue_windows_test.go} (99%) rename pkg/event/{stackwalk.go => stackwalk_windows.go} (99%) rename pkg/event/{stackwalk_test.go => stackwalk_windows_test.go} (99%) diff --git a/pkg/event/stackwalk_linux.go b/pkg/event/batch_linux_test.go similarity index 60% rename from pkg/event/stackwalk_linux.go rename to pkg/event/batch_linux_test.go index 7d3684f51..23f2766dc 100644 --- a/pkg/event/stackwalk_linux.go +++ b/pkg/event/batch_linux_test.go @@ -20,17 +20,18 @@ package event -// StackwalkDecorator is a no-op on Linux. Callstack enrichment -// via StackWalk events is a Windows ETW concept. -type StackwalkDecorator struct{} +import ( + "encoding/json" + "testing" -// NewStackwalkDecorator constructs a no-op stackwalk decorator. -func NewStackwalkDecorator(_ *Queue) *StackwalkDecorator { - return &StackwalkDecorator{} -} - -func (s *StackwalkDecorator) Push(_ *Event) {} + "github.com/stretchr/testify/require" +) -func (s *StackwalkDecorator) Pop(e *Event) *Event { return e } +func TestLinuxBatchMarshalJSON(t *testing.T) { + batch := NewBatch(&Event{PID: 42, Type: Execve}, &Event{PID: 43, Type: Exit}) + require.EqualValues(t, 2, batch.Len()) -func (s *StackwalkDecorator) Stop() {} + var events []map[string]interface{} + require.NoError(t, json.Unmarshal(batch.MarshalJSON(), &events)) + require.Len(t, events, 2) +} diff --git a/pkg/event/batch_test.go b/pkg/event/batch_windows_test.go similarity index 99% rename from pkg/event/batch_test.go rename to pkg/event/batch_windows_test.go index 0cee1f9c9..f82d6d91f 100644 --- a/pkg/event/batch_test.go +++ b/pkg/event/batch_windows_test.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/enum_linux.go b/pkg/event/bitset_linux.go similarity index 92% rename from pkg/event/enum_linux.go rename to pkg/event/bitset_linux.go index 7ed359caa..f78bc4079 100644 --- a/pkg/event/enum_linux.go +++ b/pkg/event/bitset_linux.go @@ -19,3 +19,5 @@ */ package event + +func typeBitIndex(typ Type) uint { return typ.ID() } diff --git a/pkg/event/param_capture_linux.go b/pkg/event/bitset_linux_test.go similarity index 66% rename from pkg/event/param_capture_linux.go rename to pkg/event/bitset_linux_test.go index c1b2c661a..1385c4574 100644 --- a/pkg/event/param_capture_linux.go +++ b/pkg/event/bitset_linux_test.go @@ -20,10 +20,15 @@ package event -import "github.com/rabbitstack/fibratus/pkg/event/params" +import ( + "testing" -// NewParamFromCapture builds a parameter instance from the restored capture state. -// Captures are not wired on Linux yet, so enrichment is deferred. -func NewParamFromCapture(name string, typ params.Type, value params.Value, _ Type) *Param { - return &Param{Name: name, Type: typ, Value: value} + "github.com/stretchr/testify/assert" +) + +func TestLinuxBitSets(t *testing.T) { + bitsets := &BitSets{} + bitsets.SetBit(TypeBitSet, Execve) + assert.True(t, bitsets.IsBitSet(&Event{Type: Execve})) + assert.False(t, bitsets.IsBitSet(&Event{Type: Exit})) } diff --git a/pkg/event/bitset_windows.go b/pkg/event/bitset_windows.go new file mode 100644 index 000000000..0a07df44c --- /dev/null +++ b/pkg/event/bitset_windows.go @@ -0,0 +1,21 @@ +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +func typeBitIndex(typ Type) uint { return uint(typ.HookID()) } diff --git a/pkg/event/enum.go b/pkg/event/enum_windows.go similarity index 99% rename from pkg/event/enum.go rename to pkg/event/enum_windows.go index 326f81346..e4cd47c44 100644 --- a/pkg/event/enum.go +++ b/pkg/event/enum_windows.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/event.go b/pkg/event/event.go index 216b2ad37..5d0856aa8 100644 --- a/pkg/event/event.go +++ b/pkg/event/event.go @@ -76,7 +76,7 @@ type Event struct { // PID is the identifier of the process that generated the event. PID PID `json:"pid"` // Tid is the thread identifier of the thread that generated the event. - Tid uint32 `json:"tid"` + Tid TID `json:"tid"` // Evasions is the bitmask that stores detected evasion types on this event. Evasions uint32 `json:"-"` // Type is the internal representation of the event. This field should be @@ -95,8 +95,7 @@ type Event struct { // PS represents process' metadata and its allocated resources such as handles, DLLs, etc. PS *pstypes.PS `json:"ps,omitempty"` // Callstack represents the call stack for the thread that generated the event. - Callstack callstack.Callstack `json:"callstack"` - + Callstack callstack.Callstack `json:"callstack,omitempty"` // mmux guards the metadata map mmux sync.RWMutex } diff --git a/pkg/event/event_linux.go b/pkg/event/event_linux.go index 493ae4616..52d873418 100644 --- a/pkg/event/event_linux.go +++ b/pkg/event/event_linux.go @@ -20,75 +20,24 @@ package event -import ( - "encoding/json" - "fmt" +import "github.com/rabbitstack/fibratus/pkg/event/params" - capver "github.com/rabbitstack/fibratus/pkg/cap/version" -) +const cloneThread = uint64(0x00010000) -func (e *Event) IsCreateFile() bool { return false } -func (e *Event) IsCreateProcess() bool { return e.Type == CreateProcess || e.Type == Execve || e.Type == Clone } -func (e *Event) IsCreateProcessInternal() bool { return false } -func (e *Event) IsCreateThread() bool { return false } -func (e *Event) IsCloseFile() bool { return false } -func (e *Event) IsCreateHandle() bool { return false } -func (e *Event) IsCloseHandle() bool { return false } -func (e *Event) IsDeleteFile() bool { return false } -func (e *Event) IsRenameFile() bool { return false } -func (e *Event) IsEnumDirectory() bool { return false } -func (e *Event) IsTerminateProcess() bool { return e.Type == TerminateProcess || e.Type == Exit } -func (e *Event) IsTerminateThread() bool { return false } -func (e *Event) IsUnloadModule() bool { return false } -func (e *Event) IsLoadModule() bool { return false } -func (e *Event) IsLoadModuleInternal() bool { return false } -func (e *Event) IsModuleRundown() bool { return false } -func (e *Event) IsFileOpEnd() bool { return false } -func (e *Event) IsRegSetValue() bool { return false } -func (e *Event) IsRegSetValueInternal() bool { return false } -func (e *Event) IsRegCreateKey() bool { return false } -func (e *Event) IsProcessRundown() bool { return e.Type == ProcessRundown } -func (e *Event) IsProcessRundownInternal() bool { return false } -func (e *Event) IsVirtualAlloc() bool { return false } -func (e *Event) IsMapViewFile() bool { return false } -func (e *Event) IsUnmapViewFile() bool { return false } -func (e *Event) IsStackWalk() bool { return false } -func (e *Event) IsOpenThread() bool { return false } -func (e *Event) IsOpenProcess() bool { return false } -func (e *Event) IsNetworkTCP() bool { return false } -func (e *Event) IsNetworkUDP() bool { return false } -func (e *Event) IsDNS() bool { return false } -func (e *Event) IsRundown() bool { return e.IsProcessRundown() } -func (e *Event) IsSuccess() bool { return true } -func (e *Event) IsRundownProcessed() bool { return false } -func (e *Event) IsCreateDisposition() bool { return false } -func (e *Event) IsOverwriteDisposition() bool { return false } -func (e *Event) IsOpenDisposition() bool { return false } -func (e *Event) IsCreateRemoteThread() bool { return false } -func (e *Event) IsSurrogateProcess() bool { return false } -func (e *Event) IsSystemPid() bool { return e.PID == 0 || e.PID == 1 } -func (e *Event) IsState() bool { return e.Type.OnlyState() } - -// PartialKey returns a key used to deduplicate sequence partials. -// On Linux this combines the event type with the process identifier. -func (e *Event) PartialKey() uint64 { - return uint64(e.Type)<<32 | uint64(e.PID) +// IsCreateProcess reports whether clone creates a new process. +func (e *Event) IsCreateProcess() bool { + return e.Type == Clone && e.Params.TryGetUint64(params.CloneFlags)&cloneThread == 0 } -// HookID returns the stable bitset index for this type. -func (t Type) HookID() uint16 { return uint16(t) } - -// MarshalJSON serializes the event to JSON. -func (e *Event) MarshalJSON() []byte { - b, err := json.Marshal(e) - if err != nil { - return []byte("{}") - } - return b +// IsCreateThread reports whether clone creates a thread in the current process. +func (e *Event) IsCreateThread() bool { + return e.Type == Clone && e.Params.TryGetUint64(params.CloneFlags)&cloneThread != 0 } -// UnmarshalRaw recovers the event from a capture buffer. -// Captures are not wired on Linux yet. -func (e *Event) UnmarshalRaw(_ []byte, _ capver.Version) error { - return fmt.Errorf("event capture unmarshalling is not implemented on Linux") +// IsTerminateProcess reports whether the event exits a process. +func (e *Event) IsTerminateProcess() bool { return e.Type == Exit } + +// PartialKey returns a key used to deduplicate sequence partials. +func (e *Event) PartialKey() uint64 { + return uint64(e.Type)<<32 | uint64(e.PID) } diff --git a/pkg/event/event_linux_test.go b/pkg/event/event_linux_test.go index 79a6ad5e3..0a3efa597 100644 --- a/pkg/event/event_linux_test.go +++ b/pkg/event/event_linux_test.go @@ -29,18 +29,29 @@ import ( ) func TestLinuxParamBasics(t *testing.T) { - p := NewParam(params.ProcessID, params.PID, uint32(42)) + p := NewParam(params.ProcessID, params.PID, uint64(42)) require.NotNil(t, p) assert.Equal(t, "42", p.String()) pars := Params{} - pars.Append(params.ProcessName, params.UnicodeString, "bash") + pars.Append(params.ProcessName, params.String, "bash") assert.Equal(t, "bash", pars.MustGetString(params.ProcessName)) } func TestLinuxEventTypeHelpers(t *testing.T) { e := &Event{Type: Execve, PID: 1} - assert.True(t, e.IsCreateProcess()) - assert.False(t, e.IsStackWalk()) - assert.Equal(t, uint16(Execve), e.Type.HookID()) + assert.False(t, e.IsCreateProcess()) + assert.Equal(t, RawSyscallTracepoint, e.Type.Source()) + assert.Equal(t, Process, e.Type.Category()) + assert.Equal(t, uint(Execve), e.Type.ID()) + + processClone := &Event{Type: Clone, Params: Params{}} + processClone.Params.Append(params.CloneFlags, params.Uint64, uint64(0)) + assert.True(t, processClone.IsCreateProcess()) + assert.False(t, processClone.IsCreateThread()) + + threadClone := &Event{Type: Clone, Params: Params{}} + threadClone.Params.Append(params.CloneFlags, params.Uint64, cloneThread) + assert.False(t, threadClone.IsCreateProcess()) + assert.True(t, threadClone.IsCreateThread()) } diff --git a/pkg/event/flags.go b/pkg/event/flags.go index 8cd50dd01..cf5a6878c 100644 --- a/pkg/event/flags.go +++ b/pkg/event/flags.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io @@ -20,14 +18,9 @@ package event -import ( - "strings" - - "github.com/rabbitstack/fibratus/pkg/sys" - "golang.org/x/sys/windows" -) +import "strings" -// ParamFlag defines the mapping between the flag value and its symbolical name. +// ParamFlag defines the mapping between a flag value and its symbolic name. type ParamFlag struct { Name string Value uint64 @@ -37,240 +30,22 @@ func (f ParamFlag) eval(v uint64) bool { return (v == 0 && f.Value == 0) || (f.Value != 0 && (v&f.Value) == f.Value && v != 0) } -// ParamFlags represents the type alias for the event parameter flags +// ParamFlags maps parameter bit flags to symbolic names. type ParamFlags []ParamFlag -// String produces a string with all flags present in the bitmask and delimited -// with the `|` separator. -func (flags ParamFlags) String(f uint64) string { +// String returns the names of all flags in the bitmask, separated by pipes. +func (flags ParamFlags) String(value uint64) string { var ( - n strings.Builder - s string + names strings.Builder + separator string ) for _, flag := range flags { - if flag.eval(f) { - n.WriteString(s) - n.WriteString(flag.Name) - s = "|" - // remove current flags value to avoid duplicates - f &= ^flag.Value + if flag.eval(value) { + names.WriteString(separator) + names.WriteString(flag.Name) + separator = "|" + value &= ^flag.Value } } - return n.String() -} - -const ( - // PsApplicationID identifies the packaged process - PsApplicationID = 0x00000001 - // PsWOW64 indicates if the 32-bit process is created in 64-bit Windows system - PsWOW64 = 0x00000002 - // PsProtected process is to be run as a protected process. The system restricts - // access to protected processes and the threads of protected processes. - PsProtected = 0x00000004 - // PsPackaged represents a process packaged with the MSIX technology and thus has - // package identity. - PsPackaged = 0x00000008 -) - -// PsCreationFlags describes the process creation flags. -var PsCreationFlags = []ParamFlag{ - {"APPLICATION_ID", PsApplicationID}, - {"WOW64", PsWOW64}, - {"PROTECTED", PsProtected}, - {"PACKAGED", PsPackaged}, -} - -// AllAccess represents the maximum process/thread access right -const AllAccess = windows.STANDARD_RIGHTS_REQUIRED | windows.SYNCHRONIZE | 0xFFFF - -// PsAccessRightFlags describes flags for the process access rights. -var PsAccessRightFlags = []ParamFlag{ - {"ALL_ACCESS", AllAccess}, - {"DELETE", windows.DELETE}, - {"READ_CONTROL", windows.READ_CONTROL}, - {"SYNCHRONIZE", windows.SYNCHRONIZE}, - {"WRITE_DAC", windows.WRITE_DAC}, - {"WRITE_OWNER", windows.WRITE_OWNER}, - {"GENERIC_READ", windows.GENERIC_READ}, - {"ACCESS_SYSTEM_SECURITY", windows.ACCESS_SYSTEM_SECURITY}, - {"TERMINATE", windows.PROCESS_TERMINATE}, - {"CREATE_THREAD", windows.PROCESS_CREATE_THREAD}, - {"VM_OPERATION", windows.PROCESS_VM_OPERATION}, - {"VM_READ", windows.PROCESS_VM_READ}, - {"VM_WRITE", windows.PROCESS_VM_WRITE}, - {"DUP_HANDLE", windows.PROCESS_DUP_HANDLE}, - {"CREATE_PROCESS", windows.PROCESS_CREATE_PROCESS}, - {"SET_QUOTA", windows.PROCESS_SET_QUOTA}, - {"SET_INFORMATION", windows.PROCESS_SET_INFORMATION}, - {"QUERY_INFORMATION", windows.PROCESS_QUERY_INFORMATION}, - {"SUSPEND_RESUME", windows.PROCESS_SUSPEND_RESUME}, - {"QUERY_LIMITED_INFORMATION", windows.PROCESS_QUERY_LIMITED_INFORMATION}, -} - -// ThreadAccessRightFlags describes flags for the thread access rights. -var ThreadAccessRightFlags = []ParamFlag{ - {"ALL_ACCESS", AllAccess}, - {"DELETE", windows.DELETE}, - {"READ_CONTROL", windows.READ_CONTROL}, - {"SYNCHRONIZE", windows.SYNCHRONIZE}, - {"WRITE_DAC", windows.WRITE_DAC}, - {"WRITE_OWNER", windows.WRITE_OWNER}, - {"TERMINATE", windows.THREAD_TERMINATE}, - {"SUSPEND_THREAD", windows.THREAD_SUSPEND_RESUME}, - {"GET_CONTEXT", windows.THREAD_GET_CONTEXT}, - {"SET_CONTEXT", windows.THREAD_SET_CONTEXT}, - {"SET_INFORMATION", windows.THREAD_SET_INFORMATION}, - {"QUERY_INFORMATION", windows.THREAD_QUERY_INFORMATION}, - {"SET_THREAD_TOKEN", windows.THREAD_SET_THREAD_TOKEN}, - {"IMPERSONATE", windows.THREAD_IMPERSONATE}, - {"DIRECT_IMPERSONATION", windows.THREAD_DIRECT_IMPERSONATION}, - {"SET_LIMITED_INFORMATION", windows.THREAD_SET_LIMITED_INFORMATION}, - {"QUERY_LIMITED_INFORMATION", windows.THREAD_QUERY_LIMITED_INFORMATION}, -} - -// FileAttributeFlags describes file attribute flags. -var FileAttributeFlags = []ParamFlag{ - {"READ_ONLY", windows.FILE_ATTRIBUTE_READONLY}, - {"HIDDEN", windows.FILE_ATTRIBUTE_HIDDEN}, - {"SYSTEM", windows.FILE_ATTRIBUTE_SYSTEM}, - {"DIRECTORY", windows.FILE_ATTRIBUTE_DIRECTORY}, - {"ARCHIVE", windows.FILE_ATTRIBUTE_ARCHIVE}, - {"DEVICE", windows.FILE_ATTRIBUTE_DEVICE}, - {"NORMAL", windows.FILE_ATTRIBUTE_NORMAL}, - {"TEMPORARY", windows.FILE_ATTRIBUTE_TEMPORARY}, - {"SPARSE", windows.FILE_ATTRIBUTE_SPARSE_FILE}, - {"JUNCTION", windows.FILE_ATTRIBUTE_REPARSE_POINT}, - {"COMPRESSED", windows.FILE_ATTRIBUTE_COMPRESSED}, - {"OFFLINE", windows.FILE_ATTRIBUTE_OFFLINE}, - {"UNINDEXED", windows.FILE_ATTRIBUTE_NOT_CONTENT_INDEXED}, - {"ENCRYPTED", windows.FILE_ATTRIBUTE_ENCRYPTED}, - {"STREAM", windows.FILE_ATTRIBUTE_INTEGRITY_STREAM}, - {"VIRTUAL", windows.FILE_ATTRIBUTE_VIRTUAL}, - {"NO_SCRUB", windows.FILE_ATTRIBUTE_NO_SCRUB_DATA}, - {"RECALL_OPEN", windows.FILE_ATTRIBUTE_RECALL_ON_OPEN}, - {"RECALL_ACCESS", windows.FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS}, - {"PINNED", 0x80000}, - {"UNPINNED", 0x100000}, -} - -// FileCreateOptionsFlags describes file create options flags -var FileCreateOptionsFlags = []ParamFlag{ - {"DIRECTORY_FILE", windows.FILE_DIRECTORY_FILE}, - {"WRITE_THROUGH", windows.FILE_WRITE_THROUGH}, - {"SEQUENTIAL_ONLY", windows.FILE_SEQUENTIAL_ONLY}, - {"NO_INTERMEDIATE_BUFFERING", windows.FILE_NO_INTERMEDIATE_BUFFERING}, - {"SYNCHRONOUS_IO_ALERT", windows.FILE_SYNCHRONOUS_IO_ALERT}, - {"SYNCHRONOUS_IO_NONALERT", windows.FILE_SYNCHRONOUS_IO_NONALERT}, - {"NON_DIRECTORY_FILE", windows.FILE_NON_DIRECTORY_FILE}, - {"CREATE_TREE_CONNECTION", windows.FILE_CREATE_TREE_CONNECTION}, - {"COMPLETE_IF_OPLOCKED", windows.FILE_COMPLETE_IF_OPLOCKED}, - {"NO_EA_KNOWLEDGE", windows.FILE_NO_EA_KNOWLEDGE}, - {"OPEN_REMOTE_INSTANCE", windows.FILE_OPEN_REMOTE_INSTANCE}, - {"RANDOM_ACCESS", windows.FILE_RANDOM_ACCESS}, - {"DELETE_ON_CLOSE", windows.FILE_DELETE_ON_CLOSE}, - {"OPEN_BY_FILE_ID", windows.FILE_OPEN_BY_FILE_ID}, - {"FOR_BACKUP_INTENT", windows.FILE_OPEN_FOR_BACKUP_INTENT}, - {"NO_COMPRESSION", windows.FILE_NO_COMPRESSION}, - {"OPEN_REQUIRING_OPLOCK", windows.FILE_OPEN_REQUIRING_OPLOCK}, - {"DISALLOW_EXCLUSIVE", windows.FILE_DISALLOW_EXCLUSIVE}, - {"RESERVE_OPFILTER", windows.FILE_RESERVE_OPFILTER}, - {"OPEN_REPARSE_POINT", windows.FILE_OPEN_REPARSE_POINT}, - {"OPEN_NO_RECALL", windows.FILE_OPEN_NO_RECALL}, - {"OPEN_FOR_FREE_SPACE_QUERY", windows.FILE_OPEN_FOR_FREE_SPACE_QUERY}, -} - -// FileShareModeFlags describes file share mask flags -var FileShareModeFlags = []ParamFlag{ - {"DENY", 0}, - {"READ", windows.FILE_SHARE_READ}, - {"WRITE", windows.FILE_SHARE_WRITE}, - {"DELETE", windows.FILE_SHARE_DELETE}, -} - -// MemAllocationFlags describes virtual allocation/free type flags -var MemAllocationFlags = []ParamFlag{ - {"COMMIT", windows.MEM_COMMIT}, - {"RESERVE", windows.MEM_RESERVE}, - {"RESET", windows.MEM_RESET}, - {"RESET_UNDO", windows.MEM_RESET_UNDO}, - {"PHYSICAL", windows.MEM_PHYSICAL}, - {"LARGE_PAGES", windows.MEM_LARGE_PAGES}, - {"TOP_DOWN", windows.MEM_TOP_DOWN}, - {"RELEASE", windows.MEM_RELEASE}, - {"DECOMMIT", windows.MEM_DECOMMIT}, - {"WRITE_WATCH", windows.MEM_WRITE_WATCH}, -} - -// MemProtectionFlags represents memory protection option flags. -var MemProtectionFlags = []ParamFlag{ - {"NONE", 0}, - {"EXECUTE", windows.PAGE_EXECUTE}, - {"EXECUTE_READ", windows.PAGE_EXECUTE_READ}, - {"EXECUTE_READWRITE", windows.PAGE_EXECUTE_READWRITE}, - {"EXECUTE_WRITECOPY", windows.PAGE_EXECUTE_WRITECOPY}, - {"NOACCESS", windows.PAGE_NOACCESS}, - {"READONLY", windows.PAGE_READONLY}, - {"READWRITE", windows.PAGE_READWRITE}, - {"WRITECOPY", windows.PAGE_WRITECOPY}, - {"TARGETS_INVALID", windows.PAGE_TARGETS_INVALID}, - {"TARGETS_NO_UPDATE", windows.PAGE_TARGETS_NO_UPDATE}, - {"GUARD", windows.PAGE_GUARD}, - {"NOCACHE", windows.PAGE_NOCACHE}, - {"WRITECOMBINE", windows.PAGE_WRITECOMBINE}, -} - -// ViewProtectionFlags describes section protection flags. These -// have different values than the memory protection flags as they -// are reported by the kernel. -var ViewProtectionFlags = []ParamFlag{ - {"EXECUTE_READWRITE", sys.SectionRWX}, - {"EXECUTE_WRITECOPY", sys.SectionWXC}, - {"NOCACHE", sys.SectionNC}, - {"WRITECOMBINE", sys.SectionWCB}, - {"READONLY", sys.SectionR}, - {"EXECUTE", sys.SectionX}, - {"EXECUTE_READ", sys.SectionRX}, - {"READWRITE", sys.SectionRW}, - {"WRITECOPY", sys.SectionWC}, -} - -// DNSOptsFlags describes DNS query/response options. -var DNSOptsFlags = []ParamFlag{ - {"STANDARD", 0x00000000}, - {"ACCEPT_TRUNCATED_RESPONSE", 0x00000001}, - {"USE_TCP_ONLY", 0x00000002}, - {"NO_RECURSION", 0x00000004}, - {"BYPASS_CACHE", 0x00000008}, - {"NO_WIRE_QUERY", 0x00000010}, - {"NO_LOCAL_NAME", 0x00000020}, - {"NO_NETBT", 0x00000080}, - {"WIRE_ONLY", 0x00000100}, - {"RETURN_MESSAGE", 0x00000200}, - {"MULTICAST_ONLY", 0x00000400}, - {"NO_MULTICAST", 0x00000800}, - {"TREAT_AS_FQDN", 0x00001000}, - {"ADDRCONFIG", 0x00002000}, - {"DUAL_ADDR", 0x00004000}, - {"MULTICAST_WAIT", 0x00020000}, - {"MULTICAST_VERIFY", 0x00040000}, - {"DONT_RESET_TTL_VALUES", 0x00100000}, - {"DISABLE_IDN_ENCODING", 0x00200000}, - {"APPEND_MULTILABEL", 0x00800000}, -} - -// AccessMaskFlags describes the generic and specific access rights -var AccessMaskFlags = []ParamFlag{ - {"DELETE", windows.DELETE}, - {"READ_CONTROL", windows.READ_CONTROL}, - {"WRITE_DAC", windows.WRITE_DAC}, - {"WRITE_OWNER", windows.WRITE_OWNER}, - {"SYNCHRONIZE", windows.SYNCHRONIZE}, - {"STANDARD_RIGHTS_REQUIRED", windows.STANDARD_RIGHTS_REQUIRED}, - {"STANDARD_RIGHTS_ALL", windows.STANDARD_RIGHTS_ALL}, - {"ACCESS_SYSTEM_SECURITY", windows.ACCESS_SYSTEM_SECURITY}, - {"MAXIMUM_ALLOWED", windows.MAXIMUM_ALLOWED}, - {"GENERIC_READ", windows.GENERIC_READ}, - {"GENERIC_WRITE", windows.GENERIC_WRITE}, - {"GENERIC_EXECUTE", windows.GENERIC_EXECUTE}, - {"GENERIC_ALL", windows.GENERIC_ALL}, + return names.String() } diff --git a/pkg/event/flags_test.go b/pkg/event/flags_test.go index 4ce531ea7..78fdc6f5c 100644 --- a/pkg/event/flags_test.go +++ b/pkg/event/flags_test.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io @@ -23,19 +21,23 @@ package event import "testing" func TestParamFlags(t *testing.T) { - var tests = []struct { + flags := ParamFlags{ + {Name: "ALL", Value: 0x3}, + {Name: "READ", Value: 0x1}, + {Name: "WRITE", Value: 0x2}, + } + tests := []struct { flag uint64 - flags ParamFlags expected string }{ - {0x1fffff, PsAccessRightFlags, "ALL_ACCESS"}, - {0x1400, PsAccessRightFlags, "QUERY_INFORMATION|QUERY_LIMITED_INFORMATION"}, - {0x1800, ThreadAccessRightFlags, "QUERY_LIMITED_INFORMATION"}, - {0x00000002, PsCreationFlags, "WOW64"}, + {0x3, "ALL"}, + {0x1, "READ"}, + {0x2, "WRITE"}, + {0, ""}, } for i, tt := range tests { - s := tt.flags.String(tt.flag) + s := flags.String(tt.flag) if s != tt.expected { t.Errorf("%d. %q flag mismatch: exp=%s got=%s", i, tt.expected, tt.expected, s) } diff --git a/pkg/event/flags_windows.go b/pkg/event/flags_windows.go new file mode 100644 index 000000000..3ff3aadbf --- /dev/null +++ b/pkg/event/flags_windows.go @@ -0,0 +1,240 @@ +/* + * Copyright 2021-2022 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "github.com/rabbitstack/fibratus/pkg/sys" + "golang.org/x/sys/windows" +) + +const ( + // PsApplicationID identifies the packaged process + PsApplicationID = 0x00000001 + // PsWOW64 indicates if the 32-bit process is created in 64-bit Windows system + PsWOW64 = 0x00000002 + // PsProtected process is to be run as a protected process. The system restricts + // access to protected processes and the threads of protected processes. + PsProtected = 0x00000004 + // PsPackaged represents a process packaged with the MSIX technology and thus has + // package identity. + PsPackaged = 0x00000008 +) + +// PsCreationFlags describes the process creation flags. +var PsCreationFlags = []ParamFlag{ + {"APPLICATION_ID", PsApplicationID}, + {"WOW64", PsWOW64}, + {"PROTECTED", PsProtected}, + {"PACKAGED", PsPackaged}, +} + +// AllAccess represents the maximum process/thread access right +const AllAccess = windows.STANDARD_RIGHTS_REQUIRED | windows.SYNCHRONIZE | 0xFFFF + +// PsAccessRightFlags describes flags for the process access rights. +var PsAccessRightFlags = []ParamFlag{ + {"ALL_ACCESS", AllAccess}, + {"DELETE", windows.DELETE}, + {"READ_CONTROL", windows.READ_CONTROL}, + {"SYNCHRONIZE", windows.SYNCHRONIZE}, + {"WRITE_DAC", windows.WRITE_DAC}, + {"WRITE_OWNER", windows.WRITE_OWNER}, + {"GENERIC_READ", windows.GENERIC_READ}, + {"ACCESS_SYSTEM_SECURITY", windows.ACCESS_SYSTEM_SECURITY}, + {"TERMINATE", windows.PROCESS_TERMINATE}, + {"CREATE_THREAD", windows.PROCESS_CREATE_THREAD}, + {"VM_OPERATION", windows.PROCESS_VM_OPERATION}, + {"VM_READ", windows.PROCESS_VM_READ}, + {"VM_WRITE", windows.PROCESS_VM_WRITE}, + {"DUP_HANDLE", windows.PROCESS_DUP_HANDLE}, + {"CREATE_PROCESS", windows.PROCESS_CREATE_PROCESS}, + {"SET_QUOTA", windows.PROCESS_SET_QUOTA}, + {"SET_INFORMATION", windows.PROCESS_SET_INFORMATION}, + {"QUERY_INFORMATION", windows.PROCESS_QUERY_INFORMATION}, + {"SUSPEND_RESUME", windows.PROCESS_SUSPEND_RESUME}, + {"QUERY_LIMITED_INFORMATION", windows.PROCESS_QUERY_LIMITED_INFORMATION}, +} + +// ThreadAccessRightFlags describes flags for the thread access rights. +var ThreadAccessRightFlags = []ParamFlag{ + {"ALL_ACCESS", AllAccess}, + {"DELETE", windows.DELETE}, + {"READ_CONTROL", windows.READ_CONTROL}, + {"SYNCHRONIZE", windows.SYNCHRONIZE}, + {"WRITE_DAC", windows.WRITE_DAC}, + {"WRITE_OWNER", windows.WRITE_OWNER}, + {"TERMINATE", windows.THREAD_TERMINATE}, + {"SUSPEND_THREAD", windows.THREAD_SUSPEND_RESUME}, + {"GET_CONTEXT", windows.THREAD_GET_CONTEXT}, + {"SET_CONTEXT", windows.THREAD_SET_CONTEXT}, + {"SET_INFORMATION", windows.THREAD_SET_INFORMATION}, + {"QUERY_INFORMATION", windows.THREAD_QUERY_INFORMATION}, + {"SET_THREAD_TOKEN", windows.THREAD_SET_THREAD_TOKEN}, + {"IMPERSONATE", windows.THREAD_IMPERSONATE}, + {"DIRECT_IMPERSONATION", windows.THREAD_DIRECT_IMPERSONATION}, + {"SET_LIMITED_INFORMATION", windows.THREAD_SET_LIMITED_INFORMATION}, + {"QUERY_LIMITED_INFORMATION", windows.THREAD_QUERY_LIMITED_INFORMATION}, +} + +// FileAttributeFlags describes file attribute flags. +var FileAttributeFlags = []ParamFlag{ + {"READ_ONLY", windows.FILE_ATTRIBUTE_READONLY}, + {"HIDDEN", windows.FILE_ATTRIBUTE_HIDDEN}, + {"SYSTEM", windows.FILE_ATTRIBUTE_SYSTEM}, + {"DIRECTORY", windows.FILE_ATTRIBUTE_DIRECTORY}, + {"ARCHIVE", windows.FILE_ATTRIBUTE_ARCHIVE}, + {"DEVICE", windows.FILE_ATTRIBUTE_DEVICE}, + {"NORMAL", windows.FILE_ATTRIBUTE_NORMAL}, + {"TEMPORARY", windows.FILE_ATTRIBUTE_TEMPORARY}, + {"SPARSE", windows.FILE_ATTRIBUTE_SPARSE_FILE}, + {"JUNCTION", windows.FILE_ATTRIBUTE_REPARSE_POINT}, + {"COMPRESSED", windows.FILE_ATTRIBUTE_COMPRESSED}, + {"OFFLINE", windows.FILE_ATTRIBUTE_OFFLINE}, + {"UNINDEXED", windows.FILE_ATTRIBUTE_NOT_CONTENT_INDEXED}, + {"ENCRYPTED", windows.FILE_ATTRIBUTE_ENCRYPTED}, + {"STREAM", windows.FILE_ATTRIBUTE_INTEGRITY_STREAM}, + {"VIRTUAL", windows.FILE_ATTRIBUTE_VIRTUAL}, + {"NO_SCRUB", windows.FILE_ATTRIBUTE_NO_SCRUB_DATA}, + {"RECALL_OPEN", windows.FILE_ATTRIBUTE_RECALL_ON_OPEN}, + {"RECALL_ACCESS", windows.FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS}, + {"PINNED", 0x80000}, + {"UNPINNED", 0x100000}, +} + +// FileCreateOptionsFlags describes file create options flags +var FileCreateOptionsFlags = []ParamFlag{ + {"DIRECTORY_FILE", windows.FILE_DIRECTORY_FILE}, + {"WRITE_THROUGH", windows.FILE_WRITE_THROUGH}, + {"SEQUENTIAL_ONLY", windows.FILE_SEQUENTIAL_ONLY}, + {"NO_INTERMEDIATE_BUFFERING", windows.FILE_NO_INTERMEDIATE_BUFFERING}, + {"SYNCHRONOUS_IO_ALERT", windows.FILE_SYNCHRONOUS_IO_ALERT}, + {"SYNCHRONOUS_IO_NONALERT", windows.FILE_SYNCHRONOUS_IO_NONALERT}, + {"NON_DIRECTORY_FILE", windows.FILE_NON_DIRECTORY_FILE}, + {"CREATE_TREE_CONNECTION", windows.FILE_CREATE_TREE_CONNECTION}, + {"COMPLETE_IF_OPLOCKED", windows.FILE_COMPLETE_IF_OPLOCKED}, + {"NO_EA_KNOWLEDGE", windows.FILE_NO_EA_KNOWLEDGE}, + {"OPEN_REMOTE_INSTANCE", windows.FILE_OPEN_REMOTE_INSTANCE}, + {"RANDOM_ACCESS", windows.FILE_RANDOM_ACCESS}, + {"DELETE_ON_CLOSE", windows.FILE_DELETE_ON_CLOSE}, + {"OPEN_BY_FILE_ID", windows.FILE_OPEN_BY_FILE_ID}, + {"FOR_BACKUP_INTENT", windows.FILE_OPEN_FOR_BACKUP_INTENT}, + {"NO_COMPRESSION", windows.FILE_NO_COMPRESSION}, + {"OPEN_REQUIRING_OPLOCK", windows.FILE_OPEN_REQUIRING_OPLOCK}, + {"DISALLOW_EXCLUSIVE", windows.FILE_DISALLOW_EXCLUSIVE}, + {"RESERVE_OPFILTER", windows.FILE_RESERVE_OPFILTER}, + {"OPEN_REPARSE_POINT", windows.FILE_OPEN_REPARSE_POINT}, + {"OPEN_NO_RECALL", windows.FILE_OPEN_NO_RECALL}, + {"OPEN_FOR_FREE_SPACE_QUERY", windows.FILE_OPEN_FOR_FREE_SPACE_QUERY}, +} + +// FileShareModeFlags describes file share mask flags +var FileShareModeFlags = []ParamFlag{ + {"DENY", 0}, + {"READ", windows.FILE_SHARE_READ}, + {"WRITE", windows.FILE_SHARE_WRITE}, + {"DELETE", windows.FILE_SHARE_DELETE}, +} + +// MemAllocationFlags describes virtual allocation/free type flags +var MemAllocationFlags = []ParamFlag{ + {"COMMIT", windows.MEM_COMMIT}, + {"RESERVE", windows.MEM_RESERVE}, + {"RESET", windows.MEM_RESET}, + {"RESET_UNDO", windows.MEM_RESET_UNDO}, + {"PHYSICAL", windows.MEM_PHYSICAL}, + {"LARGE_PAGES", windows.MEM_LARGE_PAGES}, + {"TOP_DOWN", windows.MEM_TOP_DOWN}, + {"RELEASE", windows.MEM_RELEASE}, + {"DECOMMIT", windows.MEM_DECOMMIT}, + {"WRITE_WATCH", windows.MEM_WRITE_WATCH}, +} + +// MemProtectionFlags represents memory protection option flags. +var MemProtectionFlags = []ParamFlag{ + {"NONE", 0}, + {"EXECUTE", windows.PAGE_EXECUTE}, + {"EXECUTE_READ", windows.PAGE_EXECUTE_READ}, + {"EXECUTE_READWRITE", windows.PAGE_EXECUTE_READWRITE}, + {"EXECUTE_WRITECOPY", windows.PAGE_EXECUTE_WRITECOPY}, + {"NOACCESS", windows.PAGE_NOACCESS}, + {"READONLY", windows.PAGE_READONLY}, + {"READWRITE", windows.PAGE_READWRITE}, + {"WRITECOPY", windows.PAGE_WRITECOPY}, + {"TARGETS_INVALID", windows.PAGE_TARGETS_INVALID}, + {"TARGETS_NO_UPDATE", windows.PAGE_TARGETS_NO_UPDATE}, + {"GUARD", windows.PAGE_GUARD}, + {"NOCACHE", windows.PAGE_NOCACHE}, + {"WRITECOMBINE", windows.PAGE_WRITECOMBINE}, +} + +// ViewProtectionFlags describes section protection flags. These +// have different values than the memory protection flags as they +// are reported by the kernel. +var ViewProtectionFlags = []ParamFlag{ + {"EXECUTE_READWRITE", sys.SectionRWX}, + {"EXECUTE_WRITECOPY", sys.SectionWXC}, + {"NOCACHE", sys.SectionNC}, + {"WRITECOMBINE", sys.SectionWCB}, + {"READONLY", sys.SectionR}, + {"EXECUTE", sys.SectionX}, + {"EXECUTE_READ", sys.SectionRX}, + {"READWRITE", sys.SectionRW}, + {"WRITECOPY", sys.SectionWC}, +} + +// DNSOptsFlags describes DNS query/response options. +var DNSOptsFlags = []ParamFlag{ + {"STANDARD", 0x00000000}, + {"ACCEPT_TRUNCATED_RESPONSE", 0x00000001}, + {"USE_TCP_ONLY", 0x00000002}, + {"NO_RECURSION", 0x00000004}, + {"BYPASS_CACHE", 0x00000008}, + {"NO_WIRE_QUERY", 0x00000010}, + {"NO_LOCAL_NAME", 0x00000020}, + {"NO_NETBT", 0x00000080}, + {"WIRE_ONLY", 0x00000100}, + {"RETURN_MESSAGE", 0x00000200}, + {"MULTICAST_ONLY", 0x00000400}, + {"NO_MULTICAST", 0x00000800}, + {"TREAT_AS_FQDN", 0x00001000}, + {"ADDRCONFIG", 0x00002000}, + {"DUAL_ADDR", 0x00004000}, + {"MULTICAST_WAIT", 0x00020000}, + {"MULTICAST_VERIFY", 0x00040000}, + {"DONT_RESET_TTL_VALUES", 0x00100000}, + {"DISABLE_IDN_ENCODING", 0x00200000}, + {"APPEND_MULTILABEL", 0x00800000}, +} + +// AccessMaskFlags describes the generic and specific access rights +var AccessMaskFlags = []ParamFlag{ + {"DELETE", windows.DELETE}, + {"READ_CONTROL", windows.READ_CONTROL}, + {"WRITE_DAC", windows.WRITE_DAC}, + {"WRITE_OWNER", windows.WRITE_OWNER}, + {"SYNCHRONIZE", windows.SYNCHRONIZE}, + {"STANDARD_RIGHTS_REQUIRED", windows.STANDARD_RIGHTS_REQUIRED}, + {"STANDARD_RIGHTS_ALL", windows.STANDARD_RIGHTS_ALL}, + {"ACCESS_SYSTEM_SECURITY", windows.ACCESS_SYSTEM_SECURITY}, + {"MAXIMUM_ALLOWED", windows.MAXIMUM_ALLOWED}, + {"GENERIC_READ", windows.GENERIC_READ}, + {"GENERIC_WRITE", windows.GENERIC_WRITE}, + {"GENERIC_EXECUTE", windows.GENERIC_EXECUTE}, + {"GENERIC_ALL", windows.GENERIC_ALL}, +} diff --git a/pkg/event/formatter.go b/pkg/event/formatter.go index 7a3e0361b..3e596bdb7 100644 --- a/pkg/event/formatter.go +++ b/pkg/event/formatter.go @@ -157,6 +157,54 @@ func NewFormatter(template string) (*Formatter, error) { }, nil } +// Format applies the template on the provided event. +func (f *Formatter) Format(evt *Event) []byte { + if evt == nil { + return []byte{} + } + values := map[string]interface{}{ + ts: evt.Timestamp.String(), + pid: strconv.FormatUint(uint64(evt.PID), 10), + tid: strconv.FormatUint(uint64(evt.Tid), 10), + seq: strconv.FormatUint(evt.Seq, 10), + cpu: strconv.FormatUint(uint64(evt.CPU), 10), + typ: evt.Name(), + cat: evt.Category(), + desc: evt.Description(), + host: evt.Host, + meta: evt.Metadata.String(), + parameters: evt.Params.String(), + } + + // add process metadata + ps := evt.PS + if ps != nil { + values[proc] = ps.Name + values[ppid] = strconv.FormatUint(uint64(ps.Ppid), 10) + values[cwd] = ps.Cwd + values[exe] = ps.Exe + values[cmd] = ps.Cmdline + values[sid] = ps.SID + parent := ps.Parent + if parent != nil { + values[pproc] = parent.Name + values[pexe] = parent.Exe + values[pcmd] = parent.Cmdline + } + addPlatformProcessFormatValues(ps, values) + } + + addPlatformFormatValues(evt, values) + + if f.expandParamsDot { + for _, par := range evt.Params { + values[".Params."+caser.String(par.Name)] = par.String() + } + } + + return f.t.ExecuteString(values) +} + // ColorFormatter wraps a Formatter and re-renders each template tag with // ANSI colour codes before it is substituted into the output string. // @@ -205,6 +253,9 @@ func (f *ColorFormatter) Format(e *Event) []byte { // colourTag maps a bare tag name to its coloured string representation. func (f *ColorFormatter) colourTag(tag string, e *Event) string { + if value, ok := colourPlatformProcessTag(tag, e); ok { + return value + } switch tag { case seq: // sequence number is ok to render as dim gray @@ -261,12 +312,6 @@ func (f *ColorFormatter) colourTag(tag string, e *Event) string { return colorizer.Span(colorizer.Gray, "N/A") } return colorizer.Span(colorizer.White, ps.Cwd) - case sid: - ps := e.PS - if ps == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.Span(colorizer.Gray, ps.SID) case pproc: ps := e.PS if ps == nil || ps.Parent == nil { @@ -279,14 +324,8 @@ func (f *ColorFormatter) colourTag(tag string, e *Event) string { return colorizer.Span(colorizer.Magenta, e.Category().String()) case parameters: return e.Params.Colorize() - case pe: - ps := e.PS - if ps == nil || ps.PE == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.Span(colorizer.Magenta, ps.PE.String()) case cstack: - return fmt.Sprintf("\n%s", e.Callstack.Colorize()) + return colourPlatformTag(tag, e) } return "" diff --git a/pkg/event/formatter_linux.go b/pkg/event/formatter_linux.go index 8e3322ac5..8ac7533d0 100644 --- a/pkg/event/formatter_linux.go +++ b/pkg/event/formatter_linux.go @@ -20,54 +20,12 @@ package event -import "strconv" +import pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" -// Format applies the template on the provided event. -func (f *Formatter) Format(evt *Event) []byte { - if evt == nil { - return []byte{} - } - values := map[string]interface{}{ - ts: evt.Timestamp.String(), - pid: strconv.FormatUint(uint64(evt.PID), 10), - tid: strconv.FormatUint(uint64(evt.Tid), 10), - seq: strconv.FormatUint(evt.Seq, 10), - cpu: strconv.FormatUint(uint64(evt.CPU), 10), - typ: evt.Name, - cat: evt.Category, - desc: evt.Description, - host: evt.Host, - meta: evt.Metadata.String(), - parameters: evt.Params.String(), - } +func addPlatformFormatValues(_ *Event, _ map[string]interface{}) {} - ps := evt.PS - if ps != nil { - values[proc] = ps.Name - values[ppid] = strconv.FormatUint(uint64(ps.Ppid), 10) - values[cwd] = ps.Cwd - values[exe] = ps.Exe - values[cmd] = ps.Cmdline - values[sid] = ps.SID - parent := ps.Parent - if parent != nil { - values[pproc] = parent.Name - values[pexe] = parent.Exe - values[pcmd] = parent.Cmdline - } - if ps.PE != nil { - values[pe] = ps.PE.String() - } - } - if !evt.Callstack.IsEmpty() { - values[cstack] = evt.Callstack.String() - } +func addPlatformProcessFormatValues(_ *pstypes.PS, _ map[string]interface{}) {} - if f.expandParamsDot { - for _, par := range evt.Params { - values[".Params."+caser.String(par.Name)] = par.String() - } - } +func colourPlatformTag(_ string, _ *Event) string { return "" } - return f.t.ExecuteString(values) -} +func colourPlatformProcessTag(_ string, _ *Event) (string, bool) { return "", false } diff --git a/pkg/event/formatter_linux_test.go b/pkg/event/formatter_linux_test.go new file mode 100644 index 000000000..5c016fd83 --- /dev/null +++ b/pkg/event/formatter_linux_test.go @@ -0,0 +1,44 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestLinuxFormatter(t *testing.T) { + formatter, err := NewFormatter("{{.Type}} pid={{.Pid}} tid={{.Tid}}") + require.NoError(t, err) + + event := &Event{ + Timestamp: time.Now(), + PID: 42, + Tid: 43, + Type: Execve, + Name: Execve.String(), + Category: Process, + } + assert.Equal(t, "execve pid=42 tid=43", string(formatter.Format(event))) +} diff --git a/pkg/event/formatter_windows.go b/pkg/event/formatter_windows.go index 3c55f3f54..2b6ad3017 100644 --- a/pkg/event/formatter_windows.go +++ b/pkg/event/formatter_windows.go @@ -19,59 +19,36 @@ package event import ( - "strconv" + "fmt" + + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/rabbitstack/fibratus/pkg/util/colorizer" ) -// Format applies the template on the provided event. -func (f *Formatter) Format(evt *Event) []byte { - if evt == nil { - return []byte{} - } - values := map[string]interface{}{ - ts: evt.Timestamp.String(), - pid: strconv.FormatUint(uint64(evt.PID), 10), - tid: strconv.FormatUint(uint64(evt.Tid), 10), - seq: strconv.FormatUint(evt.Seq, 10), - cpu: strconv.FormatUint(uint64(evt.CPU), 10), - typ: evt.Name(), - cat: evt.Category(), - desc: evt.Description(), - host: evt.Host, - meta: evt.Metadata.String(), - parameters: evt.Params.String(), +func addPlatformProcessFormatValues(ps *pstypes.PS, values map[string]interface{}) { + values[sid] = ps.SID + if ps.PE != nil { + values[pe] = ps.PE.String() } +} - // add process metadata - ps := evt.PS - if ps != nil { - values[proc] = ps.Name - values[ppid] = strconv.FormatUint(uint64(ps.Ppid), 10) - values[cwd] = ps.Cwd - values[exe] = ps.Exe - values[cmd] = ps.Cmdline - values[sid] = ps.SID - parent := ps.Parent - if parent != nil { - values[pproc] = parent.Name - values[pexe] = parent.Exe - values[pcmd] = parent.Cmdline - } - if ps.PE != nil { - values[pe] = ps.PE.String() - } - } - // add callstack summary - if !evt.Callstack.IsEmpty() { - values[cstack] = evt.Callstack.String() - } +func colourPlatformTag(_ string, evt *Event) string { + return fmt.Sprintf("\n%s", evt.Callstack.Colorize()) +} - if f.expandParamsDot { - // expand all parameters into the map, so we can ask - // for specific parameter names in the template - for _, par := range evt.Params { - values[".Params."+caser.String(par.Name)] = par.String() +func colourPlatformProcessTag(tag string, evt *Event) (string, bool) { + switch tag { + case sid: + if evt.PS == nil { + return colorizer.Span(colorizer.Gray, "N/A"), true } + return colorizer.Span(colorizer.Gray, evt.PS.SID), true + case pe: + if evt.PS == nil || evt.PS.PE == nil { + return colorizer.Span(colorizer.Gray, "N/A"), true + } + return colorizer.Span(colorizer.Magenta, evt.PS.PE.String()), true + default: + return "", false } - - return f.t.ExecuteString(values) } diff --git a/pkg/event/formatter_test.go b/pkg/event/formatter_windows_test.go similarity index 99% rename from pkg/event/formatter_test.go rename to pkg/event/formatter_windows_test.go index 42a2ae812..657dba714 100644 --- a/pkg/event/formatter_test.go +++ b/pkg/event/formatter_windows_test.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/marshaller.go b/pkg/event/marshaller.go index 01008265f..973bc129c 100644 --- a/pkg/event/marshaller.go +++ b/pkg/event/marshaller.go @@ -24,6 +24,14 @@ import ( "unicode/utf8" ) +type serializationConfig struct { + handles bool + threads bool + modules bool + envs bool + pe bool +} + type jsonStream struct { buf []byte } diff --git a/pkg/event/marshaller_linux.go b/pkg/event/marshaller_linux.go index 0a3be0a01..a785ddda2 100644 --- a/pkg/event/marshaller_linux.go +++ b/pkg/event/marshaller_linux.go @@ -20,15 +20,31 @@ package event -var ( - // SerializeHandles indicates if handles are serialized as part of the process state - SerializeHandles bool - // SerializeThreads indicates if threads are serialized as part of the process state - SerializeThreads bool - // SerializeModules indicates if modules are serialized as part of the process state - SerializeModules bool - // SerializePE indicates if PE metadata are serialized as part of the process state - SerializePE bool - // SerializeEnvs indicates if the environment variables are serialized as part of the process state - SerializeEnvs bool +import ( + "encoding/json" + "fmt" + + capver "github.com/rabbitstack/fibratus/pkg/cap/version" ) + +// SerializeEnvs indicates if environment variables are serialized with process state. +var SerializeEnvs bool + +func serializationOptions() serializationConfig { + return serializationConfig{envs: SerializeEnvs} +} + +// MarshalJSON serializes the event to JSON. +func (e *Event) MarshalJSON() []byte { + type plainEvent Event + b, err := json.Marshal((*plainEvent)(e)) + if err != nil { + return []byte("{}") + } + return b +} + +// UnmarshalRaw recovers an event from a capture buffer. +func (e *Event) UnmarshalRaw(_ []byte, _ capver.Version) error { + return fmt.Errorf("event capture unmarshalling is not implemented on Linux") +} diff --git a/pkg/event/marshaller_linux_test.go b/pkg/event/marshaller_linux_test.go new file mode 100644 index 000000000..53e9b6c5c --- /dev/null +++ b/pkg/event/marshaller_linux_test.go @@ -0,0 +1,38 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestLinuxMarshalJSON(t *testing.T) { + event := &Event{PID: 42, Tid: 43, Type: Execve, Name: Execve.String(), Category: Process} + var decoded map[string]interface{} + require.NoError(t, json.Unmarshal(event.MarshalJSON(), &decoded)) + assert.Equal(t, float64(42), decoded["pid"]) + assert.Equal(t, float64(43), decoded["tid"]) + assert.Equal(t, "execve", decoded["name"]) +} diff --git a/pkg/event/marshaller_windows.go b/pkg/event/marshaller_windows.go index 1473e454b..244d39095 100644 --- a/pkg/event/marshaller_windows.go +++ b/pkg/event/marshaller_windows.go @@ -51,6 +51,16 @@ var ( SerializeEnvs bool ) +func serializationOptions() serializationConfig { + return serializationConfig{ + handles: SerializeHandles, + threads: SerializeThreads, + modules: SerializeModules, + envs: SerializeEnvs, + pe: SerializePE, + } +} + // unmarshalTimestampErrors counts timestamp unmarshal errors var unmarshalTimestampErrors = expvar.NewInt("event.timestamp.unmarshal.errors") diff --git a/pkg/event/marshaller_test.go b/pkg/event/marshaller_windows_test.go similarity index 99% rename from pkg/event/marshaller_test.go rename to pkg/event/marshaller_windows_test.go index d6ad0202e..2906b7f62 100644 --- a/pkg/event/marshaller_test.go +++ b/pkg/event/marshaller_windows_test.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/metainfo.go b/pkg/event/metainfo.go new file mode 100644 index 000000000..289196db4 --- /dev/null +++ b/pkg/event/metainfo.go @@ -0,0 +1,54 @@ +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "cmp" + "slices" +) + +// Info describes an event's human-readable name, category, and purpose. +type Info struct { + Name string + Category Category + Description string +} + +// GetTypesMeta returns event type metadata without duplicate display names. +func GetTypesMeta() []Info { + infos := make([]Info, 0, len(events)) +outer: + for _, info := range events { + for _, existing := range infos { + if existing.Name == info.Name { + continue outer + } + } + infos = append(infos, info) + } + slices.SortFunc(infos, func(a, b Info) int { + return cmp.Or(cmp.Compare(a.Category, b.Category), cmp.Compare(a.Name, b.Name)) + }) + return infos +} + +// IsKnown reports whether the event name is registered. +func IsKnown(name string) bool { + return NameToType(name) != UnknownType +} diff --git a/pkg/event/metainfo_linux.go b/pkg/event/metainfo_linux.go index 4378f1a8a..667f598a3 100644 --- a/pkg/event/metainfo_linux.go +++ b/pkg/event/metainfo_linux.go @@ -22,42 +22,29 @@ package event import "slices" -type Info struct { - Name string - Category Category - Description string -} - var events = map[Type]Info{ - CreateProcess: {Name: "CreateProcess", Category: Process, Description: "Creates a new process"}, - Execve: {Name: "Execve", Category: Process, Description: "Executes a program"}, - TerminateProcess: {Name: "TerminateProcess", Category: Process, Description: "Terminates a process"}, - Exit: {Name: "Exit", Category: Process, Description: "Exits a process"}, - ProcessRundown: {Name: "ProcessRundown", Category: Process, Description: "Reports an existing process"}, - Clone: {Name: "Clone", Category: Process, Description: "Clones a process or thread"}, + Execve: {Name: "execve", Category: Process, Description: "Executes a program"}, + Exit: {Name: "exit", Category: Process, Description: "Exit all threads in a process"}, + Clone: {Name: "clone", Category: Process, Description: "Creates a child process or a thread"}, } var types = map[string]Type{ - "CreateProcess": CreateProcess, - "Execve": Execve, - "TerminateProcess": TerminateProcess, - "Exit": Exit, - "ProcessRundown": ProcessRundown, - "Clone": Clone, + "execve": Execve, + "exit": Exit, + "clone": Clone, } +// All returns all Linux event types. func All() []Type { - return []Type{CreateProcess, Execve, TerminateProcess, Exit, Clone} -} - -func AllWithState() []Type { - return append(All(), ProcessRundown) + return []Type{Execve, Exit, Clone} } +// MaxTypeID returns the largest Linux event type identifier. func MaxTypeID() uint16 { - return uint16(slices.Max(AllWithState())) + return uint16(slices.Max(All())) } +// TypeToEventInfo returns metadata for an event type. func TypeToEventInfo(typ Type) Info { if info, ok := events[typ]; ok { return info @@ -65,6 +52,7 @@ func TypeToEventInfo(typ Type) Info { return Info{Name: "N/A", Category: Unknown} } +// NameToType converts an event name to its type. func NameToType(name string) Type { if typ, ok := types[name]; ok { return typ @@ -72,37 +60,7 @@ func NameToType(name string) Type { return UnknownType } +// NameToTypes converts an event name to its possible internal types. func NameToTypes(name string) []Type { return []Type{NameToType(name)} } - -func GetTypesMeta() []Info { - infos := make([]Info, 0, len(events)) - for _, info := range events { - infos = append(infos, info) - } - slices.SortFunc(infos, func(a, b Info) int { - if a.Category == b.Category { - if a.Name < b.Name { - return -1 - } - if a.Name > b.Name { - return 1 - } - return 0 - } - if a.Category < b.Category { - return -1 - } - return 1 - }) - return infos -} - -func GetTypesMetaIndexed() []Info { - return GetTypesMeta() -} - -func IsKnown(name string) bool { - return NameToType(name) != UnknownType -} diff --git a/pkg/event/param.go b/pkg/event/param.go index ec0a9ba9f..344a2785a 100644 --- a/pkg/event/param.go +++ b/pkg/event/param.go @@ -23,11 +23,11 @@ import ( "net" "reflect" "sort" + "strconv" "strings" "time" "github.com/rabbitstack/fibratus/pkg/util/colorizer" - "github.com/rabbitstack/fibratus/pkg/util/ntstatus" "github.com/rabbitstack/fibratus/pkg/util/va" "golang.org/x/text/cases" "golang.org/x/text/language" @@ -99,6 +99,100 @@ type Param struct { Enum ParamEnum `json:"enum"` } +// NewParam creates a parameter and normalizes its value for the current platform. +func NewParam(name string, typ params.Type, value params.Value, options ...ParamOption) *Param { + var opts paramOpts + for _, opt := range options { + opt(&opts) + } + return &Param{ + Name: name, + Type: typ, + Value: normalizeParamValue(typ, value), + Flags: opts.flags, + Enum: opts.enum, + } +} + +// String returns the string representation of the parameter value. +func (p Param) String() string { + if p.Value == nil { + return "" + } + if value, ok := formatPlatformParam(p); ok { + return value + } + switch p.Type { + case params.Path: + return fmt.Sprintf("%v", p.Value) + case params.Address: + v, ok := p.Value.(uint64) + if !ok { + return "" + } + return va.Address(v).String() + case params.Int8: + return strconv.Itoa(int(p.Value.(int8))) + case params.Uint8: + return strconv.Itoa(int(p.Value.(uint8))) + case params.Int16: + return strconv.Itoa(int(p.Value.(int16))) + case params.Uint16, params.Port: + return strconv.Itoa(int(p.Value.(uint16))) + case params.Uint32: + return strconv.FormatUint(uint64(p.Value.(uint32)), 10) + case params.PID, params.TID: + return formatPlatformID(p.Value) + case params.Int32: + return strconv.Itoa(int(p.Value.(int32))) + case params.Uint64: + return strconv.FormatUint(p.Value.(uint64), 10) + case params.Int64: + return strconv.FormatInt(p.Value.(int64), 10) + case params.IPv4, params.IPv6: + return p.Value.(net.IP).String() + case params.Bool: + return strconv.FormatBool(p.Value.(bool)) + case params.Float: + return strconv.FormatFloat(float64(p.Value.(float32)), 'f', 6, 32) + case params.Double: + return strconv.FormatFloat(p.Value.(float64), 'f', 6, 64) + case params.Time: + return p.Value.(time.Time).String() + case params.Enum: + if p.Enum == nil { + return "" + } + v, ok := p.Value.(uint32) + if !ok { + return "" + } + return p.Enum[v] + case params.Flags, params.Flags64: + if p.Flags == nil { + return "" + } + switch v := p.Value.(type) { + case uint32: + return p.Flags.String(uint64(v)) + case uint64: + return p.Flags.String(v) + default: + return "" + } + case params.Slice: + switch slice := p.Value.(type) { + case []string: + return strings.Join(slice, ",") + default: + return fmt.Sprintf("%v", slice) + } + case params.Binary: + return string(p.Value.([]byte)) + } + return fmt.Sprintf("%v", p.Value) +} + // IsNumber determines if the parameter stores the integer value type. func (p Param) IsNumber() bool { return p.Type == params.Int8 || p.Type == params.Int16 || p.Type == params.Int32 || p.Type == params.Int64 || @@ -111,12 +205,7 @@ func (p Param) IsNumber() bool { // type is converted to string param type, as drive mapping is performed // on the target where the capture is being taken. func (p Param) CaptureType() params.Type { - switch p.Type { - case params.HandleType, params.DOSPath, params.Key: - return params.UnicodeString - default: - return p.Type - } + return captureParamType(p.Type) } // Params is the type that represents the sequence of event parameters @@ -207,83 +296,6 @@ func (pars Params) MustGetString(name string) string { return s } -// GetPid returns the pid from the parameter. -func (pars Params) GetPid() (uint32, error) { - return pars.getPid(params.ProcessID) -} - -// MustGetPid returns the pid parameter. It panics if -// an error occurs while trying to get the pid parameter. -func (pars Params) MustGetPid() uint32 { - pid, err := pars.GetPid() - if err != nil { - panic(err) - } - return pid -} - -// GetPpid returns the parent pid from the parameter. -func (pars Params) GetPpid() (uint32, error) { - return pars.getPid(params.ProcessParentID) -} - -// MustGetPpid returns the parent pid parameter. It panics if -// an error occurs while trying to get the pid parameter. -func (pars Params) MustGetPpid() uint32 { - ppid, err := pars.GetPpid() - if err != nil { - panic(err) - } - return ppid -} - -func (pars Params) getPid(name string) (uint32, error) { - par, err := pars.findParam(name) - if err != nil { - return uint32(0), err - } - if par.Type != params.PID { - return uint32(0), fmt.Errorf("%q parameter is not a PID", name) - } - v, ok := par.Value.(uint32) - if !ok { - return uint32(0), fmt.Errorf("unable to type cast %q parameter to uint32 value from pid", name) - } - return v, nil -} - -// GetTid returns the thread id from the parameter. -func (pars Params) GetTid() (uint32, error) { - par, err := pars.findParam(params.ThreadID) - if err != nil { - return uint32(0), err - } - if par.Type != params.TID { - return uint32(0), fmt.Errorf("%q parameter is not a TID", params.ThreadID) - } - v, ok := par.Value.(uint32) - if !ok { - return uint32(0), fmt.Errorf("unable to type cast %q parameter to uint32 value from tid", params.ThreadID) - } - return v, nil -} - -// MustGetTid returns the thread id from the parameter or panics if an error occurs. -func (pars Params) MustGetTid() uint32 { - par, err := pars.findParam(params.ThreadID) - if err != nil { - panic(err) - } - if par.Type != params.TID { - panic(fmt.Errorf("%q parameter is not a TID", params.ThreadID)) - } - v, ok := par.Value.(uint32) - if !ok { - panic(fmt.Errorf("unable to type cast %q parameter to uint32 value from tid", params.ThreadID)) - } - return v -} - // GetUint8 returns the underlying uint8 value from the parameter. func (pars Params) GetUint8(name string) (uint8, error) { par, err := pars.findParam(name) @@ -737,18 +749,13 @@ func (pars Params) Colorize() string { // color applies a semantic colour to a single parameter value based // on its type and for string types its content. func (p *Param) color() string { + if color, ok := platformParamColor(p); ok { + return color + } switch p.Type { case params.Address: return colorizer.SpanDim(colorizer.Span(colorizer.Gray, "0x"+p.String())) - case params.Status: - v := p.String() - - if v == ntstatus.Success { - return colorizer.Span(colorizer.Green, v) - } - return colorizer.Span(colorizer.Red, v) - case params.Int8, params.Int16, params.Int32, params.Int64, params.Uint8, params.Uint16, params.Uint32, params.Uint64, params.Float, params.Double: @@ -764,9 +771,6 @@ func (p *Param) color() string { } return colorizer.Span(colorizer.Coral, p.String()) - case params.UnicodeString, params.AnsiString, params.SID: - return colorizer.Span(colorizer.White, p.String()) - case params.IPv4, params.IPv6: return colorizer.Span(colorizer.Blue, p.String()) diff --git a/pkg/event/param_capture_windows.go b/pkg/event/param_capture_windows.go deleted file mode 100644 index d8c79be40..000000000 --- a/pkg/event/param_capture_windows.go +++ /dev/null @@ -1,76 +0,0 @@ -//go:build windows - -/* - * Copyright 2019-2020 by Nedim Sabic Sabic - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package event - -import ( - "github.com/rabbitstack/fibratus/pkg/event/params" - "github.com/rabbitstack/fibratus/pkg/fs" - "github.com/rabbitstack/fibratus/pkg/network" - "github.com/rabbitstack/fibratus/pkg/util/key" -) - -// NewParamFromCapture builds a parameter instance from the restored capture state. -func NewParamFromCapture(name string, typ params.Type, value params.Value, etype Type) *Param { - var enum ParamEnum - var flags ParamFlags - switch name { - case params.FileOperation: - enum = fs.FileCreateDispositions - case params.FileCreateOptions: - flags = FileCreateOptionsFlags - case params.FileAttributes: - flags = FileAttributeFlags - case params.FileShareMask: - flags = FileShareModeFlags - case params.FileInfoClass: - enum = fs.FileInfoClasses - case params.FileType: - enum = fs.FileTypes - case params.NetL4Proto: - enum = network.ProtoNames - case params.RegValueType: - enum = key.RegistryValueTypes - case params.MemAllocType: - flags = MemAllocationFlags - case params.FileViewSectionType: - enum = ViewSectionTypes - case params.DNSOpts: - flags = DNSOptsFlags - case params.DNSRR: - enum = DNSRecordTypes - case params.DNSRcode: - enum = DNSResponseCodes - case params.DesiredAccess: - if etype == OpenProcess { - flags = PsAccessRightFlags - } else { - flags = ThreadAccessRightFlags - } - case params.MemProtect: - if etype == VirtualAlloc || etype == VirtualFree { - flags = MemProtectionFlags - } else { - flags = ViewProtectionFlags - } - } - return &Param{Name: name, Type: typ, Value: value, Enum: enum, Flags: flags} -} diff --git a/pkg/event/param_linux.go b/pkg/event/param_linux.go index af0a2ce89..761a72143 100644 --- a/pkg/event/param_linux.go +++ b/pkg/event/param_linux.go @@ -22,104 +22,103 @@ package event import ( "fmt" - "net" "strconv" - "strings" - "time" "github.com/rabbitstack/fibratus/pkg/event/params" - "github.com/rabbitstack/fibratus/pkg/util/ntstatus" - "github.com/rabbitstack/fibratus/pkg/util/va" + "github.com/rabbitstack/fibratus/pkg/util/colorizer" ) -// NewParam creates a new event parameter. -func NewParam(name string, typ params.Type, value params.Value, options ...ParamOption) *Param { - var opts paramOpts - for _, opt := range options { - opt(&opts) +func normalizeParamValue(_ params.Type, value params.Value) params.Value { return value } + +func formatPlatformParam(p Param) (string, bool) { + if p.Type != params.String { + return "", false + } + value, ok := p.Value.(string) + if !ok { + return fmt.Sprintf("%v", p.Value), true } - return &Param{Name: name, Type: typ, Value: value, Flags: opts.flags, Enum: opts.enum} + return value, true } -// String returns the string representation of the parameter value. -func (p Param) String() string { - if p.Value == nil { - return "" - } +func formatPlatformID(value params.Value) string { + return strconv.FormatUint(value.(uint64), 10) +} + +func captureParamType(typ params.Type) params.Type { return typ } + +func platformParamColor(p *Param) (string, bool) { switch p.Type { - case params.UnicodeString, params.AnsiString, params.Path, params.DOSPath, params.Key, params.HandleType: - if s, ok := p.Value.(string); ok { - return s - } - return fmt.Sprintf("%v", p.Value) + case params.String: + return colorizer.Span(colorizer.White, p.String()), true case params.Status: - v, ok := p.Value.(uint32) - if !ok { - return "" - } - return ntstatus.FormatMessage(v) - case params.Address: - v, ok := p.Value.(uint64) - if !ok { - return "" - } - return va.Address(v).String() - case params.Int8: - return strconv.Itoa(int(p.Value.(int8))) - case params.Uint8: - return strconv.Itoa(int(p.Value.(uint8))) - case params.Int16: - return strconv.Itoa(int(p.Value.(int16))) - case params.Uint16, params.Port: - return strconv.Itoa(int(p.Value.(uint16))) - case params.Uint32, params.PID, params.TID: - return strconv.Itoa(int(p.Value.(uint32))) - case params.Int32: - return strconv.Itoa(int(p.Value.(int32))) - case params.Uint64: - return strconv.FormatUint(p.Value.(uint64), 10) - case params.Int64: - return strconv.Itoa(int(p.Value.(int64))) - case params.IPv4, params.IPv6: - return p.Value.(net.IP).String() - case params.Bool: - return strconv.FormatBool(p.Value.(bool)) - case params.Float: - return strconv.FormatFloat(float64(p.Value.(float32)), 'f', 6, 32) - case params.Double: - return strconv.FormatFloat(p.Value.(float64), 'f', 6, 64) - case params.Time: - return p.Value.(time.Time).String() - case params.Enum: - if p.Enum == nil { - return "" + if p.String() == "0" { + return colorizer.Span(colorizer.Green, p.String()), true } - v, ok := p.Value.(uint32) - if !ok { - return "" - } - return p.Enum[v] - case params.Flags, params.Flags64: - if p.Flags == nil { - return "" - } - switch v := p.Value.(type) { - case uint32: - return p.Flags.String(uint64(v)) - case uint64: - return p.Flags.String(v) - default: - return "" - } - case params.Slice: - switch slice := p.Value.(type) { - case []string: - return strings.Join(slice, ",") - default: - return fmt.Sprintf("%v", slice) - } - case params.Binary: - return string(p.Value.([]byte)) + return colorizer.Span(colorizer.Red, p.String()), true + default: + return "", false + } +} + +// NewParamFromCapture builds a parameter from restored capture state. +func NewParamFromCapture(name string, typ params.Type, value params.Value, _ Type) *Param { + return &Param{Name: name, Type: typ, Value: value} +} + +// GetPid returns the process identifier. +func (pars Params) GetPid() (uint64, error) { + return pars.getID(params.ProcessID, params.PID) +} + +// MustGetPid returns the process identifier or panics. +func (pars Params) MustGetPid() uint64 { + id, err := pars.GetPid() + if err != nil { + panic(err) + } + return id +} + +// GetPpid returns the parent process identifier. +func (pars Params) GetPpid() (uint64, error) { + return pars.getID(params.ProcessParentID, params.PID) +} + +// MustGetPpid returns the parent process identifier or panics. +func (pars Params) MustGetPpid() uint64 { + id, err := pars.GetPpid() + if err != nil { + panic(err) + } + return id +} + +// GetTid returns the thread identifier. +func (pars Params) GetTid() (uint64, error) { + return pars.getID(params.ThreadID, params.TID) +} + +// MustGetTid returns the thread identifier or panics. +func (pars Params) MustGetTid() uint64 { + id, err := pars.GetTid() + if err != nil { + panic(err) + } + return id +} + +func (pars Params) getID(name string, typ params.Type) (uint64, error) { + param, err := pars.findParam(name) + if err != nil { + return 0, err + } + if param.Type != typ { + return 0, fmt.Errorf("%q parameter has unexpected identifier type", name) + } + value, ok := param.Value.(uint64) + if !ok { + return 0, fmt.Errorf("unable to type cast %q parameter to uint64 identifier", name) } - return fmt.Sprintf("%v", p.Value) + return value, nil } diff --git a/pkg/event/param_test.go b/pkg/event/param_test.go index a47b18dcb..059687f99 100644 --- a/pkg/event/param_test.go +++ b/pkg/event/param_test.go @@ -19,27 +19,28 @@ package event import ( + "testing" + "github.com/rabbitstack/fibratus/pkg/event/params" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "testing" ) func TestParams(t *testing.T) { pars := Params{ - params.FileObject: {Name: params.FileObject, Type: params.Uint64, Value: uint64(18446738026482168384)}, - params.ThreadID: {Name: params.ThreadID, Type: params.Uint32, Value: uint32(1484)}, - params.FileCreateOptions: {Name: params.FileCreateOptions, Type: params.Uint32, Value: uint32(1223456)}, - params.FilePath: {Name: params.FilePath, Type: params.UnicodeString, Value: "\\Device\\HarddiskVolume2\\Windows\\system32\\kernel32.dll"}, - params.FileShareMask: {Name: params.FileShareMask, Type: params.Uint32, Value: uint32(5)}, + params.FileObject: {Name: params.FileObject, Type: params.Uint64, Value: uint64(18446738026482168384)}, + params.ThreadID: {Name: params.ThreadID, Type: params.Uint32, Value: uint32(1484)}, + params.FileOffset: {Name: params.FileOffset, Type: params.Uint64, Value: uint64(1223456)}, + params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/usr/bin/bash"}, + params.ProcessID: {Name: params.ProcessID, Type: params.Uint32, Value: uint32(5)}, } assert.True(t, pars.Contains(params.FileObject)) - assert.False(t, pars.Contains(params.FileOffset)) + assert.False(t, pars.Contains(params.ProcessName)) filename, err := pars.GetString(params.FilePath) require.NoError(t, err) - assert.Equal(t, "\\Device\\HarddiskVolume2\\Windows\\system32\\kernel32.dll", filename) + assert.Equal(t, "/usr/bin/bash", filename) _, err = pars.GetString(params.FileObject) require.Error(t, err) @@ -51,10 +52,10 @@ func TestParams(t *testing.T) { assert.False(t, pars.Contains(params.ThreadID)) assert.Equal(t, 4, pars.Len()) - require.NoError(t, pars.Set(params.FileShareMask, uint32(5), params.Enum)) + require.NoError(t, pars.Set(params.ProcessID, uint32(5), params.Enum)) - require.NoError(t, pars.SetValue(params.FilePath, "\\Device\\HarddiskVolume2\\Windows\\system32\\KERNEL32.dll")) + require.NoError(t, pars.SetValue(params.FilePath, "/usr/bin/zsh")) filename1, err := pars.GetString(params.FilePath) require.NoError(t, err) - assert.Equal(t, "\\Device\\HarddiskVolume2\\Windows\\system32\\KERNEL32.dll", filename1) + assert.Equal(t, "/usr/bin/zsh", filename1) } diff --git a/pkg/event/param_windows.go b/pkg/event/param_windows.go index 7d718eb0e..a5b8efde8 100644 --- a/pkg/event/param_windows.go +++ b/pkg/event/param_windows.go @@ -21,162 +21,213 @@ package event import ( "expvar" "fmt" - "net" "strconv" - "strings" - "time" "unsafe" "github.com/rabbitstack/fibratus/pkg/event/params" "github.com/rabbitstack/fibratus/pkg/fs" htypes "github.com/rabbitstack/fibratus/pkg/handle/types" + "github.com/rabbitstack/fibratus/pkg/network" "github.com/rabbitstack/fibratus/pkg/sys" "github.com/rabbitstack/fibratus/pkg/sys/etw" + "github.com/rabbitstack/fibratus/pkg/util/colorizer" "github.com/rabbitstack/fibratus/pkg/util/ip" "github.com/rabbitstack/fibratus/pkg/util/key" "github.com/rabbitstack/fibratus/pkg/util/ntstatus" - "github.com/rabbitstack/fibratus/pkg/util/va" "golang.org/x/sys/windows" ) -// unknownKeysCount counts the number of times the registry key failed to convert from native format var unknownKeysCount = expvar.NewInt("registry.unknown.keys.count") -// NewParam creates a new event parameter. Since the parameter type is already categorized, -// we can coerce the value to the appropriate representation (e.g. hex, IP address) -func NewParam(name string, typ params.Type, value params.Value, options ...ParamOption) *Param { - var opts paramOpts - for _, opt := range options { - opt(&opts) - } - var v params.Value +func normalizeParamValue(typ params.Type, value params.Value) params.Value { switch typ { case params.IPv4: - v = ip.ToIPv4(value.(uint32)) + return ip.ToIPv4(value.(uint32)) case params.IPv6: - v = ip.ToIPv6(value.([]byte)) + return ip.ToIPv6(value.([]byte)) case params.Port: - v = windows.Ntohs(value.(uint16)) + return windows.Ntohs(value.(uint16)) default: - v = value + return value } - return &Param{Name: name, Type: typ, Value: v, Flags: opts.flags, Enum: opts.enum} } -// String returns the string representation of the parameter value. -func (p Param) String() string { - if p.Value == nil { - return "" - } +func formatPlatformParam(p Param) (string, bool) { switch p.Type { case params.UnicodeString, params.AnsiString, params.Path: - return p.Value.(string) + return p.Value.(string), true case params.SID, params.WbemSID: sid, err := getSID(&p) if err != nil { - return "" + return "", true } if p.Name == params.ProcessTokenIntegrityLevel { - return sys.RidToString(sid) + return sys.RidToString(sid), true } - return sid.String() + return sid.String(), true case params.DOSPath: - return fs.GetDevMapper().Convert(p.Value.(string)) + return fs.GetDevMapper().Convert(p.Value.(string)), true case params.Key: rootKey, keyName := key.Format(p.Value.(string)) if keyName != "" && rootKey != key.Invalid { - return rootKey.String() + "\\" + keyName + return rootKey.String() + "\\" + keyName, true } if rootKey != key.Invalid { - return rootKey.String() + return rootKey.String(), true } unknownKeysCount.Add(1) - return keyName + return keyName, true case params.HandleType: - return htypes.ConvertTypeIDToName(p.Value.(uint16)) + return htypes.ConvertTypeIDToName(p.Value.(uint16)), true case params.Status: - v, ok := p.Value.(uint32) - if !ok { - return "" - } - return ntstatus.FormatMessage(v) - case params.Address: - v, ok := p.Value.(uint64) - if !ok { - return "" - } - return va.Address(v).String() - case params.Int8: - return strconv.Itoa(int(p.Value.(int8))) - case params.Uint8: - return strconv.Itoa(int(p.Value.(uint8))) - case params.Int16: - return strconv.Itoa(int(p.Value.(int16))) - case params.Uint16, params.Port: - return strconv.Itoa(int(p.Value.(uint16))) - case params.Uint32, params.PID, params.TID: - return strconv.Itoa(int(p.Value.(uint32))) - case params.Int32: - return strconv.Itoa(int(p.Value.(int32))) - case params.Uint64: - return strconv.FormatUint(p.Value.(uint64), 10) - case params.Int64: - return strconv.Itoa(int(p.Value.(int64))) - case params.IPv4, params.IPv6: - return p.Value.(net.IP).String() - case params.Bool: - return strconv.FormatBool(p.Value.(bool)) - case params.Float: - return strconv.FormatFloat(float64(p.Value.(float32)), 'f', 6, 32) - case params.Double: - return strconv.FormatFloat(p.Value.(float64), 'f', 6, 64) - case params.Time: - return p.Value.(time.Time).String() - case params.Enum: - if p.Enum == nil { - return "" - } - e := p.Value - v, ok := e.(uint32) + value, ok := p.Value.(uint32) if !ok { - return "" + return "", true } - return p.Enum[v] - case params.Flags, params.Flags64: - if p.Flags == nil { - return "" + return ntstatus.FormatMessage(value), true + default: + return "", false + } +} + +func formatPlatformID(value params.Value) string { + return strconv.FormatUint(uint64(value.(uint32)), 10) +} + +func captureParamType(typ params.Type) params.Type { + switch typ { + case params.HandleType, params.DOSPath, params.Key: + return params.UnicodeString + default: + return typ + } +} + +func platformParamColor(p *Param) (string, bool) { + switch p.Type { + case params.UnicodeString, params.AnsiString, params.SID: + return colorizer.Span(colorizer.White, p.String()), true + case params.Status: + if p.String() == ntstatus.Success { + return colorizer.Span(colorizer.Green, p.String()), true } - f := p.Value - switch v := f.(type) { - case uint32: - return p.Flags.String(uint64(v)) - case uint64: - return p.Flags.String(v) - default: - return "" + return colorizer.Span(colorizer.Red, p.String()), true + default: + return "", false + } +} + +// NewParamFromCapture builds a parameter from restored capture state. +func NewParamFromCapture(name string, typ params.Type, value params.Value, etype Type) *Param { + var enum ParamEnum + var flags ParamFlags + switch name { + case params.FileOperation: + enum = fs.FileCreateDispositions + case params.FileCreateOptions: + flags = FileCreateOptionsFlags + case params.FileAttributes: + flags = FileAttributeFlags + case params.FileShareMask: + flags = FileShareModeFlags + case params.FileInfoClass: + enum = fs.FileInfoClasses + case params.FileType: + enum = fs.FileTypes + case params.NetL4Proto: + enum = network.ProtoNames + case params.RegValueType: + enum = key.RegistryValueTypes + case params.MemAllocType: + flags = MemAllocationFlags + case params.FileViewSectionType: + enum = ViewSectionTypes + case params.DNSOpts: + flags = DNSOptsFlags + case params.DNSRR: + enum = DNSRecordTypes + case params.DNSRcode: + enum = DNSResponseCodes + case params.DesiredAccess: + if etype == OpenProcess { + flags = PsAccessRightFlags + } else { + flags = ThreadAccessRightFlags } - case params.Slice: - switch slice := p.Value.(type) { - case []string: - return strings.Join(slice, ",") - default: - return fmt.Sprintf("%v", slice) + case params.MemProtect: + if etype == VirtualAlloc || etype == VirtualFree { + flags = MemProtectionFlags + } else { + flags = ViewProtectionFlags } - case params.Binary: - return string(p.Value.([]byte)) } - return fmt.Sprintf("%v", p.Value) + return &Param{Name: name, Type: typ, Value: value, Enum: enum, Flags: flags} +} + +// GetPid returns the process identifier. +func (pars Params) GetPid() (uint32, error) { + return pars.getID(params.ProcessID, params.PID) +} + +// MustGetPid returns the process identifier or panics. +func (pars Params) MustGetPid() uint32 { + id, err := pars.GetPid() + if err != nil { + panic(err) + } + return id +} + +// GetPpid returns the parent process identifier. +func (pars Params) GetPpid() (uint32, error) { + return pars.getID(params.ProcessParentID, params.PID) +} + +// MustGetPpid returns the parent process identifier or panics. +func (pars Params) MustGetPpid() uint32 { + id, err := pars.GetPpid() + if err != nil { + panic(err) + } + return id +} + +// GetTid returns the thread identifier. +func (pars Params) GetTid() (uint32, error) { + return pars.getID(params.ThreadID, params.TID) +} + +// MustGetTid returns the thread identifier or panics. +func (pars Params) MustGetTid() uint32 { + id, err := pars.GetTid() + if err != nil { + panic(err) + } + return id +} + +func (pars Params) getID(name string, typ params.Type) (uint32, error) { + param, err := pars.findParam(name) + if err != nil { + return 0, err + } + if param.Type != typ { + return 0, fmt.Errorf("%q parameter has unexpected identifier type", name) + } + value, ok := param.Value.(uint32) + if !ok { + return 0, fmt.Errorf("unable to type cast %q parameter to uint32 identifier", name) + } + return value, nil } -// GetSID returns the raw SID (Security Identifier) parameter as -// typed representation on which various operations can be performed, -// such as converting the SID to string or resolving username/domain. +// GetSID returns the raw Windows security identifier parameter. func (pars Params) GetSID() (*windows.SID, error) { - par, err := pars.findParam(params.UserSID) + param, err := pars.findParam(params.UserSID) if err != nil { return nil, err } - return getSID(par) + return getSID(param) } func getSID(param *Param) (*windows.SID, error) { @@ -187,17 +238,14 @@ func getSID(param *Param) (*windows.SID, error) { if sid == nil { return nil, fmt.Errorf("sid linked to parameter %s is empty", param.Name) } - b := uintptr(unsafe.Pointer(&sid[0])) + pointer := uintptr(unsafe.Pointer(&sid[0])) if param.Type == params.WbemSID { - // a WBEM SID is actually a TOKEN_USER structure followed - // by the SID, so we have to double the pointer size - b += uintptr(8 * 2) + pointer += uintptr(8 * 2) } - return (*windows.SID)(unsafe.Pointer(b)), nil + return (*windows.SID)(unsafe.Pointer(pointer)), nil } -// MustGetSID returns the SID (Security Identifier) event parameter -// or panics if an error occurs. +// MustGetSID returns the Windows security identifier or panics. func (pars Params) MustGetSID() *windows.SID { sid, err := pars.GetSID() if err != nil { @@ -208,10 +256,6 @@ func (pars Params) MustGetSID() *windows.SID { var paramDecoder = &ParamDecoder{} -// decodeParams parses the event binary layout to extract -// the parameters. Each event is annotated with the schema -// version number which helps us determine when the event -// schema changes in order to parse new fields. func (e *Event) decodeParams(r *etw.EventRecord) { switch r.Header.ProviderID.Data1 { case RegistryEventGUID.Data1: diff --git a/pkg/event/params/names.go b/pkg/event/params/names.go index cb269f02c..153a8d14f 100644 --- a/pkg/event/params/names.go +++ b/pkg/event/params/names.go @@ -19,122 +19,54 @@ package params const ( - // NTStatus is the parameter that identifies the NTSTATUS value. - NTStatus = "status" - // ProcessID represents the process identifier. ProcessID = "pid" // TargetProcessID represents the target process identifier. TargetProcessID = "target_pid" - // ProcessObject field represents the address of the process object in the kernel. - ProcessObject = "kproc" // ThreadID field represents the thread identifier. ThreadID = "tid" - // Callstack field represents the thread callstack. - Callstack = "callstack" - // CallstackTimestamp field identifvies the callstack timestamp parameter. - CallstackTimestamp = "callstack_timestamp" // ProcessParentID field represents the parent process identifier. ProcessParentID = "ppid" - // ProcessRealParentID field presents the real parent process identifier. - ProcessRealParentID = "real_ppid" // SessionID fields represents the session identifier. SessionID = "session_id" - // UserSID field is the security identifier associated to the process token under which it is run. - UserSID = "sid" // Username field represents the username under which the event was generated. Username = "username" - // Domain field represents the domain under which the event was generated. - Domain = "domain" // ProcessName field denotes the process Module name. ProcessName = "name" // Exe field denotes the full path of the executable. Exe = "exe" // Cmdline field represents the process command line. Cmdline = "cmdline" - // DTB field denotes the address of the process directory table. - DTB = "directory_table_base" // ProcessFlags field denotes the process creation flags ProcessFlags = "flags" // ExitStatus is the field that represents the process exit status. ExitStatus = "exit_status" // StartTime field denotes the process start time. StartTime = "start_time" - // ProcessTokenIntegrityLevel field denotes the process integrity level. - ProcessTokenIntegrityLevel = "token_integrity_level" - // ProcessTokenElevationType field designates the process token elevation type. - ProcessTokenElevationType = "token_elevation_type" - // ProcessTokenIsElevated field designates if the process token is elevated. - ProcessTokenIsElevated = "token_is_elevated" - - // DesiredAccess field denotes the access rights for different kernel objects such as processes or threads. - DesiredAccess = "desired_access" - - // BasePrio field is the thread base priority assigned by the scheduler. - BasePrio = "base_prio" - // IOPrio represents the filed that indicates the thread I/O priority. - IOPrio = "io_prio" - // PagePrio field denotes page priority. - PagePrio = "page_prio" - // KstackBase field is the start address of the kernel space stack. - KstackBase = "kstack" - // KstackLimit field is the end address of the kernel space stack. - KstackLimit = "kstack_limit" - // UstackBase field is the start address of the user space stack. - UstackBase = "ustack" - // UstackLimit field is the end address of the user space stack. - UstackLimit = "ustack_limit" - // StartAddress field is the thread start address. - StartAddress = "start_address" - // StartAddressSymbol field is the symbol associated with the thread start address. - StartAddressSymbol = "start_address_symbol" - // StartAddressModule field is the module where the thread start address is mapped. - StartAddressModule = "start_address_module" - // TEB field is the address of the Thread Environment Block (TEB) - TEB = "teb" - // FileObject determines the field name for the file object pointer. FileObject = "file_object" // FilePath represents the field that designates the absolute path of the file. FilePath = "file_path" - // FileCreateOptions is the field that represents the values passed in the CreateDispositions parameter to the NtCreateFile function. - FileCreateOptions = "create_options" - // FileOperation is the field that represents the values passed in the CreateOptions parameter to the NtCreateFile function. - FileOperation = "create_disposition" // FileCreated represents the name for the file creation field. FileCreated = "created" // FileAccessed represents the name for the file access field. FileAccessed = "accessed" // FileModified represents the name for the file modification field. FileModified = "modified" - // FileShareMask represents the field name for the share access mask. - FileShareMask = "share_mask" // FileType represents the field name that indicates the file type. FileType = "type" - // FileAttributes is the field that represents file attribute values. - FileAttributes = "attributes" // FileIoSize is the filed that represents the number of bytes in file read/write operations. FileIoSize = "io_size" // FileOffset represents the file for the file offset in read/write operations. FileOffset = "offset" - // FileInfoClass represents the file information class. - FileInfoClass = "class" // FileKey represents the directory key identifier in EnumDirectory events. FileKey = "file_key" // FileDirectory represents the field for the directory name in EnumDirectory events. FileDirectory = "directory" - // FileIrpPtr represents the I/O request packet id. - FileIrpPtr = "irp" // FileExtraInfo is the parameter that represents extra information returned by the file system for the operation. For example for a read request, the actual number of bytes that were read. FileExtraInfo = "extra_info" - // FileIsDLL is the parameter that indicates if the file is a DLL - FileIsDLL = "is_dll" - // FileIsDriver is the parameter that indicates if the file is a driver - FileIsDriver = "is_driver" // FileIsExecutable is the parameter that indicates if the file is an executable FileIsExecutable = "is_exec" - // FileIsDotnet is the parameter that indicates if the file is a .NET assembly - FileIsDotnet = "is_dotnet" // FileViewBase is the parameter that represents the base address of the mapped section. FileViewBase = "view_base" @@ -143,47 +75,12 @@ const ( // FileViewSectionType is the parameter that represents the mapped section type. FileViewSectionType = "section_type" - // RegKeyHandle identifies the parameter name for the registry key handle. - RegKeyHandle = "key_handle" - // RegKCB identifies the parameter name for the registry key control block. - RegKCB = "kcb" - // RegPath represents the parameter name for the fully qualified key path. - RegPath = "key_path" - // RegValue identifies the parameter name that contains the value - RegValue = "value" - // RegValueType identifies the parameter that represents registry value type e.g (DWORD, BINARY) - RegValueType = "value_type" - // RegData identifies the parameter that stores the captured registry data - RegData = "data" - // ModuleBase identifies the parameter name for the base address of the process in which the Mmdule is loaded. ModuleBase = "base_address" // ModuleSize represents the parameter name for the size of the module in bytes. ModuleSize = "module_size" - // ModuleCheckSum is the parameter name for module checksum. - ModuleCheckSum = "checksum" - // ModuleTimeDateStamp is the parametter name for module timedate stamp. - ModuleTimeDateStamp = "timedate_stamp" - // ModuleDefaultBase is the parameter name that represents module's base address. - ModuleDefaultBase = "default_address" // ModulePath is the parameter name that denotes the file path and extension of the DLL/executable Module. ModulePath = "file_path" - // ModuleSignatureLevel is the parameter denoting the loaded module signature level. - ModuleSignatureLevel = "signature_level" - // ModuleSignatureType is the parameter denoting the loaded module signature type. - ModuleSignatureType = "signature_type" - // ModuleCertSubject is the parameter that indicates the subject of the certificate is the entity its public key is associated with. - ModuleCertSubject = "cert_subject" - // ModuleCertIssuer is the parameter that represents the certificate authority (CA). - ModuleCertIssuer = "cert_issuer" - // ModuleCertSerial is the parameter that represents the serial number MUST be a positive integer assigned - // by the CA to each certificate. - ModuleCertSerial = "cert_serial" - // ModuleCertNotBefore is the parameter that specifies the certificate won't be valid before this timestamp. - ModuleCertNotBefore = "cert_not_before" - // ModuleCertNotAfter is the parameter that specifies the certificate won't be valid after this timestamp. - ModuleCertNotAfter = "cert_not_after" - // NetSize identifies the parameter name that represents the packet size. NetSize = "size" // NetDIP is the parameter name that denotes the destination IP address. @@ -238,17 +135,6 @@ const ( // DNSAnswers is the field that represents DNS response answers DNSAnswers = "answers" - // HandleID identifies the parameter that specifies the handle identifier. - HandleID = "handle_id" - // HandleSourceID identifies the parameter that specifies the source handle identifier. - HandleSourceID = "handle_source_id" - // HandleObject identifies the parameter that represents the kernel object to which handle is associated. - HandleObject = "handle_object" - // HandleObjectName identifies the parameter that represents the kernel object name. - HandleObjectName = "handle_name" - // HandleObjectTypeID identifies the parameter that represents the kernel object type identifier. - HandleObjectTypeID = "type_id" - // MemBaseAddress identifies the parameter that denotes the allocation base address. MemBaseAddress = "base_address" // MemRegionSize identifies the parameter that represents the allocated region size. @@ -266,37 +152,4 @@ const ( LinkSource = "source" // LinkTarget identifies the parameter that represents the target symbolic link object or other kernel object LinkTarget = "target" - - // ThreadpoolPoolID represents the thread pool identifier. - ThreadpoolPoolID = "pool_id" - // ThreadpoolTaskID represents the thread pool task identifier. - ThreadpoolTaskID = "task_id" - // ThreadpoolCallback represents the address of the callback function. - ThreadpoolCallback = "callback" - // ThreadpoolCallbackSymbol represents the callback symbol. - ThreadpoolCallbackSymbol = "callback_symbol" - // ThreadpoolCallbackModule represents the module containing the callback symbol. - ThreadpoolCallbackModule = "callback_module" - // ThreadpoolContext represents the address of the callback context. - ThreadpoolContext = "context" - // ThreadpoolContextRip represents the value of instruction pointer contained in the callback context. - ThreadpoolContextRip = "context_rip" - // ThreadpoolContextRipSymbol represents the symbol name associated with the instruction pointer in callback context. - ThreadpoolContextRipSymbol = "context_rip_symbol" - // ThreadpoolContextRipModule represents the module name associated with the instruction pointer in callback context. - ThreadpoolContextRipModule = "context_rip_module" - // ThreadpoolSubprocessTag represents the service identifier associated with the thread pool. - ThreadpoolSubprocessTag = "subprocess_tag" - // ThreadpoolTimerDuetime represents the timer due time. - ThreadpoolTimerDuetime = "duetime" - // ThreadpoolTimerSubqueue represents the memory address of the timer subqueue. - ThreadpoolTimerSubqueue = "subqueue" - // ThreadpoolTimer represents the memory address of the timer object. - ThreadpoolTimer = "timer" - // ThreadpoolTimerPeriod represents the period of the timer - ThreadpoolTimerPeriod = "period" - // ThreadpoolTimerWindow represents the timer tolerate period. - ThreadpoolTimerWindow = "window" - // ThreadpoolTimerAbsolute indicates if the timer is absolute or relative. - ThreadpoolTimerAbsolute = "absolute" ) diff --git a/pkg/event/params/names_linux.go b/pkg/event/params/names_linux.go new file mode 100644 index 000000000..4d5acd049 --- /dev/null +++ b/pkg/event/params/names_linux.go @@ -0,0 +1,30 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package params + +const ( + // CloneFlags is the bitmask supplied to clone(2). + CloneFlags = "clone_flags" + // UID is the effective Linux user identifier. + UID = "uid" + // GID is the effective Linux group identifier. + GID = "gid" +) diff --git a/pkg/event/params/names_windows.go b/pkg/event/params/names_windows.go new file mode 100644 index 000000000..a457c1e10 --- /dev/null +++ b/pkg/event/params/names_windows.go @@ -0,0 +1,91 @@ +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package params + +const ( + NTStatus = "status" + ProcessObject = "kproc" + Callstack = "callstack" + CallstackTimestamp = "callstack_timestamp" + ProcessRealParentID = "real_ppid" + UserSID = "sid" + Domain = "domain" + DTB = "directory_table_base" + ProcessTokenIntegrityLevel = "token_integrity_level" + ProcessTokenElevationType = "token_elevation_type" + ProcessTokenIsElevated = "token_is_elevated" + DesiredAccess = "desired_access" + BasePrio = "base_prio" + IOPrio = "io_prio" + PagePrio = "page_prio" + KstackBase = "kstack" + KstackLimit = "kstack_limit" + UstackBase = "ustack" + UstackLimit = "ustack_limit" + StartAddress = "start_address" + StartAddressSymbol = "start_address_symbol" + StartAddressModule = "start_address_module" + TEB = "teb" + FileCreateOptions = "create_options" + FileOperation = "create_disposition" + FileShareMask = "share_mask" + FileAttributes = "attributes" + FileInfoClass = "class" + FileIrpPtr = "irp" + FileIsDLL = "is_dll" + FileIsDriver = "is_driver" + FileIsDotnet = "is_dotnet" + RegKeyHandle = "key_handle" + RegKCB = "kcb" + RegPath = "key_path" + RegValue = "value" + RegValueType = "value_type" + RegData = "data" + ModuleCheckSum = "checksum" + ModuleTimeDateStamp = "timedate_stamp" + ModuleDefaultBase = "default_address" + ModuleSignatureLevel = "signature_level" + ModuleSignatureType = "signature_type" + ModuleCertSubject = "cert_subject" + ModuleCertIssuer = "cert_issuer" + ModuleCertSerial = "cert_serial" + ModuleCertNotBefore = "cert_not_before" + ModuleCertNotAfter = "cert_not_after" + HandleID = "handle_id" + HandleSourceID = "handle_source_id" + HandleObject = "handle_object" + HandleObjectName = "handle_name" + HandleObjectTypeID = "type_id" + ThreadpoolPoolID = "pool_id" + ThreadpoolTaskID = "task_id" + ThreadpoolCallback = "callback" + ThreadpoolCallbackSymbol = "callback_symbol" + ThreadpoolCallbackModule = "callback_module" + ThreadpoolContext = "context" + ThreadpoolContextRip = "context_rip" + ThreadpoolContextRipSymbol = "context_rip_symbol" + ThreadpoolContextRipModule = "context_rip_module" + ThreadpoolSubprocessTag = "subprocess_tag" + ThreadpoolTimerDuetime = "duetime" + ThreadpoolTimerSubqueue = "subqueue" + ThreadpoolTimer = "timer" + ThreadpoolTimerPeriod = "period" + ThreadpoolTimerWindow = "window" + ThreadpoolTimerAbsolute = "absolute" +) diff --git a/pkg/event/params/param_types.go b/pkg/event/params/param_types.go index aec8c363d..094ff92f2 100644 --- a/pkg/event/params/param_types.go +++ b/pkg/event/params/param_types.go @@ -18,96 +18,47 @@ package params -// Type defines event parameter type +// Type defines an event parameter type. type Type uint16 const ( - // Null is a null parameter type - Null Type = iota - // UnicodeString a string of 16-bit characters. By default, assumed to have been encoded using UTF-16LE - UnicodeString - // AnsiString a string of 8-bit characters - AnsiString - // Int8 a signed 8-bit integer - Int8 - // Uint8 an unsigned 8-bit integer - Uint8 - // Int16 a signed 16-bit integer - Int16 - // Uint16 an unsigned 16-bit integer - Uint16 - // Int32 a signed 32-bit integer - Int32 - // Uint32 an unsigned 32-bit integer - Uint32 - // Int64 a signed 64-bit integer - Int64 - // Uint64 an unsigned 64-bit integer - Uint64 - // Float an IEEE 4-byte floating-point number - Float - // Double an IEEE 8-byte floating-point number - Double - // Bool a 32-bit value where 0 is false and 1 is true - Bool - // Binary is a binary data of variable size. The size must be specified in the data definition as a constant or a reference to another (integer) data item.For an IP V6 address, the data should be an IN6_ADDR structure. - // For a socket address, the data should be a SOCKADDR_STORAGE structure. The AF_INET, AF_INET6, and AF_LINK address families are supported - Binary - // GUID is a GUID structure. On output, the GUID is rendered in the registry string form, {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} - GUID - // Pointer an unsigned 32-bit or 64-bit pointer value. The size depends on the architecture of the computer logging the event - Pointer - // SID a security identifier (SID) structure that uniquely identifies a user or group - SID - // PID is the process identifier - PID - // TID is the thread identifier - TID - // WbemSID is the Web-Based Enterprise Management security identifier. - WbemSID - // Port represents the endpoint port number - Port - // IP is the IP address - IP - // IPv4 is the IPv4 address - IPv4 - // IPv6 is the IPv6 address - IPv6 - // Time represents the timestamp - Time - // Slice represents a collection of items - Slice - // Enum represents an enumeration - Enum - // Map represents a map - Map - // Object is the generic object type - Object - // DOSPath represents the file system path in DOS device notation - DOSPath - // Path represents the file system path with normalized drive letter notation - Path - // Status represents the system error code message - Status - // Key represents the registry key - Key - // Flags represents a bitmask of flags - Flags - // Flags64 represents an extended (64 bits) bitmask of flags - Flags64 - // Address is the memory address reference - Address - // HandleType represents the handle type such as Mutex or File - HandleType + Null Type = 0 + Int8 Type = 3 + Uint8 Type = 4 + Int16 Type = 5 + Uint16 Type = 6 + Int32 Type = 7 + Uint32 Type = 8 + Int64 Type = 9 + Uint64 Type = 10 + Float Type = 11 + Double Type = 12 + Bool Type = 13 + Binary Type = 14 + PID Type = 18 + TID Type = 19 + Port Type = 21 + IP Type = 22 + IPv4 Type = 23 + IPv6 Type = 24 + Time Type = 25 + Slice Type = 26 + Enum Type = 27 + Map Type = 28 + Object Type = 29 + Path Type = 31 + Status Type = 32 + Flags Type = 34 + Flags64 Type = 35 + Address Type = 36 ) -// String return the type string representation. +// String returns the type name. func (t Type) String() string { + if name := platformTypeString(t); name != "" { + return name + } switch t { - case UnicodeString: - return "unicode" - case AnsiString: - return "ansi" case Int8: return "int8" case Uint8: @@ -124,8 +75,6 @@ func (t Type) String() string { return "int64" case Uint64: return "uint64" - case SID, WbemSID: - return "sid" case TID: return "tid" case PID: diff --git a/pkg/event/params/types_linux.go b/pkg/event/params/types_linux.go new file mode 100644 index 000000000..a7c933239 --- /dev/null +++ b/pkg/event/params/types_linux.go @@ -0,0 +1,33 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package params + +const ( + // String is a UTF-8 encoded Linux string. + String Type = 1 +) + +func platformTypeString(t Type) string { + if t == String { + return "string" + } + return "" +} diff --git a/pkg/event/params/types_windows.go b/pkg/event/params/types_windows.go new file mode 100644 index 000000000..5a64fba36 --- /dev/null +++ b/pkg/event/params/types_windows.go @@ -0,0 +1,44 @@ +/* + * Copyright 2021-present by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package params + +const ( + UnicodeString Type = 1 + AnsiString Type = 2 + GUID Type = 15 + Pointer Type = 16 + SID Type = 17 + WbemSID Type = 20 + DOSPath Type = 30 + Key Type = 33 + HandleType Type = 37 +) + +func platformTypeString(t Type) string { + switch t { + case UnicodeString: + return "unicode" + case AnsiString: + return "ansi" + case SID, WbemSID: + return "sid" + default: + return "" + } +} diff --git a/pkg/event/pid_linux.go b/pkg/event/pid_linux.go index 340f0367a..a16deb920 100644 --- a/pkg/event/pid_linux.go +++ b/pkg/event/pid_linux.go @@ -22,3 +22,6 @@ package event // PID is the process identifier type on Linux (kernel PIDs are 64-bit). type PID = uint64 + +// TID is the thread identifier type on Linux (kernel thread IDs are 64-bit). +type TID = uint64 diff --git a/pkg/event/pid_windows.go b/pkg/event/pid_windows.go index a93a7dc04..835c23063 100644 --- a/pkg/event/pid_windows.go +++ b/pkg/event/pid_windows.go @@ -22,3 +22,6 @@ package event // PID is the process identifier type on Windows. type PID = uint32 + +// TID is the thread identifier type on Windows. +type TID = uint32 diff --git a/pkg/event/queue.go b/pkg/event/queue.go index f76460ca1..9055de150 100644 --- a/pkg/event/queue.go +++ b/pkg/event/queue.go @@ -43,9 +43,10 @@ type Listener interface { // Queue is the channel-backed data structure for // pushing captured events and invoking listeners. type Queue struct { + queuePlatform + q chan *Event listeners []Listener - decorator *StackwalkDecorator stackEnrichment bool enqueueAlways bool } @@ -58,7 +59,7 @@ func NewQueue(size int, stackEnrichment bool, enqueueAlways bool) *Queue { stackEnrichment: stackEnrichment, enqueueAlways: enqueueAlways, } - q.decorator = NewStackwalkDecorator(q) + q.initPlatform() return q } @@ -70,7 +71,7 @@ func NewQueueWithChannel(ch chan *Event, stackEnrichment bool, enqueueAlways boo stackEnrichment: stackEnrichment, enqueueAlways: enqueueAlways, } - q.decorator = NewStackwalkDecorator(q) + q.initPlatform() return q } @@ -84,7 +85,7 @@ func (q *Queue) RegisterListener(listener Listener) { func (q *Queue) Events() <-chan *Event { return q.q } // Close closes the queue disposing allocated resources. -func (q *Queue) Close() { q.decorator.Stop() } +func (q *Queue) Close() { q.closePlatform() } // Push pushes a new event to the channel. Prior to // sending the event to the channel, all registered @@ -107,20 +108,8 @@ func (q *Queue) Close() { q.decorator.Stop() } // enriched with callstack parameter and forwarded to the // event queue. func (q *Queue) Push(e *Event) error { - if q.stackEnrichment { - // store pending event for callstack enrichment - if e.Type.WaitStack() { - q.decorator.Push(e) - return nil - } - // decorate events with callstack return addresses - if e.IsStackWalk() { - e = q.decorator.Pop(e) - } - } - // drop stack walk events - if e.IsStackWalk() { - return nil + if handled, err := q.pushPlatform(e); handled || err != nil { + return err } return q.push(e) } diff --git a/pkg/event/queue_linux.go b/pkg/event/queue_linux.go new file mode 100644 index 000000000..76705f077 --- /dev/null +++ b/pkg/event/queue_linux.go @@ -0,0 +1,29 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +type queuePlatform struct{} + +func (q *Queue) initPlatform() {} + +func (q *Queue) closePlatform() {} + +func (q *Queue) pushPlatform(_ *Event) (bool, error) { return false, nil } diff --git a/pkg/event/flags_linux.go b/pkg/event/queue_linux_test.go similarity index 68% rename from pkg/event/flags_linux.go rename to pkg/event/queue_linux_test.go index f7d187755..d6fdbcb35 100644 --- a/pkg/event/flags_linux.go +++ b/pkg/event/queue_linux_test.go @@ -20,21 +20,17 @@ package event -import "strings" +import ( + "testing" -type ParamFlag struct { - Name string - Value uint64 -} + "github.com/stretchr/testify/require" +) -type ParamFlags []ParamFlag +func TestLinuxQueuePush(t *testing.T) { + queue := NewQueue(1, false, false) + t.Cleanup(queue.Close) -func (flags ParamFlags) String(value uint64) string { - var names []string - for _, flag := range flags { - if value&flag.Value == flag.Value { - names = append(names, flag.Name) - } - } - return strings.Join(names, "|") + event := &Event{Type: Execve, PID: 42, Tid: 43} + require.NoError(t, queue.Push(event)) + require.Same(t, event, <-queue.Events()) } diff --git a/pkg/event/queue_windows.go b/pkg/event/queue_windows.go new file mode 100644 index 000000000..9866c468f --- /dev/null +++ b/pkg/event/queue_windows.go @@ -0,0 +1,48 @@ +/* + * Copyright 2021-2022 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +type queuePlatform struct { + decorator *StackwalkDecorator +} + +func (q *Queue) initPlatform() { + q.decorator = NewStackwalkDecorator(q) +} + +func (q *Queue) closePlatform() { + q.decorator.Stop() +} + +func (q *Queue) pushPlatform(e *Event) (bool, error) { + if q.stackEnrichment { + if e.Type.CanEnrichStack() { + q.decorator.Push(e) + return true, nil + } + if e.IsStackWalk() { + q.decorator.Pop(e) + return true, nil + } + } + if e.IsStackWalk() { + return true, nil + } + return false, nil +} diff --git a/pkg/event/queue_test.go b/pkg/event/queue_windows_test.go similarity index 99% rename from pkg/event/queue_test.go rename to pkg/event/queue_windows_test.go index 7c4f9087a..c1ab2345b 100644 --- a/pkg/event/queue_test.go +++ b/pkg/event/queue_windows_test.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/stackwalk.go b/pkg/event/stackwalk_windows.go similarity index 99% rename from pkg/event/stackwalk.go rename to pkg/event/stackwalk_windows.go index 0c40daf8d..c6a7fb7ae 100644 --- a/pkg/event/stackwalk.go +++ b/pkg/event/stackwalk_windows.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/stackwalk_test.go b/pkg/event/stackwalk_windows_test.go similarity index 99% rename from pkg/event/stackwalk_test.go rename to pkg/event/stackwalk_windows_test.go index c624151a8..285070555 100644 --- a/pkg/event/stackwalk_test.go +++ b/pkg/event/stackwalk_windows_test.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2021-present by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/event/types_linux.go b/pkg/event/types_linux.go index 0513861e4..8bb9b7140 100644 --- a/pkg/event/types_linux.go +++ b/pkg/event/types_linux.go @@ -25,54 +25,66 @@ import ( "github.com/rabbitstack/fibratus/pkg/util/hashers" ) +// Source identifies a Linux event source. type Source uint8 const ( - SystemLogger Source = iota - SecurityTelemetryLogger + // RawSyscallTracepoint identifies events from the raw_syscalls tracepoint. + RawSyscallTracepoint Source = iota ) +// Type identifies a Linux event type. type Type uint16 const ( UnknownType Type = iota - CreateProcess Execve - TerminateProcess Exit - ProcessRundown Clone - - // Windows-only event types stubbed so shared consumers (rules compiler) - // compile on Linux. These are never emitted by the Linux event source. - RegOpenKey - OpenThread - OpenProcess - SetFileInformation - CreateFile - MapViewFile - UnmapViewFile - SetThreadContext - CreateSymbolicLinkObject - CreateThread ) +// String returns the event type name. func (t Type) String() string { - return TypeToEventInfo(t).Name + switch t { + case Execve: + return "execve" + case Exit: + return "exit" + case Clone: + return "clone" + default: + return "" + } } +// Category returns the event type category. func (t Type) Category() Category { - return TypeToEventInfo(t).Category + switch t { + case Execve, Exit, Clone: + return Process + default: + return Unknown + } } -func (t Type) Subcategory() Subcategory { - return None -} +// Subcategory returns the event type subcategory. +func (t Type) Subcategory() Subcategory { return None } +// Description returns a brief description of the event type. func (t Type) Description() string { - return TypeToEventInfo(t).Description + switch t { + case Execve: + return "Executes a program" + case Exit: + return "Exit all threads in a process" + case Clone: + return "Creates a child process or a thread" + default: + return "" + } } +// Hash calculates the hash of the event type name. func (t Type) Hash() uint32 { if t == UnknownType { return 0 @@ -80,18 +92,17 @@ func (t Type) Hash() uint32 { return hashers.FnvUint32([]byte(t.String())) } +// Exists reports whether the event type is known. func (t Type) Exists() bool { - return t != UnknownType && t.String() != "N/A" -} - -func (t Type) OnlyState() bool { - return t == ProcessRundown -} - -func (t Type) CanEnrichStack() bool { - return false + switch t { + case Execve, Exit, Clone: + return true + default: + return false + } } +// UnmarshalYAML converts an event name to its type. func (t *Type) UnmarshalYAML(unmarshal func(interface{}) error) error { var name string if err := unmarshal(&name); err != nil { @@ -101,13 +112,11 @@ func (t *Type) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -func (t Type) ID() uint { - return uint(t) -} +// ID returns the stable numeric event identifier. +func (t Type) ID() uint { return uint(t) } -func (t Type) Source() Source { - return SystemLogger -} +// Source returns the event source. +func (t Type) Source() Source { return RawSyscallTracepoint } func (t Type) color() string { return colorizer.SpanBold(colorizer.White, t.String()) From 88a2cfd63148ed80ee1d4080ca25d8b6921310e9 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 10 Aug 2026 23:36:40 +0200 Subject: [PATCH 25/65] refactor(rules): adapt filtering to platform event models Split field/accessor/function registries and compiler behavior by platform, remove Linux-only Windows stubs, and preserve Windows-specific tests behind file suffixes. Use platform PID types and add Linux compiler coverage. --- pkg/config/filters.go | 6 +- pkg/filter/accessor_linux.go | 23 +- pkg/filter/accessor_narrow_windows.go | 105 ----- pkg/filter/accessor_windows.go | 71 ++++ pkg/filter/accessor_windows_test.go | 19 +- pkg/filter/fields/defs.go | 359 ++---------------- pkg/filter/fields/defs_linux.go | 36 ++ pkg/filter/fields/defs_linux_test.go | 42 ++ pkg/filter/fields/defs_windows.go | 322 ++++++++++++++++ ...{filter_test.go => filter_windows_test.go} | 5 +- pkg/filter/ql/function.go | 100 +---- ...n_callstack_linux.go => function_linux.go} | 30 ++ ...llstack_windows.go => function_windows.go} | 113 ++++++ ...ction_test.go => function_windows_test.go} | 0 .../{base_test.go => base_windows_test.go} | 0 .../{dir_test.go => dir_windows_test.go} | 0 .../{glob_test.go => glob_windows_test.go} | 0 ...{is_abs_test.go => is_abs_windows_test.go} | 0 ...{volume_test.go => volume_windows_test.go} | 0 ...iteral_test.go => literal_windows_test.go} | 0 ...{parser_test.go => parser_windows_test.go} | 0 pkg/filter/util.go | 9 - .../get_reg_value_linux.go => util_linux.go} | 11 +- ...cessor_narrow_linux.go => util_windows.go} | 26 +- pkg/rules/action/kill_linux.go | 8 +- pkg/rules/action/kill_windows.go | 8 +- pkg/rules/compiler.go | 30 +- .../compiler_linux.go} | 24 +- pkg/rules/compiler_linux_test.go | 52 +++ pkg/rules/compiler_windows.go | 63 +++ ...piler_test.go => compiler_windows_test.go} | 0 ...{engine_test.go => engine_windows_test.go} | 0 pkg/rules/sequence.go | 4 +- ...uence_test.go => sequence_windows_test.go} | 0 34 files changed, 847 insertions(+), 619 deletions(-) delete mode 100644 pkg/filter/accessor_narrow_windows.go create mode 100644 pkg/filter/fields/defs_linux.go create mode 100644 pkg/filter/fields/defs_linux_test.go create mode 100644 pkg/filter/fields/defs_windows.go rename pkg/filter/{filter_test.go => filter_windows_test.go} (99%) rename pkg/filter/ql/{function_callstack_linux.go => function_linux.go} (62%) rename pkg/filter/ql/{function_callstack_windows.go => function_windows.go} (51%) rename pkg/filter/ql/{function_test.go => function_windows_test.go} (100%) rename pkg/filter/ql/functions/{base_test.go => base_windows_test.go} (100%) rename pkg/filter/ql/functions/{dir_test.go => dir_windows_test.go} (100%) rename pkg/filter/ql/functions/{glob_test.go => glob_windows_test.go} (100%) rename pkg/filter/ql/functions/{is_abs_test.go => is_abs_windows_test.go} (100%) rename pkg/filter/ql/functions/{volume_test.go => volume_windows_test.go} (100%) rename pkg/filter/ql/{literal_test.go => literal_windows_test.go} (100%) rename pkg/filter/ql/{parser_test.go => parser_windows_test.go} (100%) rename pkg/filter/{ql/functions/get_reg_value_linux.go => util_linux.go} (72%) rename pkg/filter/{accessor_narrow_linux.go => util_windows.go} (60%) rename pkg/{filter/ql/functions/minidump_linux.go => rules/compiler_linux.go} (56%) create mode 100644 pkg/rules/compiler_linux_test.go create mode 100644 pkg/rules/compiler_windows.go rename pkg/rules/{compiler_test.go => compiler_windows_test.go} (100%) rename pkg/rules/{engine_test.go => engine_windows_test.go} (100%) rename pkg/rules/{sequence_test.go => sequence_windows_test.go} (100%) diff --git a/pkg/config/filters.go b/pkg/config/filters.go index f5d23fa3b..e728d4d65 100644 --- a/pkg/config/filters.go +++ b/pkg/config/filters.go @@ -170,13 +170,13 @@ type ActionContext struct { // UniquePids returns a set of process identifiers // from each matched event to be used in actions // such as the process kill action. -func (ctx *ActionContext) UniquePids() []uint32 { - pids := make(map[uint32]struct{}) +func (ctx *ActionContext) UniquePids() []event.PID { + pids := make(map[event.PID]struct{}) for _, e := range ctx.Events { if e.IsCreateProcess() { pids[e.Params.MustGetPid()] = struct{}{} } else { - pids[uint32(e.PID)] = struct{}{} + pids[e.PID] = struct{}{} } } return convert.MapKeysToSlice(pids) diff --git a/pkg/filter/accessor_linux.go b/pkg/filter/accessor_linux.go index 069271f0d..432a11540 100644 --- a/pkg/filter/accessor_linux.go +++ b/pkg/filter/accessor_linux.go @@ -61,7 +61,7 @@ func (a *psAccessor) Get(f Field, e *event.Event) (params.Value, error) { return nil, ErrPsNil } return e.PS.Name, nil - case fields.PsComm, fields.PsCmdline: + case fields.PsCmdline: if e.PS == nil { return nil, ErrPsNil } @@ -115,3 +115,24 @@ func (a *psAccessor) Get(f Field, e *event.Event) (params.Value, error) { return nil, nil } } + +func (f *filter) pruneUnusedAccessors() { + removeEvtAccessor := true + removePsAccessor := true + + for _, field := range f.fields { + switch { + case field.Name.IsEvtField() || field.Name.IsKevtField(): + removeEvtAccessor = false + case field.Name.IsPsField(): + removePsAccessor = false + } + } + + if removeEvtAccessor { + f.removeAccessor(&evtAccessor{}) + } + if removePsAccessor { + f.removeAccessor(&psAccessor{}) + } +} diff --git a/pkg/filter/accessor_narrow_windows.go b/pkg/filter/accessor_narrow_windows.go deleted file mode 100644 index 239f17323..000000000 --- a/pkg/filter/accessor_narrow_windows.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build windows - -/* - * Copyright 2020-2021 by Nedim Sabic Sabic - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package filter - -func (f *filter) pruneUnusedAccessors() { - var ( - removeEvtAccessor = true - removePsAccessor = true - removeThreadAccessor = true - removeModuleAccessor = true - removeFileAccessor = true - removeRegistryAccessor = true - removeNetworkAccessor = true - removeHandleAccessor = true - removePEAccessor = true - removeMemAccessor = true - removeDNSAccessor = true - removeThreadpoolAccessor = true - ) - - for _, field := range f.fields { - switch { - case field.Name.IsEvtField() || field.Name.IsKevtField(): - removeEvtAccessor = false - case field.Name.IsPeField(): - removePEAccessor = false - case field.Name.IsPsField(): - removePsAccessor = false - case field.Name.IsThreadField(): - removeThreadAccessor = false - case field.Name.IsImageField() || field.Name.IsModuleField(): - removeModuleAccessor = false - case field.Name.IsFileField(): - removeFileAccessor = false - case field.Name.IsRegistryField(): - removeRegistryAccessor = false - case field.Name.IsNetworkField(): - removeNetworkAccessor = false - case field.Name.IsHandleField(): - removeHandleAccessor = false - case field.Name.IsMemField(): - removeMemAccessor = false - case field.Name.IsDNSField(): - removeDNSAccessor = false - case field.Name.IsThreadpoolField(): - removeThreadpoolAccessor = false - } - } - - if removeEvtAccessor { - f.removeAccessor(&evtAccessor{}) - } - if removePsAccessor { - f.removeAccessor(&psAccessor{}) - } - if removeThreadAccessor { - f.removeAccessor(&threadAccessor{}) - } - if removeModuleAccessor { - f.removeAccessor(&moduleAccessor{}) - } - if removeFileAccessor { - f.removeAccessor(&fileAccessor{}) - } - if removeRegistryAccessor { - f.removeAccessor(®istryAccessor{}) - } - if removeNetworkAccessor { - f.removeAccessor(&networkAccessor{}) - } - if removeHandleAccessor { - f.removeAccessor(&handleAccessor{}) - } - if removePEAccessor { - f.removeAccessor(&peAccessor{}) - } - if removeMemAccessor { - f.removeAccessor(&memAccessor{}) - } - if removeDNSAccessor { - f.removeAccessor(&dnsAccessor{}) - } - if removeThreadpoolAccessor { - f.removeAccessor(&threadpoolAccessor{}) - } -} diff --git a/pkg/filter/accessor_windows.go b/pkg/filter/accessor_windows.go index e39cd59ef..c1230d8bc 100644 --- a/pkg/filter/accessor_windows.go +++ b/pkg/filter/accessor_windows.go @@ -1261,3 +1261,74 @@ func (*dnsAccessor) Get(f Field, e *event.Event) (params.Value, error) { return nil, nil } + +func (f *filter) pruneUnusedAccessors() { + var ( + removeEvtAccessor = true + removePsAccessor = true + removeThreadAccessor = true + removeModuleAccessor = true + removeFileAccessor = true + removeRegistryAccessor = true + removeNetworkAccessor = true + removePEAccessor = true + removeMemAccessor = true + removeDNSAccessor = true + ) + + for _, field := range f.fields { + switch { + case field.Name.IsEvtField() || field.Name.IsKevtField(): + removeEvtAccessor = false + case field.Name.IsPeField(): + removePEAccessor = false + case field.Name.IsPsField(): + removePsAccessor = false + case field.Name.IsThreadField(): + removeThreadAccessor = false + case field.Name.IsImageField() || field.Name.IsModuleField(): + removeModuleAccessor = false + case field.Name.IsFileField(): + removeFileAccessor = false + case field.Name.IsRegistryField(): + removeRegistryAccessor = false + case field.Name.IsNetworkField(): + removeNetworkAccessor = false + case field.Name.IsMemField(): + removeMemAccessor = false + case field.Name.IsDNSField(): + removeDNSAccessor = false + } + } + + if removeEvtAccessor { + f.removeAccessor(&evtAccessor{}) + } + if removePsAccessor { + f.removeAccessor(&psAccessor{}) + } + if removeThreadAccessor { + f.removeAccessor(&threadAccessor{}) + } + if removeModuleAccessor { + f.removeAccessor(&moduleAccessor{}) + } + if removeFileAccessor { + f.removeAccessor(&fileAccessor{}) + } + if removeRegistryAccessor { + f.removeAccessor(®istryAccessor{}) + } + if removeNetworkAccessor { + f.removeAccessor(&networkAccessor{}) + } + if removePEAccessor { + f.removeAccessor(&peAccessor{}) + } + if removeMemAccessor { + f.removeAccessor(&memAccessor{}) + } + if removeDNSAccessor { + f.removeAccessor(&dnsAccessor{}) + } +} diff --git a/pkg/filter/accessor_windows_test.go b/pkg/filter/accessor_windows_test.go index 0035e7f52..7e2fc5056 100644 --- a/pkg/filter/accessor_windows_test.go +++ b/pkg/filter/accessor_windows_test.go @@ -71,6 +71,17 @@ func TestNarrowAccessors(t *testing.T) { assert.Len(t, pea.fields, 2) } +func eventWithCallstack(typ event.Type, category event.Category) *event.Event { + e := &event.Event{Type: typ} + e.Callstack = []callstack.Frame{{ + Addr: 0x7ffb5c1d0396, + Offset: 0x61, + Symbol: "CreateProcessW", + Module: "C:\\WINDOWS\\System32\\KERNELBASE.dll", + }} + return e +} + func TestIsFieldAccessible(t *testing.T) { var tests = []struct { a Accessor @@ -104,22 +115,22 @@ func TestIsFieldAccessible(t *testing.T) { }, { newThreadAccessor(), - &event.Event{Type: event.CreateProcess, Callstack: []callstack.Frame{{Addr: 0x7ffb5c1d0396, Offset: 0x61, Symbol: "CreateProcessW", Module: "C:\\WINDOWS\\System32\\KERNELBASE.dll"}}}, + eventWithCallstack(event.CreateProcess, event.Process), true, }, { newThreadAccessor(), - &event.Event{Type: event.RegSetValue, Callstack: []callstack.Frame{{Addr: 0x7ffb5c1d0396, Offset: 0x61, Symbol: "CreateProcessW", Module: "C:\\WINDOWS\\System32\\KERNELBASE.dll"}}}, + eventWithCallstack(event.RegSetValue, event.Registry), true, }, { newRegistryAccessor(), - &event.Event{Type: event.RegSetValue, Callstack: []callstack.Frame{{Addr: 0x7ffb5c1d0396, Offset: 0x61, Symbol: "CreateProcessW", Module: "C:\\WINDOWS\\System32\\KERNELBASE.dll"}}}, + eventWithCallstack(event.RegSetValue, event.Registry), true, }, { newNetworkAccessor(), - &event.Event{Type: event.RegSetValue, Callstack: []callstack.Frame{{Addr: 0x7ffb5c1d0396, Offset: 0x61, Symbol: "CreateProcessW", Module: "C:\\WINDOWS\\System32\\KERNELBASE.dll"}}}, + eventWithCallstack(event.RegSetValue, event.Registry), false, }, { diff --git a/pkg/filter/fields/defs.go b/pkg/filter/fields/defs.go index 5743682ce..cafd29eb6 100644 --- a/pkg/filter/fields/defs.go +++ b/pkg/filter/fields/defs.go @@ -904,15 +904,13 @@ func IsPseudoField(f Field) bool { func (f Field) IsPeSectionsPseudo() bool { return f == PeSections || f == PsPeSections } -var fields = map[Field]FieldInfo{ +var commonFields = map[Field]FieldInfo{ EvtSeq: {EvtSeq, "event sequence number", params.Uint64, []string{"evt.seq > 666"}, nil, nil}, - EvtPID: {EvtPID, "process identifier generating the event", params.Uint32, []string{"evt.pid = 6"}, nil, nil}, - EvtTID: {EvtTID, "thread identifier generating the event", params.Uint32, []string{"evt.tid = 1024"}, nil, nil}, EvtCPU: {EvtCPU, "logical processor core where the event was generated", params.Uint8, []string{"evt.cpu = 2"}, nil, nil}, - EvtName: {EvtName, "symbolical event name", params.AnsiString, []string{"evt.name = 'CreateThread'"}, nil, nil}, - EvtCategory: {EvtCategory, "event category", params.AnsiString, []string{"evt.category = 'registry'"}, nil, nil}, - EvtDesc: {EvtDesc, "event description", params.AnsiString, []string{"evt.desc contains 'Creates a new process'"}, nil, nil}, - EvtHost: {EvtHost, "host name on which the event was produced", params.UnicodeString, []string{"evt.host contains 'kitty'"}, nil, nil}, + EvtName: {EvtName, "symbolical event name", platformAnsiString(), []string{"evt.name = 'CreateThread'"}, nil, nil}, + EvtCategory: {EvtCategory, "event category", platformAnsiString(), []string{"evt.category = 'registry'"}, nil, nil}, + EvtDesc: {EvtDesc, "event description", platformAnsiString(), []string{"evt.desc contains 'Creates a new process'"}, nil, nil}, + EvtHost: {EvtHost, "host name on which the event was produced", platformString(), []string{"evt.host contains 'kitty'"}, nil, nil}, EvtTime: {EvtTime, "event timestamp as a time string", params.Time, []string{"evt.time = '17:05:32'"}, nil, nil}, EvtTimeHour: {EvtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"evt.time.h = 23"}, nil, nil}, EvtTimeMin: {EvtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"evt.time.m = 54"}, nil, nil}, @@ -922,9 +920,9 @@ var fields = map[Field]FieldInfo{ EvtDateDay: {EvtDateDay, "day of the month on which the event occurred", params.Time, []string{"evt.date.d = 12"}, nil, nil}, EvtDateMonth: {EvtDateMonth, "month of the year on which the event occurred", params.Time, []string{"evt.date.m = 11"}, nil, nil}, EvtDateYear: {EvtDateYear, "year on which the event occurred", params.Uint32, []string{"evt.date.y = 2020"}, nil, nil}, - EvtDateTz: {EvtDateTz, "time zone associated with the event timestamp", params.AnsiString, []string{"evt.date.tz = 'UTC'"}, nil, nil}, + EvtDateTz: {EvtDateTz, "time zone associated with the event timestamp", platformAnsiString(), []string{"evt.date.tz = 'UTC'"}, nil, nil}, EvtDateWeek: {EvtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"evt.date.week = 2"}, nil, nil}, - EvtDateWeekday: {EvtDateWeekday, "week day on which the event occurred", params.AnsiString, []string{"evt.date.weekday = 'Monday'"}, nil, nil}, + EvtDateWeekday: {EvtDateWeekday, "week day on which the event occurred", platformAnsiString(), []string{"evt.date.weekday = 'Monday'"}, nil, nil}, EvtNparams: {EvtNparams, "number of parameters", params.Int8, []string{"evt.nparams > 2"}, nil, nil}, EvtArg: {EvtArg, "event parameter", params.Object, []string{"evt.arg[cmdline] istartswith 'C:\\Windows'"}, nil, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { for _, c := range s { @@ -938,17 +936,12 @@ var fields = map[Field]FieldInfo{ } return true }}}, - EvtIsDirectSyscall: {EvtIsDirectSyscall, "indicates if the event is performing a direct syscall", params.Bool, []string{"evt.is_direct_syscall = true"}, nil, nil}, - EvtIsIndirectSyscall: {EvtIsIndirectSyscall, "indicates if the event is performing an indirect syscall", params.Bool, []string{"evt.is_indirect_syscall = true"}, nil, nil}, - KevtSeq: {KevtSeq, "event sequence number", params.Uint64, []string{"kevt.seq > 666"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtSeq}}, nil}, - KevtPID: {KevtPID, "process identifier generating the event", params.Uint32, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil}, - KevtTID: {KevtTID, "thread identifier generating the event", params.Uint32, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil}, KevtCPU: {KevtCPU, "logical processor core where the event was generated", params.Uint8, []string{"kevt.cpu = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCPU}}, nil}, - KevtName: {KevtName, "symbolical event name", params.AnsiString, []string{"kevt.name = 'CreateThread'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtName}}, nil}, - KevtCategory: {KevtCategory, "event category", params.AnsiString, []string{"kevt.category = 'registry'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCategory}}, nil}, - KevtDesc: {KevtDesc, "event description", params.AnsiString, []string{"kevt.desc contains 'Creates a new process'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDesc}}, nil}, - KevtHost: {KevtHost, "host name on which the event was produced", params.UnicodeString, []string{"kevt.host contains 'kitty'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtHost}}, nil}, + KevtName: {KevtName, "symbolical event name", platformAnsiString(), []string{"kevt.name = 'CreateThread'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtName}}, nil}, + KevtCategory: {KevtCategory, "event category", platformAnsiString(), []string{"kevt.category = 'registry'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCategory}}, nil}, + KevtDesc: {KevtDesc, "event description", platformAnsiString(), []string{"kevt.desc contains 'Creates a new process'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDesc}}, nil}, + KevtHost: {KevtHost, "host name on which the event was produced", platformString(), []string{"kevt.host contains 'kitty'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtHost}}, nil}, KevtTime: {KevtTime, "event timestamp as a time string", params.Time, []string{"kevt.time = '17:05:32'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTime}}, nil}, KevtTimeHour: {KevtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"kevt.time.h = 23"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeHour}}, nil}, KevtTimeMin: {KevtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"kevt.time.m = 54"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeMin}}, nil}, @@ -958,9 +951,9 @@ var fields = map[Field]FieldInfo{ KevtDateDay: {KevtDateDay, "day of the month on which the event occurred", params.Time, []string{"kevt.date.d = 12"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateDay}}, nil}, KevtDateMonth: {KevtDateMonth, "month of the year on which the event occurred", params.Time, []string{"kevt.date.m = 11"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateMonth}}, nil}, KevtDateYear: {KevtDateYear, "year on which the event occurred", params.Uint32, []string{"kevt.date.y = 2020"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateYear}}, nil}, - KevtDateTz: {KevtDateTz, "time zone associated with the event timestamp", params.AnsiString, []string{"kevt.date.tz = 'UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateTz}}, nil}, + KevtDateTz: {KevtDateTz, "time zone associated with the event timestamp", platformAnsiString(), []string{"kevt.date.tz = 'UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateTz}}, nil}, KevtDateWeek: {KevtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"kevt.date.week = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeek}}, nil}, - KevtDateWeekday: {KevtDateWeekday, "week day on which the event occurred", params.AnsiString, []string{"kevt.date.weekday = 'Monday'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeekday}}, nil}, + KevtDateWeekday: {KevtDateWeekday, "week day on which the event occurred", platformAnsiString(), []string{"kevt.date.weekday = 'Monday'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeekday}}, nil}, KevtNparams: {KevtNparams, "number of parameters", params.Int8, []string{"kevt.nparams > 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtNparams}}, nil}, KevtArg: {KevtArg, "event parameter", params.Object, []string{"kevt.arg[cmdline] istartswith 'C:\\Windows'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtArg}}, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { for _, c := range s { @@ -974,313 +967,27 @@ var fields = map[Field]FieldInfo{ } return true }}}, + PsName: {PsName, "process image name including the file extension", platformString(), []string{"ps.name contains 'firefox'"}, nil, nil}, + PsCmdline: {PsCmdline, "process command line", platformString(), []string{"ps.cmdline contains 'java'"}, nil, nil}, + PsExe: {PsExe, "full name of the process' executable", platformString(), []string{"ps.exe = 'C:\\Windows\\system32\\cmd.exe'"}, nil, nil}, + PsArgs: {PsArgs, "process command line arguments", params.Slice, []string{"ps.args in ('/cdir', '/-C')"}, nil, nil}, + PsCwd: {PsCwd, "process current working directory", platformString(), []string{"ps.cwd = 'C:\\Users\\Default'"}, nil, nil}, + PsUsername: {PsUsername, "process username", platformString(), []string{"ps.username contains 'system'"}, nil, nil}, + PsEnvs: {PsEnvs, "process environment variables", params.Slice, []string{"ps.envs in ('SystemRoot:C:\\WINDOWS')", "ps.envs[windir] = 'C:\\WINDOWS'"}, nil, &Argument{Optional: true, ValidationFunc: func(arg string) bool { return true }}}, + PsParentName: {PsParentName, "parent process image name including the file extension", platformString(), []string{"ps.parent.name contains 'cmd.exe'"}, nil, nil}, + PsParentCmdline: {PsParentCmdline, "parent process command line", platformString(), []string{"ps.parent.cmdline contains 'java'"}, nil, nil}, + PsParentExe: {PsParentExe, "full name of the parent process' executable", platformString(), []string{"ps.parent.exe = 'C:\\Windows\\system32\\explorer.exe'"}, nil, nil}, +} - PsPid: {PsPid, "process identifier", params.PID, []string{"ps.pid = 1024"}, nil, nil}, - PsPpid: {PsPpid, "parent process identifier", params.PID, []string{"ps.ppid = 45"}, nil, nil}, - PsName: {PsName, "process image name including the file extension", params.UnicodeString, []string{"ps.name contains 'firefox'"}, nil, nil}, - PsComm: {PsComm, "process command line", params.UnicodeString, []string{"ps.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsCmdline}}, nil}, - PsCmdline: {PsCmdline, "process command line", params.UnicodeString, []string{"ps.cmdline contains 'java'"}, nil, nil}, - PsExe: {PsExe, "full name of the process' executable", params.UnicodeString, []string{"ps.exe = 'C:\\Windows\\system32\\cmd.exe'"}, nil, nil}, - PsArgs: {PsArgs, "process command line arguments", params.Slice, []string{"ps.args in ('/cdir', '/-C')"}, nil, nil}, - PsCwd: {PsCwd, "process current working directory", params.UnicodeString, []string{"ps.cwd = 'C:\\Users\\Default'"}, nil, nil}, - PsSID: {PsSID, "security identifier under which this process is run", params.UnicodeString, []string{"ps.sid contains 'SYSTEM'"}, nil, nil}, - PsSessionID: {PsSessionID, "unique identifier for the current session", params.Int16, []string{"ps.sessionid = 1"}, nil, nil}, - PsDomain: {PsDomain, "process domain", params.UnicodeString, []string{"ps.domain contains 'SERVICE'"}, nil, nil}, - PsUsername: {PsUsername, "process username", params.UnicodeString, []string{"ps.username contains 'system'"}, nil, nil}, - PsEnvs: {PsEnvs, "process environment variables", params.Slice, []string{"ps.envs in ('SystemRoot:C:\\WINDOWS')", "ps.envs[windir] = 'C:\\WINDOWS'"}, nil, &Argument{Optional: true, ValidationFunc: func(arg string) bool { return true }}}, - PsHandleNames: {PsHandleNames, "allocated process handle names", params.Slice, []string{"ps.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, - PsHandleTypes: {PsHandleTypes, "allocated process handle types", params.Slice, []string{"ps.handle.types in ('Key', 'Mutant', 'Section')"}, nil, nil}, - PsDTB: {PsDTB, "process directory table base address", params.Address, []string{"ps.dtb = '7ffe0000'"}, nil, nil}, - PsModuleNames: {PsModuleNames, "modules loaded by the process", params.Slice, []string{"ps.modules in ('crypt32.dll', 'xul.dll')"}, nil, nil}, - PsParentName: {PsParentName, "parent process image name including the file extension", params.UnicodeString, []string{"ps.parent.name contains 'cmd.exe'"}, nil, nil}, - PsParentPid: {PsParentPid, "parent process id", params.Uint32, []string{"ps.parent.pid = 4"}, nil, nil}, - PsParentComm: {PsParentComm, "parent process command line", params.UnicodeString, []string{"ps.parent.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsParentCmdline}}, nil}, - PsParentCmdline: {PsParentCmdline, "parent process command line", params.UnicodeString, []string{"ps.parent.cmdline contains 'java'"}, nil, nil}, - PsParentExe: {PsParentExe, "full name of the parent process' executable", params.UnicodeString, []string{"ps.parent.exe = 'C:\\Windows\\system32\\explorer.exe'"}, nil, nil}, - PsParentArgs: {PsParentArgs, "parent process command line arguments", params.Slice, []string{"ps.parent.args in ('/cdir', '/-C')"}, nil, nil}, - PsParentCwd: {PsParentCwd, "parent process current working directory", params.UnicodeString, []string{"ps.parent.cwd = 'C:\\Temp'"}, nil, nil}, - PsParentSID: {PsParentSID, "security identifier under which the parent process is run", params.UnicodeString, []string{"ps.parent.sid contains 'SYSTEM'"}, nil, nil}, - PsParentDomain: {PsParentDomain, "parent process domain", params.UnicodeString, []string{"ps.parent.domain contains 'SERVICE'"}, nil, nil}, - PsParentUsername: {PsParentUsername, "parent process username", params.UnicodeString, []string{"ps.parent.username contains 'system'"}, nil, nil}, - PsParentSessionID: {PsParentSessionID, "unique identifier for the current session of parent process", params.Int16, []string{"ps.parent.sessionid = 1"}, nil, nil}, - PsParentEnvs: {PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('MOZ_CRASHREPORTER_DATA_DIRECTORY')"}, nil, nil}, - PsParentHandles: {PsParentHandles, "allocated parent process handle names", params.Slice, []string{"ps.parent.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, - PsParentHandleTypes: {PsParentHandleTypes, "allocated parent process handle types", params.Slice, []string{"ps.parent.handle.types in ('File', 'SymbolicLink')"}, nil, nil}, - PsParentDTB: {PsParentDTB, "parent process directory table base address", params.Address, []string{"ps.parent.dtb = '7ffe0000'"}, nil, nil}, - PsAccessMask: {PsAccessMask, "process desired access rights", params.AnsiString, []string{"ps.access.mask = '0x1400'"}, nil, nil}, - PsAccessMaskNames: {PsAccessMaskNames, "process desired access rights as a string list", params.Slice, []string{"ps.access.mask.names in ('SUSPEND_RESUME')"}, nil, nil}, - PsAccessStatus: {PsAccessStatus, "process access status", params.UnicodeString, []string{"ps.access.status = 'access is denied.'"}, nil, nil}, - PsUUID: {PsUUID, "unique process identifier", params.Uint64, []string{"ps.uuid > 6000054355"}, nil, nil}, - PsParentUUID: {PsParentUUID, "unique parent process identifier", params.Uint64, []string{"ps.parent.uuid > 6000054355"}, nil, nil}, - PsIsWOW64Field: {PsIsWOW64Field, "indicates if the process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.is_wow64"}, nil, nil}, - PsIsPackagedField: {PsIsPackagedField, "indicates if the process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.is_packaged"}, nil, nil}, - PsIsProtectedField: {PsIsProtectedField, "indicates if the process generating the event is a protected process", params.Bool, []string{"ps.is_protected"}, nil, nil}, - PsParentIsWOW64Field: {PsParentIsWOW64Field, "indicates if the parent process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.parent.is_wow64"}, nil, nil}, - PsParentIsPackagedField: {PsParentIsPackagedField, "indicates if the parent process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.parent.is_packaged"}, nil, nil}, - PsParentIsProtectedField: {PsParentIsProtectedField, "indicates if the the parent process generating the event is a protected process", params.Bool, []string{"ps.parent.is_protected"}, nil, nil}, - PsAncestor: {PsAncestor, "the process ancestor name", params.UnicodeString, []string{"ps.ancestor[1] = 'svchost.exe'", "ps.ancestor in ('winword.exe')"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, - PsTokenIntegrityLevel: {PsTokenIntegrityLevel, "process token integrity level", params.UnicodeString, []string{"ps.token.integrity_level = 'SYSTEM'"}, nil, nil}, - PsTokenIsElevated: {PsTokenIsElevated, "indicates if the process token is elevated", params.Bool, []string{"ps.token.is_elevated = true"}, nil, nil}, - PsTokenElevationType: {PsTokenElevationType, "process token elevation type", params.AnsiString, []string{"ps.token.elevation_type = 'LIMITED'"}, nil, nil}, - PsParentTokenIntegrityLevel: {PsParentTokenIntegrityLevel, "parent process token integrity level", params.UnicodeString, []string{"ps.parent.token.integrity_level = 'HIGH'"}, nil, nil}, - PsParentTokenIsElevated: {PsParentTokenIsElevated, "indicates if the parent process token is elevated", params.Bool, []string{"ps.parent.token.is_elevated = true"}, nil, nil}, - PsParentTokenElevationType: {PsParentTokenElevationType, "parent process token elevation type", params.AnsiString, []string{"ps.parent.token.elevation_type = 'LIMITED'"}, nil, nil}, - PsSignatureExists: {PsSignatureExists, "indicates if the process executable has a valid signature", params.Bool, []string{"ps.signature.exists"}, nil, nil}, - PsSignatureTrusted: {PsSignatureTrusted, "indicates if the process executable signature certificate chain is trusted", params.Bool, []string{"ps.signature.trusted"}, nil, nil}, - PsSignatureSerial: {PsSignatureSerial, "represents signature serial number", params.UnicodeString, []string{"ps.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, - PsSignatureSubject: {PsSignatureSubject, "represents signature subject", params.UnicodeString, []string{"ps.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - PsSignatureIssuer: {PsSignatureIssuer, "represents signature CA", params.UnicodeString, []string{"ps.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - PsSignatureAfter: {PsSignatureAfter, "represents certificate expiration date", params.Time, []string{"ps.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - PsSignatureBefore: {PsSignatureBefore, "represents certificate enrollment date", params.Time, []string{"ps.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - - PsPeNumSections: {PsPeNumSections, "number of PE sections", params.Uint16, []string{"ps.pe.nsections < 5"}, nil, nil}, - PsPeNumSymbols: {PsPeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"ps.pe.nsymbols > 230"}, nil, nil}, - PsPeBaseAddress: {PsPeBaseAddress, "executable base address", params.Address, []string{"ps.pe.address.base = '140000000'"}, nil, nil}, - PsPeEntrypoint: {PsPeEntrypoint, "address of the entrypoint function", params.Address, []string{"ps.pe.address.entrypoint = '20110'"}, nil, nil}, - PsPeSymbols: {PsPeSymbols, "imported symbols", params.Slice, []string{"ps.pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, nil, nil}, - PsPeImports: {PsPeImports, "imported dynamic linked libraries", params.Slice, []string{"ps.pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, nil, nil}, - PsPeResources: {PsPeResources, "version resources", params.Map, []string{"ps.pe.resources[FileDescription] = 'Notepad'"}, nil, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { - for _, c := range s { - switch { - case unicode.IsLower(c): - case unicode.IsUpper(c): - case unicode.IsNumber(c): - case c == '_': - default: - return false - } - } - return true - }}}, - PsPeCompany: {PsPeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.company = 'Microsoft Corporation'"}, nil, nil}, - PsPeCopyright: {PsPeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"ps.pe.copyright = '© Microsoft Corporation'"}, nil, nil}, - PsPeDescription: {PsPeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.description = 'Notepad'"}, nil, nil}, - PsPeFileName: {PsPeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.name = 'NOTEPAD.EXE'"}, nil, nil}, - PsPeFileVersion: {PsPeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, nil, nil}, - PsPeProduct: {PsPeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product = 'Microsoft® Windows® Operating System'"}, nil, nil}, - PsPeProductVersion: {PsPeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product.version = '10.0.18362.693'"}, nil, nil}, - PsPeImphash: {PsPeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, nil, nil}, - PsPeIsDotnet: {PsPeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"ps.pe.is_dotnet"}, nil, nil}, - PsPeAnomalies: {PsPeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"ps.pe.anomalies in ('number of sections is 0')"}, nil, nil}, - PsPeIsModified: {PsPeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"ps.pe.is_modified"}, nil, nil}, - - ThreadBasePrio: {ThreadBasePrio, "scheduler priority of the thread", params.Int8, []string{"thread.prio = 5"}, nil, nil}, - ThreadIOPrio: {ThreadIOPrio, "I/O priority hint for scheduling I/O operations", params.Int8, []string{"thread.io.prio = 4"}, nil, nil}, - ThreadPagePrio: {ThreadPagePrio, "memory page priority hint for memory pages accessed by the thread", params.Int8, []string{"thread.page.prio = 12"}, nil, nil}, - ThreadKstackBase: {ThreadKstackBase, "base address of the thread's kernel space stack", params.Address, []string{"thread.kstack.base = 'a65d800000'"}, nil, nil}, - ThreadKstackLimit: {ThreadKstackLimit, "limit of the thread's kernel space stack", params.Address, []string{"thread.kstack.limit = 'a85d800000'"}, nil, nil}, - ThreadUstackBase: {ThreadUstackBase, "base address of the thread's user space stack", params.Address, []string{"thread.ustack.base = '7ffe0000'"}, nil, nil}, - ThreadUstackLimit: {ThreadUstackLimit, "limit of the thread's user space stack", params.Address, []string{"thread.ustack.limit = '8ffe0000'"}, nil, nil}, - ThreadEntrypoint: {ThreadEntrypoint, "starting address of the function to be executed by the thread", params.Address, []string{"thread.entrypoint = '7efe0000'"}, &Deprecation{Since: "2.3.0", Fields: []Field{ThreadStartAddress}}, nil}, - ThreadStartAddress: {ThreadStartAddress, "thread start address", params.Address, []string{"thread.start_address = '7efe0000'"}, nil, nil}, - ThreadStartAddressSymbol: {ThreadStartAddressSymbol, "thread start address symbol", params.UnicodeString, []string{"thread.start_address.symbol = 'LoadModule'"}, nil, nil}, - ThreadStartAddressModule: {ThreadStartAddressModule, "thread start address module", params.UnicodeString, []string{"thread.start_address.module endswith 'kernel32.dll'"}, nil, nil}, - ThreadPID: {ThreadPID, "the process identifier where the thread is created", params.Uint32, []string{"evt.pid != thread.pid"}, nil, nil}, - ThreadTEB: {ThreadTEB, "the base address of the thread environment block", params.Address, []string{"thread.teb_address = '8f30893000'"}, nil, nil}, - ThreadAccessMask: {ThreadAccessMask, "thread desired access rights", params.AnsiString, []string{"thread.access.mask = '0x1fffff'"}, nil, nil}, - ThreadAccessMaskNames: {ThreadAccessMaskNames, "thread desired access rights as a string list", params.Slice, []string{"thread.access.mask.names in ('IMPERSONATE')"}, nil, nil}, - ThreadAccessStatus: {ThreadAccessStatus, "thread access status", params.UnicodeString, []string{"thread.access.status = 'success'"}, nil, nil}, - ThreadCallstackSummary: {ThreadCallstackSummary, "callstack summary", params.UnicodeString, []string{"thread.callstack.summary contains 'ntdll.dll|KERNELBASE.dll'"}, nil, nil}, - ThreadCallstackKernelSummary: {ThreadCallstackKernelSummary, "kernel thread callstack summary", params.UnicodeString, []string{"thread.callstack.kernel_summary contains 'fileinfo.sys|ntoskrnl.exe|FLTMGR.SYS|ntoskrnl.exe'"}, nil, nil}, - ThreadCallstackDetail: {ThreadCallstackDetail, "detailed information of each stack frame", params.UnicodeString, []string{"thread.callstack.detail contains 'KERNELBASE.dll!CreateProcessW'"}, nil, nil}, - ThreadCallstackModules: {ThreadCallstackModules, "list of modules comprising the callstack", params.Slice, []string{"thread.callstack.modules in ('C:\\WINDOWS\\System32\\KERNELBASE.dll')", "base(thread.callstack.modules[7]) = 'ntdll.dll'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, - ThreadCallstackSymbols: {ThreadCallstackSymbols, "list of symbols comprising the callstack", params.Slice, []string{"thread.callstack.symbols in ('ntdll.dll!NtCreateProcess')", "thread.callstack.symbols[3] = 'ntdll!NtCreateProcess'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, - ThreadCallstackAllocationSizes: {ThreadCallstackAllocationSizes, "allocation sizes of private pages", params.Slice, []string{"thread.callstack.allocation_sizes > 10000"}, nil, nil}, - ThreadCallstackProtections: {ThreadCallstackProtections, "page protections masks of each frame", params.Slice, []string{"thread.callstack.protections in ('RWX', 'WX')"}, nil, nil}, - ThreadCallstackCallsiteLeadingAssembly: {ThreadCallstackCallsiteLeadingAssembly, "callsite leading assembly instructions", params.Slice, []string{"thread.callstack.callsite_leading_assembly in ('mov r10,rcx', 'syscall')"}, nil, nil}, - ThreadCallstackCallsiteTrailingAssembly: {ThreadCallstackCallsiteTrailingAssembly, "callsite trailing assembly instructions", params.Slice, []string{"thread.callstack.callsite_trailing_assembly in ('add esp, 0xab')"}, nil, nil}, - ThreadCallstackIsUnbacked: {ThreadCallstackIsUnbacked, "indicates if the callstack contains unbacked regions", params.Bool, []string{"thread.callstack.is_unbacked"}, nil, nil}, - ThreadCallstackAddresses: {ThreadCallstackAddresses, "list of all stack return addresses", params.Slice, []string{"thread.callstack.addresses in ('7ffb5c1d0396')"}, nil, nil}, - ThreadCallstackFinalUserModuleName: {ThreadCallstackFinalUserModuleName, "final user space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_user_module.name != 'ntdll.dll'"}, nil, nil}, - ThreadCallstackFinalUserModulePath: {ThreadCallstackFinalUserModulePath, "final user space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_user_module.path imatches '?:\\Windows\\System32\\ntdll.dll'"}, nil, nil}, - ThreadCallstackFinalUserSymbolName: {ThreadCallstackFinalUserSymbolName, "final user space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_user_symbol.name imatches 'CreateProcess*'"}, nil, nil}, - ThreadCallstackFinalKernelModuleName: {ThreadCallstackFinalKernelModuleName, "final kernel space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_kernel_module.name = 'FLTMGR.SYS'"}, nil, nil}, - ThreadCallstackFinalKernelModulePath: {ThreadCallstackFinalKernelModulePath, "final kernel space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_kernel_module.path imatches '?:\\WINDOWS\\System32\\drivers\\FLTMGR.SYS'"}, nil, nil}, - ThreadCallstackFinalKernelSymbolName: {ThreadCallstackFinalKernelSymbolName, "final kernel space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_kernel_symbol.name = 'FltGetStreamContext'"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureExists: {ThreadCallstackFinalUserModuleSignatureExists, "signature status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.exists = true"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureTrusted: {ThreadCallstackFinalUserModuleSignatureTrusted, "signature trust status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.trusted = true"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureIssuer: {ThreadCallstackFinalUserModuleSignatureIssuer, "final user space stack frame module signature certificate issuer", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.issuer imatches '*Microsoft Corporation*'"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureSubject: {ThreadCallstackFinalUserModuleSignatureSubject, "final user space stack frame module signature certificate subject", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.subject imatches '*Microsoft Windows*'"}, nil, nil}, - - ImagePath: {ImagePath, "full image path", params.UnicodeString, []string{"image.path = 'C:\\Windows\\System32\\advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePath}}, nil}, - ImageName: {ImageName, "image name", params.UnicodeString, []string{"image.name = 'advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleName}}, nil}, - ImageBase: {ImageBase, "the base address of process in which the image is loaded", params.Address, []string{"image.base.address = 'a65d800000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleBase}}, nil}, - ImageChecksum: {ImageChecksum, "image checksum", params.Uint32, []string{"image.checksum = 746424"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleChecksum}}, nil}, - ImageSize: {ImageSize, "image size", params.Uint32, []string{"image.size > 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSize}}, nil}, - ImageDefaultAddress: {ImageDefaultAddress, "default image address", params.Address, []string{"image.default.address = '7efe0000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleDefaultAddress}}, nil}, - ImagePID: {ImagePID, "target process identifier", params.Uint32, []string{"image.pid = 80"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePID}}, nil}, - ImageSignatureType: {ImageSignatureType, "image signature type", params.AnsiString, []string{"image.signature.type != 'NONE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureType}}, nil}, - ImageSignatureLevel: {ImageSignatureLevel, "image signature level", params.AnsiString, []string{"image.signature.level = 'AUTHENTICODE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureLevel}}, nil}, - ImageCertSerial: {ImageCertSerial, "image certificate serial number", params.UnicodeString, []string{"image.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSerial}}, nil}, - ImageCertSubject: {ImageCertSubject, "image certificate subject", params.UnicodeString, []string{"image.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSubject}}, nil}, - ImageCertIssuer: {ImageCertIssuer, "image certificate CA", params.UnicodeString, []string{"image.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureIssuer}}, nil}, - ImageCertAfter: {ImageCertAfter, "image certificate expiration date", params.Time, []string{"image.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureAfter}}, nil}, - ImageCertBefore: {ImageCertBefore, "image certificate enrollment date", params.Time, []string{"image.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureBefore}}, nil}, - ImageIsDLL: {ImageIsDLL, "indicates if the loaded image is a DLL", params.Bool, []string{"image.is_dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDLL}}, nil}, - ImageIsDriver: {ImageIsDriver, "indicates if the loaded image is a driver", params.Bool, []string{"image.is_driver'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDriver}}, nil}, - ImageIsExecutable: {ImageIsExecutable, "indicates if the loaded image is an executable", params.Bool, []string{"image.is_exec'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsExecutable}}, nil}, - ImageIsDotnet: {ImageIsDotnet, "indicates if the loaded image is a .NET assembly", params.Bool, []string{"image.is_dotnet'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDotnet}}, nil}, - ModulePath: {ModulePath, "full module path", params.UnicodeString, []string{"module.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, - ModulePathStem: {ModulePathStem, "module path stem", params.UnicodeString, []string{"module.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, - ModuleName: {ModuleName, "module name", params.UnicodeString, []string{"module.name = 'advapi32.dll'"}, nil, nil}, - ModuleBase: {ModuleBase, "the base address of process in which the module is loaded", params.Address, []string{"module.base.address = 'a65d800000'"}, nil, nil}, - ModuleChecksum: {ModuleChecksum, "module checksum", params.Uint32, []string{"module.checksum = 746424"}, nil, nil}, - ModuleSize: {ModuleSize, "module size", params.Uint32, []string{"module.size > 1024"}, nil, nil}, - ModuleDefaultAddress: {ModuleDefaultAddress, "default module address", params.Address, []string{"module.default_address = '7efe0000'"}, nil, nil}, - ModulePID: {ModulePID, "target process identifier", params.Uint32, []string{"module.pid = 80"}, nil, nil}, - ModuleSignatureType: {ModuleSignatureType, "module signature type", params.AnsiString, []string{"module.signature.type != 'NONE'"}, nil, nil}, - ModuleSignatureLevel: {ModuleSignatureLevel, "module signature level", params.AnsiString, []string{"module.signature.level = 'AUTHENTICODE'"}, nil, nil}, - ModuleSignatureExists: {ModuleSignatureExists, "indicates if the module is signed", params.Bool, []string{"module.signature.exists = true"}, nil, nil}, - ModuleSignatureTrusted: {ModuleSignatureTrusted, "indicates if the module signature is trusted", params.Bool, []string{"module.signature.trusted = false"}, nil, nil}, - ModuleSignatureSerial: {ModuleSignatureSerial, "module certificate serial number", params.UnicodeString, []string{"module.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, - ModuleSignatureSubject: {ModuleSignatureSubject, "module certificate subject", params.UnicodeString, []string{"module.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - ModuleSignatureIssuer: {ModuleSignatureIssuer, "module certificate CA", params.UnicodeString, []string{"module.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - ModuleSignatureAfter: {ModuleSignatureAfter, "module certificate expiration date", params.Time, []string{"module.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - ModuleSignatureBefore: {ModuleSignatureBefore, "module certificate enrollment date", params.Time, []string{"module.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - ModuleIsDLL: {ModuleIsDLL, "indicates if the loaded module is a DLL", params.Bool, []string{"module.is_dll'"}, nil, nil}, - ModuleIsDriver: {ModuleIsDriver, "indicates if the loaded module is a driver", params.Bool, []string{"module.is_driver'"}, nil, nil}, - ModuleIsExecutable: {ModuleIsExecutable, "indicates if the loaded module is an executable", params.Bool, []string{"module.is_exec'"}, nil, nil}, - ModuleIsDotnet: {ModuleIsDotnet, "indicates if the loaded module is a .NET assembly", params.Bool, []string{"module.pe.is_dotnet'"}, nil, nil}, - DllPath: {DllPath, "full dll path", params.UnicodeString, []string{"dll.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, - DllPathStem: {DllPathStem, "dll path stem", params.UnicodeString, []string{"dll.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, - DllName: {DllName, "module name", params.UnicodeString, []string{"dll.name = 'advapi32.dll'"}, nil, nil}, - DllBase: {DllBase, "the base address of process in which the DLL is loaded", params.Address, []string{"dll.base = 'a65d800000'"}, nil, nil}, - DllSize: {DllSize, "dll virtual mapped size", params.Uint32, []string{"dll.size > 1024"}, nil, nil}, - DllPID: {DllPID, "target process identifier", params.Uint32, []string{"dll.pid = 80"}, nil, nil}, - DllSignatureType: {DllSignatureType, "dll signature type", params.AnsiString, []string{"dll.signature.type != 'NONE'"}, nil, nil}, - DllSignatureLevel: {DllSignatureLevel, "dll signature level", params.AnsiString, []string{"dll.signature.level = 'AUTHENTICODE'"}, nil, nil}, - DllSignatureExists: {DllSignatureExists, "indicates if the dll is signed", params.Bool, []string{"dll.signature.exists = true"}, nil, nil}, - DllSignatureTrusted: {DllSignatureTrusted, "indicates if the dll signature is trusted", params.Bool, []string{"dll.signature.trusted = false"}, nil, nil}, - DllSignatureSerial: {DllSignatureSerial, "dll certificate serial number", params.UnicodeString, []string{"dll.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, - DllSignatureSubject: {DllSignatureSubject, "dll certificate subject", params.UnicodeString, []string{"dll.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - DllSignatureIssuer: {DllSignatureIssuer, "dll certificate CA", params.UnicodeString, []string{"dll.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - DllSignatureAfter: {DllSignatureAfter, "moddllule certificate expiration date", params.Time, []string{"dll.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - DllSignatureBefore: {DllSignatureBefore, "dll certificate enrollment date", params.Time, []string{"dll.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - DllIsDotnet: {DllIsDotnet, "indicates if the loaded dll is a .NET assembly", params.Bool, []string{"dll.pe.is_dotnet'"}, nil, nil}, - - FileObject: {FileObject, "file object address", params.Uint64, []string{"file.object = 18446738026482168384"}, nil, nil}, - FilePath: {FilePath, "full file path", params.UnicodeString, []string{"file.path = 'C:\\Windows\\System32'"}, nil, nil}, - FilePathStem: {FilePathStem, "full file path without extension", params.UnicodeString, []string{"file.path.stem = 'C:\\Windows\\System32\\cmd'"}, nil, nil}, - FileName: {FileName, "full file name", params.UnicodeString, []string{"file.name contains 'mimikatz'"}, nil, nil}, - FileOperation: {FileOperation, "file operation", params.AnsiString, []string{"file.operation = 'open'"}, nil, nil}, - FileShareMask: {FileShareMask, "file share mask", params.AnsiString, []string{"file.share.mask = 'READ'"}, &Deprecation{Since: "3.1.0", Fields: []Field{FileShareMode}}, nil}, - FileShareMode: {FileShareMask, "file share mode", params.AnsiString, []string{"file.share_mode = 'DENY'"}, nil, nil}, - FileIOSize: {FileIOSize, "file I/O size", params.Uint32, []string{"file.io.size > 512"}, nil, nil}, - FileOffset: {FileOffset, "file offset", params.Uint64, []string{"file.offset = 1024"}, nil, nil}, - FileType: {FileType, "file type", params.AnsiString, []string{"file.type = 'directory'"}, nil, nil}, - FileExtension: {FileExtension, "file extension", params.AnsiString, []string{"file.extension = '.dll'"}, nil, nil}, - FileAttributes: {FileAttributes, "file attributes", params.Slice, []string{"file.attributes in ('archive', 'hidden')"}, nil, nil}, - FileStatus: {FileStatus, "file operation status message", params.UnicodeString, []string{"file.status != 'success'"}, nil, nil}, - FileViewBase: {FileViewBase, "view base address", params.Address, []string{"file.view.base = '25d42170000'"}, nil, nil}, - FileViewSize: {FileViewSize, "size of the mapped view", params.Uint64, []string{"file.view.size > 1024"}, nil, nil}, - FileViewType: {FileViewType, "type of the mapped view section", params.Enum, []string{"file.view.type = 'IMAGE'"}, nil, nil}, - FileViewProtection: {FileViewProtection, "protection rights of the section view", params.AnsiString, []string{"file.view.protection = 'READONLY'"}, nil, nil}, - FileIsDLL: {FileIsDLL, "indicates if the created file is a DLL", params.Bool, []string{"file.is_dll'"}, nil, nil}, - FileIsDriver: {FileIsDriver, "indicates if the created file is a driver", params.Bool, []string{"file.is_driver'"}, nil, nil}, - FileIsExecutable: {FileIsExecutable, "indicates if the created file is an executable", params.Bool, []string{"file.is_exec'"}, nil, nil}, - FilePID: {FilePID, "denotes the process id performing file operation", params.PID, []string{"file.pid = 4"}, nil, nil}, - FileKey: {FileKey, "uniquely identifies the file object", params.Uint64, []string{"file.key = 12446738026482168384"}, nil, nil}, - FileInfoClass: {FileInfoClass, "identifies the file information class", params.Enum, []string{"file.info_class = 'Allocation'"}, nil, nil}, - FileInfoAllocationSize: {FileInfoAllocationSize, "file allocation size", params.Uint64, []string{"file.info.allocation_size > 645400"}, nil, nil}, - FileInfoEOFSize: {FileInfoEOFSize, "file EOF size", params.Uint64, []string{"file.info.eof_size > 1000"}, nil, nil}, - FileInfoIsDispositionDeleteFile: {FileInfoIsDispositionDeleteFile, "indicates if the file is deleted when its handle is closed", params.Bool, []string{"file.info.is_disposition_file_delete = true"}, nil, nil}, - - RegistryPath: {RegistryPath, "fully qualified registry path", params.UnicodeString, []string{"registry.path = 'HKEY_LOCAL_MACHINE\\SYSTEM'"}, nil, nil}, - RegistryKeyName: {RegistryKeyName, "registry key name", params.UnicodeString, []string{"registry.key.name = 'CurrentControlSet'"}, nil, nil}, - RegistryKCB: {RegistryKCB, "registry KCB address", params.Address, []string{"registry.kcb = 'FFFFB905D60C2268'"}, nil, nil}, - RegistryValue: {RegistryValue, "registry value name", params.UnicodeString, []string{"registry.value = 'Epoch'"}, nil, nil}, - RegistryValueType: {RegistryValueType, "type of registry value", params.UnicodeString, []string{"registry.value.type = 'REG_SZ'"}, nil, nil}, - RegistryData: {RegistryData, "registry value captured data", params.Object, []string{"registry.data = '%SystemRoot%'"}, nil, nil}, - RegistryStatus: {RegistryStatus, "status of registry operation", params.UnicodeString, []string{"registry.status != 'success'"}, nil, nil}, - - NetDIP: {NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil}, - NetSIP: {NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil}, - NetDport: {NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil}, - NetSport: {NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil}, - NetDportName: {NetDportName, "destination port name", params.AnsiString, []string{"net.dport.name = 'dns'"}, nil, nil}, - NetSportName: {NetSportName, "source port name", params.AnsiString, []string{"net.sport.name = 'http'"}, nil, nil}, - NetL4Proto: {NetL4Proto, "layer 4 protocol name", params.AnsiString, []string{"net.l4.proto = 'TCP"}, nil, nil}, - NetPacketSize: {NetPacketSize, "packet size", params.Uint32, []string{"net.size > 512"}, nil, nil}, - NetSIPNames: {NetSIPNames, "source IP names", params.Slice, []string{"net.sip.names in ('github.com.')"}, nil, nil}, - NetDIPNames: {NetDIPNames, "destination IP names", params.Slice, []string{"net.dip.names in ('github.com.')"}, nil, nil}, - - HandleID: {HandleID, "handle identifier", params.Uint16, []string{"handle.id = 24"}, nil, nil}, - HandleObject: {HandleObject, "handle object address", params.Address, []string{"handle.object = 'FFFFB905DBF61988'"}, nil, nil}, - HandleName: {HandleName, "handle name", params.UnicodeString, []string{"handle.name = '\\Device\\NamedPipe\\chrome.12644.28.105826381'"}, nil, nil}, - HandleType: {HandleType, "handle type", params.AnsiString, []string{"handle.type = 'Mutant'"}, nil, nil}, - - PeNumSections: {PeNumSections, "number of sections", params.Uint16, []string{"pe.nsections < 5"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSections}}, nil}, - PeNumSymbols: {PeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"pe.nsymbols > 230"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSymbols}}, nil}, - PeBaseAddress: {PeBaseAddress, "image base address", params.Address, []string{"pe.address.base = '140000000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeBaseAddress}}, nil}, - PeEntrypoint: {PeEntrypoint, "address of the entrypoint function", params.Address, []string{"pe.address.entrypoint = '20110'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeEntrypoint}}, nil}, - PeSymbols: {PeSymbols, "imported symbols", params.Slice, []string{"pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeSymbols}}, nil}, - PeImports: {PeImports, "imported dynamic linked libraries", params.Slice, []string{"pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImports}}, nil}, - - PeResources: {PeResources, "version resources", params.Map, []string{"pe.resources[FileDescription] = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeResources}}, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { - for _, c := range s { - switch { - case unicode.IsLower(c): - case unicode.IsUpper(c): - case unicode.IsNumber(c): - case c == '_': - default: - return false - } - } - return true - }}}, - - PeCompany: {PeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"pe.company = 'Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCompany}}, nil}, - PeCopyright: {PeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"pe.copyright = '© Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCopyright}}, nil}, - PeDescription: {PeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"pe.description = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeDescription}}, nil}, - PeFileName: {PeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"pe.file.name = 'NOTEPAD.EXE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileName}}, nil}, - PeFileVersion: {PeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileVersion}}, nil}, - PeProduct: {PeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"pe.product = 'Microsoft® Windows® Operating System'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProduct}}, nil}, - PeProductVersion: {PeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"pe.product.version = '10.0.18362.693'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProductVersion}}, nil}, - PeIsDLL: {PeIsDLL, "indicates if the loaded image or created file is a DLL", params.Bool, []string{"pe.is_dll'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDLL, ImageIsDLL}}, nil}, - PeIsDriver: {PeIsDriver, "indicates if the loaded image or created file is a driver", params.Bool, []string{"pe.is_driver'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDriver, ImageIsDriver}}, nil}, - PeIsExecutable: {PeIsExecutable, "indicates if the loaded image or created file is an executable", params.Bool, []string{"pe.is_exec'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsExecutable, ImageIsExecutable}}, nil}, - PeImphash: {PeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImphash}}, nil}, - PeIsDotnet: {PeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"pe.is_dotnet"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsDotnet}}, nil}, - PeAnomalies: {PeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"pe.anomalies in ('number of sections is 0')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeAnomalies}}, nil}, - PeIsSigned: {PeIsSigned, "indicates if the PE has embedded or catalog signature", params.Bool, []string{"pe.is_signed"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureExists}}, nil}, - PeIsTrusted: {PeIsTrusted, "indicates if the PE certificate chain is trusted", params.Bool, []string{"pe.is_trusted"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureTrusted}}, nil}, - PeCertSerial: {PeCertSerial, "PE certificate serial number", params.UnicodeString, []string{"pe.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSerial}}, nil}, - PeCertSubject: {PeCertSubject, "PE certificate subject", params.UnicodeString, []string{"pe.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSubject}}, nil}, - PeCertIssuer: {PeCertIssuer, "PE certificate CA", params.UnicodeString, []string{"pe.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureIssuer}}, nil}, - PeCertAfter: {PeCertAfter, "PE certificate expiration date", params.Time, []string{"pe.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureAfter}}, nil}, - PeCertBefore: {PeCertBefore, "PE certificate enrollment date", params.Time, []string{"pe.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureBefore}}, nil}, - PeIsModified: {PeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"pe.is_modified"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsModified}}, nil}, - - MemBaseAddress: {MemBaseAddress, "region base address", params.Address, []string{"mem.address = '211d13f2000'"}, nil, nil}, - MemRegionSize: {MemRegionSize, "region size", params.Uint64, []string{"mem.size > 438272"}, nil, nil}, - MemAllocType: {MemAllocType, "region allocation or release type", params.Flags, []string{"mem.alloc = 'COMMIT'"}, nil, nil}, - MemPageType: {MemPageType, "page type of the allocated region", params.Enum, []string{"mem.type = 'PRIVATE'"}, nil, nil}, - MemProtection: {MemProtection, "allocated region protection type", params.Enum, []string{"mem.protection = 'READWRITE'"}, nil, nil}, - MemProtectionMask: {MemProtectionMask, "allocated region protection in mask notation", params.Enum, []string{"mem.protection.mask = 'RWX'"}, nil, nil}, - - DNSName: {DNSName, "dns query name", params.UnicodeString, []string{"dns.name = 'example.org'"}, nil, nil}, - DNSRR: {DNSRR, "dns resource record type", params.AnsiString, []string{"dns.rr = 'AA'"}, nil, nil}, - DNSOptions: {DNSOptions, "dns query options", params.Flags64, []string{"dns.options in ('ADDRCONFIG', 'DUAL_ADDR')"}, nil, nil}, - DNSRcode: {DNSRR, "dns response status", params.AnsiString, []string{"dns.rcode = 'NXDOMAIN'"}, nil, nil}, - DNSAnswers: {DNSAnswers, "dns response answers", params.Slice, []string{"dns.answers in ('o.lencr.edgesuite.net', 'a1887.dscq.akamai.net')"}, nil, nil}, - - ThreadpoolPoolID: {ThreadpoolPoolID, "thread pool identifier", params.Address, []string{"threadpool.id = '20f5fc02440'"}, nil, nil}, - ThreadpoolTaskID: {ThreadpoolTaskID, "thread pool task identifier", params.Address, []string{"threadpool.task.id = '20f7ecd21f8'"}, nil, nil}, - ThreadpoolCallbackAddress: {ThreadpoolCallbackAddress, "thread pool callback address", params.Address, []string{"threadpool.callback.address = '7ff868739ed0'"}, nil, nil}, - ThreadpoolCallbackSymbol: {ThreadpoolCallbackSymbol, "thread pool callback symbol", params.UnicodeString, []string{"threadpool.callback.symbol = 'RtlDestroyQueryDebugBuffer'"}, nil, nil}, - ThreadpoolCallbackModule: {ThreadpoolCallbackModule, "thread pool module containing the callback symbol", params.UnicodeString, []string{"threadpool.callback.module contains 'ntdll.dll'"}, nil, nil}, - ThreadpoolCallbackContext: {ThreadpoolCallbackContext, "thread pool callback context address", params.Address, []string{"threadpool.callback.context = '1df41e07bd0'"}, nil, nil}, - ThreadpoolCallbackContextRip: {ThreadpoolCallbackContextRip, "thread pool callback thread context instruction pointer", params.Address, []string{"threadpool.callback.context.rip = '1df42ffc1f8'"}, nil, nil}, - ThreadpoolCallbackContextRipSymbol: {ThreadpoolCallbackContextRipSymbol, "thread pool callback thread context instruction pointer symbol", params.UnicodeString, []string{"threadpool.callback.context.rip.symbol = 'VirtualProtect'"}, nil, nil}, - ThreadpoolCallbackContextRipModule: {ThreadpoolCallbackContextRipModule, "thread pool callback thread context instruction pointer symbol module", params.UnicodeString, []string{"threadpool.callback.context.rip.module contains 'ntdll.dll'"}, nil, nil}, - ThreadpoolSubprocessTag: {ThreadpoolSubprocessTag, "thread pool service identifier", params.Address, []string{"threadpool.subprocess_tag = '10d'"}, nil, nil}, - ThreadpoolTimerDuetime: {ThreadpoolTimerDuetime, "thread pool timer due time", params.Uint64, []string{"threadpool.timer.duetime > 10"}, nil, nil}, - ThreadpoolTimerSubqueue: {ThreadpoolTimerSubqueue, "thread pool timer subqueue address", params.Address, []string{"threadpool.timer.subqueue = '1db401703e8'"}, nil, nil}, - ThreadpoolTimer: {ThreadpoolTimer, "thread pool timer address", params.Address, []string{"threadpool.timer.address = '3e8'"}, nil, nil}, - ThreadpoolTimerPeriod: {ThreadpoolTimerPeriod, "thread pool timer period", params.Uint32, []string{"threadpool.timer.period = 0'"}, nil, nil}, - ThreadpoolTimerWindow: {ThreadpoolTimerWindow, "thread pool timer tolerate period", params.Uint32, []string{"threadpool.timer.window = 0'"}, nil, nil}, - ThreadpoolTimerAbsolute: {ThreadpoolTimerAbsolute, "indicates if the thread pool timer is absolute or relative", params.Bool, []string{"threadpool.timer.is_absolute = true'"}, nil, nil}, +func platformFields(platform map[Field]FieldInfo) map[Field]FieldInfo { + fields := make(map[Field]FieldInfo, len(commonFields)+len(platform)) + for field, info := range commonFields { + fields[field] = info + } + for field, info := range platform { + fields[field] = info + } + return fields } // ArgumentOf returns argument data for the specified field. diff --git a/pkg/filter/fields/defs_linux.go b/pkg/filter/fields/defs_linux.go new file mode 100644 index 000000000..717dd8ffa --- /dev/null +++ b/pkg/filter/fields/defs_linux.go @@ -0,0 +1,36 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package fields + +import "github.com/rabbitstack/fibratus/pkg/event/params" + +func platformString() params.Type { return params.String } +func platformAnsiString() params.Type { return params.String } + +var fields = platformFields(map[Field]FieldInfo{ + EvtPID: {EvtPID, "process identifier generating the event", params.Uint64, []string{"evt.pid = 6"}, nil, nil}, + EvtTID: {EvtTID, "thread identifier generating the event", params.Uint64, []string{"evt.tid = 1024"}, nil, nil}, + KevtPID: {KevtPID, "process identifier generating the event", params.Uint64, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil}, + KevtTID: {KevtTID, "thread identifier generating the event", params.Uint64, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil}, + PsPid: {PsPid, "process identifier", params.Uint64, []string{"ps.pid = 1024"}, nil, nil}, + PsPpid: {PsPpid, "parent process identifier", params.Uint64, []string{"ps.ppid = 45"}, nil, nil}, + PsParentPid: {PsParentPid, "parent process id", params.Uint64, []string{"ps.parent.pid = 4"}, nil, nil}, +}) diff --git a/pkg/filter/fields/defs_linux_test.go b/pkg/filter/fields/defs_linux_test.go new file mode 100644 index 000000000..22eeaf939 --- /dev/null +++ b/pkg/filter/fields/defs_linux_test.go @@ -0,0 +1,42 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package fields + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/stretchr/testify/require" +) + +func TestLinuxFields(t *testing.T) { + require.True(t, IsField(string(EvtName))) + require.True(t, IsField(string(PsName))) + require.True(t, IsField(string(PsParentExe))) + require.Equal(t, params.String, EvtName.Type()) + require.Equal(t, params.String, PsName.Type()) + require.Equal(t, params.Uint64, EvtPID.Type()) + require.Equal(t, params.Uint64, EvtTID.Type()) + require.Equal(t, params.Uint64, PsPid.Type()) + require.False(t, IsField(string(PsComm))) + require.False(t, IsField(string(RegistryPath))) + require.False(t, IsField(string(PeEntrypoint))) +} diff --git a/pkg/filter/fields/defs_windows.go b/pkg/filter/fields/defs_windows.go new file mode 100644 index 000000000..14faab085 --- /dev/null +++ b/pkg/filter/fields/defs_windows.go @@ -0,0 +1,322 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package fields + +import ( + "unicode" + + "github.com/rabbitstack/fibratus/pkg/event/params" +) + +func platformString() params.Type { return params.UnicodeString } +func platformAnsiString() params.Type { return params.AnsiString } + +var fields = platformFields(map[Field]FieldInfo{ + EvtPID: {EvtPID, "process identifier generating the event", params.Uint32, []string{"evt.pid = 6"}, nil, nil}, + EvtTID: {EvtTID, "thread identifier generating the event", params.Uint32, []string{"evt.tid = 1024"}, nil, nil}, + KevtPID: {KevtPID, "process identifier generating the event", params.Uint32, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil}, + KevtTID: {KevtTID, "thread identifier generating the event", params.Uint32, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil}, + PsPid: {PsPid, "process identifier", params.PID, []string{"ps.pid = 1024"}, nil, nil}, + PsPpid: {PsPpid, "parent process identifier", params.PID, []string{"ps.ppid = 45"}, nil, nil}, + PsParentPid: {PsParentPid, "parent process id", params.Uint32, []string{"ps.parent.pid = 4"}, nil, nil}, + EvtIsDirectSyscall: {EvtIsDirectSyscall, "indicates if the event is performing a direct syscall", params.Bool, []string{"evt.is_direct_syscall = true"}, nil, nil}, + EvtIsIndirectSyscall: {EvtIsIndirectSyscall, "indicates if the event is performing an indirect syscall", params.Bool, []string{"evt.is_indirect_syscall = true"}, nil, nil}, + PsComm: {PsComm, "process command line", params.UnicodeString, []string{"ps.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsCmdline}}, nil}, + PsSID: {PsSID, "security identifier under which this process is run", params.UnicodeString, []string{"ps.sid contains 'SYSTEM'"}, nil, nil}, + PsSessionID: {PsSessionID, "unique identifier for the current session", params.Int16, []string{"ps.sessionid = 1"}, nil, nil}, + PsDomain: {PsDomain, "process domain", params.UnicodeString, []string{"ps.domain contains 'SERVICE'"}, nil, nil}, + PsHandleNames: {PsHandleNames, "allocated process handle names", params.Slice, []string{"ps.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, + PsHandleTypes: {PsHandleTypes, "allocated process handle types", params.Slice, []string{"ps.handle.types in ('Key', 'Mutant', 'Section')"}, nil, nil}, + PsDTB: {PsDTB, "process directory table base address", params.Address, []string{"ps.dtb = '7ffe0000'"}, nil, nil}, + PsModuleNames: {PsModuleNames, "modules loaded by the process", params.Slice, []string{"ps.modules in ('crypt32.dll', 'xul.dll')"}, nil, nil}, + PsParentComm: {PsParentComm, "parent process command line", params.UnicodeString, []string{"ps.parent.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsParentCmdline}}, nil}, + PsParentArgs: {PsParentArgs, "parent process command line arguments", params.Slice, []string{"ps.parent.args in ('/cdir', '/-C')"}, nil, nil}, + PsParentCwd: {PsParentCwd, "parent process current working directory", params.UnicodeString, []string{"ps.parent.cwd = 'C:\\Temp'"}, nil, nil}, + PsParentSID: {PsParentSID, "security identifier under which the parent process is run", params.UnicodeString, []string{"ps.parent.sid contains 'SYSTEM'"}, nil, nil}, + PsParentDomain: {PsParentDomain, "parent process domain", params.UnicodeString, []string{"ps.parent.domain contains 'SERVICE'"}, nil, nil}, + PsParentUsername: {PsParentUsername, "parent process username", params.UnicodeString, []string{"ps.parent.username contains 'system'"}, nil, nil}, + PsParentSessionID: {PsParentSessionID, "unique identifier for the current session of parent process", params.Int16, []string{"ps.parent.sessionid = 1"}, nil, nil}, + PsParentEnvs: {PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('MOZ_CRASHREPORTER_DATA_DIRECTORY')"}, nil, nil}, + PsParentHandles: {PsParentHandles, "allocated parent process handle names", params.Slice, []string{"ps.parent.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, + PsParentHandleTypes: {PsParentHandleTypes, "allocated parent process handle types", params.Slice, []string{"ps.parent.handle.types in ('File', 'SymbolicLink')"}, nil, nil}, + PsParentDTB: {PsParentDTB, "parent process directory table base address", params.Address, []string{"ps.parent.dtb = '7ffe0000'"}, nil, nil}, + PsAccessMask: {PsAccessMask, "process desired access rights", params.AnsiString, []string{"ps.access.mask = '0x1400'"}, nil, nil}, + PsAccessMaskNames: {PsAccessMaskNames, "process desired access rights as a string list", params.Slice, []string{"ps.access.mask.names in ('SUSPEND_RESUME')"}, nil, nil}, + PsAccessStatus: {PsAccessStatus, "process access status", params.UnicodeString, []string{"ps.access.status = 'access is denied.'"}, nil, nil}, + PsUUID: {PsUUID, "unique process identifier", params.Uint64, []string{"ps.uuid > 6000054355"}, nil, nil}, + PsParentUUID: {PsParentUUID, "unique parent process identifier", params.Uint64, []string{"ps.parent.uuid > 6000054355"}, nil, nil}, + PsIsWOW64Field: {PsIsWOW64Field, "indicates if the process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.is_wow64"}, nil, nil}, + PsIsPackagedField: {PsIsPackagedField, "indicates if the process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.is_packaged"}, nil, nil}, + PsIsProtectedField: {PsIsProtectedField, "indicates if the process generating the event is a protected process", params.Bool, []string{"ps.is_protected"}, nil, nil}, + PsParentIsWOW64Field: {PsParentIsWOW64Field, "indicates if the parent process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.parent.is_wow64"}, nil, nil}, + PsParentIsPackagedField: {PsParentIsPackagedField, "indicates if the parent process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.parent.is_packaged"}, nil, nil}, + PsParentIsProtectedField: {PsParentIsProtectedField, "indicates if the the parent process generating the event is a protected process", params.Bool, []string{"ps.parent.is_protected"}, nil, nil}, + PsAncestor: {PsAncestor, "the process ancestor name", params.UnicodeString, []string{"ps.ancestor[1] = 'svchost.exe'", "ps.ancestor in ('winword.exe')"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, + PsTokenIntegrityLevel: {PsTokenIntegrityLevel, "process token integrity level", params.UnicodeString, []string{"ps.token.integrity_level = 'SYSTEM'"}, nil, nil}, + PsTokenIsElevated: {PsTokenIsElevated, "indicates if the process token is elevated", params.Bool, []string{"ps.token.is_elevated = true"}, nil, nil}, + PsTokenElevationType: {PsTokenElevationType, "process token elevation type", params.AnsiString, []string{"ps.token.elevation_type = 'LIMITED'"}, nil, nil}, + PsParentTokenIntegrityLevel: {PsParentTokenIntegrityLevel, "parent process token integrity level", params.UnicodeString, []string{"ps.parent.token.integrity_level = 'HIGH'"}, nil, nil}, + PsParentTokenIsElevated: {PsParentTokenIsElevated, "indicates if the parent process token is elevated", params.Bool, []string{"ps.parent.token.is_elevated = true"}, nil, nil}, + PsParentTokenElevationType: {PsParentTokenElevationType, "parent process token elevation type", params.AnsiString, []string{"ps.parent.token.elevation_type = 'LIMITED'"}, nil, nil}, + PsSignatureExists: {PsSignatureExists, "indicates if the process executable has a valid signature", params.Bool, []string{"ps.signature.exists"}, nil, nil}, + PsSignatureTrusted: {PsSignatureTrusted, "indicates if the process executable signature certificate chain is trusted", params.Bool, []string{"ps.signature.trusted"}, nil, nil}, + PsSignatureSerial: {PsSignatureSerial, "represents signature serial number", params.UnicodeString, []string{"ps.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, + PsSignatureSubject: {PsSignatureSubject, "represents signature subject", params.UnicodeString, []string{"ps.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + PsSignatureIssuer: {PsSignatureIssuer, "represents signature CA", params.UnicodeString, []string{"ps.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + PsSignatureAfter: {PsSignatureAfter, "represents certificate expiration date", params.Time, []string{"ps.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + PsSignatureBefore: {PsSignatureBefore, "represents certificate enrollment date", params.Time, []string{"ps.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + PsPeNumSections: {PsPeNumSections, "number of PE sections", params.Uint16, []string{"ps.pe.nsections < 5"}, nil, nil}, + PsPeNumSymbols: {PsPeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"ps.pe.nsymbols > 230"}, nil, nil}, + PsPeBaseAddress: {PsPeBaseAddress, "executable base address", params.Address, []string{"ps.pe.address.base = '140000000'"}, nil, nil}, + PsPeEntrypoint: {PsPeEntrypoint, "address of the entrypoint function", params.Address, []string{"ps.pe.address.entrypoint = '20110'"}, nil, nil}, + PsPeSymbols: {PsPeSymbols, "imported symbols", params.Slice, []string{"ps.pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, nil, nil}, + PsPeImports: {PsPeImports, "imported dynamic linked libraries", params.Slice, []string{"ps.pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, nil, nil}, + PsPeResources: {PsPeResources, "version resources", params.Map, []string{"ps.pe.resources[FileDescription] = 'Notepad'"}, nil, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { + for _, c := range s { + switch { + case unicode.IsLower(c): + case unicode.IsUpper(c): + case unicode.IsNumber(c): + case c == '_': + default: + return false + } + } + return true + }}}, + PsPeCompany: {PsPeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.company = 'Microsoft Corporation'"}, nil, nil}, + PsPeCopyright: {PsPeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"ps.pe.copyright = '© Microsoft Corporation'"}, nil, nil}, + PsPeDescription: {PsPeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.description = 'Notepad'"}, nil, nil}, + PsPeFileName: {PsPeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.name = 'NOTEPAD.EXE'"}, nil, nil}, + PsPeFileVersion: {PsPeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, nil, nil}, + PsPeProduct: {PsPeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product = 'Microsoft® Windows® Operating System'"}, nil, nil}, + PsPeProductVersion: {PsPeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product.version = '10.0.18362.693'"}, nil, nil}, + PsPeImphash: {PsPeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, nil, nil}, + PsPeIsDotnet: {PsPeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"ps.pe.is_dotnet"}, nil, nil}, + PsPeAnomalies: {PsPeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"ps.pe.anomalies in ('number of sections is 0')"}, nil, nil}, + PsPeIsModified: {PsPeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"ps.pe.is_modified"}, nil, nil}, + ThreadBasePrio: {ThreadBasePrio, "scheduler priority of the thread", params.Int8, []string{"thread.prio = 5"}, nil, nil}, + ThreadIOPrio: {ThreadIOPrio, "I/O priority hint for scheduling I/O operations", params.Int8, []string{"thread.io.prio = 4"}, nil, nil}, + ThreadPagePrio: {ThreadPagePrio, "memory page priority hint for memory pages accessed by the thread", params.Int8, []string{"thread.page.prio = 12"}, nil, nil}, + ThreadKstackBase: {ThreadKstackBase, "base address of the thread's kernel space stack", params.Address, []string{"thread.kstack.base = 'a65d800000'"}, nil, nil}, + ThreadKstackLimit: {ThreadKstackLimit, "limit of the thread's kernel space stack", params.Address, []string{"thread.kstack.limit = 'a85d800000'"}, nil, nil}, + ThreadUstackBase: {ThreadUstackBase, "base address of the thread's user space stack", params.Address, []string{"thread.ustack.base = '7ffe0000'"}, nil, nil}, + ThreadUstackLimit: {ThreadUstackLimit, "limit of the thread's user space stack", params.Address, []string{"thread.ustack.limit = '8ffe0000'"}, nil, nil}, + ThreadEntrypoint: {ThreadEntrypoint, "starting address of the function to be executed by the thread", params.Address, []string{"thread.entrypoint = '7efe0000'"}, &Deprecation{Since: "2.3.0", Fields: []Field{ThreadStartAddress}}, nil}, + ThreadStartAddress: {ThreadStartAddress, "thread start address", params.Address, []string{"thread.start_address = '7efe0000'"}, nil, nil}, + ThreadStartAddressSymbol: {ThreadStartAddressSymbol, "thread start address symbol", params.UnicodeString, []string{"thread.start_address.symbol = 'LoadModule'"}, nil, nil}, + ThreadStartAddressModule: {ThreadStartAddressModule, "thread start address module", params.UnicodeString, []string{"thread.start_address.module endswith 'kernel32.dll'"}, nil, nil}, + ThreadPID: {ThreadPID, "the process identifier where the thread is created", params.Uint32, []string{"evt.pid != thread.pid"}, nil, nil}, + ThreadTEB: {ThreadTEB, "the base address of the thread environment block", params.Address, []string{"thread.teb_address = '8f30893000'"}, nil, nil}, + ThreadAccessMask: {ThreadAccessMask, "thread desired access rights", params.AnsiString, []string{"thread.access.mask = '0x1fffff'"}, nil, nil}, + ThreadAccessMaskNames: {ThreadAccessMaskNames, "thread desired access rights as a string list", params.Slice, []string{"thread.access.mask.names in ('IMPERSONATE')"}, nil, nil}, + ThreadAccessStatus: {ThreadAccessStatus, "thread access status", params.UnicodeString, []string{"thread.access.status = 'success'"}, nil, nil}, + ThreadCallstackSummary: {ThreadCallstackSummary, "callstack summary", params.UnicodeString, []string{"thread.callstack.summary contains 'ntdll.dll|KERNELBASE.dll'"}, nil, nil}, + ThreadCallstackKernelSummary: {ThreadCallstackKernelSummary, "kernel thread callstack summary", params.UnicodeString, []string{"thread.callstack.kernel_summary contains 'fileinfo.sys|ntoskrnl.exe|FLTMGR.SYS|ntoskrnl.exe'"}, nil, nil}, + ThreadCallstackDetail: {ThreadCallstackDetail, "detailed information of each stack frame", params.UnicodeString, []string{"thread.callstack.detail contains 'KERNELBASE.dll!CreateProcessW'"}, nil, nil}, + ThreadCallstackModules: {ThreadCallstackModules, "list of modules comprising the callstack", params.Slice, []string{"thread.callstack.modules in ('C:\\WINDOWS\\System32\\KERNELBASE.dll')", "base(thread.callstack.modules[7]) = 'ntdll.dll'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, + ThreadCallstackSymbols: {ThreadCallstackSymbols, "list of symbols comprising the callstack", params.Slice, []string{"thread.callstack.symbols in ('ntdll.dll!NtCreateProcess')", "thread.callstack.symbols[3] = 'ntdll!NtCreateProcess'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, + ThreadCallstackAllocationSizes: {ThreadCallstackAllocationSizes, "allocation sizes of private pages", params.Slice, []string{"thread.callstack.allocation_sizes > 10000"}, nil, nil}, + ThreadCallstackProtections: {ThreadCallstackProtections, "page protections masks of each frame", params.Slice, []string{"thread.callstack.protections in ('RWX', 'WX')"}, nil, nil}, + ThreadCallstackCallsiteLeadingAssembly: {ThreadCallstackCallsiteLeadingAssembly, "callsite leading assembly instructions", params.Slice, []string{"thread.callstack.callsite_leading_assembly in ('mov r10,rcx', 'syscall')"}, nil, nil}, + ThreadCallstackCallsiteTrailingAssembly: {ThreadCallstackCallsiteTrailingAssembly, "callsite trailing assembly instructions", params.Slice, []string{"thread.callstack.callsite_trailing_assembly in ('add esp, 0xab')"}, nil, nil}, + ThreadCallstackIsUnbacked: {ThreadCallstackIsUnbacked, "indicates if the callstack contains unbacked regions", params.Bool, []string{"thread.callstack.is_unbacked"}, nil, nil}, + ThreadCallstackAddresses: {ThreadCallstackAddresses, "list of all stack return addresses", params.Slice, []string{"thread.callstack.addresses in ('7ffb5c1d0396')"}, nil, nil}, + ThreadCallstackFinalUserModuleName: {ThreadCallstackFinalUserModuleName, "final user space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_user_module.name != 'ntdll.dll'"}, nil, nil}, + ThreadCallstackFinalUserModulePath: {ThreadCallstackFinalUserModulePath, "final user space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_user_module.path imatches '?:\\Windows\\System32\\ntdll.dll'"}, nil, nil}, + ThreadCallstackFinalUserSymbolName: {ThreadCallstackFinalUserSymbolName, "final user space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_user_symbol.name imatches 'CreateProcess*'"}, nil, nil}, + ThreadCallstackFinalKernelModuleName: {ThreadCallstackFinalKernelModuleName, "final kernel space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_kernel_module.name = 'FLTMGR.SYS'"}, nil, nil}, + ThreadCallstackFinalKernelModulePath: {ThreadCallstackFinalKernelModulePath, "final kernel space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_kernel_module.path imatches '?:\\WINDOWS\\System32\\drivers\\FLTMGR.SYS'"}, nil, nil}, + ThreadCallstackFinalKernelSymbolName: {ThreadCallstackFinalKernelSymbolName, "final kernel space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_kernel_symbol.name = 'FltGetStreamContext'"}, nil, nil}, + ThreadCallstackFinalUserModuleSignatureExists: {ThreadCallstackFinalUserModuleSignatureExists, "signature status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.exists = true"}, nil, nil}, + ThreadCallstackFinalUserModuleSignatureTrusted: {ThreadCallstackFinalUserModuleSignatureTrusted, "signature trust status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.trusted = true"}, nil, nil}, + ThreadCallstackFinalUserModuleSignatureIssuer: {ThreadCallstackFinalUserModuleSignatureIssuer, "final user space stack frame module signature certificate issuer", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.issuer imatches '*Microsoft Corporation*'"}, nil, nil}, + ThreadCallstackFinalUserModuleSignatureSubject: {ThreadCallstackFinalUserModuleSignatureSubject, "final user space stack frame module signature certificate subject", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.subject imatches '*Microsoft Windows*'"}, nil, nil}, + ImagePath: {ImagePath, "full image path", params.UnicodeString, []string{"image.path = 'C:\\Windows\\System32\\advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePath}}, nil}, + ImageName: {ImageName, "image name", params.UnicodeString, []string{"image.name = 'advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleName}}, nil}, + ImageBase: {ImageBase, "the base address of process in which the image is loaded", params.Address, []string{"image.base.address = 'a65d800000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleBase}}, nil}, + ImageChecksum: {ImageChecksum, "image checksum", params.Uint32, []string{"image.checksum = 746424"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleChecksum}}, nil}, + ImageSize: {ImageSize, "image size", params.Uint32, []string{"image.size > 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSize}}, nil}, + ImageDefaultAddress: {ImageDefaultAddress, "default image address", params.Address, []string{"image.default.address = '7efe0000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleDefaultAddress}}, nil}, + ImagePID: {ImagePID, "target process identifier", params.Uint32, []string{"image.pid = 80"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePID}}, nil}, + ImageSignatureType: {ImageSignatureType, "image signature type", params.AnsiString, []string{"image.signature.type != 'NONE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureType}}, nil}, + ImageSignatureLevel: {ImageSignatureLevel, "image signature level", params.AnsiString, []string{"image.signature.level = 'AUTHENTICODE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureLevel}}, nil}, + ImageCertSerial: {ImageCertSerial, "image certificate serial number", params.UnicodeString, []string{"image.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSerial}}, nil}, + ImageCertSubject: {ImageCertSubject, "image certificate subject", params.UnicodeString, []string{"image.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSubject}}, nil}, + ImageCertIssuer: {ImageCertIssuer, "image certificate CA", params.UnicodeString, []string{"image.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureIssuer}}, nil}, + ImageCertAfter: {ImageCertAfter, "image certificate expiration date", params.Time, []string{"image.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureAfter}}, nil}, + ImageCertBefore: {ImageCertBefore, "image certificate enrollment date", params.Time, []string{"image.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureBefore}}, nil}, + ImageIsDLL: {ImageIsDLL, "indicates if the loaded image is a DLL", params.Bool, []string{"image.is_dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDLL}}, nil}, + ImageIsDriver: {ImageIsDriver, "indicates if the loaded image is a driver", params.Bool, []string{"image.is_driver'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDriver}}, nil}, + ImageIsExecutable: {ImageIsExecutable, "indicates if the loaded image is an executable", params.Bool, []string{"image.is_exec'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsExecutable}}, nil}, + ImageIsDotnet: {ImageIsDotnet, "indicates if the loaded image is a .NET assembly", params.Bool, []string{"image.is_dotnet'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDotnet}}, nil}, + ModulePath: {ModulePath, "full module path", params.UnicodeString, []string{"module.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, + ModulePathStem: {ModulePathStem, "module path stem", params.UnicodeString, []string{"module.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, + ModuleName: {ModuleName, "module name", params.UnicodeString, []string{"module.name = 'advapi32.dll'"}, nil, nil}, + ModuleBase: {ModuleBase, "the base address of process in which the module is loaded", params.Address, []string{"module.base.address = 'a65d800000'"}, nil, nil}, + ModuleChecksum: {ModuleChecksum, "module checksum", params.Uint32, []string{"module.checksum = 746424"}, nil, nil}, + ModuleSize: {ModuleSize, "module size", params.Uint32, []string{"module.size > 1024"}, nil, nil}, + ModuleDefaultAddress: {ModuleDefaultAddress, "default module address", params.Address, []string{"module.default_address = '7efe0000'"}, nil, nil}, + ModulePID: {ModulePID, "target process identifier", params.Uint32, []string{"module.pid = 80"}, nil, nil}, + ModuleSignatureType: {ModuleSignatureType, "module signature type", params.AnsiString, []string{"module.signature.type != 'NONE'"}, nil, nil}, + ModuleSignatureLevel: {ModuleSignatureLevel, "module signature level", params.AnsiString, []string{"module.signature.level = 'AUTHENTICODE'"}, nil, nil}, + ModuleSignatureExists: {ModuleSignatureExists, "indicates if the module is signed", params.Bool, []string{"module.signature.exists = true"}, nil, nil}, + ModuleSignatureTrusted: {ModuleSignatureTrusted, "indicates if the module signature is trusted", params.Bool, []string{"module.signature.trusted = false"}, nil, nil}, + ModuleSignatureSerial: {ModuleSignatureSerial, "module certificate serial number", params.UnicodeString, []string{"module.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, + ModuleSignatureSubject: {ModuleSignatureSubject, "module certificate subject", params.UnicodeString, []string{"module.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + ModuleSignatureIssuer: {ModuleSignatureIssuer, "module certificate CA", params.UnicodeString, []string{"module.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + ModuleSignatureAfter: {ModuleSignatureAfter, "module certificate expiration date", params.Time, []string{"module.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + ModuleSignatureBefore: {ModuleSignatureBefore, "module certificate enrollment date", params.Time, []string{"module.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + ModuleIsDLL: {ModuleIsDLL, "indicates if the loaded module is a DLL", params.Bool, []string{"module.is_dll'"}, nil, nil}, + ModuleIsDriver: {ModuleIsDriver, "indicates if the loaded module is a driver", params.Bool, []string{"module.is_driver'"}, nil, nil}, + ModuleIsExecutable: {ModuleIsExecutable, "indicates if the loaded module is an executable", params.Bool, []string{"module.is_exec'"}, nil, nil}, + ModuleIsDotnet: {ModuleIsDotnet, "indicates if the loaded module is a .NET assembly", params.Bool, []string{"module.pe.is_dotnet'"}, nil, nil}, + DllPath: {DllPath, "full dll path", params.UnicodeString, []string{"dll.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, + DllPathStem: {DllPathStem, "dll path stem", params.UnicodeString, []string{"dll.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, + DllName: {DllName, "module name", params.UnicodeString, []string{"dll.name = 'advapi32.dll'"}, nil, nil}, + DllBase: {DllBase, "the base address of process in which the DLL is loaded", params.Address, []string{"dll.base = 'a65d800000'"}, nil, nil}, + DllSize: {DllSize, "dll virtual mapped size", params.Uint32, []string{"dll.size > 1024"}, nil, nil}, + DllPID: {DllPID, "target process identifier", params.Uint32, []string{"dll.pid = 80"}, nil, nil}, + DllSignatureType: {DllSignatureType, "dll signature type", params.AnsiString, []string{"dll.signature.type != 'NONE'"}, nil, nil}, + DllSignatureLevel: {DllSignatureLevel, "dll signature level", params.AnsiString, []string{"dll.signature.level = 'AUTHENTICODE'"}, nil, nil}, + DllSignatureExists: {DllSignatureExists, "indicates if the dll is signed", params.Bool, []string{"dll.signature.exists = true"}, nil, nil}, + DllSignatureTrusted: {DllSignatureTrusted, "indicates if the dll signature is trusted", params.Bool, []string{"dll.signature.trusted = false"}, nil, nil}, + DllSignatureSerial: {DllSignatureSerial, "dll certificate serial number", params.UnicodeString, []string{"dll.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, + DllSignatureSubject: {DllSignatureSubject, "dll certificate subject", params.UnicodeString, []string{"dll.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + DllSignatureIssuer: {DllSignatureIssuer, "dll certificate CA", params.UnicodeString, []string{"dll.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, + DllSignatureAfter: {DllSignatureAfter, "moddllule certificate expiration date", params.Time, []string{"dll.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + DllSignatureBefore: {DllSignatureBefore, "dll certificate enrollment date", params.Time, []string{"dll.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, + DllIsDotnet: {DllIsDotnet, "indicates if the loaded dll is a .NET assembly", params.Bool, []string{"dll.pe.is_dotnet'"}, nil, nil}, + FileObject: {FileObject, "file object address", params.Uint64, []string{"file.object = 18446738026482168384"}, nil, nil}, + FilePath: {FilePath, "full file path", params.UnicodeString, []string{"file.path = 'C:\\Windows\\System32'"}, nil, nil}, + FilePathStem: {FilePathStem, "full file path without extension", params.UnicodeString, []string{"file.path.stem = 'C:\\Windows\\System32\\cmd'"}, nil, nil}, + FileName: {FileName, "full file name", params.UnicodeString, []string{"file.name contains 'mimikatz'"}, nil, nil}, + FileOperation: {FileOperation, "file operation", params.AnsiString, []string{"file.operation = 'open'"}, nil, nil}, + FileShareMask: {FileShareMask, "file share mask", params.AnsiString, []string{"file.share.mask = 'READ'"}, &Deprecation{Since: "3.1.0", Fields: []Field{FileShareMode}}, nil}, + FileShareMode: {FileShareMask, "file share mode", params.AnsiString, []string{"file.share_mode = 'DENY'"}, nil, nil}, + FileIOSize: {FileIOSize, "file I/O size", params.Uint32, []string{"file.io.size > 512"}, nil, nil}, + FileOffset: {FileOffset, "file offset", params.Uint64, []string{"file.offset = 1024"}, nil, nil}, + FileType: {FileType, "file type", params.AnsiString, []string{"file.type = 'directory'"}, nil, nil}, + FileExtension: {FileExtension, "file extension", params.AnsiString, []string{"file.extension = '.dll'"}, nil, nil}, + FileAttributes: {FileAttributes, "file attributes", params.Slice, []string{"file.attributes in ('archive', 'hidden')"}, nil, nil}, + FileStatus: {FileStatus, "file operation status message", params.UnicodeString, []string{"file.status != 'success'"}, nil, nil}, + FileViewBase: {FileViewBase, "view base address", params.Address, []string{"file.view.base = '25d42170000'"}, nil, nil}, + FileViewSize: {FileViewSize, "size of the mapped view", params.Uint64, []string{"file.view.size > 1024"}, nil, nil}, + FileViewType: {FileViewType, "type of the mapped view section", params.Enum, []string{"file.view.type = 'IMAGE'"}, nil, nil}, + FileViewProtection: {FileViewProtection, "protection rights of the section view", params.AnsiString, []string{"file.view.protection = 'READONLY'"}, nil, nil}, + FileIsDLL: {FileIsDLL, "indicates if the created file is a DLL", params.Bool, []string{"file.is_dll'"}, nil, nil}, + FileIsDriver: {FileIsDriver, "indicates if the created file is a driver", params.Bool, []string{"file.is_driver'"}, nil, nil}, + FileIsExecutable: {FileIsExecutable, "indicates if the created file is an executable", params.Bool, []string{"file.is_exec'"}, nil, nil}, + FilePID: {FilePID, "denotes the process id performing file operation", params.PID, []string{"file.pid = 4"}, nil, nil}, + FileKey: {FileKey, "uniquely identifies the file object", params.Uint64, []string{"file.key = 12446738026482168384"}, nil, nil}, + FileInfoClass: {FileInfoClass, "identifies the file information class", params.Enum, []string{"file.info_class = 'Allocation'"}, nil, nil}, + FileInfoAllocationSize: {FileInfoAllocationSize, "file allocation size", params.Uint64, []string{"file.info.allocation_size > 645400"}, nil, nil}, + FileInfoEOFSize: {FileInfoEOFSize, "file EOF size", params.Uint64, []string{"file.info.eof_size > 1000"}, nil, nil}, + FileInfoIsDispositionDeleteFile: {FileInfoIsDispositionDeleteFile, "indicates if the file is deleted when its handle is closed", params.Bool, []string{"file.info.is_disposition_file_delete = true"}, nil, nil}, + RegistryPath: {RegistryPath, "fully qualified registry path", params.UnicodeString, []string{"registry.path = 'HKEY_LOCAL_MACHINE\\SYSTEM'"}, nil, nil}, + RegistryKeyName: {RegistryKeyName, "registry key name", params.UnicodeString, []string{"registry.key.name = 'CurrentControlSet'"}, nil, nil}, + RegistryKCB: {RegistryKCB, "registry KCB address", params.Address, []string{"registry.kcb = 'FFFFB905D60C2268'"}, nil, nil}, + RegistryValue: {RegistryValue, "registry value name", params.UnicodeString, []string{"registry.value = 'Epoch'"}, nil, nil}, + RegistryValueType: {RegistryValueType, "type of registry value", params.UnicodeString, []string{"registry.value.type = 'REG_SZ'"}, nil, nil}, + RegistryData: {RegistryData, "registry value captured data", params.Object, []string{"registry.data = '%SystemRoot%'"}, nil, nil}, + RegistryStatus: {RegistryStatus, "status of registry operation", params.UnicodeString, []string{"registry.status != 'success'"}, nil, nil}, + NetDIP: {NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil}, + NetSIP: {NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil}, + NetDport: {NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil}, + NetSport: {NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil}, + NetDportName: {NetDportName, "destination port name", params.AnsiString, []string{"net.dport.name = 'dns'"}, nil, nil}, + NetSportName: {NetSportName, "source port name", params.AnsiString, []string{"net.sport.name = 'http'"}, nil, nil}, + NetL4Proto: {NetL4Proto, "layer 4 protocol name", params.AnsiString, []string{"net.l4.proto = 'TCP"}, nil, nil}, + NetPacketSize: {NetPacketSize, "packet size", params.Uint32, []string{"net.size > 512"}, nil, nil}, + NetSIPNames: {NetSIPNames, "source IP names", params.Slice, []string{"net.sip.names in ('github.com.')"}, nil, nil}, + NetDIPNames: {NetDIPNames, "destination IP names", params.Slice, []string{"net.dip.names in ('github.com.')"}, nil, nil}, + HandleID: {HandleID, "handle identifier", params.Uint16, []string{"handle.id = 24"}, nil, nil}, + HandleObject: {HandleObject, "handle object address", params.Address, []string{"handle.object = 'FFFFB905DBF61988'"}, nil, nil}, + HandleName: {HandleName, "handle name", params.UnicodeString, []string{"handle.name = '\\Device\\NamedPipe\\chrome.12644.28.105826381'"}, nil, nil}, + HandleType: {HandleType, "handle type", params.AnsiString, []string{"handle.type = 'Mutant'"}, nil, nil}, + PeNumSections: {PeNumSections, "number of sections", params.Uint16, []string{"pe.nsections < 5"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSections}}, nil}, + PeNumSymbols: {PeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"pe.nsymbols > 230"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSymbols}}, nil}, + PeBaseAddress: {PeBaseAddress, "image base address", params.Address, []string{"pe.address.base = '140000000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeBaseAddress}}, nil}, + PeEntrypoint: {PeEntrypoint, "address of the entrypoint function", params.Address, []string{"pe.address.entrypoint = '20110'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeEntrypoint}}, nil}, + PeSymbols: {PeSymbols, "imported symbols", params.Slice, []string{"pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeSymbols}}, nil}, + PeImports: {PeImports, "imported dynamic linked libraries", params.Slice, []string{"pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImports}}, nil}, + PeResources: {PeResources, "version resources", params.Map, []string{"pe.resources[FileDescription] = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeResources}}, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { + for _, c := range s { + switch { + case unicode.IsLower(c): + case unicode.IsUpper(c): + case unicode.IsNumber(c): + case c == '_': + default: + return false + } + } + return true + }}}, + PeCompany: {PeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"pe.company = 'Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCompany}}, nil}, + PeCopyright: {PeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"pe.copyright = '© Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCopyright}}, nil}, + PeDescription: {PeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"pe.description = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeDescription}}, nil}, + PeFileName: {PeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"pe.file.name = 'NOTEPAD.EXE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileName}}, nil}, + PeFileVersion: {PeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileVersion}}, nil}, + PeProduct: {PeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"pe.product = 'Microsoft® Windows® Operating System'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProduct}}, nil}, + PeProductVersion: {PeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"pe.product.version = '10.0.18362.693'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProductVersion}}, nil}, + PeIsDLL: {PeIsDLL, "indicates if the loaded image or created file is a DLL", params.Bool, []string{"pe.is_dll'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDLL, ImageIsDLL}}, nil}, + PeIsDriver: {PeIsDriver, "indicates if the loaded image or created file is a driver", params.Bool, []string{"pe.is_driver'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDriver, ImageIsDriver}}, nil}, + PeIsExecutable: {PeIsExecutable, "indicates if the loaded image or created file is an executable", params.Bool, []string{"pe.is_exec'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsExecutable, ImageIsExecutable}}, nil}, + PeImphash: {PeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImphash}}, nil}, + PeIsDotnet: {PeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"pe.is_dotnet"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsDotnet}}, nil}, + PeAnomalies: {PeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"pe.anomalies in ('number of sections is 0')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeAnomalies}}, nil}, + PeIsSigned: {PeIsSigned, "indicates if the PE has embedded or catalog signature", params.Bool, []string{"pe.is_signed"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureExists}}, nil}, + PeIsTrusted: {PeIsTrusted, "indicates if the PE certificate chain is trusted", params.Bool, []string{"pe.is_trusted"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureTrusted}}, nil}, + PeCertSerial: {PeCertSerial, "PE certificate serial number", params.UnicodeString, []string{"pe.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSerial}}, nil}, + PeCertSubject: {PeCertSubject, "PE certificate subject", params.UnicodeString, []string{"pe.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSubject}}, nil}, + PeCertIssuer: {PeCertIssuer, "PE certificate CA", params.UnicodeString, []string{"pe.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureIssuer}}, nil}, + PeCertAfter: {PeCertAfter, "PE certificate expiration date", params.Time, []string{"pe.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureAfter}}, nil}, + PeCertBefore: {PeCertBefore, "PE certificate enrollment date", params.Time, []string{"pe.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureBefore}}, nil}, + PeIsModified: {PeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"pe.is_modified"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsModified}}, nil}, + MemBaseAddress: {MemBaseAddress, "region base address", params.Address, []string{"mem.address = '211d13f2000'"}, nil, nil}, + MemRegionSize: {MemRegionSize, "region size", params.Uint64, []string{"mem.size > 438272"}, nil, nil}, + MemAllocType: {MemAllocType, "region allocation or release type", params.Flags, []string{"mem.alloc = 'COMMIT'"}, nil, nil}, + MemPageType: {MemPageType, "page type of the allocated region", params.Enum, []string{"mem.type = 'PRIVATE'"}, nil, nil}, + MemProtection: {MemProtection, "allocated region protection type", params.Enum, []string{"mem.protection = 'READWRITE'"}, nil, nil}, + MemProtectionMask: {MemProtectionMask, "allocated region protection in mask notation", params.Enum, []string{"mem.protection.mask = 'RWX'"}, nil, nil}, + DNSName: {DNSName, "dns query name", params.UnicodeString, []string{"dns.name = 'example.org'"}, nil, nil}, + DNSRR: {DNSRR, "dns resource record type", params.AnsiString, []string{"dns.rr = 'AA'"}, nil, nil}, + DNSOptions: {DNSOptions, "dns query options", params.Flags64, []string{"dns.options in ('ADDRCONFIG', 'DUAL_ADDR')"}, nil, nil}, + DNSRcode: {DNSRR, "dns response status", params.AnsiString, []string{"dns.rcode = 'NXDOMAIN'"}, nil, nil}, + DNSAnswers: {DNSAnswers, "dns response answers", params.Slice, []string{"dns.answers in ('o.lencr.edgesuite.net', 'a1887.dscq.akamai.net')"}, nil, nil}, + ThreadpoolPoolID: {ThreadpoolPoolID, "thread pool identifier", params.Address, []string{"threadpool.id = '20f5fc02440'"}, nil, nil}, + ThreadpoolTaskID: {ThreadpoolTaskID, "thread pool task identifier", params.Address, []string{"threadpool.task.id = '20f7ecd21f8'"}, nil, nil}, + ThreadpoolCallbackAddress: {ThreadpoolCallbackAddress, "thread pool callback address", params.Address, []string{"threadpool.callback.address = '7ff868739ed0'"}, nil, nil}, + ThreadpoolCallbackSymbol: {ThreadpoolCallbackSymbol, "thread pool callback symbol", params.UnicodeString, []string{"threadpool.callback.symbol = 'RtlDestroyQueryDebugBuffer'"}, nil, nil}, + ThreadpoolCallbackModule: {ThreadpoolCallbackModule, "thread pool module containing the callback symbol", params.UnicodeString, []string{"threadpool.callback.module contains 'ntdll.dll'"}, nil, nil}, + ThreadpoolCallbackContext: {ThreadpoolCallbackContext, "thread pool callback context address", params.Address, []string{"threadpool.callback.context = '1df41e07bd0'"}, nil, nil}, + ThreadpoolCallbackContextRip: {ThreadpoolCallbackContextRip, "thread pool callback thread context instruction pointer", params.Address, []string{"threadpool.callback.context.rip = '1df42ffc1f8'"}, nil, nil}, + ThreadpoolCallbackContextRipSymbol: {ThreadpoolCallbackContextRipSymbol, "thread pool callback thread context instruction pointer symbol", params.UnicodeString, []string{"threadpool.callback.context.rip.symbol = 'VirtualProtect'"}, nil, nil}, + ThreadpoolCallbackContextRipModule: {ThreadpoolCallbackContextRipModule, "thread pool callback thread context instruction pointer symbol module", params.UnicodeString, []string{"threadpool.callback.context.rip.module contains 'ntdll.dll'"}, nil, nil}, + ThreadpoolSubprocessTag: {ThreadpoolSubprocessTag, "thread pool service identifier", params.Address, []string{"threadpool.subprocess_tag = '10d'"}, nil, nil}, + ThreadpoolTimerDuetime: {ThreadpoolTimerDuetime, "thread pool timer due time", params.Uint64, []string{"threadpool.timer.duetime > 10"}, nil, nil}, + ThreadpoolTimerSubqueue: {ThreadpoolTimerSubqueue, "thread pool timer subqueue address", params.Address, []string{"threadpool.timer.subqueue = '1db401703e8'"}, nil, nil}, + ThreadpoolTimer: {ThreadpoolTimer, "thread pool timer address", params.Address, []string{"threadpool.timer.address = '3e8'"}, nil, nil}, + ThreadpoolTimerPeriod: {ThreadpoolTimerPeriod, "thread pool timer period", params.Uint32, []string{"threadpool.timer.period = 0'"}, nil, nil}, + ThreadpoolTimerWindow: {ThreadpoolTimerWindow, "thread pool timer tolerate period", params.Uint32, []string{"threadpool.timer.window = 0'"}, nil, nil}, + ThreadpoolTimerAbsolute: {ThreadpoolTimerAbsolute, "indicates if the thread pool timer is absolute or relative", params.Bool, []string{"threadpool.timer.is_absolute = true'"}, nil, nil}, +}) diff --git a/pkg/filter/filter_test.go b/pkg/filter/filter_windows_test.go similarity index 99% rename from pkg/filter/filter_test.go rename to pkg/filter/filter_windows_test.go index b01d0559d..60d2710fd 100644 --- a/pkg/filter/filter_test.go +++ b/pkg/filter/filter_windows_test.go @@ -62,7 +62,10 @@ var cfg = &config.Config{ EnableDNSEvents: true, }, Filters: &config.Filters{}, - PE: pe.Config{Enabled: true}, +} + +func init() { + cfg.PE = pe.Config{Enabled: true} } func TestFilterCompile(t *testing.T) { diff --git a/pkg/filter/ql/function.go b/pkg/filter/ql/function.go index 56d8c7f51..ee35c61da 100644 --- a/pkg/filter/ql/function.go +++ b/pkg/filter/ql/function.go @@ -21,14 +21,12 @@ package ql import ( "fmt" "maps" - "path/filepath" "regexp" "sort" "strings" "github.com/rabbitstack/fibratus/pkg/callstack" "github.com/rabbitstack/fibratus/pkg/filter/fields" - "github.com/rabbitstack/fibratus/pkg/pe" pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" "github.com/rabbitstack/fibratus/pkg/filter/ql/functions" @@ -68,7 +66,6 @@ var funcs = map[string]FunctionDef{ functions.SubstrFn.String(): &functions.Substr{}, functions.EntropyFn.String(): &functions.Entropy{}, functions.RegexFn.String(): functions.NewRegex(), - functions.IsMinidumpFn.String(): &functions.IsMinidump{}, functions.BaseFn.String(): &functions.Base{}, functions.DirFn.String(): &functions.Dir{}, functions.SymlinkFn.String(): &functions.Symlink{}, @@ -76,7 +73,6 @@ var funcs = map[string]FunctionDef{ functions.GlobFn.String(): &functions.Glob{}, functions.IsAbsFn.String(): &functions.IsAbs{}, functions.VolumeFn.String(): &functions.Volume{}, - functions.GetRegValueFn.String(): &functions.GetRegValue{}, functions.YaraFn.String(): &functions.Yara{}, functions.ForeachFn.String(): &Foreach{}, functions.CountFn.String(): &functions.Count{}, @@ -219,35 +215,19 @@ func (f *Foreach) Call(args []interface{}) (interface{}, bool) { return true, true } } - case []pstypes.Module: - for _, mod := range elems { - if f.evalExpr(e, useCallValuer, f.moduleMapValuer(segments, mod), valuer) { - return true, true - } - } - case map[uint32]pstypes.Thread: - for _, thread := range elems { - if f.evalExpr(e, useCallValuer, f.threadMapValuer(segments, thread), valuer) { - return true, true - } - } case []pstypes.Mmap: for _, mmap := range elems { if f.evalExpr(e, useCallValuer, f.mmapMapValuer(segments, mmap), valuer) { return true, true } } - case []pe.Sec: - for _, sec := range elems { - if f.evalExpr(e, useCallValuer, f.sectionMapValuer(segments, sec), valuer) { - return true, true - } - } case callstack.Callstack: if ok, matched := f.foreachCallstack(elems, segments, e, useCallValuer, valuer); ok { return matched, true } return false, false + default: + return f.foreachPlatform(elems, segments, e, useCallValuer, valuer) } return false, false @@ -410,27 +390,6 @@ func (f *Foreach) stringMapValuer(v *BareBoundVariableLiteral, s string) MapValu return MapValuer{v.Value: s} } -// moduleMapValuer returns the map valuer with process module attributes. -func (f *Foreach) moduleMapValuer(segments []*BoundSegmentLiteral, mod pstypes.Module) MapValuer { - var valuer = MapValuer{} - for _, seg := range segments { - key := seg.Value - switch seg.Segment { - case fields.PathSegment: - valuer[key] = mod.Name - case fields.NameSegment: - valuer[key] = filepath.Base(mod.Name) - case fields.AddressSegment: - valuer[key] = mod.BaseAddress.String() - case fields.SizeSegment: - valuer[key] = mod.Size - case fields.ChecksumSegment: - valuer[key] = mod.Checksum - } - } - return valuer -} - // procMapValuer returns the map valuer with process attributes. func (f *Foreach) procMapValuer(segments []*BoundSegmentLiteral, proc *pstypes.PS) MapValuer { var valuer = MapValuer{} @@ -449,45 +408,11 @@ func (f *Foreach) procMapValuer(segments []*BoundSegmentLiteral, proc *pstypes.P valuer[key] = proc.Args case fields.CwdSegment: valuer[key] = proc.Cwd - case fields.SIDSegment: - valuer[key] = proc.SID - case fields.SessionIDSegment: - valuer[key] = proc.SessionID case fields.UsernameSegment: valuer[key] = proc.Username - case fields.DomainSegment: - valuer[key] = proc.Domain - case fields.TokenIntegrityLevelSegment: - valuer[key] = proc.TokenIntegrityLevel - case fields.TokenIsElevatedSegment: - valuer[key] = proc.IsTokenElevated - case fields.TokenElevationTypeSegment: - valuer[key] = proc.TokenElevationType - } - } - return valuer -} - -// threadMapValuer returns the map valuer with thread information. -func (f *Foreach) threadMapValuer(segments []*BoundSegmentLiteral, thread pstypes.Thread) MapValuer { - var valuer = MapValuer{} - for _, seg := range segments { - key := seg.Value - switch seg.Segment { - case fields.TidSegment: - valuer[key] = thread.Tid - case fields.StartAddressSegment: - valuer[key] = thread.StartAddress.String() - case fields.UserStackBaseSegment: - valuer[key] = thread.UstackBase.String() - case fields.UserStackLimitSegment: - valuer[key] = thread.UstackLimit.String() - case fields.KernelStackBaseSegment: - valuer[key] = thread.KstackBase.String() - case fields.KernelStackLimitSegment: - valuer[key] = thread.KstackLimit.String() } } + addPlatformProcessValues(segments, proc, valuer) return valuer } @@ -511,22 +436,3 @@ func (f *Foreach) mmapMapValuer(segments []*BoundSegmentLiteral, mmap pstypes.Mm } return valuer } - -// sectionMapValuer returns map valuer with PE section data. -func (f *Foreach) sectionMapValuer(segments []*BoundSegmentLiteral, section pe.Sec) MapValuer { - var valuer = MapValuer{} - for _, seg := range segments { - key := seg.Value - switch seg.Segment { - case fields.NameSegment: - valuer[key] = section.Name - case fields.SizeSegment: - valuer[key] = section.Size - case fields.EntropySegment: - valuer[key] = section.Entropy - case fields.MD5Segment: - valuer[key] = section.Md5 - } - } - return valuer -} diff --git a/pkg/filter/ql/function_callstack_linux.go b/pkg/filter/ql/function_linux.go similarity index 62% rename from pkg/filter/ql/function_callstack_linux.go rename to pkg/filter/ql/function_linux.go index 3f0754c58..771982b79 100644 --- a/pkg/filter/ql/function_callstack_linux.go +++ b/pkg/filter/ql/function_linux.go @@ -25,8 +25,38 @@ import ( "github.com/rabbitstack/fibratus/pkg/callstack" "github.com/rabbitstack/fibratus/pkg/filter/fields" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" ) +func (f *Foreach) foreachPlatform(elems interface{}, segments []*BoundSegmentLiteral, e interface{}, useCallValuer bool, valuer MapValuer) (bool, bool) { + threads, ok := elems.(map[uint64]pstypes.Thread) + if !ok { + return false, false + } + for _, thread := range threads { + if f.evalExpr(e, useCallValuer, f.threadMapValuer(segments, thread), valuer) { + return true, true + } + } + return false, false +} + +func addPlatformProcessValues(_ []*BoundSegmentLiteral, _ *pstypes.PS, _ MapValuer) {} + +// threadMapValuer returns the map valuer with Linux thread information. +func (f *Foreach) threadMapValuer(segments []*BoundSegmentLiteral, thread pstypes.Thread) MapValuer { + valuer := MapValuer{} + for _, seg := range segments { + switch seg.Segment { + case fields.TidSegment: + valuer[seg.Value] = thread.Tid + case fields.PIDSegment: + valuer[seg.Value] = thread.Pid + } + } + return valuer +} + func (f *Foreach) foreachCallstack(elems callstack.Callstack, segments []*BoundSegmentLiteral, e interface{}, useCallValuer bool, valuer MapValuer) (bool, bool) { for _, frame := range elems { if f.evalExpr(e, useCallValuer, f.callstackMapValuer(segments, frame), valuer) { diff --git a/pkg/filter/ql/function_callstack_windows.go b/pkg/filter/ql/function_windows.go similarity index 51% rename from pkg/filter/ql/function_callstack_windows.go rename to pkg/filter/ql/function_windows.go index d8434036e..b8a527756 100644 --- a/pkg/filter/ql/function_callstack_windows.go +++ b/pkg/filter/ql/function_windows.go @@ -22,12 +22,125 @@ package ql import ( + "path/filepath" + "github.com/rabbitstack/fibratus/pkg/callstack" "github.com/rabbitstack/fibratus/pkg/filter/fields" + "github.com/rabbitstack/fibratus/pkg/filter/ql/functions" + "github.com/rabbitstack/fibratus/pkg/pe" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" "github.com/rabbitstack/fibratus/pkg/util/signature" "golang.org/x/sys/windows" ) +func init() { + funcs[functions.IsMinidumpFn.String()] = &functions.IsMinidump{} + funcs[functions.GetRegValueFn.String()] = &functions.GetRegValue{} +} + +func (f *Foreach) foreachPlatform(elems interface{}, segments []*BoundSegmentLiteral, e interface{}, useCallValuer bool, valuer MapValuer) (bool, bool) { + switch elems := elems.(type) { + case []pstypes.Module: + for _, mod := range elems { + if f.evalExpr(e, useCallValuer, f.moduleMapValuer(segments, mod), valuer) { + return true, true + } + } + case map[uint32]pstypes.Thread: + for _, thread := range elems { + if f.evalExpr(e, useCallValuer, f.threadMapValuer(segments, thread), valuer) { + return true, true + } + } + case []pe.Sec: + for _, sec := range elems { + if f.evalExpr(e, useCallValuer, f.sectionMapValuer(segments, sec), valuer) { + return true, true + } + } + } + return false, false +} + +func addPlatformProcessValues(segments []*BoundSegmentLiteral, proc *pstypes.PS, valuer MapValuer) { + for _, seg := range segments { + switch seg.Segment { + case fields.SIDSegment: + valuer[seg.Value] = proc.SID + case fields.SessionIDSegment: + valuer[seg.Value] = proc.SessionID + case fields.DomainSegment: + valuer[seg.Value] = proc.Domain + case fields.TokenIntegrityLevelSegment: + valuer[seg.Value] = proc.TokenIntegrityLevel + case fields.TokenIsElevatedSegment: + valuer[seg.Value] = proc.IsTokenElevated + case fields.TokenElevationTypeSegment: + valuer[seg.Value] = proc.TokenElevationType + } + } +} + +// moduleMapValuer returns the map valuer with process module attributes. +func (f *Foreach) moduleMapValuer(segments []*BoundSegmentLiteral, mod pstypes.Module) MapValuer { + valuer := MapValuer{} + for _, seg := range segments { + switch seg.Segment { + case fields.PathSegment: + valuer[seg.Value] = mod.Name + case fields.NameSegment: + valuer[seg.Value] = filepath.Base(mod.Name) + case fields.AddressSegment: + valuer[seg.Value] = mod.BaseAddress.String() + case fields.SizeSegment: + valuer[seg.Value] = mod.Size + case fields.ChecksumSegment: + valuer[seg.Value] = mod.Checksum + } + } + return valuer +} + +// threadMapValuer returns the map valuer with thread information. +func (f *Foreach) threadMapValuer(segments []*BoundSegmentLiteral, thread pstypes.Thread) MapValuer { + valuer := MapValuer{} + for _, seg := range segments { + switch seg.Segment { + case fields.TidSegment: + valuer[seg.Value] = thread.Tid + case fields.StartAddressSegment: + valuer[seg.Value] = thread.StartAddress.String() + case fields.UserStackBaseSegment: + valuer[seg.Value] = thread.UstackBase.String() + case fields.UserStackLimitSegment: + valuer[seg.Value] = thread.UstackLimit.String() + case fields.KernelStackBaseSegment: + valuer[seg.Value] = thread.KstackBase.String() + case fields.KernelStackLimitSegment: + valuer[seg.Value] = thread.KstackLimit.String() + } + } + return valuer +} + +// sectionMapValuer returns map valuer with PE section data. +func (f *Foreach) sectionMapValuer(segments []*BoundSegmentLiteral, section pe.Sec) MapValuer { + valuer := MapValuer{} + for _, seg := range segments { + switch seg.Segment { + case fields.NameSegment: + valuer[seg.Value] = section.Name + case fields.SizeSegment: + valuer[seg.Value] = section.Size + case fields.EntropySegment: + valuer[seg.Value] = section.Entropy + case fields.MD5Segment: + valuer[seg.Value] = section.Md5 + } + } + return valuer +} + // foreachCallstack evaluates the predicate against callstack frames. // The first return value indicates whether callstack handling applied; // the second is the match result. diff --git a/pkg/filter/ql/function_test.go b/pkg/filter/ql/function_windows_test.go similarity index 100% rename from pkg/filter/ql/function_test.go rename to pkg/filter/ql/function_windows_test.go diff --git a/pkg/filter/ql/functions/base_test.go b/pkg/filter/ql/functions/base_windows_test.go similarity index 100% rename from pkg/filter/ql/functions/base_test.go rename to pkg/filter/ql/functions/base_windows_test.go diff --git a/pkg/filter/ql/functions/dir_test.go b/pkg/filter/ql/functions/dir_windows_test.go similarity index 100% rename from pkg/filter/ql/functions/dir_test.go rename to pkg/filter/ql/functions/dir_windows_test.go diff --git a/pkg/filter/ql/functions/glob_test.go b/pkg/filter/ql/functions/glob_windows_test.go similarity index 100% rename from pkg/filter/ql/functions/glob_test.go rename to pkg/filter/ql/functions/glob_windows_test.go diff --git a/pkg/filter/ql/functions/is_abs_test.go b/pkg/filter/ql/functions/is_abs_windows_test.go similarity index 100% rename from pkg/filter/ql/functions/is_abs_test.go rename to pkg/filter/ql/functions/is_abs_windows_test.go diff --git a/pkg/filter/ql/functions/volume_test.go b/pkg/filter/ql/functions/volume_windows_test.go similarity index 100% rename from pkg/filter/ql/functions/volume_test.go rename to pkg/filter/ql/functions/volume_windows_test.go diff --git a/pkg/filter/ql/literal_test.go b/pkg/filter/ql/literal_windows_test.go similarity index 100% rename from pkg/filter/ql/literal_test.go rename to pkg/filter/ql/literal_windows_test.go diff --git a/pkg/filter/ql/parser_test.go b/pkg/filter/ql/parser_windows_test.go similarity index 100% rename from pkg/filter/ql/parser_test.go rename to pkg/filter/ql/parser_windows_test.go diff --git a/pkg/filter/util.go b/pkg/filter/util.go index 700b07d07..dce09e5b7 100644 --- a/pkg/filter/util.go +++ b/pkg/filter/util.go @@ -23,18 +23,9 @@ import ( "net" "strings" - "github.com/rabbitstack/fibratus/pkg/event" "github.com/rabbitstack/fibratus/pkg/util/bytes" ) -// framePID returns the pid associated with the stack frame. -func framePID(e *event.Event) event.PID { - if !e.Callstack.IsEmpty() && e.Callstack.FrameAt(0).PID != 0 { - return event.PID(e.Callstack.FrameAt(0).PID) - } - return e.PID -} - // CompareSeqLink returns true if any value // in the sequence link slice equals to the // given LHS value. diff --git a/pkg/filter/ql/functions/get_reg_value_linux.go b/pkg/filter/util_linux.go similarity index 72% rename from pkg/filter/ql/functions/get_reg_value_linux.go rename to pkg/filter/util_linux.go index 6295a79cd..752ccdb36 100644 --- a/pkg/filter/ql/functions/get_reg_value_linux.go +++ b/pkg/filter/util_linux.go @@ -18,12 +18,11 @@ * limitations under the License. */ -package functions +package filter -type GetRegValue struct{} +import "github.com/rabbitstack/fibratus/pkg/event" -func (GetRegValue) Call([]interface{}) (interface{}, bool) { return nil, false } -func (GetRegValue) Desc() FunctionDesc { - return FunctionDesc{Name: GetRegValueFn} +// framePID returns the process identifier associated with the event. +func framePID(e *event.Event) event.PID { + return e.PID } -func (GetRegValue) Name() Fn { return GetRegValueFn } diff --git a/pkg/filter/accessor_narrow_linux.go b/pkg/filter/util_windows.go similarity index 60% rename from pkg/filter/accessor_narrow_linux.go rename to pkg/filter/util_windows.go index 1e9105ca0..2983997c5 100644 --- a/pkg/filter/accessor_narrow_linux.go +++ b/pkg/filter/util_windows.go @@ -1,6 +1,7 @@ -//go:build linux +//go:build windows /* + * Copyright 2021-present by Nedim Sabic Sabic * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io * All Rights Reserved. @@ -20,23 +21,12 @@ package filter -func (f *filter) pruneUnusedAccessors() { - removeEvtAccessor := true - removePsAccessor := true +import "github.com/rabbitstack/fibratus/pkg/event" - for _, field := range f.fields { - switch { - case field.Name.IsEvtField() || field.Name.IsKevtField(): - removeEvtAccessor = false - case field.Name.IsPsField(): - removePsAccessor = false - } - } - - if removeEvtAccessor { - f.removeAccessor(&evtAccessor{}) - } - if removePsAccessor { - f.removeAccessor(&psAccessor{}) +// framePID returns the process identifier associated with the stack frame. +func framePID(e *event.Event) event.PID { + if !e.Callstack.IsEmpty() && e.Callstack.FrameAt(0).PID != 0 { + return event.PID(e.Callstack.FrameAt(0).PID) } + return e.PID } diff --git a/pkg/rules/action/kill_linux.go b/pkg/rules/action/kill_linux.go index 04ff289f8..1cc0bbbb0 100644 --- a/pkg/rules/action/kill_linux.go +++ b/pkg/rules/action/kill_linux.go @@ -20,10 +20,14 @@ package action -import "fmt" +import ( + "fmt" + + "github.com/rabbitstack/fibratus/pkg/event" +) // Kill terminates all processes with specified pids. // The signal-based Linux implementation lands with the detection work. -func Kill(pids []uint32) error { +func Kill(pids []event.PID) error { return fmt.Errorf("kill action is not implemented on Linux yet (pids=%v)", pids) } diff --git a/pkg/rules/action/kill_windows.go b/pkg/rules/action/kill_windows.go index 926414441..1b2bf830a 100644 --- a/pkg/rules/action/kill_windows.go +++ b/pkg/rules/action/kill_windows.go @@ -20,14 +20,16 @@ package action import ( "fmt" - "github.com/rabbitstack/fibratus/pkg/util/multierror" - "golang.org/x/sys/windows" "os" "syscall" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/util/multierror" + "golang.org/x/sys/windows" ) // Kill terminates all processes with specified pids. -func Kill(pids []uint32) error { +func Kill(pids []event.PID) error { errs := make([]error, 0) for _, pid := range pids { err := terminate(pid) diff --git a/pkg/rules/compiler.go b/pkg/rules/compiler.go index a45a87bc4..bd320eec8 100644 --- a/pkg/rules/compiler.go +++ b/pkg/rules/compiler.go @@ -220,33 +220,6 @@ func (c *compiler) visitApproverPredicates(node ql.Node) { ql.WalkFunc(node, walk) } -// referencesTargetEvents checks whether the rule AST contains -// an event type filter for high-volume events we want to approve. -func (c *compiler) referencesApproverEvents(root ql.Node) bool { - var found bool - ql.WalkFunc(root, func(n ql.Node) { - expr, ok := n.(*ql.BinaryExpr) - if !ok { - return - } - - // direct event match. We also include SetFileInformation - // to approve any paths referenced in the condition - if c.containsEventTypes(expr, event.RegOpenKey, event.OpenThread, event.OpenProcess, event.SetFileInformation) { - found = true - return - } - - // for file events require open file operation - if expr.Op == ql.And { - if c.containsEventTypes(expr, event.CreateFile) && c.containsFieldMatch(expr, fields.FileOperation, ql.Eq, "OPEN") { - found = true - } - } - }) - return found -} - func (c *compiler) containsEventTypes(root ql.Node, types ...event.Type) bool { var contains bool ql.WalkFunc(root, func(n ql.Node) { @@ -381,6 +354,9 @@ func (c *compiler) buildCompileResult(filters map[*config.FilterConfig]filter.Fi events = append(events, typ) m[typ] = true + + updatePlatformCompileResult(rs, typ) + } } } diff --git a/pkg/filter/ql/functions/minidump_linux.go b/pkg/rules/compiler_linux.go similarity index 56% rename from pkg/filter/ql/functions/minidump_linux.go rename to pkg/rules/compiler_linux.go index 98e57df6b..e6dbf4d9a 100644 --- a/pkg/filter/ql/functions/minidump_linux.go +++ b/pkg/rules/compiler_linux.go @@ -18,22 +18,16 @@ * limitations under the License. */ -package functions +package rules -// IsMinidump determines if the specified file contains the minidump signature. -type IsMinidump struct{} +import ( + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/filter/ql" +) -func (f IsMinidump) Call(args []interface{}) (interface{}, bool) { - return false, len(args) >= 1 +func (*compiler) referencesApproverEvents(ql.Node) bool { + return false } -func (f IsMinidump) Desc() FunctionDesc { - return FunctionDesc{ - Name: IsMinidumpFn, - Args: []FunctionArgDesc{ - {Keyword: "file", Types: []ArgType{Field, BoundField, BoundSegment, BareBoundVariable, Func, String}, Required: true}, - }, - } -} - -func (f IsMinidump) Name() Fn { return IsMinidumpFn } +func updatePlatformCompileResult(*config.RulesCompileResult, event.Type) {} diff --git a/pkg/rules/compiler_linux_test.go b/pkg/rules/compiler_linux_test.go new file mode 100644 index 000000000..5ab4c325b --- /dev/null +++ b/pkg/rules/compiler_linux_test.go @@ -0,0 +1,52 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package rules + +import ( + "os" + "path/filepath" + "testing" + + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/ps" + "github.com/stretchr/testify/require" +) + +func TestCompilerLinuxRule(t *testing.T) { + rule := filepath.Join(t.TempDir(), "execve.yml") + require.NoError(t, os.WriteFile(rule, []byte(`name: Linux process execution +id: 4d17dc44-cc9f-4f13-9a31-23c6529ff46e +version: 1.0.0 +min-engine-version: 3.0.0 +condition: evt.name = 'execve' and ps.name = 'bash' +`), 0o600)) + + cfg := &config.Config{ + Filters: &config.Filters{ + Rules: config.Rules{FromPaths: []string{rule}}, + }, + } + filters, result, err := newCompiler(ps.NewSnapshotter(), cfg).compile() + require.NoError(t, err) + require.Len(t, filters, 1) + require.NotNil(t, result) + require.True(t, result.HasProcEvents) +} diff --git a/pkg/rules/compiler_windows.go b/pkg/rules/compiler_windows.go new file mode 100644 index 000000000..8b8320cc2 --- /dev/null +++ b/pkg/rules/compiler_windows.go @@ -0,0 +1,63 @@ +//go:build windows + +/* + * Copyright 2021-present by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package rules + +import ( + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/filter/fields" + "github.com/rabbitstack/fibratus/pkg/filter/ql" +) + +// referencesApproverEvents checks whether the rule AST contains an event type +// filter for high-volume Windows events that can be approved by the source. +func (c *compiler) referencesApproverEvents(root ql.Node) bool { + var found bool + ql.WalkFunc(root, func(n ql.Node) { + expr, ok := n.(*ql.BinaryExpr) + if !ok { + return + } + + if c.containsEventTypes(expr, event.RegOpenKey, event.OpenThread, event.OpenProcess, event.SetFileInformation) { + found = true + return + } + + if expr.Op == ql.And && + c.containsEventTypes(expr, event.CreateFile) && + c.containsFieldMatch(expr, fields.FileOperation, ql.Eq, "OPEN") { + found = true + } + }) + return found +} + +func updatePlatformCompileResult(rs *config.RulesCompileResult, typ event.Type) { + if typ == event.MapViewFile || typ == event.UnmapViewFile { + rs.HasVAMapEvents = true + } + if typ == event.OpenProcess || typ == event.OpenThread || typ == event.SetThreadContext || + typ == event.CreateSymbolicLinkObject { + rs.HasAuditAPIEvents = true + } +} diff --git a/pkg/rules/compiler_test.go b/pkg/rules/compiler_windows_test.go similarity index 100% rename from pkg/rules/compiler_test.go rename to pkg/rules/compiler_windows_test.go diff --git a/pkg/rules/engine_test.go b/pkg/rules/engine_windows_test.go similarity index 100% rename from pkg/rules/engine_test.go rename to pkg/rules/engine_windows_test.go diff --git a/pkg/rules/sequence.go b/pkg/rules/sequence.go index d6cc20a90..58d335696 100644 --- a/pkg/rules/sequence.go +++ b/pkg/rules/sequence.go @@ -567,10 +567,10 @@ func (s *sequenceState) expire(e *event.Event) bool { // to the final sequence slot, it is safe to expire // the whole sequence pid := event.PID(rhs.Params.MustGetPid()) - if lhs.Type == event.CreateProcess && isFinalSlot { + if lhs.IsCreateProcess() && isFinalSlot { return event.PID(lhs.Params.MustGetPid()) == pid } - if lhs.Type == event.CreateThread { + if lhs.IsCreateThread() { // if the pids differ, the thread // is created in a remote process. // Sequence can be expired only if diff --git a/pkg/rules/sequence_test.go b/pkg/rules/sequence_windows_test.go similarity index 100% rename from pkg/rules/sequence_test.go rename to pkg/rules/sequence_windows_test.go From 241679482f96930b7857c3c5290df2d0f001dd3b Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 10 Aug 2026 23:36:45 +0200 Subject: [PATCH 26/65] refactor(ps): remove Windows concepts from Linux process state Model Linux process/thread state with 64-bit identifiers and Linux-native resources, expose stable process UUIDs, and remove redundant snapshot operations. Split alert serialization and utility implementations by platform, dropping Linux PE, registry, and NTSTATUS stubs. --- pkg/alertsender/alert.go | 172 +++--------------- pkg/alertsender/alert_process_linux.go | 68 +++++++ pkg/alertsender/alert_process_windows.go | 88 +++++++++ pkg/pe/types_linux.go | 36 ---- pkg/ps/process_key.go | 25 --- pkg/ps/snapshotter_linux.go | 13 +- pkg/ps/types/types_linux.go | 134 ++++++++------ .../types/types_linux_test.go} | 16 +- .../{colorizer_stub.go => colorizer_linux.go} | 2 +- pkg/util/log/{logger.go => logger_windows.go} | 9 +- ...{logger_test.go => logger_windows_test.go} | 5 +- pkg/util/ntstatus/status_linux.go | 35 ---- 12 files changed, 283 insertions(+), 320 deletions(-) create mode 100644 pkg/alertsender/alert_process_linux.go create mode 100644 pkg/alertsender/alert_process_windows.go delete mode 100644 pkg/pe/types_linux.go delete mode 100644 pkg/ps/process_key.go rename pkg/{util/key/key_linux.go => ps/types/types_linux_test.go} (68%) rename pkg/util/colorizer/{colorizer_stub.go => colorizer_linux.go} (97%) rename pkg/util/log/{logger.go => logger_windows.go} (99%) rename pkg/util/log/{logger_test.go => logger_windows_test.go} (99%) delete mode 100644 pkg/util/ntstatus/status_linux.go diff --git a/pkg/alertsender/alert.go b/pkg/alertsender/alert.go index fe9b846e8..1fa7f2331 100644 --- a/pkg/alertsender/alert.go +++ b/pkg/alertsender/alert.go @@ -166,115 +166,47 @@ func (a *Alert) MDToHTML() error { return nil } +type alertJSON struct { + ID string `json:"id"` + Title string `json:"title"` + Severity string `json:"severity"` + Text string `json:"text,omitempty"` + Description string `json:"description"` + Labels map[string]string `json:"labels,omitempty"` + Events []alertJSONEvent `json:"events"` +} + +type alertJSONEvent struct { + Name string `json:"name"` + Category string `json:"category"` + Timestamp time.Time `json:"timestamp"` + Params map[string]any `json:"params"` + Callstack []string `json:"callstack,omitempty"` + Proc *alertProcess `json:"proc,omitempty"` +} + // MarshalJSON encodes the alert to JSON format. func (a Alert) MarshalJSON() ([]byte, error) { - var msg = &struct { - ID string `json:"id"` - Title string `json:"title"` - Severity string `json:"severity"` - Text string `json:"text,omitempty"` - Description string `json:"description"` - Labels map[string]string `json:"labels,omitempty"` - Events []struct { - Name string `json:"name"` - Category string `json:"category"` - Timestamp time.Time `json:"timestamp"` - Params map[string]any `json:"params"` - Callstack []string `json:"callstack,omitempty"` - Proc *struct { - PID event.PID `json:"pid"` - TID uint32 `json:"tid"` - PPID event.PID `json:"ppid"` - Name string `json:"name"` - Exe string `json:"exe"` - Cmdline string `json:"cmdline,omitempty"` - Pname string `json:"parent_name,omitempty"` - Pcmdline string `json:"parent_cmdline,omitempty"` - Cwd string `json:"cwd,omitempty"` - SID string `json:"sid"` - Username string `json:"username"` - Domain string `json:"domain"` - SessionID uint32 `json:"session_id"` - IntegrityLevel string `json:"integrity_level"` - IsWOW64 bool `json:"is_wow64"` - IsPackaged bool `json:"is_packaged"` - IsProtected bool `json:"is_protected"` - Ancestors []string `json:"ancestors"` - } `json:"proc,omitempty"` - } `json:"events"` - }{ + msg := alertJSON{ ID: a.ID, Title: a.Title, Severity: a.Severity.String(), Text: a.Text, Description: a.Description, Labels: a.Labels, + Events: make([]alertJSONEvent, 0, len(a.Events)), } - events := make([]struct { - Name string `json:"name"` - Category string `json:"category"` - Timestamp time.Time `json:"timestamp"` - Params map[string]any `json:"params"` - Callstack []string `json:"callstack,omitempty"` - Proc *struct { - PID event.PID `json:"pid"` - TID uint32 `json:"tid"` - PPID event.PID `json:"ppid"` - Name string `json:"name"` - Exe string `json:"exe"` - Cmdline string `json:"cmdline,omitempty"` - Pname string `json:"parent_name,omitempty"` - Pcmdline string `json:"parent_cmdline,omitempty"` - Cwd string `json:"cwd,omitempty"` - SID string `json:"sid"` - Username string `json:"username"` - Domain string `json:"domain"` - SessionID uint32 `json:"session_id"` - IntegrityLevel string `json:"integrity_level"` - IsWOW64 bool `json:"is_wow64"` - IsPackaged bool `json:"is_packaged"` - IsProtected bool `json:"is_protected"` - Ancestors []string `json:"ancestors"` - } `json:"proc,omitempty"` - }, 0, len(a.Events)) - for _, e := range a.Events { - var evt = struct { - Name string `json:"name"` - Category string `json:"category"` - Timestamp time.Time `json:"timestamp"` - Params map[string]any `json:"params"` - Callstack []string `json:"callstack,omitempty"` - Proc *struct { - PID event.PID `json:"pid"` - TID uint32 `json:"tid"` - PPID event.PID `json:"ppid"` - Name string `json:"name"` - Exe string `json:"exe"` - Cmdline string `json:"cmdline,omitempty"` - Pname string `json:"parent_name,omitempty"` - Pcmdline string `json:"parent_cmdline,omitempty"` - Cwd string `json:"cwd,omitempty"` - SID string `json:"sid"` - Username string `json:"username"` - Domain string `json:"domain"` - SessionID uint32 `json:"session_id"` - IntegrityLevel string `json:"integrity_level"` - IsWOW64 bool `json:"is_wow64"` - IsPackaged bool `json:"is_packaged"` - IsProtected bool `json:"is_protected"` - Ancestors []string `json:"ancestors"` - } `json:"proc,omitempty"` - }{ + evt := alertJSONEvent{ Name: e.Name(), - Category: e.Category().String(), + Category: e.Category.String(), Timestamp: e.Timestamp, Params: make(map[string]any), - Callstack: make([]string, 0, len(e.Callstack)), + Callstack: alertCallstack(e), + Proc: newAlertProcess(e), } - // populate event parameters for _, param := range e.Params { if param.Type == params.Bool || param.Type == params.PID || param.Type == params.TID || param.Type == params.Port || param.IsNumber() { @@ -284,60 +216,8 @@ func (a Alert) MarshalJSON() ([]byte, error) { } } - // populate callstack - for i := range e.Callstack { - frame := e.Callstack[len(e.Callstack)-i-1] - evt.Callstack = append(evt.Callstack, fmt.Sprintf("%v %s!%s", frame.Addr, frame.Module, frame.Symbol)) - } - - ps := e.PS - if ps != nil { - evt.Proc = &struct { - PID event.PID `json:"pid"` - TID uint32 `json:"tid"` - PPID event.PID `json:"ppid"` - Name string `json:"name"` - Exe string `json:"exe"` - Cmdline string `json:"cmdline,omitempty"` - Pname string `json:"parent_name,omitempty"` - Pcmdline string `json:"parent_cmdline,omitempty"` - Cwd string `json:"cwd,omitempty"` - SID string `json:"sid"` - Username string `json:"username"` - Domain string `json:"domain"` - SessionID uint32 `json:"session_id"` - IntegrityLevel string `json:"integrity_level"` - IsWOW64 bool `json:"is_wow64"` - IsPackaged bool `json:"is_packaged"` - IsProtected bool `json:"is_protected"` - Ancestors []string `json:"ancestors"` - }{ - PID: ps.PID, - TID: e.Tid, - PPID: ps.Ppid, - Name: ps.Name, - Exe: ps.Exe, - Cmdline: ps.Cmdline, - Cwd: ps.Cwd, - SID: ps.SID, - Username: ps.Username, - Domain: ps.Domain, - SessionID: ps.SessionID, - IntegrityLevel: ps.TokenIntegrityLevel, - IsWOW64: ps.IsWOW64, - IsPackaged: ps.IsPackaged, - IsProtected: ps.IsProtected, - Ancestors: ps.Ancestors(), - } - if ps.Parent != nil { - evt.Proc.Pname = ps.Parent.Name - evt.Proc.Pcmdline = ps.Parent.Cmdline - } - } - - events = append(events, evt) + msg.Events = append(msg.Events, evt) } - msg.Events = events return json.Marshal(msg) } diff --git a/pkg/alertsender/alert_process_linux.go b/pkg/alertsender/alert_process_linux.go new file mode 100644 index 000000000..4f3703c11 --- /dev/null +++ b/pkg/alertsender/alert_process_linux.go @@ -0,0 +1,68 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package alertsender + +import "github.com/rabbitstack/fibratus/pkg/event" + +type alertProcess struct { + PID event.PID `json:"pid"` + TID event.TID `json:"tid"` + PPID event.PID `json:"ppid"` + Name string `json:"name"` + Exe string `json:"exe"` + Cmdline string `json:"cmdline,omitempty"` + Pname string `json:"parent_name,omitempty"` + Pcmdline string `json:"parent_cmdline,omitempty"` + Cwd string `json:"cwd,omitempty"` + UID uint32 `json:"uid"` + GID uint32 `json:"gid"` + Username string `json:"username"` + Ancestors []string `json:"ancestors"` +} + +func newAlertProcess(e *event.Event) *alertProcess { + if e.PS == nil { + return nil + } + proc := &alertProcess{ + PID: e.PS.PID, + TID: e.Tid, + PPID: e.PS.Ppid, + Name: e.PS.Name, + Exe: e.PS.Exe, + Cmdline: e.PS.Cmdline, + Cwd: e.PS.Cwd, + UID: e.PS.UID, + GID: e.PS.GID, + Username: e.PS.Username, + Ancestors: make([]string, 0), + } + proc.Ancestors = append(proc.Ancestors, e.PS.Ancestors()...) + if e.PS.Parent != nil { + proc.Pname = e.PS.Parent.Name + proc.Pcmdline = e.PS.Parent.Cmdline + } + return proc +} + +func alertCallstack(*event.Event) []string { + return nil +} diff --git a/pkg/alertsender/alert_process_windows.go b/pkg/alertsender/alert_process_windows.go new file mode 100644 index 000000000..c92870749 --- /dev/null +++ b/pkg/alertsender/alert_process_windows.go @@ -0,0 +1,88 @@ +//go:build windows + +/* + * Copyright 2021-2022 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package alertsender + +import ( + "fmt" + + "github.com/rabbitstack/fibratus/pkg/event" +) + +type alertProcess struct { + PID event.PID `json:"pid"` + TID event.TID `json:"tid"` + PPID event.PID `json:"ppid"` + Name string `json:"name"` + Exe string `json:"exe"` + Cmdline string `json:"cmdline,omitempty"` + Pname string `json:"parent_name,omitempty"` + Pcmdline string `json:"parent_cmdline,omitempty"` + Cwd string `json:"cwd,omitempty"` + SID string `json:"sid"` + Username string `json:"username"` + Domain string `json:"domain"` + SessionID uint32 `json:"session_id"` + IntegrityLevel string `json:"integrity_level"` + IsWOW64 bool `json:"is_wow64"` + IsPackaged bool `json:"is_packaged"` + IsProtected bool `json:"is_protected"` + Ancestors []string `json:"ancestors"` +} + +func newAlertProcess(e *event.Event) *alertProcess { + if e.PS == nil { + return nil + } + proc := &alertProcess{ + PID: e.PS.PID, + TID: e.Tid, + PPID: e.PS.Ppid, + Name: e.PS.Name, + Exe: e.PS.Exe, + Cmdline: e.PS.Cmdline, + Cwd: e.PS.Cwd, + SID: e.PS.SID, + Username: e.PS.Username, + Domain: e.PS.Domain, + SessionID: e.PS.SessionID, + IntegrityLevel: e.PS.TokenIntegrityLevel, + IsWOW64: e.PS.IsWOW64, + IsPackaged: e.PS.IsPackaged, + IsProtected: e.PS.IsProtected, + Ancestors: make([]string, 0), + } + proc.Ancestors = append(proc.Ancestors, e.PS.Ancestors()...) + if e.PS.Parent != nil { + proc.Pname = e.PS.Parent.Name + proc.Pcmdline = e.PS.Parent.Cmdline + } + return proc +} + +func alertCallstack(e *event.Event) []string { + callstack := make([]string, 0, len(e.Callstack)) + for i := range e.Callstack { + frame := e.Callstack[len(e.Callstack)-i-1] + callstack = append(callstack, fmt.Sprintf("%v %s!%s", frame.Addr, frame.Module, frame.Symbol)) + } + return callstack +} diff --git a/pkg/pe/types_linux.go b/pkg/pe/types_linux.go deleted file mode 100644 index 767bcaa34..000000000 --- a/pkg/pe/types_linux.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package pe - -import "fmt" - -// Sec contains section attributes. On Linux this is only used so -// shared filter foreach helpers can compile against pe.Sec. -type Sec struct { - Name string - Size uint32 - Entropy float64 - Md5 string -} - -func (s Sec) String() string { - return fmt.Sprintf("Name: %s, Size: %d, Entropy: %f, Md5: %s", s.Name, s.Size, s.Entropy, s.Md5) -} diff --git a/pkg/ps/process_key.go b/pkg/ps/process_key.go deleted file mode 100644 index 250edf1b0..000000000 --- a/pkg/ps/process_key.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ps - -// ProcessKey uniquely identifies a process instance across PID reuse. -type ProcessKey struct { - PID uint32 - StartBootTime uint64 -} diff --git a/pkg/ps/snapshotter_linux.go b/pkg/ps/snapshotter_linux.go index 37b049397..d1f49bcb7 100644 --- a/pkg/ps/snapshotter_linux.go +++ b/pkg/ps/snapshotter_linux.go @@ -36,12 +36,11 @@ type Snapshotter interface { Remove(*event.Event) error // Find attempts to retrieve process state for the specified process identifier. Find(pid uint64) (bool, *pstypes.PS) - // FindAndPut attempts to retrieve process state and updates the snapshot when found. + // FindAndPut retrieves process state. Procfs fallback enrichment will be added + // when Linux capture is wired. FindAndPut(pid uint64) *pstypes.PS // Put inserts the process state into the snapshotter. Put(*pstypes.PS) - // UpsertSnapshot inserts or replaces process state. - UpsertSnapshot(*pstypes.PS) // Size returns the total number of process state items. Size() uint32 // Close closes the process snapshotter and disposes allocated resources. @@ -49,7 +48,7 @@ type Snapshotter interface { // AddThread builds thread state from the event representation. AddThread(*event.Event) error // RemoveThread removes the thread from the given process. - RemoveThread(pid uint64, tid uint32) error + RemoveThread(pid uint64, tid uint64) error // AddMmap adds a memory mapping to the process state. AddMmap(*event.Event) error // RemoveMmap removes a memory mapping at the given base address. @@ -90,10 +89,6 @@ func (s *snapshotter) Put(ps *pstypes.PS) { s.procs[ps.PID] = ps } -func (s *snapshotter) UpsertSnapshot(ps *pstypes.PS) { - s.Put(ps) -} - func (s *snapshotter) Write(evt *event.Event) error { if evt == nil || evt.PS == nil { return nil @@ -138,7 +133,7 @@ func (s *snapshotter) AddThread(evt *event.Event) error { return nil } -func (s *snapshotter) RemoveThread(pid uint64, tid uint32) error { +func (s *snapshotter) RemoveThread(pid uint64, tid uint64) error { ok, ps := s.Find(pid) if !ok || ps == nil { return nil diff --git a/pkg/ps/types/types_linux.go b/pkg/ps/types/types_linux.go index d70a71ffc..290c4e92f 100644 --- a/pkg/ps/types/types_linux.go +++ b/pkg/ps/types/types_linux.go @@ -21,60 +21,73 @@ package types import ( + "encoding/binary" "fmt" - "strings" + "hash/fnv" "sync" "time" "github.com/rabbitstack/fibratus/pkg/util/va" ) -// PE is a placeholder for PE metadata on Linux builds. -// Linux process images are ELF; this field exists so shared -// formatters/templates compile without Windows PE types. -type PE struct{} - -func (p *PE) String() string { return "" } - +// PS encapsulates Linux process state and its allocated resources. type PS struct { sync.RWMutex - PID uint64 `json:"pid"` - Ppid uint64 `json:"ppid"` - Name string `json:"name"` - Cmdline string `json:"comm"` - Exe string `json:"exe"` - Cwd string `json:"cwd"` - Args []string `json:"args"` - StartTime time.Time `json:"started"` - StartBootTime uint64 `json:"start_boot_time"` - UID uint32 `json:"uid"` - GID uint32 `json:"gid"` - Username string `json:"username"` - Domain string `json:"domain"` - SID string `json:"sid"` - SessionID uint32 `json:"session_id"` - TokenIntegrityLevel string `json:"token_integrity_level"` - TokenElevationType string `json:"token_elevation_type"` - IsTokenElevated bool `json:"is_token_elevated"` - IsWOW64 bool `json:"is_wow_64"` - IsPackaged bool `json:"is_packaged"` - IsProtected bool `json:"is_protected"` - Envs map[string]string `json:"envs"` - Parent *PS `json:"parent"` - Threads map[uint32]Thread `json:"-"` - Mmaps []Mmap `json:"mmaps"` - Modules []Module `json:"modules"` - PE *PE `json:"-"` + // PID is the thread group identifier. It is also the thread identifier of the main thread. + PID uint64 `json:"pid"` + // Ppid is the thread group identifier of the parent process. + Ppid uint64 `json:"ppid"` + // Name is the process name. + Name string `json:"name"` + // Cmdline is the full process command line. + Cmdline string `json:"comm"` + // Exe is the full path to the process executable. + Exe string `json:"exe"` + // Cwd is the current working directory of the process. + Cwd string `json:"cwd"` + // Args contains the process command-line arguments. + Args []string `json:"args"` + // StartTime is the wall-clock time when the process started. + StartTime time.Time `json:"started"` + // StartBootTime is the process start time measured from system boot. + StartBootTime uint64 `json:"start_boot_time"` + // UID is the real user identifier of the process. + UID uint32 `json:"uid"` + // GID is the real group identifier of the process. + GID uint32 `json:"gid"` + // Username is the name associated with UID. + Username string `json:"username"` + // Envs contains process environment variables indexed by name. + Envs map[string]string `json:"envs"` + // Parent references the parent process state when it is available. + Parent *PS `json:"parent"` + // Threads contains the threads that belong to this process. + Threads map[uint64]Thread `json:"-"` + // Mmaps contains the process memory mappings, including shared objects. + Mmaps []Mmap `json:"mmaps"` } +// UUID returns a stable identifier for this process instance. +func (ps *PS) UUID() uint64 { + var key [16]byte + binary.LittleEndian.PutUint64(key[:8], ps.PID) + binary.LittleEndian.PutUint64(key[8:], ps.StartBootTime) + h := fnv.New64a() + _, _ = h.Write(key[:]) + return h.Sum64() +} + +// String returns a string representation of the process state. func (ps *PS) String() string { return fmt.Sprintf("Pid: %d\nPpid: %d\nName: %s\nCmdline: %s\nExe: %s", ps.PID, ps.Ppid, ps.Name, ps.Cmdline, ps.Exe) } +// StringShort returns a compact string representation of the process state. func (ps *PS) StringShort() string { return ps.String() } +// Ancestors returns process ancestors as image name and process identifier pairs. func (ps *PS) Ancestors() []string { var ancestors []string Walk(func(parent *PS) { @@ -83,50 +96,56 @@ func (ps *PS) Ancestors() []string { return ancestors } +// Thread stores identifiers for a Linux thread. type Thread struct { - Tid uint32 - Pid uint64 - StartAddress va.Address - UstackBase va.Address - UstackLimit va.Address - KstackBase va.Address - KstackLimit va.Address -} - -type Module struct { - Name string - BaseAddress va.Address - Size uint64 - Checksum uint32 + // Tid is the thread identifier. + Tid uint64 + // Pid is the thread group identifier to which the thread belongs. + Pid uint64 } +// Mmap stores information about a process memory mapping. type Mmap struct { + // BaseAddress is the starting virtual address of the mapping. BaseAddress va.Address - Size uint64 - Protection uint32 - Type string - File string + // Size is the mapping size in bytes. + Size uint64 + // Protection is the mapping protection bitmask. + Protection uint32 + // Type describes the mapping type. + Type string + // File is the path backing the mapping, if any. + File string } +// ProtectMask returns the mapping protection in mask notation. func (m *Mmap) ProtectMask() string { return "" } +// AddThread adds a thread to the process state. func (ps *PS) AddThread(thread Thread) { + ps.Lock() + defer ps.Unlock() if ps.Threads == nil { - ps.Threads = make(map[uint32]Thread) + ps.Threads = make(map[uint64]Thread) } ps.Threads[thread.Tid] = thread } -func (ps *PS) RemoveThread(tid uint32) { +// RemoveThread removes a thread from the process state. +func (ps *PS) RemoveThread(tid uint64) { + ps.Lock() + defer ps.Unlock() delete(ps.Threads, tid) } +// AddMmap adds a memory mapping to the process state. func (ps *PS) AddMmap(mmap Mmap) { ps.Mmaps = append(ps.Mmaps, mmap) } +// RemoveMmap removes the memory mapping at the specified address. func (ps *PS) RemoveMmap(addr va.Address) { for i, mmap := range ps.Mmaps { if mmap.BaseAddress == addr { @@ -136,6 +155,7 @@ func (ps *PS) RemoveMmap(addr va.Address) { } } +// FindMmap returns the memory mapping at the specified address. func (ps *PS) FindMmap(addr va.Address) *Mmap { for i := range ps.Mmaps { if ps.Mmaps[i].BaseAddress == addr { @@ -144,7 +164,3 @@ func (ps *PS) FindMmap(addr va.Address) *Mmap { } return nil } - -func (ps *PS) IsSvchost() bool { - return strings.EqualFold(ps.Name, "svchost.exe") -} diff --git a/pkg/util/key/key_linux.go b/pkg/ps/types/types_linux_test.go similarity index 68% rename from pkg/util/key/key_linux.go rename to pkg/ps/types/types_linux_test.go index ba9fb74ab..981c7478b 100644 --- a/pkg/util/key/key_linux.go +++ b/pkg/ps/types/types_linux_test.go @@ -18,6 +18,18 @@ * limitations under the License. */ -package key +package types -var RegistryValueTypes = map[uint32]string{} +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestPSUUID(t *testing.T) { + process := &PS{PID: 42, StartBootTime: 100} + reusedPID := &PS{PID: 42, StartBootTime: 200} + + require.Equal(t, process.UUID(), process.UUID()) + require.NotEqual(t, process.UUID(), reusedPID.UUID()) +} diff --git a/pkg/util/colorizer/colorizer_stub.go b/pkg/util/colorizer/colorizer_linux.go similarity index 97% rename from pkg/util/colorizer/colorizer_stub.go rename to pkg/util/colorizer/colorizer_linux.go index dbf2e6a41..190af18c9 100644 --- a/pkg/util/colorizer/colorizer_stub.go +++ b/pkg/util/colorizer/colorizer_linux.go @@ -1,4 +1,4 @@ -//go:build !windows +//go:build linux /* * Copyright 2026 by Mostafa Moradian diff --git a/pkg/util/log/logger.go b/pkg/util/log/logger_windows.go similarity index 99% rename from pkg/util/log/logger.go rename to pkg/util/log/logger_windows.go index 452b15940..c9f32353d 100644 --- a/pkg/util/log/logger.go +++ b/pkg/util/log/logger_windows.go @@ -1,5 +1,3 @@ -//go:build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io @@ -24,15 +22,16 @@ import ( "errors" "expvar" "fmt" + "io" + "os" + "path/filepath" + "github.com/rabbitstack/fibratus/pkg/sys" "github.com/rabbitstack/fibratus/pkg/util/log/rotate" fs "github.com/rifflock/lfshook" "github.com/saferwall/pe/log" "github.com/sirupsen/logrus" "golang.org/x/sys/windows" - "io" - "os" - "path/filepath" ) var ( diff --git a/pkg/util/log/logger_test.go b/pkg/util/log/logger_windows_test.go similarity index 99% rename from pkg/util/log/logger_test.go rename to pkg/util/log/logger_windows_test.go index 928befd38..749932651 100644 --- a/pkg/util/log/logger_test.go +++ b/pkg/util/log/logger_windows_test.go @@ -19,10 +19,11 @@ package log import ( - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" "os" "testing" + + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" ) func TestInitFromConfig(t *testing.T) { diff --git a/pkg/util/ntstatus/status_linux.go b/pkg/util/ntstatus/status_linux.go deleted file mode 100644 index 59b931d0e..000000000 --- a/pkg/util/ntstatus/status_linux.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ntstatus - -import "fmt" - -// Success determines the success system message -const Success = "Success" - -// FormatMessage resolves a status code to a human-readable message. -// On Linux this returns a hex representation for non-zero codes. -func FormatMessage(status uint32) string { - if status == 0 { - return Success - } - return fmt.Sprintf("0x%x", status) -} From 52b9d4b2734f309d44a501a5a01d3c958bc7ab3e Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 12 Aug 2026 15:01:49 +0200 Subject: [PATCH 27/65] refactor(platform): align local transports and file layout Use UNIX domain sockets for Linux local API clients while retaining named pipes on Windows, with transport-specific coverage. Rename alert, process snapshotter, mock, and NTSTATUS files to match their platform responsibilities. --- ...{alert_process_linux.go => alert_linux.go} | 0 ...rt_process_windows.go => alert_windows.go} | 0 pkg/api/listener.go | 4 +- pkg/api/listener_linux.go | 11 +- pkg/api/listener_linux_test.go | 50 ++ pkg/ps/snapshotter.go | 71 -- pkg/ps/snapshotter_impl_windows.go | 756 +++++++++++++++++ ...er_mock.go => snapshotter_mock_windows.go} | 0 pkg/ps/snapshotter_windows.go | 777 ++---------------- .../ntstatus/{status_windows.go => status.go} | 0 pkg/util/rest/rest.go | 7 +- pkg/util/rest/rest_linux_test.go | 55 ++ pkg/util/rest/rest_test.go | 29 - pkg/util/rest/rest_windows_test.go | 57 ++ 14 files changed, 977 insertions(+), 840 deletions(-) rename pkg/alertsender/{alert_process_linux.go => alert_linux.go} (100%) rename pkg/alertsender/{alert_process_windows.go => alert_windows.go} (100%) create mode 100644 pkg/api/listener_linux_test.go delete mode 100644 pkg/ps/snapshotter.go create mode 100644 pkg/ps/snapshotter_impl_windows.go rename pkg/ps/{snapshotter_mock.go => snapshotter_mock_windows.go} (100%) rename pkg/util/ntstatus/{status_windows.go => status.go} (100%) create mode 100644 pkg/util/rest/rest_linux_test.go create mode 100644 pkg/util/rest/rest_windows_test.go diff --git a/pkg/alertsender/alert_process_linux.go b/pkg/alertsender/alert_linux.go similarity index 100% rename from pkg/alertsender/alert_process_linux.go rename to pkg/alertsender/alert_linux.go diff --git a/pkg/alertsender/alert_process_windows.go b/pkg/alertsender/alert_windows.go similarity index 100% rename from pkg/alertsender/alert_process_windows.go rename to pkg/alertsender/alert_windows.go diff --git a/pkg/api/listener.go b/pkg/api/listener.go index 433a9b9a6..f9eac573f 100644 --- a/pkg/api/listener.go +++ b/pkg/api/listener.go @@ -46,8 +46,8 @@ func makeTCPListener(addr string) (net.Listener, error) { return net.Listen("tcp", addr) } -// DialPipe creates a dialer to be used with the http.Client to connect to a named pipe. -func DialPipe(pipePath string) func(context.Context, string, string) (net.Conn, error) { +// DialLocalTransport creates a dialer for the Windows named pipe transport. +func DialLocalTransport(pipePath string) func(context.Context, string, string) (net.Conn, error) { npipe := transformPipePath(pipePath) return func(ctx context.Context, _, _ string) (net.Conn, error) { return winio.DialPipeContext(ctx, npipe) diff --git a/pkg/api/listener_linux.go b/pkg/api/listener_linux.go index a3aa832e2..cd145dc41 100644 --- a/pkg/api/listener_linux.go +++ b/pkg/api/listener_linux.go @@ -22,13 +22,14 @@ package api import ( "context" - "fmt" "net" + "strings" ) -// DialPipe is unavailable on Linux. The HTTP API uses TCP transports instead. -func DialPipe(pipePath string) func(context.Context, string, string) (net.Conn, error) { - return func(context.Context, string, string) (net.Conn, error) { - return nil, fmt.Errorf("named pipe transport %q is not supported on linux", pipePath) +// DialLocalTransport creates a dialer for the Linux UNIX domain socket transport. +func DialLocalTransport(path string) func(context.Context, string, string) (net.Conn, error) { + path = strings.TrimPrefix(path, "unix://") + return func(ctx context.Context, _, _ string) (net.Conn, error) { + return (&net.Dialer{}).DialContext(ctx, "unix", path) } } diff --git a/pkg/api/listener_linux_test.go b/pkg/api/listener_linux_test.go new file mode 100644 index 000000000..ef6d49a4f --- /dev/null +++ b/pkg/api/listener_linux_test.go @@ -0,0 +1,50 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package api + +import ( + "context" + "net" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestDialLocalTransport(t *testing.T) { + path := filepath.Join(t.TempDir(), "fibratus.sock") + listener, err := net.Listen("unix", path) + require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, listener.Close()) }) + + accepted := make(chan net.Conn, 1) + go func() { + conn, err := listener.Accept() + if err == nil { + accepted <- conn + } + }() + + conn, err := DialLocalTransport("unix://"+path)(context.Background(), "", "") + require.NoError(t, err) + require.NoError(t, conn.Close()) + require.NoError(t, (<-accepted).Close()) +} diff --git a/pkg/ps/snapshotter.go b/pkg/ps/snapshotter.go deleted file mode 100644 index 34f7997fa..000000000 --- a/pkg/ps/snapshotter.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build windows - -/* - * Copyright 2020-2021 by Nedim Sabic Sabic - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ps - -import ( - "github.com/rabbitstack/fibratus/pkg/event" - pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" - "github.com/rabbitstack/fibratus/pkg/util/va" -) - -// Snapshotter is the interface that exposes a set of methods all process snapshotters have to satisfy. It stores the state -// of all running processes in the system including its threads, dynamically loaded libraries, handles/file descriptors -// and other metadata. -type Snapshotter interface { - // Write appends a new process state to the snapshotter. It takes as an input the inbound event to fetch - // the basic data, but also enriches the process' state with extra metadata such as process' env variables, PE - // metadata for Windows binaries and so on. - Write(*event.Event) error - // AddThread builds thread state from the event representation. - AddThread(*event.Event) error - // AddModule builds module state from the event representation. - AddModule(*event.Event) error - // RemoveThread removes the thread from the given process. - RemoveThread(pid uint32, tid uint32) error - // RemoveModule removes the module the given process. - RemoveModule(pid uint32, addr va.Address) error - // AddMmap adds a new memory mapping (data memory-mapped file, image, or pagefile) to this process state. - AddMmap(*event.Event) error - // RemoveMmap removes memory mapping at the given base address. - RemoveMmap(pid uint32, addr va.Address) error - // WriteFromCapture appends a new process state to the snapshotter from the captured event. - WriteFromCapture(evt *event.Event) error - // Remove deletes process's state from the snapshotter. - Remove(evt *event.Event) error - // Find attempts to retrieve process' state for the specified process identifier. Returns true - // if the process was find in the state. Otherwise, returns false and constructs a fresh process - // state by querying the OS via API functions. - Find(pid uint32) (bool, *pstypes.PS) - // FindModule traverses loaded modules of all processes in the snapshot and - // if there is module with the specified base address, it returns its metadata. - FindModule(addr va.Address) (bool, *pstypes.Module) - // FindAllModules finds all unique modules across the snapshotter state. - FindAllModules() map[string]pstypes.Module - // FindAndPut attempts to retrieve process' state for the specified process identifier. - // If the process is found, the snapshotter state is updated with the new process. - FindAndPut(pid uint32) *pstypes.PS - // Put inserts the process state into snapshotter. - Put(*pstypes.PS) - // Size returns the total number of process state items. - Size() uint32 - // Close closes process snapshotter and disposes all allocated resources. - Close() error -} diff --git a/pkg/ps/snapshotter_impl_windows.go b/pkg/ps/snapshotter_impl_windows.go new file mode 100644 index 000000000..b17179ad4 --- /dev/null +++ b/pkg/ps/snapshotter_impl_windows.go @@ -0,0 +1,756 @@ +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ps + +import ( + "expvar" + "path/filepath" + "strconv" + "strings" + "sync" + "time" + + "github.com/rabbitstack/fibratus/pkg/sys" + "github.com/rabbitstack/fibratus/pkg/util/va" + "golang.org/x/sys/windows" + + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/handle" + htypes "github.com/rabbitstack/fibratus/pkg/handle/types" + "github.com/rabbitstack/fibratus/pkg/pe" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + log "github.com/sirupsen/logrus" +) + +// SystemPID designates the pid of the system process that acts as the container for system threads +const SystemPID uint32 = 4 + +var ( + // reapPeriod specifies the interval for triggering the housekeeping of dead processes + reapPeriod = time.Minute * 2 + + processLookupFailureCount = expvar.NewMap("process.lookup.failure.count") + reapedProcesses = expvar.NewInt("process.reaped") + processCount = expvar.NewInt("process.count") + threadCount = expvar.NewInt("process.thread.count") + moduleCount = expvar.NewInt("process.module.count") + mmapCount = expvar.NewInt("process.mmap.count") + pebReadErrors = expvar.NewInt("process.peb.read.errors") + processEnrichments = expvar.NewInt("process.enrichments") +) + +type snapshotter struct { + mu sync.RWMutex + procs map[uint32]*pstypes.PS + dirty map[uint32]*pstypes.PS + dmu sync.RWMutex + quit chan struct{} + config *config.Config + hsnap handle.Snapshotter + capture bool +} + +// NewSnapshotter returns a new instance of the process snapshotter. +func NewSnapshotter(hsnap handle.Snapshotter, config *config.Config) Snapshotter { + s := &snapshotter{ + procs: make(map[uint32]*pstypes.PS), + dirty: make(map[uint32]*pstypes.PS), + quit: make(chan struct{}, 1), + config: config, + hsnap: hsnap, + } + + s.mu.Lock() + defer s.mu.Unlock() + + s.hsnap.RegisterCreateCallback(s.onHandleCreated) + s.hsnap.RegisterDestroyCallback(s.onHandleDestroyed) + + go s.gcDeadProcesses() + + return s +} + +// NewSnapshotterFromCapture restores the snapshotter state from the cap file. +func NewSnapshotterFromCapture(hsnap handle.Snapshotter, config *config.Config) Snapshotter { + s := &snapshotter{ + procs: make(map[uint32]*pstypes.PS), + dirty: make(map[uint32]*pstypes.PS), + quit: make(chan struct{}, 1), + config: config, + hsnap: hsnap, + capture: true, + } + + s.hsnap.RegisterCreateCallback(s.onHandleCreated) + s.hsnap.RegisterDestroyCallback(s.onHandleDestroyed) + + return s +} + +func (s *snapshotter) WriteFromCapture(e *event.Event) error { + switch e.Type { + case event.CreateProcess, event.ProcessRundown: + s.mu.Lock() + defer s.mu.Unlock() + proc := e.PS + if proc == nil { + return nil + } + pid, err := e.Params.GetPid() + if err != nil { + return err + } + ppid, err := e.Params.GetPpid() + if err != nil { + return err + } + if proc.PID == proc.Ppid || + (e.IsProcessRundown() && pid == sys.InvalidProcessID) { + return nil + } + if e.IsProcessRundown() { + proc.Parent = s.procs[ppid] + } else { + proc, err = s.newProcState(pid, ppid, e) + if err != nil { + return err + } + } + s.procs[pid] = proc + case event.CreateThread, event.ThreadRundown: + return s.AddThread(e) + case event.LoadModule, event.ModuleRundown: + return s.AddModule(e) + } + return nil +} + +func (s *snapshotter) Write(e *event.Event) error { + s.mu.Lock() + defer s.mu.Unlock() + processCount.Add(1) + + pid, err := e.Params.GetPid() + if err != nil { + return err + } + ppid, err := e.Params.GetPpid() + if err != nil { + return err + } + + proc, err := s.newProcState(pid, ppid, e) + if ps := s.procs[pid]; ps == nil && (e.IsCreateProcessInternal() || e.IsProcessRundownInternal()) { + // only modify the state if there is no process derived from the NT kernel logger process events + s.procs[pid] = proc + } else if ps, ok := s.procs[pid]; ok && (e.IsCreateProcessInternal() || e.IsProcessRundownInternal()) && ps.IsCreatedFromSystemLogger { + // process state derived from the core kernel events exists - enrich it + ps.TokenIntegrityLevel = proc.TokenIntegrityLevel + ps.TokenElevationType = proc.TokenElevationType + ps.IsTokenElevated = proc.IsTokenElevated + if strings.EqualFold(ps.Name, filepath.Base(proc.Exe)) && len(proc.Exe) > len(ps.Exe) { + // prefer full executable path + ps.Exe = proc.Exe + } + s.procs[pid] = ps + } else if ps, ok := s.procs[pid]; ok && (e.IsCreateProcess() || e.IsProcessRundown()) && !ps.IsCreatedFromSystemLogger { + // enrich the existing process state with the newly arrived NT kernel logger process events + // but obtain the integrity level and executable path from the previous proc state + processEnrichments.Add(1) + proc.TokenIntegrityLevel = ps.TokenIntegrityLevel + proc.TokenElevationType = ps.TokenElevationType + proc.IsTokenElevated = ps.IsTokenElevated + + if strings.EqualFold(proc.Name, filepath.Base(ps.Exe)) && len(ps.Exe) > len(proc.Exe) { + // prefer full executable path + proc.Exe = ps.Exe + e.AppendParam(params.Exe, params.Path, ps.Exe) + } + + // if the process UUID has been initialized when + // the internal event arrived, reassign it to the + // current process state + proc.AssignUUID(ps) + + e.AppendParam(params.ProcessTokenIntegrityLevel, params.AnsiString, ps.TokenIntegrityLevel) + e.AppendParam(params.ProcessTokenElevationType, params.AnsiString, ps.TokenElevationType) + e.AppendParam(params.ProcessTokenIsElevated, params.Bool, ps.IsTokenElevated) + + s.procs[pid] = proc + } else { + // in all other cases append the process state + s.procs[pid] = proc + } + + // assign process state to the event + e.PS = proc + + return err +} + +func (s *snapshotter) AddThread(e *event.Event) error { + pid, err := e.Params.GetPid() + if err != nil { + return err + } + threadCount.Add(1) + + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[pid] + if !ok { + return nil + } + + thread := pstypes.Thread{} + thread.Tid, _ = e.Params.GetTid() + thread.UstackBase = e.Params.TryGetAddress(params.UstackBase) + thread.UstackLimit = e.Params.TryGetAddress(params.UstackLimit) + thread.KstackBase = e.Params.TryGetAddress(params.KstackBase) + thread.KstackLimit = e.Params.TryGetAddress(params.KstackLimit) + thread.IOPrio, _ = e.Params.GetUint8(params.IOPrio) + thread.BasePrio, _ = e.Params.GetUint8(params.BasePrio) + thread.PagePrio, _ = e.Params.GetUint8(params.PagePrio) + thread.StartAddress = e.Params.TryGetAddress(params.StartAddress) + + proc.AddThread(thread) + + return nil +} + +func (s *snapshotter) AddModule(e *event.Event) error { + pid, err := e.Params.GetPid() + if err != nil { + return err + } + s.mu.Lock() + defer s.mu.Unlock() + + if pid == 0 && e.IsModuleRundown() { + // assume system process if pid is zero + pid = SystemPID + } + proc, ok := s.procs[pid] + if !ok { + return nil + } + + module := pstypes.Module{} + module.Size, _ = e.Params.GetUint64(params.ModuleSize) + module.Checksum, _ = e.Params.GetUint32(params.ModuleCheckSum) + module.TimedateStamp, _ = e.Params.GetUint32(params.ModuleTimeDateStamp) + module.Name = e.GetParamAsString(params.ModulePath) + module.BaseAddress = e.Params.TryGetAddress(params.ModuleBase) + module.DefaultBaseAddress = e.Params.TryGetAddress(params.ModuleDefaultBase) + + if e.IsLoadModuleInternal() { + proc.AddModule(module) + return nil + } + + moduleCount.Add(1) + + module.SignatureLevel, _ = e.Params.GetUint32(params.ModuleSignatureLevel) + module.SignatureType, _ = e.Params.GetUint32(params.ModuleSignatureType) + + if strings.EqualFold(proc.Name, filepath.Base(module.Name)) && len(proc.Exe) < len(module.Name) { + // if the module is loaded for the process executable, and + // we don't have the full executable path, override with + // the one from the Module path + proc.Exe = module.Name + } + + proc.AddModule(module) + + return nil +} + +func (s *snapshotter) RemoveThread(pid uint32, tid uint32) error { + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[pid] + if !ok { + return nil + } + proc.RemoveThread(tid) + threadCount.Add(-1) + return nil +} + +func (s *snapshotter) RemoveModule(pid uint32, addr va.Address) error { + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[pid] + if !ok { + return nil + } + proc.RemoveModule(addr) + moduleCount.Add(-1) + return nil +} + +func (s *snapshotter) FindModule(addr va.Address) (bool, *pstypes.Module) { + s.mu.RLock() + defer s.mu.RUnlock() + for _, proc := range s.procs { + for _, mod := range proc.Modules { + if mod.BaseAddress == addr { + return true, &mod + } + } + } + return false, nil +} + +func (s *snapshotter) FindAllModules() map[string]pstypes.Module { + s.mu.RLock() + defer s.mu.RUnlock() + mods := make(map[string]pstypes.Module) + for _, proc := range s.procs { + for _, mod := range proc.Modules { + if _, ok := mods[mod.Name]; ok { + continue + } + mods[mod.Name] = mod + } + } + return mods +} + +func (s *snapshotter) AddMmap(e *event.Event) error { + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[e.PID] + if !ok { + return nil + } + + mmapCount.Add(1) + + mmap := pstypes.Mmap{} + mmap.File = e.GetParamAsString(params.FilePath) + mmap.BaseAddress = e.Params.TryGetAddress(params.FileViewBase) + mmap.Size, _ = e.Params.GetUint64(params.FileViewSize) + mmap.Protection, _ = e.Params.GetUint32(params.MemProtect) + mmap.Type = e.GetParamAsString(params.FileViewSectionType) + + proc.AddMmap(mmap) + + return nil +} + +func (s *snapshotter) RemoveMmap(pid uint32, addr va.Address) error { + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[pid] + if !ok { + return nil + } + mmapCount.Add(-1) + proc.RemoveMmap(addr) + return nil +} + +func (s *snapshotter) Close() error { + s.quit <- struct{}{} + return nil +} + +func (s *snapshotter) newProcState(pid, ppid uint32, e *event.Event) (*pstypes.PS, error) { + if e.IsCreateProcessInternal() || e.IsProcessRundownInternal() { + proc := &pstypes.PS{ + PID: pid, + Ppid: ppid, + Exe: e.GetParamAsString(params.Exe), + Name: filepath.Base(e.GetParamAsString(params.Exe)), + TokenIntegrityLevel: e.GetParamAsString(params.ProcessTokenIntegrityLevel), + TokenElevationType: e.GetParamAsString(params.ProcessTokenElevationType), + IsTokenElevated: e.Params.TryGetBool(params.ProcessTokenIsElevated), + Threads: make(map[uint32]pstypes.Thread), + Modules: make([]pstypes.Module, 0), + Handles: make([]htypes.Handle, 0), + Mmaps: make([]pstypes.Mmap, 0), + } + + return proc, nil + } + + proc := pstypes.New( + pid, + ppid, + e.GetParamAsString(params.ProcessName), + e.GetParamAsString(params.Cmdline), + e.GetParamAsString(params.Exe), + e.Params.MustGetSID(), + e.Params.MustGetUint32(params.SessionID), + ) + + proc.Parent = s.procs[ppid] + proc.StartTime, _ = e.Params.GetTime(params.StartTime) + proc.IsWOW64 = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsWOW64) != 0 + proc.IsPackaged = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsPackaged) != 0 + proc.IsProtected = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsProtected) != 0 + proc.IsCreatedFromSystemLogger = true + + if !s.capture { + if proc.Username != "" { + e.AppendParam(params.Username, params.UnicodeString, proc.Username) + } + if proc.Domain != "" { + e.AppendParam(params.Domain, params.UnicodeString, proc.Domain) + } + // retrieve process handles + var err error + proc.Handles, err = s.hsnap.FindHandles(pid) + if err != nil { + return proc, err + } + } + + // return early if we're reading from the capture file + if s.capture { + // reset username/domain from captured event parameters + proc.Domain = e.GetParamAsString(params.Domain) + proc.Username = e.GetParamAsString(params.Username) + return proc, nil + } + + // retrieve Portable Executable data + var err error + proc.PE, err = pe.ParseFileWithConfig(proc.Exe, s.config.PE) + if err != nil { + return proc, err + } + + // try to read the PEB (Process Environment Block) + // to access environment variables and the process + // current working directory + access := uint32(windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ) + process, err := windows.OpenProcess(access, false, pid) + if err != nil { + process, err = windows.OpenProcess(windows.PROCESS_QUERY_INFORMATION, false, pid) + if err != nil { + return proc, nil + } + } + //nolint:errcheck + defer windows.CloseHandle(process) + + // query token attributes if not enriched by internal event + if s.procs[pid] == nil { + var token windows.Token + err = windows.OpenProcessToken(process, windows.TOKEN_QUERY, &token) + if err != nil { + goto readPEB + } + defer token.Close() + + // get process token integrity level + tokenMandatoryLabel, err := sys.GetProcessTokenInformation[windows.Tokenmandatorylabel](token, windows.TokenIntegrityLevel) + if err != nil { + goto readPEB + } + + proc.TokenIntegrityLevel = sys.RidToString(tokenMandatoryLabel.Label.Sid) + proc.IsTokenElevated = token.IsElevated() + + e.AppendParam(params.ProcessTokenIntegrityLevel, params.AnsiString, proc.TokenIntegrityLevel) + e.AppendParam(params.ProcessTokenIsElevated, params.Bool, proc.IsTokenElevated) + } + +readPEB: + // read PEB (Process Environment Block) + peb, err := ReadPEB(process) + if err != nil { + pebReadErrors.Add(1) + return proc, err + } + proc.Envs = peb.GetEnvs() + proc.Cwd = peb.GetCurrentWorkingDirectory() + + return proc, nil +} + +func (s *snapshotter) Remove(e *event.Event) error { + s.mu.Lock() + defer s.mu.Unlock() + pid, err := e.Params.GetPid() + if err != nil { + return err + } + // remove process from primary map and + // move to dirty map. This is required + // to prevent dropping process state from + // events when TerminateProcess event is + // emitted before subsequent events + if proc := s.procs[pid]; proc != nil { + s.dmu.Lock() + defer s.dmu.Unlock() + s.dirty[pid] = proc + // schedule removal + remove := func(pid uint32) func() { + return func() { + s.dmu.Lock() + defer s.dmu.Unlock() + if ps, ok := s.dirty[pid]; ok { + delete(s.dirty, pid) + log.Debugf("dirty process removed: %s. Dirty procs: %d", ps.Name, len(s.dirty)) + } + } + } + time.AfterFunc(time.Second*5, remove(pid)) + } + delete(s.procs, pid) + processCount.Add(-1) + // reset parent if it died after spawning a process + for procID, proc := range s.procs { + if proc.Ppid == pid { + s.procs[procID].Parent = nil + } + } + return nil +} + +func (s *snapshotter) Put(proc *pstypes.PS) { + if proc != nil { + s.mu.Lock() + defer s.mu.Unlock() + s.procs[proc.PID] = proc + } +} + +func (s *snapshotter) FindAndPut(pid uint32) *pstypes.PS { + ok, proc := s.Find(pid) + if !ok { + s.Put(proc) + } + return proc +} + +func (s *snapshotter) Find(pid uint32) (bool, *pstypes.PS) { + s.mu.RLock() + defer s.mu.RUnlock() + ps, ok := s.procs[pid] + if ok { + return true, ps + } + if s.capture || pid == sys.InvalidProcessID { + return false, nil + } + + // check if the process is in dirty map + s.dmu.RLock() + defer s.dmu.RUnlock() + if ps := s.dirty[pid]; ps != nil { + return true, ps + } + + processLookupFailureCount.Add(strconv.Itoa(int(pid)), 1) + + proc := &pstypes.PS{ + PID: pid, + Ppid: sys.InvalidProcessID, + Threads: make(map[uint32]pstypes.Thread), + Modules: make([]pstypes.Module, 0), + Handles: make([]htypes.Handle, 0), + } + + getProcExecutable := func(process windows.Handle) (string, string) { + var size uint32 = windows.MAX_PATH + n := make([]uint16, size) + err := windows.QueryFullProcessImageName(process, 0, &n[0], &size) + if err != nil { + return "", "" + } + return windows.UTF16ToString(n), filepath.Base(windows.UTF16ToString(n)) + } + + access := uint32(windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ) + process, err := windows.OpenProcess(access, false, pid) + if err != nil { + // the access to protected / system process can't be achieved + // through `PROCESS_VM_READ` or `PROCESS_QUERY_INFORMATION` flags. + // Try to acquire the process handle again but with restricted access + // rights to be able to obtain other attributes such as the full process's + // Module executable path or process times + process, err = windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, pid) + if err != nil { + return false, nil + } + } + //nolint:errcheck + defer windows.CloseHandle(process) + + // get process executable full path and name + proc.Exe, proc.Name = getProcExecutable(process) + + // consult process parent id + info, err := sys.QueryInformationProcess[windows.PROCESS_BASIC_INFORMATION](process, windows.ProcessBasicInformation) + if err != nil { + return false, proc + } + proc.Ppid = uint32(info.InheritedFromUniqueProcessId) + + // retrieve Portable Executable data + proc.PE, err = pe.ParseFileWithConfig(proc.Exe, s.config.PE) + if err != nil { + return false, proc + } + + // get process times + var ( + ct windows.Filetime + xt windows.Filetime + kt windows.Filetime + ut windows.Filetime + ) + err = windows.GetProcessTimes(process, &ct, &xt, &kt, &ut) + if err != nil { + return false, proc + } + proc.StartTime = time.Unix(0, ct.Nanoseconds()) + + // get process creation attributes + var isWOW64 bool + if err := windows.IsWow64Process(process, &isWOW64); err == nil && isWOW64 { + proc.IsWOW64 = true + } + if isPackaged, err := sys.IsProcessPackaged(process); err == nil && isPackaged { + proc.IsPackaged = true + } + if prot, err := sys.QueryInformationProcess[sys.PsProtection](process, sys.ProcessProtectionInformation); err == nil && prot != nil { + proc.IsProtected = prot.IsProtected() + } + + // get process token attributes + var ( + token windows.Token + tokenUser *windows.Tokenuser + tokenMandatoryLabel *windows.Tokenmandatorylabel + ) + + err = windows.OpenProcessToken(process, windows.TOKEN_QUERY, &token) + if err != nil { + goto readPEB + } + defer token.Close() + tokenUser, err = token.GetTokenUser() + if err != nil { + goto readPEB + } + proc.SID = tokenUser.User.Sid.String() + proc.Username, proc.Domain, _, _ = tokenUser.User.Sid.LookupAccount("") + + // get process token integrity level + tokenMandatoryLabel, err = sys.GetProcessTokenInformation[windows.Tokenmandatorylabel](token, windows.TokenIntegrityLevel) + if err != nil { + goto readPEB + } + + proc.TokenIntegrityLevel = sys.RidToString(tokenMandatoryLabel.Label.Sid) + proc.IsTokenElevated = token.IsElevated() + + // retrieve process handles + proc.Handles, err = s.hsnap.FindHandles(pid) + if err != nil { + goto readPEB + } + +readPEB: + // read PEB (Process Environment Block) + peb, err := ReadPEB(process) + if err != nil { + pebReadErrors.Add(1) + return false, proc + } + proc.Envs = peb.GetEnvs() + proc.Cmdline = peb.GetCommandLine() + proc.SessionID = peb.GetSessionID() + proc.Cwd = peb.GetCurrentWorkingDirectory() + + return false, proc +} + +func (s *snapshotter) Size() uint32 { + s.mu.RLock() + defer s.mu.RUnlock() + return uint32(len(s.procs)) +} + +// gcDeadProcesses periodically scans the map of the snapshot's processes and removes +// any terminated processes from it. This guarantees that any leftovers are cleaned-up +// in case we miss process' terminate events. +func (s *snapshotter) gcDeadProcesses() { + tick := time.NewTicker(reapPeriod) + for { + select { + case <-tick.C: + s.mu.Lock() + ss := len(s.procs) + log.Debugf("scanning for dead processes on the snapshot of %d items", ss) + + for pid := range s.procs { + proc, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, pid) + if err != nil { + continue + } + if !sys.IsProcessRunning(proc) { + delete(s.procs, pid) + } + _ = windows.CloseHandle(proc) + } + + if ss > len(s.procs) { + reaped := ss - len(s.procs) + reapedProcesses.Add(int64(reaped)) + log.Debugf("%d dead process(es) reaped", reaped) + } + s.mu.Unlock() + case <-s.quit: + tick.Stop() + } + } +} + +func (s *snapshotter) onHandleCreated(pid uint32, handle htypes.Handle) { + s.mu.RLock() + ps, ok := s.procs[pid] + s.mu.RUnlock() + if ok { + s.mu.Lock() + defer s.mu.Unlock() + ps.AddHandle(handle) + s.procs[pid] = ps + } +} + +func (s *snapshotter) onHandleDestroyed(pid uint32, rawHandle windows.Handle) { + s.mu.RLock() + ps, ok := s.procs[pid] + s.mu.RUnlock() + if ok { + s.mu.Lock() + defer s.mu.Unlock() + ps.RemoveHandle(rawHandle) + s.procs[pid] = ps + } +} diff --git a/pkg/ps/snapshotter_mock.go b/pkg/ps/snapshotter_mock_windows.go similarity index 100% rename from pkg/ps/snapshotter_mock.go rename to pkg/ps/snapshotter_mock_windows.go diff --git a/pkg/ps/snapshotter_windows.go b/pkg/ps/snapshotter_windows.go index b17179ad4..34f7997fa 100644 --- a/pkg/ps/snapshotter_windows.go +++ b/pkg/ps/snapshotter_windows.go @@ -1,5 +1,7 @@ +//go:build windows + /* - * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2020-2021 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -19,738 +21,51 @@ package ps import ( - "expvar" - "path/filepath" - "strconv" - "strings" - "sync" - "time" - - "github.com/rabbitstack/fibratus/pkg/sys" - "github.com/rabbitstack/fibratus/pkg/util/va" - "golang.org/x/sys/windows" - - "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/event" - "github.com/rabbitstack/fibratus/pkg/event/params" - "github.com/rabbitstack/fibratus/pkg/handle" - htypes "github.com/rabbitstack/fibratus/pkg/handle/types" - "github.com/rabbitstack/fibratus/pkg/pe" pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" - log "github.com/sirupsen/logrus" -) - -// SystemPID designates the pid of the system process that acts as the container for system threads -const SystemPID uint32 = 4 - -var ( - // reapPeriod specifies the interval for triggering the housekeeping of dead processes - reapPeriod = time.Minute * 2 - - processLookupFailureCount = expvar.NewMap("process.lookup.failure.count") - reapedProcesses = expvar.NewInt("process.reaped") - processCount = expvar.NewInt("process.count") - threadCount = expvar.NewInt("process.thread.count") - moduleCount = expvar.NewInt("process.module.count") - mmapCount = expvar.NewInt("process.mmap.count") - pebReadErrors = expvar.NewInt("process.peb.read.errors") - processEnrichments = expvar.NewInt("process.enrichments") + "github.com/rabbitstack/fibratus/pkg/util/va" ) -type snapshotter struct { - mu sync.RWMutex - procs map[uint32]*pstypes.PS - dirty map[uint32]*pstypes.PS - dmu sync.RWMutex - quit chan struct{} - config *config.Config - hsnap handle.Snapshotter - capture bool -} - -// NewSnapshotter returns a new instance of the process snapshotter. -func NewSnapshotter(hsnap handle.Snapshotter, config *config.Config) Snapshotter { - s := &snapshotter{ - procs: make(map[uint32]*pstypes.PS), - dirty: make(map[uint32]*pstypes.PS), - quit: make(chan struct{}, 1), - config: config, - hsnap: hsnap, - } - - s.mu.Lock() - defer s.mu.Unlock() - - s.hsnap.RegisterCreateCallback(s.onHandleCreated) - s.hsnap.RegisterDestroyCallback(s.onHandleDestroyed) - - go s.gcDeadProcesses() - - return s -} - -// NewSnapshotterFromCapture restores the snapshotter state from the cap file. -func NewSnapshotterFromCapture(hsnap handle.Snapshotter, config *config.Config) Snapshotter { - s := &snapshotter{ - procs: make(map[uint32]*pstypes.PS), - dirty: make(map[uint32]*pstypes.PS), - quit: make(chan struct{}, 1), - config: config, - hsnap: hsnap, - capture: true, - } - - s.hsnap.RegisterCreateCallback(s.onHandleCreated) - s.hsnap.RegisterDestroyCallback(s.onHandleDestroyed) - - return s -} - -func (s *snapshotter) WriteFromCapture(e *event.Event) error { - switch e.Type { - case event.CreateProcess, event.ProcessRundown: - s.mu.Lock() - defer s.mu.Unlock() - proc := e.PS - if proc == nil { - return nil - } - pid, err := e.Params.GetPid() - if err != nil { - return err - } - ppid, err := e.Params.GetPpid() - if err != nil { - return err - } - if proc.PID == proc.Ppid || - (e.IsProcessRundown() && pid == sys.InvalidProcessID) { - return nil - } - if e.IsProcessRundown() { - proc.Parent = s.procs[ppid] - } else { - proc, err = s.newProcState(pid, ppid, e) - if err != nil { - return err - } - } - s.procs[pid] = proc - case event.CreateThread, event.ThreadRundown: - return s.AddThread(e) - case event.LoadModule, event.ModuleRundown: - return s.AddModule(e) - } - return nil -} - -func (s *snapshotter) Write(e *event.Event) error { - s.mu.Lock() - defer s.mu.Unlock() - processCount.Add(1) - - pid, err := e.Params.GetPid() - if err != nil { - return err - } - ppid, err := e.Params.GetPpid() - if err != nil { - return err - } - - proc, err := s.newProcState(pid, ppid, e) - if ps := s.procs[pid]; ps == nil && (e.IsCreateProcessInternal() || e.IsProcessRundownInternal()) { - // only modify the state if there is no process derived from the NT kernel logger process events - s.procs[pid] = proc - } else if ps, ok := s.procs[pid]; ok && (e.IsCreateProcessInternal() || e.IsProcessRundownInternal()) && ps.IsCreatedFromSystemLogger { - // process state derived from the core kernel events exists - enrich it - ps.TokenIntegrityLevel = proc.TokenIntegrityLevel - ps.TokenElevationType = proc.TokenElevationType - ps.IsTokenElevated = proc.IsTokenElevated - if strings.EqualFold(ps.Name, filepath.Base(proc.Exe)) && len(proc.Exe) > len(ps.Exe) { - // prefer full executable path - ps.Exe = proc.Exe - } - s.procs[pid] = ps - } else if ps, ok := s.procs[pid]; ok && (e.IsCreateProcess() || e.IsProcessRundown()) && !ps.IsCreatedFromSystemLogger { - // enrich the existing process state with the newly arrived NT kernel logger process events - // but obtain the integrity level and executable path from the previous proc state - processEnrichments.Add(1) - proc.TokenIntegrityLevel = ps.TokenIntegrityLevel - proc.TokenElevationType = ps.TokenElevationType - proc.IsTokenElevated = ps.IsTokenElevated - - if strings.EqualFold(proc.Name, filepath.Base(ps.Exe)) && len(ps.Exe) > len(proc.Exe) { - // prefer full executable path - proc.Exe = ps.Exe - e.AppendParam(params.Exe, params.Path, ps.Exe) - } - - // if the process UUID has been initialized when - // the internal event arrived, reassign it to the - // current process state - proc.AssignUUID(ps) - - e.AppendParam(params.ProcessTokenIntegrityLevel, params.AnsiString, ps.TokenIntegrityLevel) - e.AppendParam(params.ProcessTokenElevationType, params.AnsiString, ps.TokenElevationType) - e.AppendParam(params.ProcessTokenIsElevated, params.Bool, ps.IsTokenElevated) - - s.procs[pid] = proc - } else { - // in all other cases append the process state - s.procs[pid] = proc - } - - // assign process state to the event - e.PS = proc - - return err -} - -func (s *snapshotter) AddThread(e *event.Event) error { - pid, err := e.Params.GetPid() - if err != nil { - return err - } - threadCount.Add(1) - - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[pid] - if !ok { - return nil - } - - thread := pstypes.Thread{} - thread.Tid, _ = e.Params.GetTid() - thread.UstackBase = e.Params.TryGetAddress(params.UstackBase) - thread.UstackLimit = e.Params.TryGetAddress(params.UstackLimit) - thread.KstackBase = e.Params.TryGetAddress(params.KstackBase) - thread.KstackLimit = e.Params.TryGetAddress(params.KstackLimit) - thread.IOPrio, _ = e.Params.GetUint8(params.IOPrio) - thread.BasePrio, _ = e.Params.GetUint8(params.BasePrio) - thread.PagePrio, _ = e.Params.GetUint8(params.PagePrio) - thread.StartAddress = e.Params.TryGetAddress(params.StartAddress) - - proc.AddThread(thread) - - return nil -} - -func (s *snapshotter) AddModule(e *event.Event) error { - pid, err := e.Params.GetPid() - if err != nil { - return err - } - s.mu.Lock() - defer s.mu.Unlock() - - if pid == 0 && e.IsModuleRundown() { - // assume system process if pid is zero - pid = SystemPID - } - proc, ok := s.procs[pid] - if !ok { - return nil - } - - module := pstypes.Module{} - module.Size, _ = e.Params.GetUint64(params.ModuleSize) - module.Checksum, _ = e.Params.GetUint32(params.ModuleCheckSum) - module.TimedateStamp, _ = e.Params.GetUint32(params.ModuleTimeDateStamp) - module.Name = e.GetParamAsString(params.ModulePath) - module.BaseAddress = e.Params.TryGetAddress(params.ModuleBase) - module.DefaultBaseAddress = e.Params.TryGetAddress(params.ModuleDefaultBase) - - if e.IsLoadModuleInternal() { - proc.AddModule(module) - return nil - } - - moduleCount.Add(1) - - module.SignatureLevel, _ = e.Params.GetUint32(params.ModuleSignatureLevel) - module.SignatureType, _ = e.Params.GetUint32(params.ModuleSignatureType) - - if strings.EqualFold(proc.Name, filepath.Base(module.Name)) && len(proc.Exe) < len(module.Name) { - // if the module is loaded for the process executable, and - // we don't have the full executable path, override with - // the one from the Module path - proc.Exe = module.Name - } - - proc.AddModule(module) - - return nil -} - -func (s *snapshotter) RemoveThread(pid uint32, tid uint32) error { - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[pid] - if !ok { - return nil - } - proc.RemoveThread(tid) - threadCount.Add(-1) - return nil -} - -func (s *snapshotter) RemoveModule(pid uint32, addr va.Address) error { - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[pid] - if !ok { - return nil - } - proc.RemoveModule(addr) - moduleCount.Add(-1) - return nil -} - -func (s *snapshotter) FindModule(addr va.Address) (bool, *pstypes.Module) { - s.mu.RLock() - defer s.mu.RUnlock() - for _, proc := range s.procs { - for _, mod := range proc.Modules { - if mod.BaseAddress == addr { - return true, &mod - } - } - } - return false, nil -} - -func (s *snapshotter) FindAllModules() map[string]pstypes.Module { - s.mu.RLock() - defer s.mu.RUnlock() - mods := make(map[string]pstypes.Module) - for _, proc := range s.procs { - for _, mod := range proc.Modules { - if _, ok := mods[mod.Name]; ok { - continue - } - mods[mod.Name] = mod - } - } - return mods -} - -func (s *snapshotter) AddMmap(e *event.Event) error { - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[e.PID] - if !ok { - return nil - } - - mmapCount.Add(1) - - mmap := pstypes.Mmap{} - mmap.File = e.GetParamAsString(params.FilePath) - mmap.BaseAddress = e.Params.TryGetAddress(params.FileViewBase) - mmap.Size, _ = e.Params.GetUint64(params.FileViewSize) - mmap.Protection, _ = e.Params.GetUint32(params.MemProtect) - mmap.Type = e.GetParamAsString(params.FileViewSectionType) - - proc.AddMmap(mmap) - - return nil -} - -func (s *snapshotter) RemoveMmap(pid uint32, addr va.Address) error { - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[pid] - if !ok { - return nil - } - mmapCount.Add(-1) - proc.RemoveMmap(addr) - return nil -} - -func (s *snapshotter) Close() error { - s.quit <- struct{}{} - return nil -} - -func (s *snapshotter) newProcState(pid, ppid uint32, e *event.Event) (*pstypes.PS, error) { - if e.IsCreateProcessInternal() || e.IsProcessRundownInternal() { - proc := &pstypes.PS{ - PID: pid, - Ppid: ppid, - Exe: e.GetParamAsString(params.Exe), - Name: filepath.Base(e.GetParamAsString(params.Exe)), - TokenIntegrityLevel: e.GetParamAsString(params.ProcessTokenIntegrityLevel), - TokenElevationType: e.GetParamAsString(params.ProcessTokenElevationType), - IsTokenElevated: e.Params.TryGetBool(params.ProcessTokenIsElevated), - Threads: make(map[uint32]pstypes.Thread), - Modules: make([]pstypes.Module, 0), - Handles: make([]htypes.Handle, 0), - Mmaps: make([]pstypes.Mmap, 0), - } - - return proc, nil - } - - proc := pstypes.New( - pid, - ppid, - e.GetParamAsString(params.ProcessName), - e.GetParamAsString(params.Cmdline), - e.GetParamAsString(params.Exe), - e.Params.MustGetSID(), - e.Params.MustGetUint32(params.SessionID), - ) - - proc.Parent = s.procs[ppid] - proc.StartTime, _ = e.Params.GetTime(params.StartTime) - proc.IsWOW64 = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsWOW64) != 0 - proc.IsPackaged = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsPackaged) != 0 - proc.IsProtected = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsProtected) != 0 - proc.IsCreatedFromSystemLogger = true - - if !s.capture { - if proc.Username != "" { - e.AppendParam(params.Username, params.UnicodeString, proc.Username) - } - if proc.Domain != "" { - e.AppendParam(params.Domain, params.UnicodeString, proc.Domain) - } - // retrieve process handles - var err error - proc.Handles, err = s.hsnap.FindHandles(pid) - if err != nil { - return proc, err - } - } - - // return early if we're reading from the capture file - if s.capture { - // reset username/domain from captured event parameters - proc.Domain = e.GetParamAsString(params.Domain) - proc.Username = e.GetParamAsString(params.Username) - return proc, nil - } - - // retrieve Portable Executable data - var err error - proc.PE, err = pe.ParseFileWithConfig(proc.Exe, s.config.PE) - if err != nil { - return proc, err - } - - // try to read the PEB (Process Environment Block) - // to access environment variables and the process - // current working directory - access := uint32(windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ) - process, err := windows.OpenProcess(access, false, pid) - if err != nil { - process, err = windows.OpenProcess(windows.PROCESS_QUERY_INFORMATION, false, pid) - if err != nil { - return proc, nil - } - } - //nolint:errcheck - defer windows.CloseHandle(process) - - // query token attributes if not enriched by internal event - if s.procs[pid] == nil { - var token windows.Token - err = windows.OpenProcessToken(process, windows.TOKEN_QUERY, &token) - if err != nil { - goto readPEB - } - defer token.Close() - - // get process token integrity level - tokenMandatoryLabel, err := sys.GetProcessTokenInformation[windows.Tokenmandatorylabel](token, windows.TokenIntegrityLevel) - if err != nil { - goto readPEB - } - - proc.TokenIntegrityLevel = sys.RidToString(tokenMandatoryLabel.Label.Sid) - proc.IsTokenElevated = token.IsElevated() - - e.AppendParam(params.ProcessTokenIntegrityLevel, params.AnsiString, proc.TokenIntegrityLevel) - e.AppendParam(params.ProcessTokenIsElevated, params.Bool, proc.IsTokenElevated) - } - -readPEB: - // read PEB (Process Environment Block) - peb, err := ReadPEB(process) - if err != nil { - pebReadErrors.Add(1) - return proc, err - } - proc.Envs = peb.GetEnvs() - proc.Cwd = peb.GetCurrentWorkingDirectory() - - return proc, nil -} - -func (s *snapshotter) Remove(e *event.Event) error { - s.mu.Lock() - defer s.mu.Unlock() - pid, err := e.Params.GetPid() - if err != nil { - return err - } - // remove process from primary map and - // move to dirty map. This is required - // to prevent dropping process state from - // events when TerminateProcess event is - // emitted before subsequent events - if proc := s.procs[pid]; proc != nil { - s.dmu.Lock() - defer s.dmu.Unlock() - s.dirty[pid] = proc - // schedule removal - remove := func(pid uint32) func() { - return func() { - s.dmu.Lock() - defer s.dmu.Unlock() - if ps, ok := s.dirty[pid]; ok { - delete(s.dirty, pid) - log.Debugf("dirty process removed: %s. Dirty procs: %d", ps.Name, len(s.dirty)) - } - } - } - time.AfterFunc(time.Second*5, remove(pid)) - } - delete(s.procs, pid) - processCount.Add(-1) - // reset parent if it died after spawning a process - for procID, proc := range s.procs { - if proc.Ppid == pid { - s.procs[procID].Parent = nil - } - } - return nil -} - -func (s *snapshotter) Put(proc *pstypes.PS) { - if proc != nil { - s.mu.Lock() - defer s.mu.Unlock() - s.procs[proc.PID] = proc - } -} - -func (s *snapshotter) FindAndPut(pid uint32) *pstypes.PS { - ok, proc := s.Find(pid) - if !ok { - s.Put(proc) - } - return proc -} - -func (s *snapshotter) Find(pid uint32) (bool, *pstypes.PS) { - s.mu.RLock() - defer s.mu.RUnlock() - ps, ok := s.procs[pid] - if ok { - return true, ps - } - if s.capture || pid == sys.InvalidProcessID { - return false, nil - } - - // check if the process is in dirty map - s.dmu.RLock() - defer s.dmu.RUnlock() - if ps := s.dirty[pid]; ps != nil { - return true, ps - } - - processLookupFailureCount.Add(strconv.Itoa(int(pid)), 1) - - proc := &pstypes.PS{ - PID: pid, - Ppid: sys.InvalidProcessID, - Threads: make(map[uint32]pstypes.Thread), - Modules: make([]pstypes.Module, 0), - Handles: make([]htypes.Handle, 0), - } - - getProcExecutable := func(process windows.Handle) (string, string) { - var size uint32 = windows.MAX_PATH - n := make([]uint16, size) - err := windows.QueryFullProcessImageName(process, 0, &n[0], &size) - if err != nil { - return "", "" - } - return windows.UTF16ToString(n), filepath.Base(windows.UTF16ToString(n)) - } - - access := uint32(windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ) - process, err := windows.OpenProcess(access, false, pid) - if err != nil { - // the access to protected / system process can't be achieved - // through `PROCESS_VM_READ` or `PROCESS_QUERY_INFORMATION` flags. - // Try to acquire the process handle again but with restricted access - // rights to be able to obtain other attributes such as the full process's - // Module executable path or process times - process, err = windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, pid) - if err != nil { - return false, nil - } - } - //nolint:errcheck - defer windows.CloseHandle(process) - - // get process executable full path and name - proc.Exe, proc.Name = getProcExecutable(process) - - // consult process parent id - info, err := sys.QueryInformationProcess[windows.PROCESS_BASIC_INFORMATION](process, windows.ProcessBasicInformation) - if err != nil { - return false, proc - } - proc.Ppid = uint32(info.InheritedFromUniqueProcessId) - - // retrieve Portable Executable data - proc.PE, err = pe.ParseFileWithConfig(proc.Exe, s.config.PE) - if err != nil { - return false, proc - } - - // get process times - var ( - ct windows.Filetime - xt windows.Filetime - kt windows.Filetime - ut windows.Filetime - ) - err = windows.GetProcessTimes(process, &ct, &xt, &kt, &ut) - if err != nil { - return false, proc - } - proc.StartTime = time.Unix(0, ct.Nanoseconds()) - - // get process creation attributes - var isWOW64 bool - if err := windows.IsWow64Process(process, &isWOW64); err == nil && isWOW64 { - proc.IsWOW64 = true - } - if isPackaged, err := sys.IsProcessPackaged(process); err == nil && isPackaged { - proc.IsPackaged = true - } - if prot, err := sys.QueryInformationProcess[sys.PsProtection](process, sys.ProcessProtectionInformation); err == nil && prot != nil { - proc.IsProtected = prot.IsProtected() - } - - // get process token attributes - var ( - token windows.Token - tokenUser *windows.Tokenuser - tokenMandatoryLabel *windows.Tokenmandatorylabel - ) - - err = windows.OpenProcessToken(process, windows.TOKEN_QUERY, &token) - if err != nil { - goto readPEB - } - defer token.Close() - tokenUser, err = token.GetTokenUser() - if err != nil { - goto readPEB - } - proc.SID = tokenUser.User.Sid.String() - proc.Username, proc.Domain, _, _ = tokenUser.User.Sid.LookupAccount("") - - // get process token integrity level - tokenMandatoryLabel, err = sys.GetProcessTokenInformation[windows.Tokenmandatorylabel](token, windows.TokenIntegrityLevel) - if err != nil { - goto readPEB - } - - proc.TokenIntegrityLevel = sys.RidToString(tokenMandatoryLabel.Label.Sid) - proc.IsTokenElevated = token.IsElevated() - - // retrieve process handles - proc.Handles, err = s.hsnap.FindHandles(pid) - if err != nil { - goto readPEB - } - -readPEB: - // read PEB (Process Environment Block) - peb, err := ReadPEB(process) - if err != nil { - pebReadErrors.Add(1) - return false, proc - } - proc.Envs = peb.GetEnvs() - proc.Cmdline = peb.GetCommandLine() - proc.SessionID = peb.GetSessionID() - proc.Cwd = peb.GetCurrentWorkingDirectory() - - return false, proc -} - -func (s *snapshotter) Size() uint32 { - s.mu.RLock() - defer s.mu.RUnlock() - return uint32(len(s.procs)) -} - -// gcDeadProcesses periodically scans the map of the snapshot's processes and removes -// any terminated processes from it. This guarantees that any leftovers are cleaned-up -// in case we miss process' terminate events. -func (s *snapshotter) gcDeadProcesses() { - tick := time.NewTicker(reapPeriod) - for { - select { - case <-tick.C: - s.mu.Lock() - ss := len(s.procs) - log.Debugf("scanning for dead processes on the snapshot of %d items", ss) - - for pid := range s.procs { - proc, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, pid) - if err != nil { - continue - } - if !sys.IsProcessRunning(proc) { - delete(s.procs, pid) - } - _ = windows.CloseHandle(proc) - } - - if ss > len(s.procs) { - reaped := ss - len(s.procs) - reapedProcesses.Add(int64(reaped)) - log.Debugf("%d dead process(es) reaped", reaped) - } - s.mu.Unlock() - case <-s.quit: - tick.Stop() - } - } -} - -func (s *snapshotter) onHandleCreated(pid uint32, handle htypes.Handle) { - s.mu.RLock() - ps, ok := s.procs[pid] - s.mu.RUnlock() - if ok { - s.mu.Lock() - defer s.mu.Unlock() - ps.AddHandle(handle) - s.procs[pid] = ps - } -} - -func (s *snapshotter) onHandleDestroyed(pid uint32, rawHandle windows.Handle) { - s.mu.RLock() - ps, ok := s.procs[pid] - s.mu.RUnlock() - if ok { - s.mu.Lock() - defer s.mu.Unlock() - ps.RemoveHandle(rawHandle) - s.procs[pid] = ps - } +// Snapshotter is the interface that exposes a set of methods all process snapshotters have to satisfy. It stores the state +// of all running processes in the system including its threads, dynamically loaded libraries, handles/file descriptors +// and other metadata. +type Snapshotter interface { + // Write appends a new process state to the snapshotter. It takes as an input the inbound event to fetch + // the basic data, but also enriches the process' state with extra metadata such as process' env variables, PE + // metadata for Windows binaries and so on. + Write(*event.Event) error + // AddThread builds thread state from the event representation. + AddThread(*event.Event) error + // AddModule builds module state from the event representation. + AddModule(*event.Event) error + // RemoveThread removes the thread from the given process. + RemoveThread(pid uint32, tid uint32) error + // RemoveModule removes the module the given process. + RemoveModule(pid uint32, addr va.Address) error + // AddMmap adds a new memory mapping (data memory-mapped file, image, or pagefile) to this process state. + AddMmap(*event.Event) error + // RemoveMmap removes memory mapping at the given base address. + RemoveMmap(pid uint32, addr va.Address) error + // WriteFromCapture appends a new process state to the snapshotter from the captured event. + WriteFromCapture(evt *event.Event) error + // Remove deletes process's state from the snapshotter. + Remove(evt *event.Event) error + // Find attempts to retrieve process' state for the specified process identifier. Returns true + // if the process was find in the state. Otherwise, returns false and constructs a fresh process + // state by querying the OS via API functions. + Find(pid uint32) (bool, *pstypes.PS) + // FindModule traverses loaded modules of all processes in the snapshot and + // if there is module with the specified base address, it returns its metadata. + FindModule(addr va.Address) (bool, *pstypes.Module) + // FindAllModules finds all unique modules across the snapshotter state. + FindAllModules() map[string]pstypes.Module + // FindAndPut attempts to retrieve process' state for the specified process identifier. + // If the process is found, the snapshotter state is updated with the new process. + FindAndPut(pid uint32) *pstypes.PS + // Put inserts the process state into snapshotter. + Put(*pstypes.PS) + // Size returns the total number of process state items. + Size() uint32 + // Close closes process snapshotter and disposes all allocated resources. + Close() error } diff --git a/pkg/util/ntstatus/status_windows.go b/pkg/util/ntstatus/status.go similarity index 100% rename from pkg/util/ntstatus/status_windows.go rename to pkg/util/ntstatus/status.go diff --git a/pkg/util/rest/rest.go b/pkg/util/rest/rest.go index 507d35478..b2e48b90d 100644 --- a/pkg/util/rest/rest.go +++ b/pkg/util/rest/rest.go @@ -46,9 +46,9 @@ type Option func(o *opts) func WithTransport(addr string) Option { return func(o *opts) { o.addr = addr - if strings.HasPrefix(addr, `npipe:///`) { + if strings.HasPrefix(addr, `npipe:///`) || strings.HasPrefix(addr, `unix://`) { transport = &http.Transport{ - DialContext: api.DialPipe(addr), + DialContext: api.DialLocalTransport(addr), } } else { transport = &http.Transport{ @@ -104,6 +104,9 @@ func request(method string, options ...Option) ([]byte, error) { scheme := "http://" addr := strings.TrimPrefix(opts.addr, `npipe:///`) + if strings.HasPrefix(addr, "unix://") { + addr = "localhost" + } ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() diff --git a/pkg/util/rest/rest_linux_test.go b/pkg/util/rest/rest_linux_test.go new file mode 100644 index 000000000..e0215cba7 --- /dev/null +++ b/pkg/util/rest/rest_linux_test.go @@ -0,0 +1,55 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package rest + +import ( + "net" + "net/http" + "net/http/httptest" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestGetUnixSocket(t *testing.T) { + path := filepath.Join(t.TempDir(), "fibratus.sock") + listener, err := net.Listen("unix", path) + require.NoError(t, err) + + mux := http.NewServeMux() + mux.HandleFunc("/config", func(w http.ResponseWriter, _ *http.Request) { + if _, err := w.Write([]byte("test")); err != nil { + t.Fatal(err) + } + }) + + srv := httptest.NewUnstartedServer(mux) + srv.Listener = listener + srv.Start() + defer srv.Close() + + resp, err := Get(WithURI("config"), WithTransport("unix://"+path)) + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, "test", string(resp)) +} diff --git a/pkg/util/rest/rest_test.go b/pkg/util/rest/rest_test.go index 396cce923..491880430 100644 --- a/pkg/util/rest/rest_test.go +++ b/pkg/util/rest/rest_test.go @@ -20,12 +20,10 @@ package rest import ( "fmt" - "github.com/rabbitstack/fibratus/pkg/api" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "net/http" "net/http/httptest" - "os/user" "strings" "testing" ) @@ -47,33 +45,6 @@ func TestGet(t *testing.T) { assert.Equal(t, "test", string(resp)) } -func TestGetPipe(t *testing.T) { - usr, err := user.Current() - require.NoError(t, err) - descriptor := "D:P(A;;GA;;;" + usr.Uid + ")" - listener, err := api.MakePipeListener(`npipe:///fibratus`, descriptor) - require.NoError(t, err) - - mux := http.NewServeMux() - - mux.HandleFunc("/config", func(w http.ResponseWriter, r *http.Request) { - if _, err := w.Write([]byte("test")); err != nil { - t.Fatal(err) - } - }) - - srv := httptest.NewUnstartedServer(mux) - srv.Listener = listener - - srv.Start() - defer srv.Close() - - resp, err := Get(WithURI("config"), WithTransport(`npipe:///fibratus`)) - require.NoError(t, err) - require.NotNil(t, resp) - assert.Equal(t, "test", string(resp)) -} - func port(s string) string { i := strings.LastIndex(s, ":") if i == 0 { diff --git a/pkg/util/rest/rest_windows_test.go b/pkg/util/rest/rest_windows_test.go new file mode 100644 index 000000000..d7d4a0182 --- /dev/null +++ b/pkg/util/rest/rest_windows_test.go @@ -0,0 +1,57 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package rest + +import ( + "net/http" + "net/http/httptest" + "os/user" + "testing" + + "github.com/rabbitstack/fibratus/pkg/api" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestGetPipe(t *testing.T) { + usr, err := user.Current() + require.NoError(t, err) + descriptor := "D:P(A;;GA;;;" + usr.Uid + ")" + listener, err := api.MakePipeListener(`npipe:///fibratus`, descriptor) + require.NoError(t, err) + + mux := http.NewServeMux() + mux.HandleFunc("/config", func(w http.ResponseWriter, _ *http.Request) { + if _, err := w.Write([]byte("test")); err != nil { + t.Fatal(err) + } + }) + + srv := httptest.NewUnstartedServer(mux) + srv.Listener = listener + srv.Start() + defer srv.Close() + + resp, err := Get(WithURI("config"), WithTransport(`npipe:///fibratus`)) + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, "test", string(resp)) +} From 50bad3e9f548a6f6972f8f7415f57e9d657cb5ac Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 12 Aug 2026 15:01:56 +0200 Subject: [PATCH 28/65] refactor(config): enforce Linux-native event settings Keep process events mandatory, reuse the established file-I/O setting, and remove deprecated kevt fields from Linux. Restore documentation lost while splitting shared and Windows-specific configuration and parameter catalogs. --- pkg/config/alertsender_linux.go | 6 +- pkg/config/config.go | 280 +++++++++++++++++++++++++++ pkg/config/config.schema.json | 6 - pkg/config/eventsource_linux.go | 28 ++- pkg/config/eventsource_linux_test.go | 7 +- pkg/event/params/names_windows.go | 201 ++++++++++++------- pkg/event/params/param_types.go | 83 +++++--- pkg/event/params/types_windows.go | 25 ++- pkg/filter/fields/defs_linux.go | 2 - pkg/filter/fields/defs_linux_test.go | 2 + 10 files changed, 506 insertions(+), 134 deletions(-) create mode 100644 pkg/config/config.go diff --git a/pkg/config/alertsender_linux.go b/pkg/config/alertsender_linux.go index 1818cc7f1..74c780c5d 100644 --- a/pkg/config/alertsender_linux.go +++ b/pkg/config/alertsender_linux.go @@ -22,10 +22,6 @@ package config import "github.com/rabbitstack/fibratus/pkg/alertsender" -func (c *Config) loadPlatformAlertSender(typ string, config interface{}, configs *[]alertsender.Config) error { - // Platform-specific Linux alert senders can be loaded here. - _ = typ - _ = config - _ = configs +func (c *Config) loadPlatformAlertSender(_ string, _ interface{}, _ *[]alertsender.Config) error { return nil } diff --git a/pkg/config/config.go b/pkg/config/config.go new file mode 100644 index 000000000..a5e135e12 --- /dev/null +++ b/pkg/config/config.go @@ -0,0 +1,280 @@ +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "strings" + "time" + + "github.com/rabbitstack/fibratus/pkg/aggregator" + "github.com/rabbitstack/fibratus/pkg/aggregator/transformers" + removet "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/remove" + renamet "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/rename" + replacet "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/replace" + tagst "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/tags" + trimt "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/trim" + "github.com/rabbitstack/fibratus/pkg/alertsender" + mailsender "github.com/rabbitstack/fibratus/pkg/alertsender/mail" + slacksender "github.com/rabbitstack/fibratus/pkg/alertsender/slack" + "github.com/rabbitstack/fibratus/pkg/outputs" + "github.com/rabbitstack/fibratus/pkg/outputs/amqp" + "github.com/rabbitstack/fibratus/pkg/outputs/console" + "github.com/rabbitstack/fibratus/pkg/outputs/elasticsearch" + "github.com/rabbitstack/fibratus/pkg/outputs/http" + "github.com/rabbitstack/fibratus/pkg/util/log" + "github.com/rabbitstack/fibratus/pkg/util/multierror" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "github.com/spf13/viper" + "gopkg.in/yaml.v3" +) + +const ( + capFile = "cap.file" + configFile = "config-file" + forwardMode = "forward" +) + +// Config stores configuration options for fine-tuning the behaviour of Fibratus. +type Config struct { + platformConfig + + // EventSource stores options for fine-tuning the event source. + EventSource EventSourceConfig `json:"eventsource" yaml:"eventsource"` + // Filament contains filament settings. + Filament FilamentConfig `json:"filament" yaml:"filament"` + // API stores global HTTP API preferences. + API APIConfig `json:"api" yaml:"api"` + // Output stores the currently active output configuration. + Output outputs.Config + // Aggregator stores event aggregator configuration. + Aggregator aggregator.Config `json:"aggregator" yaml:"aggregator"` + // Log contains logging configuration. + Log log.Config `json:"logging" yaml:"logging"` + // Transformers stores transformer configurations. + Transformers []transformers.Config + // Alertsenders stores alert sender configurations. + Alertsenders []alertsender.Config + // Filters contains filter and rule definitions. + Filters *Filters `json:"filters" yaml:"filters"` + // ForwardMode designates whether event forwarding mode is engaged. + ForwardMode bool `json:"forward" yaml:"forward"` + // CapFile is the path to the capture file. + CapFile string + + flags *pflag.FlagSet + viper *viper.Viper + opts *Options +} + +// Options determines which config flags are toggled depending on the command type. +type Options struct { + capture bool + replay bool + run bool + list bool + stats bool + validate bool +} + +// Option configures the command-specific configuration surface. +type Option func(*Options) + +// WithCapture determines whether the capture command is executed. +func WithCapture() Option { return func(o *Options) { o.capture = true } } + +// WithReplay determines whether the replay command is executed. +func WithReplay() Option { return func(o *Options) { o.replay = true } } + +// WithRun determines whether the run command is executed. +func WithRun() Option { return func(o *Options) { o.run = true } } + +// WithList determines whether the list command is executed. +func WithList() Option { return func(o *Options) { o.list = true } } + +// WithStats determines whether the stats command is executed. +func WithStats() Option { return func(o *Options) { o.stats = true } } + +// WithValidate determines whether the validate command is executed. +func WithValidate() Option { return func(o *Options) { o.validate = true } } + +// NewWithOpts builds a new configuration store from files, environment variables, and flags. +func NewWithOpts(options ...Option) *Config { + opts := &Options{} + for _, option := range options { + option(opts) + } + + v := viper.New() + v.AutomaticEnv() + v.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_")) + + c := &Config{ + platformConfig: newPlatformConfig(), + EventSource: EventSourceConfig{}, + Filament: FilamentConfig{}, + API: APIConfig{}, + Aggregator: aggregator.Config{}, + Log: log.Config{}, + Filters: &Filters{}, + flags: new(pflag.FlagSet), + viper: v, + opts: opts, + } + + if opts.run || opts.replay { + aggregator.AddFlags(c.flags) + console.AddFlags(c.flags) + amqp.AddFlags(c.flags) + elasticsearch.AddFlags(c.flags) + http.AddFlags(c.flags) + removet.AddFlags(c.flags) + replacet.AddFlags(c.flags) + renamet.AddFlags(c.flags) + trimt.AddFlags(c.flags) + tagst.AddFlags(c.flags) + mailsender.AddFlags(c.flags) + slacksender.AddFlags(c.flags) + } + + c.addFlags() + c.addPlatformFlags() + return c +} + +// MustViperize adds the configuration flags to the Cobra command. +func (c *Config) MustViperize(cmd *cobra.Command) { + cmd.PersistentFlags().AddFlagSet(c.flags) + if err := c.viper.BindPFlags(cmd.PersistentFlags()); err != nil { + panic(err) + } + if c.opts.capture || c.opts.replay { + if err := cmd.MarkPersistentFlagRequired(capFile); err != nil { + panic(err) + } + } +} + +// Init initializes the configuration state from Viper. +func (c *Config) Init() error { + c.EventSource.initFromViper(c.viper) + c.Filament.initFromViper(c.viper) + c.API.initFromViper(c.viper) + c.Aggregator.InitFromViper(c.viper) + c.Log.InitFromViper(c.viper) + c.Filters.initFromViper(c.viper) + c.ForwardMode = c.viper.GetBool(forwardMode) + c.CapFile = c.viper.GetString(capFile) + c.initPlatform() + + if c.opts.run || c.opts.replay { + if err := c.tryLoadOutput(); err != nil { + return err + } + if err := c.tryLoadTransformers(); err != nil { + return err + } + if err := c.tryLoadAlertSenders(); err != nil { + return err + } + } + return nil +} + +func (c *Config) GetConfigFile() string { return c.viper.GetString(configFile) } + +func (c *Config) GetFilters() []*FilterConfig { + if c.Filters == nil { + return nil + } + return c.Filters.filters +} + +func (c *Config) TryLoadFile(file string) error { + c.viper.SetConfigFile(file) + return c.viper.ReadInConfig() +} + +func (c *Config) validateConfig() error { + file := c.viper.GetString(configFile) + var out interface{} + b, err := os.ReadFile(file) + if err != nil { + return err + } + switch filepath.Ext(file) { + case ".yaml", ".yml": + err = yaml.Unmarshal(b, &out) + case ".json": + err = json.Unmarshal(b, &out) + default: + return fmt.Errorf("%s is not a supported config file extension", filepath.Ext(file)) + } + if err != nil { + return fmt.Errorf("couldn't read the config file: %v", err) + } + valid, errs := validate(configSchema, out) + if !valid || len(errs) > 0 { + return fmt.Errorf("invalid config: %v", multierror.Wrap(errs...)) + } + valid, errs = validate(configSchema, c.viper.AllSettings()) + if !valid || len(errs) > 0 { + return fmt.Errorf("invalid config: %v", multierror.Wrap(errs...)) + } + return nil +} + +func (c *Config) IsCaptureSet() bool { return c.CapFile != "" } +func (c *Config) IsFilamentSet() bool { return c.Filament.Name != "" } +func (c *Config) ConfigExists() bool { _, err := os.Stat(c.File()); return err == nil } +func (c *Config) File() string { return c.viper.GetString(configFile) } + +func (c *Config) addFlags() { + c.flags.String(configFile, defaultConfigFile(), "Indicates the location of the configuration file") + if c.opts.run { + c.flags.Bool(forwardMode, false, "Designates if event forwarding mode is engaged") + } + if c.opts.run || c.opts.replay || c.opts.validate { + c.flags.StringP(filamentName, "f", "", "Specifies the filament to execute") + c.flags.Bool(rulesEnabled, true, "Indicates if the rule engine is enabled and rules loaded") + c.flags.StringSlice(rulesFromPaths, defaultRulesPaths(), "Comma-separated list of rules files") + c.flags.StringSlice(macrosFromPaths, defaultMacrosPaths(), "Comma-separated list of macro files") + c.flags.StringSlice(rulesFromURLs, nil, "Comma-separated list of rules URL resources") + c.flags.Bool(matchAll, true, "Indicates if the match all strategy is enabled for the rule engine") + } + if c.opts.capture { + c.flags.StringP(capFile, "o", "", "The path of the output cap file") + } + if c.opts.replay { + c.flags.StringP(capFile, "k", "", "The path of the input cap file") + } + if c.opts.run || c.opts.replay || c.opts.list || c.opts.validate { + c.flags.String(filamentPath, defaultFilamentPath(), "Denotes the directory where filaments are located") + } + if c.opts.run || c.opts.replay || c.opts.capture || c.opts.stats { + c.flags.String(transport, "localhost:8080", "Specifies the underlying transport protocol for the API HTTP server") + c.flags.Duration(timeout, 15*time.Second, "Determines the timeout for the API server responses") + } + c.Log.AddFlags(c.flags) +} diff --git a/pkg/config/config.schema.json b/pkg/config/config.schema.json index dd75c0712..863d99fb1 100644 --- a/pkg/config/config.schema.json +++ b/pkg/config/config.schema.json @@ -335,12 +335,6 @@ "eventsource": { "type": "object", "properties": { - "enable-process": { - "type": "boolean" - }, - "enable-file": { - "type": "boolean" - }, "enable-thread": { "type": "boolean" }, diff --git a/pkg/config/eventsource_linux.go b/pkg/config/eventsource_linux.go index 7de7ba2c1..77d02f209 100644 --- a/pkg/config/eventsource_linux.go +++ b/pkg/config/eventsource_linux.go @@ -27,28 +27,25 @@ import ( ) const ( - enableProcessEvents = "eventsource.enable-process" - enableFileEvents = "eventsource.enable-file" - enableNetEvents = "eventsource.enable-net" - enableMemEvents = "eventsource.enable-mem" - excludedEvents = "eventsource.blacklist.events" - excludedImages = "eventsource.blacklist.images" + enableFileIOEvents = "eventsource.enable-fileio" + enableNetEvents = "eventsource.enable-net" + enableMemEvents = "eventsource.enable-mem" + excludedEvents = "eventsource.blacklist.events" + excludedImages = "eventsource.blacklist.images" ) type EventSourceConfig struct { eventSourceConfig - ExcludedEvents []string `json:"blacklist.events" yaml:"blacklist.events"` - ExcludedImages []string `json:"blacklist.images" yaml:"blacklist.images"` - EnableProcessEvents bool `json:"enable-process" yaml:"enable-process"` - EnableFileIOEvents bool `json:"enable-file" yaml:"enable-file"` - EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` - EnableMemEvents bool `json:"enable-mem" yaml:"enable-mem"` + ExcludedEvents []string `json:"blacklist.events" yaml:"blacklist.events"` + ExcludedImages []string `json:"blacklist.images" yaml:"blacklist.images"` + EnableFileIOEvents bool `json:"enable-fileio" yaml:"enable-fileio"` + EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` + EnableMemEvents bool `json:"enable-mem" yaml:"enable-mem"` } func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { - flags.Bool(enableProcessEvents, true, "Determines whether process events are collected") - flags.Bool(enableFileEvents, true, "Determines whether file events are collected") + flags.Bool(enableFileIOEvents, true, "Determines whether file events are collected") flags.Bool(enableNetEvents, true, "Determines whether network events are collected") flags.Bool(enableMemEvents, true, "Determines whether memory events are collected") flags.StringSlice(excludedEvents, nil, "A list of event names to drop") @@ -56,8 +53,7 @@ func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { } func (c *EventSourceConfig) initFromViper(v *viper.Viper) { - c.EnableProcessEvents = v.GetBool(enableProcessEvents) - c.EnableFileIOEvents = v.GetBool(enableFileEvents) + c.EnableFileIOEvents = v.GetBool(enableFileIOEvents) c.EnableNetEvents = v.GetBool(enableNetEvents) c.EnableMemEvents = v.GetBool(enableMemEvents) c.ExcludedEvents = v.GetStringSlice(excludedEvents) diff --git a/pkg/config/eventsource_linux_test.go b/pkg/config/eventsource_linux_test.go index 140fdc91a..555e6d0bd 100644 --- a/pkg/config/eventsource_linux_test.go +++ b/pkg/config/eventsource_linux_test.go @@ -33,14 +33,14 @@ import ( func TestEventSourceConfigLinux(t *testing.T) { c := NewWithOpts(WithRun()) require.NoError(t, c.flags.Parse([]string{ - "--eventsource.enable-process=false", + "--eventsource.enable-fileio=false", "--eventsource.blacklist.events=execve", "--eventsource.blacklist.images=systemd", })) require.NoError(t, c.viper.BindPFlags(c.flags)) require.NoError(t, c.Init()) - require.False(t, c.EventSource.EnableProcessEvents) + require.False(t, c.EventSource.EnableFileIOEvents) require.True(t, c.EventSource.ExcludeEvent(event.Execve.ID())) require.True(t, c.EventSource.ExcludeImage(&pstypes.PS{Name: "systemd"})) for _, typ := range event.All() { @@ -51,8 +51,7 @@ func TestEventSourceConfigLinux(t *testing.T) { func TestValidateLinuxEventSource(t *testing.T) { file := filepath.Join(t.TempDir(), "fibratus.yml") require.NoError(t, os.WriteFile(file, []byte(`eventsource: - enable-process: true - enable-file: true + enable-fileio: true blacklist: events: - execve diff --git a/pkg/event/params/names_windows.go b/pkg/event/params/names_windows.go index a457c1e10..a05e33f26 100644 --- a/pkg/event/params/names_windows.go +++ b/pkg/event/params/names_windows.go @@ -19,73 +19,142 @@ package params const ( - NTStatus = "status" - ProcessObject = "kproc" - Callstack = "callstack" - CallstackTimestamp = "callstack_timestamp" - ProcessRealParentID = "real_ppid" - UserSID = "sid" - Domain = "domain" - DTB = "directory_table_base" + // NTStatus identifies the NTSTATUS value. + NTStatus = "status" + // ProcessObject represents the address of the process object in the kernel. + ProcessObject = "kproc" + // Callstack represents the thread call stack. + Callstack = "callstack" + // CallstackTimestamp identifies the call stack timestamp. + CallstackTimestamp = "callstack_timestamp" + // ProcessRealParentID represents the real parent process identifier. + ProcessRealParentID = "real_ppid" + // UserSID is the security identifier associated with the process token. + UserSID = "sid" + // Domain represents the domain under which the event was generated. + Domain = "domain" + // DTB denotes the address of the process directory table. + DTB = "directory_table_base" + // ProcessTokenIntegrityLevel denotes the process integrity level. ProcessTokenIntegrityLevel = "token_integrity_level" - ProcessTokenElevationType = "token_elevation_type" - ProcessTokenIsElevated = "token_is_elevated" - DesiredAccess = "desired_access" - BasePrio = "base_prio" - IOPrio = "io_prio" - PagePrio = "page_prio" - KstackBase = "kstack" - KstackLimit = "kstack_limit" - UstackBase = "ustack" - UstackLimit = "ustack_limit" - StartAddress = "start_address" - StartAddressSymbol = "start_address_symbol" - StartAddressModule = "start_address_module" - TEB = "teb" - FileCreateOptions = "create_options" - FileOperation = "create_disposition" - FileShareMask = "share_mask" - FileAttributes = "attributes" - FileInfoClass = "class" - FileIrpPtr = "irp" - FileIsDLL = "is_dll" - FileIsDriver = "is_driver" - FileIsDotnet = "is_dotnet" - RegKeyHandle = "key_handle" - RegKCB = "kcb" - RegPath = "key_path" - RegValue = "value" - RegValueType = "value_type" - RegData = "data" - ModuleCheckSum = "checksum" - ModuleTimeDateStamp = "timedate_stamp" - ModuleDefaultBase = "default_address" - ModuleSignatureLevel = "signature_level" - ModuleSignatureType = "signature_type" - ModuleCertSubject = "cert_subject" - ModuleCertIssuer = "cert_issuer" - ModuleCertSerial = "cert_serial" - ModuleCertNotBefore = "cert_not_before" - ModuleCertNotAfter = "cert_not_after" - HandleID = "handle_id" - HandleSourceID = "handle_source_id" - HandleObject = "handle_object" - HandleObjectName = "handle_name" - HandleObjectTypeID = "type_id" - ThreadpoolPoolID = "pool_id" - ThreadpoolTaskID = "task_id" - ThreadpoolCallback = "callback" - ThreadpoolCallbackSymbol = "callback_symbol" - ThreadpoolCallbackModule = "callback_module" - ThreadpoolContext = "context" - ThreadpoolContextRip = "context_rip" + // ProcessTokenElevationType designates the process token elevation type. + ProcessTokenElevationType = "token_elevation_type" + // ProcessTokenIsElevated designates whether the process token is elevated. + ProcessTokenIsElevated = "token_is_elevated" + // DesiredAccess denotes the access rights for a kernel object. + DesiredAccess = "desired_access" + // BasePrio is the thread base priority assigned by the scheduler. + BasePrio = "base_prio" + // IOPrio indicates the thread I/O priority. + IOPrio = "io_prio" + // PagePrio denotes the page priority. + PagePrio = "page_prio" + // KstackBase is the start address of the kernel-space stack. + KstackBase = "kstack" + // KstackLimit is the end address of the kernel-space stack. + KstackLimit = "kstack_limit" + // UstackBase is the start address of the user-space stack. + UstackBase = "ustack" + // UstackLimit is the end address of the user-space stack. + UstackLimit = "ustack_limit" + // StartAddress is the thread start address. + StartAddress = "start_address" + // StartAddressSymbol is the symbol associated with the thread start address. + StartAddressSymbol = "start_address_symbol" + // StartAddressModule is the module containing the thread start address. + StartAddressModule = "start_address_module" + // TEB is the address of the Thread Environment Block. + TEB = "teb" + // FileCreateOptions represents options passed to NtCreateFile. + FileCreateOptions = "create_options" + // FileOperation represents the file create disposition. + FileOperation = "create_disposition" + // FileShareMask represents the file share access mask. + FileShareMask = "share_mask" + // FileAttributes represents file attribute values. + FileAttributes = "attributes" + // FileInfoClass represents the file information class. + FileInfoClass = "class" + // FileIrpPtr represents the I/O request packet identifier. + FileIrpPtr = "irp" + // FileIsDLL indicates whether the file is a DLL. + FileIsDLL = "is_dll" + // FileIsDriver indicates whether the file is a driver. + FileIsDriver = "is_driver" + // FileIsDotnet indicates whether the file is a .NET assembly. + FileIsDotnet = "is_dotnet" + // RegKeyHandle identifies the registry key handle. + RegKeyHandle = "key_handle" + // RegKCB identifies the registry key control block. + RegKCB = "kcb" + // RegPath represents the fully qualified registry key path. + RegPath = "key_path" + // RegValue identifies the registry value. + RegValue = "value" + // RegValueType identifies the registry value type. + RegValueType = "value_type" + // RegData stores the captured registry data. + RegData = "data" + // ModuleCheckSum is the module checksum. + ModuleCheckSum = "checksum" + // ModuleTimeDateStamp is the module timestamp. + ModuleTimeDateStamp = "timedate_stamp" + // ModuleDefaultBase is the module's default base address. + ModuleDefaultBase = "default_address" + // ModuleSignatureLevel is the loaded module signature level. + ModuleSignatureLevel = "signature_level" + // ModuleSignatureType is the loaded module signature type. + ModuleSignatureType = "signature_type" + // ModuleCertSubject is the module certificate subject. + ModuleCertSubject = "cert_subject" + // ModuleCertIssuer is the module certificate issuer. + ModuleCertIssuer = "cert_issuer" + // ModuleCertSerial is the module certificate serial number. + ModuleCertSerial = "cert_serial" + // ModuleCertNotBefore is the beginning of the module certificate validity period. + ModuleCertNotBefore = "cert_not_before" + // ModuleCertNotAfter is the end of the module certificate validity period. + ModuleCertNotAfter = "cert_not_after" + // HandleID identifies the handle. + HandleID = "handle_id" + // HandleSourceID identifies the source handle. + HandleSourceID = "handle_source_id" + // HandleObject identifies the kernel object backing the handle. + HandleObject = "handle_object" + // HandleObjectName is the handle object name. + HandleObjectName = "handle_name" + // HandleObjectTypeID is the handle object type identifier. + HandleObjectTypeID = "type_id" + // ThreadpoolPoolID identifies the thread pool. + ThreadpoolPoolID = "pool_id" + // ThreadpoolTaskID identifies the thread pool task. + ThreadpoolTaskID = "task_id" + // ThreadpoolCallback is the thread pool callback address. + ThreadpoolCallback = "callback" + // ThreadpoolCallbackSymbol is the thread pool callback symbol. + ThreadpoolCallbackSymbol = "callback_symbol" + // ThreadpoolCallbackModule is the module containing the callback. + ThreadpoolCallbackModule = "callback_module" + // ThreadpoolContext is the thread pool callback context. + ThreadpoolContext = "context" + // ThreadpoolContextRip is the instruction pointer in the callback context. + ThreadpoolContextRip = "context_rip" + // ThreadpoolContextRipSymbol is the symbol for the context instruction pointer. ThreadpoolContextRipSymbol = "context_rip_symbol" + // ThreadpoolContextRipModule is the module containing the context instruction pointer. ThreadpoolContextRipModule = "context_rip_module" - ThreadpoolSubprocessTag = "subprocess_tag" - ThreadpoolTimerDuetime = "duetime" - ThreadpoolTimerSubqueue = "subqueue" - ThreadpoolTimer = "timer" - ThreadpoolTimerPeriod = "period" - ThreadpoolTimerWindow = "window" - ThreadpoolTimerAbsolute = "absolute" + // ThreadpoolSubprocessTag is the thread pool subprocess tag. + ThreadpoolSubprocessTag = "subprocess_tag" + // ThreadpoolTimerDuetime is the timer due time. + ThreadpoolTimerDuetime = "duetime" + // ThreadpoolTimerSubqueue is the timer subqueue. + ThreadpoolTimerSubqueue = "subqueue" + // ThreadpoolTimer identifies the timer. + ThreadpoolTimer = "timer" + // ThreadpoolTimerPeriod is the timer period. + ThreadpoolTimerPeriod = "period" + // ThreadpoolTimerWindow is the timer window. + ThreadpoolTimerWindow = "window" + // ThreadpoolTimerAbsolute indicates whether the timer due time is absolute. + ThreadpoolTimerAbsolute = "absolute" ) diff --git a/pkg/event/params/param_types.go b/pkg/event/params/param_types.go index 094ff92f2..c62ee303e 100644 --- a/pkg/event/params/param_types.go +++ b/pkg/event/params/param_types.go @@ -22,34 +22,63 @@ package params type Type uint16 const ( - Null Type = 0 - Int8 Type = 3 - Uint8 Type = 4 - Int16 Type = 5 - Uint16 Type = 6 - Int32 Type = 7 - Uint32 Type = 8 - Int64 Type = 9 - Uint64 Type = 10 - Float Type = 11 - Double Type = 12 - Bool Type = 13 - Binary Type = 14 - PID Type = 18 - TID Type = 19 - Port Type = 21 - IP Type = 22 - IPv4 Type = 23 - IPv6 Type = 24 - Time Type = 25 - Slice Type = 26 - Enum Type = 27 - Map Type = 28 - Object Type = 29 - Path Type = 31 - Status Type = 32 - Flags Type = 34 + // Null is a null parameter type. + Null Type = 0 + // Int8 is a signed 8-bit integer. + Int8 Type = 3 + // Uint8 is an unsigned 8-bit integer. + Uint8 Type = 4 + // Int16 is a signed 16-bit integer. + Int16 Type = 5 + // Uint16 is an unsigned 16-bit integer. + Uint16 Type = 6 + // Int32 is a signed 32-bit integer. + Int32 Type = 7 + // Uint32 is an unsigned 32-bit integer. + Uint32 Type = 8 + // Int64 is a signed 64-bit integer. + Int64 Type = 9 + // Uint64 is an unsigned 64-bit integer. + Uint64 Type = 10 + // Float is an IEEE 4-byte floating-point number. + Float Type = 11 + // Double is an IEEE 8-byte floating-point number. + Double Type = 12 + // Bool is a boolean value. + Bool Type = 13 + // Binary is variable-sized binary data. + Binary Type = 14 + // PID is a process identifier. + PID Type = 18 + // TID is a thread identifier. + TID Type = 19 + // Port is an endpoint port number. + Port Type = 21 + // IP is an IP address. + IP Type = 22 + // IPv4 is an IPv4 address. + IPv4 Type = 23 + // IPv6 is an IPv6 address. + IPv6 Type = 24 + // Time is a timestamp. + Time Type = 25 + // Slice is a collection of items. + Slice Type = 26 + // Enum is an enumeration. + Enum Type = 27 + // Map is a map of values. + Map Type = 28 + // Object is a generic object. + Object Type = 29 + // Path is a normalized filesystem path. + Path Type = 31 + // Status is a system error code. + Status Type = 32 + // Flags is a bitmask. + Flags Type = 34 + // Flags64 is a 64-bit bitmask. Flags64 Type = 35 + // Address is a memory address. Address Type = 36 ) diff --git a/pkg/event/params/types_windows.go b/pkg/event/params/types_windows.go index 5a64fba36..a342c0b85 100644 --- a/pkg/event/params/types_windows.go +++ b/pkg/event/params/types_windows.go @@ -19,15 +19,24 @@ package params const ( + // UnicodeString is a UTF-16LE string. UnicodeString Type = 1 - AnsiString Type = 2 - GUID Type = 15 - Pointer Type = 16 - SID Type = 17 - WbemSID Type = 20 - DOSPath Type = 30 - Key Type = 33 - HandleType Type = 37 + // AnsiString is an 8-bit character string. + AnsiString Type = 2 + // GUID is a globally unique identifier. + GUID Type = 15 + // Pointer is an architecture-sized pointer value. + Pointer Type = 16 + // SID is a Windows security identifier. + SID Type = 17 + // WbemSID is a Web-Based Enterprise Management security identifier. + WbemSID Type = 20 + // DOSPath is a filesystem path in DOS device notation. + DOSPath Type = 30 + // Key is a registry key. + Key Type = 33 + // HandleType is a Windows handle type. + HandleType Type = 37 ) func platformTypeString(t Type) string { diff --git a/pkg/filter/fields/defs_linux.go b/pkg/filter/fields/defs_linux.go index 717dd8ffa..f0daa6b47 100644 --- a/pkg/filter/fields/defs_linux.go +++ b/pkg/filter/fields/defs_linux.go @@ -28,8 +28,6 @@ func platformAnsiString() params.Type { return params.String } var fields = platformFields(map[Field]FieldInfo{ EvtPID: {EvtPID, "process identifier generating the event", params.Uint64, []string{"evt.pid = 6"}, nil, nil}, EvtTID: {EvtTID, "thread identifier generating the event", params.Uint64, []string{"evt.tid = 1024"}, nil, nil}, - KevtPID: {KevtPID, "process identifier generating the event", params.Uint64, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil}, - KevtTID: {KevtTID, "thread identifier generating the event", params.Uint64, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil}, PsPid: {PsPid, "process identifier", params.Uint64, []string{"ps.pid = 1024"}, nil, nil}, PsPpid: {PsPpid, "parent process identifier", params.Uint64, []string{"ps.ppid = 45"}, nil, nil}, PsParentPid: {PsParentPid, "parent process id", params.Uint64, []string{"ps.parent.pid = 4"}, nil, nil}, diff --git a/pkg/filter/fields/defs_linux_test.go b/pkg/filter/fields/defs_linux_test.go index 22eeaf939..381e3ac5b 100644 --- a/pkg/filter/fields/defs_linux_test.go +++ b/pkg/filter/fields/defs_linux_test.go @@ -36,6 +36,8 @@ func TestLinuxFields(t *testing.T) { require.Equal(t, params.Uint64, EvtPID.Type()) require.Equal(t, params.Uint64, EvtTID.Type()) require.Equal(t, params.Uint64, PsPid.Type()) + require.False(t, IsField(string(KevtPID))) + require.False(t, IsField(string(KevtTID))) require.False(t, IsField(string(PsComm))) require.False(t, IsField(string(RegistryPath))) require.False(t, IsField(string(PeEntrypoint))) From dafcc983b712d54b1c93403639b381985eebe302 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 14 Sep 2026 13:17:05 +0200 Subject: [PATCH 29/65] feat(ebpf): Add Linux process event source Linux run can now load CO-RE programs, snapshot processes through iter/task, and emit enriched execve/exit/clone events instead of failing as an unwired capture stub. --- .github/workflows/linux-port.yml | 39 +++ internal/bootstrap/bootstrap_linux.go | 179 +++++++++++++- internal/bootstrap/source_linux.go | 32 ++- internal/ebpf/btf.go | 33 +++ internal/ebpf/c/clone.bpf.c | 166 +++++++++++++ internal/ebpf/c/common/events.h | 125 ++++++++++ internal/ebpf/c/execve.bpf.c | 85 +++++++ internal/ebpf/c/exit.bpf.c | 57 +++++ internal/ebpf/c/proc_iter.bpf.c | 60 +++++ internal/ebpf/clone_bpfeb.go | 171 +++++++++++++ internal/ebpf/clone_bpfeb.o | Bin 0 -> 30048 bytes internal/ebpf/clone_bpfel.go | 171 +++++++++++++ internal/ebpf/clone_bpfel.o | Bin 0 -> 30048 bytes internal/ebpf/consumer.go | 189 +++++++++++++++ internal/ebpf/consumer_test.go | 98 ++++++++ internal/ebpf/doc.go | 7 +- internal/ebpf/enrich.go | 52 ++++ internal/ebpf/events.go | 142 +++++++++++ internal/ebpf/events_test.go | 150 ++++++++++++ internal/ebpf/execve_bpfeb.go | 156 ++++++++++++ internal/ebpf/execve_bpfeb.o | Bin 0 -> 16352 bytes internal/ebpf/execve_bpfel.go | 156 ++++++++++++ internal/ebpf/execve_bpfel.o | Bin 0 -> 16352 bytes internal/ebpf/exit_bpfeb.go | 150 ++++++++++++ internal/ebpf/exit_bpfeb.o | Bin 0 -> 11336 bytes internal/ebpf/exit_bpfel.go | 150 ++++++++++++ internal/ebpf/exit_bpfel.o | Bin 0 -> 11336 bytes internal/ebpf/gen.go | 26 ++ internal/ebpf/generate.sh | 36 +++ internal/ebpf/loader.go | 220 +++++++++++++++++ internal/ebpf/maps.go | 27 +++ internal/ebpf/proc_iter.go | 64 +++++ internal/ebpf/prociter_bpfeb.go | 147 +++++++++++ internal/ebpf/prociter_bpfeb.o | Bin 0 -> 6264 bytes internal/ebpf/prociter_bpfel.go | 147 +++++++++++ internal/ebpf/prociter_bpfel.o | Bin 0 -> 6264 bytes internal/ebpf/ringbuf.go | 60 +++++ internal/ebpf/source.go | 297 +++++++++++++++++++++++ internal/ebpf/source_integration_test.go | 83 +++++++ internal/ebpf/source_test.go | 118 +++++++++ internal/ebpf/testdata/execve.json | 19 ++ pkg/api/server_linux.go | 62 +++++ pkg/event/event_linux.go | 22 +- pkg/event/params/names_linux.go | 6 + pkg/event/sequencer_linux.go | 55 +++++ pkg/util/signals/signals.go | 2 + pkg/util/signals/signals_linux.go | 47 ++++ 47 files changed, 3784 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/linux-port.yml create mode 100644 internal/ebpf/btf.go create mode 100644 internal/ebpf/c/clone.bpf.c create mode 100644 internal/ebpf/c/common/events.h create mode 100644 internal/ebpf/c/execve.bpf.c create mode 100644 internal/ebpf/c/exit.bpf.c create mode 100644 internal/ebpf/c/proc_iter.bpf.c create mode 100644 internal/ebpf/clone_bpfeb.go create mode 100644 internal/ebpf/clone_bpfeb.o create mode 100644 internal/ebpf/clone_bpfel.go create mode 100644 internal/ebpf/clone_bpfel.o create mode 100644 internal/ebpf/consumer.go create mode 100644 internal/ebpf/consumer_test.go create mode 100644 internal/ebpf/enrich.go create mode 100644 internal/ebpf/events.go create mode 100644 internal/ebpf/events_test.go create mode 100644 internal/ebpf/execve_bpfeb.go create mode 100644 internal/ebpf/execve_bpfeb.o create mode 100644 internal/ebpf/execve_bpfel.go create mode 100644 internal/ebpf/execve_bpfel.o create mode 100644 internal/ebpf/exit_bpfeb.go create mode 100644 internal/ebpf/exit_bpfeb.o create mode 100644 internal/ebpf/exit_bpfel.go create mode 100644 internal/ebpf/exit_bpfel.o create mode 100644 internal/ebpf/gen.go create mode 100755 internal/ebpf/generate.sh create mode 100644 internal/ebpf/loader.go create mode 100644 internal/ebpf/maps.go create mode 100644 internal/ebpf/proc_iter.go create mode 100644 internal/ebpf/prociter_bpfeb.go create mode 100644 internal/ebpf/prociter_bpfeb.o create mode 100644 internal/ebpf/prociter_bpfel.go create mode 100644 internal/ebpf/prociter_bpfel.o create mode 100644 internal/ebpf/ringbuf.go create mode 100644 internal/ebpf/source.go create mode 100644 internal/ebpf/source_integration_test.go create mode 100644 internal/ebpf/source_test.go create mode 100644 internal/ebpf/testdata/execve.json create mode 100644 pkg/api/server_linux.go create mode 100644 pkg/event/sequencer_linux.go create mode 100644 pkg/util/signals/signals_linux.go diff --git a/.github/workflows/linux-port.yml b/.github/workflows/linux-port.yml new file mode 100644 index 000000000..1c4c950c6 --- /dev/null +++ b/.github/workflows/linux-port.yml @@ -0,0 +1,39 @@ +name: linux-port + +on: + pull_request: + branches: + - linux-port + workflow_dispatch: + +concurrency: + group: linux-port-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + GO_VERSION: 1.26.x + +jobs: + ebpf: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + - name: Install clang + run: | + sudo apt-get update + sudo apt-get install -y clang llvm + clang --version + - name: Check generation drift + run: | + chmod +x internal/ebpf/generate.sh + ./internal/ebpf/generate.sh + git diff --exit-code -- internal/ebpf + - name: Unit tests + run: go test ./internal/ebpf ./internal/bootstrap ./pkg/event ./pkg/ps ./pkg/api ./pkg/util/signals + - name: Privileged process source + run: sudo -E env "PATH=$PATH" go test -tags ebpf_integration -count=1 ./internal/ebpf diff --git a/internal/bootstrap/bootstrap_linux.go b/internal/bootstrap/bootstrap_linux.go index d9d3abc45..26ca98856 100644 --- a/internal/bootstrap/bootstrap_linux.go +++ b/internal/bootstrap/bootstrap_linux.go @@ -23,45 +23,202 @@ package bootstrap import ( "errors" + "fmt" + "os" + "syscall" + "github.com/rabbitstack/fibratus/pkg/aggregator" + "github.com/rabbitstack/fibratus/pkg/alertsender" + "github.com/rabbitstack/fibratus/pkg/api" "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/filter" + "github.com/rabbitstack/fibratus/pkg/ps" + "github.com/rabbitstack/fibratus/pkg/rules" + "github.com/rabbitstack/fibratus/pkg/util/multierror" + "github.com/rabbitstack/fibratus/pkg/util/signals" + "github.com/rabbitstack/fibratus/pkg/util/version" + log "github.com/sirupsen/logrus" + "golang.org/x/sys/unix" ) -var ErrCaptureNotWired = errors.New("linux event capture is not wired yet") +const instanceLockPath = "/tmp/fibratus.lock" +// ErrAlreadyRunning signals a Fibratus process is already running. +var ErrAlreadyRunning = errors.New("an instance of Fibratus process is already running in the system") + +// App centralizes the core building blocks responsible +// for event acquisition, rule engine initialization, +// and event routing to the output sinks. type App struct { - config *config.Config - evs *EventSourceControl + config *config.Config + evs *EventSourceControl + engine *rules.Engine + psnap ps.Snapshotter + agg *aggregator.BufferedAggregator + signals chan struct{} + lock *os.File } +// Option enables changing the behaviour of the bootstrap application. type Option func(*opts) -type opts struct{} +type opts struct { + installSignals bool +} +// WithSignals installs signal handlers. func WithSignals() Option { - return func(*opts) {} + return func(o *opts) { + o.installSignals = true + } } +// WithDebugPrivilege is a no-op on Linux. func WithDebugPrivilege() Option { return func(*opts) {} } +// NewApp constructs a new bootstrap application with the specified configuration +// and a list of options. func NewApp(cfg *config.Config, options ...Option) (*App, error) { if err := InitConfigAndLogger(cfg); err != nil { return nil, err } - return &App{config: cfg, evs: NewEventSourceControl(cfg)}, nil + var o opts + var sigs chan struct{} + for _, opt := range options { + opt(&o) + } + if o.installSignals { + sigs = signals.Install() + } + + psnap := ps.NewSnapshotter() + + var engine *rules.Engine + var rs *config.RulesCompileResult + if cfg.Filters != nil && cfg.Filters.Rules.Enabled && !cfg.ForwardMode && !cfg.IsCaptureSet() && !cfg.IsFilamentSet() { + engine = rules.NewEngine(psnap, cfg) + var err error + rs, err = engine.Compile() + if err != nil { + return nil, err + } + if rs != nil { + log.Infof("rules compile summary: %s", rs) + } + } else { + log.Info("rule engine is disabled") + } + + return &App{ + config: cfg, + evs: NewEventSourceControl(psnap, cfg, rs), + engine: engine, + psnap: psnap, + signals: sigs, + }, nil } -func (f *App) Run([]string) error { - if err := f.evs.Open(f.config); err != nil { +// Run configures and opens the event source to start consuming events. +func (f *App) Run(args []string) error { + if f.evs == nil { + panic("event source is nil") + } + cfg := f.config + + if cfg.IsFilamentSet() { + return fmt.Errorf("filaments are not supported on Linux") + } + + lock, err := acquireInstanceLock() + if err != nil { + if errors.Is(err, syscall.EWOULDBLOCK) || errors.Is(err, syscall.EAGAIN) { + return ErrAlreadyRunning + } + return fmt.Errorf("acquiring instance lock: %w", err) + } + f.lock = lock + + log.Infof("bootstrapping with pid %d. Version: %s", os.Getpid(), version.Get()) + log.Infof("configuration options: %s", cfg.Print()) + + fltr, err := filter.NewFromCLI(args, cfg) + if err != nil { + return err + } + if fltr != nil { + f.evs.SetFilter(fltr) + } + if f.engine != nil { + f.evs.RegisterEventListener(f.engine) + } + + if err := f.evs.Open(cfg); err != nil { + return multierror.Wrap(err, f.evs.Close()) + } + + f.agg, err = aggregator.NewBuffered( + f.evs.Events(), + f.evs.Errors(), + cfg.Aggregator, + cfg.Output, + cfg.Transformers, + cfg.Alertsenders, + ) + if err != nil { return err } - return ErrCaptureNotWired + return api.StartServer(cfg) } -func (*App) Wait() {} +// Wait waits for the app to receive the termination signal. +func (f *App) Wait() { + if f.signals != nil { + <-f.signals + } +} +// Shutdown is responsible for tearing down everything gracefully. func (f *App) Shutdown() error { - return f.evs.Close() + errs := make([]error, 0) + if f.evs != nil { + if err := f.evs.Close(); err != nil { + errs = append(errs, err) + } + } + if f.psnap != nil { + if err := f.psnap.Close(); err != nil { + errs = append(errs, err) + } + } + if f.agg != nil { + if err := f.agg.Stop(); err != nil { + errs = append(errs, err) + } + } + if err := api.CloseServer(); err != nil { + errs = append(errs, err) + } + if err := alertsender.ShutdownAll(); err != nil { + errs = append(errs, err) + } + if f.lock != nil { + _ = unix.Flock(int(f.lock.Fd()), unix.LOCK_UN) + _ = f.lock.Close() + _ = os.Remove(instanceLockPath) + } + return multierror.Wrap(errs...) +} + +func acquireInstanceLock() (*os.File, error) { + f, err := os.OpenFile(instanceLockPath, os.O_CREATE|os.O_RDWR, 0o600) + if err != nil { + return nil, err + } + if err := unix.Flock(int(f.Fd()), unix.LOCK_EX|unix.LOCK_NB); err != nil { + _ = f.Close() + return nil, err + } + return f, nil } diff --git a/internal/bootstrap/source_linux.go b/internal/bootstrap/source_linux.go index b4df2a74e..8096eba53 100644 --- a/internal/bootstrap/source_linux.go +++ b/internal/bootstrap/source_linux.go @@ -22,15 +22,25 @@ package bootstrap import ( + "github.com/rabbitstack/fibratus/internal/ebpf" "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/filter" + "github.com/rabbitstack/fibratus/pkg/ps" + "github.com/rabbitstack/fibratus/pkg/source" ) +// EventSourceControl abstracts away the management of event sources. type EventSourceControl struct { - evs *stubEventSource + evs source.EventSource } -func NewEventSourceControl(*config.Config) *EventSourceControl { - return &EventSourceControl{evs: &stubEventSource{}} +func NewEventSourceControl( + psnap ps.Snapshotter, + cfg *config.Config, + compiler *config.RulesCompileResult, +) *EventSourceControl { + return &EventSourceControl{evs: ebpf.NewEventSource(psnap, cfg, compiler)} } func (s *EventSourceControl) Open(cfg *config.Config) error { @@ -41,10 +51,18 @@ func (s *EventSourceControl) Close() error { return s.evs.Close() } -type stubEventSource struct{} +func (s *EventSourceControl) Errors() <-chan error { + return s.evs.Errors() +} + +func (s *EventSourceControl) Events() <-chan *event.Event { + return s.evs.Events() +} -func (*stubEventSource) Open(*config.Config) error { - return nil +func (s *EventSourceControl) SetFilter(f filter.Filter) { + s.evs.SetFilter(f) } -func (*stubEventSource) Close() error { return nil } +func (s *EventSourceControl) RegisterEventListener(lis event.Listener) { + s.evs.RegisterEventListener(lis) +} diff --git a/internal/ebpf/btf.go b/internal/ebpf/btf.go new file mode 100644 index 000000000..0e4d96d78 --- /dev/null +++ b/internal/ebpf/btf.go @@ -0,0 +1,33 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "fmt" + "runtime" +) + +func checkRuntimeSupport() (*PrerequisiteReport, error) { + if runtime.GOARCH != "amd64" { + return nil, fmt.Errorf("linux eBPF capture requires amd64, got %s", runtime.GOARCH) + } + return ProbePrerequisites() +} diff --git a/internal/ebpf/c/clone.bpf.c b/internal/ebpf/c/clone.bpf.c new file mode 100644 index 000000000..d2e5bdfde --- /dev/null +++ b/internal/ebpf/c/clone.bpf.c @@ -0,0 +1,166 @@ +//go:build ignore + +#include "common/events.h" +#include "bpf_core_read.h" +#include "bpf_tracing.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +static __always_inline int handle_clone_enter(u64 flags, u32 syscall_id) +{ + u64 key = bpf_get_current_pid_tgid(); + struct scratch_value val = {}; + + val.arg0 = flags; + val.arg1 = syscall_id; + bpf_map_update_elem(&scratch, &key, &val, BPF_ANY); + return 0; +} + +static __always_inline int handle_clone_exit(long ret, u32 syscall_id) +{ + u64 key = bpf_get_current_pid_tgid(); + struct scratch_value *val; + struct fibratus_event *e; + struct task_struct *task; + struct task_struct *parent; + const struct cred *cred; + + /* Successful clones are emitted from sched_process_fork with child identity. + * Leave scratch in place so the fork handler can recover clone flags. + */ + if (ret >= 0) + return 0; + + e = reserve_event(); + if (!e) + return 0; + + e->kind = EVT_KIND_CLONE; + e->type = EVT_TYPE_CLONE; + e->syscall_id = syscall_id; + e->retval = ret; + fill_current_ids(e); + + task = (struct task_struct *)bpf_get_current_task(); + e->start_boottime = BPF_CORE_READ(task, start_boottime); + parent = BPF_CORE_READ(task, real_parent); + if (parent) + e->ppid = BPF_CORE_READ(parent, tgid); + cred = BPF_CORE_READ(task, real_cred); + if (cred) { + e->uid = BPF_CORE_READ(cred, uid.val); + e->gid = BPF_CORE_READ(cred, gid.val); + } + + val = bpf_map_lookup_elem(&scratch, &key); + if (val) { + e->clone_flags = val->arg0; + if (!e->syscall_id) + e->syscall_id = (u32)val->arg1; + } + bpf_map_delete_elem(&scratch, &key); + + bpf_ringbuf_submit(e, 0); + return 0; +} + +SEC("tp/syscalls/sys_enter_clone") +int handle_sys_enter_clone(struct trace_event_raw_sys_enter *ctx) +{ + return handle_clone_enter(ctx->args[0], (u32)ctx->id); +} + +SEC("tp/syscalls/sys_exit_clone") +int handle_sys_exit_clone(struct trace_event_raw_sys_exit *ctx) +{ + return handle_clone_exit(ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_clone3") +int handle_sys_enter_clone3(struct trace_event_raw_sys_enter *ctx) +{ + u64 flags = 0; + + bpf_probe_read_user(&flags, sizeof(flags), (const void *)ctx->args[0]); + return handle_clone_enter(flags, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_exit_clone3") +int handle_sys_exit_clone3(struct trace_event_raw_sys_exit *ctx) +{ + return handle_clone_exit(ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_fork") +int handle_sys_enter_fork(struct trace_event_raw_sys_enter *ctx) +{ + return handle_clone_enter(0, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_exit_fork") +int handle_sys_exit_fork(struct trace_event_raw_sys_exit *ctx) +{ + return handle_clone_exit(ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_vfork") +int handle_sys_enter_vfork(struct trace_event_raw_sys_enter *ctx) +{ + return handle_clone_enter(0, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_exit_vfork") +int handle_sys_exit_vfork(struct trace_event_raw_sys_exit *ctx) +{ + return handle_clone_exit(ctx->ret, (u32)ctx->id); +} + +SEC("tp_btf/sched_process_fork") +int BPF_PROG(handle_sched_process_fork, struct task_struct *parent, struct task_struct *child) +{ + struct fibratus_event *e; + struct scratch_value *val; + const struct cred *cred; + struct task_struct *real_parent; + u64 key; + + if (!child || !parent) + return 0; + + e = reserve_event(); + if (!e) + return 0; + + e->kind = EVT_KIND_CLONE; + e->type = EVT_TYPE_CLONE; + e->retval = child->tgid; + e->pid = child->tgid; + e->tid = child->pid; + e->tgid = child->tgid; + e->start_boottime = child->start_boottime; + __builtin_memcpy(&e->comm, child->comm, sizeof(e->comm)); + + real_parent = child->real_parent; + if (real_parent) + e->ppid = real_parent->tgid; + else + e->ppid = parent->tgid; + + cred = child->real_cred; + if (cred) { + e->uid = cred->uid.val; + e->gid = cred->gid.val; + } + + key = ((u64)parent->tgid << 32) | (u32)parent->pid; + val = bpf_map_lookup_elem(&scratch, &key); + if (val) { + e->clone_flags = val->arg0; + e->syscall_id = (u32)val->arg1; + bpf_map_delete_elem(&scratch, &key); + } + + bpf_ringbuf_submit(e, 0); + return 0; +} diff --git a/internal/ebpf/c/common/events.h b/internal/ebpf/c/common/events.h new file mode 100644 index 000000000..56400585a --- /dev/null +++ b/internal/ebpf/c/common/events.h @@ -0,0 +1,125 @@ +/* Shared event and map definitions for the Linux eBPF backend. */ + +#pragma once + +#include "vmlinux.h" +#include "bpf_helpers.h" + +#ifndef BPF_ANY +#define BPF_ANY 0 +#endif + +#define EVT_FILENAME_LEN 256 + +struct trace_event_raw_sys_enter { + unsigned short common_type; + unsigned char common_flags; + unsigned char common_preempt_count; + int common_pid; + long id; + unsigned long args[6]; +}; + +struct trace_event_raw_sys_exit { + unsigned short common_type; + unsigned char common_flags; + unsigned char common_preempt_count; + int common_pid; + long id; + long ret; +}; + +enum fibratus_event_kind { + EVT_KIND_SNAPSHOT = 0, + EVT_KIND_EXECVE = 1, + EVT_KIND_EXIT = 2, + EVT_KIND_CLONE = 3, +}; + +/* Stable semantic type IDs. Keep in sync with pkg/event.Type on Linux. */ +#define EVT_TYPE_UNKNOWN 0 +#define EVT_TYPE_EXECVE 1 +#define EVT_TYPE_EXIT 2 +#define EVT_TYPE_CLONE 3 + +struct fibratus_event { + u32 kind; + u32 type; + u32 pid; + u32 tid; + u32 tgid; + u32 ppid; + u32 uid; + u32 gid; + u32 syscall_id; + u32 pad; + s64 retval; + u64 clone_flags; + u64 start_boottime; + u64 timestamp_ns; + u8 comm[TASK_COMM_LEN]; + u8 filename[EVT_FILENAME_LEN]; +}; + +struct scratch_value { + u64 arg0; + u64 arg1; + u8 filename[EVT_FILENAME_LEN]; +}; + +struct { + __uint(type, BPF_MAP_TYPE_RINGBUF); + __uint(max_entries, 1 << 24); +} events SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __uint(max_entries, 1); + __type(key, u32); + __type(value, u64); +} drop_count SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_HASH); + __uint(max_entries, 8192); + __type(key, u64); + __type(value, struct scratch_value); +} scratch SEC(".maps"); + +static __always_inline void account_drop(void) +{ + u32 key = 0; + u64 *count; + + count = bpf_map_lookup_elem(&drop_count, &key); + if (!count) + return; + __sync_fetch_and_add(count, 1); +} + +static __always_inline struct fibratus_event *reserve_event(void) +{ + struct fibratus_event *e; + + e = bpf_ringbuf_reserve(&events, sizeof(*e), 0); + if (!e) { + account_drop(); + return NULL; + } + __builtin_memset(e, 0, sizeof(*e)); + e->timestamp_ns = bpf_ktime_get_ns(); + return e; +} + +static __always_inline void fill_current_ids(struct fibratus_event *e) +{ + u64 id = bpf_get_current_pid_tgid(); + u64 uidgid = bpf_get_current_uid_gid(); + + e->tgid = id >> 32; + e->tid = (u32)id; + e->pid = e->tgid; + e->uid = (u32)uidgid; + e->gid = uidgid >> 32; + bpf_get_current_comm(&e->comm, sizeof(e->comm)); +} diff --git a/internal/ebpf/c/execve.bpf.c b/internal/ebpf/c/execve.bpf.c new file mode 100644 index 000000000..55ec98d4c --- /dev/null +++ b/internal/ebpf/c/execve.bpf.c @@ -0,0 +1,85 @@ +//go:build ignore + +#include "common/events.h" +#include "bpf_core_read.h" +#include "bpf_tracing.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +static __always_inline int handle_exec_enter(const char *filename, u32 syscall_id) +{ + u64 key = bpf_get_current_pid_tgid(); + struct scratch_value val = {}; + + val.arg1 = syscall_id; + if (filename) + bpf_probe_read_user_str(&val.filename, sizeof(val.filename), filename); + bpf_map_update_elem(&scratch, &key, &val, BPF_ANY); + return 0; +} + +static __always_inline int handle_exec_exit(long ret, u32 syscall_id) +{ + u64 key = bpf_get_current_pid_tgid(); + struct scratch_value *val; + struct fibratus_event *e; + struct task_struct *task; + struct task_struct *parent; + const struct cred *cred; + + e = reserve_event(); + if (!e) + return 0; + + e->kind = EVT_KIND_EXECVE; + e->type = EVT_TYPE_EXECVE; + e->syscall_id = syscall_id; + e->retval = ret; + fill_current_ids(e); + + task = (struct task_struct *)bpf_get_current_task(); + e->start_boottime = BPF_CORE_READ(task, start_boottime); + parent = BPF_CORE_READ(task, real_parent); + if (parent) + e->ppid = BPF_CORE_READ(parent, tgid); + cred = BPF_CORE_READ(task, real_cred); + if (cred) { + e->uid = BPF_CORE_READ(cred, uid.val); + e->gid = BPF_CORE_READ(cred, gid.val); + } + + val = bpf_map_lookup_elem(&scratch, &key); + if (val) { + if (!e->syscall_id) + e->syscall_id = (u32)val->arg1; + __builtin_memcpy(&e->filename, val->filename, sizeof(e->filename)); + } + bpf_map_delete_elem(&scratch, &key); + + bpf_ringbuf_submit(e, 0); + return 0; +} + +SEC("tp/syscalls/sys_enter_execve") +int handle_sys_enter_execve(struct trace_event_raw_sys_enter *ctx) +{ + return handle_exec_enter((const char *)ctx->args[0], (u32)ctx->id); +} + +SEC("tp/syscalls/sys_exit_execve") +int handle_sys_exit_execve(struct trace_event_raw_sys_exit *ctx) +{ + return handle_exec_exit(ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_execveat") +int handle_sys_enter_execveat(struct trace_event_raw_sys_enter *ctx) +{ + return handle_exec_enter((const char *)ctx->args[1], (u32)ctx->id); +} + +SEC("tp/syscalls/sys_exit_execveat") +int handle_sys_exit_execveat(struct trace_event_raw_sys_exit *ctx) +{ + return handle_exec_exit(ctx->ret, (u32)ctx->id); +} diff --git a/internal/ebpf/c/exit.bpf.c b/internal/ebpf/c/exit.bpf.c new file mode 100644 index 000000000..00e32465c --- /dev/null +++ b/internal/ebpf/c/exit.bpf.c @@ -0,0 +1,57 @@ +//go:build ignore + +#include "common/events.h" +#include "bpf_core_read.h" +#include "bpf_tracing.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +static __always_inline int handle_exit(long ret, u32 syscall_id) +{ + struct fibratus_event *e; + struct task_struct *task; + struct task_struct *parent; + const struct cred *cred; + u64 id; + + id = bpf_get_current_pid_tgid(); + /* Only emit process exits from the thread-group leader. */ + if ((u32)id != (id >> 32)) + return 0; + + e = reserve_event(); + if (!e) + return 0; + + e->kind = EVT_KIND_EXIT; + e->type = EVT_TYPE_EXIT; + e->syscall_id = syscall_id; + e->retval = ret; + fill_current_ids(e); + + task = (struct task_struct *)bpf_get_current_task(); + e->start_boottime = BPF_CORE_READ(task, start_boottime); + parent = BPF_CORE_READ(task, real_parent); + if (parent) + e->ppid = BPF_CORE_READ(parent, tgid); + cred = BPF_CORE_READ(task, real_cred); + if (cred) { + e->uid = BPF_CORE_READ(cred, uid.val); + e->gid = BPF_CORE_READ(cred, gid.val); + } + + bpf_ringbuf_submit(e, 0); + return 0; +} + +SEC("tp/syscalls/sys_exit_exit_group") +int handle_sys_exit_exit_group(struct trace_event_raw_sys_exit *ctx) +{ + return handle_exit(ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_exit_exit") +int handle_sys_exit_exit(struct trace_event_raw_sys_exit *ctx) +{ + return handle_exit(ctx->ret, (u32)ctx->id); +} diff --git a/internal/ebpf/c/proc_iter.bpf.c b/internal/ebpf/c/proc_iter.bpf.c new file mode 100644 index 000000000..31c7b8be4 --- /dev/null +++ b/internal/ebpf/c/proc_iter.bpf.c @@ -0,0 +1,60 @@ +//go:build ignore + +#include "common/events.h" +#include "bpf_core_read.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +/* Task iterator baseline scanner. + * + * Intentionally omits bpf_d_path (available from Linux 5.10). Executable path + * and cmdline are left empty here and are filled best-effort from + * /proc//{exe,cmdline} in userspace. + * + * ctx->task is a trusted BTF pointer, so field access uses CO-RE direct reads + * rather than bpf_probe_read-based helpers. + */ +SEC("iter/task") +int dump_task(struct bpf_iter__task *ctx) +{ + struct task_struct *task; + struct task_struct *parent; + const struct cred *cred; + struct fibratus_event *e; + pid_t pid; + pid_t tgid; + + task = ctx->task; + if (!task) + return 0; + + pid = task->pid; + tgid = task->tgid; + if (pid != tgid) + return 0; + + e = reserve_event(); + if (!e) + return 0; + + e->kind = EVT_KIND_SNAPSHOT; + e->type = EVT_TYPE_UNKNOWN; + e->pid = tgid; + e->tid = pid; + e->tgid = tgid; + e->start_boottime = task->start_boottime; + __builtin_memcpy(&e->comm, task->comm, sizeof(e->comm)); + + parent = task->real_parent; + if (parent) + e->ppid = parent->tgid; + + cred = task->real_cred; + if (cred) { + e->uid = cred->uid.val; + e->gid = cred->gid.val; + } + + bpf_ringbuf_submit(e, 0); + return 0; +} diff --git a/internal/ebpf/clone_bpfeb.go b/internal/ebpf/clone_bpfeb.go new file mode 100644 index 000000000..0c1de89c0 --- /dev/null +++ b/internal/ebpf/clone_bpfeb.go @@ -0,0 +1,171 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (mips || mips64 || ppc64 || s390x) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type cloneScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Filename [256]uint8 +} + +// loadClone returns the embedded CollectionSpec for clone. +func loadClone() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_CloneBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load clone: %w", err) + } + + return spec, err +} + +// loadCloneObjects loads clone and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *cloneObjects +// *clonePrograms +// *cloneMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadCloneObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadClone() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// cloneSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type cloneSpecs struct { + cloneProgramSpecs + cloneMapSpecs + cloneVariableSpecs +} + +// cloneProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type cloneProgramSpecs struct { + HandleSchedProcessFork *ebpf.ProgramSpec `ebpf:"handle_sched_process_fork"` + HandleSysEnterClone *ebpf.ProgramSpec `ebpf:"handle_sys_enter_clone"` + HandleSysEnterClone3 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_clone3"` + HandleSysEnterFork *ebpf.ProgramSpec `ebpf:"handle_sys_enter_fork"` + HandleSysEnterVfork *ebpf.ProgramSpec `ebpf:"handle_sys_enter_vfork"` + HandleSysExitClone *ebpf.ProgramSpec `ebpf:"handle_sys_exit_clone"` + HandleSysExitClone3 *ebpf.ProgramSpec `ebpf:"handle_sys_exit_clone3"` + HandleSysExitFork *ebpf.ProgramSpec `ebpf:"handle_sys_exit_fork"` + HandleSysExitVfork *ebpf.ProgramSpec `ebpf:"handle_sys_exit_vfork"` +} + +// cloneMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type cloneMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` +} + +// cloneVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type cloneVariableSpecs struct { +} + +// cloneObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type cloneObjects struct { + clonePrograms + cloneMaps + cloneVariables +} + +func (o *cloneObjects) Close() error { + return _CloneClose( + &o.clonePrograms, + &o.cloneMaps, + ) +} + +// cloneMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type cloneMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` +} + +func (m *cloneMaps) Close() error { + return _CloneClose( + m.DropCount, + m.Events, + m.Scratch, + ) +} + +// cloneVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type cloneVariables struct { +} + +// clonePrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type clonePrograms struct { + HandleSchedProcessFork *ebpf.Program `ebpf:"handle_sched_process_fork"` + HandleSysEnterClone *ebpf.Program `ebpf:"handle_sys_enter_clone"` + HandleSysEnterClone3 *ebpf.Program `ebpf:"handle_sys_enter_clone3"` + HandleSysEnterFork *ebpf.Program `ebpf:"handle_sys_enter_fork"` + HandleSysEnterVfork *ebpf.Program `ebpf:"handle_sys_enter_vfork"` + HandleSysExitClone *ebpf.Program `ebpf:"handle_sys_exit_clone"` + HandleSysExitClone3 *ebpf.Program `ebpf:"handle_sys_exit_clone3"` + HandleSysExitFork *ebpf.Program `ebpf:"handle_sys_exit_fork"` + HandleSysExitVfork *ebpf.Program `ebpf:"handle_sys_exit_vfork"` +} + +func (p *clonePrograms) Close() error { + return _CloneClose( + p.HandleSchedProcessFork, + p.HandleSysEnterClone, + p.HandleSysEnterClone3, + p.HandleSysEnterFork, + p.HandleSysEnterVfork, + p.HandleSysExitClone, + p.HandleSysExitClone3, + p.HandleSysExitFork, + p.HandleSysExitVfork, + ) +} + +func _CloneClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed clone_bpfeb.o +var _CloneBytes []byte diff --git a/internal/ebpf/clone_bpfeb.o b/internal/ebpf/clone_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..bd257bec4254700d3b62bd78dd04128ab236de7a GIT binary patch literal 30048 zcmeI44Qymrb;s|UvAwgKP1YgV%>bc!At8*n8}E3%yBU^cJNekeDci(Z0x}es8QZg- zVf``8jFWM^ZKnmQ5s=ENO6!&YCXIrTXk`TL4ppSJDnzXkRTe~*RZ?N8L2_xNx>c)= zXq4^$+ow!&Co(uoKbLATa4` zO7ith%A3ikZlakFs|d-D(M752W*4qDC~#S8m74wh)lFi^4VLRH*I2HyTw%G)vd(ge z0gXEYl zUHOl*oc+S9n_BAizW{SKw$ap8T3M_Q*+pP=~Jyf?_w^h4fDGMj$Ld)gz|nSRK7KI=_Cr$Rg!o%r*!&}G366;e}yTGBRrci0XuH4Xs?_3 z96-ALWMRiMSeFZ_%N%!<0N+FE|cy+ zpOIJIU?k;(VZ6!tL^z)h&%D8mOVmTR8|M@GvGX})@;Mkc_2PUweuy6(){hMPF_KX? zlE<7rdf>x5*Ted0^O<>q{V1r{Ir%7S_uueG_fNAvJNwgN%d!4A^)me`)-N7UrjodF zI-37o6ggx1U!i~E#F;~89KO3-g;;OKQO3lJ^`+4!|F9ijJRWShAC>Fl6&~N03sf5B z!xvs%CpmM{jN{<=dUailufoi4oAEI7A(M{l*Szn|e!=t? z=t@{{f_;`@s}4i?lU3gA18UcV1k)f2?8!FQKeC?D}Y@=6=O zXEF8`6EcW>>6H^_e81w0>{J&y3J8bs9 ztbSzJj3=-@!1{ZPqt`t>6XSieVg3$c@{3>5Z)r*$IA+q%+-CAaIr{#9baB#vb$fs# z#0P!lk?iDe#8=)*gnVu_GN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;F{oh!Ha_Hf>#8u3EmLg2=e}j;Hco3;Dq1- z!9#*`f-8b+g69P<3a$%Y5xgdNLvSO=*G2?K1;+#@1P=%v5}XrU5nK~IFL+UKUGR$F zHNhK#8$rG@oZyP!n&5fCi-PNdSHaHv;C1VQH-oIVFC6;=G?!iW z1;+&^1rG|Q`a18U2dKU-Q+-{g`npW@b(!kx@`~U!!5e}bLGF$SjtY(mP6!?lJR~?L zxFWbFcwX?L;JV-y!E1sy1UG_weME3na7=JQ@PObU!8ySd!8O72f)@qX1+NHR6TBg~ z5#-lJ1V;tO1SbR!2p$rg6I>Bo6Fe_?QE*-Gir_WD8-g1_z9AwwDmW%MA(-a7v%hph zT5v&dRq&kP1;I;#mj$m1UKhL>Wcozl`g>!yU|(=ta8mG~;I!a^;Huy`!3%K5z^jtfo-9u%AwTo6qAwa$L!A=*~J_cJA*ty&(7{!Bk(zK1zPMO!am72-q3_ z(bIy@38wnG_Tz%7zOMe0f~mf){!4quqj!^0 zX8O-c1Y#w@%Ovs%&_V$%}i*?U8(F}b)LKDohw)h3;5pexqb zPtGJ#eaDP%MxJ2qXW7@%_ZjE=w1i$u=(R*Xam+jHPq6IzY@!>s<0Nn%VNa}0zGPuG)T9a?a zY3pgzBi<_@zD@ZaJ%8fp^tEVRY6`Vpc24;o z-A~$-f9-}zzhnR7H+yZ%&vE&-{`U6}PWkG~?aMzPX(}@n16>7CVt2I-vgU= z<*#tQNk}T+{*J^g{~rXfg4lhm&Knn@8YKvMZMSLtxd_mWdr q&*^rrYL$EWP=m?N8>@8u_5K=>A*%?=b8*A;w}-lpx3k`sAN?=IQg_b) literal 0 HcmV?d00001 diff --git a/internal/ebpf/clone_bpfel.go b/internal/ebpf/clone_bpfel.go new file mode 100644 index 000000000..36266195f --- /dev/null +++ b/internal/ebpf/clone_bpfel.go @@ -0,0 +1,171 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type cloneScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Filename [256]uint8 +} + +// loadClone returns the embedded CollectionSpec for clone. +func loadClone() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_CloneBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load clone: %w", err) + } + + return spec, err +} + +// loadCloneObjects loads clone and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *cloneObjects +// *clonePrograms +// *cloneMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadCloneObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadClone() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// cloneSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type cloneSpecs struct { + cloneProgramSpecs + cloneMapSpecs + cloneVariableSpecs +} + +// cloneProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type cloneProgramSpecs struct { + HandleSchedProcessFork *ebpf.ProgramSpec `ebpf:"handle_sched_process_fork"` + HandleSysEnterClone *ebpf.ProgramSpec `ebpf:"handle_sys_enter_clone"` + HandleSysEnterClone3 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_clone3"` + HandleSysEnterFork *ebpf.ProgramSpec `ebpf:"handle_sys_enter_fork"` + HandleSysEnterVfork *ebpf.ProgramSpec `ebpf:"handle_sys_enter_vfork"` + HandleSysExitClone *ebpf.ProgramSpec `ebpf:"handle_sys_exit_clone"` + HandleSysExitClone3 *ebpf.ProgramSpec `ebpf:"handle_sys_exit_clone3"` + HandleSysExitFork *ebpf.ProgramSpec `ebpf:"handle_sys_exit_fork"` + HandleSysExitVfork *ebpf.ProgramSpec `ebpf:"handle_sys_exit_vfork"` +} + +// cloneMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type cloneMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` +} + +// cloneVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type cloneVariableSpecs struct { +} + +// cloneObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type cloneObjects struct { + clonePrograms + cloneMaps + cloneVariables +} + +func (o *cloneObjects) Close() error { + return _CloneClose( + &o.clonePrograms, + &o.cloneMaps, + ) +} + +// cloneMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type cloneMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` +} + +func (m *cloneMaps) Close() error { + return _CloneClose( + m.DropCount, + m.Events, + m.Scratch, + ) +} + +// cloneVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type cloneVariables struct { +} + +// clonePrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type clonePrograms struct { + HandleSchedProcessFork *ebpf.Program `ebpf:"handle_sched_process_fork"` + HandleSysEnterClone *ebpf.Program `ebpf:"handle_sys_enter_clone"` + HandleSysEnterClone3 *ebpf.Program `ebpf:"handle_sys_enter_clone3"` + HandleSysEnterFork *ebpf.Program `ebpf:"handle_sys_enter_fork"` + HandleSysEnterVfork *ebpf.Program `ebpf:"handle_sys_enter_vfork"` + HandleSysExitClone *ebpf.Program `ebpf:"handle_sys_exit_clone"` + HandleSysExitClone3 *ebpf.Program `ebpf:"handle_sys_exit_clone3"` + HandleSysExitFork *ebpf.Program `ebpf:"handle_sys_exit_fork"` + HandleSysExitVfork *ebpf.Program `ebpf:"handle_sys_exit_vfork"` +} + +func (p *clonePrograms) Close() error { + return _CloneClose( + p.HandleSchedProcessFork, + p.HandleSysEnterClone, + p.HandleSysEnterClone3, + p.HandleSysEnterFork, + p.HandleSysEnterVfork, + p.HandleSysExitClone, + p.HandleSysExitClone3, + p.HandleSysExitFork, + p.HandleSysExitVfork, + ) +} + +func _CloneClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed clone_bpfel.o +var _CloneBytes []byte diff --git a/internal/ebpf/clone_bpfel.o b/internal/ebpf/clone_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..145a50e697c14faecd5b5dd1b9a377b028abd6b8 GIT binary patch literal 30048 zcmeI54{Te-OHB8b}xxs6uBUBUgVs}S&=g$ zFN&NNIVEyZGuYA)gRA_T;inAN%-{m6xAmE@N(p7_)Nq>eb6%5#C_T(oe2lZB-}b(nhD}c%z89 zELBu?t-ylOhu$<04}s1Cg%9u?x+@ zQIWP8)VCt_FN<6fxhQf$mu(Xqy)OaDDrK65s(%+ZrmZROZ5n{3N*JzvJW zW#D<-h9h%!E3q=4GiP19nX|6lOrx{s3FHZIWEyY7C+bOCVQxTsU5H-7JYz}L>*YHT z_w8|>(9+9Ad?0MQ*~!aac9QjQzOf#*%zAzk$LN>cyd2x*#*Ot*|5MlV6<5#B4J_^a z8JFI*?4aJ;krq2LyLPa+^@kjpZMRr7YxTq1>FXK&6S3ol7F*E!RiE#tx5u3y)?@o~ z4ST5f?Ra~t{gU(goa>MGUu&;_=Rii$F2mTaxRvR2VC4rJa3T>#8{Bwjb_JHh{)PUr zUj3ZEetvO2Fwovl;7h-?+vEHWz6h?MIch9|(7JRx%I)9cqePWkogT`xv~*Y_Tg-6Fe0 zCPg~GJ$AwQhp`JWNe@Ii|Ap(lFeVzp*aa)>y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h>B&m0HbVau4qrpzYnAu!#e5mr*7IndLt$PIl9dz}nd^2^9uv%MKz7BK_v!gH z+V}6%0@+7*wN=Y|#!pe}w!a|lCnY1>XH~lWFX7@@um67kdY;Nq@a28d=TW|1|6AYh za`=9-eQpW+@;;q^$Fg4ge!um4{m-n?eoWd=Iy3C}(@x#~?P$DS`+k4pdguRE6t36* zT%G=Ni%hrwb)?m6e_Woguh;)SL-~5`m+SPOTQs`;b8EEk@1L*N|MD8`&(!HZyQJHH zaEF5A0kq3{G%saj-+Jd{O2Q- zFYo97BQpP#n=?K9f)0Xgt2w|Y=Sn#20WeLM&q;Z41C=7aeV_36(!OUeXQX^ip8I^d z8V>Val&{zSt~&kaeWY*S_n&J*_la!=328qs_jMe9R;Ald sqVWyKuMR^sj-wJ*KJKE|8~?vWdAOieA%5H?`S;4~)Z%R#1U;qFB literal 0 HcmV?d00001 diff --git a/internal/ebpf/consumer.go b/internal/ebpf/consumer.go new file mode 100644 index 000000000..ca1d022cf --- /dev/null +++ b/internal/ebpf/consumer.go @@ -0,0 +1,189 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "expvar" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/ps" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" +) + +var ( + eventsProcessed = expvar.NewInt("ebpf.events.processed") + eventsExcluded = expvar.NewInt("ebpf.events.excluded") + eventsUnknown = expvar.NewInt("ebpf.events.unknown") + parseErrors = expvar.NewInt("ebpf.events.parse.errors") + pendingQueued = expvar.NewInt("ebpf.startup.pending.queued") + pendingDropped = expvar.NewInt("ebpf.startup.pending.dropped") + replayApplied = expvar.NewInt("ebpf.startup.replay.applied") + snapshotUpserts = expvar.NewInt("ebpf.startup.snapshot.upserts") + lateSnapshots = expvar.NewInt("ebpf.startup.snapshot.late") + enrichmentMiss = expvar.NewInt("ebpf.enrichment.miss") + ringbufDrops = expvar.NewInt("ebpf.ringbuf.drops") +) + +func applyProcessState(psnap ps.Snapshotter, evt *event.Event) { + if evt == nil || psnap == nil { + return + } + switch { + case evt.Type == event.Execve && succeeded(evt): + ps := buildPS(evt, psnap) + evt.PS = ps + _ = psnap.Write(evt) + case evt.Type == event.Clone && succeeded(evt) && evt.IsCreateProcess(): + ps := buildPS(evt, psnap) + evt.PS = ps + psnap.Put(ps) + case evt.Type == event.Clone && succeeded(evt) && evt.IsCreateThread(): + ok, existing := psnap.Find(evt.PID) + if ok && existing != nil { + evt.PS = existing + _ = psnap.AddThread(evt) + } + case evt.Type == event.Exit: + ok, existing := psnap.Find(evt.PID) + if ok { + evt.PS = existing + } + _ = psnap.Remove(evt) + default: + ok, existing := psnap.Find(evt.PID) + if ok { + evt.PS = existing + } + } + if evt.PS == nil { + ok, existing := psnap.Find(evt.PID) + if ok { + evt.PS = existing + } + } +} + +func upsertSnapshot(psnap ps.Snapshotter, rec *pstypes.PS) { + if psnap == nil || rec == nil { + return + } + ok, existing := psnap.Find(rec.PID) + if !ok || existing == nil { + psnap.Put(rec) + snapshotUpserts.Add(1) + return + } + if existing.StartBootTime != rec.StartBootTime { + psnap.Put(rec) + snapshotUpserts.Add(1) + return + } + mergePS(existing, rec) + snapshotUpserts.Add(1) +} + +func mergePS(dst, src *pstypes.PS) { + if src.Name != "" { + dst.Name = src.Name + } + if src.Exe != "" { + dst.Exe = src.Exe + } + if src.Cmdline != "" { + dst.Cmdline = src.Cmdline + } + if src.Ppid != 0 { + dst.Ppid = src.Ppid + } + if src.UID != 0 { + dst.UID = src.UID + } + if src.GID != 0 { + dst.GID = src.GID + } + if src.StartBootTime != 0 { + dst.StartBootTime = src.StartBootTime + } +} + +func buildPS(evt *event.Event, psnap ps.Snapshotter) *pstypes.PS { + ok, existing := psnap.Find(evt.PID) + exe := evt.GetParamAsString(params.Exe) + cmdline := evt.GetParamAsString(params.Cmdline) + name := evt.GetParamAsString(params.ProcessName) + if exe == "" && existing != nil { + exe = existing.Exe + } + if cmdline == "" && existing != nil { + cmdline = existing.Cmdline + } + if name == "" { + name = baseName(exe) + } + ps := &pstypes.PS{ + PID: evt.PID, + Ppid: evt.GetParamAsUint64(params.ProcessParentID), + Name: name, + Cmdline: cmdline, + Exe: exe, + Args: splitCmdline(cmdline), + StartBootTime: evt.GetParamAsUint64(params.StartBootTime), + UID: evt.GetParamAsUint32(params.UID), + GID: evt.GetParamAsUint32(params.GID), + Threads: make(map[uint64]pstypes.Thread), + } + if ok && existing != nil && existing.StartBootTime == ps.StartBootTime && existing.Threads != nil { + ps.Threads = existing.Threads + ps.Parent = existing.Parent + } + if ok, parent := psnap.Find(ps.Ppid); ok { + ps.Parent = parent + } + return ps +} + +func succeeded(evt *event.Event) bool { + ret, err := evt.Params.GetInt64(params.Retval) + if err != nil { + return true + } + return ret >= 0 +} + +func enrichEvent(evt *event.Event) { + if evt == nil { + return + } + exe, cmdline, err := enrichFromProc(evt.PID) + if err != nil { + enrichmentMiss.Add(1) + } + if exe != "" { + evt.Params.Append(params.Exe, params.Path, exe) + if evt.GetParamAsString(params.ProcessName) == "" { + evt.Params.Append(params.ProcessName, params.String, baseName(exe)) + } + } + if cmdline != "" { + evt.Params.Append(params.Cmdline, params.String, cmdline) + } +} diff --git a/internal/ebpf/consumer_test.go b/internal/ebpf/consumer_test.go new file mode 100644 index 000000000..3977c626f --- /dev/null +++ b/internal/ebpf/consumer_test.go @@ -0,0 +1,98 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/ps" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestApplyProcessStateExecveAndPIDReuse(t *testing.T) { + snap := ps.NewSnapshotter() + first := sampleExecve().toEvent(1) + applyProcessState(snap, first) + ok, got := snap.Find(4242) + require.True(t, ok) + assert.Equal(t, "/bin/bash", got.Exe) + assert.Equal(t, uint64(123456789), got.StartBootTime) + assert.Equal(t, got.UUID(), first.PS.UUID()) + + reuse := sampleExecve().toEvent(2) + reuse.Params.Append(params.StartBootTime, params.Uint64, uint64(999)) + reuse.Params.Append(params.Exe, params.Path, "/bin/sh") + reuse.Params.Append(params.ProcessName, params.String, "sh") + applyProcessState(snap, reuse) + ok, got = snap.Find(4242) + require.True(t, ok) + assert.Equal(t, "/bin/sh", got.Exe) + assert.Equal(t, uint64(999), got.StartBootTime) + assert.NotEqual(t, first.PS.UUID(), got.UUID()) +} + +func TestApplyProcessStateExitRemoves(t *testing.T) { + snap := ps.NewSnapshotter() + evt := sampleExecve().toEvent(1) + applyProcessState(snap, evt) + exit := &event.Event{ + Type: event.Exit, + PID: 4242, + Params: event.Params{}, + } + exit.Params.Append(params.Retval, params.Int64, int64(0)) + applyProcessState(snap, exit) + ok, _ := snap.Find(4242) + assert.False(t, ok) +} + +func TestUpsertSnapshotIgnoresAfterLiveReplacement(t *testing.T) { + snap := ps.NewSnapshotter() + rec := &pstypes.PS{PID: 7, Name: "snap", StartBootTime: 9, Exe: "/bin/snap"} + upsertSnapshot(snap, rec) + ok, got := snap.Find(7) + require.True(t, ok) + assert.Equal(t, "snap", got.Name) + + live := &event.Event{Type: event.Execve, PID: 7, Params: event.Params{}} + live.Params.Append(params.ProcessName, params.String, "live") + live.Params.Append(params.Exe, params.Path, "/bin/live") + live.Params.Append(params.StartBootTime, params.Uint64, uint64(9)) + live.Params.Append(params.Retval, params.Int64, int64(0)) + applyProcessState(snap, live) + + upsertSnapshot(snap, &pstypes.PS{PID: 7, Name: "stale", StartBootTime: 9, Exe: "/bin/stale"}) + ok, got = snap.Find(7) + require.True(t, ok) + assert.Equal(t, "stale", got.Name) +} + +func TestPendingBackpressure(t *testing.T) { + es := &EventSource{pendingCap: 2} + require.True(t, es.enqueuePending(&event.Event{PID: 1})) + require.True(t, es.enqueuePending(&event.Event{PID: 2})) + require.False(t, es.enqueuePending(&event.Event{PID: 3})) + assert.Len(t, es.pending, 2) +} diff --git a/internal/ebpf/doc.go b/internal/ebpf/doc.go index ca37ad037..8d281edf7 100644 --- a/internal/ebpf/doc.go +++ b/internal/ebpf/doc.go @@ -16,7 +16,8 @@ * limitations under the License. */ -// Package ebpf hosts the Linux eBPF instrumentation backend and supporting -// feasibility prototypes used to validate CO-RE load, feature probes, and -// race-safe process-state reconciliation. +// Package ebpf hosts the Linux eBPF instrumentation backend. The process +// event source loads CO-RE programs, captures execve/exit/clone, and +// reconciles live events against an iter/task baseline. The spike +// subdirectory remains as a feasibility prototype. package ebpf diff --git a/internal/ebpf/enrich.go b/internal/ebpf/enrich.go new file mode 100644 index 000000000..19bbe0741 --- /dev/null +++ b/internal/ebpf/enrich.go @@ -0,0 +1,52 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "fmt" + "os" + "strings" +) + +// enrichFromProc best-effort reads /proc//{exe,cmdline}. Failures leave +// fields empty and never replace the iterator baseline scan. +func enrichFromProc(pid uint64) (exe string, cmdline string, err error) { + exe, err = os.Readlink(fmt.Sprintf("/proc/%d/exe", pid)) + if err != nil { + exe = "" + } + + raw, cerr := os.ReadFile(fmt.Sprintf("/proc/%d/cmdline", pid)) + if cerr != nil { + if err == nil { + err = cerr + } + return exe, "", err + } + parts := strings.Split(string(raw), "\x00") + cleaned := make([]string, 0, len(parts)) + for _, p := range parts { + if p != "" { + cleaned = append(cleaned, p) + } + } + return exe, strings.Join(cleaned, " "), err +} diff --git a/internal/ebpf/events.go b/internal/ebpf/events.go new file mode 100644 index 000000000..c4c237857 --- /dev/null +++ b/internal/ebpf/events.go @@ -0,0 +1,142 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "bytes" + "encoding/binary" + "fmt" + "time" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/util/hostname" +) + +const ( + eventKindSnapshot = 0 + eventKindExecve = 1 + eventKindExit = 2 + eventKindClone = 3 + + commLen = 16 + filenameLen = 256 +) + +// rawEvent mirrors struct fibratus_event in c/common/events.h. +type rawEvent struct { + Kind uint32 + Type uint32 + PID uint32 + TID uint32 + TGID uint32 + PPID uint32 + UID uint32 + GID uint32 + SyscallID uint32 + Pad uint32 + Retval int64 + CloneFlags uint64 + StartBootTime uint64 + TimestampNs uint64 + Comm [commLen]byte + Filename [filenameLen]byte +} + +func decodeRawEvent(raw []byte) (rawEvent, error) { + var ev rawEvent + if err := binary.Read(bytes.NewReader(raw), binary.LittleEndian, &ev); err != nil { + return ev, fmt.Errorf("decoding eBPF event: %w", err) + } + return ev, nil +} + +func (r rawEvent) comm() string { return cString(r.Comm[:]) } +func (r rawEvent) filename() string { return cString(r.Filename[:]) } + +func (r rawEvent) eventType() event.Type { + switch r.Type { + case uint32(event.Execve): + return event.Execve + case uint32(event.Exit): + return event.Exit + case uint32(event.Clone): + return event.Clone + default: + return event.UnknownType + } +} + +func (r rawEvent) processID() uint64 { + if r.PID != 0 { + return uint64(r.PID) + } + return uint64(r.TGID) +} + +func (r rawEvent) toEvent(seq uint64) *event.Event { + typ := r.eventType() + info := event.TypeToEventInfo(typ) + evt := &event.Event{ + Seq: seq, + PID: r.processID(), + Tid: uint64(r.TID), + Type: typ, + Name: info.Name, + Category: info.Category, + Description: info.Description, + Host: hostname.Get(), + Timestamp: time.Unix(0, int64(r.TimestampNs)), + Params: event.Params{}, + Metadata: make(event.Metadata), + } + evt.Params.Append(params.ProcessID, params.PID, evt.PID) + evt.Params.Append(params.ThreadID, params.TID, evt.Tid) + evt.Params.Append(params.ProcessParentID, params.PID, uint64(r.PPID)) + evt.Params.Append(params.ProcessName, params.String, r.comm()) + evt.Params.Append(params.UID, params.Uint32, r.UID) + evt.Params.Append(params.GID, params.Uint32, r.GID) + evt.Params.Append(params.SyscallID, params.Uint32, r.SyscallID) + evt.Params.Append(params.Retval, params.Int64, r.Retval) + evt.Params.Append(params.StartBootTime, params.Uint64, r.StartBootTime) + + switch typ { + case event.Execve: + name := r.filename() + if name == "" { + name = r.comm() + } + evt.Params.Append(params.Exe, params.Path, name) + evt.Params.Append(params.Cmdline, params.String, name) + case event.Exit: + evt.Params.Append(params.ExitStatus, params.Int64, r.Retval) + case event.Clone: + evt.Params.Append(params.CloneFlags, params.Uint64, r.CloneFlags) + } + return evt +} + +func cString(b []byte) string { + if i := bytes.IndexByte(b, 0); i >= 0 { + b = b[:i] + } + return string(b) +} diff --git a/internal/ebpf/events_test.go b/internal/ebpf/events_test.go new file mode 100644 index 000000000..8c089337e --- /dev/null +++ b/internal/ebpf/events_test.go @@ -0,0 +1,150 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "bytes" + "encoding/binary" + "encoding/json" + "os" + "path/filepath" + "testing" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestDecodeRawEvent(t *testing.T) { + raw := sampleExecve() + buf := encodeRaw(t, raw) + got, err := decodeRawEvent(buf) + require.NoError(t, err) + assert.Equal(t, raw.Kind, got.Kind) + assert.Equal(t, raw.Type, got.Type) + assert.Equal(t, raw.PID, got.PID) + assert.Equal(t, raw.StartBootTime, got.StartBootTime) + assert.Equal(t, "bash", got.comm()) + assert.Equal(t, "/bin/bash", got.filename()) +} + +func TestRawEventToEventGolden(t *testing.T) { + evt := sampleExecve().toEvent(7) + got := goldenEvent(evt) + path := filepath.Join("testdata", "execve.json") + if os.Getenv("UPDATE_GOLDEN") == "1" { + require.NoError(t, os.MkdirAll(filepath.Dir(path), 0o755)) + require.NoError(t, os.WriteFile(path, prettyJSON(t, got), 0o644)) + } + want, err := os.ReadFile(path) + require.NoError(t, err) + assert.JSONEq(t, string(want), string(prettyJSON(t, got))) +} + +func TestCloneThreadSemantics(t *testing.T) { + raw := sampleClone(0x00010000) + evt := raw.toEvent(1) + assert.True(t, evt.IsCreateThread()) + assert.False(t, evt.IsCreateProcess()) + + raw = sampleClone(0) + evt = raw.toEvent(2) + assert.True(t, evt.IsCreateProcess()) + assert.False(t, evt.IsCreateThread()) +} + +func sampleExecve() rawEvent { + var ev rawEvent + ev.Kind = eventKindExecve + ev.Type = uint32(event.Execve) + ev.PID = 4242 + ev.TID = 4242 + ev.TGID = 4242 + ev.PPID = 1 + ev.UID = 1000 + ev.GID = 1000 + ev.SyscallID = 59 + ev.Retval = 0 + ev.StartBootTime = 123456789 + ev.TimestampNs = 111 + copy(ev.Comm[:], "bash") + copy(ev.Filename[:], "/bin/bash") + return ev +} + +func sampleClone(flags uint64) rawEvent { + var ev rawEvent + ev.Kind = eventKindClone + ev.Type = uint32(event.Clone) + ev.PID = 99 + ev.TID = 100 + ev.TGID = 99 + ev.PPID = 1 + ev.Retval = 99 + ev.CloneFlags = flags + ev.StartBootTime = 55 + copy(ev.Comm[:], "worker") + return ev +} + +func encodeRaw(t *testing.T, ev rawEvent) []byte { + t.Helper() + var buf bytes.Buffer + require.NoError(t, binary.Write(&buf, binary.LittleEndian, ev)) + return buf.Bytes() +} + +type golden struct { + Name string `json:"name"` + PID uint64 `json:"pid"` + Tid uint64 `json:"tid"` + Seq uint64 `json:"seq"` + Params map[string]string `json:"params"` +} + +func goldenEvent(evt *event.Event) golden { + g := golden{ + Name: evt.Name, + PID: evt.PID, + Tid: evt.Tid, + Seq: evt.Seq, + Params: map[string]string{}, + } + for name := range evt.Params { + g.Params[name] = evt.GetParamAsString(name) + } + return g +} + +func prettyJSON(t *testing.T, v any) []byte { + t.Helper() + buf, err := json.MarshalIndent(v, "", " ") + require.NoError(t, err) + return append(buf, '\n') +} + +func TestSucceededHelper(t *testing.T) { + evt := sampleExecve().toEvent(1) + assert.True(t, succeeded(evt)) + evt.Params.Append(params.Retval, params.Int64, int64(-2)) + assert.False(t, succeeded(evt)) +} diff --git a/internal/ebpf/execve_bpfeb.go b/internal/ebpf/execve_bpfeb.go new file mode 100644 index 000000000..cbad50c9e --- /dev/null +++ b/internal/ebpf/execve_bpfeb.go @@ -0,0 +1,156 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (mips || mips64 || ppc64 || s390x) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type execveScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Filename [256]uint8 +} + +// loadExecve returns the embedded CollectionSpec for execve. +func loadExecve() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_ExecveBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load execve: %w", err) + } + + return spec, err +} + +// loadExecveObjects loads execve and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *execveObjects +// *execvePrograms +// *execveMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadExecveObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadExecve() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// execveSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveSpecs struct { + execveProgramSpecs + execveMapSpecs + execveVariableSpecs +} + +// execveProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveProgramSpecs struct { + HandleSysEnterExecve *ebpf.ProgramSpec `ebpf:"handle_sys_enter_execve"` + HandleSysEnterExecveat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_execveat"` + HandleSysExitExecve *ebpf.ProgramSpec `ebpf:"handle_sys_exit_execve"` + HandleSysExitExecveat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_execveat"` +} + +// execveMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` +} + +// execveVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type execveVariableSpecs struct { +} + +// execveObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execveObjects struct { + execvePrograms + execveMaps + execveVariables +} + +func (o *execveObjects) Close() error { + return _ExecveClose( + &o.execvePrograms, + &o.execveMaps, + ) +} + +// execveMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execveMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` +} + +func (m *execveMaps) Close() error { + return _ExecveClose( + m.DropCount, + m.Events, + m.Scratch, + ) +} + +// execveVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execveVariables struct { +} + +// execvePrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type execvePrograms struct { + HandleSysEnterExecve *ebpf.Program `ebpf:"handle_sys_enter_execve"` + HandleSysEnterExecveat *ebpf.Program `ebpf:"handle_sys_enter_execveat"` + HandleSysExitExecve *ebpf.Program `ebpf:"handle_sys_exit_execve"` + HandleSysExitExecveat *ebpf.Program `ebpf:"handle_sys_exit_execveat"` +} + +func (p *execvePrograms) Close() error { + return _ExecveClose( + p.HandleSysEnterExecve, + p.HandleSysEnterExecveat, + p.HandleSysExitExecve, + p.HandleSysExitExecveat, + ) +} + +func _ExecveClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed execve_bpfeb.o +var _ExecveBytes []byte diff --git a/internal/ebpf/execve_bpfeb.o b/internal/ebpf/execve_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..4b62ac978b7947976e078a44d32c3664763f74f8 GIT binary patch literal 16352 zcmeI2e{5veRmbnM$M!ft?B*9Hw8=}8F5|7&J6gq(d1k4H8eg zn$mo|S2+v5>L*%wRmDlZNf)K=UR*iYr^HRIRci4|2YbYjyDWEDZnNBCxyf>a8jkp{9I)zh!k!NEKGH(eq}-FlK_Yn&^$P8;rVsocT- zt@F%DU2k^)^~2$2+7QoE$4yp#mZhD?g-@G#Jv5(7rr@D=UCMVdH_kcd`8!^jT}pk6@)rxv6iYL21t-mH=B?mpi%`zY zTfuQzZ|1Gw^fQ}zE0_)z3(Cw}LG2m6(({J=9p-J8TP!zOZm?WuxyEvp#ET>pbuuQW|u}rc|uyk1tu(No$V;AdqV9fTkd~hkDi~FKXwTyv|I5c+Ie}3%ts_$NClK zUFK!x9p)uwZ5Qe{nYUQqVBTb|GjA}LnYCT0pJ!fUeU^EZIm5idJjJ}sJi)xgoMvt^ zrGUu5Gn6u3N%o&p6d9r`Zdg`?M3E%&AoxO4BIp~}H$UYBwJ)WFv zzH~steR8hJ>R~uJ*A#f)DyS725uA^fS?YZNtnYuw2IuSh9jxzjNPT}pW?8TAXYdsB z1j{tb6w4&b1WT9Y0Ly-sah4?P{eE(;`Ek!jC+8YkJ}2jzlXFd)76RTAnj~>pxBGeUkdo2Y019k#x-IT*V+=(orS{Di%ZhdBiST4rv$Bw$V*# zS%=F~Wom=Q@#he2_CrW_A*K;e-;E1G52DtyZTdF~*)GaxHJ8!vu}72%w?oa3=m(Ed zeMmpSX|m~QHi&$55v@=3o;Jbd?nQc%)ASyAnd?wi8j*ao^~uLx%0nO@e+n^;7$E)( zVgs>&_#VU!#5w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 b/internal/ebpf/exit_bpfel.go @@ -0,0 +1,150 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type exitScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Filename [256]uint8 +} + +// loadExit returns the embedded CollectionSpec for exit. +func loadExit() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_ExitBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load exit: %w", err) + } + + return spec, err +} + +// loadExitObjects loads exit and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *exitObjects +// *exitPrograms +// *exitMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadExitObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadExit() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// exitSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type exitSpecs struct { + exitProgramSpecs + exitMapSpecs + exitVariableSpecs +} + +// exitProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type exitProgramSpecs struct { + HandleSysExitExit *ebpf.ProgramSpec `ebpf:"handle_sys_exit_exit"` + HandleSysExitExitGroup *ebpf.ProgramSpec `ebpf:"handle_sys_exit_exit_group"` +} + +// exitMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type exitMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` +} + +// exitVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type exitVariableSpecs struct { +} + +// exitObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadExitObjects or ebpf.CollectionSpec.LoadAndAssign. +type exitObjects struct { + exitPrograms + exitMaps + exitVariables +} + +func (o *exitObjects) Close() error { + return _ExitClose( + &o.exitPrograms, + &o.exitMaps, + ) +} + +// exitMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadExitObjects or ebpf.CollectionSpec.LoadAndAssign. +type exitMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` +} + +func (m *exitMaps) Close() error { + return _ExitClose( + m.DropCount, + m.Events, + m.Scratch, + ) +} + +// exitVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadExitObjects or ebpf.CollectionSpec.LoadAndAssign. +type exitVariables struct { +} + +// exitPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadExitObjects or ebpf.CollectionSpec.LoadAndAssign. +type exitPrograms struct { + HandleSysExitExit *ebpf.Program `ebpf:"handle_sys_exit_exit"` + HandleSysExitExitGroup *ebpf.Program `ebpf:"handle_sys_exit_exit_group"` +} + +func (p *exitPrograms) Close() error { + return _ExitClose( + p.HandleSysExitExit, + p.HandleSysExitExitGroup, + ) +} + +func _ExitClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed exit_bpfel.o +var _ExitBytes []byte diff --git a/internal/ebpf/exit_bpfel.o b/internal/ebpf/exit_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..f9b7dfc31e417f6665df399324e52e24a46c7122 GIT binary patch literal 11336 zcmeI2Z)}}a9mmh@x~|>ER^~PaqCOKGx3lYRVU9Xvxr`ONIH4KU42^kucl)%x>FvGO z`)6w@=uJc|32H;MnL?n5$`W}|5|Yh?u$u6qFGySrCQAgf7pRM1T=WI?)%6^43YsyeTdXkK#NH9o8;m)Mw9~6x3jKZ$@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zLJ2^ZP9=aY=Dq@s#2j#j}d%6rWRk zLGdNUwi8J6?RCGZFLA(5#`05&(~5f)_bVq}brhiubQo zaiBP*IIXx>alhh{;=1A~#WRX$70)R?r}%>6ON#y0UYvh9k30v8Q;O4ydlmO9E-9`n zo>DxcnD=u(U)*oJr^flbV%}Th`FzL3xtSeBprAkAV;MXr74se&&+k#pdu=>_STXOl z@%%}}Cl#Mkd`9uS;`53xDqc|B96R4^{}m?{cPZ{sd{ptU;xWaOiccy&rTC2EdBx`y zUsSxHxS5?s;IP>KD^4ozQrx5XsN!M8V~QsgpHzHG@fpSQiq9*)sCYqfv;6-zzW=w! zm`CLv#RnDlDIQQ^gYl) zSo+Gl@)sc*U-jd-|3$%l6k6$vl6*eDrWdi1UlUA6K7V|a-;&GtabodHQwKg=Rx`&; zM`e7}O6kPnhpEE{4s?cJG!Q8#I>RnUR&<7Y9a+&C?s2pSgZ(jt*Wg2r&}H5VcR1W4 z?^mCx(2yBr8G195UeuN=a$GGYeh1pM%KLkzFVO52k^Bv|1u-q`MGt?tLJ`1*Yk@0TopMUekVV2(eu$AX@}H<7ne|0kvYX(`L`r=73gk3Ze7RR0`*xJP(j z&I3p8T=zO9vsbErUh1Eb@~oeA>H2?zv{i>M7a{71i(y#Szh2k6t#6=&T)`I0Qkmrs R_XsDY07bn1Z8q1K{{aRnlZ^lX literal 0 HcmV?d00001 diff --git a/internal/ebpf/gen.go b/internal/ebpf/gen.go new file mode 100644 index 000000000..a0f07fc5c --- /dev/null +++ b/internal/ebpf/gen.go @@ -0,0 +1,26 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +// Regenerate with ./generate.sh (preferred) or go generate -tags linux. +// bpf2go version is pinned to github.com/cilium/ebpf v0.20.0. +// +//go:generate ./generate.sh diff --git a/internal/ebpf/generate.sh b/internal/ebpf/generate.sh new file mode 100755 index 000000000..e9ef3a51a --- /dev/null +++ b/internal/ebpf/generate.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# Regenerate bpf2go bindings for the Linux eBPF process source. +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "$ROOT" + +if ! command -v clang >/dev/null 2>&1; then + echo "clang is required to regenerate eBPF objects" >&2 + exit 1 +fi + +# The process source is x86_64-only. Always compile CO-RE objects for that +# architecture so generation is host-independent. +export BPF_TARGET_ARCH=x86 + +CLANG_VERSION="$(clang --version | head -n1)" +echo "clang: ${CLANG_VERSION}" +echo "target arch: ${BPF_TARGET_ARCH}" + +INCLUDES=(-I./c -I./c/common -I./spike/c -O2 -g "-D__TARGET_ARCH_${BPF_TARGET_ARCH}") + +generate() { + local name="$1" + local src="$2" + go run github.com/cilium/ebpf/cmd/bpf2go@v0.20.0 \ + -go-package ebpf -output-dir . -cc clang -target bpfel,bpfeb -tags linux \ + "${name}" "${src}" -- "${INCLUDES[@]}" +} + +generate execve ./c/execve.bpf.c +generate exit ./c/exit.bpf.c +generate clone ./c/clone.bpf.c +generate prociter ./c/proc_iter.bpf.c + +echo "generated eBPF bindings" diff --git a/internal/ebpf/loader.go b/internal/ebpf/loader.go new file mode 100644 index 000000000..1e2145ea1 --- /dev/null +++ b/internal/ebpf/loader.go @@ -0,0 +1,220 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "fmt" + "io" + "sync" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/link" + "github.com/cilium/ebpf/rlimit" + log "github.com/sirupsen/logrus" +) + +type loader struct { + exec *execveObjects + exit *exitObjects + clone *cloneObjects + iter *prociterObjects + links []link.Link + iterLink *link.Iter + once sync.Once +} + +func loadCollections() (*loader, error) { + if err := rlimit.RemoveMemlock(); err != nil { + return nil, fmt.Errorf("removing memlock: %w", err) + } + + execSpec, err := loadExecve() + if err != nil { + return nil, fmt.Errorf("loading execve collection spec: %w", err) + } + exitSpec, err := loadExit() + if err != nil { + return nil, fmt.Errorf("loading exit collection spec: %w", err) + } + cloneSpec, err := loadClone() + if err != nil { + return nil, fmt.Errorf("loading clone collection spec: %w", err) + } + iterSpec, err := loadProciter() + if err != nil { + return nil, fmt.Errorf("loading prociter collection spec: %w", err) + } + + var execObjs execveObjects + if err := execSpec.LoadAndAssign(&execObjs, nil); err != nil { + return nil, fmt.Errorf("loading execve objects: %w", err) + } + + replacements := map[string]*ebpf.Map{ + eventsMapName: execObjs.Events, + dropCountMapName: execObjs.DropCount, + scratchMapName: execObjs.Scratch, + } + opts := &ebpf.CollectionOptions{MapReplacements: replacements} + + var exitObjs exitObjects + if err := exitSpec.LoadAndAssign(&exitObjs, opts); err != nil { + _ = execObjs.Close() + return nil, fmt.Errorf("loading exit objects: %w", err) + } + + var cloneObjs cloneObjects + if err := cloneSpec.LoadAndAssign(&cloneObjs, opts); err != nil { + _ = exitObjs.Close() + _ = execObjs.Close() + return nil, fmt.Errorf("loading clone objects: %w", err) + } + + var iterObjs prociterObjects + if err := iterSpec.LoadAndAssign(&iterObjs, opts); err != nil { + _ = cloneObjs.Close() + _ = exitObjs.Close() + _ = execObjs.Close() + return nil, fmt.Errorf("loading prociter objects: %w", err) + } + + return &loader{ + exec: &execObjs, + exit: &exitObjs, + clone: &cloneObjs, + iter: &iterObjs, + }, nil +} + +func (l *loader) eventsMap() *ebpf.Map { return l.exec.Events } + +func (l *loader) dropCount() uint64 { + var key uint32 + var drop uint64 + if l.exec == nil || l.exec.DropCount == nil { + return 0 + } + _ = l.exec.DropCount.Lookup(&key, &drop) + return drop +} + +func (l *loader) attachHotPath() error { + type tp struct { + group string + name string + prog *ebpf.Program + } + tracepoints := []tp{ + {"syscalls", "sys_enter_execve", l.exec.HandleSysEnterExecve}, + {"syscalls", "sys_exit_execve", l.exec.HandleSysExitExecve}, + {"syscalls", "sys_enter_execveat", l.exec.HandleSysEnterExecveat}, + {"syscalls", "sys_exit_execveat", l.exec.HandleSysExitExecveat}, + {"syscalls", "sys_exit_exit_group", l.exit.HandleSysExitExitGroup}, + {"syscalls", "sys_exit_exit", l.exit.HandleSysExitExit}, + {"syscalls", "sys_enter_clone", l.clone.HandleSysEnterClone}, + {"syscalls", "sys_exit_clone", l.clone.HandleSysExitClone}, + {"syscalls", "sys_enter_clone3", l.clone.HandleSysEnterClone3}, + {"syscalls", "sys_exit_clone3", l.clone.HandleSysExitClone3}, + {"syscalls", "sys_enter_fork", l.clone.HandleSysEnterFork}, + {"syscalls", "sys_exit_fork", l.clone.HandleSysExitFork}, + {"syscalls", "sys_enter_vfork", l.clone.HandleSysEnterVfork}, + {"syscalls", "sys_exit_vfork", l.clone.HandleSysExitVfork}, + } + for _, t := range tracepoints { + if t.prog == nil { + return fmt.Errorf("missing program for %s/%s", t.group, t.name) + } + lnk, err := link.Tracepoint(t.group, t.name, t.prog, nil) + if err != nil { + return fmt.Errorf("attaching %s/%s: %w", t.group, t.name, err) + } + l.links = append(l.links, lnk) + } + + if l.clone.HandleSchedProcessFork == nil { + return fmt.Errorf("missing sched_process_fork program") + } + fork, err := link.AttachTracing(link.TracingOptions{Program: l.clone.HandleSchedProcessFork}) + if err != nil { + return fmt.Errorf("attaching sched_process_fork: %w", err) + } + l.links = append(l.links, fork) + return nil +} + +func (l *loader) runTaskIterator() error { + if l.iter == nil || l.iter.DumpTask == nil { + return fmt.Errorf("missing iter/task program") + } + it, err := link.AttachIter(link.IterOptions{Program: l.iter.DumpTask}) + if err != nil { + return fmt.Errorf("attaching iter/task: %w", err) + } + l.iterLink = it + file, err := it.Open() + if err != nil { + return fmt.Errorf("opening task iterator: %w", err) + } + _, _ = io.Copy(io.Discard, file) + return file.Close() +} + +func (l *loader) Close() error { + var err error + l.once.Do(func() { + for _, lnk := range l.links { + if lnk != nil { + if e := lnk.Close(); e != nil { + err = e + } + } + } + if l.iterLink != nil { + if e := l.iterLink.Close(); e != nil { + err = e + } + } + // Replacement collections share maps owned by execve. Close only their + // programs so the canonical maps are released once. + if l.iter != nil { + if e := l.iter.prociterPrograms.Close(); e != nil { + err = e + } + } + if l.exit != nil { + if e := l.exit.exitPrograms.Close(); e != nil { + err = e + } + } + if l.clone != nil { + if e := l.clone.clonePrograms.Close(); e != nil { + err = e + } + } + if l.exec != nil { + if e := l.exec.Close(); e != nil { + err = e + } + } + log.Debug("eBPF loader closed") + }) + return err +} diff --git a/internal/ebpf/maps.go b/internal/ebpf/maps.go new file mode 100644 index 000000000..353876c85 --- /dev/null +++ b/internal/ebpf/maps.go @@ -0,0 +1,27 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +const ( + eventsMapName = "events" + dropCountMapName = "drop_count" + scratchMapName = "scratch" +) diff --git a/internal/ebpf/proc_iter.go b/internal/ebpf/proc_iter.go new file mode 100644 index 000000000..75bba914c --- /dev/null +++ b/internal/ebpf/proc_iter.go @@ -0,0 +1,64 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "strings" + + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" +) + +func snapshotFromRaw(r rawEvent, exe, cmdline string) *pstypes.PS { + name := r.comm() + if name == "" && exe != "" { + name = baseName(exe) + } + if cmdline == "" { + cmdline = exe + } + args := splitCmdline(cmdline) + return &pstypes.PS{ + PID: uint64(r.TGID), + Ppid: uint64(r.PPID), + Name: name, + Cmdline: cmdline, + Exe: exe, + Args: args, + StartBootTime: r.StartBootTime, + UID: r.UID, + GID: r.GID, + Threads: make(map[uint64]pstypes.Thread), + } +} + +func baseName(path string) string { + if i := strings.LastIndex(path, "/"); i >= 0 && i+1 < len(path) { + return path[i+1:] + } + return path +} + +func splitCmdline(cmdline string) []string { + if cmdline == "" { + return nil + } + return strings.Fields(cmdline) +} diff --git a/internal/ebpf/prociter_bpfeb.go b/internal/ebpf/prociter_bpfeb.go new file mode 100644 index 000000000..4fe1862cf --- /dev/null +++ b/internal/ebpf/prociter_bpfeb.go @@ -0,0 +1,147 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (mips || mips64 || ppc64 || s390x) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type prociterScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Filename [256]uint8 +} + +// loadProciter returns the embedded CollectionSpec for prociter. +func loadProciter() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_ProciterBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load prociter: %w", err) + } + + return spec, err +} + +// loadProciterObjects loads prociter and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *prociterObjects +// *prociterPrograms +// *prociterMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadProciterObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadProciter() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// prociterSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterSpecs struct { + prociterProgramSpecs + prociterMapSpecs + prociterVariableSpecs +} + +// prociterProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterProgramSpecs struct { + DumpTask *ebpf.ProgramSpec `ebpf:"dump_task"` +} + +// prociterMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` +} + +// prociterVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type prociterVariableSpecs struct { +} + +// prociterObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterObjects struct { + prociterPrograms + prociterMaps + prociterVariables +} + +func (o *prociterObjects) Close() error { + return _ProciterClose( + &o.prociterPrograms, + &o.prociterMaps, + ) +} + +// prociterMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` +} + +func (m *prociterMaps) Close() error { + return _ProciterClose( + m.DropCount, + m.Events, + m.Scratch, + ) +} + +// prociterVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterVariables struct { +} + +// prociterPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type prociterPrograms struct { + DumpTask *ebpf.Program `ebpf:"dump_task"` +} + +func (p *prociterPrograms) Close() error { + return _ProciterClose( + p.DumpTask, + ) +} + +func _ProciterClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed prociter_bpfeb.o +var _ProciterBytes []byte diff --git a/internal/ebpf/prociter_bpfeb.o b/internal/ebpf/prociter_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..565df7f816d49aeb569219e3c32824350e3e3f97 GIT binary patch literal 6264 zcmb_gU2Igx6+U}y0&YTL6DV#=%cV`JP0e~ufHWQUSI63_pkdy z?U<^rAS(TpQz;TstH$b&M5R2qQY5Gp2}`Xi9uf&vQH4|<{Ft^;h5FD&DiZy^nKSF_ zA*e4IappVUnKNf*&dkmo{GFkZr-L9Rt&)=eKu;K2El{=$8kW_1qoiiPDI3VPROPG0 z-1k@mw@N$lYu}aA#48J|MY=mJy822;E%m~cjJ3RM;rz8Rt9*G(K0+=3+q-v&*LJZM zSs#kry?ghLA5Z(IwupR@epl>xslV!q)`>hr`&=P4syM8eRWxfvyO|NNNA00vx1x!R zcC&sU&4?@SE8bRoS8+x0rs567>x#>YR~45OFDou8UQ%38yr?*@IHOoqoKhT9d_i$k zaab{{IH;IW>`@FAyA?YXHz*QB^S^FxOtR$pDKUP)hm^1JpWP}peooA|x?h=VpQE?P zBRee4ZnEcWE+=N*=x67blVN&*o48v#B_Pjr+4Gmr$!2Xg^G3TlmpP4_9~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leqE0+whc70Zw8U9RUGMQ2x`QEXQi!-FPtggvd-ynvb9NUTIH(RLLLugwe1>A%- z09j>1N_HyNhWwZ*CC7GQ#jxX6wnB@xL6xg)wq*^w7xl!a;!~T2=2m$+#cH##!eGDH zrQE0N9$xgpR*arN4NhYu@S{T058e7Z!+Ww)o6KkJdLskhm5IY&8b5MuToTx270G2Y zexc&G&b2ww!nc^iOACeX2+9zCXi|`Opz}^#hVZUr8G!J9T!sYq;z!UK(4DjK1#-F#p71yBufqWq*C*ddmnEY2UnNhw9<7>~wWKKE2 zlm@E+$u$A7DHNaaH+?;PLY@xuLv7j*2}%*1rVYbOZ0y5Z?gqfOGus0J|2E z59RLxJKx6mmER>tXQRqL1a>Xhys~~bess26!+TEsWizcMXBx4QMb zW_as~txtMMnf5t`opMY)E#DgNB0cn$hRnE}C_z9MTEe|BAQvSkOP;EiC^A DR*2= e.pendingCap { + pendingDropped.Add(1) + return false + } + e.pending = append(e.pending, evt) + pendingQueued.Add(1) + return true +} + +func (e *EventSource) finishBaseline() { + e.pendingMu.Lock() + pending := e.pending + e.pending = nil + e.live.Store(true) + e.pendingMu.Unlock() + + for _, evt := range pending { + e.dispatch(evt) + replayApplied.Add(1) + } +} + +func (e *EventSource) dispatch(evt *event.Event) { + applyProcessState(e.psnap, evt) + eventsProcessed.Add(1) + + if e.config != nil { + if e.config.EventSource.ExcludeEvent(evt.Type.ID()) { + eventsExcluded.Add(1) + return + } + if e.config.EventSource.ExcludeImage(evt.PS) { + eventsExcluded.Add(1) + return + } + if evt.IsDropped(e.config.IsCaptureSet()) { + eventsExcluded.Add(1) + return + } + } + if e.filter != nil && !e.filter.Eval(evt) { + return + } + if err := e.q.Push(evt); err != nil { + select { + case e.errs <- err: + default: + } + } +} + +func (e *EventSource) startupSummary() string { + return fmt.Sprintf("pending_queued=%d pending_dropped=%d replay_applied=%d snapshot_upserts=%d", + pendingQueued.Value(), pendingDropped.Value(), replayApplied.Value(), snapshotUpserts.Value()) +} diff --git a/internal/ebpf/source_integration_test.go b/internal/ebpf/source_integration_test.go new file mode 100644 index 000000000..a33c43f56 --- /dev/null +++ b/internal/ebpf/source_integration_test.go @@ -0,0 +1,83 @@ +//go:build linux && ebpf_integration + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "os" + "testing" + "time" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/ps" + "github.com/stretchr/testify/require" +) + +func TestLiveProcessSource(t *testing.T) { + cfg := testConfig() + es := NewEventSource(ps.NewSnapshotter(), cfg, nil).(*EventSource) + if err := es.Open(cfg); err != nil { + t.Fatalf("opening process source: %v", err) + } + t.Cleanup(func() { _ = es.Close() }) + + cmd := execLookPath() + p, err := os.StartProcess(cmd, []string{cmd}, &os.ProcAttr{ + Files: []*os.File{nil, nil, nil}, + }) + require.NoError(t, err) + _, _ = p.Wait() + + deadline := time.Now().Add(5 * time.Second) + var sawExec, sawExit bool + for time.Now().Before(deadline) && (!sawExec || !sawExit) { + select { + case evt := <-es.Events(): + switch evt.Type { + case event.Execve: + if evt.PID == uint64(p.Pid) { + sawExec = true + } + case event.Exit: + if evt.PID == uint64(p.Pid) { + sawExit = true + } + } + case err := <-es.Errors(): + t.Fatalf("event source error: %v", err) + case <-time.After(50 * time.Millisecond): + } + } + if !sawExec { + t.Fatal("did not observe execve for spawned process") + } + if !sawExit { + t.Fatal("did not observe exit for spawned process") + } +} + +func execLookPath() string { + for _, p := range []string{"/bin/true", "/usr/bin/true"} { + if _, err := os.Stat(p); err == nil { + return p + } + } + return "/bin/sh" +} diff --git a/internal/ebpf/source_test.go b/internal/ebpf/source_test.go new file mode 100644 index 000000000..439640af6 --- /dev/null +++ b/internal/ebpf/source_test.go @@ -0,0 +1,118 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/ps" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func testConfig() *config.Config { + cfg := &config.Config{ForwardMode: true} + cfg.EventSource.Init() + return cfg +} + +func TestStartupReplayAndLateSnapshot(t *testing.T) { + cfg := testConfig() + es := NewEventSource(ps.NewSnapshotter(), cfg, nil).(*EventSource) + + hot := sampleExecve() + hot.PID = 42 + hot.TGID = 42 + hot.StartBootTime = 100 + hot.Comm = [16]byte{} + hot.Filename = [256]byte{} + copy(hot.Comm[:], "hot-a") + copy(hot.Filename[:], "/bin/hot-a") + es.handleRecord(encodeRaw(t, hot)) + require.Len(t, es.pending, 1) + ok, _ := es.psnap.Find(42) + assert.False(t, ok) + + snap := hot + snap.Kind = eventKindSnapshot + snap.Type = 0 + snap.Comm = [16]byte{} + copy(snap.Comm[:], "snap-a") + es.handleSnapshot(snap) + ok, got := es.psnap.Find(42) + require.True(t, ok) + assert.Equal(t, "snap-a", got.Name) + + es.finishBaseline() + assert.True(t, es.live.Load()) + assert.Nil(t, es.pending) + + select { + case evt := <-es.Events(): + assert.Equal(t, event.Execve, evt.Type) + assert.Equal(t, uint64(42), evt.PID) + require.NotNil(t, evt.PS) + assert.Equal(t, "hot-a", evt.PS.Name) + assert.Equal(t, uint64(100), evt.PS.StartBootTime) + default: + t.Fatal("expected replayed execve on the output queue") + } + + late := snap + late.Comm = [16]byte{} + copy(late.Comm[:], "stale") + es.handleSnapshot(late) + ok, got = es.psnap.Find(42) + require.True(t, ok) + assert.Equal(t, "hot-a", got.Name) +} + +func TestPIDReuseKeepsDistinctUUIDs(t *testing.T) { + cfg := testConfig() + es := NewEventSource(ps.NewSnapshotter(), cfg, nil).(*EventSource) + es.live.Store(true) + + first := sampleExecve() + first.PID = 8 + first.TGID = 8 + first.StartBootTime = 1 + first.Comm = [16]byte{} + copy(first.Comm[:], "one") + es.handleRecord(encodeRaw(t, first)) + + exit := rawEvent{Kind: eventKindExit, Type: uint32(event.Exit), PID: 8, TGID: 8, StartBootTime: 1} + es.handleRecord(encodeRaw(t, exit)) + + second := first + second.StartBootTime = 2 + second.Comm = [16]byte{} + second.Filename = [256]byte{} + copy(second.Comm[:], "two") + copy(second.Filename[:], "/bin/two") + es.handleRecord(encodeRaw(t, second)) + + ok, got := es.psnap.Find(8) + require.True(t, ok) + assert.Equal(t, "two", got.Name) + assert.Equal(t, uint64(2), got.StartBootTime) +} diff --git a/internal/ebpf/testdata/execve.json b/internal/ebpf/testdata/execve.json new file mode 100644 index 000000000..f676d77b6 --- /dev/null +++ b/internal/ebpf/testdata/execve.json @@ -0,0 +1,19 @@ +{ + "name": "execve", + "pid": 4242, + "tid": 4242, + "seq": 7, + "params": { + "cmdline": "/bin/bash", + "exe": "/bin/bash", + "gid": "1000", + "name": "bash", + "pid": "4242", + "ppid": "1", + "retval": "0", + "start_boot_time": "123456789", + "syscall_id": "59", + "tid": "4242", + "uid": "1000" + } +} diff --git a/pkg/api/server_linux.go b/pkg/api/server_linux.go new file mode 100644 index 000000000..72dcd0db1 --- /dev/null +++ b/pkg/api/server_linux.go @@ -0,0 +1,62 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package api + +import ( + "fmt" + "net" + "os" + "strings" + + "github.com/rabbitstack/fibratus/pkg/config" +) + +var listener net.Listener + +// StartServer starts the HTTP server with the specified configuration. +func StartServer(c *config.Config) error { + var err error + transport := c.API.Transport + if strings.HasPrefix(transport, "unix://") { + path := strings.TrimPrefix(transport, "unix://") + _ = os.Remove(path) + listener, err = net.Listen("unix", path) + if err != nil { + return fmt.Errorf("fail to listen on the %q socket: %w", path, err) + } + } else { + listener, err = net.Listen("tcp", transport) + if err != nil { + return fmt.Errorf("fail to listen on %q: %w", transport, err) + } + } + + setupServer(listener, c) + return nil +} + +// CloseServer shutdowns the server by stopping the listener. +func CloseServer() error { + if listener != nil { + return listener.Close() + } + return nil +} diff --git a/pkg/event/event_linux.go b/pkg/event/event_linux.go index 52d873418..a2113821e 100644 --- a/pkg/event/event_linux.go +++ b/pkg/event/event_linux.go @@ -20,7 +20,11 @@ package event -import "github.com/rabbitstack/fibratus/pkg/event/params" +import ( + "os" + + "github.com/rabbitstack/fibratus/pkg/event/params" +) const cloneThread = uint64(0x00010000) @@ -41,3 +45,19 @@ func (e *Event) IsTerminateProcess() bool { return e.Type == Exit } func (e *Event) PartialKey() uint64 { return uint64(e.Type)<<32 | uint64(e.PID) } + +// DropCurrentProc determines if events generated by the Fibratus process are dropped. +var DropCurrentProc = true + +var currentPid = uint64(os.Getpid()) + +// IsDropped reports whether the event should be omitted from the output queue. +func (e *Event) IsDropped(_ bool) bool { + return DropCurrentProc && e.PID == currentPid +} + +// IsStackWalk reports whether the event is a stack walk record. +func (e *Event) IsStackWalk() bool { return false } + +// IsState reports whether the event is used only for state management. +func (e *Event) IsState() bool { return false } diff --git a/pkg/event/params/names_linux.go b/pkg/event/params/names_linux.go index 4d5acd049..edf79f1f0 100644 --- a/pkg/event/params/names_linux.go +++ b/pkg/event/params/names_linux.go @@ -27,4 +27,10 @@ const ( UID = "uid" // GID is the effective Linux group identifier. GID = "gid" + // SyscallID is the raw architecture-specific syscall number. + SyscallID = "syscall_id" + // Retval is the syscall return value. + Retval = "retval" + // StartBootTime is the process start time measured from system boot, in nanoseconds. + StartBootTime = "start_boot_time" ) diff --git a/pkg/event/sequencer_linux.go b/pkg/event/sequencer_linux.go new file mode 100644 index 000000000..33ea66a38 --- /dev/null +++ b/pkg/event/sequencer_linux.go @@ -0,0 +1,55 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import "sync/atomic" + +// Sequencer increments the event sequence number. +type Sequencer struct { + seq uint64 +} + +// NewSequencer creates an in-memory event sequencer. +func NewSequencer() *Sequencer { + return &Sequencer{} +} + +// Increment increments the sequence number atomically. +func (s *Sequencer) Increment() { + atomic.AddUint64(&s.seq, 1) +} + +// Get returns the current sequence number. +func (s *Sequencer) Get() uint64 { + return atomic.LoadUint64(&s.seq) +} + +// Reset sets the sequence number to zero. +func (s *Sequencer) Reset() error { + atomic.StoreUint64(&s.seq, 0) + return nil +} + +// Close is a no-op on Linux. +func (s *Sequencer) Close() error { return nil } + +// Shutdown closes the sequencer. +func (s *Sequencer) Shutdown() error { return s.Close() } diff --git a/pkg/util/signals/signals.go b/pkg/util/signals/signals.go index d7670af07..d4d69a7f4 100644 --- a/pkg/util/signals/signals.go +++ b/pkg/util/signals/signals.go @@ -1,3 +1,5 @@ +//go:build windows + /* * Copyright 2021-2022 by Nedim Sabic Sabic * https://www.fibratus.io diff --git a/pkg/util/signals/signals_linux.go b/pkg/util/signals/signals_linux.go new file mode 100644 index 000000000..f202280ba --- /dev/null +++ b/pkg/util/signals/signals_linux.go @@ -0,0 +1,47 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package signals + +import ( + "os" + "os/signal" + "syscall" + + log "github.com/sirupsen/logrus" +) + +// Install setups the signal handler. Returns a blocking +// channel which receives an input after Interrupt or Term +// signals are triggered. +func Install() chan struct{} { + sigCh := make(chan os.Signal, 1) + signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM) + + stopCh := make(chan struct{}) + + go func() { + sig := <-sigCh + log.Infof("got signal %q, shutting down...", sig) + stopCh <- struct{}{} + }() + + return stopCh +} From 546fd09f7bc23c35679801050cd4a1e12be6ef86 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 14 Sep 2026 13:25:49 +0200 Subject: [PATCH 30/65] fix(ebpf): Skip optional fork and vfork attach failures Some kernels refuse a perf link on the legacy fork/vfork syscall tracepoints while clone and clone3 still attach. Treat those links as optional so the process source can open. --- internal/ebpf/loader.go | 56 +++++++++++++++++++++++++----------- internal/ebpf/loader_test.go | 41 ++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 17 deletions(-) create mode 100644 internal/ebpf/loader_test.go diff --git a/internal/ebpf/loader.go b/internal/ebpf/loader.go index 1e2145ea1..eebb59583 100644 --- a/internal/ebpf/loader.go +++ b/internal/ebpf/loader.go @@ -21,14 +21,18 @@ package ebpf import ( + "errors" "fmt" "io" + "os" + "strings" "sync" "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" "github.com/cilium/ebpf/rlimit" log "github.com/sirupsen/logrus" + "golang.org/x/sys/unix" ) type loader struct { @@ -118,25 +122,28 @@ func (l *loader) dropCount() uint64 { func (l *loader) attachHotPath() error { type tp struct { - group string - name string - prog *ebpf.Program + group string + name string + prog *ebpf.Program + optional bool } tracepoints := []tp{ - {"syscalls", "sys_enter_execve", l.exec.HandleSysEnterExecve}, - {"syscalls", "sys_exit_execve", l.exec.HandleSysExitExecve}, - {"syscalls", "sys_enter_execveat", l.exec.HandleSysEnterExecveat}, - {"syscalls", "sys_exit_execveat", l.exec.HandleSysExitExecveat}, - {"syscalls", "sys_exit_exit_group", l.exit.HandleSysExitExitGroup}, - {"syscalls", "sys_exit_exit", l.exit.HandleSysExitExit}, - {"syscalls", "sys_enter_clone", l.clone.HandleSysEnterClone}, - {"syscalls", "sys_exit_clone", l.clone.HandleSysExitClone}, - {"syscalls", "sys_enter_clone3", l.clone.HandleSysEnterClone3}, - {"syscalls", "sys_exit_clone3", l.clone.HandleSysExitClone3}, - {"syscalls", "sys_enter_fork", l.clone.HandleSysEnterFork}, - {"syscalls", "sys_exit_fork", l.clone.HandleSysExitFork}, - {"syscalls", "sys_enter_vfork", l.clone.HandleSysEnterVfork}, - {"syscalls", "sys_exit_vfork", l.clone.HandleSysExitVfork}, + {"syscalls", "sys_enter_execve", l.exec.HandleSysEnterExecve, false}, + {"syscalls", "sys_exit_execve", l.exec.HandleSysExitExecve, false}, + {"syscalls", "sys_enter_execveat", l.exec.HandleSysEnterExecveat, false}, + {"syscalls", "sys_exit_execveat", l.exec.HandleSysExitExecveat, false}, + {"syscalls", "sys_exit_exit_group", l.exit.HandleSysExitExitGroup, false}, + {"syscalls", "sys_exit_exit", l.exit.HandleSysExitExit, false}, + {"syscalls", "sys_enter_clone", l.clone.HandleSysEnterClone, false}, + {"syscalls", "sys_exit_clone", l.clone.HandleSysExitClone, false}, + {"syscalls", "sys_enter_clone3", l.clone.HandleSysEnterClone3, false}, + {"syscalls", "sys_exit_clone3", l.clone.HandleSysExitClone3, false}, + // fork/vfork are legacy wrappers. libc uses clone/clone3, and some + // kernels refuse a perf link on these syscall tracepoints. + {"syscalls", "sys_enter_fork", l.clone.HandleSysEnterFork, true}, + {"syscalls", "sys_exit_fork", l.clone.HandleSysExitFork, true}, + {"syscalls", "sys_enter_vfork", l.clone.HandleSysEnterVfork, true}, + {"syscalls", "sys_exit_vfork", l.clone.HandleSysExitVfork, true}, } for _, t := range tracepoints { if t.prog == nil { @@ -144,6 +151,10 @@ func (l *loader) attachHotPath() error { } lnk, err := link.Tracepoint(t.group, t.name, t.prog, nil) if err != nil { + if t.optional && isAttachUnavailable(err) { + log.Warnf("skipping optional %s/%s: %v", t.group, t.name, err) + continue + } return fmt.Errorf("attaching %s/%s: %w", t.group, t.name, err) } l.links = append(l.links, lnk) @@ -160,6 +171,17 @@ func (l *loader) attachHotPath() error { return nil } +func isAttachUnavailable(err error) bool { + if err == nil { + return false + } + if errors.Is(err, unix.EPERM) || errors.Is(err, unix.ENOENT) || errors.Is(err, os.ErrPermission) || errors.Is(err, os.ErrNotExist) { + return true + } + msg := strings.ToLower(err.Error()) + return strings.Contains(msg, "permission denied") || strings.Contains(msg, "no such file") +} + func (l *loader) runTaskIterator() error { if l.iter == nil || l.iter.DumpTask == nil { return fmt.Errorf("missing iter/task program") diff --git a/internal/ebpf/loader_test.go b/internal/ebpf/loader_test.go new file mode 100644 index 000000000..24f52cfe9 --- /dev/null +++ b/internal/ebpf/loader_test.go @@ -0,0 +1,41 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "errors" + "fmt" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "golang.org/x/sys/unix" +) + +func TestIsAttachUnavailable(t *testing.T) { + assert.False(t, isAttachUnavailable(nil)) + assert.False(t, isAttachUnavailable(errors.New("verifier rejected"))) + assert.True(t, isAttachUnavailable(unix.EPERM)) + assert.True(t, isAttachUnavailable(unix.ENOENT)) + assert.True(t, isAttachUnavailable(os.ErrPermission)) + assert.True(t, isAttachUnavailable(fmt.Errorf("attaching syscalls/sys_enter_fork: cannot create bpf perf link: %w", unix.EPERM))) + assert.True(t, isAttachUnavailable(errors.New("cannot create bpf perf link: permission denied"))) +} From df8c38927d6fad9db3cbd312153db6ecfb340720 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 14 Sep 2026 13:48:35 +0200 Subject: [PATCH 31/65] fix(ebpf): Emit process exits from sched_process_exit The exit and exit_group syscalls never return, so their raw syscall exit tracepoints never fire, and processes terminated by signals never enter exit_group at all. Attach a tp_btf program to sched_process_exit instead, emitting the raw wait status from the task exit code when the thread-group leader terminates. Also read effective instead of real credentials in every program so the uid/gid parameters match their documented semantics. --- internal/ebpf/c/clone.bpf.c | 8 ++--- internal/ebpf/c/execve.bpf.c | 4 +-- internal/ebpf/c/exit.bpf.c | 57 +++++++++++++++-------------- internal/ebpf/c/proc_iter.bpf.c | 4 +-- internal/ebpf/clone_bpfeb.o | Bin 30048 -> 30072 bytes internal/ebpf/clone_bpfel.o | Bin 30048 -> 30072 bytes internal/ebpf/execve_bpfeb.o | Bin 16352 -> 16376 bytes internal/ebpf/execve_bpfel.o | Bin 16352 -> 16376 bytes internal/ebpf/exit_bpfeb.go | 9 ++--- internal/ebpf/exit_bpfeb.o | Bin 11336 -> 6648 bytes internal/ebpf/exit_bpfel.go | 9 ++--- internal/ebpf/exit_bpfel.o | Bin 11336 -> 6648 bytes internal/ebpf/loader.go | 62 +++++++++++++++++++------------- internal/ebpf/prociter_bpfeb.o | Bin 6264 -> 6288 bytes internal/ebpf/prociter_bpfel.o | Bin 6264 -> 6288 bytes internal/ebpf/spike/c/vmlinux.h | 1 + 16 files changed, 80 insertions(+), 74 deletions(-) diff --git a/internal/ebpf/c/clone.bpf.c b/internal/ebpf/c/clone.bpf.c index d2e5bdfde..cc2deacea 100644 --- a/internal/ebpf/c/clone.bpf.c +++ b/internal/ebpf/c/clone.bpf.c @@ -49,8 +49,8 @@ static __always_inline int handle_clone_exit(long ret, u32 syscall_id) e->ppid = BPF_CORE_READ(parent, tgid); cred = BPF_CORE_READ(task, real_cred); if (cred) { - e->uid = BPF_CORE_READ(cred, uid.val); - e->gid = BPF_CORE_READ(cred, gid.val); + e->uid = BPF_CORE_READ(cred, euid.val); + e->gid = BPF_CORE_READ(cred, egid.val); } val = bpf_map_lookup_elem(&scratch, &key); @@ -149,8 +149,8 @@ int BPF_PROG(handle_sched_process_fork, struct task_struct *parent, struct task_ cred = child->real_cred; if (cred) { - e->uid = cred->uid.val; - e->gid = cred->gid.val; + e->uid = cred->euid.val; + e->gid = cred->egid.val; } key = ((u64)parent->tgid << 32) | (u32)parent->pid; diff --git a/internal/ebpf/c/execve.bpf.c b/internal/ebpf/c/execve.bpf.c index 55ec98d4c..04ee29ba2 100644 --- a/internal/ebpf/c/execve.bpf.c +++ b/internal/ebpf/c/execve.bpf.c @@ -44,8 +44,8 @@ static __always_inline int handle_exec_exit(long ret, u32 syscall_id) e->ppid = BPF_CORE_READ(parent, tgid); cred = BPF_CORE_READ(task, real_cred); if (cred) { - e->uid = BPF_CORE_READ(cred, uid.val); - e->gid = BPF_CORE_READ(cred, gid.val); + e->uid = BPF_CORE_READ(cred, euid.val); + e->gid = BPF_CORE_READ(cred, egid.val); } val = bpf_map_lookup_elem(&scratch, &key); diff --git a/internal/ebpf/c/exit.bpf.c b/internal/ebpf/c/exit.bpf.c index 00e32465c..2228444bd 100644 --- a/internal/ebpf/c/exit.bpf.c +++ b/internal/ebpf/c/exit.bpf.c @@ -6,17 +6,25 @@ char LICENSE[] SEC("license") = "Dual MIT/GPL"; -static __always_inline int handle_exit(long ret, u32 syscall_id) +/* Process exits are captured from sched_process_exit rather than the + * syscalls/sys_exit_{exit,exit_group} tracepoints: those syscalls never + * return, so their exit tracepoints never fire. The scheduler hook also + * covers processes terminated by signals, which never enter exit_group. + */ +SEC("tp_btf/sched_process_exit") +int BPF_PROG(handle_sched_process_exit, struct task_struct *task) { struct fibratus_event *e; - struct task_struct *task; struct task_struct *parent; const struct cred *cred; - u64 id; - id = bpf_get_current_pid_tgid(); - /* Only emit process exits from the thread-group leader. */ - if ((u32)id != (id >> 32)) + if (!task) + return 0; + + /* Only emit process exits from the thread-group leader; thread + * exits are not process exits. + */ + if (task->pid != task->tgid) return 0; e = reserve_event(); @@ -25,33 +33,24 @@ static __always_inline int handle_exit(long ret, u32 syscall_id) e->kind = EVT_KIND_EXIT; e->type = EVT_TYPE_EXIT; - e->syscall_id = syscall_id; - e->retval = ret; - fill_current_ids(e); - - task = (struct task_struct *)bpf_get_current_task(); - e->start_boottime = BPF_CORE_READ(task, start_boottime); - parent = BPF_CORE_READ(task, real_parent); + /* Raw wait status: (code << 8) | termination signal. */ + e->retval = task->exit_code; + e->pid = task->tgid; + e->tid = task->pid; + e->tgid = task->tgid; + e->start_boottime = task->start_boottime; + __builtin_memcpy(&e->comm, task->comm, sizeof(e->comm)); + + parent = task->real_parent; if (parent) - e->ppid = BPF_CORE_READ(parent, tgid); - cred = BPF_CORE_READ(task, real_cred); + e->ppid = parent->tgid; + + cred = task->real_cred; if (cred) { - e->uid = BPF_CORE_READ(cred, uid.val); - e->gid = BPF_CORE_READ(cred, gid.val); + e->uid = cred->euid.val; + e->gid = cred->egid.val; } bpf_ringbuf_submit(e, 0); return 0; } - -SEC("tp/syscalls/sys_exit_exit_group") -int handle_sys_exit_exit_group(struct trace_event_raw_sys_exit *ctx) -{ - return handle_exit(ctx->ret, (u32)ctx->id); -} - -SEC("tp/syscalls/sys_exit_exit") -int handle_sys_exit_exit(struct trace_event_raw_sys_exit *ctx) -{ - return handle_exit(ctx->ret, (u32)ctx->id); -} diff --git a/internal/ebpf/c/proc_iter.bpf.c b/internal/ebpf/c/proc_iter.bpf.c index 31c7b8be4..eb41eadaa 100644 --- a/internal/ebpf/c/proc_iter.bpf.c +++ b/internal/ebpf/c/proc_iter.bpf.c @@ -51,8 +51,8 @@ int dump_task(struct bpf_iter__task *ctx) cred = task->real_cred; if (cred) { - e->uid = cred->uid.val; - e->gid = cred->gid.val; + e->uid = cred->euid.val; + e->gid = cred->egid.val; } bpf_ringbuf_submit(e, 0); diff --git a/internal/ebpf/clone_bpfeb.o b/internal/ebpf/clone_bpfeb.o index bd257bec4254700d3b62bd78dd04128ab236de7a..e03647d4529c7b5e2a10c51f75e09c3ad1479f8b 100644 GIT binary patch delta 4343 zcmeH~e`u9e7{{M;-h1EOyIt+h<&RkIzD}nz@AT@_U7c<(Ci4~s>jz{Ic%8fHO6Rg! zmePBxK_fzk$H>5N1=$FZ#Tzy#+J%f38QdUpM9_l%2=$K%L4zRsKJPtuyxq{G{?r5S zInU=j&-wM7=iGDd#3eCxNerwI$qy6H1w=x%&)OoQYBKPuu#{D`MZGzzULCEnL_`f& zO}bO&sT&%(!&Q$4Z`8}b8eo{K?qk)j$=L})I@Cc)EUi+twhW4{~0FtjOkVPWh63CSi3 z9!AMyXCe1%IS2U-$Sa8iir^_^jgW1~??aviISct5K0ZGp;J!x#fg~OSKmR(())<$dR{!C{>OGdr2 z>TN+P)|lE+Qo{%)VrwaoPm_31yKt6O~u`xDDLqjx~NQo%2K^ zbBGMq?!{IX8D5;`JE2Et$V(_sllTZBV_-{IZ$kdG0-P%0c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6DpfbiGwL+TE9xT3U)6N^MiEx&@^yJ1qf<^#BV+8G5fxouxoY$w zXC|z9h6|(z*b`RY`nS9)y|GDbRSnTPv01$nJt(%QpQDFFOg&$*cIDB7ots{7?|yVU z#cHc+V-yVTuc$wu_ExO2Mk{uBM2)&pb?#wpwOy+Zc82T1`+E0xR@AHWo6oBq)y?hj zvh58Xdk0alz{U08r(B!>kGOaz_(vB%NtESvaTB=Kx?X)%mVQk%zLLmb?IA2N!|c6(96HnsF|^fya!21w80t?r%(U2hmgzJhOmPHk;%- zMKp~8u>JPDd_NG)$Hb;MtyIjoAA7eI&{ErdM2GB61 z4fYUS=LrpK#tLq(0*|^Fd+5RJ^401c}|~ixRr^Dv4wT zxFy3Xub9kpmwDWt{kB&e~04 zmalkRQ8rs7Ib`9xVV+*!16h`uYML;wk}NAElC9c`8MmTLYQ8}-f*VG*xfrKQb~%ju zOh#GX<6_ny)4Y;o41tU6cQI~NIpFZl>`f%MtU<$|Heg->9@D&+WE`hf&S?IKWTFV1 z(tJg=w3L|NW5&6N9*}vl2o~haxbzIY*zB8F0S7r@{S-5%VMH9xkt91=A9FG5oWwGLQX+eB1HTW5{bQS^KFDjoOrd|;Nu?$B%ZC!du=3R7IG`}(++zgn*Vgz4sn+p z$g%s|IOe|{XapVomw^@;$6RbhcF_Gl4z$QPCZc()2){Bi2I<-Y8DGH31>EIu)*VPB zesSkLKj3g?&!zT2_DgIH`$-g)okaH+@b;{X5v diff --git a/internal/ebpf/clone_bpfel.o b/internal/ebpf/clone_bpfel.o index 145a50e697c14faecd5b5dd1b9a377b028abd6b8..b0d4f7accca9d31e7e7bedd61e56010b9fd70553 100644 GIT binary patch delta 4163 zcmeH~e{54#6vxkf>q@&7Y&)P^=Grpo*kpr_32PbK3c*ngB%mf@B4LwNHXSf=7{;$R zz(h=lHaVD#1Ol3zBK`f{zbw~ z-@WH^&bja2ch9}=osL}<<5xwxQp8SI?Qn=Fuk^}Tz& zJSSK`BW%(%;V|1azsqdbR}^R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pi#etlfeTqZlv{a$l0jTpmJbd0UlMn6RcHfG_Cl3 zaAruOS;gaWTXUZN4YX-^<}{T&n7P6;8f7WI4toaX;I(iv*soYawwKYNQNY5<;3~xr z!XE6=C}d$5SS3R`vBN4TS}hK1z-<~2aj1U$i@W|iuc2w^aj>Z@m0<(1~s~=IKEvtvp9maMzTed z=*!T5id2wG8hn{==}N(~Wkry^QTS<@cPgF(SAZ`o_9KyD{!=k0xGXL>&;sM=|8^kG zl>f^>3yh;LI3rHE|HpwA7zgp^1yqdUA;7CMFC=(L<}ts>9HKk8o(uNeJUhRr zY>&r$Nb%Enqqs~kcR+|Mrj^4j6)R`L9>_}E1B&B&pi242ABbN$b5F^JmbD*5S{%V% zUQiTl9x6obx3C}lj)i^TGsdyU?yeGcdF+J?Vp4`*)WxivL7OGRJv#o*&!Fv;;k~*z zAZO5y$?!fMo-=5jGQ9t5ShIU8MY9a|*5hB}F|-46rng>;J}2FMb@<;G?koHY#AIs~ diff --git a/internal/ebpf/execve_bpfeb.o b/internal/ebpf/execve_bpfeb.o index 4b62ac978b7947976e078a44d32c3664763f74f8..237dca6b17f25f9558e4e1ae2dbe6c893759d050 100644 GIT binary patch delta 1809 zcmeH|O-NKx6vxk`rmnX$|PvfrbQR;J^$Z5=YG9& z=bASQW+uYgW}~;9EXuRxNmj`X*F|RVv^UAu%D3|sufaUI%8I-r7u2u(De90?<|ZOh z^#i#f-NgQ3FuX5 zA9Nb}8*~e_1zTDuLd0MDw>aERUhvnOpPWSaqe|>>1-4a$LVrfHAJu?fgBAS==&!J% zzn@5D7%0|ZC7#U1)e<;aX`SDN}Yv$KN!)goZ17}l% z{7fjo>%u){d)lL<>#1F_G5$VO%`;(lAT>5TxcmIc(+wRIZEr65PnG;Em75Ry9aWdG zq&Tc7o!FQ+w_N+&QHx#N^yA|e;2pvDk*pxfX1=r~Y#t<<-bAD%WN(SPC65!$;DRVa zk|&9>m`O=*VDuMf6@D?_wB&n4cX6qdXB&9IX4CzaXih93x2bL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n;i&zvp?*&Uw#s z_AaSyX^C+5tTb{S&$l zdY(Ua1{9;2e{+^;pRk${p8^Edp&Kv?`wShz=tJ9-{wVYh>FaHmc!wbq6p{VF! zHndg!nEQ!IjSu!*Jl)mX9p_F@j5Y96o@N%{w>>>Mb)G+v+oW=D8Z;?`X-ICgnSh@+#u750fu9Vnt z9?rW&Tc}VkwwPuzNaoACz1k6E<&9zQ(wpW(k_QksPY|7zJOZ{&p=?<^lEHb1k4c_E zzIu=7Sr#v*Sfe*$fmv)*ChWoSTOSe?pmt*0X?ACDF5Z!9y--3U$>PAs@ZmO)*RMcFU1vRh17?a#4`KsiE|H7%wQLIErWN6JhOhdrrOE|`B38{ zmf)c#jg9g-^hq9S*4PH0Ykta3@GC71`1_h`iLeR&9ep1UMMOUoi71vT{vcBJ3uxF8 AX#fBK delta 1691 zcmeH|O-NKx6vxkfGov%=j34F9NH#M~F^yS{AEndiIAcUcn{?+U7^5I5G3bK`>bVId z2$bWZ+SEc&u)umPB!Uzog$lG>xG0&(0vA$5p|q&}cf1o1A%a#dI(Xjs|L!^W%UvnqegRViGfG2fCMExa+iU zHr6~LJ)MJb@mGYzd*}v4X-m+15d-jL)t-d@tlCr1E6^C%ivIK+I*KSw%gqG43&9R; zu8Cz*M1^ZLJnShGCwbE27fbxsv$Z(j$P~B|2}@{&7@=+7Z`lRAR zvi}58$2v}#I1l;L8PoIgi&+r+ux5yg|p`{s$pOk4sU zSGDbD#dDh5NjIUxqQIFS$?+@5(3Bof-EN`9FL F{RG&H0{Q>| diff --git a/internal/ebpf/exit_bpfeb.go b/internal/ebpf/exit_bpfeb.go index 6570fe4bf..41ac2799d 100644 --- a/internal/ebpf/exit_bpfeb.go +++ b/internal/ebpf/exit_bpfeb.go @@ -62,8 +62,7 @@ type exitSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type exitProgramSpecs struct { - HandleSysExitExit *ebpf.ProgramSpec `ebpf:"handle_sys_exit_exit"` - HandleSysExitExitGroup *ebpf.ProgramSpec `ebpf:"handle_sys_exit_exit_group"` + HandleSchedProcessExit *ebpf.ProgramSpec `ebpf:"handle_sched_process_exit"` } // exitMapSpecs contains maps before they are loaded into the kernel. @@ -124,14 +123,12 @@ type exitVariables struct { // // It can be passed to loadExitObjects or ebpf.CollectionSpec.LoadAndAssign. type exitPrograms struct { - HandleSysExitExit *ebpf.Program `ebpf:"handle_sys_exit_exit"` - HandleSysExitExitGroup *ebpf.Program `ebpf:"handle_sys_exit_exit_group"` + HandleSchedProcessExit *ebpf.Program `ebpf:"handle_sched_process_exit"` } func (p *exitPrograms) Close() error { return _ExitClose( - p.HandleSysExitExit, - p.HandleSysExitExitGroup, + p.HandleSchedProcessExit, ) } diff --git a/internal/ebpf/exit_bpfeb.o b/internal/ebpf/exit_bpfeb.o index 8dd9327fa924f5a9bac20cc1fb7756c6c46b569b..c3d4e7f6955c97a79ff32f2370fc4a8b5a320ca0 100644 GIT binary patch literal 6648 zcmb_gUyPJj6+iQbmQ|2lS_<`FKeXa5!Y~WcZlU0mvarOpj(|!P{dRWdV|TK%GvoZh zT_ACyG$BUG+NdFEQ#UClq%YFg2qqf#!9*T-z(gbQPeObVV;}HA+e9M%e)pa``|TC# zOK^Fu-_a&1F>9&Nt1v#eZS|B`f*`S<0S4v{`Yetqeb%`hy z)=Jv&k6Zm$*2_4hOC5{X^;+(pmjX(OBbTyP^MYmHx-w>k&yUG_C>1ZvM^QD?MFBv1Xx$%Nx0igU_`l$#O3uU~PXe4TO=8TRFh z$q-lGR(@OgE#)_r-%x&C`Bmi$$}cOwsQiNRdFAJn&nZ8nyrX%Z*enB<6ceUg;Xk|zsRz&ump6E=^#>kNY~roy6*J~S zpWV;M`>@&ra@g%YUvJ|T$HmkI{$_me{~-OYJi;gTVPKf6&*@7R$`6$9Z5JxRXAT_R zvOhnns&|$B{YT~nFk=)+pI7<|lj!24ASU!RNrMNpQK^k?obv}j%bXwN0OVpkK-ur3 zzU<5xtnZ^Br~WWxyq1y!ZG0adXb*ynUB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#jA?f6klp(v%MqpAMaB6zT&jvjN)O% zql(Ll8;a)@FDhOJNA?@vRa^Li;){ycTRG98nD>9A{zOXgfZ`#=BZ?;#&nTW#yrB4u z;$_9>6<<(%QSo{!Cp#2(D^4jMP&}k~MDe8J8O3vo7ZjgSysY@V;tPr|Dqe5pwhqPJ zic^XQ6b~sLQ9P-5M)92D1;u9+FDpK;_=4h#iq~7Yy+iSx;K+HbV> zIPU(UU_T07>5GzlKEG-$Vk3V|puR%k#58|PuHcUo%`Z)T_;6Xv9;d$Q?6i^6iROo? zBL@%m2cIH{v=#lqfF&dPgMF5a=nwW<;u(Bz0?&oI54wtX7Olqr`(H~i7Ys>Z-7&9$ zXvjn%qPu$*Cw&F+8s*KsGE%(do_Y!y_?}@xMx=;sL!$VQ{O2s!Pu?FKx)28tH)%g{ ziH&d#T(YwHbmcjLXJWJVC#8fB$?d!QvMbN+zl`YGcm5%XL+7Fq_AV=`5ze0BF+|6@ zyz_h5l-hW>_Bmx0(Usq@Fd9C~m~g|2C{9G@kN56o{hyNp8A$HGvvcip|M6{Vv-Y>H zAP=GaEi0SPX#4zI!_}Kx_M(eZi} WHs-<^Eot@JW&FJbFqhHocmD@szlUA` diff --git a/internal/ebpf/exit_bpfel.go b/internal/ebpf/exit_bpfel.go index 673523e58..0ddb7d384 100644 --- a/internal/ebpf/exit_bpfel.go +++ b/internal/ebpf/exit_bpfel.go @@ -62,8 +62,7 @@ type exitSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type exitProgramSpecs struct { - HandleSysExitExit *ebpf.ProgramSpec `ebpf:"handle_sys_exit_exit"` - HandleSysExitExitGroup *ebpf.ProgramSpec `ebpf:"handle_sys_exit_exit_group"` + HandleSchedProcessExit *ebpf.ProgramSpec `ebpf:"handle_sched_process_exit"` } // exitMapSpecs contains maps before they are loaded into the kernel. @@ -124,14 +123,12 @@ type exitVariables struct { // // It can be passed to loadExitObjects or ebpf.CollectionSpec.LoadAndAssign. type exitPrograms struct { - HandleSysExitExit *ebpf.Program `ebpf:"handle_sys_exit_exit"` - HandleSysExitExitGroup *ebpf.Program `ebpf:"handle_sys_exit_exit_group"` + HandleSchedProcessExit *ebpf.Program `ebpf:"handle_sched_process_exit"` } func (p *exitPrograms) Close() error { return _ExitClose( - p.HandleSysExitExit, - p.HandleSysExitExitGroup, + p.HandleSchedProcessExit, ) } diff --git a/internal/ebpf/exit_bpfel.o b/internal/ebpf/exit_bpfel.o index f9b7dfc31e417f6665df399324e52e24a46c7122..664710f4c78c17568e7309afd0844bde5915a75a 100644 GIT binary patch literal 6648 zcmb_hUu;xq75`=^rR^4IyKNT~^`a|Iv7HVeyDaSDEKB(l>pDW!uA;ZoncH^K`Nzy1 zY_}v%6iGvLQ;iZ5H*4c!LiR<78^J_FA57$d2TU{)|0Kj0G42CC=x!nrf4}cLcjoq6 z*cUzNx##@OIp4qYoqO+hr(YWxJrs>ZR6r5+wrZlls?@dqrk>PlQmsei{1e9Bx6ac_ z`ecid6=VN$&!kqawi&$1>ilX{sd3n@t}*^^LVN>!z185)wRUJFbMF2FD%XEx?Ca3( z{(}b(?EcuEL-eWRI`Aq0@gKW1RBKgAD+^~+G^>TPM?@w??h%;~858My|0Z;8Aiaz*4dk(WhY61gn$g2*M2iz4eH=R}r8&WM~4IW96K z@`%W!$UPzxB4Z*Qk()$ziEI<8g<}5Kf)`qo+Q4jKt29wANFAk5ns(FhJFx#+bF{**S%pOp3X9}#T& z>x-CKr@Ku(XZm}^?`YWV74qv`0{=L=qu3AK#xJP<5$3}&m`n|FmqRj{4sbC`U<2_bX%Zd=z*r* zG1SzfPeFgfv2ge5o z`iH?J2mA*!wvOLLBZ&Pn-yl8;P#8sDx$g7Fjy?a9d;I7ZN8GWOQX{Ub{Q0t{3h6o5 zEBck3S5@9AXjN6)wG;8Y){52KbkWN??4tJ6CuqjCVa}I|(+)3c)|*$S()pUFvXxTV z&6H|rQO#7+erCosj&x-@p>WxurgC|&m@as#wue3LX?B>INmqhqD&x=|pN-5)2tFAY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r=73gk3Ze7RR0`*xJP(j z&I3p8T=zO9vsbErUh1Eb@~oeA>H2?zv{i>M7a{71i(y#Szh2k6t#6=&T)`I0Qkmrs R_XsDY07bn1Z8q1K{{aRnlZ^lX diff --git a/internal/ebpf/loader.go b/internal/ebpf/loader.go index eebb59583..98054c573 100644 --- a/internal/ebpf/loader.go +++ b/internal/ebpf/loader.go @@ -120,54 +120,66 @@ func (l *loader) dropCount() uint64 { return drop } +// syscallsGroup is the tracefs group hosting raw syscall tracepoints. +const syscallsGroup = "syscalls" + func (l *loader) attachHotPath() error { type tp struct { - group string name string prog *ebpf.Program optional bool } tracepoints := []tp{ - {"syscalls", "sys_enter_execve", l.exec.HandleSysEnterExecve, false}, - {"syscalls", "sys_exit_execve", l.exec.HandleSysExitExecve, false}, - {"syscalls", "sys_enter_execveat", l.exec.HandleSysEnterExecveat, false}, - {"syscalls", "sys_exit_execveat", l.exec.HandleSysExitExecveat, false}, - {"syscalls", "sys_exit_exit_group", l.exit.HandleSysExitExitGroup, false}, - {"syscalls", "sys_exit_exit", l.exit.HandleSysExitExit, false}, - {"syscalls", "sys_enter_clone", l.clone.HandleSysEnterClone, false}, - {"syscalls", "sys_exit_clone", l.clone.HandleSysExitClone, false}, - {"syscalls", "sys_enter_clone3", l.clone.HandleSysEnterClone3, false}, - {"syscalls", "sys_exit_clone3", l.clone.HandleSysExitClone3, false}, + {"sys_enter_execve", l.exec.HandleSysEnterExecve, false}, + {"sys_exit_execve", l.exec.HandleSysExitExecve, false}, + {"sys_enter_execveat", l.exec.HandleSysEnterExecveat, false}, + {"sys_exit_execveat", l.exec.HandleSysExitExecveat, false}, + {"sys_enter_clone", l.clone.HandleSysEnterClone, false}, + {"sys_exit_clone", l.clone.HandleSysExitClone, false}, + {"sys_enter_clone3", l.clone.HandleSysEnterClone3, false}, + {"sys_exit_clone3", l.clone.HandleSysExitClone3, false}, // fork/vfork are legacy wrappers. libc uses clone/clone3, and some // kernels refuse a perf link on these syscall tracepoints. - {"syscalls", "sys_enter_fork", l.clone.HandleSysEnterFork, true}, - {"syscalls", "sys_exit_fork", l.clone.HandleSysExitFork, true}, - {"syscalls", "sys_enter_vfork", l.clone.HandleSysEnterVfork, true}, - {"syscalls", "sys_exit_vfork", l.clone.HandleSysExitVfork, true}, + {"sys_enter_fork", l.clone.HandleSysEnterFork, true}, + {"sys_exit_fork", l.clone.HandleSysExitFork, true}, + {"sys_enter_vfork", l.clone.HandleSysEnterVfork, true}, + {"sys_exit_vfork", l.clone.HandleSysExitVfork, true}, } for _, t := range tracepoints { if t.prog == nil { - return fmt.Errorf("missing program for %s/%s", t.group, t.name) + return fmt.Errorf("missing program for %s/%s", syscallsGroup, t.name) } - lnk, err := link.Tracepoint(t.group, t.name, t.prog, nil) + lnk, err := link.Tracepoint(syscallsGroup, t.name, t.prog, nil) if err != nil { if t.optional && isAttachUnavailable(err) { - log.Warnf("skipping optional %s/%s: %v", t.group, t.name, err) + log.Warnf("skipping optional %s/%s: %v", syscallsGroup, t.name, err) continue } - return fmt.Errorf("attaching %s/%s: %w", t.group, t.name, err) + return fmt.Errorf("attaching %s/%s: %w", syscallsGroup, t.name, err) } l.links = append(l.links, lnk) } - if l.clone.HandleSchedProcessFork == nil { - return fmt.Errorf("missing sched_process_fork program") + // Successful clones and process exits are captured from scheduler + // tracepoints. Clone syscall exit tracepoints fire in the parent, and + // exit/exit_group never return, so their exit tracepoints never fire. + tracing := []struct { + name string + prog *ebpf.Program + }{ + {"sched_process_fork", l.clone.HandleSchedProcessFork}, + {"sched_process_exit", l.exit.HandleSchedProcessExit}, } - fork, err := link.AttachTracing(link.TracingOptions{Program: l.clone.HandleSchedProcessFork}) - if err != nil { - return fmt.Errorf("attaching sched_process_fork: %w", err) + for _, t := range tracing { + if t.prog == nil { + return fmt.Errorf("missing %s program", t.name) + } + lnk, err := link.AttachTracing(link.TracingOptions{Program: t.prog}) + if err != nil { + return fmt.Errorf("attaching %s: %w", t.name, err) + } + l.links = append(l.links, lnk) } - l.links = append(l.links, fork) return nil } diff --git a/internal/ebpf/prociter_bpfeb.o b/internal/ebpf/prociter_bpfeb.o index 565df7f816d49aeb569219e3c32824350e3e3f97..5340adcd9cb7c4b1b8e19f3d2785acedbb95adf1 100644 GIT binary patch delta 1304 zcmZ9LUr5tY6vxlKzhAoP%&l5mSoE`??2p^j!eObS0xhD99x{m9aw82Phzcv?XJO@A z!X;P_kz@~pjEYI^DfbYypumTq1wGVDL=Pnd;X@C7&u>>5UO4A`Klj{!=XdXKJ~G}k z9u_^%BS)n_LTFbL6y^BR%bubtEjRj{9%QvDj+>b+cFZ!!73WO7W@lZ#{DX$m^* zBaiYJlkTrXCfnm|&IlN`8%Zo9wjoLwnh3+OwxD-t9fR(G-UJ(gKA?3T`WW<9L36;X(Q@dzC1YCjm<^>dO1jqhZet)ft{Ur^cT~g`7I#(L z6{xvi>7>|+M0V7*Tewq00~b#9olB;&Gw#nqw5og6ArV!D>UPnhDm-0cr#j?0+1lI| zA-6l#*l}?nX|-E@=TphXjuaqtDKWT{~>`d?>!eU)VW~&tD5| zX`Uh)t$@bY60cyhBqo^SC6v5n|_9j>Yhz1WBIwme8;m?vcP zfa4@a`ElelUm-CKmbf;aARmy(twIczF&=@mFb4(5H$=~{fo#zHiD(LsQ1W$i{yVl} zjyi0U{7W>!6JkyW8CZCFEx5akc|%ml3m9EE8y{#)^G%{W-h>?2{E+B13X*BfPl*bC z@I)C`gEP!F7W_aoi%%|}=>a(5M_wRTVlzZk41n`x%m*%LK1}q5^Rs2l`J(2tL_hez zbDDABIeyGum{PTteFK6UDyJ>5pA47~g996=o}27}W8Ui^$)P38Uxf45bv|9<#r3#i z&cD<79AX&1u-TwHxFU3z`_&P{$|k)lMHA2A9|J!ZH**@!#exYT4~JqGxtPuPejDP6 oO8aL-zv^B6R!k}@&??4MZ=h4`Q)&2uD#B+}FxV;LsyAr;2Rrn>f&c&j delta 1231 zcmZ9LO-NKx6vxlK?~yajr1PqAW?}iH53Nk!nC4`D3=!leGFrGZCzT8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x>@&x0KhTIA`q2&9>Zz}|WuFZ4fhOLtcEj%3)o$jV{2fn+$ba>& z32{_D^VNxF`OTLQ4YJICN;Jwre{WN)Ek<7N(Bby0$-!tMI&gVt(DLi9^^Y8*SX=ym z{(>Vf|M>Ii2@DgMz^u4w6LuFI%-HXQ`4PBa(tc<2@ZT}d2AB+1RuZ@IaP25tW649P&~?vlOZTKn1U892nsv65F7>bz^|dk z98tC6&rt7EJb>bLW?a@{ahm7{9AgGwk17b@-!Gdd>T+-qcvx`)c@5LuR6Gtgmx!{8 zr@;kpiKZ1l0T(Y5%{bTx&N1VDdV_-C3elV@Smy?-L<@=!;$tXT!)Nbc1H7#GBK_VvwnhK| diff --git a/internal/ebpf/spike/c/vmlinux.h b/internal/ebpf/spike/c/vmlinux.h index dc774a68b..da94af6b5 100644 --- a/internal/ebpf/spike/c/vmlinux.h +++ b/internal/ebpf/spike/c/vmlinux.h @@ -124,6 +124,7 @@ struct cgroup_namespace { struct task_struct { int pid; int tgid; + int exit_code; struct task_struct *real_parent; struct task_struct *group_leader; const struct cred *real_cred; From d845c7c4e63dce683599e9af827141db4dc0a614 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 14 Sep 2026 13:48:35 +0200 Subject: [PATCH 32/65] fix(ebpf): Preserve ring buffer order during startup replay Drain the pending queue in rounds and only flip to live dispatch once the queue is empty, so replayed and live events cannot interleave out of ring buffer order. Size the output channel to the pending capacity so a full replay cannot block before the aggregator starts consuming. Assign the sequence number at dispatch and increment it only for events that pass exclusion and filtering, mirroring the Windows consumer. --- internal/ebpf/consumer_test.go | 6 +++--- internal/ebpf/events.go | 6 ++++-- internal/ebpf/events_test.go | 9 +++++---- internal/ebpf/source.go | 37 +++++++++++++++++++++++----------- 4 files changed, 37 insertions(+), 21 deletions(-) diff --git a/internal/ebpf/consumer_test.go b/internal/ebpf/consumer_test.go index 3977c626f..edc6d1646 100644 --- a/internal/ebpf/consumer_test.go +++ b/internal/ebpf/consumer_test.go @@ -33,7 +33,7 @@ import ( func TestApplyProcessStateExecveAndPIDReuse(t *testing.T) { snap := ps.NewSnapshotter() - first := sampleExecve().toEvent(1) + first := sampleExecve().toEvent() applyProcessState(snap, first) ok, got := snap.Find(4242) require.True(t, ok) @@ -41,7 +41,7 @@ func TestApplyProcessStateExecveAndPIDReuse(t *testing.T) { assert.Equal(t, uint64(123456789), got.StartBootTime) assert.Equal(t, got.UUID(), first.PS.UUID()) - reuse := sampleExecve().toEvent(2) + reuse := sampleExecve().toEvent() reuse.Params.Append(params.StartBootTime, params.Uint64, uint64(999)) reuse.Params.Append(params.Exe, params.Path, "/bin/sh") reuse.Params.Append(params.ProcessName, params.String, "sh") @@ -55,7 +55,7 @@ func TestApplyProcessStateExecveAndPIDReuse(t *testing.T) { func TestApplyProcessStateExitRemoves(t *testing.T) { snap := ps.NewSnapshotter() - evt := sampleExecve().toEvent(1) + evt := sampleExecve().toEvent() applyProcessState(snap, evt) exit := &event.Event{ Type: event.Exit, diff --git a/internal/ebpf/events.go b/internal/ebpf/events.go index c4c237857..acebb3960 100644 --- a/internal/ebpf/events.go +++ b/internal/ebpf/events.go @@ -92,11 +92,13 @@ func (r rawEvent) processID() uint64 { return uint64(r.TGID) } -func (r rawEvent) toEvent(seq uint64) *event.Event { +// toEvent converts the raw eBPF record into an event. The sequence number is +// assigned at dispatch time, mirroring the Windows consumer which increments +// the sequencer only for events that pass exclusion and filtering. +func (r rawEvent) toEvent() *event.Event { typ := r.eventType() info := event.TypeToEventInfo(typ) evt := &event.Event{ - Seq: seq, PID: r.processID(), Tid: uint64(r.TID), Type: typ, diff --git a/internal/ebpf/events_test.go b/internal/ebpf/events_test.go index 8c089337e..982f4ceeb 100644 --- a/internal/ebpf/events_test.go +++ b/internal/ebpf/events_test.go @@ -48,7 +48,8 @@ func TestDecodeRawEvent(t *testing.T) { } func TestRawEventToEventGolden(t *testing.T) { - evt := sampleExecve().toEvent(7) + evt := sampleExecve().toEvent() + evt.Seq = 7 got := goldenEvent(evt) path := filepath.Join("testdata", "execve.json") if os.Getenv("UPDATE_GOLDEN") == "1" { @@ -62,12 +63,12 @@ func TestRawEventToEventGolden(t *testing.T) { func TestCloneThreadSemantics(t *testing.T) { raw := sampleClone(0x00010000) - evt := raw.toEvent(1) + evt := raw.toEvent() assert.True(t, evt.IsCreateThread()) assert.False(t, evt.IsCreateProcess()) raw = sampleClone(0) - evt = raw.toEvent(2) + evt = raw.toEvent() assert.True(t, evt.IsCreateProcess()) assert.False(t, evt.IsCreateThread()) } @@ -143,7 +144,7 @@ func prettyJSON(t *testing.T, v any) []byte { } func TestSucceededHelper(t *testing.T) { - evt := sampleExecve().toEvent(1) + evt := sampleExecve().toEvent() assert.True(t, succeeded(evt)) evt.Params.Append(params.Retval, params.Int64, int64(-2)) assert.False(t, succeeded(evt)) diff --git a/internal/ebpf/source.go b/internal/ebpf/source.go index fb70ca48a..58b7759ca 100644 --- a/internal/ebpf/source.go +++ b/internal/ebpf/source.go @@ -68,7 +68,9 @@ type EventSource struct { // NewEventSource constructs the Linux eBPF event source. func NewEventSource(psnap ps.Snapshotter, cfg *config.Config, _ *config.RulesCompileResult) source.EventSource { - evts := make(chan *event.Event, 500) + // Startup replay pushes queued events before the aggregator starts + // consuming, so the channel must be able to absorb a full pending queue. + evts := make(chan *event.Event, defaultPendingCap) return &EventSource{ psnap: psnap, config: cfg, @@ -210,8 +212,7 @@ func (e *EventSource) handleRecord(raw []byte) { return } - e.sequencer.Increment() - evt := rec.toEvent(e.sequencer.Get()) + evt := rec.toEvent() if rec.Kind == eventKindExecve || rec.Kind == eventKindClone { enrichEvent(evt) } @@ -249,20 +250,31 @@ func (e *EventSource) enqueuePending(evt *event.Event) bool { return true } +// finishBaseline replays queued hot events in ring-buffer order and then +// switches to live dispatch. New records keep landing in the pending queue +// while a replay round runs, so loop until the queue drains before flipping +// live. This guarantees replayed and live events preserve global ring-buffer +// order. func (e *EventSource) finishBaseline() { - e.pendingMu.Lock() - pending := e.pending - e.pending = nil - e.live.Store(true) - e.pendingMu.Unlock() - - for _, evt := range pending { - e.dispatch(evt) - replayApplied.Add(1) + for { + e.pendingMu.Lock() + pending := e.pending + e.pending = nil + if len(pending) == 0 { + e.live.Store(true) + e.pendingMu.Unlock() + return + } + e.pendingMu.Unlock() + for _, evt := range pending { + e.dispatch(evt) + replayApplied.Add(1) + } } } func (e *EventSource) dispatch(evt *event.Event) { + evt.Seq = e.sequencer.Get() applyProcessState(e.psnap, evt) eventsProcessed.Add(1) @@ -283,6 +295,7 @@ func (e *EventSource) dispatch(evt *event.Event) { if e.filter != nil && !e.filter.Eval(evt) { return } + e.sequencer.Increment() if err := e.q.Push(evt); err != nil { select { case e.errs <- err: From c52ed31bb109c9d6156a1bf1a34c4cd3bf469ab0 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 14 Sep 2026 13:48:36 +0200 Subject: [PATCH 33/65] test(event): Cover the Linux sequencer --- pkg/event/sequencer_linux_test.go | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pkg/event/sequencer_linux_test.go diff --git a/pkg/event/sequencer_linux_test.go b/pkg/event/sequencer_linux_test.go new file mode 100644 index 000000000..1fec3500e --- /dev/null +++ b/pkg/event/sequencer_linux_test.go @@ -0,0 +1,43 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestSequencer(t *testing.T) { + sequencer := NewSequencer() + defer sequencer.Close() + + assert.Equal(t, uint64(0), sequencer.Get()) + for i := 0; i < 10; i++ { + sequencer.Increment() + } + assert.Equal(t, uint64(10), sequencer.Get()) + + require.NoError(t, sequencer.Reset()) + assert.Equal(t, uint64(0), sequencer.Get()) + require.NoError(t, sequencer.Shutdown()) +} From b80b1fab6e0ebcc3776243225be3276b99489453 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 14 Sep 2026 13:48:36 +0200 Subject: [PATCH 34/65] refactor(bootstrap): Align Linux bootstrap with platform conventions Guard single instance with an abstract UNIX domain socket that the kernel releases automatically on process termination, replacing the flock file in a world-writable directory. Drop the no-op debug privilege option since the concept does not exist on Linux. Import internal/ebpf under the libebpf alias and give the Windows signal handler its platform suffix now that a Linux counterpart exists. --- internal/bootstrap/bootstrap_linux.go | 59 ++++++++----------- internal/bootstrap/source_linux.go | 4 +- .../{signals.go => signals_windows.go} | 0 3 files changed, 27 insertions(+), 36 deletions(-) rename pkg/util/signals/{signals.go => signals_windows.go} (100%) diff --git a/internal/bootstrap/bootstrap_linux.go b/internal/bootstrap/bootstrap_linux.go index 26ca98856..7a25fd788 100644 --- a/internal/bootstrap/bootstrap_linux.go +++ b/internal/bootstrap/bootstrap_linux.go @@ -22,10 +22,11 @@ package bootstrap import ( + "context" "errors" "fmt" + "net" "os" - "syscall" "github.com/rabbitstack/fibratus/pkg/aggregator" "github.com/rabbitstack/fibratus/pkg/alertsender" @@ -38,10 +39,12 @@ import ( "github.com/rabbitstack/fibratus/pkg/util/signals" "github.com/rabbitstack/fibratus/pkg/util/version" log "github.com/sirupsen/logrus" - "golang.org/x/sys/unix" ) -const instanceLockPath = "/tmp/fibratus.lock" +// instanceSocket is an abstract UNIX domain socket name. Binding it acts as +// a kernel-wide mutex that is released automatically when the process +// terminates, so no filesystem cleanup is required. +const instanceSocket = "@fibratus" // ErrAlreadyRunning signals a Fibratus process is already running. var ErrAlreadyRunning = errors.New("an instance of Fibratus process is already running in the system") @@ -50,13 +53,13 @@ var ErrAlreadyRunning = errors.New("an instance of Fibratus process is already r // for event acquisition, rule engine initialization, // and event routing to the output sinks. type App struct { - config *config.Config - evs *EventSourceControl - engine *rules.Engine - psnap ps.Snapshotter - agg *aggregator.BufferedAggregator - signals chan struct{} - lock *os.File + config *config.Config + evs *EventSourceControl + engine *rules.Engine + psnap ps.Snapshotter + agg *aggregator.BufferedAggregator + signals chan struct{} + instance net.Listener } // Option enables changing the behaviour of the bootstrap application. @@ -73,11 +76,6 @@ func WithSignals() Option { } } -// WithDebugPrivilege is a no-op on Linux. -func WithDebugPrivilege() Option { - return func(*opts) {} -} - // NewApp constructs a new bootstrap application with the specified configuration // and a list of options. func NewApp(cfg *config.Config, options ...Option) (*App, error) { @@ -131,14 +129,9 @@ func (f *App) Run(args []string) error { return fmt.Errorf("filaments are not supported on Linux") } - lock, err := acquireInstanceLock() - if err != nil { - if errors.Is(err, syscall.EWOULDBLOCK) || errors.Is(err, syscall.EAGAIN) { - return ErrAlreadyRunning - } - return fmt.Errorf("acquiring instance lock: %w", err) + if !f.isSingleInstance() { + return ErrAlreadyRunning } - f.lock = lock log.Infof("bootstrapping with pid %d. Version: %s", os.Getpid(), version.Get()) log.Infof("configuration options: %s", cfg.Print()) @@ -203,22 +196,20 @@ func (f *App) Shutdown() error { if err := alertsender.ShutdownAll(); err != nil { errs = append(errs, err) } - if f.lock != nil { - _ = unix.Flock(int(f.lock.Fd()), unix.LOCK_UN) - _ = f.lock.Close() - _ = os.Remove(instanceLockPath) + if f.instance != nil { + _ = f.instance.Close() } return multierror.Wrap(errs...) } -func acquireInstanceLock() (*os.File, error) { - f, err := os.OpenFile(instanceLockPath, os.O_CREATE|os.O_RDWR, 0o600) +// isSingleInstance checks if there is already an instance of Fibratus +// running in the system. +func (f *App) isSingleInstance() bool { + var lc net.ListenConfig + l, err := lc.Listen(context.Background(), "unix", instanceSocket) if err != nil { - return nil, err - } - if err := unix.Flock(int(f.Fd()), unix.LOCK_EX|unix.LOCK_NB); err != nil { - _ = f.Close() - return nil, err + return false } - return f, nil + f.instance = l + return true } diff --git a/internal/bootstrap/source_linux.go b/internal/bootstrap/source_linux.go index 8096eba53..c341c9b55 100644 --- a/internal/bootstrap/source_linux.go +++ b/internal/bootstrap/source_linux.go @@ -22,7 +22,7 @@ package bootstrap import ( - "github.com/rabbitstack/fibratus/internal/ebpf" + libebpf "github.com/rabbitstack/fibratus/internal/ebpf" "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/event" "github.com/rabbitstack/fibratus/pkg/filter" @@ -40,7 +40,7 @@ func NewEventSourceControl( cfg *config.Config, compiler *config.RulesCompileResult, ) *EventSourceControl { - return &EventSourceControl{evs: ebpf.NewEventSource(psnap, cfg, compiler)} + return &EventSourceControl{evs: libebpf.NewEventSource(psnap, cfg, compiler)} } func (s *EventSourceControl) Open(cfg *config.Config) error { diff --git a/pkg/util/signals/signals.go b/pkg/util/signals/signals_windows.go similarity index 100% rename from pkg/util/signals/signals.go rename to pkg/util/signals/signals_windows.go From 90ec3db25898a82aadcb81e56a735a42e6ad78d9 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 14 Sep 2026 13:48:36 +0200 Subject: [PATCH 35/65] ci: Validate PR titles targeting linux-port --- .github/workflows/linux-port.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/linux-port.yml b/.github/workflows/linux-port.yml index 1c4c950c6..31c68cf90 100644 --- a/.github/workflows/linux-port.yml +++ b/.github/workflows/linux-port.yml @@ -17,6 +17,11 @@ jobs: ebpf: runs-on: ubuntu-latest steps: + - name: Validate PR title + if: github.event_name == 'pull_request' + uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Checkout uses: actions/checkout@v4 - name: Install Go From d3daa2c6eafb442f4cfbcefb715faf701024ca91 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 14 Sep 2026 19:15:22 +0200 Subject: [PATCH 36/65] refactor(ebpf): Simplify the ring buffer record model Drop the kind field: it always mirrored the type, which alone designates the event topology, with zero reserved for iter/task snapshot records that map to the unknown type and can never leak as live events. Removing it also removes the explicit alignment padding. Rename the record struct to syscall_event, generalize clone_flags to a per-type flags field ahead of wider telemetry, and rename attachHotPath to attachPrograms with a comment contrasting the continuous live-capture programs against the one-shot snapshot iterator. --- internal/ebpf/c/clone.bpf.c | 10 ++++------ internal/ebpf/c/common/events.h | 27 +++++++++++-------------- internal/ebpf/c/execve.bpf.c | 3 +-- internal/ebpf/c/exit.bpf.c | 3 +-- internal/ebpf/c/proc_iter.bpf.c | 5 ++--- internal/ebpf/clone_bpfeb.o | Bin 30072 -> 30208 bytes internal/ebpf/clone_bpfel.o | Bin 30072 -> 29824 bytes internal/ebpf/events.go | 34 +++++++++++++++----------------- internal/ebpf/events_test.go | 5 +---- internal/ebpf/execve_bpfeb.o | Bin 16376 -> 16456 bytes internal/ebpf/execve_bpfel.o | Bin 16376 -> 16264 bytes internal/ebpf/exit_bpfeb.o | Bin 6648 -> 6632 bytes internal/ebpf/exit_bpfel.o | Bin 6648 -> 6632 bytes internal/ebpf/loader.go | 7 ++++++- internal/ebpf/prociter_bpfeb.o | Bin 6288 -> 6280 bytes internal/ebpf/prociter_bpfel.o | Bin 6288 -> 6280 bytes internal/ebpf/source.go | 6 +++--- internal/ebpf/source_test.go | 5 ++--- 18 files changed, 47 insertions(+), 58 deletions(-) diff --git a/internal/ebpf/c/clone.bpf.c b/internal/ebpf/c/clone.bpf.c index cc2deacea..3c452ff34 100644 --- a/internal/ebpf/c/clone.bpf.c +++ b/internal/ebpf/c/clone.bpf.c @@ -21,7 +21,7 @@ static __always_inline int handle_clone_exit(long ret, u32 syscall_id) { u64 key = bpf_get_current_pid_tgid(); struct scratch_value *val; - struct fibratus_event *e; + struct syscall_event *e; struct task_struct *task; struct task_struct *parent; const struct cred *cred; @@ -36,7 +36,6 @@ static __always_inline int handle_clone_exit(long ret, u32 syscall_id) if (!e) return 0; - e->kind = EVT_KIND_CLONE; e->type = EVT_TYPE_CLONE; e->syscall_id = syscall_id; e->retval = ret; @@ -55,7 +54,7 @@ static __always_inline int handle_clone_exit(long ret, u32 syscall_id) val = bpf_map_lookup_elem(&scratch, &key); if (val) { - e->clone_flags = val->arg0; + e->flags = val->arg0; if (!e->syscall_id) e->syscall_id = (u32)val->arg1; } @@ -119,7 +118,7 @@ int handle_sys_exit_vfork(struct trace_event_raw_sys_exit *ctx) SEC("tp_btf/sched_process_fork") int BPF_PROG(handle_sched_process_fork, struct task_struct *parent, struct task_struct *child) { - struct fibratus_event *e; + struct syscall_event *e; struct scratch_value *val; const struct cred *cred; struct task_struct *real_parent; @@ -132,7 +131,6 @@ int BPF_PROG(handle_sched_process_fork, struct task_struct *parent, struct task_ if (!e) return 0; - e->kind = EVT_KIND_CLONE; e->type = EVT_TYPE_CLONE; e->retval = child->tgid; e->pid = child->tgid; @@ -156,7 +154,7 @@ int BPF_PROG(handle_sched_process_fork, struct task_struct *parent, struct task_ key = ((u64)parent->tgid << 32) | (u32)parent->pid; val = bpf_map_lookup_elem(&scratch, &key); if (val) { - e->clone_flags = val->arg0; + e->flags = val->arg0; e->syscall_id = (u32)val->arg1; bpf_map_delete_elem(&scratch, &key); } diff --git a/internal/ebpf/c/common/events.h b/internal/ebpf/c/common/events.h index 56400585a..4328072f6 100644 --- a/internal/ebpf/c/common/events.h +++ b/internal/ebpf/c/common/events.h @@ -29,21 +29,16 @@ struct trace_event_raw_sys_exit { long ret; }; -enum fibratus_event_kind { - EVT_KIND_SNAPSHOT = 0, - EVT_KIND_EXECVE = 1, - EVT_KIND_EXIT = 2, - EVT_KIND_CLONE = 3, -}; - -/* Stable semantic type IDs. Keep in sync with pkg/event.Type on Linux. */ -#define EVT_TYPE_UNKNOWN 0 +/* Stable semantic type IDs. Keep in sync with pkg/event.Type on Linux. + * Zero is reserved for iter/task baseline snapshot records, which feed + * the process state and are never dispatched as events. + */ +#define EVT_TYPE_SNAPSHOT 0 #define EVT_TYPE_EXECVE 1 #define EVT_TYPE_EXIT 2 #define EVT_TYPE_CLONE 3 -struct fibratus_event { - u32 kind; +struct syscall_event { u32 type; u32 pid; u32 tid; @@ -52,9 +47,9 @@ struct fibratus_event { u32 uid; u32 gid; u32 syscall_id; - u32 pad; s64 retval; - u64 clone_flags; + /* Interpreted per event type; clone stores the raw clone flags. */ + u64 flags; u64 start_boottime; u64 timestamp_ns; u8 comm[TASK_COMM_LEN]; @@ -97,9 +92,9 @@ static __always_inline void account_drop(void) __sync_fetch_and_add(count, 1); } -static __always_inline struct fibratus_event *reserve_event(void) +static __always_inline struct syscall_event *reserve_event(void) { - struct fibratus_event *e; + struct syscall_event *e; e = bpf_ringbuf_reserve(&events, sizeof(*e), 0); if (!e) { @@ -111,7 +106,7 @@ static __always_inline struct fibratus_event *reserve_event(void) return e; } -static __always_inline void fill_current_ids(struct fibratus_event *e) +static __always_inline void fill_current_ids(struct syscall_event *e) { u64 id = bpf_get_current_pid_tgid(); u64 uidgid = bpf_get_current_uid_gid(); diff --git a/internal/ebpf/c/execve.bpf.c b/internal/ebpf/c/execve.bpf.c index 04ee29ba2..32211a588 100644 --- a/internal/ebpf/c/execve.bpf.c +++ b/internal/ebpf/c/execve.bpf.c @@ -22,7 +22,7 @@ static __always_inline int handle_exec_exit(long ret, u32 syscall_id) { u64 key = bpf_get_current_pid_tgid(); struct scratch_value *val; - struct fibratus_event *e; + struct syscall_event *e; struct task_struct *task; struct task_struct *parent; const struct cred *cred; @@ -31,7 +31,6 @@ static __always_inline int handle_exec_exit(long ret, u32 syscall_id) if (!e) return 0; - e->kind = EVT_KIND_EXECVE; e->type = EVT_TYPE_EXECVE; e->syscall_id = syscall_id; e->retval = ret; diff --git a/internal/ebpf/c/exit.bpf.c b/internal/ebpf/c/exit.bpf.c index 2228444bd..f5569f792 100644 --- a/internal/ebpf/c/exit.bpf.c +++ b/internal/ebpf/c/exit.bpf.c @@ -14,7 +14,7 @@ char LICENSE[] SEC("license") = "Dual MIT/GPL"; SEC("tp_btf/sched_process_exit") int BPF_PROG(handle_sched_process_exit, struct task_struct *task) { - struct fibratus_event *e; + struct syscall_event *e; struct task_struct *parent; const struct cred *cred; @@ -31,7 +31,6 @@ int BPF_PROG(handle_sched_process_exit, struct task_struct *task) if (!e) return 0; - e->kind = EVT_KIND_EXIT; e->type = EVT_TYPE_EXIT; /* Raw wait status: (code << 8) | termination signal. */ e->retval = task->exit_code; diff --git a/internal/ebpf/c/proc_iter.bpf.c b/internal/ebpf/c/proc_iter.bpf.c index eb41eadaa..628a190cf 100644 --- a/internal/ebpf/c/proc_iter.bpf.c +++ b/internal/ebpf/c/proc_iter.bpf.c @@ -20,7 +20,7 @@ int dump_task(struct bpf_iter__task *ctx) struct task_struct *task; struct task_struct *parent; const struct cred *cred; - struct fibratus_event *e; + struct syscall_event *e; pid_t pid; pid_t tgid; @@ -37,8 +37,7 @@ int dump_task(struct bpf_iter__task *ctx) if (!e) return 0; - e->kind = EVT_KIND_SNAPSHOT; - e->type = EVT_TYPE_UNKNOWN; + e->type = EVT_TYPE_SNAPSHOT; e->pid = tgid; e->tid = pid; e->tgid = tgid; diff --git a/internal/ebpf/clone_bpfeb.o b/internal/ebpf/clone_bpfeb.o index e03647d4529c7b5e2a10c51f75e09c3ad1479f8b..40ba3e2869a1db31af38fa3c0306908130a6cd76 100644 GIT binary patch literal 30208 zcmeI4e{5UVb;s``C7F($SZQpBZPVqYNgc|QWy*>Z)^$DRhZAP?64iAJrE5V_6fJVr z4_2fSD)KNEO*>&rF=6Wf0Sy|Z>k_T#1{E!46$>DtD>iNQAL>>V+L~bk)&g1^4BF6Q z!eH3@o_o(F?>iFJZpk_n)rB9={oHeZoO|B=@!lon-#UBl(NM@!_28-hMBGWJYY-V( z(v;-ScPMWntJ;YsKBgihKS>`--7-0QW0N9Rv{tFfmu_qjL$0%2W4X$5h2=8KC6)^; z=UL9NoMkz~a+>87%Noln%M!~1%M8mtmc1-fER!q~EaNO=EPa+ymhCJfEJ>ih*EdNH z>eiM249m$^u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git a/internal/ebpf/loader.go b/internal/ebpf/loader.go index 98054c573..83cc1887a 100644 --- a/internal/ebpf/loader.go +++ b/internal/ebpf/loader.go @@ -123,7 +123,12 @@ func (l *loader) dropCount() uint64 { // syscallsGroup is the tracefs group hosting raw syscall tracepoints. const syscallsGroup = "syscalls" -func (l *loader) attachHotPath() error { +// attachPrograms attaches the live-capture programs: raw syscall tracepoints +// plus the scheduler tp_btf hooks. These feed the ring buffer continuously, +// in contrast to the one-shot iter/task snapshot program started by +// runTaskIterator. The caller starts the ring buffer reader first so no +// events are lost between attachment and consumption. +func (l *loader) attachPrograms() error { type tp struct { name string prog *ebpf.Program diff --git a/internal/ebpf/prociter_bpfeb.o b/internal/ebpf/prociter_bpfeb.o index 5340adcd9cb7c4b1b8e19f3d2785acedbb95adf1..772188f36c344e06c84596e50e257aa7ca709296 100644 GIT binary patch delta 939 zcmYk3F=$g!6o&tM6D3+DFVgg-R^&+s>(V5X8I(k{nu1`#qA4QHGZmuK8yu{PNe4AU zhlIOi^QjRX1S1jbAd*2uK_P>n;3^VCq?0%}c+PvLkUN}{??30>^PiVywvlb7Rk4+s zn!Ery?mdo_ZA3X=Ttlg~GOZR`jkA;Uth}-~LVZ&~#x~&Oi+{^1n`5q2u}gAHa_~;& z3KOtuBg6Toi;P*<2i>Bm!EI6t!oifJ1Ej2+Xp_3hMKrd{3uT0=FNtHQgXO3c?oreEQy zOMMDzWhY5(;nPr6?td!01m&^$4dEM5KCvdF!MyvZsSdf-w2=s^vxhiEmwr=z2Rx$z z+7bRjZ|@+U5&i*mnE88h{~y5T{#?irdZ)XOxG=&zuPl732E1fPbrJ3WuM@-#;fFw< zHquSu=fK+}aeIWvh<)Ktz{fZ-eE~KUA%g?H-wioB3w*YTH-t~Hz>fPOoB_Ua!}}5D z`at+9@SP10g~{+Q^C(`Z@yds2V({lvLs9rRWjflU!1XPz3$Ib86KqIz{0uPMi2FYX z^9E@kIwRZ{o)6iakL)$KtZ6kgzLi$K8CbR&n4z^_>%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?3+YfDe{d=C$Igk0J zUOm6GTRbRjUch2;vgc?<-806*wx`8nMzS;Ntr4e)+A!i_%gZ@oSt&Z&3i{l^(Dkb~ zuOtp9j-5Mm`NZt0sn(-l&Pdh?3*7#Wk7yXcz%xQYJgj{~?F`4=5@A`gCw2A?p(&nY z8}|uq@h$CDg2_>@`h;VoO|bgBhn-;m;&(oB46Fbt@mG#RFMvt$7Dso8cgslP563_q z$cZf<$I zyrmcT0<^^k_)~~=fwevd*d6g{UH=ZO_c_4sim!3q_yKH-%YIJKwt5^o;_6F}^S>71 zJ@v4~N5!T8tS_zm?@C=?Qv0WVnTNiU_9v<9J4~=syrmxc%-XX(tMld|K1t1-pr(3n z#;B{lnQ;TY){gnyPcKzt;sF L(#q0;a;&kxaP^nu diff --git a/internal/ebpf/source.go b/internal/ebpf/source.go index 58b7759ca..e335732cd 100644 --- a/internal/ebpf/source.go +++ b/internal/ebpf/source.go @@ -118,7 +118,7 @@ func (e *EventSource) Open(cfg *config.Config) error { go e.consume() - if err := ldr.attachHotPath(); err != nil { + if err := ldr.attachPrograms(); err != nil { e.Close() return err } @@ -198,7 +198,7 @@ func (e *EventSource) handleRecord(raw []byte) { parseErrors.Add(1) return } - if rec.Kind == eventKindSnapshot { + if rec.Type == snapshotType { e.handleSnapshot(rec) return } @@ -213,7 +213,7 @@ func (e *EventSource) handleRecord(raw []byte) { } evt := rec.toEvent() - if rec.Kind == eventKindExecve || rec.Kind == eventKindClone { + if typ == event.Execve || typ == event.Clone { enrichEvent(evt) } diff --git a/internal/ebpf/source_test.go b/internal/ebpf/source_test.go index 439640af6..c57fbaf18 100644 --- a/internal/ebpf/source_test.go +++ b/internal/ebpf/source_test.go @@ -54,8 +54,7 @@ func TestStartupReplayAndLateSnapshot(t *testing.T) { assert.False(t, ok) snap := hot - snap.Kind = eventKindSnapshot - snap.Type = 0 + snap.Type = snapshotType snap.Comm = [16]byte{} copy(snap.Comm[:], "snap-a") es.handleSnapshot(snap) @@ -100,7 +99,7 @@ func TestPIDReuseKeepsDistinctUUIDs(t *testing.T) { copy(first.Comm[:], "one") es.handleRecord(encodeRaw(t, first)) - exit := rawEvent{Kind: eventKindExit, Type: uint32(event.Exit), PID: 8, TGID: 8, StartBootTime: 1} + exit := rawEvent{Type: uint32(event.Exit), PID: 8, TGID: 8, StartBootTime: 1} es.handleRecord(encodeRaw(t, exit)) second := first From f04626d9974b1ad71f6ba46bf382ecf7b6725321 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Tue, 15 Sep 2026 10:11:46 +0200 Subject: [PATCH 37/65] feat(event): Add Linux syscall telemetry types and parameters Extend the Linux event catalog with openat, unlink, rename, connect, accept, mmap, process_vm_readv/writev, kill, ptrace, and prctl. Identifiers stay stable and Linux-native, and tests assert that Windows event names stay out of the catalog. --- pkg/event/metainfo_linux.go | 42 +++++++++++++++++---- pkg/event/params/names_linux.go | 32 ++++++++++++++++ pkg/event/types_linux.go | 65 ++++++++++++++++++++++++++++++++- pkg/event/types_linux_test.go | 60 ++++++++++++++++++++++++++++++ 4 files changed, 190 insertions(+), 9 deletions(-) create mode 100644 pkg/event/types_linux_test.go diff --git a/pkg/event/metainfo_linux.go b/pkg/event/metainfo_linux.go index 667f598a3..606b0f669 100644 --- a/pkg/event/metainfo_linux.go +++ b/pkg/event/metainfo_linux.go @@ -23,20 +23,48 @@ package event import "slices" var events = map[Type]Info{ - Execve: {Name: "execve", Category: Process, Description: "Executes a program"}, - Exit: {Name: "exit", Category: Process, Description: "Exit all threads in a process"}, - Clone: {Name: "clone", Category: Process, Description: "Creates a child process or a thread"}, + Execve: {Name: "execve", Category: Process, Description: "Executes a program"}, + Exit: {Name: "exit", Category: Process, Description: "Exit all threads in a process"}, + Clone: {Name: "clone", Category: Process, Description: "Creates a child process or a thread"}, + Openat: {Name: "openat", Category: File, Description: "Opens or creates a file"}, + Unlink: {Name: "unlink", Category: File, Description: "Removes a directory entry"}, + Rename: {Name: "rename", Category: File, Description: "Renames a file"}, + Connect: {Name: "connect", Category: Net, Description: "Initiates a socket connection"}, + Accept: {Name: "accept", Category: Net, Description: "Accepts a socket connection"}, + Mmap: {Name: "mmap", Category: Mem, Description: "Maps files or devices into memory"}, + ProcessVMRead: {Name: "process_vm_readv", Category: Mem, Description: "Reads memory from another process"}, + ProcessVMWrite: {Name: "process_vm_writev", Category: Mem, Description: "Writes memory into another process"}, + Kill: {Name: "kill", Category: Process, Description: "Sends a signal to a process"}, + Ptrace: {Name: "ptrace", Category: Process, Description: "Traces or controls another process"}, + Prctl: {Name: "prctl", Category: Process, Description: "Performs a process-control operation"}, } var types = map[string]Type{ - "execve": Execve, - "exit": Exit, - "clone": Clone, + "execve": Execve, + "exit": Exit, + "clone": Clone, + "openat": Openat, + "unlink": Unlink, + "rename": Rename, + "connect": Connect, + "accept": Accept, + "mmap": Mmap, + "process_vm_readv": ProcessVMRead, + "process_vm_writev": ProcessVMWrite, + "kill": Kill, + "ptrace": Ptrace, + "prctl": Prctl, } // All returns all Linux event types. func All() []Type { - return []Type{Execve, Exit, Clone} + return []Type{ + Execve, Exit, Clone, + Openat, Unlink, Rename, + Connect, Accept, + Mmap, ProcessVMRead, ProcessVMWrite, + Kill, Ptrace, Prctl, + } } // MaxTypeID returns the largest Linux event type identifier. diff --git a/pkg/event/params/names_linux.go b/pkg/event/params/names_linux.go index edf79f1f0..14b30b4a4 100644 --- a/pkg/event/params/names_linux.go +++ b/pkg/event/params/names_linux.go @@ -33,4 +33,36 @@ const ( Retval = "retval" // StartBootTime is the process start time measured from system boot, in nanoseconds. StartBootTime = "start_boot_time" + // DirFD is a directory file descriptor, including AT_FDCWD. + DirFD = "dirfd" + // NewDirFD is the destination directory file descriptor for renameat. + NewDirFD = "new_dirfd" + // FileNewPath is the destination path of a rename. + FileNewPath = "file_new_path" + // FileFlags is the raw openat, unlinkat, or renameat2 flags bitmask. + FileFlags = "file_flags" + // FileMode is the file creation mode supplied to openat. + FileMode = "file_mode" + // FD is a file descriptor. + FD = "fd" + // SockFamily is the socket address family (AF_INET, AF_INET6, AF_UNIX). + SockFamily = "sock_family" + // SockPath is the filesystem path of an AF_UNIX socket. + SockPath = "sock_path" + // MmapFlags is the raw mmap flags bitmask. + MmapFlags = "mmap_flags" + // MmapOffset is the file offset of a memory mapping. + MmapOffset = "mmap_offset" + // Signal is a POSIX signal number. + Signal = "signal" + // PtraceRequest is the ptrace request code. + PtraceRequest = "ptrace_request" + // PtraceAddr is the ptrace address argument. + PtraceAddr = "ptrace_addr" + // PtraceData is the ptrace data argument. + PtraceData = "ptrace_data" + // PrctlOption is the prctl option code. + PrctlOption = "prctl_option" + // Truncated is a bitmask of truncated variable-length fields. + Truncated = "truncated" ) diff --git a/pkg/event/types_linux.go b/pkg/event/types_linux.go index 8bb9b7140..883947e0b 100644 --- a/pkg/event/types_linux.go +++ b/pkg/event/types_linux.go @@ -41,6 +41,17 @@ const ( Execve Exit Clone + Openat + Unlink + Rename + Connect + Accept + Mmap + ProcessVMRead + ProcessVMWrite + Kill + Ptrace + Prctl ) // String returns the event type name. @@ -52,6 +63,28 @@ func (t Type) String() string { return "exit" case Clone: return "clone" + case Openat: + return "openat" + case Unlink: + return "unlink" + case Rename: + return "rename" + case Connect: + return "connect" + case Accept: + return "accept" + case Mmap: + return "mmap" + case ProcessVMRead: + return "process_vm_readv" + case ProcessVMWrite: + return "process_vm_writev" + case Kill: + return "kill" + case Ptrace: + return "ptrace" + case Prctl: + return "prctl" default: return "" } @@ -60,8 +93,14 @@ func (t Type) String() string { // Category returns the event type category. func (t Type) Category() Category { switch t { - case Execve, Exit, Clone: + case Execve, Exit, Clone, Kill, Ptrace, Prctl: return Process + case Openat, Unlink, Rename: + return File + case Connect, Accept: + return Net + case Mmap, ProcessVMRead, ProcessVMWrite: + return Mem default: return Unknown } @@ -79,6 +118,28 @@ func (t Type) Description() string { return "Exit all threads in a process" case Clone: return "Creates a child process or a thread" + case Openat: + return "Opens or creates a file" + case Unlink: + return "Removes a directory entry" + case Rename: + return "Renames a file" + case Connect: + return "Initiates a socket connection" + case Accept: + return "Accepts a socket connection" + case Mmap: + return "Maps files or devices into memory" + case ProcessVMRead: + return "Reads memory from another process" + case ProcessVMWrite: + return "Writes memory into another process" + case Kill: + return "Sends a signal to a process" + case Ptrace: + return "Traces or controls another process" + case Prctl: + return "Performs a process-control operation" default: return "" } @@ -95,7 +156,7 @@ func (t Type) Hash() uint32 { // Exists reports whether the event type is known. func (t Type) Exists() bool { switch t { - case Execve, Exit, Clone: + case Execve, Exit, Clone, Openat, Unlink, Rename, Connect, Accept, Mmap, ProcessVMRead, ProcessVMWrite, Kill, Ptrace, Prctl: return true default: return false diff --git a/pkg/event/types_linux_test.go b/pkg/event/types_linux_test.go new file mode 100644 index 000000000..9cee20881 --- /dev/null +++ b/pkg/event/types_linux_test.go @@ -0,0 +1,60 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestLinuxEventCatalog(t *testing.T) { + assert.Equal(t, uint16(1), uint16(Execve)) + assert.Equal(t, uint16(14), uint16(Prctl)) + assert.Equal(t, File, Openat.Category()) + assert.Equal(t, Net, Connect.Category()) + assert.Equal(t, Mem, Mmap.Category()) + assert.Equal(t, Process, Kill.Category()) + assert.Equal(t, "process_vm_readv", ProcessVMRead.String()) + assert.True(t, Openat.Exists()) + for _, typ := range All() { + assert.True(t, typ.Exists()) + assert.Equal(t, typ, NameToType(typ.String())) + assert.NotEmpty(t, typ.Description()) + assert.Equal(t, typ.Category(), TypeToEventInfo(typ).Category) + } + assert.Equal(t, uint16(Prctl), MaxTypeID()) +} + +func TestLinuxEventCatalogRejectsWindowsNames(t *testing.T) { + for _, name := range []string{ + "CreateProcess", + "TerminateProcess", + "ProcessRundown", + "CreateFile", + "CreateThread", + "LoadImage", + "RegOpenKey", + "RecvTCPv4", + } { + assert.Equal(t, UnknownType, NameToType(name), name) + } +} From e402a4d8f6050d840dad70e5121a510b1357e723 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Tue, 15 Sep 2026 10:15:49 +0200 Subject: [PATCH 38/65] feat(ebpf): Extend the shared syscall record and enabled-type map Grow the ring buffer record with extra arguments, a second path buffer, and truncation bits so later syscall families can share one header. Build scratch values in a per-CPU heap to stay under the BPF stack limit, and gate emission with an enabled-type array keyed by stable event IDs rather than architecture syscall numbers. --- internal/ebpf/c/clone.bpf.c | 44 +++++------ internal/ebpf/c/common/events.h | 136 +++++++++++++++++++++++++++++++- internal/ebpf/c/execve.bpf.c | 41 ++++------ internal/ebpf/c/exit.bpf.c | 2 + internal/ebpf/clone_bpfeb.go | 32 +++++--- internal/ebpf/clone_bpfeb.o | Bin 30208 -> 45216 bytes internal/ebpf/clone_bpfel.go | 32 +++++--- internal/ebpf/clone_bpfel.o | Bin 29824 -> 44832 bytes internal/ebpf/events.go | 31 +++++--- internal/ebpf/execve_bpfeb.go | 32 +++++--- internal/ebpf/execve_bpfeb.o | Bin 16456 -> 22792 bytes internal/ebpf/execve_bpfel.go | 32 +++++--- internal/ebpf/execve_bpfel.o | Bin 16264 -> 22600 bytes internal/ebpf/exit_bpfeb.go | 32 +++++--- internal/ebpf/exit_bpfeb.o | Bin 6632 -> 7880 bytes internal/ebpf/exit_bpfel.go | 32 +++++--- internal/ebpf/exit_bpfel.o | Bin 6632 -> 7880 bytes internal/ebpf/loader.go | 49 +++++++++++- internal/ebpf/loader_test.go | 22 ++++++ internal/ebpf/maps.go | 8 +- internal/ebpf/prociter_bpfeb.go | 32 +++++--- internal/ebpf/prociter_bpfeb.o | Bin 6280 -> 7136 bytes internal/ebpf/prociter_bpfel.go | 32 +++++--- internal/ebpf/prociter_bpfel.o | Bin 6280 -> 7136 bytes internal/ebpf/source.go | 5 ++ internal/ebpf/source_test.go | 3 + 26 files changed, 448 insertions(+), 149 deletions(-) diff --git a/internal/ebpf/c/clone.bpf.c b/internal/ebpf/c/clone.bpf.c index 3c452ff34..4e881d261 100644 --- a/internal/ebpf/c/clone.bpf.c +++ b/internal/ebpf/c/clone.bpf.c @@ -1,19 +1,20 @@ //go:build ignore #include "common/events.h" -#include "bpf_core_read.h" #include "bpf_tracing.h" char LICENSE[] SEC("license") = "Dual MIT/GPL"; static __always_inline int handle_clone_enter(u64 flags, u32 syscall_id) { - u64 key = bpf_get_current_pid_tgid(); - struct scratch_value val = {}; + struct scratch_value *val; - val.arg0 = flags; - val.arg1 = syscall_id; - bpf_map_update_elem(&scratch, &key, &val, BPF_ANY); + val = borrow_scratch(); + if (!val) + return 0; + val->flags = flags; + val->arg1 = syscall_id; + store_scratch(val); return 0; } @@ -22,9 +23,6 @@ static __always_inline int handle_clone_exit(long ret, u32 syscall_id) u64 key = bpf_get_current_pid_tgid(); struct scratch_value *val; struct syscall_event *e; - struct task_struct *task; - struct task_struct *parent; - const struct cred *cred; /* Successful clones are emitted from sched_process_fork with child identity. * Leave scratch in place so the fork handler can recover clone flags. @@ -32,29 +30,25 @@ static __always_inline int handle_clone_exit(long ret, u32 syscall_id) if (ret >= 0) return 0; + if (!type_enabled(EVT_TYPE_CLONE)) { + bpf_map_delete_elem(&scratch, &key); + return 0; + } + e = reserve_event(); - if (!e) + if (!e) { + bpf_map_delete_elem(&scratch, &key); return 0; + } e->type = EVT_TYPE_CLONE; e->syscall_id = syscall_id; e->retval = ret; - fill_current_ids(e); - - task = (struct task_struct *)bpf_get_current_task(); - e->start_boottime = BPF_CORE_READ(task, start_boottime); - parent = BPF_CORE_READ(task, real_parent); - if (parent) - e->ppid = BPF_CORE_READ(parent, tgid); - cred = BPF_CORE_READ(task, real_cred); - if (cred) { - e->uid = BPF_CORE_READ(cred, euid.val); - e->gid = BPF_CORE_READ(cred, egid.val); - } + fill_current_task(e); val = bpf_map_lookup_elem(&scratch, &key); if (val) { - e->flags = val->arg0; + copy_scratch(e, val); if (!e->syscall_id) e->syscall_id = (u32)val->arg1; } @@ -126,6 +120,8 @@ int BPF_PROG(handle_sched_process_fork, struct task_struct *parent, struct task_ if (!child || !parent) return 0; + if (!type_enabled(EVT_TYPE_CLONE)) + return 0; e = reserve_event(); if (!e) @@ -154,7 +150,7 @@ int BPF_PROG(handle_sched_process_fork, struct task_struct *parent, struct task_ key = ((u64)parent->tgid << 32) | (u32)parent->pid; val = bpf_map_lookup_elem(&scratch, &key); if (val) { - e->flags = val->arg0; + copy_scratch(e, val); e->syscall_id = (u32)val->arg1; bpf_map_delete_elem(&scratch, &key); } diff --git a/internal/ebpf/c/common/events.h b/internal/ebpf/c/common/events.h index 4328072f6..f44b374f8 100644 --- a/internal/ebpf/c/common/events.h +++ b/internal/ebpf/c/common/events.h @@ -4,12 +4,24 @@ #include "vmlinux.h" #include "bpf_helpers.h" +#include "bpf_core_read.h" #ifndef BPF_ANY #define BPF_ANY 0 #endif #define EVT_FILENAME_LEN 256 +#define EVT_TYPE_MAX 32 + +#define TRUNC_FILENAME (1u << 0) +#define TRUNC_FILENAME2 (1u << 1) + +/* UAPI openat2 argument; not a CO-RE kernel type. */ +struct open_how { + u64 flags; + u64 mode; + u64 resolve; +}; struct trace_event_raw_sys_enter { unsigned short common_type; @@ -37,6 +49,17 @@ struct trace_event_raw_sys_exit { #define EVT_TYPE_EXECVE 1 #define EVT_TYPE_EXIT 2 #define EVT_TYPE_CLONE 3 +#define EVT_TYPE_OPENAT 4 +#define EVT_TYPE_UNLINK 5 +#define EVT_TYPE_RENAME 6 +#define EVT_TYPE_CONNECT 7 +#define EVT_TYPE_ACCEPT 8 +#define EVT_TYPE_MMAP 9 +#define EVT_TYPE_PROCESS_VM_READ 10 +#define EVT_TYPE_PROCESS_VM_WRITE 11 +#define EVT_TYPE_KILL 12 +#define EVT_TYPE_PTRACE 13 +#define EVT_TYPE_PRCTL 14 struct syscall_event { u32 type; @@ -48,18 +71,31 @@ struct syscall_event { u32 gid; u32 syscall_id; s64 retval; - /* Interpreted per event type; clone stores the raw clone flags. */ + /* Interpreted per event type: clone flags, open flags, mmap flags, accept flags. */ u64 flags; + u64 arg0; + u64 arg1; + u64 arg2; + u64 arg3; u64 start_boottime; u64 timestamp_ns; + u32 truncated; + u32 pad; u8 comm[TASK_COMM_LEN]; u8 filename[EVT_FILENAME_LEN]; + u8 filename2[EVT_FILENAME_LEN]; }; struct scratch_value { u64 arg0; u64 arg1; + u64 arg2; + u64 arg3; + u64 flags; + u32 truncated; + u32 pad; u8 filename[EVT_FILENAME_LEN]; + u8 filename2[EVT_FILENAME_LEN]; }; struct { @@ -74,13 +110,32 @@ struct { __type(value, u64); } drop_count SEC(".maps"); +/* Correlates sys_enter state with the matching sys_exit. The task can + * migrate CPUs between entry and exit, so this must be a global hash, not + * a per-CPU one. LRU eviction reclaims entries whose exit never fired + * (e.g. the task was killed mid-syscall). + */ struct { - __uint(type, BPF_MAP_TYPE_PERCPU_HASH); - __uint(max_entries, 8192); + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __uint(max_entries, 2048); __type(key, u64); __type(value, struct scratch_value); } scratch SEC(".maps"); +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __uint(max_entries, 1); + __type(key, u32); + __type(value, struct scratch_value); +} scratch_heap SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __uint(max_entries, EVT_TYPE_MAX); + __type(key, u32); + __type(value, u8); +} enabled SEC(".maps"); + static __always_inline void account_drop(void) { u32 key = 0; @@ -92,6 +147,16 @@ static __always_inline void account_drop(void) __sync_fetch_and_add(count, 1); } +static __always_inline int type_enabled(u32 type) +{ + u8 *on; + + if (type >= EVT_TYPE_MAX) + return 0; + on = bpf_map_lookup_elem(&enabled, &type); + return on && *on; +} + static __always_inline struct syscall_event *reserve_event(void) { struct syscall_event *e; @@ -118,3 +183,68 @@ static __always_inline void fill_current_ids(struct syscall_event *e) e->gid = uidgid >> 32; bpf_get_current_comm(&e->comm, sizeof(e->comm)); } + +static __always_inline void fill_current_task(struct syscall_event *e) +{ + struct task_struct *task; + struct task_struct *parent; + const struct cred *cred; + + fill_current_ids(e); + task = (struct task_struct *)bpf_get_current_task(); + e->start_boottime = BPF_CORE_READ(task, start_boottime); + parent = BPF_CORE_READ(task, real_parent); + if (parent) + e->ppid = BPF_CORE_READ(parent, tgid); + cred = BPF_CORE_READ(task, real_cred); + if (cred) { + e->uid = BPF_CORE_READ(cred, euid.val); + e->gid = BPF_CORE_READ(cred, egid.val); + } +} + +static __always_inline u32 read_user_str(void *dst, u32 size, const char *src) +{ + long n; + + if (!src) + return 0; + n = bpf_probe_read_user_str(dst, size, src); + if (n == size) + return 1; + return 0; +} + +static __always_inline void copy_scratch(struct syscall_event *e, struct scratch_value *val) +{ + if (!val) + return; + e->arg0 = val->arg0; + e->arg1 = val->arg1; + e->arg2 = val->arg2; + e->arg3 = val->arg3; + if (!e->flags) + e->flags = val->flags; + e->truncated = val->truncated; + __builtin_memcpy(&e->filename, val->filename, sizeof(e->filename)); + __builtin_memcpy(&e->filename2, val->filename2, sizeof(e->filename2)); +} + +static __always_inline struct scratch_value *borrow_scratch(void) +{ + u32 zero = 0; + struct scratch_value *val; + + val = bpf_map_lookup_elem(&scratch_heap, &zero); + if (!val) + return NULL; + __builtin_memset(val, 0, sizeof(*val)); + return val; +} + +static __always_inline int store_scratch(struct scratch_value *val) +{ + u64 key = bpf_get_current_pid_tgid(); + + return bpf_map_update_elem(&scratch, &key, val, BPF_ANY); +} diff --git a/internal/ebpf/c/execve.bpf.c b/internal/ebpf/c/execve.bpf.c index 32211a588..afffb5740 100644 --- a/internal/ebpf/c/execve.bpf.c +++ b/internal/ebpf/c/execve.bpf.c @@ -1,20 +1,20 @@ //go:build ignore #include "common/events.h" -#include "bpf_core_read.h" #include "bpf_tracing.h" char LICENSE[] SEC("license") = "Dual MIT/GPL"; static __always_inline int handle_exec_enter(const char *filename, u32 syscall_id) { - u64 key = bpf_get_current_pid_tgid(); - struct scratch_value val = {}; + struct scratch_value *val; - val.arg1 = syscall_id; - if (filename) - bpf_probe_read_user_str(&val.filename, sizeof(val.filename), filename); - bpf_map_update_elem(&scratch, &key, &val, BPF_ANY); + val = borrow_scratch(); + if (!val) + return 0; + val->arg1 = syscall_id; + val->truncated |= read_user_str(val->filename, sizeof(val->filename), filename); + store_scratch(val); return 0; } @@ -23,35 +23,28 @@ static __always_inline int handle_exec_exit(long ret, u32 syscall_id) u64 key = bpf_get_current_pid_tgid(); struct scratch_value *val; struct syscall_event *e; - struct task_struct *task; - struct task_struct *parent; - const struct cred *cred; + + if (!type_enabled(EVT_TYPE_EXECVE)) { + bpf_map_delete_elem(&scratch, &key); + return 0; + } e = reserve_event(); - if (!e) + if (!e) { + bpf_map_delete_elem(&scratch, &key); return 0; + } e->type = EVT_TYPE_EXECVE; e->syscall_id = syscall_id; e->retval = ret; - fill_current_ids(e); - - task = (struct task_struct *)bpf_get_current_task(); - e->start_boottime = BPF_CORE_READ(task, start_boottime); - parent = BPF_CORE_READ(task, real_parent); - if (parent) - e->ppid = BPF_CORE_READ(parent, tgid); - cred = BPF_CORE_READ(task, real_cred); - if (cred) { - e->uid = BPF_CORE_READ(cred, euid.val); - e->gid = BPF_CORE_READ(cred, egid.val); - } + fill_current_task(e); val = bpf_map_lookup_elem(&scratch, &key); if (val) { if (!e->syscall_id) e->syscall_id = (u32)val->arg1; - __builtin_memcpy(&e->filename, val->filename, sizeof(e->filename)); + copy_scratch(e, val); } bpf_map_delete_elem(&scratch, &key); diff --git a/internal/ebpf/c/exit.bpf.c b/internal/ebpf/c/exit.bpf.c index f5569f792..ead1dadfd 100644 --- a/internal/ebpf/c/exit.bpf.c +++ b/internal/ebpf/c/exit.bpf.c @@ -26,6 +26,8 @@ int BPF_PROG(handle_sched_process_exit, struct task_struct *task) */ if (task->pid != task->tgid) return 0; + if (!type_enabled(EVT_TYPE_EXIT)) + return 0; e = reserve_event(); if (!e) diff --git a/internal/ebpf/clone_bpfeb.go b/internal/ebpf/clone_bpfeb.go index 0c1de89c0..a99c432ca 100644 --- a/internal/ebpf/clone_bpfeb.go +++ b/internal/ebpf/clone_bpfeb.go @@ -14,10 +14,16 @@ import ( ) type cloneScratchValue struct { - _ structs.HostLayout - Arg0 uint64 - Arg1 uint64 - Filename [256]uint8 + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 } // loadClone returns the embedded CollectionSpec for clone. @@ -77,9 +83,11 @@ type cloneProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type cloneMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // cloneVariableSpecs contains global variables before they are loaded into the kernel. @@ -108,16 +116,20 @@ func (o *cloneObjects) Close() error { // // It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. type cloneMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *cloneMaps) Close() error { return _CloneClose( m.DropCount, + m.Enabled, m.Events, m.Scratch, + m.ScratchHeap, ) } diff --git a/internal/ebpf/clone_bpfeb.o b/internal/ebpf/clone_bpfeb.o index 40ba3e2869a1db31af38fa3c0306908130a6cd76..6e64435e0e43ef1428988face98b3da432c06ef1 100644 GIT binary patch literal 45216 zcmeI54RB-Ed7ck0ND$nWR#5a~*pa2HIF_;UYK7g^4=gJi=x1dpT1&LFQs`I-fF+>? zD=rC&7jBhzV@5(_E?&I&=V=?;n(W(W zT`=|}%N#c5l$g%ctRsAZdOjIs!~zYeX{yZ;c3VDF%!n7;p>9*RsGHOdb%VN2U8Am2 zSEz03GPOlrqBf}wYMol6R;eZGICYF#pysJLYL=RzhSW4QMNLvg(0;Q+-KK6)H>n-! z26dgfMqQ<@P}|gHYKyu=ZBiT5I<-cvQcKiv>KL^^%~NyKEHy(7scCA8nxu-D^CNCN zo==!i_(DnEjp2AZaDMsXj<6b^J9>OxxJzPTT<5L$^uZer%|E32@xSRbi6l0 zu?F=wvZCGo`i$?tCrf6Z*eAaH?&^P?x%gd4$M(nmJ!hCfR~p6bTQRA6h2d@{6$R5wnhf)qJP6+yY2C#GWC0o4QPG zQJ1JqYJ*y*)~Ho#i8@XlqZX)nYL1$vW~d=GO-)ggR1vhF^Td?dCT~$UsU7MDb)C9K zU8Sy2+tg)hi@HQ@QXAAdwMMN{OVn}d7_~snQ*+cTHA4-lX=;j^q>A|KdH8(ExN@p) zzL+>;ZV-R>dMyie;~%(SYm4jdJvrAaX#uOIOBU_G-J?sn;}I^y)g`+E6c`q^PVN#^t1 z;``ine7CcHt{)A~PnPV) zZ`tI?HU|88vMmQ}uam{=jlCYQPS|w=`Gpb>erqqMoTA@LVu#CHS#LCPF^E7$m`@Ld4s$}?vPvLP4Y5%i`*t}lUK+) zx}gk~hg2@)kKu-X`bBJLJ4$R}Yk5ASdY`Bd5sY z~^7kHg)>jhpTCq==lWD(&N$F5%BHhG)=W%3re zMcyPYk!`(@zDeGozd>Fn*U4+-8rjwh>8s=w`b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ZG7`x1|l#YX0+g)ipHq^f3KD7GwBdV(Ndk=~hYh zng27Tsrg3j7SavvP|DTguZJtye$`c;7}k<+rLuofdhVfz66u73c)*C0M)VlbZA2pd zfXQ+{iIZt9dW`5cB9T66vfO8~Xwj3_q8q~PK)u&JdTebwKy?3l0>v8rYEsV4pgY#x zL&hZ1-6xD~MxJEuVcFf#cN^oowS-E$ahnCu7oyyHQ?mDam`8K3LhLy#5}WvuHuji5$GoBVxZlPuf%?-%rnr6lhJR zwa50;mPfi*LVA<-y;bNC^!Mc^YCdgwkT-;nX6@7SDTO31YQGg11zR5Nhh79XY2W@_ zfPNl{v8y} z`aj2ol91GYdUm8>+eiQPZ;YC>-$T!z2yZ=SWc|}=U;n15S^MjzM06gK+NZfn!D-)1 qj@~$@{a({5_v6wG(+>Xk{uX&cZmCB6+_Z_eP(9Sgdst`NkN!7}!GaS2 diff --git a/internal/ebpf/clone_bpfel.go b/internal/ebpf/clone_bpfel.go index 36266195f..c6bf58999 100644 --- a/internal/ebpf/clone_bpfel.go +++ b/internal/ebpf/clone_bpfel.go @@ -14,10 +14,16 @@ import ( ) type cloneScratchValue struct { - _ structs.HostLayout - Arg0 uint64 - Arg1 uint64 - Filename [256]uint8 + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 } // loadClone returns the embedded CollectionSpec for clone. @@ -77,9 +83,11 @@ type cloneProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type cloneMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // cloneVariableSpecs contains global variables before they are loaded into the kernel. @@ -108,16 +116,20 @@ func (o *cloneObjects) Close() error { // // It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. type cloneMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *cloneMaps) Close() error { return _CloneClose( m.DropCount, + m.Enabled, m.Events, m.Scratch, + m.ScratchHeap, ) } diff --git a/internal/ebpf/clone_bpfel.o b/internal/ebpf/clone_bpfel.o index 9985e02c15cf0ad258cf5339cc58e33f6797ac08..f18f19b39a08bd07270e95c1fa797cf99351e0b2 100644 GIT binary patch literal 44832 zcmeI53vgrCecms@6&GBsB<@N}v9_FC#r6g(tyb7wJrGIRK#!H7Xf46g%7J4g02hQ7 zthgjXawSkur?4VtkXB7OsY7Et8k@Eo8_j4EPVHJ~;(9q_jf;*w4X5L}$W(3F8BNVL zZp`txDQ2pv`u)%O4tV${xR#n$Z9F)`i|_o-`*qK`_gq}?Z=XK%U}Rt*aAqL*@4*&1 z*C1H`@|HbmtjXYg2)QsiVrb#|sL@xg1o^-7DgGPOi4QghS{HBC)Xlhgz?PK{AR>KJu|8l?u*jx-nAYm>S`U8lCG zYt$BXmD;4PP#e@`YMr`Btx>DgGPOi4QghS{HBC)Xlhgz?PK{AR>KJu|8l@TuDkX9* zG!B=Bth1CWZ1GZxRdA8Z39+HmadqwcDiTUcVEw~*;)-Io~ zBKb0oS0ylv#QRMguKk`E+9%FI{xk2a{D*=+H|-$xmje7-+e|3WhH7Il@{q^?jK z)MaX&x=5{2tJE^JL@iQt)C@IEO;MB71T{{LQA6q&b%YwF2Gow}P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jPEPeSm3;H2QR z;0eLgg7bpwf*XQY1+NR<6ud2XS8z-4ew6h$?ofa94v6%m;I!Zg!PA2Cg6o1Cf>#Bv z3*HpGEqGUOOYnY_6A8fsf|G*Nf+qw|3(gC!3vLKr6}&EZQ}DLnUBNBE`%&&o2p$le z6r2`3A$VGFUT|G-L-4BLZ-GPSgTB8KOy{?7`u7C?XOvISz7Wzs@gO)f|4$4Frt@4l zeNwPE&z&gR^bbDt;YU8=KKvmyTnp+oHCzdb!xvw8W|*M!**5asBl2y5GTh-iHNH)R zKU&ZS5B|E1ltc4IRrsGb%$E!Pu%w2I#p`qQiMWD)f)T1+;z%+ZkfDzanyT4L5vtN>OE#ii&1aXkQV2>b3`d4M!gY@BP_uq zM%hSkiaCXmd{3Nn4#m)%JH$P?Z6Y1||EjRl2XT&|ux0#y5OJ9Zb%5W06yeZa>|OHf z`&}ou{(aV>Lw7!V@5|U&BZr&J{gAjGw%eHq#s3|`N7PT>L&)iSstKB>%}?|l_@nCI zG3qJ8)1Grg{e3Rd;O^9ZRfED2^`B+?^?jP^xA*37{j`T1QU8fOq`}>> z{b?v1RliHQ;WF@4zts!X@0>=wtzXPT%Ay_L*Dbd7DdH>eN9DKepK9kc0b4(1eI}G& zsNIt_5hv-lps)+i--}4F?aG9e@bg=inc}H2wjH*9vX6e7u=XPub`QU4=)^CDV-XJ3 zugCPL`qwzW3rY2#G)&(&w4?gJQMx^;`+eEOg`Q6~8LYld3)$=7TcL{Cgs2>%xdBJt O>2w?K)!13T1OE;B7_8s` diff --git a/internal/ebpf/execve_bpfel.go b/internal/ebpf/execve_bpfel.go index 7b1d8a45e..bbedc2e6d 100644 --- a/internal/ebpf/execve_bpfel.go +++ b/internal/ebpf/execve_bpfel.go @@ -14,10 +14,16 @@ import ( ) type execveScratchValue struct { - _ structs.HostLayout - Arg0 uint64 - Arg1 uint64 - Filename [256]uint8 + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 } // loadExecve returns the embedded CollectionSpec for execve. @@ -72,9 +78,11 @@ type execveProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type execveMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // execveVariableSpecs contains global variables before they are loaded into the kernel. @@ -103,16 +111,20 @@ func (o *execveObjects) Close() error { // // It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. type execveMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *execveMaps) Close() error { return _ExecveClose( m.DropCount, + m.Enabled, m.Events, m.Scratch, + m.ScratchHeap, ) } diff --git a/internal/ebpf/execve_bpfel.o b/internal/ebpf/execve_bpfel.o index cc808bde2073750857c398eb7310f1aa9ab1372b..249deb439058a6c1e71712c69cd4f3f8d8032551 100644 GIT binary patch literal 22600 zcmeI3eQaD=dB)F-6K9+ai8o|t4W;BRA7PU9I%7NRn%!=gWY@d1G_YnjOAQpplkp^D z#UI1WI6K3j)>6TpR-n2Sb={V>W{Xsd?jHtKT|<%9YAJP9q`DPSjf#+4wW=j(Wwi+W z2krKG&w0-H&TA)tkoqC{$mc%icfP;Ry?3sEe(=f@(MZI26EWX2yX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W=*B4hC{;=+sRJY5e``zQ|vsF(b z?70{Grg+0en4~#ZojGI%-HuG_U{GD?4kfpbs2@g+f_&r*b#ly=Gi|p%3dH9@+Hh}g zV5WJf%Nq`Za!_@oD$jWdPQw}xcpMO@=6tBvq~18dFET+RdDW_tB{lMHskz_Q?VHIC y*<{(}vu$-F&;K_P)W{sS(45-7aSG8*xCcH2v8<^zF-nXISu#^F$bh0Nr2hv~Y~NP^ diff --git a/internal/ebpf/prociter_bpfel.go b/internal/ebpf/prociter_bpfel.go index 7871faf59..4a2d9ae32 100644 --- a/internal/ebpf/prociter_bpfel.go +++ b/internal/ebpf/prociter_bpfel.go @@ -14,10 +14,16 @@ import ( ) type prociterScratchValue struct { - _ structs.HostLayout - Arg0 uint64 - Arg1 uint64 - Filename [256]uint8 + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 } // loadProciter returns the embedded CollectionSpec for prociter. @@ -69,9 +75,11 @@ type prociterProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type prociterMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // prociterVariableSpecs contains global variables before they are loaded into the kernel. @@ -100,16 +108,20 @@ func (o *prociterObjects) Close() error { // // It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. type prociterMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *prociterMaps) Close() error { return _ProciterClose( m.DropCount, + m.Enabled, m.Events, m.Scratch, + m.ScratchHeap, ) } diff --git a/internal/ebpf/prociter_bpfel.o b/internal/ebpf/prociter_bpfel.o index 1be845f7dccce2791d7e254033f6297c0310c045..61b46d42608293c8bb833ed9ab123a233cab4864 100644 GIT binary patch delta 2657 zcmZuyZA_b06h6KEpzZi5&{Eh36hT11t&A~1$E>(yXr_TV6EsfRK?h_w3!8C@rj5>R zMt?x=g8a~lWFjUmL2(&6qs_LM8TW%2O;Be9S|;d7(irRtCxJ+dpl-$17VZ>o7j6>{2{#D`g{y=E!i6Ts$2^j73X|{+9uGczRd`8wQFuXk zUihMLQg}{yMtE9yLU`QZZNp9gv49kwMA0un$!a2t>Weg_cQ)p(@$cRTza0M3n#kFOn#>%kmu z=ndcy8#C11DTP-yibh#H3ms4nR4q6kjK9nv^rH~G4{gwV2)K@8Ky(0lP;>}-7@9wt z0FH`ILLY~&2Xn_KfCk7AcnZj)MstTw!$49JETJ}~6eeUIDI=j;K_BVe8EfL3p|BIg z^AGZt$XYZ&G$Y5+41Fg!0JKOx1l=n6F!Xk4eAot}2k^K9%(0UbI1YTiI#<+eAuUZ{Y>=wd@vXp3fzCyKZpSv{b-x1b`YAhyd`V*?A88t^7c6Pv4q7Ww1Y? zUv$16j12W|Bs}VA??9yY03959a({Q^V6=x~ksjLHKM>s?c|7``*r=;rCEf$wLy?2s zeO-OgNQ_XhXCT@$+vd7v)myU4Kr4A!Z?9O;x0}cSJWp3_p#rkh%a$|Ar%P- z_Iwe$LyE@5zr^+16itgCgI7Bg&51w5{-mOy)qMXlymwkrlQq7a$U`E80-li-?8b%C zCf*Bnq4#$2W$aI4AmZ!6?g^r>_=mu2XYkWW^IrI4;tzw>2Sn3xNt^@cevFGt{10G9 zl4wr+6|nCDej;gp75qi%JO+xMP~5LR4H5Lf#%!hQ}Ko3Q|(x-xKYr7k8s4m{6a$f z_zFKQ{u62E)#3V7hrAl>9T*%3&%Oy970;7pe?&Zye#EoB=oHtI)tH+hh#ue$@2=O2j4w;=q(iioBqqQ*)pQ*a{bL6$mZhi2uf=}xK{G*EAmfBKBhZz zH|)G@H=B9*d@U@cc_;k!H1Fn8^O7>IN#3B$G@l7y?wEZ)_nJ~(pMJ|*o0)!7=y`8r zhTIm~;d|aePvHft?y%;&e(^&hPV0AkU6$?ob6<(VEUOEOSKos){%=qSNRNb9??#%u&SL2Ibm&~hnmHy3FTzVAw|NF>7*0Zy1q0f{Gnd{-z zshrmet8T|~2pS*?MwMx*Tba)ROVAIXkjP3bAG$6@vaqMk@wz?gqWQZn<6Hr2-U|CQ zv;)d=4cZAUKt;57Hkb5T3F2mr*iYX8f}Mo+!mq)K=ZnuJRSR0rw{*T0C4Mf^T~@O&j6!@!tan%yqlFo6eYPb_H-O&zb9(i{luw76d#XNKsl;uxeP|$P`_YiIc zhsV8I&L8FcYeY%OSHR6BqMYzKu7ArL-52oZnBP@AI)^x*@qmP<745?YW`3~3qlzYl zVO%L;<$MNt`*}qb;T>GRPtlCQ z@JHZqjc8i|-13)FiNz3vS?3 z;A0y+Cwu^T{VUP$!biaBkEQ3Oo;+C%b6flG|&NY$v+vueoXQ`!8&vV(C)zYLgDse~Sj znNL%l>M3&*Fc>iRQp47WoPL*iIGt6mm|{Aywj#09mcNJlN&H{nWpqtOVqUCZuBJEX qhZ@bj^suhQ%uuFN?J&hm!m7%FLpX3&9WbX58|4QE5;0dZ+5Z5W+U8*Z diff --git a/internal/ebpf/source.go b/internal/ebpf/source.go index e335732cd..69583b889 100644 --- a/internal/ebpf/source.go +++ b/internal/ebpf/source.go @@ -109,6 +109,11 @@ func (e *EventSource) Open(cfg *config.Config) error { } e.loader = ldr + if err := ldr.setEnabledTypes(&e.config.EventSource); err != nil { + _ = ldr.Close() + return err + } + rd, err := newRingReader(ldr.eventsMap()) if err != nil { _ = ldr.Close() diff --git a/internal/ebpf/source_test.go b/internal/ebpf/source_test.go index c57fbaf18..7d01d2d1a 100644 --- a/internal/ebpf/source_test.go +++ b/internal/ebpf/source_test.go @@ -32,6 +32,9 @@ import ( func testConfig() *config.Config { cfg := &config.Config{ForwardMode: true} + cfg.EventSource.EnableFileIOEvents = true + cfg.EventSource.EnableNetEvents = true + cfg.EventSource.EnableMemEvents = true cfg.EventSource.Init() return cfg } From 151dca5346807c4aacbb839e882835caa4fa1653 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Tue, 15 Sep 2026 10:33:32 +0200 Subject: [PATCH 39/65] feat(ebpf): Capture file, network, memory, and process-control syscalls Add one CO-RE program per family for openat/unlink/rename, connect/accept, mmap/process_vm_readv/writev, and kill/ptrace/prctl. Optional families follow the existing enable-fileio, enable-net, and enable-mem switches, process-control events stay on, and accept reads the peer address on syscall exit because the kernel fills it then. --- internal/ebpf/c/common/events.h | 29 +++++ internal/ebpf/c/ctl.bpf.c | 106 +++++++++++++++++ internal/ebpf/c/file.bpf.c | 158 +++++++++++++++++++++++++ internal/ebpf/c/mem.bpf.c | 81 +++++++++++++ internal/ebpf/c/net.bpf.c | 103 ++++++++++++++++ internal/ebpf/consumer.go | 21 ++++ internal/ebpf/ctl_bpfeb.go | 186 +++++++++++++++++++++++++++++ internal/ebpf/ctl_bpfeb.o | Bin 0 -> 47768 bytes internal/ebpf/ctl_bpfel.go | 186 +++++++++++++++++++++++++++++ internal/ebpf/ctl_bpfel.o | Bin 0 -> 47288 bytes internal/ebpf/doc.go | 9 +- internal/ebpf/events.go | 62 ++++++++-- internal/ebpf/file_bpfeb.go | 204 ++++++++++++++++++++++++++++++++ internal/ebpf/file_bpfeb.o | Bin 0 -> 77952 bytes internal/ebpf/file_bpfel.go | 204 ++++++++++++++++++++++++++++++++ internal/ebpf/file_bpfel.o | Bin 0 -> 77184 bytes internal/ebpf/generate.sh | 6 +- internal/ebpf/loader.go | 142 +++++++++++++++++++++- internal/ebpf/mem_bpfeb.go | 174 +++++++++++++++++++++++++++ internal/ebpf/mem_bpfeb.o | Bin 0 -> 32240 bytes internal/ebpf/mem_bpfel.go | 174 +++++++++++++++++++++++++++ internal/ebpf/mem_bpfel.o | Bin 0 -> 31952 bytes internal/ebpf/net.go | 85 +++++++++++++ internal/ebpf/net_bpfeb.go | 174 +++++++++++++++++++++++++++ internal/ebpf/net_bpfeb.o | Bin 0 -> 33648 bytes internal/ebpf/net_bpfel.go | 174 +++++++++++++++++++++++++++ internal/ebpf/net_bpfel.o | Bin 0 -> 33360 bytes internal/ebpf/source.go | 2 +- pkg/event/metainfo_linux.go | 41 ++----- pkg/event/params/names_linux.go | 4 + 30 files changed, 2278 insertions(+), 47 deletions(-) create mode 100644 internal/ebpf/c/ctl.bpf.c create mode 100644 internal/ebpf/c/file.bpf.c create mode 100644 internal/ebpf/c/mem.bpf.c create mode 100644 internal/ebpf/c/net.bpf.c create mode 100644 internal/ebpf/ctl_bpfeb.go create mode 100644 internal/ebpf/ctl_bpfeb.o create mode 100644 internal/ebpf/ctl_bpfel.go create mode 100644 internal/ebpf/ctl_bpfel.o create mode 100644 internal/ebpf/file_bpfeb.go create mode 100644 internal/ebpf/file_bpfeb.o create mode 100644 internal/ebpf/file_bpfel.go create mode 100644 internal/ebpf/file_bpfel.o create mode 100644 internal/ebpf/mem_bpfeb.go create mode 100644 internal/ebpf/mem_bpfeb.o create mode 100644 internal/ebpf/mem_bpfel.go create mode 100644 internal/ebpf/mem_bpfel.o create mode 100644 internal/ebpf/net.go create mode 100644 internal/ebpf/net_bpfeb.go create mode 100644 internal/ebpf/net_bpfeb.o create mode 100644 internal/ebpf/net_bpfel.go create mode 100644 internal/ebpf/net_bpfel.o diff --git a/internal/ebpf/c/common/events.h b/internal/ebpf/c/common/events.h index f44b374f8..912371a90 100644 --- a/internal/ebpf/c/common/events.h +++ b/internal/ebpf/c/common/events.h @@ -248,3 +248,32 @@ static __always_inline int store_scratch(struct scratch_value *val) return bpf_map_update_elem(&scratch, &key, val, BPF_ANY); } + +static __always_inline int submit_from_scratch(u32 type, long ret, u32 syscall_id) +{ + u64 key = bpf_get_current_pid_tgid(); + struct scratch_value *val; + struct syscall_event *e; + + if (!type_enabled(type)) { + bpf_map_delete_elem(&scratch, &key); + return 0; + } + + e = reserve_event(); + if (!e) { + bpf_map_delete_elem(&scratch, &key); + return 0; + } + + e->type = type; + e->syscall_id = syscall_id; + e->retval = ret; + fill_current_task(e); + val = bpf_map_lookup_elem(&scratch, &key); + if (val) + copy_scratch(e, val); + bpf_map_delete_elem(&scratch, &key); + bpf_ringbuf_submit(e, 0); + return 0; +} diff --git a/internal/ebpf/c/ctl.bpf.c b/internal/ebpf/c/ctl.bpf.c new file mode 100644 index 000000000..a237c8360 --- /dev/null +++ b/internal/ebpf/c/ctl.bpf.c @@ -0,0 +1,106 @@ +//go:build ignore + +#include "common/events.h" +#include "bpf_tracing.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +static __always_inline int handle_kill_enter(u64 pid, u64 sig) +{ + struct scratch_value *val; + + if (!type_enabled(EVT_TYPE_KILL)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = pid; + val->arg1 = sig; + store_scratch(val); + return 0; +} + +SEC("tp/syscalls/sys_enter_kill") +int handle_sys_enter_kill(struct trace_event_raw_sys_enter *ctx) +{ + return handle_kill_enter(ctx->args[0], ctx->args[1]); +} + +SEC("tp/syscalls/sys_exit_kill") +int handle_sys_exit_kill(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_KILL, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_tkill") +int handle_sys_enter_tkill(struct trace_event_raw_sys_enter *ctx) +{ + return handle_kill_enter(ctx->args[0], ctx->args[1]); +} + +SEC("tp/syscalls/sys_exit_tkill") +int handle_sys_exit_tkill(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_KILL, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_tgkill") +int handle_sys_enter_tgkill(struct trace_event_raw_sys_enter *ctx) +{ + return handle_kill_enter(ctx->args[0], ctx->args[2]); +} + +SEC("tp/syscalls/sys_exit_tgkill") +int handle_sys_exit_tgkill(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_KILL, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_ptrace") +int handle_sys_enter_ptrace(struct trace_event_raw_sys_enter *ctx) +{ + struct scratch_value *val; + + if (!type_enabled(EVT_TYPE_PTRACE)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = ctx->args[0]; /* request */ + val->arg1 = ctx->args[1]; /* pid */ + val->arg2 = ctx->args[2]; /* addr */ + val->arg3 = ctx->args[3]; /* data */ + store_scratch(val); + return 0; +} + +SEC("tp/syscalls/sys_exit_ptrace") +int handle_sys_exit_ptrace(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_PTRACE, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_prctl") +int handle_sys_enter_prctl(struct trace_event_raw_sys_enter *ctx) +{ + struct scratch_value *val; + + if (!type_enabled(EVT_TYPE_PRCTL)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = ctx->args[0]; + val->arg1 = ctx->args[1]; + val->arg2 = ctx->args[2]; + val->arg3 = ctx->args[3]; + val->flags = ctx->args[4]; + store_scratch(val); + return 0; +} + +SEC("tp/syscalls/sys_exit_prctl") +int handle_sys_exit_prctl(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_PRCTL, ctx->ret, (u32)ctx->id); +} diff --git a/internal/ebpf/c/file.bpf.c b/internal/ebpf/c/file.bpf.c new file mode 100644 index 000000000..fe991bbd6 --- /dev/null +++ b/internal/ebpf/c/file.bpf.c @@ -0,0 +1,158 @@ +//go:build ignore + +#include "common/events.h" +#include "bpf_tracing.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +static __always_inline int handle_openat_enter(s64 dirfd, const char *pathname, u64 flags, u64 mode) +{ + struct scratch_value *val; + + if (!type_enabled(EVT_TYPE_OPENAT)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = (u64)dirfd; + val->arg1 = mode; + val->flags = flags; + val->truncated |= read_user_str(val->filename, sizeof(val->filename), pathname); + store_scratch(val); + return 0; +} + +SEC("tp/syscalls/sys_enter_open") +int handle_sys_enter_open(struct trace_event_raw_sys_enter *ctx) +{ + return handle_openat_enter(-100 /* AT_FDCWD */, (const char *)ctx->args[0], ctx->args[1], ctx->args[2]); +} + +SEC("tp/syscalls/sys_exit_open") +int handle_sys_exit_open(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_OPENAT, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_openat") +int handle_sys_enter_openat(struct trace_event_raw_sys_enter *ctx) +{ + return handle_openat_enter((s64)ctx->args[0], (const char *)ctx->args[1], ctx->args[2], ctx->args[3]); +} + +SEC("tp/syscalls/sys_exit_openat") +int handle_sys_exit_openat(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_OPENAT, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_openat2") +int handle_sys_enter_openat2(struct trace_event_raw_sys_enter *ctx) +{ + struct open_how how = {}; + + if (ctx->args[2]) + bpf_probe_read_user(&how, sizeof(how), (const void *)ctx->args[2]); + return handle_openat_enter((s64)ctx->args[0], (const char *)ctx->args[1], how.flags, how.mode); +} + +SEC("tp/syscalls/sys_exit_openat2") +int handle_sys_exit_openat2(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_OPENAT, ctx->ret, (u32)ctx->id); +} + +static __always_inline int handle_unlink_enter(s64 dirfd, const char *pathname, u64 flags) +{ + struct scratch_value *val; + + if (!type_enabled(EVT_TYPE_UNLINK)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = (u64)dirfd; + val->flags = flags; + val->truncated |= read_user_str(val->filename, sizeof(val->filename), pathname); + store_scratch(val); + return 0; +} + +SEC("tp/syscalls/sys_enter_unlink") +int handle_sys_enter_unlink(struct trace_event_raw_sys_enter *ctx) +{ + return handle_unlink_enter(-100 /* AT_FDCWD */, (const char *)ctx->args[0], 0); +} + +SEC("tp/syscalls/sys_exit_unlink") +int handle_sys_exit_unlink(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_UNLINK, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_unlinkat") +int handle_sys_enter_unlinkat(struct trace_event_raw_sys_enter *ctx) +{ + return handle_unlink_enter((s64)ctx->args[0], (const char *)ctx->args[1], ctx->args[2]); +} + +SEC("tp/syscalls/sys_exit_unlinkat") +int handle_sys_exit_unlinkat(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_UNLINK, ctx->ret, (u32)ctx->id); +} + +static __always_inline int handle_rename_enter(s64 olddirfd, const char *oldpath, s64 newdirfd, const char *newpath, u64 flags) +{ + struct scratch_value *val; + + if (!type_enabled(EVT_TYPE_RENAME)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = (u64)olddirfd; + val->arg1 = (u64)newdirfd; + val->flags = flags; + val->truncated |= read_user_str(val->filename, sizeof(val->filename), oldpath); + if (read_user_str(val->filename2, sizeof(val->filename2), newpath)) + val->truncated |= TRUNC_FILENAME2; + store_scratch(val); + return 0; +} + +SEC("tp/syscalls/sys_enter_rename") +int handle_sys_enter_rename(struct trace_event_raw_sys_enter *ctx) +{ + return handle_rename_enter(-100 /* AT_FDCWD */, (const char *)ctx->args[0], -100, (const char *)ctx->args[1], 0); +} + +SEC("tp/syscalls/sys_exit_rename") +int handle_sys_exit_rename(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_RENAME, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_renameat") +int handle_sys_enter_renameat(struct trace_event_raw_sys_enter *ctx) +{ + return handle_rename_enter((s64)ctx->args[0], (const char *)ctx->args[1], (s64)ctx->args[2], (const char *)ctx->args[3], 0); +} + +SEC("tp/syscalls/sys_exit_renameat") +int handle_sys_exit_renameat(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_RENAME, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_renameat2") +int handle_sys_enter_renameat2(struct trace_event_raw_sys_enter *ctx) +{ + return handle_rename_enter((s64)ctx->args[0], (const char *)ctx->args[1], (s64)ctx->args[2], (const char *)ctx->args[3], ctx->args[4]); +} + +SEC("tp/syscalls/sys_exit_renameat2") +int handle_sys_exit_renameat2(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_RENAME, ctx->ret, (u32)ctx->id); +} diff --git a/internal/ebpf/c/mem.bpf.c b/internal/ebpf/c/mem.bpf.c new file mode 100644 index 000000000..de77d9c6e --- /dev/null +++ b/internal/ebpf/c/mem.bpf.c @@ -0,0 +1,81 @@ +//go:build ignore + +#include "common/events.h" +#include "bpf_tracing.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +struct iovec { + u64 iov_base; + u64 iov_len; +}; + +SEC("tp/syscalls/sys_enter_mmap") +int handle_sys_enter_mmap(struct trace_event_raw_sys_enter *ctx) +{ + struct scratch_value *val; + + if (!type_enabled(EVT_TYPE_MMAP)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = ctx->args[5]; /* offset */ + val->arg1 = ctx->args[1]; /* length */ + val->arg2 = ctx->args[2]; /* prot */ + val->arg3 = ctx->args[4]; /* fd */ + val->flags = ctx->args[3]; + store_scratch(val); + return 0; +} + +SEC("tp/syscalls/sys_exit_mmap") +int handle_sys_exit_mmap(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_MMAP, ctx->ret, (u32)ctx->id); +} + +static __always_inline int handle_process_vm_enter(u32 type, u64 pid, const void *rvec, u64 flags) +{ + struct scratch_value *val; + struct iovec iov = {}; + + if (!type_enabled(type)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = pid; + val->flags = flags; + if (rvec) { + bpf_probe_read_user(&iov, sizeof(iov), rvec); + val->arg2 = iov.iov_base; + val->arg3 = iov.iov_len; + } + store_scratch(val); + return 0; +} + +SEC("tp/syscalls/sys_enter_process_vm_readv") +int handle_sys_enter_process_vm_readv(struct trace_event_raw_sys_enter *ctx) +{ + return handle_process_vm_enter(EVT_TYPE_PROCESS_VM_READ, ctx->args[0], (const void *)ctx->args[3], ctx->args[5]); +} + +SEC("tp/syscalls/sys_exit_process_vm_readv") +int handle_sys_exit_process_vm_readv(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_PROCESS_VM_READ, ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_process_vm_writev") +int handle_sys_enter_process_vm_writev(struct trace_event_raw_sys_enter *ctx) +{ + return handle_process_vm_enter(EVT_TYPE_PROCESS_VM_WRITE, ctx->args[0], (const void *)ctx->args[3], ctx->args[5]); +} + +SEC("tp/syscalls/sys_exit_process_vm_writev") +int handle_sys_exit_process_vm_writev(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_PROCESS_VM_WRITE, ctx->ret, (u32)ctx->id); +} diff --git a/internal/ebpf/c/net.bpf.c b/internal/ebpf/c/net.bpf.c new file mode 100644 index 000000000..8f4269daa --- /dev/null +++ b/internal/ebpf/c/net.bpf.c @@ -0,0 +1,103 @@ +//go:build ignore + +#include "common/events.h" +#include "bpf_tracing.h" + +char LICENSE[] SEC("license") = "Dual MIT/GPL"; + +/* Copy exactly addrlen bytes: a fixed-size read past the caller's sockaddr + * can cross into an unmapped page and fail wholesale, losing the address. + */ +static __always_inline void read_sockaddr(struct scratch_value *val, const void *addr, u64 addrlen) +{ + u64 len = addrlen; + + if (len > sizeof(val->filename2)) { + len = sizeof(val->filename2); + val->truncated |= TRUNC_FILENAME2; + } + if (addr && len) + bpf_probe_read_user(val->filename2, len, addr); +} + +SEC("tp/syscalls/sys_enter_connect") +int handle_sys_enter_connect(struct trace_event_raw_sys_enter *ctx) +{ + struct scratch_value *val; + + if (!type_enabled(EVT_TYPE_CONNECT)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = ctx->args[0]; + val->arg1 = ctx->args[2]; + read_sockaddr(val, (const void *)ctx->args[1], ctx->args[2]); + store_scratch(val); + return 0; +} + +SEC("tp/syscalls/sys_exit_connect") +int handle_sys_exit_connect(struct trace_event_raw_sys_exit *ctx) +{ + return submit_from_scratch(EVT_TYPE_CONNECT, ctx->ret, (u32)ctx->id); +} + +static __always_inline int handle_accept_enter(u64 fd, const void *addr, const void *addrlen, u64 flags) +{ + struct scratch_value *val; + + if (!type_enabled(EVT_TYPE_ACCEPT)) + return 0; + val = borrow_scratch(); + if (!val) + return 0; + val->arg0 = fd; + val->arg1 = (u64)addrlen; + val->arg2 = (u64)addr; + val->flags = flags; + store_scratch(val); + return 0; +} + +/* addrlen is value-result: the kernel writes the peer address and its actual + * size only once accept returns, so the sockaddr is copied at exit. + */ +static __always_inline int handle_accept_exit(long ret, u32 syscall_id) +{ + u64 key = bpf_get_current_pid_tgid(); + struct scratch_value *val; + u32 addrlen = 0; + + val = bpf_map_lookup_elem(&scratch, &key); + if (val && val->arg2 && ret >= 0) { + if (val->arg1) + bpf_probe_read_user(&addrlen, sizeof(addrlen), (const void *)val->arg1); + read_sockaddr(val, (const void *)val->arg2, addrlen); + } + return submit_from_scratch(EVT_TYPE_ACCEPT, ret, syscall_id); +} + +SEC("tp/syscalls/sys_enter_accept") +int handle_sys_enter_accept(struct trace_event_raw_sys_enter *ctx) +{ + return handle_accept_enter(ctx->args[0], (const void *)ctx->args[1], (const void *)ctx->args[2], 0); +} + +SEC("tp/syscalls/sys_exit_accept") +int handle_sys_exit_accept(struct trace_event_raw_sys_exit *ctx) +{ + return handle_accept_exit(ctx->ret, (u32)ctx->id); +} + +SEC("tp/syscalls/sys_enter_accept4") +int handle_sys_enter_accept4(struct trace_event_raw_sys_enter *ctx) +{ + return handle_accept_enter(ctx->args[0], (const void *)ctx->args[1], (const void *)ctx->args[2], ctx->args[3]); +} + +SEC("tp/syscalls/sys_exit_accept4") +int handle_sys_exit_accept4(struct trace_event_raw_sys_exit *ctx) +{ + return handle_accept_exit(ctx->ret, (u32)ctx->id); +} diff --git a/internal/ebpf/consumer.go b/internal/ebpf/consumer.go index ca1d022cf..1c5e57168 100644 --- a/internal/ebpf/consumer.go +++ b/internal/ebpf/consumer.go @@ -27,6 +27,7 @@ import ( "github.com/rabbitstack/fibratus/pkg/event/params" "github.com/rabbitstack/fibratus/pkg/ps" pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/rabbitstack/fibratus/pkg/util/va" ) var ( @@ -62,6 +63,17 @@ func applyProcessState(psnap ps.Snapshotter, evt *event.Event) { evt.PS = existing _ = psnap.AddThread(evt) } + case evt.Type == event.Mmap && succeeded(evt): + ok, existing := psnap.Find(evt.PID) + if ok && existing != nil { + evt.PS = existing + existing.AddMmap(pstypes.Mmap{ + BaseAddress: va.Address(evt.GetParamAsUint64(params.MemBaseAddress)), + Size: evt.GetParamAsUint64(params.MemRegionSize), + Protection: evt.GetParamAsUint32(params.MemProtect), + Type: mmapKind(evt.GetParamAsUint64(params.MmapFlags)), + }) + } case evt.Type == event.Exit: ok, existing := psnap.Find(evt.PID) if ok { @@ -169,6 +181,15 @@ func succeeded(evt *event.Event) bool { return ret >= 0 } +const mapAnonymous = 0x20 + +func mmapKind(flags uint64) string { + if flags&mapAnonymous != 0 { + return "anonymous" + } + return "file" +} + func enrichEvent(evt *event.Event) { if evt == nil { return diff --git a/internal/ebpf/ctl_bpfeb.go b/internal/ebpf/ctl_bpfeb.go new file mode 100644 index 000000000..7771745ab --- /dev/null +++ b/internal/ebpf/ctl_bpfeb.go @@ -0,0 +1,186 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (mips || mips64 || ppc64 || s390x) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type ctlScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 +} + +// loadCtl returns the embedded CollectionSpec for ctl. +func loadCtl() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_CtlBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load ctl: %w", err) + } + + return spec, err +} + +// loadCtlObjects loads ctl and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *ctlObjects +// *ctlPrograms +// *ctlMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadCtlObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadCtl() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// ctlSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type ctlSpecs struct { + ctlProgramSpecs + ctlMapSpecs + ctlVariableSpecs +} + +// ctlProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type ctlProgramSpecs struct { + HandleSysEnterKill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_kill"` + HandleSysEnterPrctl *ebpf.ProgramSpec `ebpf:"handle_sys_enter_prctl"` + HandleSysEnterPtrace *ebpf.ProgramSpec `ebpf:"handle_sys_enter_ptrace"` + HandleSysEnterTgkill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_tgkill"` + HandleSysEnterTkill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_tkill"` + HandleSysExitKill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_kill"` + HandleSysExitPrctl *ebpf.ProgramSpec `ebpf:"handle_sys_exit_prctl"` + HandleSysExitPtrace *ebpf.ProgramSpec `ebpf:"handle_sys_exit_ptrace"` + HandleSysExitTgkill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_tgkill"` + HandleSysExitTkill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_tkill"` +} + +// ctlMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type ctlMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` +} + +// ctlVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type ctlVariableSpecs struct { +} + +// ctlObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type ctlObjects struct { + ctlPrograms + ctlMaps + ctlVariables +} + +func (o *ctlObjects) Close() error { + return _CtlClose( + &o.ctlPrograms, + &o.ctlMaps, + ) +} + +// ctlMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type ctlMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` +} + +func (m *ctlMaps) Close() error { + return _CtlClose( + m.DropCount, + m.Enabled, + m.Events, + m.Scratch, + m.ScratchHeap, + ) +} + +// ctlVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type ctlVariables struct { +} + +// ctlPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type ctlPrograms struct { + HandleSysEnterKill *ebpf.Program `ebpf:"handle_sys_enter_kill"` + HandleSysEnterPrctl *ebpf.Program `ebpf:"handle_sys_enter_prctl"` + HandleSysEnterPtrace *ebpf.Program `ebpf:"handle_sys_enter_ptrace"` + HandleSysEnterTgkill *ebpf.Program `ebpf:"handle_sys_enter_tgkill"` + HandleSysEnterTkill *ebpf.Program `ebpf:"handle_sys_enter_tkill"` + HandleSysExitKill *ebpf.Program `ebpf:"handle_sys_exit_kill"` + HandleSysExitPrctl *ebpf.Program `ebpf:"handle_sys_exit_prctl"` + HandleSysExitPtrace *ebpf.Program `ebpf:"handle_sys_exit_ptrace"` + HandleSysExitTgkill *ebpf.Program `ebpf:"handle_sys_exit_tgkill"` + HandleSysExitTkill *ebpf.Program `ebpf:"handle_sys_exit_tkill"` +} + +func (p *ctlPrograms) Close() error { + return _CtlClose( + p.HandleSysEnterKill, + p.HandleSysEnterPrctl, + p.HandleSysEnterPtrace, + p.HandleSysEnterTgkill, + p.HandleSysEnterTkill, + p.HandleSysExitKill, + p.HandleSysExitPrctl, + p.HandleSysExitPtrace, + p.HandleSysExitTgkill, + p.HandleSysExitTkill, + ) +} + +func _CtlClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed ctl_bpfeb.o +var _CtlBytes []byte diff --git a/internal/ebpf/ctl_bpfeb.o b/internal/ebpf/ctl_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..d6052ea8643f8f168329f571194e3a8d8027ffc2 GIT binary patch literal 47768 zcmeI53yfpedEXDonIU(jU5#Qr=trWviYjyE^@_6(i7VSOCGENnI?8i1OYrL+?Z_)b=ssAix}8}Z6r(@6jQ({*hX!qZ4j_^ z(vF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NXjabvWldv zA}On<3MX8_t(k9 z7(Oe9tu-TAlvf23htM@_+e+^$g=< zKN9(6*oWjFtHBS4eXrFy-Demd6!|;&7?%IG3vP-~$zRrTIl}nJ-~2hwA^9I%lfdr% zT<79v7+>(aIEUo_`K$!M5!OF^PdJP(`Cr93B>$VYB=Ys^Z+;5_hUH(e(M_-ZVK^`U z$Q;59$^SjuE`BWQwD%dthapnLN0@FFZtwU!%ipVi_}+6EAN7wML4+as2Z2lMy8WL* zm?8Q9O&7gi|M0zLFaPLM2s9-B_oZC|{`>jX62=Ea<^9iL`4?^Ie*fP@4&$T#QTh9) zA^9I|y71Sle^kcxu>9AUUlA(d@T#{xy!_42!7?QOQ!N)fR(IO_4C9O8XK)V7e}^%o z9VLJHt}90vAN4m+;2e_whqCa)alQJRk0Zd4{J#)LY#c?Ll7IOAyO)3DHQ2-a!}$p& zIdaoZd+);&d*Oxe#yKp0Q3BvtbJF_^^M@h&OZW)m_X0RaZpZ0uGs?r8zoWkZzhU*S zF?P45~`b+-yh7{DxKl0tB s*Us8@ufb#Rc)3EBa{7l?-ssQ5BkFth-Jh*Hw|#F*;(UaDVgAYg2bE*hUH||9 literal 0 HcmV?d00001 diff --git a/internal/ebpf/ctl_bpfel.go b/internal/ebpf/ctl_bpfel.go new file mode 100644 index 000000000..cf523a9f9 --- /dev/null +++ b/internal/ebpf/ctl_bpfel.go @@ -0,0 +1,186 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type ctlScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 +} + +// loadCtl returns the embedded CollectionSpec for ctl. +func loadCtl() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_CtlBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load ctl: %w", err) + } + + return spec, err +} + +// loadCtlObjects loads ctl and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *ctlObjects +// *ctlPrograms +// *ctlMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadCtlObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadCtl() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// ctlSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type ctlSpecs struct { + ctlProgramSpecs + ctlMapSpecs + ctlVariableSpecs +} + +// ctlProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type ctlProgramSpecs struct { + HandleSysEnterKill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_kill"` + HandleSysEnterPrctl *ebpf.ProgramSpec `ebpf:"handle_sys_enter_prctl"` + HandleSysEnterPtrace *ebpf.ProgramSpec `ebpf:"handle_sys_enter_ptrace"` + HandleSysEnterTgkill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_tgkill"` + HandleSysEnterTkill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_tkill"` + HandleSysExitKill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_kill"` + HandleSysExitPrctl *ebpf.ProgramSpec `ebpf:"handle_sys_exit_prctl"` + HandleSysExitPtrace *ebpf.ProgramSpec `ebpf:"handle_sys_exit_ptrace"` + HandleSysExitTgkill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_tgkill"` + HandleSysExitTkill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_tkill"` +} + +// ctlMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type ctlMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` +} + +// ctlVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type ctlVariableSpecs struct { +} + +// ctlObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type ctlObjects struct { + ctlPrograms + ctlMaps + ctlVariables +} + +func (o *ctlObjects) Close() error { + return _CtlClose( + &o.ctlPrograms, + &o.ctlMaps, + ) +} + +// ctlMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type ctlMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` +} + +func (m *ctlMaps) Close() error { + return _CtlClose( + m.DropCount, + m.Enabled, + m.Events, + m.Scratch, + m.ScratchHeap, + ) +} + +// ctlVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type ctlVariables struct { +} + +// ctlPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type ctlPrograms struct { + HandleSysEnterKill *ebpf.Program `ebpf:"handle_sys_enter_kill"` + HandleSysEnterPrctl *ebpf.Program `ebpf:"handle_sys_enter_prctl"` + HandleSysEnterPtrace *ebpf.Program `ebpf:"handle_sys_enter_ptrace"` + HandleSysEnterTgkill *ebpf.Program `ebpf:"handle_sys_enter_tgkill"` + HandleSysEnterTkill *ebpf.Program `ebpf:"handle_sys_enter_tkill"` + HandleSysExitKill *ebpf.Program `ebpf:"handle_sys_exit_kill"` + HandleSysExitPrctl *ebpf.Program `ebpf:"handle_sys_exit_prctl"` + HandleSysExitPtrace *ebpf.Program `ebpf:"handle_sys_exit_ptrace"` + HandleSysExitTgkill *ebpf.Program `ebpf:"handle_sys_exit_tgkill"` + HandleSysExitTkill *ebpf.Program `ebpf:"handle_sys_exit_tkill"` +} + +func (p *ctlPrograms) Close() error { + return _CtlClose( + p.HandleSysEnterKill, + p.HandleSysEnterPrctl, + p.HandleSysEnterPtrace, + p.HandleSysEnterTgkill, + p.HandleSysEnterTkill, + p.HandleSysExitKill, + p.HandleSysExitPrctl, + p.HandleSysExitPtrace, + p.HandleSysExitTgkill, + p.HandleSysExitTkill, + ) +} + +func _CtlClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed ctl_bpfel.o +var _CtlBytes []byte diff --git a/internal/ebpf/ctl_bpfel.o b/internal/ebpf/ctl_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..fdbcf24fe6cd34db9a4bd6986ddbbf4d34cf97fe GIT binary patch literal 47288 zcmeI54{W37ecvBa=R4k6KFf|zQEIPwou&@Yx!h6r$EF>}q5qsir$ z3f4)Cq_auWL%G)NxU^l>&e4dVXq42gi8aVH)SEdpzzK`dvRzSVfID!jw`p53XluJE z!`cy8Ht+j;p6^4x`bj!Faq0vJAKc6D^LhUNf8Kw3@2Ah6dmtK#7;hrxf15seS7W-X zeS6AUQ|7%0S$X%ErON1t)mIRC7`DkD>AoQjm%nPA&4DP=c;k&X##G`z2XAqDn7LkM zK5HXISt#U8lCGYt$BXmD;4PP#e@GYMol6mZ>Fbk(#GwsTpdTnxZDD32K}gP{*hvPD?ST zc`N4fey1`{596pFdTZnF@}!IR%D#Sl8Bnh{G+(4v-tF?MjJf>#`E1$w^Y-VH9mdAb zr-vi1Lg9J2wa2_1LK&|zAG71&m4mLpZnUuQkXMj=8OJLU7)Hwfvp9UaJ-q*rIGf2Y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v)6*m+&6}J?(6?YVGD()(d@exn2{)*#@lZw-dvxBio1$q@&RfXsjtKzQyf>ERGe0vRa{hDR$N!yP~249 zQruSDQM{?Rt2lO()IL;y#c{<+#c9P^#YM$s#dXCE#ZAR6#cjnM#hZ$|ieqw7AFjXR zxZ-(zy99d{ZFQ=VO6IyB>=FU5d{so(i#CA1^9?UhxZxUsU|E;y((p zoR7b*_%9THTk)_I3dZl}Hz__H;*TKQ{faLro>IK1_<6;jemMKcqo4iUV?UM4f95AI zJapb1Uo4at&GGrd%<+3KJaAl~|3P2>fpGVUxbWAUcYaOKewa?u+405e{&(y4_!8i* zvD~*EZK~mD_DhiVdz8Dz>U)PHxzAYc9V_G?j%E{cU!>eSGv^2-e|e;@ z^S=zY-SS`M{opsN|L-FHZuuvee;)o~r2Z04=RdVa`>*hP{mts1-=qDPcB#KS($x9m zvkAM_e}m^wZ&v^K9{I2BQvYjq$^TKzKP0hZ{;b~$N0_pjoWA_d7w=XgzO-w~J5Yl! zI7_(yjA}Ut?al*{T24`OBKNTmP>x|E<8ql>Fruh|d38$b9JB8*}ig;pmwq i?ti|V-b0u5@1p+rx5K1s&MD3eC7yJN&!4v+&Ho4MJ_Eo2 literal 0 HcmV?d00001 diff --git a/internal/ebpf/doc.go b/internal/ebpf/doc.go index 8d281edf7..d283bd6b7 100644 --- a/internal/ebpf/doc.go +++ b/internal/ebpf/doc.go @@ -16,8 +16,9 @@ * limitations under the License. */ -// Package ebpf hosts the Linux eBPF instrumentation backend. The process -// event source loads CO-RE programs, captures execve/exit/clone, and -// reconciles live events against an iter/task baseline. The spike -// subdirectory remains as a feasibility prototype. +// Package ebpf hosts the Linux eBPF instrumentation backend. The event +// source loads CO-RE programs, captures process, file, network, memory, +// and process-control syscalls, and reconciles live events against an +// iter/task baseline. The spike subdirectory remains as a feasibility +// prototype. package ebpf diff --git a/internal/ebpf/events.go b/internal/ebpf/events.go index d47f6259b..c432d9b79 100644 --- a/internal/ebpf/events.go +++ b/internal/ebpf/events.go @@ -78,16 +78,11 @@ func (r rawEvent) filename() string { return cString(r.Filename[:]) } func (r rawEvent) filename2() string { return cString(r.Filename2[:]) } func (r rawEvent) eventType() event.Type { - switch r.Type { - case uint32(event.Execve): - return event.Execve - case uint32(event.Exit): - return event.Exit - case uint32(event.Clone): - return event.Clone - default: - return event.UnknownType + typ := event.Type(r.Type) + if typ.Exists() { + return typ } + return event.UnknownType } func (r rawEvent) processID() uint64 { @@ -137,6 +132,55 @@ func (r rawEvent) toEvent() *event.Event { evt.Params.Append(params.ExitStatus, params.Int64, r.Retval) case event.Clone: evt.Params.Append(params.CloneFlags, params.Uint64, r.Flags) + case event.Openat: + evt.Params.Append(params.DirFD, params.Int64, int64(r.Arg0)) + evt.Params.Append(params.FilePath, params.Path, r.filename()) + evt.Params.Append(params.FileFlags, params.Uint64, r.Flags) + evt.Params.Append(params.FileMode, params.Uint64, r.Arg1) + if r.Retval >= 0 { + evt.Params.Append(params.FD, params.Int64, r.Retval) + } + case event.Unlink: + evt.Params.Append(params.DirFD, params.Int64, int64(r.Arg0)) + evt.Params.Append(params.FilePath, params.Path, r.filename()) + evt.Params.Append(params.FileFlags, params.Uint64, r.Flags) + case event.Rename: + evt.Params.Append(params.DirFD, params.Int64, int64(r.Arg0)) + evt.Params.Append(params.NewDirFD, params.Int64, int64(r.Arg1)) + evt.Params.Append(params.FilePath, params.Path, r.filename()) + evt.Params.Append(params.FileNewPath, params.Path, r.filename2()) + evt.Params.Append(params.FileFlags, params.Uint64, r.Flags) + case event.Connect, event.Accept: + appendSockParams(evt, r) + case event.Mmap: + addr := uint64(0) + if r.Retval >= 0 { + addr = uint64(r.Retval) + } + evt.Params.Append(params.MemBaseAddress, params.Address, addr) + evt.Params.Append(params.MemRegionSize, params.Uint64, r.Arg1) + evt.Params.Append(params.MemProtect, params.Uint32, uint32(r.Arg2)) + evt.Params.Append(params.MmapFlags, params.Uint64, r.Flags) + evt.Params.Append(params.FD, params.Int64, int64(r.Arg3)) + evt.Params.Append(params.MmapOffset, params.Uint64, r.Arg0) + case event.ProcessVMRead, event.ProcessVMWrite: + evt.Params.Append(params.TargetProcessID, params.PID, uint64(uint32(r.Arg0))) + evt.Params.Append(params.MemBaseAddress, params.Address, r.Arg2) + evt.Params.Append(params.MemRegionSize, params.Uint64, r.Arg3) + evt.Params.Append(params.MmapFlags, params.Uint64, r.Flags) + case event.Kill: + evt.Params.Append(params.TargetProcessID, params.PID, uint64(uint32(r.Arg0))) + evt.Params.Append(params.Signal, params.Int32, int32(r.Arg1)) + case event.Ptrace: + evt.Params.Append(params.PtraceRequest, params.Int64, int64(r.Arg0)) + evt.Params.Append(params.TargetProcessID, params.PID, uint64(uint32(r.Arg1))) + evt.Params.Append(params.PtraceAddr, params.Address, r.Arg2) + evt.Params.Append(params.PtraceData, params.Uint64, r.Arg3) + case event.Prctl: + evt.Params.Append(params.PrctlOption, params.Int64, int64(r.Arg0)) + } + if r.Truncated != 0 { + evt.Params.Append(params.Truncated, params.Uint32, r.Truncated) } return evt } diff --git a/internal/ebpf/file_bpfeb.go b/internal/ebpf/file_bpfeb.go new file mode 100644 index 000000000..b97645487 --- /dev/null +++ b/internal/ebpf/file_bpfeb.go @@ -0,0 +1,204 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (mips || mips64 || ppc64 || s390x) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type fileScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 +} + +// loadFile returns the embedded CollectionSpec for file. +func loadFile() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_FileBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load file: %w", err) + } + + return spec, err +} + +// loadFileObjects loads file and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *fileObjects +// *filePrograms +// *fileMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadFileObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadFile() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// fileSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type fileSpecs struct { + fileProgramSpecs + fileMapSpecs + fileVariableSpecs +} + +// fileProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type fileProgramSpecs struct { + HandleSysEnterOpen *ebpf.ProgramSpec `ebpf:"handle_sys_enter_open"` + HandleSysEnterOpenat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_openat"` + HandleSysEnterOpenat2 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_openat2"` + HandleSysEnterRename *ebpf.ProgramSpec `ebpf:"handle_sys_enter_rename"` + HandleSysEnterRenameat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_renameat"` + HandleSysEnterRenameat2 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_renameat2"` + HandleSysEnterUnlink *ebpf.ProgramSpec `ebpf:"handle_sys_enter_unlink"` + HandleSysEnterUnlinkat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_unlinkat"` + HandleSysExitOpen *ebpf.ProgramSpec `ebpf:"handle_sys_exit_open"` + HandleSysExitOpenat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_openat"` + HandleSysExitOpenat2 *ebpf.ProgramSpec `ebpf:"handle_sys_exit_openat2"` + HandleSysExitRename *ebpf.ProgramSpec `ebpf:"handle_sys_exit_rename"` + HandleSysExitRenameat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_renameat"` + HandleSysExitRenameat2 *ebpf.ProgramSpec `ebpf:"handle_sys_exit_renameat2"` + HandleSysExitUnlink *ebpf.ProgramSpec `ebpf:"handle_sys_exit_unlink"` + HandleSysExitUnlinkat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_unlinkat"` +} + +// fileMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type fileMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` +} + +// fileVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type fileVariableSpecs struct { +} + +// fileObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type fileObjects struct { + filePrograms + fileMaps + fileVariables +} + +func (o *fileObjects) Close() error { + return _FileClose( + &o.filePrograms, + &o.fileMaps, + ) +} + +// fileMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type fileMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` +} + +func (m *fileMaps) Close() error { + return _FileClose( + m.DropCount, + m.Enabled, + m.Events, + m.Scratch, + m.ScratchHeap, + ) +} + +// fileVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type fileVariables struct { +} + +// filePrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type filePrograms struct { + HandleSysEnterOpen *ebpf.Program `ebpf:"handle_sys_enter_open"` + HandleSysEnterOpenat *ebpf.Program `ebpf:"handle_sys_enter_openat"` + HandleSysEnterOpenat2 *ebpf.Program `ebpf:"handle_sys_enter_openat2"` + HandleSysEnterRename *ebpf.Program `ebpf:"handle_sys_enter_rename"` + HandleSysEnterRenameat *ebpf.Program `ebpf:"handle_sys_enter_renameat"` + HandleSysEnterRenameat2 *ebpf.Program `ebpf:"handle_sys_enter_renameat2"` + HandleSysEnterUnlink *ebpf.Program `ebpf:"handle_sys_enter_unlink"` + HandleSysEnterUnlinkat *ebpf.Program `ebpf:"handle_sys_enter_unlinkat"` + HandleSysExitOpen *ebpf.Program `ebpf:"handle_sys_exit_open"` + HandleSysExitOpenat *ebpf.Program `ebpf:"handle_sys_exit_openat"` + HandleSysExitOpenat2 *ebpf.Program `ebpf:"handle_sys_exit_openat2"` + HandleSysExitRename *ebpf.Program `ebpf:"handle_sys_exit_rename"` + HandleSysExitRenameat *ebpf.Program `ebpf:"handle_sys_exit_renameat"` + HandleSysExitRenameat2 *ebpf.Program `ebpf:"handle_sys_exit_renameat2"` + HandleSysExitUnlink *ebpf.Program `ebpf:"handle_sys_exit_unlink"` + HandleSysExitUnlinkat *ebpf.Program `ebpf:"handle_sys_exit_unlinkat"` +} + +func (p *filePrograms) Close() error { + return _FileClose( + p.HandleSysEnterOpen, + p.HandleSysEnterOpenat, + p.HandleSysEnterOpenat2, + p.HandleSysEnterRename, + p.HandleSysEnterRenameat, + p.HandleSysEnterRenameat2, + p.HandleSysEnterUnlink, + p.HandleSysEnterUnlinkat, + p.HandleSysExitOpen, + p.HandleSysExitOpenat, + p.HandleSysExitOpenat2, + p.HandleSysExitRename, + p.HandleSysExitRenameat, + p.HandleSysExitRenameat2, + p.HandleSysExitUnlink, + p.HandleSysExitUnlinkat, + ) +} + +func _FileClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed file_bpfeb.o +var _FileBytes []byte diff --git a/internal/ebpf/file_bpfeb.o b/internal/ebpf/file_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..98aa27a69d40299f57d60ebff3e2460160c63b0d GIT binary patch literal 77952 zc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MojE;MX@HJ|*rOC*j?K4PVuUls5hZZLa+E F{{i1B3C{ok literal 0 HcmV?d00001 diff --git a/internal/ebpf/file_bpfel.go b/internal/ebpf/file_bpfel.go new file mode 100644 index 000000000..39ff6f15d --- /dev/null +++ b/internal/ebpf/file_bpfel.go @@ -0,0 +1,204 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type fileScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 +} + +// loadFile returns the embedded CollectionSpec for file. +func loadFile() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_FileBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load file: %w", err) + } + + return spec, err +} + +// loadFileObjects loads file and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *fileObjects +// *filePrograms +// *fileMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadFileObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadFile() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// fileSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type fileSpecs struct { + fileProgramSpecs + fileMapSpecs + fileVariableSpecs +} + +// fileProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type fileProgramSpecs struct { + HandleSysEnterOpen *ebpf.ProgramSpec `ebpf:"handle_sys_enter_open"` + HandleSysEnterOpenat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_openat"` + HandleSysEnterOpenat2 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_openat2"` + HandleSysEnterRename *ebpf.ProgramSpec `ebpf:"handle_sys_enter_rename"` + HandleSysEnterRenameat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_renameat"` + HandleSysEnterRenameat2 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_renameat2"` + HandleSysEnterUnlink *ebpf.ProgramSpec `ebpf:"handle_sys_enter_unlink"` + HandleSysEnterUnlinkat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_unlinkat"` + HandleSysExitOpen *ebpf.ProgramSpec `ebpf:"handle_sys_exit_open"` + HandleSysExitOpenat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_openat"` + HandleSysExitOpenat2 *ebpf.ProgramSpec `ebpf:"handle_sys_exit_openat2"` + HandleSysExitRename *ebpf.ProgramSpec `ebpf:"handle_sys_exit_rename"` + HandleSysExitRenameat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_renameat"` + HandleSysExitRenameat2 *ebpf.ProgramSpec `ebpf:"handle_sys_exit_renameat2"` + HandleSysExitUnlink *ebpf.ProgramSpec `ebpf:"handle_sys_exit_unlink"` + HandleSysExitUnlinkat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_unlinkat"` +} + +// fileMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type fileMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` +} + +// fileVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type fileVariableSpecs struct { +} + +// fileObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type fileObjects struct { + filePrograms + fileMaps + fileVariables +} + +func (o *fileObjects) Close() error { + return _FileClose( + &o.filePrograms, + &o.fileMaps, + ) +} + +// fileMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type fileMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` +} + +func (m *fileMaps) Close() error { + return _FileClose( + m.DropCount, + m.Enabled, + m.Events, + m.Scratch, + m.ScratchHeap, + ) +} + +// fileVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type fileVariables struct { +} + +// filePrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type filePrograms struct { + HandleSysEnterOpen *ebpf.Program `ebpf:"handle_sys_enter_open"` + HandleSysEnterOpenat *ebpf.Program `ebpf:"handle_sys_enter_openat"` + HandleSysEnterOpenat2 *ebpf.Program `ebpf:"handle_sys_enter_openat2"` + HandleSysEnterRename *ebpf.Program `ebpf:"handle_sys_enter_rename"` + HandleSysEnterRenameat *ebpf.Program `ebpf:"handle_sys_enter_renameat"` + HandleSysEnterRenameat2 *ebpf.Program `ebpf:"handle_sys_enter_renameat2"` + HandleSysEnterUnlink *ebpf.Program `ebpf:"handle_sys_enter_unlink"` + HandleSysEnterUnlinkat *ebpf.Program `ebpf:"handle_sys_enter_unlinkat"` + HandleSysExitOpen *ebpf.Program `ebpf:"handle_sys_exit_open"` + HandleSysExitOpenat *ebpf.Program `ebpf:"handle_sys_exit_openat"` + HandleSysExitOpenat2 *ebpf.Program `ebpf:"handle_sys_exit_openat2"` + HandleSysExitRename *ebpf.Program `ebpf:"handle_sys_exit_rename"` + HandleSysExitRenameat *ebpf.Program `ebpf:"handle_sys_exit_renameat"` + HandleSysExitRenameat2 *ebpf.Program `ebpf:"handle_sys_exit_renameat2"` + HandleSysExitUnlink *ebpf.Program `ebpf:"handle_sys_exit_unlink"` + HandleSysExitUnlinkat *ebpf.Program `ebpf:"handle_sys_exit_unlinkat"` +} + +func (p *filePrograms) Close() error { + return _FileClose( + p.HandleSysEnterOpen, + p.HandleSysEnterOpenat, + p.HandleSysEnterOpenat2, + p.HandleSysEnterRename, + p.HandleSysEnterRenameat, + p.HandleSysEnterRenameat2, + p.HandleSysEnterUnlink, + p.HandleSysEnterUnlinkat, + p.HandleSysExitOpen, + p.HandleSysExitOpenat, + p.HandleSysExitOpenat2, + p.HandleSysExitRename, + p.HandleSysExitRenameat, + p.HandleSysExitRenameat2, + p.HandleSysExitUnlink, + p.HandleSysExitUnlinkat, + ) +} + +func _FileClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed file_bpfel.o +var _FileBytes []byte diff --git a/internal/ebpf/file_bpfel.o b/internal/ebpf/file_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..f1c850d6b47d51b3c4a3ac4ef5e8475c0a355b62 GIT binary patch literal 77184 zcmeI53vgrCdEYO{ePCBBi7RQjlqE-ZWm|^i)e8HN1j+UWTJ73UvX)>y63CVfP$aaV z#3f;py8;BK#!MXsqdGC;%3RoS9m;YNq;*nGt3*gAjW`oE#nf(wle#HVD=FhT8BCo? z*-XYkIMBfA_oJ9qA@# zJbqd})#(xBzTJDuxPJuU_Jt-4m!4cV>Ae&-=#4%5`qF=ShmH5h4x8|H@546T`G}Ov z^GfqRbObsC4MRO>+ayq$Ux&7!YtSZi721HVK}M!T&;ThKLV6S@j*Kv$r3=rXhhU4mAj3(yL*3@t$O z&>S=aO+k~;1T+qfL8H(J)Q65hhpaAI_u}(*{FR2o#$Ctx=VUyWh7EfAcJ4L@FOOQ@ zDgK(nOFC-g_~lvauH$`1-NjA*ynXs9f6BUz=4^Q$u*LAk<}GWyD`YS2{@%v@%VV0F zq^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>+SURTJ-C^bMF{?*_&?pdkSNcwkbElQt ztw^Da>oF@w;p!B4*y>&B!*|#utlkcmM6AP6=g>KD4u^3NOW$q_ZbS-h^oW(i&?pcp z*_u#yLM1mF+Z{-5)}eFY93)%gb65J9Ex3`}ElIHr93u1Q}B`AV>=ii z7_oD{kIroob3=$=)b44vW!#NHf{_E~+Lo~?j5*VeXe-9jM((t7hn3r{NShkZV?gLp zAoK{(De$n>C=e>`Z<3S|iv#Hh>mnUt4rGKJw*6~W28LlBA?84$8kGTJJvs-@K}L%4 ziKP!mHK{wG64S8cX;iYrZ3|=T-^j<#LH!-8&D-_Yg^c6p^`bbiS=X+EvhF*&PUa|1 z>`<@6g4>@<%Lwd$|Ssb2Xn^r*jvc#mU7VLIPhB?UjG*M{R)Ds((#_^~yhv{4+Kg)BpSAnDhVo7VRJTF+`*Z)5V9c z_a|Gl|5A_o@9&ZSzuYSS`)v-dRsUb!BLCGM^}n`9{uycfUhO~fsLkJhjru<(k$bg& zbj`*O_WyM~@_*|V`NuwFK*{lAMoQ)WJjrvbX z{9g56S+ntj^}nG<{>Qe+KQn3LzgGRDTjalv{4+KgQ~v{U%=P~nj6XWfz2wt2qRyGY zP1`EC&5MJ&ar_M8F9ZY2vCH2%UndbcP4!zx{DXMk+l8m@@b*jmUhSX!QyU|Lh&unj zO?H>R>wmRLz4E{QIUDgH?%!Cl_jTN{s@n8k`7a~?IPMQ={%@C^^Dj#K51#(+w0MbP@Ruax>r5}UTf?^~w|u46RbPs{G|A3==&4}*V!`Tzg` literal 0 HcmV?d00001 diff --git a/internal/ebpf/generate.sh b/internal/ebpf/generate.sh index e9ef3a51a..83cb87d0f 100755 --- a/internal/ebpf/generate.sh +++ b/internal/ebpf/generate.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Regenerate bpf2go bindings for the Linux eBPF process source. +# Regenerate bpf2go bindings for the Linux eBPF syscall telemetry source. set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -32,5 +32,9 @@ generate execve ./c/execve.bpf.c generate exit ./c/exit.bpf.c generate clone ./c/clone.bpf.c generate prociter ./c/proc_iter.bpf.c +generate file ./c/file.bpf.c +generate net ./c/net.bpf.c +generate mem ./c/mem.bpf.c +generate ctl ./c/ctl.bpf.c echo "generated eBPF bindings" diff --git a/internal/ebpf/loader.go b/internal/ebpf/loader.go index 6046d532c..09582a9f4 100644 --- a/internal/ebpf/loader.go +++ b/internal/ebpf/loader.go @@ -42,6 +42,10 @@ type loader struct { exit *exitObjects clone *cloneObjects iter *prociterObjects + file *fileObjects + net *netObjects + mem *memObjects + ctl *ctlObjects links []link.Link iterLink *link.Iter once sync.Once @@ -68,6 +72,22 @@ func loadCollections() (*loader, error) { if err != nil { return nil, fmt.Errorf("loading prociter collection spec: %w", err) } + fileSpec, err := loadFile() + if err != nil { + return nil, fmt.Errorf("loading file collection spec: %w", err) + } + netSpec, err := loadNet() + if err != nil { + return nil, fmt.Errorf("loading net collection spec: %w", err) + } + memSpec, err := loadMem() + if err != nil { + return nil, fmt.Errorf("loading mem collection spec: %w", err) + } + ctlSpec, err := loadCtl() + if err != nil { + return nil, fmt.Errorf("loading ctl collection spec: %w", err) + } var execObjs execveObjects if err := execSpec.LoadAndAssign(&execObjs, nil); err != nil { @@ -104,11 +124,57 @@ func loadCollections() (*loader, error) { return nil, fmt.Errorf("loading prociter objects: %w", err) } + var fileObjs fileObjects + if err := fileSpec.LoadAndAssign(&fileObjs, opts); err != nil { + _ = iterObjs.Close() + _ = cloneObjs.Close() + _ = exitObjs.Close() + _ = execObjs.Close() + return nil, fmt.Errorf("loading file objects: %w", err) + } + + var netObjs netObjects + if err := netSpec.LoadAndAssign(&netObjs, opts); err != nil { + _ = fileObjs.Close() + _ = iterObjs.Close() + _ = cloneObjs.Close() + _ = exitObjs.Close() + _ = execObjs.Close() + return nil, fmt.Errorf("loading net objects: %w", err) + } + + var memObjs memObjects + if err := memSpec.LoadAndAssign(&memObjs, opts); err != nil { + _ = netObjs.Close() + _ = fileObjs.Close() + _ = iterObjs.Close() + _ = cloneObjs.Close() + _ = exitObjs.Close() + _ = execObjs.Close() + return nil, fmt.Errorf("loading mem objects: %w", err) + } + + var ctlObjs ctlObjects + if err := ctlSpec.LoadAndAssign(&ctlObjs, opts); err != nil { + _ = memObjs.Close() + _ = netObjs.Close() + _ = fileObjs.Close() + _ = iterObjs.Close() + _ = cloneObjs.Close() + _ = exitObjs.Close() + _ = execObjs.Close() + return nil, fmt.Errorf("loading ctl objects: %w", err) + } + return &loader{ exec: &execObjs, exit: &exitObjs, clone: &cloneObjs, iter: &iterObjs, + file: &fileObjs, + net: &netObjs, + mem: &memObjs, + ctl: &ctlObjs, }, nil } @@ -171,7 +237,7 @@ const syscallsGroup = "syscalls" // in contrast to the one-shot iter/task snapshot program started by // runTaskIterator. The caller starts the ring buffer reader first so no // events are lost between attachment and consumption. -func (l *loader) attachPrograms() error { +func (l *loader) attachPrograms(cfg *config.EventSourceConfig) error { type tp struct { name string prog *ebpf.Program @@ -192,6 +258,60 @@ func (l *loader) attachPrograms() error { {"sys_exit_fork", l.clone.HandleSysExitFork, true}, {"sys_enter_vfork", l.clone.HandleSysEnterVfork, true}, {"sys_exit_vfork", l.clone.HandleSysExitVfork, true}, + {"sys_enter_kill", l.ctl.HandleSysEnterKill, false}, + {"sys_exit_kill", l.ctl.HandleSysExitKill, false}, + // tkill is an obsolescent predecessor of tgkill; treat it like the + // other legacy syscall tracepoints. + {"sys_enter_tkill", l.ctl.HandleSysEnterTkill, true}, + {"sys_exit_tkill", l.ctl.HandleSysExitTkill, true}, + {"sys_enter_tgkill", l.ctl.HandleSysEnterTgkill, false}, + {"sys_exit_tgkill", l.ctl.HandleSysExitTgkill, false}, + {"sys_enter_ptrace", l.ctl.HandleSysEnterPtrace, false}, + {"sys_exit_ptrace", l.ctl.HandleSysExitPtrace, false}, + {"sys_enter_prctl", l.ctl.HandleSysEnterPrctl, false}, + {"sys_exit_prctl", l.ctl.HandleSysExitPrctl, false}, + } + if cfg == nil || cfg.EnableFileIOEvents { + // Legacy variants (open, unlink, rename) follow the fork/vfork + // precedent: some kernels refuse perf links on them. + tracepoints = append(tracepoints, + tp{"sys_enter_open", l.file.HandleSysEnterOpen, true}, + tp{"sys_exit_open", l.file.HandleSysExitOpen, true}, + tp{"sys_enter_openat", l.file.HandleSysEnterOpenat, false}, + tp{"sys_exit_openat", l.file.HandleSysExitOpenat, false}, + tp{"sys_enter_openat2", l.file.HandleSysEnterOpenat2, false}, + tp{"sys_exit_openat2", l.file.HandleSysExitOpenat2, false}, + tp{"sys_enter_unlink", l.file.HandleSysEnterUnlink, true}, + tp{"sys_exit_unlink", l.file.HandleSysExitUnlink, true}, + tp{"sys_enter_unlinkat", l.file.HandleSysEnterUnlinkat, false}, + tp{"sys_exit_unlinkat", l.file.HandleSysExitUnlinkat, false}, + tp{"sys_enter_rename", l.file.HandleSysEnterRename, true}, + tp{"sys_exit_rename", l.file.HandleSysExitRename, true}, + tp{"sys_enter_renameat", l.file.HandleSysEnterRenameat, false}, + tp{"sys_exit_renameat", l.file.HandleSysExitRenameat, false}, + tp{"sys_enter_renameat2", l.file.HandleSysEnterRenameat2, false}, + tp{"sys_exit_renameat2", l.file.HandleSysExitRenameat2, false}, + ) + } + if cfg == nil || cfg.EnableNetEvents { + tracepoints = append(tracepoints, + tp{"sys_enter_connect", l.net.HandleSysEnterConnect, false}, + tp{"sys_exit_connect", l.net.HandleSysExitConnect, false}, + tp{"sys_enter_accept", l.net.HandleSysEnterAccept, false}, + tp{"sys_exit_accept", l.net.HandleSysExitAccept, false}, + tp{"sys_enter_accept4", l.net.HandleSysEnterAccept4, false}, + tp{"sys_exit_accept4", l.net.HandleSysExitAccept4, false}, + ) + } + if cfg == nil || cfg.EnableMemEvents { + tracepoints = append(tracepoints, + tp{"sys_enter_mmap", l.mem.HandleSysEnterMmap, false}, + tp{"sys_exit_mmap", l.mem.HandleSysExitMmap, false}, + tp{"sys_enter_process_vm_readv", l.mem.HandleSysEnterProcessVmReadv, false}, + tp{"sys_exit_process_vm_readv", l.mem.HandleSysExitProcessVmReadv, false}, + tp{"sys_enter_process_vm_writev", l.mem.HandleSysEnterProcessVmWritev, false}, + tp{"sys_exit_process_vm_writev", l.mem.HandleSysExitProcessVmWritev, false}, + ) } for _, t := range tracepoints { if t.prog == nil { @@ -276,6 +396,26 @@ func (l *loader) Close() error { } // Replacement collections share maps owned by execve. Close only their // programs so the canonical maps are released once. + if l.ctl != nil { + if e := l.ctl.ctlPrograms.Close(); e != nil { + err = e + } + } + if l.mem != nil { + if e := l.mem.memPrograms.Close(); e != nil { + err = e + } + } + if l.net != nil { + if e := l.net.netPrograms.Close(); e != nil { + err = e + } + } + if l.file != nil { + if e := l.file.filePrograms.Close(); e != nil { + err = e + } + } if l.iter != nil { if e := l.iter.prociterPrograms.Close(); e != nil { err = e diff --git a/internal/ebpf/mem_bpfeb.go b/internal/ebpf/mem_bpfeb.go new file mode 100644 index 000000000..e2ee49396 --- /dev/null +++ b/internal/ebpf/mem_bpfeb.go @@ -0,0 +1,174 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (mips || mips64 || ppc64 || s390x) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type memScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 +} + +// loadMem returns the embedded CollectionSpec for mem. +func loadMem() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_MemBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load mem: %w", err) + } + + return spec, err +} + +// loadMemObjects loads mem and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *memObjects +// *memPrograms +// *memMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadMemObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadMem() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// memSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type memSpecs struct { + memProgramSpecs + memMapSpecs + memVariableSpecs +} + +// memProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type memProgramSpecs struct { + HandleSysEnterMmap *ebpf.ProgramSpec `ebpf:"handle_sys_enter_mmap"` + HandleSysEnterProcessVmReadv *ebpf.ProgramSpec `ebpf:"handle_sys_enter_process_vm_readv"` + HandleSysEnterProcessVmWritev *ebpf.ProgramSpec `ebpf:"handle_sys_enter_process_vm_writev"` + HandleSysExitMmap *ebpf.ProgramSpec `ebpf:"handle_sys_exit_mmap"` + HandleSysExitProcessVmReadv *ebpf.ProgramSpec `ebpf:"handle_sys_exit_process_vm_readv"` + HandleSysExitProcessVmWritev *ebpf.ProgramSpec `ebpf:"handle_sys_exit_process_vm_writev"` +} + +// memMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type memMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` +} + +// memVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type memVariableSpecs struct { +} + +// memObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type memObjects struct { + memPrograms + memMaps + memVariables +} + +func (o *memObjects) Close() error { + return _MemClose( + &o.memPrograms, + &o.memMaps, + ) +} + +// memMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type memMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` +} + +func (m *memMaps) Close() error { + return _MemClose( + m.DropCount, + m.Enabled, + m.Events, + m.Scratch, + m.ScratchHeap, + ) +} + +// memVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type memVariables struct { +} + +// memPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type memPrograms struct { + HandleSysEnterMmap *ebpf.Program `ebpf:"handle_sys_enter_mmap"` + HandleSysEnterProcessVmReadv *ebpf.Program `ebpf:"handle_sys_enter_process_vm_readv"` + HandleSysEnterProcessVmWritev *ebpf.Program `ebpf:"handle_sys_enter_process_vm_writev"` + HandleSysExitMmap *ebpf.Program `ebpf:"handle_sys_exit_mmap"` + HandleSysExitProcessVmReadv *ebpf.Program `ebpf:"handle_sys_exit_process_vm_readv"` + HandleSysExitProcessVmWritev *ebpf.Program `ebpf:"handle_sys_exit_process_vm_writev"` +} + +func (p *memPrograms) Close() error { + return _MemClose( + p.HandleSysEnterMmap, + p.HandleSysEnterProcessVmReadv, + p.HandleSysEnterProcessVmWritev, + p.HandleSysExitMmap, + p.HandleSysExitProcessVmReadv, + p.HandleSysExitProcessVmWritev, + ) +} + +func _MemClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed mem_bpfeb.o +var _MemBytes []byte diff --git a/internal/ebpf/mem_bpfeb.o b/internal/ebpf/mem_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..c42f95631c87094af4da1872cb54734f10ec1c36 GIT binary patch literal 32240 zcmeI4eT-vQdB%_J`S9#+5<_-j3ZcCa8ob-hu4i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#cv=;;P~)#j}c=id%{o6)!7ZRlKe^!h>zQ z{}sm+Clsd?XA~C|Hv%l@ooU5$isuzCC|**$qL{y5H1k#RGe6XZNPUHS_TdA@v9CC; zIH@?Tcu;XkaYOO6;yK0hiWd|wDPB>$rr15waP{qxO*vS9#fbpljBqK%8O24#RmD?^ zXB9UUw-hfbURJ!ScwKR%$5hw!x73IK{Z*S|%0Hnvr8uLwsJNsPcfRX+;^;aBIoKT!noKajVTO!0$?Pb(e?uvkB)_(jE^Q~ZkJFDZU4z%pOI ztN6ba?~p&30^`Q_0mZi{zT>VF_a^VV|L%M4d|zV2@18dQ$;Xk2!pJ4R1m8Sp@Mk9S z^Y!45clbM#O;g(Mq5Ub)ripDDGMJRk?J{X?5wudMRy@i4$o;1uIwH{dsjmCO z1ojs#!F;7)=6Cg57Tfp+qnP}+j??iD{zl#XjREh-$OwMDhTjBF;4dSze_Z4K=)e*D zYOInw;~gp2MvbyQp8HMCsr&Cgo_(JO8L-l434skFuu%jydOUkf0uNZ}vx2~MwTi%ok7oyLU?Y8&j%WMD z@tBnXEB#jbti-J#**+WJDw6H9Q|&E%{t(ZfyEaMTTV?CmuRQs0`xC^MBXzRvLd!E&<3#!UAW{_%v?f8x-x5z)v{0A9O@|X2r=f7`@{9C+lcI99)?f8!OY?1%;CiRy`PdfiE!wpGX z(ti!^+iz6=zee26+J9k_`b#*S|Kt|=m);2vm^Z5ba|p9p{{BZzbn_jk*rfgC=&kdA zFWfe(f8yQnfO(_(%bvJd{%PhvD2c#G{&F$gtumAu6 literal 0 HcmV?d00001 diff --git a/internal/ebpf/net.go b/internal/ebpf/net.go new file mode 100644 index 000000000..57034c6f6 --- /dev/null +++ b/internal/ebpf/net.go @@ -0,0 +1,85 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "encoding/binary" + "net" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "golang.org/x/sys/unix" +) + +func appendSockParams(evt *event.Event, r rawEvent) { + evt.Params.Append(params.FD, params.Int64, int64(r.Arg0)) + if r.Type == uint32(event.Accept) && r.Retval >= 0 { + evt.Params.Append(params.NewFD, params.Int64, r.Retval) + } + if r.Flags != 0 { + evt.Params.Append(params.SockFlags, params.Uint64, r.Flags) + } + + family, ip, port, unixPath := parseSockaddr(r.Filename2[:]) + evt.Params.Append(params.SockFamily, params.Uint16, family) + if unixPath != "" { + evt.Params.Append(params.SockPath, params.Path, unixPath) + return + } + if ip == nil { + return + } + ipParam := params.IPv4 + if ip.To4() == nil { + ipParam = params.IPv6 + } + if r.Type == uint32(event.Connect) { + evt.Params.Append(params.NetDIP, ipParam, ip) + evt.Params.Append(params.NetDport, params.Port, port) + return + } + evt.Params.Append(params.NetSIP, ipParam, ip) + evt.Params.Append(params.NetSport, params.Port, port) +} + +func parseSockaddr(b []byte) (family uint16, ip net.IP, port uint16, unixPath string) { + if len(b) < 2 { + return 0, nil, 0, "" + } + family = binary.LittleEndian.Uint16(b[0:2]) + switch family { + case unix.AF_INET: + if len(b) >= 8 { + port = binary.BigEndian.Uint16(b[2:4]) + ip = net.IPv4(b[4], b[5], b[6], b[7]).To4() + } + case unix.AF_INET6: + if len(b) >= 24 { + port = binary.BigEndian.Uint16(b[2:4]) + ip = net.IP(append([]byte(nil), b[8:24]...)) + } + case unix.AF_UNIX: + if len(b) > 2 { + unixPath = cString(b[2:]) + } + } + return family, ip, port, unixPath +} diff --git a/internal/ebpf/net_bpfeb.go b/internal/ebpf/net_bpfeb.go new file mode 100644 index 000000000..28edfd4ca --- /dev/null +++ b/internal/ebpf/net_bpfeb.go @@ -0,0 +1,174 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build (mips || mips64 || ppc64 || s390x) && linux + +package ebpf + +import ( + "bytes" + _ "embed" + "fmt" + "io" + "structs" + + "github.com/cilium/ebpf" +) + +type netScratchValue struct { + _ structs.HostLayout + Arg0 uint64 + Arg1 uint64 + Arg2 uint64 + Arg3 uint64 + Flags uint64 + Truncated uint32 + Pad uint32 + Filename [256]uint8 + Filename2 [256]uint8 +} + +// loadNet returns the embedded CollectionSpec for net. +func loadNet() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_NetBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load net: %w", err) + } + + return spec, err +} + +// loadNetObjects loads net and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *netObjects +// *netPrograms +// *netMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadNetObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadNet() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// netSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type netSpecs struct { + netProgramSpecs + netMapSpecs + netVariableSpecs +} + +// netProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type netProgramSpecs struct { + HandleSysEnterAccept *ebpf.ProgramSpec `ebpf:"handle_sys_enter_accept"` + HandleSysEnterAccept4 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_accept4"` + HandleSysEnterConnect *ebpf.ProgramSpec `ebpf:"handle_sys_enter_connect"` + HandleSysExitAccept *ebpf.ProgramSpec `ebpf:"handle_sys_exit_accept"` + HandleSysExitAccept4 *ebpf.ProgramSpec `ebpf:"handle_sys_exit_accept4"` + HandleSysExitConnect *ebpf.ProgramSpec `ebpf:"handle_sys_exit_connect"` +} + +// netMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type netMapSpecs struct { + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` +} + +// netVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type netVariableSpecs struct { +} + +// netObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadNetObjects or ebpf.CollectionSpec.LoadAndAssign. +type netObjects struct { + netPrograms + netMaps + netVariables +} + +func (o *netObjects) Close() error { + return _NetClose( + &o.netPrograms, + &o.netMaps, + ) +} + +// netMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadNetObjects or ebpf.CollectionSpec.LoadAndAssign. +type netMaps struct { + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` +} + +func (m *netMaps) Close() error { + return _NetClose( + m.DropCount, + m.Enabled, + m.Events, + m.Scratch, + m.ScratchHeap, + ) +} + +// netVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadNetObjects or ebpf.CollectionSpec.LoadAndAssign. +type netVariables struct { +} + +// netPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadNetObjects or ebpf.CollectionSpec.LoadAndAssign. +type netPrograms struct { + HandleSysEnterAccept *ebpf.Program `ebpf:"handle_sys_enter_accept"` + HandleSysEnterAccept4 *ebpf.Program `ebpf:"handle_sys_enter_accept4"` + HandleSysEnterConnect *ebpf.Program `ebpf:"handle_sys_enter_connect"` + HandleSysExitAccept *ebpf.Program `ebpf:"handle_sys_exit_accept"` + HandleSysExitAccept4 *ebpf.Program `ebpf:"handle_sys_exit_accept4"` + HandleSysExitConnect *ebpf.Program `ebpf:"handle_sys_exit_connect"` +} + +func (p *netPrograms) Close() error { + return _NetClose( + p.HandleSysEnterAccept, + p.HandleSysEnterAccept4, + p.HandleSysEnterConnect, + p.HandleSysExitAccept, + p.HandleSysExitAccept4, + p.HandleSysExitConnect, + ) +} + +func _NetClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed net_bpfeb.o +var _NetBytes []byte diff --git a/internal/ebpf/net_bpfeb.o b/internal/ebpf/net_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..7a8cd9f73bb7ad7d041302e4fabaf03f6c2b407c GIT binary patch literal 33648 zcmeI5eQadcdEU>R84iciYBiCi)iiaItJ;=k<<)AqyOJi7wH|4AWh!3Fv@ErBY-eVc z9PKdTk|UBU548?TB}zJN-G((BWRM0m^HFD<8UaxQ5z_=+7BSK(61YT>77XIH4B$3{ zq)iF5P5DPr^?A>E&diy2Nm*{3pe=Zz%jf*w^Zjw}d(XY(>aSnA{7fPdnf?)(|ABB| z=*J-NBO8`V{CTg5ZoXo}=FP0t(dnOiYhOY)A9VK7*qFE8dTT%D;++vcf82$l7g^Vc zF+VJ(SD5aetf>pXxhg-6neKdh<=(8=Z05y^>kG>NA+g-3C-T&onxop95uYK8Abn)} z1KlI{sJql1>Nd4Y-J)(%H>e%zI<-w*qqeB4)F!n-ty3%1De5G3f?A>$sRe4D8dG!B zEHy(FLI2G@b&uMk?oxNC+te;~i@HhOpmwP1)HZdE+M=#fo74uiPOVU%*57O*OU_V5P%rO4v%LSzMm^ehsXNqdYL~i2-K1_%JJfY*o4Q7AQCF!= zYJ*y*R;W|dN$Lc(L@iPa)I2q&=BQa}hAM*o^Zqky_Q*ZzE_H{xP3=;*sGHOcYKOW` zZBy5%E$S+@No`Q;)CzTqI!T?NmZ(K)ftshr)EqTS%}_fbJdn^;?FpHeDiNO`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}0#QFR-6n7MN755a!_zcG9H?BCYIH@?TIHS0z zxU9IYxT(0MxUG0YaYu1iaZhoK_uKvUD~>BpDo!iTC@v~4E3PYUDsCxmE8bAtQQTGB zQyk;{e82sQx!F-TZ-F?HxzdicNO;($MEbid_9dTjw?R9seESKL(G zQruR&p}3>CtGK5)c3ibzaa?gyaawUkaZzzuab0m!aZ7Pq@rL4#;;!PJV*AHo!sGwO zo&6D4oK&1voKajA(pM&tBSv= z_z=I8E$x-`cPPGF@xvjOtS%}3sNz}0&ny14;-3$(*q{HY_!Y%pSNy8tZz_K1J&#>@ z{NfX-N6$a}AvJ`Gb1?&M$mg=(lWppBGLr`0@I# zqWzz*koxUewokCDa38VfnYMJFf`5R-{YowTcOm@W_%NquXRpo4FXk8Vmr43RWb=RY z<1~J+y*zcbBvRke=98-}+b?!Qmw!LP_9{QY`z`;R!R0nM z-}5`**{l2_%P%pZ^uMIjahTYM9&TsPk zMmRD2zI-42A9%iJukq8)_v^e5@!|UV{SeOItNmrRKgSbg{ACN{%lG{+W1`z6r*tpK zC+_e3m*pMW`#pNC$eiA*{0_@+@V-JsZlQJgZ$sfjmtI>yR1HVp6}kTLF;hQW*Y$k} Yz!cc!wm;&6{CgcaZvuxef1GFh6Ag4oAOHXW literal 0 HcmV?d00001 diff --git a/internal/ebpf/source.go b/internal/ebpf/source.go index 69583b889..e692659f1 100644 --- a/internal/ebpf/source.go +++ b/internal/ebpf/source.go @@ -123,7 +123,7 @@ func (e *EventSource) Open(cfg *config.Config) error { go e.consume() - if err := ldr.attachPrograms(); err != nil { + if err := ldr.attachPrograms(&e.config.EventSource); err != nil { e.Close() return err } diff --git a/pkg/event/metainfo_linux.go b/pkg/event/metainfo_linux.go index 606b0f669..e00d08ee3 100644 --- a/pkg/event/metainfo_linux.go +++ b/pkg/event/metainfo_linux.go @@ -22,38 +22,17 @@ package event import "slices" -var events = map[Type]Info{ - Execve: {Name: "execve", Category: Process, Description: "Executes a program"}, - Exit: {Name: "exit", Category: Process, Description: "Exit all threads in a process"}, - Clone: {Name: "clone", Category: Process, Description: "Creates a child process or a thread"}, - Openat: {Name: "openat", Category: File, Description: "Opens or creates a file"}, - Unlink: {Name: "unlink", Category: File, Description: "Removes a directory entry"}, - Rename: {Name: "rename", Category: File, Description: "Renames a file"}, - Connect: {Name: "connect", Category: Net, Description: "Initiates a socket connection"}, - Accept: {Name: "accept", Category: Net, Description: "Accepts a socket connection"}, - Mmap: {Name: "mmap", Category: Mem, Description: "Maps files or devices into memory"}, - ProcessVMRead: {Name: "process_vm_readv", Category: Mem, Description: "Reads memory from another process"}, - ProcessVMWrite: {Name: "process_vm_writev", Category: Mem, Description: "Writes memory into another process"}, - Kill: {Name: "kill", Category: Process, Description: "Sends a signal to a process"}, - Ptrace: {Name: "ptrace", Category: Process, Description: "Traces or controls another process"}, - Prctl: {Name: "prctl", Category: Process, Description: "Performs a process-control operation"}, -} +var events map[Type]Info +var types map[string]Type -var types = map[string]Type{ - "execve": Execve, - "exit": Exit, - "clone": Clone, - "openat": Openat, - "unlink": Unlink, - "rename": Rename, - "connect": Connect, - "accept": Accept, - "mmap": Mmap, - "process_vm_readv": ProcessVMRead, - "process_vm_writev": ProcessVMWrite, - "kill": Kill, - "ptrace": Ptrace, - "prctl": Prctl, +func init() { + all := All() + events = make(map[Type]Info, len(all)) + types = make(map[string]Type, len(all)) + for _, typ := range all { + events[typ] = Info{Name: typ.String(), Category: typ.Category(), Description: typ.Description()} + types[typ.String()] = typ + } } // All returns all Linux event types. diff --git a/pkg/event/params/names_linux.go b/pkg/event/params/names_linux.go index 14b30b4a4..ebb52580a 100644 --- a/pkg/event/params/names_linux.go +++ b/pkg/event/params/names_linux.go @@ -45,8 +45,12 @@ const ( FileMode = "file_mode" // FD is a file descriptor. FD = "fd" + // NewFD is the connected file descriptor returned by accept. + NewFD = "new_fd" // SockFamily is the socket address family (AF_INET, AF_INET6, AF_UNIX). SockFamily = "sock_family" + // SockFlags is the flags bitmask supplied to accept4. + SockFlags = "sock_flags" // SockPath is the filesystem path of an AF_UNIX socket. SockPath = "sock_path" // MmapFlags is the raw mmap flags bitmask. From e79d9d6a9ee6b73bad80a7be3202beccc694c1a9 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Tue, 15 Sep 2026 10:33:32 +0200 Subject: [PATCH 40/65] test(ebpf): Cover the MVP syscall event matrix Add a checked matrix that every Linux event type decodes with its documented parameters, plus mmap process-state and live open/rename/unlink/kill coverage on a real kernel. --- internal/ebpf/matrix_test.go | 147 +++++++++++++++++++++++ internal/ebpf/source_integration_test.go | 44 +++++++ 2 files changed, 191 insertions(+) create mode 100644 internal/ebpf/matrix_test.go diff --git a/internal/ebpf/matrix_test.go b/internal/ebpf/matrix_test.go new file mode 100644 index 000000000..c53a492b7 --- /dev/null +++ b/internal/ebpf/matrix_test.go @@ -0,0 +1,147 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/ps" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "golang.org/x/sys/unix" +) + +type matrixRow struct { + name string + typ event.Type + syscalls []string + hook string + params []string +} + +const hookSyscallIO = "tp/syscalls enter/exit" + +func syscallMatrix() []matrixRow { + return []matrixRow{ + {"execve", event.Execve, []string{"execve", "execveat"}, hookSyscallIO, []string{params.Exe, params.Retval}}, + {"exit", event.Exit, []string{"sched_process_exit"}, "tp_btf/sched_process_exit", []string{params.ExitStatus}}, + {"clone", event.Clone, []string{"clone", "clone3", "fork", "vfork"}, "tp/syscalls + tp_btf/sched_process_fork", []string{params.CloneFlags}}, + {"openat", event.Openat, []string{"open", "openat", "openat2"}, hookSyscallIO, []string{params.FilePath, params.DirFD, params.FileFlags, params.Retval}}, + {"unlink", event.Unlink, []string{"unlink", "unlinkat"}, hookSyscallIO, []string{params.FilePath, params.DirFD, params.Retval}}, + {"rename", event.Rename, []string{"rename", "renameat", "renameat2"}, hookSyscallIO, []string{params.FilePath, params.FileNewPath, params.Retval}}, + {"connect", event.Connect, []string{"connect"}, "tp/syscalls enter/exit; sockaddr copied at enter", []string{params.FD, params.SockFamily, params.Retval}}, + {"accept", event.Accept, []string{"accept", "accept4"}, "tp/syscalls enter/exit; sockaddr copied at exit", []string{params.FD, params.SockFamily, params.Retval}}, + {"mmap", event.Mmap, []string{"mmap"}, hookSyscallIO, []string{params.MemBaseAddress, params.MemRegionSize, params.MemProtect, params.MmapFlags, params.Retval}}, + {"process_vm_readv", event.ProcessVMRead, []string{"process_vm_readv"}, "tp/syscalls enter/exit; first remote iovec only", []string{params.TargetProcessID, params.MemBaseAddress, params.Retval}}, + {"process_vm_writev", event.ProcessVMWrite, []string{"process_vm_writev"}, "tp/syscalls enter/exit; first remote iovec only", []string{params.TargetProcessID, params.MemBaseAddress, params.Retval}}, + {"kill", event.Kill, []string{"kill", "tkill", "tgkill"}, hookSyscallIO, []string{params.TargetProcessID, params.Signal, params.Retval}}, + {"ptrace", event.Ptrace, []string{"ptrace"}, hookSyscallIO, []string{params.PtraceRequest, params.TargetProcessID, params.Retval}}, + {"prctl", event.Prctl, []string{"prctl"}, hookSyscallIO, []string{params.PrctlOption, params.Retval}}, + } +} + +func TestSyscallEventMatrix(t *testing.T) { + seen := map[event.Type]bool{} + for _, row := range syscallMatrix() { + assert.True(t, row.typ.Exists(), row.name) + assert.Equal(t, row.name, row.typ.String()) + assert.NotEmpty(t, row.syscalls) + assert.NotEmpty(t, row.hook) + seen[row.typ] = true + raw := rawEvent{Type: uint32(row.typ), Retval: 0, Filename: [256]byte{'/'}, Filename2: [256]byte{'/'}} + if row.typ == event.Connect || row.typ == event.Accept { + raw.Filename2[0] = byte(unix.AF_INET) + raw.Filename2[1] = 0 + raw.Filename2[2] = 0 + raw.Filename2[3] = 80 + raw.Filename2[4] = 127 + raw.Filename2[5] = 0 + raw.Filename2[6] = 0 + raw.Filename2[7] = 1 + } + evt := raw.toEvent() + require.Equal(t, row.typ, evt.Type, row.name) + for _, name := range row.params { + _, err := evt.Params.Get(name) + assert.NoErrorf(t, err, "%s missing param %s", row.name, name) + } + } + for _, typ := range event.All() { + assert.Truef(t, seen[typ], "event type %s missing from the syscall matrix", typ) + } +} + +func TestParseSockaddr(t *testing.T) { + var inet [256]byte + inet[0] = byte(unix.AF_INET) + inet[2] = 0x00 + inet[3] = 0x50 + inet[4] = 10 + inet[5] = 1 + inet[6] = 2 + inet[7] = 3 + family, ip, port, unixPath := parseSockaddr(inet[:]) + assert.Equal(t, uint16(unix.AF_INET), family) + assert.Equal(t, "10.1.2.3", ip.String()) + assert.Equal(t, uint16(80), port) + assert.Empty(t, unixPath) + + var un [256]byte + un[0] = byte(unix.AF_UNIX) + copy(un[2:], "/tmp/fibratus.sock") + family, ip, port, unixPath = parseSockaddr(un[:]) + assert.Equal(t, uint16(unix.AF_UNIX), family) + assert.Nil(t, ip) + assert.Equal(t, "/tmp/fibratus.sock", unixPath) + assert.Zero(t, port) +} + +func TestMmapUpdatesProcessState(t *testing.T) { + snap := ps.NewSnapshotter() + ps := &pstypes.PS{PID: 9, Name: "target", StartBootTime: 1, Threads: map[uint64]pstypes.Thread{}} + snap.Put(ps) + + raw := rawEvent{Type: uint32(event.Mmap), PID: 9, TGID: 9, Retval: 0x1000, Arg0: 4096, Arg1: 8192, Arg2: 3, Flags: 0x20} + evt := raw.toEvent() + applyProcessState(snap, evt) + ok, got := snap.Find(9) + require.True(t, ok) + require.Len(t, got.Mmaps, 1) + assert.Equal(t, uint64(0x1000), uint64(got.Mmaps[0].BaseAddress)) + assert.Equal(t, uint64(8192), got.Mmaps[0].Size) + assert.Equal(t, "anonymous", got.Mmaps[0].Type) +} + +func TestFailedSyscallKeepsProcessState(t *testing.T) { + snap := ps.NewSnapshotter() + snap.Put(&pstypes.PS{PID: 11, Name: "keep", StartBootTime: 4}) + raw := rawEvent{Type: uint32(event.Openat), PID: 11, TGID: 11, Retval: -2} + copy(raw.Filename[:], "/no/such") + evt := raw.toEvent() + applyProcessState(snap, evt) + ok, got := snap.Find(11) + require.True(t, ok) + assert.Equal(t, "keep", got.Name) + assert.Empty(t, got.Mmaps) +} diff --git a/internal/ebpf/source_integration_test.go b/internal/ebpf/source_integration_test.go index a33c43f56..f43c1feac 100644 --- a/internal/ebpf/source_integration_test.go +++ b/internal/ebpf/source_integration_test.go @@ -22,6 +22,8 @@ package ebpf import ( "os" + "os/exec" + "path/filepath" "testing" "time" @@ -81,3 +83,45 @@ func execLookPath() string { } return "/bin/sh" } + +func TestLiveSyscallTelemetry(t *testing.T) { + cfg := testConfig() + es := NewEventSource(ps.NewSnapshotter(), cfg, nil).(*EventSource) + if err := es.Open(cfg); err != nil { + t.Fatalf("opening process source: %v", err) + } + t.Cleanup(func() { _ = es.Close() }) + + dir := t.TempDir() + path := filepath.Join(dir, "x") + script := "echo hi > \"$1\" && mv \"$1\" \"$1.new\" && rm -f \"$1.new\" && kill -0 $$" + cmd := exec.Command("/bin/sh", "-c", script, "sh", path) + require.NoError(t, cmd.Run()) + + deadline := time.Now().Add(5 * time.Second) + saw := map[event.Type]bool{} + for time.Now().Before(deadline) && (!saw[event.Openat] || !saw[event.Rename] || !saw[event.Unlink] || !saw[event.Kill]) { + select { + case evt := <-es.Events(): + switch evt.Type { + case event.Openat, event.Rename, event.Unlink, event.Kill, event.Mmap: + saw[evt.Type] = true + } + case err := <-es.Errors(): + t.Fatalf("event source error: %v", err) + case <-time.After(50 * time.Millisecond): + } + } + if !saw[event.Openat] { + t.Fatal("did not observe openat") + } + if !saw[event.Rename] { + t.Fatal("did not observe rename") + } + if !saw[event.Unlink] { + t.Fatal("did not observe unlink") + } + if !saw[event.Kill] { + t.Fatal("did not observe kill") + } +} From 8f38145597d1a1c2457ac4a99da558160577f4ad Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Tue, 15 Sep 2026 16:05:42 +0200 Subject: [PATCH 41/65] refactor(ebpf): Capture process-control syscalls at exit tp_btf/sys_exit supplies pt_regs, so kill/ptrace/prctl no longer need an enter probe or scratch slot. Rename filename2 to aux, document the truncation bits and padding, and keep only file-backed mmaps in process state until munmap is hooked. --- internal/ebpf/c/common/events.h | 72 +++++++++++++++-- internal/ebpf/c/ctl.bpf.c | 134 +++++++++----------------------- internal/ebpf/c/file.bpf.c | 4 +- internal/ebpf/c/net.bpf.c | 8 +- internal/ebpf/clone_bpfeb.go | 2 +- internal/ebpf/clone_bpfeb.o | Bin 45216 -> 45192 bytes internal/ebpf/clone_bpfel.go | 2 +- internal/ebpf/clone_bpfel.o | Bin 44832 -> 44808 bytes internal/ebpf/consumer.go | 29 +++++-- internal/ebpf/ctl_bpfeb.go | 35 +-------- internal/ebpf/ctl_bpfeb.o | Bin 47768 -> 22144 bytes internal/ebpf/ctl_bpfel.go | 35 +-------- internal/ebpf/ctl_bpfel.o | Bin 47288 -> 21760 bytes internal/ebpf/events.go | 10 +-- internal/ebpf/execve_bpfeb.go | 2 +- internal/ebpf/execve_bpfeb.o | Bin 22792 -> 22768 bytes internal/ebpf/execve_bpfel.go | 2 +- internal/ebpf/execve_bpfel.o | Bin 22600 -> 22576 bytes internal/ebpf/exit_bpfeb.go | 2 +- internal/ebpf/exit_bpfeb.o | Bin 7880 -> 7872 bytes internal/ebpf/exit_bpfel.go | 2 +- internal/ebpf/exit_bpfel.o | Bin 7880 -> 7872 bytes internal/ebpf/file_bpfeb.go | 2 +- internal/ebpf/file_bpfeb.o | Bin 77952 -> 77912 bytes internal/ebpf/file_bpfel.go | 2 +- internal/ebpf/file_bpfel.o | Bin 77184 -> 77144 bytes internal/ebpf/loader.go | 14 +--- internal/ebpf/matrix_test.go | 41 ++++++---- internal/ebpf/mem_bpfeb.go | 2 +- internal/ebpf/mem_bpfeb.o | Bin 32240 -> 32216 bytes internal/ebpf/mem_bpfel.go | 2 +- internal/ebpf/mem_bpfel.o | Bin 31952 -> 31928 bytes internal/ebpf/net.go | 2 +- internal/ebpf/net_bpfeb.go | 2 +- internal/ebpf/net_bpfeb.o | Bin 33648 -> 33600 bytes internal/ebpf/net_bpfel.go | 2 +- internal/ebpf/net_bpfel.o | Bin 33360 -> 33312 bytes internal/ebpf/prociter_bpfeb.go | 2 +- internal/ebpf/prociter_bpfeb.o | Bin 7136 -> 7136 bytes internal/ebpf/prociter_bpfel.go | 2 +- internal/ebpf/prociter_bpfel.o | Bin 7136 -> 7136 bytes internal/ebpf/spike/c/vmlinux.h | 10 +++ 42 files changed, 199 insertions(+), 223 deletions(-) diff --git a/internal/ebpf/c/common/events.h b/internal/ebpf/c/common/events.h index 912371a90..185eea59c 100644 --- a/internal/ebpf/c/common/events.h +++ b/internal/ebpf/c/common/events.h @@ -13,8 +13,9 @@ #define EVT_FILENAME_LEN 256 #define EVT_TYPE_MAX 32 -#define TRUNC_FILENAME (1u << 0) -#define TRUNC_FILENAME2 (1u << 1) +/* Set when a userspace copy was longer than the destination and was cut off. */ +#define TRUNC_FILENAME (1u << 0) /* filename[]: exec path, open/unlink/rename source */ +#define TRUNC_AUX (1u << 1) /* aux[]: rename destination or sockaddr bytes */ /* UAPI openat2 argument; not a CO-RE kernel type. */ struct open_how { @@ -73,6 +74,7 @@ struct syscall_event { s64 retval; /* Interpreted per event type: clone flags, open flags, mmap flags, accept flags. */ u64 flags; + /* Generic argument slots, interpreted per event type. */ u64 arg0; u64 arg1; u64 arg2; @@ -80,10 +82,10 @@ struct syscall_event { u64 start_boottime; u64 timestamp_ns; u32 truncated; - u32 pad; + u32 pad; /* keeps comm[] 8-byte aligned; no semantic value */ u8 comm[TASK_COMM_LEN]; - u8 filename[EVT_FILENAME_LEN]; - u8 filename2[EVT_FILENAME_LEN]; + u8 filename[EVT_FILENAME_LEN]; /* exec path, open/unlink/rename source */ + u8 aux[EVT_FILENAME_LEN]; /* rename destination or sockaddr bytes */ }; struct scratch_value { @@ -95,7 +97,7 @@ struct scratch_value { u32 truncated; u32 pad; u8 filename[EVT_FILENAME_LEN]; - u8 filename2[EVT_FILENAME_LEN]; + u8 aux[EVT_FILENAME_LEN]; }; struct { @@ -227,7 +229,7 @@ static __always_inline void copy_scratch(struct syscall_event *e, struct scratch e->flags = val->flags; e->truncated = val->truncated; __builtin_memcpy(&e->filename, val->filename, sizeof(e->filename)); - __builtin_memcpy(&e->filename2, val->filename2, sizeof(e->filename2)); + __builtin_memcpy(&e->aux, val->aux, sizeof(e->aux)); } static __always_inline struct scratch_value *borrow_scratch(void) @@ -277,3 +279,59 @@ static __always_inline int submit_from_scratch(u32 type, long ret, u32 syscall_i bpf_ringbuf_submit(e, 0); return 0; } + +/* x86-64 syscall ABI. arg3 is r10, not rcx. */ +static __always_inline u64 syscall_nr(struct pt_regs *regs) +{ + return BPF_CORE_READ(regs, orig_ax); +} + +static __always_inline u64 syscall_arg0(struct pt_regs *regs) +{ + return BPF_CORE_READ(regs, di); +} + +static __always_inline u64 syscall_arg1(struct pt_regs *regs) +{ + return BPF_CORE_READ(regs, si); +} + +static __always_inline u64 syscall_arg2(struct pt_regs *regs) +{ + return BPF_CORE_READ(regs, dx); +} + +static __always_inline u64 syscall_arg3(struct pt_regs *regs) +{ + return BPF_CORE_READ(regs, r10); +} + +static __always_inline u64 syscall_arg4(struct pt_regs *regs) +{ + return BPF_CORE_READ(regs, r8); +} + +static __always_inline int submit_args(u32 type, long ret, u32 syscall_id, + u64 arg0, u64 arg1, u64 arg2, u64 arg3, u64 flags) +{ + struct syscall_event *e; + + if (!type_enabled(type)) + return 0; + + e = reserve_event(); + if (!e) + return 0; + + e->type = type; + e->syscall_id = syscall_id; + e->retval = ret; + e->arg0 = arg0; + e->arg1 = arg1; + e->arg2 = arg2; + e->arg3 = arg3; + e->flags = flags; + fill_current_task(e); + bpf_ringbuf_submit(e, 0); + return 0; +} diff --git a/internal/ebpf/c/ctl.bpf.c b/internal/ebpf/c/ctl.bpf.c index a237c8360..02cbb3ffe 100644 --- a/internal/ebpf/c/ctl.bpf.c +++ b/internal/ebpf/c/ctl.bpf.c @@ -5,102 +5,44 @@ char LICENSE[] SEC("license") = "Dual MIT/GPL"; -static __always_inline int handle_kill_enter(u64 pid, u64 sig) -{ - struct scratch_value *val; - - if (!type_enabled(EVT_TYPE_KILL)) - return 0; - val = borrow_scratch(); - if (!val) - return 0; - val->arg0 = pid; - val->arg1 = sig; - store_scratch(val); - return 0; -} - -SEC("tp/syscalls/sys_enter_kill") -int handle_sys_enter_kill(struct trace_event_raw_sys_enter *ctx) -{ - return handle_kill_enter(ctx->args[0], ctx->args[1]); -} - -SEC("tp/syscalls/sys_exit_kill") -int handle_sys_exit_kill(struct trace_event_raw_sys_exit *ctx) -{ - return submit_from_scratch(EVT_TYPE_KILL, ctx->ret, (u32)ctx->id); -} - -SEC("tp/syscalls/sys_enter_tkill") -int handle_sys_enter_tkill(struct trace_event_raw_sys_enter *ctx) -{ - return handle_kill_enter(ctx->args[0], ctx->args[1]); -} - -SEC("tp/syscalls/sys_exit_tkill") -int handle_sys_exit_tkill(struct trace_event_raw_sys_exit *ctx) -{ - return submit_from_scratch(EVT_TYPE_KILL, ctx->ret, (u32)ctx->id); -} - -SEC("tp/syscalls/sys_enter_tgkill") -int handle_sys_enter_tgkill(struct trace_event_raw_sys_enter *ctx) -{ - return handle_kill_enter(ctx->args[0], ctx->args[2]); -} - -SEC("tp/syscalls/sys_exit_tgkill") -int handle_sys_exit_tgkill(struct trace_event_raw_sys_exit *ctx) -{ - return submit_from_scratch(EVT_TYPE_KILL, ctx->ret, (u32)ctx->id); -} - -SEC("tp/syscalls/sys_enter_ptrace") -int handle_sys_enter_ptrace(struct trace_event_raw_sys_enter *ctx) -{ - struct scratch_value *val; - - if (!type_enabled(EVT_TYPE_PTRACE)) +/* x86-64 syscall numbers. Register-only syscalls are captured at + * tp_btf/sys_exit, which supplies pt_regs (args + retval) so there is + * no enter probe or scratch slot. The per-syscall sys_exit tracepoint + * only carries id and ret. + */ +#define NR_PTRACE 101 +#define NR_KILL 62 +#define NR_TKILL 200 +#define NR_TGKILL 234 +#define NR_PRCTL 157 + +SEC("tp_btf/sys_exit") +int BPF_PROG(handle_sys_exit, struct pt_regs *regs, long ret) +{ + u64 id; + + if (!regs) return 0; - val = borrow_scratch(); - if (!val) + id = syscall_nr(regs); + switch (id) { + case NR_KILL: + case NR_TKILL: + return submit_args(EVT_TYPE_KILL, ret, (u32)id, + syscall_arg0(regs), syscall_arg1(regs), 0, 0, 0); + case NR_TGKILL: + /* pid, tid, sig: emit the thread-group id and the signal. */ + return submit_args(EVT_TYPE_KILL, ret, (u32)id, + syscall_arg0(regs), syscall_arg2(regs), 0, 0, 0); + case NR_PTRACE: + return submit_args(EVT_TYPE_PTRACE, ret, (u32)id, + syscall_arg0(regs), syscall_arg1(regs), + syscall_arg2(regs), syscall_arg3(regs), 0); + case NR_PRCTL: + return submit_args(EVT_TYPE_PRCTL, ret, (u32)id, + syscall_arg0(regs), syscall_arg1(regs), + syscall_arg2(regs), syscall_arg3(regs), + syscall_arg4(regs)); + default: return 0; - val->arg0 = ctx->args[0]; /* request */ - val->arg1 = ctx->args[1]; /* pid */ - val->arg2 = ctx->args[2]; /* addr */ - val->arg3 = ctx->args[3]; /* data */ - store_scratch(val); - return 0; -} - -SEC("tp/syscalls/sys_exit_ptrace") -int handle_sys_exit_ptrace(struct trace_event_raw_sys_exit *ctx) -{ - return submit_from_scratch(EVT_TYPE_PTRACE, ctx->ret, (u32)ctx->id); -} - -SEC("tp/syscalls/sys_enter_prctl") -int handle_sys_enter_prctl(struct trace_event_raw_sys_enter *ctx) -{ - struct scratch_value *val; - - if (!type_enabled(EVT_TYPE_PRCTL)) - return 0; - val = borrow_scratch(); - if (!val) - return 0; - val->arg0 = ctx->args[0]; - val->arg1 = ctx->args[1]; - val->arg2 = ctx->args[2]; - val->arg3 = ctx->args[3]; - val->flags = ctx->args[4]; - store_scratch(val); - return 0; -} - -SEC("tp/syscalls/sys_exit_prctl") -int handle_sys_exit_prctl(struct trace_event_raw_sys_exit *ctx) -{ - return submit_from_scratch(EVT_TYPE_PRCTL, ctx->ret, (u32)ctx->id); + } } diff --git a/internal/ebpf/c/file.bpf.c b/internal/ebpf/c/file.bpf.c index fe991bbd6..5e5353780 100644 --- a/internal/ebpf/c/file.bpf.c +++ b/internal/ebpf/c/file.bpf.c @@ -115,8 +115,8 @@ static __always_inline int handle_rename_enter(s64 olddirfd, const char *oldpath val->arg1 = (u64)newdirfd; val->flags = flags; val->truncated |= read_user_str(val->filename, sizeof(val->filename), oldpath); - if (read_user_str(val->filename2, sizeof(val->filename2), newpath)) - val->truncated |= TRUNC_FILENAME2; + if (read_user_str(val->aux, sizeof(val->aux), newpath)) + val->truncated |= TRUNC_AUX; store_scratch(val); return 0; } diff --git a/internal/ebpf/c/net.bpf.c b/internal/ebpf/c/net.bpf.c index 8f4269daa..9df0001eb 100644 --- a/internal/ebpf/c/net.bpf.c +++ b/internal/ebpf/c/net.bpf.c @@ -12,12 +12,12 @@ static __always_inline void read_sockaddr(struct scratch_value *val, const void { u64 len = addrlen; - if (len > sizeof(val->filename2)) { - len = sizeof(val->filename2); - val->truncated |= TRUNC_FILENAME2; + if (len > sizeof(val->aux)) { + len = sizeof(val->aux); + val->truncated |= TRUNC_AUX; } if (addr && len) - bpf_probe_read_user(val->filename2, len, addr); + bpf_probe_read_user(val->aux, len, addr); } SEC("tp/syscalls/sys_enter_connect") diff --git a/internal/ebpf/clone_bpfeb.go b/internal/ebpf/clone_bpfeb.go index a99c432ca..bca4d7573 100644 --- a/internal/ebpf/clone_bpfeb.go +++ b/internal/ebpf/clone_bpfeb.go @@ -23,7 +23,7 @@ type cloneScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadClone returns the embedded CollectionSpec for clone. diff --git a/internal/ebpf/clone_bpfeb.o b/internal/ebpf/clone_bpfeb.o index 6e64435e0e43ef1428988face98b3da432c06ef1..091806274ed82a70ee62dc001f3623229903dcce 100644 GIT binary patch literal 45192 zcmeI5eQ;yfdEO5I5(Iap6&y=4?8wqp>?l}ywZe+}fMt0LeXI<{Yl)H9Hf^f~uq3o# z#U&w+@C&m`tf)?X8K3W{BO8J z9(@ZOzfrVQ;OARSY^7q-LMzXkl<2EX`7~y_bLG!OFW)Jj#*78VT)A@P&oVZ&^|BwI zcFx!bnCGZ5XTKe68U8T0DO=^Q$r`D)t>J)X7TBH`Jd1{WDr3TatHBC)XMNogUN8P3Ns5{hc z>K1jA+NEw#*Qp)q8nsPbrM9R|YJ*y*)~IFb6m^nXq!y@oYL1$v2Gk5SO-)fn%*8R+ zA1@|NAbhzjpT@Ai9l5x6Wlvc3&pq8gFW)br(60+teEj&U4$VKH`u@N233oq)^4XOj z)n=@W{(t3FTUwKt{anZq!E_R%Ciawse|1$pjnUy= z4a7Izcr_>5Z?8}J_WMBD91{QO-}wH@f0McLEs4ka$NrEb%&5826aR~|@jA6eEmK`T znT=19i_`+u^^@7SEiux`(m$ZOeliN^Mb_)CRRqtx?O=De5G(NG(wF)EqTS4X7Dvnwp}Dp#B^uX3Z|SN8O=rQ@5y_ z)Gl>{x=!s-*QjmkDz!yzQXAAdwMH#dr>K+EBDFxxQ*+cTHK1mwX=;ip;_v6ti)G{T zsk!lD`kc8%?EU+-BGeCm;%i@T36R?MV?WIE~ZJDmqzIydF`9N@}5@?FX?;>%HCIi~qM!EyvQJb&$a_;UJm zRzA*h)Xk5C>XY)}{x8a7uMf*}-FGR^h|kBDCsZ$YU8B!K2aVIQn~eEIDgTOVM}zB= zBfI`vF?q5L0egXL^8wrYWa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>jtTd(@B-C`sDr20RKV7>BBGyj}TCXoDP zNa_6l5^lZn-$>Yq?)$Qqw&FYf5iGs(Ut#`f29*3|YgFg|abzy}t7Z3MU3Xp9{{V+b*LTZOe$Ltx{Jx9CJB7pL&uyaMe*p?3xjX;> diff --git a/internal/ebpf/consumer.go b/internal/ebpf/consumer.go index 1c5e57168..ea5ea037b 100644 --- a/internal/ebpf/consumer.go +++ b/internal/ebpf/consumer.go @@ -67,12 +67,14 @@ func applyProcessState(psnap ps.Snapshotter, evt *event.Event) { ok, existing := psnap.Find(evt.PID) if ok && existing != nil { evt.PS = existing - existing.AddMmap(pstypes.Mmap{ - BaseAddress: va.Address(evt.GetParamAsUint64(params.MemBaseAddress)), - Size: evt.GetParamAsUint64(params.MemRegionSize), - Protection: evt.GetParamAsUint32(params.MemProtect), - Type: mmapKind(evt.GetParamAsUint64(params.MmapFlags)), - }) + if retainMmap(evt) { + existing.AddMmap(pstypes.Mmap{ + BaseAddress: va.Address(evt.GetParamAsUint64(params.MemBaseAddress)), + Size: evt.GetParamAsUint64(params.MemRegionSize), + Protection: evt.GetParamAsUint32(params.MemProtect), + Type: mmapKind(evt.GetParamAsUint64(params.MmapFlags)), + }) + } } case evt.Type == event.Exit: ok, existing := psnap.Find(evt.PID) @@ -190,6 +192,21 @@ func mmapKind(flags uint64) string { return "file" } +// retainMmap reports whether the mapping should be stored on process state. +// Anonymous mappings are frequent (heap, stacks, JIT) and we do not yet +// hook munmap, so keeping them would grow without bound. File-backed +// mappings are the useful set (shared objects, mapped files). +func retainMmap(evt *event.Event) bool { + if mmapKind(evt.GetParamAsUint64(params.MmapFlags)) != "file" { + return false + } + fd, err := evt.Params.GetInt64(params.FD) + if err != nil { + return false + } + return fd >= 0 +} + func enrichEvent(evt *event.Event) { if evt == nil { return diff --git a/internal/ebpf/ctl_bpfeb.go b/internal/ebpf/ctl_bpfeb.go index 7771745ab..c41298b34 100644 --- a/internal/ebpf/ctl_bpfeb.go +++ b/internal/ebpf/ctl_bpfeb.go @@ -23,7 +23,7 @@ type ctlScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadCtl returns the embedded CollectionSpec for ctl. @@ -68,16 +68,7 @@ type ctlSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type ctlProgramSpecs struct { - HandleSysEnterKill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_kill"` - HandleSysEnterPrctl *ebpf.ProgramSpec `ebpf:"handle_sys_enter_prctl"` - HandleSysEnterPtrace *ebpf.ProgramSpec `ebpf:"handle_sys_enter_ptrace"` - HandleSysEnterTgkill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_tgkill"` - HandleSysEnterTkill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_tkill"` - HandleSysExitKill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_kill"` - HandleSysExitPrctl *ebpf.ProgramSpec `ebpf:"handle_sys_exit_prctl"` - HandleSysExitPtrace *ebpf.ProgramSpec `ebpf:"handle_sys_exit_ptrace"` - HandleSysExitTgkill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_tgkill"` - HandleSysExitTkill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_tkill"` + HandleSysExit *ebpf.ProgramSpec `ebpf:"handle_sys_exit"` } // ctlMapSpecs contains maps before they are loaded into the kernel. @@ -144,30 +135,12 @@ type ctlVariables struct { // // It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. type ctlPrograms struct { - HandleSysEnterKill *ebpf.Program `ebpf:"handle_sys_enter_kill"` - HandleSysEnterPrctl *ebpf.Program `ebpf:"handle_sys_enter_prctl"` - HandleSysEnterPtrace *ebpf.Program `ebpf:"handle_sys_enter_ptrace"` - HandleSysEnterTgkill *ebpf.Program `ebpf:"handle_sys_enter_tgkill"` - HandleSysEnterTkill *ebpf.Program `ebpf:"handle_sys_enter_tkill"` - HandleSysExitKill *ebpf.Program `ebpf:"handle_sys_exit_kill"` - HandleSysExitPrctl *ebpf.Program `ebpf:"handle_sys_exit_prctl"` - HandleSysExitPtrace *ebpf.Program `ebpf:"handle_sys_exit_ptrace"` - HandleSysExitTgkill *ebpf.Program `ebpf:"handle_sys_exit_tgkill"` - HandleSysExitTkill *ebpf.Program `ebpf:"handle_sys_exit_tkill"` + HandleSysExit *ebpf.Program `ebpf:"handle_sys_exit"` } func (p *ctlPrograms) Close() error { return _CtlClose( - p.HandleSysEnterKill, - p.HandleSysEnterPrctl, - p.HandleSysEnterPtrace, - p.HandleSysEnterTgkill, - p.HandleSysEnterTkill, - p.HandleSysExitKill, - p.HandleSysExitPrctl, - p.HandleSysExitPtrace, - p.HandleSysExitTgkill, - p.HandleSysExitTkill, + p.HandleSysExit, ) } diff --git a/internal/ebpf/ctl_bpfeb.o b/internal/ebpf/ctl_bpfeb.o index d6052ea8643f8f168329f571194e3a8d8027ffc2..effa49e8736e42cdea0645b66000cf9549fadd43 100644 GIT binary patch literal 22144 zcmeI3eT-aJdB)Ft?XJDf?l{>cvnG@q2w@zY&G;i>ae_Mu7&es)gA>qFL1)Ih*hY_F{t=fN|@*!P~T7RYWtyoDP3>l)2{zl@{{$GFR8ze z{(tW3w)poGwqr&)kAD2us^|Ob&DTd=fAr^;+0W5`yBfv}25z2HZau^$d$4}w{l@&R zWF$=F`=XfN*Fru6eGl||@2^Mx1A2+=-|#&5#`g;I`wHXRa|7eEL&f<17UTH8kCz); z@9V`)NBq3j`ula~dKf=n{`%V3@#pfZXlJOmKD_>})xYo0`{Az_`ZIC^>tlBWtk37g z-=8whk~ch#{_E&Q;_No@ALIBf(IZEZ zy4n%_Dg2Us>PGx}OzOd}TSY^D<%Hpv-N$d-FSA?PxqJ&9YO;ZDEikhSjQAN;i?0<}fm zq&BJNs152_YMr`Htxy-J1?mhnN1di-sZ-PpHBAkuDQc2BL>0mK%@t~wx=rm+FH^Uu zm#A&(1!{}BNo`WkQ5)2=)H-#YTA?mb3)C5Ejyg@vQm3dHYML5QQ`97Nh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iRX-;d@}yG}em zfFDuv8(zqsuOG!GH9St=o1JHlE-ZZJqWpsOGJb`;_p6D1l9CU9KXYiU>F-CgSzRxl zA0YhE`=j{1=GB>J%+Zz07p-y}n()UR&p!O{slq7(x!=i2C&!&kIXP9h-vzO9($R4z zQ%*94`y|MHPEI&E<|OUpRAI`7xu1HHdYn2%%@j_$q^z89bj(TG36ip&NXjabvWldv zA}On<3MX8_t(k9 z7(Oe9tu-TAlvf23htM@_+e+^$g=< zKN9(6*oWjFtHBS4eXrFy-Demd6!|;&7?%IG3vP-~$zRrTIl}nJ-~2hwA^9I%lfdr% zT<79v7+>(aIEUo_`K$!M5!OF^PdJP(`Cr93B>$VYB=Ys^Z+;5_hUH(e(M_-ZVK^`U z$Q;59$^SjuE`BWQwD%dthapnLN0@FFZtwU!%ipVi_}+6EAN7wML4+as2Z2lMy8WL* zm?8Q9O&7gi|M0zLFaPLM2s9-B_oZC|{`>jX62=Ea<^9iL`4?^Ie*fP@4&$T#QTh9) zA^9I|y71Sle^kcxu>9AUUlA(d@T#{xy!_42!7?QOQ!N)fR(IO_4C9O8XK)V7e}^%o z9VLJHt}90vAN4m+;2e_whqCa)alQJRk0Zd4{J#)LY#c?Ll7IOAyO)3DHQ2-a!}$p& zIdaoZd+);&d*Oxe#yKp0Q3BvtbJF_^^M@h&OZW)m_X0RaZpZ0uGs?r8zoWkZzhU*S zF?P45~`b+-yh7{DxKl0tB s*Us8@ufb#Rc)3EBa{7l?-ssQ5BkFth-Jh*Hw|#F*;(UaDVgAYg2bE*hUH||9 diff --git a/internal/ebpf/ctl_bpfel.go b/internal/ebpf/ctl_bpfel.go index cf523a9f9..d28873580 100644 --- a/internal/ebpf/ctl_bpfel.go +++ b/internal/ebpf/ctl_bpfel.go @@ -23,7 +23,7 @@ type ctlScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadCtl returns the embedded CollectionSpec for ctl. @@ -68,16 +68,7 @@ type ctlSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type ctlProgramSpecs struct { - HandleSysEnterKill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_kill"` - HandleSysEnterPrctl *ebpf.ProgramSpec `ebpf:"handle_sys_enter_prctl"` - HandleSysEnterPtrace *ebpf.ProgramSpec `ebpf:"handle_sys_enter_ptrace"` - HandleSysEnterTgkill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_tgkill"` - HandleSysEnterTkill *ebpf.ProgramSpec `ebpf:"handle_sys_enter_tkill"` - HandleSysExitKill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_kill"` - HandleSysExitPrctl *ebpf.ProgramSpec `ebpf:"handle_sys_exit_prctl"` - HandleSysExitPtrace *ebpf.ProgramSpec `ebpf:"handle_sys_exit_ptrace"` - HandleSysExitTgkill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_tgkill"` - HandleSysExitTkill *ebpf.ProgramSpec `ebpf:"handle_sys_exit_tkill"` + HandleSysExit *ebpf.ProgramSpec `ebpf:"handle_sys_exit"` } // ctlMapSpecs contains maps before they are loaded into the kernel. @@ -144,30 +135,12 @@ type ctlVariables struct { // // It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. type ctlPrograms struct { - HandleSysEnterKill *ebpf.Program `ebpf:"handle_sys_enter_kill"` - HandleSysEnterPrctl *ebpf.Program `ebpf:"handle_sys_enter_prctl"` - HandleSysEnterPtrace *ebpf.Program `ebpf:"handle_sys_enter_ptrace"` - HandleSysEnterTgkill *ebpf.Program `ebpf:"handle_sys_enter_tgkill"` - HandleSysEnterTkill *ebpf.Program `ebpf:"handle_sys_enter_tkill"` - HandleSysExitKill *ebpf.Program `ebpf:"handle_sys_exit_kill"` - HandleSysExitPrctl *ebpf.Program `ebpf:"handle_sys_exit_prctl"` - HandleSysExitPtrace *ebpf.Program `ebpf:"handle_sys_exit_ptrace"` - HandleSysExitTgkill *ebpf.Program `ebpf:"handle_sys_exit_tgkill"` - HandleSysExitTkill *ebpf.Program `ebpf:"handle_sys_exit_tkill"` + HandleSysExit *ebpf.Program `ebpf:"handle_sys_exit"` } func (p *ctlPrograms) Close() error { return _CtlClose( - p.HandleSysEnterKill, - p.HandleSysEnterPrctl, - p.HandleSysEnterPtrace, - p.HandleSysEnterTgkill, - p.HandleSysEnterTkill, - p.HandleSysExitKill, - p.HandleSysExitPrctl, - p.HandleSysExitPtrace, - p.HandleSysExitTgkill, - p.HandleSysExitTkill, + p.HandleSysExit, ) } diff --git a/internal/ebpf/ctl_bpfel.o b/internal/ebpf/ctl_bpfel.o index fdbcf24fe6cd34db9a4bd6986ddbbf4d34cf97fe..21888bdd0b057624dd1badfe4f840d7159558746 100644 GIT binary patch literal 21760 zcmeI3eQaCTdB%?^$)Oy_X42Tz(rmqH)09pfh5ksRx@kbCb*pS%%em>GcI`-6qAf1^ zU@3}`q5$RAE)ceC;MPqOf(&Ka0@JWyAhrSV(5~Sy6!6es;Ih${)yLLHsyWIb{ZPHlh+CQ@$ z&iY{1-6T1e4u<#xyWf&PXz7hfAMw0Yl9td56CU0EHw1m**`PN_`sORIyz;!1LWy4% z|4H#n>zl72$MWMnuf^m&?it|&$$Q;{UU#{o=zzP`w}*Bj;cION<%V9R+|uud_J2@6 zQ9ku*<)3B$Z`<(w|6%HpYTSO#qmKVd<#e1|^Ywe7J@n@$sb}Ig_W$#!)wvsFmN3sl zk{)*`kEoBhU-!`i?%O`cf#jRq?@G*pP#_XFnlYUA50{kZn= zVWhB^zw+aIz2ngSsXZ^fhVy-OyXjt&-CVgpmwxDaaQ$taA6|bywEgjXVqW)2J=cDI zZo}!3^YirUK0lb(*F28cb@bZoEG%#X?ic+yKIxBg9qsy57}pJcn9g2@SpOEqKi?P9 zVXdDQ|HAITAKCraJ}~k4wO!W-T-mof;O_V3xBD{_`ZE~nzxMu|_vI&^zSjQyJp1!D z)1RO7@ykyKyMO*Q_v@cuW50fi{kp~UYn1&8>-cN$*B)Q*wa?dxZy(nc0^fjfiyLtF z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Rt2oB<5nsPC#c{<+#c9P^#YM$s#dXCE#ZAR6#p@xK{bob) zmSPjy-z5Bq;y`giaY}JUab9sraZT}(;uXcKiq{mcE8bANr8pLo+3Du1?8jq@xvtSn~GbC+lo7iHx+jk$9SnCxvtSn~GbC+lo7iHx+jk$M}K7Ui}rv z6(<#^6=xL}6_*v)6*m+&6}J?(6?YVGD()(d@exn2{)*#@lZw-dvxBio1$q@&RfXsjtKzQyf>ERGe0vRa{hDR$N!yP~249 zQruSDQM{?Rt2lO()IL;y#c{<+#c9P^#YM$s#dXCE#ZAR6#cjnM#hZ$|ieqw7AFjXR zxZ-(zy99d{ZFQ=VO6IyB>=FU5d{so(i#CA1^9?UhxZxUsU|E;y((p zoR7b*_%9THTk)_I3dZl}Hz__H;*TKQ{faLro>IK1_<6;jemMKcqo4iUV?UM4f95AI zJapb1Uo4at&GGrd%<+3KJaAl~|3P2>fpGVUxbWAUcYaOKewa?u+405e{&(y4_!8i* zvD~*EZK~mD_DhiVdz8Dz>U)PHxzAYc9V_G?j%E{cU!>eSGv^2-e|e;@ z^S=zY-SS`M{opsN|L-FHZuuvee;)o~r2Z04=RdVa`>*hP{mts1-=qDPcB#KS($x9m zvkAM_e}m^wZ&v^K9{I2BQvYjq$^TKzKP0hZ{;b~$N0_pjoWA_d7w=XgzO-w~J5Yl! zI7_(yjA}Ut?al*{T24`OBKNTmP>x|E<8ql>Fruh|d38$b9JB8*}ig;pmwq i?ti|V-b0u5@1p+rx5K1s&MD3eC7yJN&!4v+&Ho4MJ_Eo2 diff --git a/internal/ebpf/events.go b/internal/ebpf/events.go index c432d9b79..ec78e5add 100644 --- a/internal/ebpf/events.go +++ b/internal/ebpf/events.go @@ -62,7 +62,7 @@ type rawEvent struct { Pad uint32 Comm [commLen]byte Filename [filenameLen]byte - Filename2 [filenameLen]byte + Aux [filenameLen]byte } func decodeRawEvent(raw []byte) (rawEvent, error) { @@ -73,9 +73,9 @@ func decodeRawEvent(raw []byte) (rawEvent, error) { return ev, nil } -func (r rawEvent) comm() string { return cString(r.Comm[:]) } -func (r rawEvent) filename() string { return cString(r.Filename[:]) } -func (r rawEvent) filename2() string { return cString(r.Filename2[:]) } +func (r rawEvent) comm() string { return cString(r.Comm[:]) } +func (r rawEvent) filename() string { return cString(r.Filename[:]) } +func (r rawEvent) aux() string { return cString(r.Aux[:]) } func (r rawEvent) eventType() event.Type { typ := event.Type(r.Type) @@ -148,7 +148,7 @@ func (r rawEvent) toEvent() *event.Event { evt.Params.Append(params.DirFD, params.Int64, int64(r.Arg0)) evt.Params.Append(params.NewDirFD, params.Int64, int64(r.Arg1)) evt.Params.Append(params.FilePath, params.Path, r.filename()) - evt.Params.Append(params.FileNewPath, params.Path, r.filename2()) + evt.Params.Append(params.FileNewPath, params.Path, r.aux()) evt.Params.Append(params.FileFlags, params.Uint64, r.Flags) case event.Connect, event.Accept: appendSockParams(evt, r) diff --git a/internal/ebpf/execve_bpfeb.go b/internal/ebpf/execve_bpfeb.go index ecc537a2c..c0d9eb2ac 100644 --- a/internal/ebpf/execve_bpfeb.go +++ b/internal/ebpf/execve_bpfeb.go @@ -23,7 +23,7 @@ type execveScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadExecve returns the embedded CollectionSpec for execve. diff --git a/internal/ebpf/execve_bpfeb.o b/internal/ebpf/execve_bpfeb.o index 193a6f63082ceeca10f80d7c2783d38efb0acc33..87913ab3c3fffae0a004a9cad6f631ad3fcf5970 100644 GIT binary patch delta 4446 zcmc&$U2IfE6h3$6-rL(PVnHBn1YB*AML<>&sfcuoV5@*Bk)I7|VjF|55kif@)Sr0Q zpJ+8cG`S`=rVkBK(kO|AVr-0tC1Pxp2NF$eq7OA8xDPd1eNaRn{LakT^|}cUVss}v zcg{EG%sF$;nVGYLC!Er8XK0O+KA!$&iSxiju=Ekt{7FEjEycGW^mU*=iw2VqIbTJy z$wSV!QP1_ygvGg5@+J%plgi@N7)maYk1+#Q0^`l-X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0afIj+<3@wSmyq?jKt+mA z;xe9&+2DCHkMT{44>Hf^Us~EkrvAU;gWCcBs&2&xzIpw+ruc*@>2s0&c^@3Wc?ikLGRFOn{UVG4#uX@Boq~r1GaoH{j&Iq~P5j_*7&%o(!Om&T zgIC*6O;#Hkg2JYct>GZI`DL}r3(A{)t2@YT@vYvVyyXk)>!5Gz5{S!NS6HPW*|EaP S2Dy%QwZRJt0F|KJk@^eQ4e1*I diff --git a/internal/ebpf/execve_bpfel.go b/internal/ebpf/execve_bpfel.go index bbedc2e6d..5f4f6e613 100644 --- a/internal/ebpf/execve_bpfel.go +++ b/internal/ebpf/execve_bpfel.go @@ -23,7 +23,7 @@ type execveScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadExecve returns the embedded CollectionSpec for execve. diff --git a/internal/ebpf/execve_bpfel.o b/internal/ebpf/execve_bpfel.o index 249deb439058a6c1e71712c69cd4f3f8d8032551..d1daca3055c0d4d9a903a7a3998a0c1a9b0a1195 100644 GIT binary patch delta 4328 zcmcJRU2GIp6oBu{z_Pnt=nsF}2zL7?TYjs6trcY})UG1h1cXXRq*1g+2sH*%m1OEq z6par}Mq{Hq6r%4EMmDlBNui`ev6)|R31{ue=8YyiNxIy%N0zDS>Oz zH=t(FSD;s*_gRE)@gAwY)7t30Q@hNqXWp~;NiLV8XOPlXqu+x}aowi<8T2OY--EsZ zo!GM&Z#JQ~BBiyX)1vdZZ7uNGkVyo7R)t_~`4)zZHQ2%sn3ChaUb6xvZ-R*17KJ~)h z15c#)`Z#o8&3emyg9s8t+FGt}^9$s26Za4DujF$Z_bMJ9__xE7Ly57__b}#T^v}2& zCP@Z;0k^`kmHxz*V9pVCLfRPDchIq>Q5|l=Av)ri4&|*f;H+czz!ETMJtz{e6T3a; zm_el2UqU9>2FH+Me-9bya7<3^A0d}z_)Kj#@9>8>bUJ1NDFf=sLUgxdra}YC8E{qY z!3!At`_?8uSX^>I;Jed5ja)g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J2tJi)&r+ qI<~lWbd49^dd~XVySQ~J=GeAXR>o`KJ>YfluJ_LKZuVkLbN&QqJlv}Q diff --git a/internal/ebpf/exit_bpfeb.go b/internal/ebpf/exit_bpfeb.go index 6750226fd..cb7458b1f 100644 --- a/internal/ebpf/exit_bpfeb.go +++ b/internal/ebpf/exit_bpfeb.go @@ -23,7 +23,7 @@ type exitScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadExit returns the embedded CollectionSpec for exit. diff --git a/internal/ebpf/exit_bpfeb.o b/internal/ebpf/exit_bpfeb.o index ddcef7823a22cd096baf0aae0883e8bef031d90a..0a2fc972b6eb391e6fc367ee6eccad2d85cc211e 100644 GIT binary patch delta 1420 zcmZ9LO-NKx6vxlK?>?IkGba+2#%Z8nrm&od(o%7D4HD$Sg_}St$wkpXUjqj3ksEgn zTotcvJNnorP{{Z|Yoe5nMD|#w)U3}3hJT7Y54X2z9p zD9nT+3d7IAzYi;+5TP-!pM+mBeir^i_!+1R|C#YC@E718hlLSK7*4=up`YOIg>|u< zsOog2TYS@(BPnME8{8BxI1Nq0UxVd%7XEiwjt|3M$3)(Vm-q?W1%;?z z<`5d-|JhM<#;>uZUn8kO=OfKcyNT>k)U$L$v8;VfcSX;N8`_OFizQu(zOhDb73MG2 zSCl>!OF3N4yR#gF;tK@F_-G*_4LwQJV*{|6$9ISZ>%d&g`E{bJt>Bgb<5u{qxAR<| z#j$aGOL9aG2V{a|VHcvqeu3;Kd6x_G0p0^H_zTJlL^pZCNt1U;mY81}o+CNUTrs>z zvWNMz&+vR%CCBSXeju5PAhuy9{3Uq~6Zl}bK`Tsh5D!S;i#@J7pq=ZL0bV06q!XffkuTdRgqH^ce00CT=( z_$$#PZU7(T&1dEYejA1@$MLYRzhA%sbfl6#s}vD`p~@N_C3=AkRnG7|oHkBK4H(AX z?Nt+aD8Nzhu;HgfZ*hfc%#2htlFIDhY|aEmOu>N9TOIQ8c?&!?`8@0?{Hu9kh;lJ7AJ#EDIp5y2P$wSf+WyyK kNSEX9#e~kcb&5${ZtD|qUBg(@=|rC>=`oBUT}~wb0me72WdHyG delta 1426 zcmZ9LPe{~36vyApZ+^CaOxH-%Qrm-ILgn^X%fvkd?V*E*f({)v%q+B8$b(Vw+b*HE zg|V=R*n`j>f{OJZ6trTLphVF{A;JtwD8f^PLG*pUndFzl&b;?|@6DSxZ+=_qoaxN9 zis2^-&lNX{kKI05Hyt8>G-7>e^=;5+bt2Rw7W8Q7lK7}q_^SA>v*Bj%2Yfp)SIdb6 z@DD6{3r(T0kRDfLoH!Bh#80e8ItWu=wBh(o`$}HjeHWP_zBsL ziJ^YmCR7l)VqMH36XS+VjHC*kiPThYL})+ad30bRt$SIwM~{jtIvcGKvwAE#6+U}@ zp!eeG3%z@ar^-u8Z>ehWHk)AHN4qd_55YEWFou9lAmL#bfFpgrPISBs%(3iWAsVOy z*9I7G!*^fvb9@rbLlf6VipXPwY$BQ20CU;|$ZnE@oFEh6O7M_LD0_$oIpMJN-z1r1 zp0qqka+JAbd79)t<~N3+nK4hEUy*!EG8uslH{pUDN%9Cb@Z7o$luS*1^lx7hp14GPYvgr05+f^6*sK#r+SDRs-)$9q6r+R zQkI9&ZFER=TgIR6SvB}%fTQ5F@Ha>vwRnFvNOofI`!GAVee|CrxPjaM zU;MJ+e+jw0{{B_7Uxf^-7R!lsoJ?6mpAEn*f(LT@nAIce&p;l)?QOv-Yq?cdx$$CC u_0ux(Kre26F48(*|4NMLa}8}Gr}GV6qDe1eUD5HzE|J%1tTCN$jQ<7H&9Gho diff --git a/internal/ebpf/exit_bpfel.go b/internal/ebpf/exit_bpfel.go index 960bbdcf8..af3511b69 100644 --- a/internal/ebpf/exit_bpfel.go +++ b/internal/ebpf/exit_bpfel.go @@ -23,7 +23,7 @@ type exitScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadExit returns the embedded CollectionSpec for exit. diff --git a/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MLtvj?eeX z`XMPJG5n;H)9lc+(I|dm?_4`HwTffTv=h>cxsnmLTXCBew_1TdHO5m!%9BLO6GSJ8 z$F0l~DbfEXOUzgXFc4OQfiMBgkmGiIt;EDIEHlIekkm*_5Nj9*oB}h&SaPM~S;^`) zN~AQ5GL1x$Svd4(=SawPZQ{VZVlS8L1{_D^Hw*nkep|sE5_UZ2l$3eJ4rg2dN&g(- zr${fq=M*`T6N-HmVfXt<`H5aaeL(0E84I2*gJ5e@hzg>Ev6?_gWzbp}Oxc19f z%i+>X`FG-TNcq?7OXN$pKak&PJFNUolROB@kkWn^&ntg+1pOi9zZ@nx|f){<(rSh3jUb&AGhEAo|a3WLi*o9nnTLJp5!|4-09bGY`q-#c^Z#r`>b z4k`cpdN%o`+8=Zg=dkkgHvPE$?swI^^5e389a8@H_icJ_xwHzG9u)s0d>vN)mW@81 z|K<-fpmXWb{`fxuA5#APEdNsNkAD{F4=aC{<(DC4{(TSGD?cW-L&|^Gz{Z~mtsH;5 z^iag!jjuz>|Ei3;93rLsmk8i+>Cyh!tH6hp{~pf2OSL~1BK=|Imtm8mjE|J>e)rBR zf9?|Nf1UAWa!BhRE5Q{|d5Ke*CAPbLA&!r)bVI;MPrNcJaY6`JF7sI(?Z5HYuHO<%1J4CtP}Gr);wR zFFmRZ-U*qIbLx=x|Ea5g8F8fjuf|6XSAGg%@kxi2|1n;Fz3vj_oBNW7mA@^8!NuqC zCFQ>cA3418;~Qt6JZ<`|WlY{z>}71f`MojE;MX@HJ|*rOC*j?K4PVuUls5hZZLa+E F{{i1B3C{ok diff --git a/internal/ebpf/file_bpfel.go b/internal/ebpf/file_bpfel.go index 39ff6f15d..1b89ee110 100644 --- a/internal/ebpf/file_bpfel.go +++ b/internal/ebpf/file_bpfel.go @@ -23,7 +23,7 @@ type fileScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadFile returns the embedded CollectionSpec for file. diff --git a/internal/ebpf/file_b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-C^bMF{?*_&?pdkSNcwkbElQt ztw^Da>oF@w;p!B4*y>&B!*|#utlkcmM6AP6=g>KD4u^3NOW$q_ZbS-h^oW(i&?pcp z*_u#yLM1mF+Z{-5)}eFY93)%gb65J9Ex3`}ElIHr93u1Q}B`AV>=ii z7_oD{kIroob3=$=)b44vW!#NHf{_E~+Lo~?j5*VeXe-9jM((t7hn3r{NShkZV?gLp zAoK{(De$n>C=e>`Z<3S|iv#Hh>mnUt4rGKJw*6~W28LlBA?84$8kGTJJvs-@K}L%4 ziKP!mHK{wG64S8cX;iYrZ3|=T-^j<#LH!-8&D-_Yg^c6p^`bbiS=X+EvhF*&PUa|1 z>`<@6g4>@<%Lwd$|Ssb2Xn^r*jvc#mU7VLIPhB?UjG*M{R)Ds((#_^~yhv{4+Kg)BpSAnDhVo7VRJTF+`*Z)5V9c z_a|Gl|5A_o@9&ZSzuYSS`)v-dRsUb!BLCGM^}n`9{uycfUhO~fsLkJhjru<(k$bg& zbj`*O_WyM~@_*|V`NuwFK*{lAMoQ)WJjrvbX z{9g56S+ntj^}nG<{>Qe+KQn3LzgGRDTjalv{4+KgQ~v{U%=P~nj6XWfz2wt2qRyGY zP1`EC&5MJ&ar_M8F9ZY2vCH2%UndbcP4!zx{DXMk+l8m@@b*jmUhSX!QyU|Lh&unj zO?H>R>wmRLz4E{QIUDgH?%!Cl_jTN{s@n8k`7a~?IPMQ={%@C^^Dj#K51#(+w0MbP@Ruax>r5}UTf?^~w|u46RbPs{G|A3==&4}*V!`Tzg` diff --git a/internal/ebpf/loader.go b/internal/ebpf/loader.go index 09582a9f4..1228f5cef 100644 --- a/internal/ebpf/loader.go +++ b/internal/ebpf/loader.go @@ -258,18 +258,6 @@ func (l *loader) attachPrograms(cfg *config.EventSourceConfig) error { {"sys_exit_fork", l.clone.HandleSysExitFork, true}, {"sys_enter_vfork", l.clone.HandleSysEnterVfork, true}, {"sys_exit_vfork", l.clone.HandleSysExitVfork, true}, - {"sys_enter_kill", l.ctl.HandleSysEnterKill, false}, - {"sys_exit_kill", l.ctl.HandleSysExitKill, false}, - // tkill is an obsolescent predecessor of tgkill; treat it like the - // other legacy syscall tracepoints. - {"sys_enter_tkill", l.ctl.HandleSysEnterTkill, true}, - {"sys_exit_tkill", l.ctl.HandleSysExitTkill, true}, - {"sys_enter_tgkill", l.ctl.HandleSysEnterTgkill, false}, - {"sys_exit_tgkill", l.ctl.HandleSysExitTgkill, false}, - {"sys_enter_ptrace", l.ctl.HandleSysEnterPtrace, false}, - {"sys_exit_ptrace", l.ctl.HandleSysExitPtrace, false}, - {"sys_enter_prctl", l.ctl.HandleSysEnterPrctl, false}, - {"sys_exit_prctl", l.ctl.HandleSysExitPrctl, false}, } if cfg == nil || cfg.EnableFileIOEvents { // Legacy variants (open, unlink, rename) follow the fork/vfork @@ -331,12 +319,14 @@ func (l *loader) attachPrograms(cfg *config.EventSourceConfig) error { // Successful clones and process exits are captured from scheduler // tracepoints. Clone syscall exit tracepoints fire in the parent, and // exit/exit_group never return, so their exit tracepoints never fire. + // kill/ptrace/prctl read arguments from pt_regs at tp_btf/sys_exit. tracing := []struct { name string prog *ebpf.Program }{ {"sched_process_fork", l.clone.HandleSchedProcessFork}, {"sched_process_exit", l.exit.HandleSchedProcessExit}, + {"sys_exit", l.ctl.HandleSysExit}, } for _, t := range tracing { if t.prog == nil { diff --git a/internal/ebpf/matrix_test.go b/internal/ebpf/matrix_test.go index c53a492b7..7e3dd91ee 100644 --- a/internal/ebpf/matrix_test.go +++ b/internal/ebpf/matrix_test.go @@ -55,9 +55,9 @@ func syscallMatrix() []matrixRow { {"mmap", event.Mmap, []string{"mmap"}, hookSyscallIO, []string{params.MemBaseAddress, params.MemRegionSize, params.MemProtect, params.MmapFlags, params.Retval}}, {"process_vm_readv", event.ProcessVMRead, []string{"process_vm_readv"}, "tp/syscalls enter/exit; first remote iovec only", []string{params.TargetProcessID, params.MemBaseAddress, params.Retval}}, {"process_vm_writev", event.ProcessVMWrite, []string{"process_vm_writev"}, "tp/syscalls enter/exit; first remote iovec only", []string{params.TargetProcessID, params.MemBaseAddress, params.Retval}}, - {"kill", event.Kill, []string{"kill", "tkill", "tgkill"}, hookSyscallIO, []string{params.TargetProcessID, params.Signal, params.Retval}}, - {"ptrace", event.Ptrace, []string{"ptrace"}, hookSyscallIO, []string{params.PtraceRequest, params.TargetProcessID, params.Retval}}, - {"prctl", event.Prctl, []string{"prctl"}, hookSyscallIO, []string{params.PrctlOption, params.Retval}}, + {"kill", event.Kill, []string{"kill", "tkill", "tgkill"}, "tp_btf/sys_exit", []string{params.TargetProcessID, params.Signal, params.Retval}}, + {"ptrace", event.Ptrace, []string{"ptrace"}, "tp_btf/sys_exit", []string{params.PtraceRequest, params.TargetProcessID, params.Retval}}, + {"prctl", event.Prctl, []string{"prctl"}, "tp_btf/sys_exit", []string{params.PrctlOption, params.Retval}}, } } @@ -69,16 +69,16 @@ func TestSyscallEventMatrix(t *testing.T) { assert.NotEmpty(t, row.syscalls) assert.NotEmpty(t, row.hook) seen[row.typ] = true - raw := rawEvent{Type: uint32(row.typ), Retval: 0, Filename: [256]byte{'/'}, Filename2: [256]byte{'/'}} + raw := rawEvent{Type: uint32(row.typ), Retval: 0, Filename: [256]byte{'/'}, Aux: [256]byte{'/'}} if row.typ == event.Connect || row.typ == event.Accept { - raw.Filename2[0] = byte(unix.AF_INET) - raw.Filename2[1] = 0 - raw.Filename2[2] = 0 - raw.Filename2[3] = 80 - raw.Filename2[4] = 127 - raw.Filename2[5] = 0 - raw.Filename2[6] = 0 - raw.Filename2[7] = 1 + raw.Aux[0] = byte(unix.AF_INET) + raw.Aux[1] = 0 + raw.Aux[2] = 0 + raw.Aux[3] = 80 + raw.Aux[4] = 127 + raw.Aux[5] = 0 + raw.Aux[6] = 0 + raw.Aux[7] = 1 } evt := raw.toEvent() require.Equal(t, row.typ, evt.Type, row.name) @@ -122,7 +122,7 @@ func TestMmapUpdatesProcessState(t *testing.T) { ps := &pstypes.PS{PID: 9, Name: "target", StartBootTime: 1, Threads: map[uint64]pstypes.Thread{}} snap.Put(ps) - raw := rawEvent{Type: uint32(event.Mmap), PID: 9, TGID: 9, Retval: 0x1000, Arg0: 4096, Arg1: 8192, Arg2: 3, Flags: 0x20} + raw := rawEvent{Type: uint32(event.Mmap), PID: 9, TGID: 9, Retval: 0x1000, Arg0: 4096, Arg1: 8192, Arg2: 3, Arg3: 3, Flags: 0} evt := raw.toEvent() applyProcessState(snap, evt) ok, got := snap.Find(9) @@ -130,7 +130,20 @@ func TestMmapUpdatesProcessState(t *testing.T) { require.Len(t, got.Mmaps, 1) assert.Equal(t, uint64(0x1000), uint64(got.Mmaps[0].BaseAddress)) assert.Equal(t, uint64(8192), got.Mmaps[0].Size) - assert.Equal(t, "anonymous", got.Mmaps[0].Type) + assert.Equal(t, "file", got.Mmaps[0].Type) +} + +func TestAnonymousMmapSkipped(t *testing.T) { + snap := ps.NewSnapshotter() + ps := &pstypes.PS{PID: 9, Name: "target", StartBootTime: 1, Threads: map[uint64]pstypes.Thread{}} + snap.Put(ps) + + raw := rawEvent{Type: uint32(event.Mmap), PID: 9, TGID: 9, Retval: 0x1000, Arg1: 8192, Arg2: 3, Arg3: ^uint64(0), Flags: 0x20} + evt := raw.toEvent() + applyProcessState(snap, evt) + ok, got := snap.Find(9) + require.True(t, ok) + assert.Empty(t, got.Mmaps) } func TestFailedSyscallKeepsProcessState(t *testing.T) { diff --git a/internal/ebpf/mem_bpfeb.go b/internal/ebpf/mem_bpfeb.go index e2ee49396..119afa03b 100644 --- a/internal/ebpf/mem_bpfeb.go +++ b/internal/ebpf/mem_bpfeb.go @@ -23,7 +23,7 @@ type memScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadMem returns the embedded CollectionSpec for mem. diff --git a/internal/ebpf/mem_bpfeb.o b/internal/ebpf/mem_bpfeb.o index c42f95631c87094af4da1872cb54734f10ec1c36..11508e9f158433e53380583dbc8c08bd4fc2e73c 100644 GIT bin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F6}$Z^&dqkxZ2KKpShw5LSGM=lbVw|{|D?O}k_E12cE>eyMHI~`_u9yE-cNhuhi zE#-Nn;Eb;M0|XN&<#|dvu<~3tZ2PAfv0Hgw5VrCxp0R3K$Zw(lZ;0Hkq5%(R^_pG9 zEPAamQo*koxwi6K%5$d~u$1R+!*)R3Yq*qW_5kaD;Zk<}TNt59pX+F3UC$w^-(Y#p zuA|SJEzj9?^m()8IU~(KmsM(F17{bh)aT8X=j=NAY$vo?@|*?N*5}QZXXyVm^?9@9 z8R!2s^?9@9nf2fPT>fABTZy9y-!fGv1TcpBe-bO06pCm?vj{t$vxWp1o5I=E=DOYA7GYy`InDK9#TFK9?uoNd5~9Kmi5- diff --git a/internal/ebpf/net_bpfel.go b/internal/ebpf/net_bpfel.go index 0b2ac2fe4..da8e0c87a 100644 --- a/internal/ebpf/net_bpfel.go +++ b/internal/ebpf/net_bpfel.go @@ -23,7 +23,7 @@ type netScratchValue struct { Truncated uint32 Pad uint32 Filename [256]uint8 - Filename2 [256]uint8 + Aux [256]uint8 } // loadNet returns the embedded CollectionSpec for net. diff --git a/internal/ebpf/net_bpfel.o b/internal/ebpf/net_bpfel.o index 17569c1521e7cf0c49a57940f785d6de29fff23a..ca639ddafb05f690ca4ee25c37bf6f989533114d 100644 GIT binary patch delta 6771 zcmc(je`sB28ONV<&fV?J%}sNcmNc8)dTR^4(f+vYk~W!TyEEO))(TNtiBst9=0-Nu z-ci)6b~{%IF4ZxkXLJ`fB%-pE6-h~jfU8DmCCY^OV-U1Llrru_O9Ykt;n45*z0Y%V zxaeOK^OAes=kq-8uk*g|dB5jmaonF8_b2mS=~C~ez5Yta>^*xQ_iwu*E~V~7Hm~+J z;c$5 z@*I9cu=gP^;`adT{m85M9fghLu^j6^tek>fg#Y9kN3R^{4L=3mjo4Gj@s~LOTa(`p zV=&PeBl~|RWBf4M;dra~F`=&xj4>1rpbw6Zpa2JO5cd5WMA|Sh!>~UDn>WLBLhT&v zht)2^{sinnC2YR|)d8us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nuBVzD7p-srR)D!S~rJjWE zg2%ab2pz<-1Ilrj3q)=omfjUJyGkvhW7dp$Pj9TsTizE(59iUW`A+Xz|K8f^=MB4g zK~y3?ThlJ)F*D}PdrtKaq|O~bn`(PpvB7R`46HL6aSWftu?@*Df@^EJfY=NlNBRcv zn8H0^=b$yq{Tc3GA*z%9N3cI_-3a%8BAvrT{QCaESK^&HZ!1a?8KuG=E{rJZlY#xr z+ZA0BhLj?Wl@I7eUr#6+6~4*y`xIq_?}F6nRy%!BHRwu?-M13k3bu;_<@#j5PU;;7^&ojIaO;YDa|o+wwwUhr#S-Ht1tC7Kg%20Q17=7rCISA8HVl(7yr7Nl^C2j+=> zm$451EBp|B^&RgV$~QC()fSh3FJ7{O|EXKh=LjI%kS~SngqQlbEu%DW2p_^R2;~iF z;n5YG5uTDh-ww|&9mu!A?8L)y@VD=TriA&+GG7xWGB4Xh6DMmLTw1GnHFObcG4$g< DhPjb6 diff --git a/internal/ebpf/spike/c/vmlinux.h b/internal/ebpf/spike/c/vmlinux.h index da94af6b5..c5a3f8ae2 100644 --- a/internal/ebpf/spike/c/vmlinux.h +++ b/internal/ebpf/spike/c/vmlinux.h @@ -73,6 +73,16 @@ enum bpf_map_type { #define TASK_COMM_LEN 16 #endif +/* x86-64 field names from kernel BTF. CO-RE relocates by name. */ +struct pt_regs { + unsigned long r10; + unsigned long r8; + unsigned long dx; + unsigned long si; + unsigned long di; + unsigned long orig_ax; +} __attribute__((preserve_access_index)); + struct seq_file; struct bpf_iter_meta { From 54978c05671ec090ef475db311faea43a1060ff6 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 16 Sep 2026 09:21:28 +0200 Subject: [PATCH 42/65] feat(filter): Add Linux field catalog for the syscall event matrix Keep deprecated kevt aliases on Windows so they never enter the Linux catalog, and register process, file, network, memory, and thread fields for the captured syscalls. --- pkg/filter/fields/defs.go | 79 +++++++++++++++++----------- pkg/filter/fields/defs_linux.go | 53 +++++++++++++++++-- pkg/filter/fields/defs_linux_test.go | 39 ++++++++++++-- pkg/filter/fields/defs_windows.go | 39 ++++++++++++-- 4 files changed, 165 insertions(+), 45 deletions(-) diff --git a/pkg/filter/fields/defs.go b/pkg/filter/fields/defs.go index cafd29eb6..8f76f848d 100644 --- a/pkg/filter/fields/defs.go +++ b/pkg/filter/fields/defs.go @@ -117,6 +117,20 @@ const ( PsUUID Field = "ps.uuid" // PsParentUUID represents the unique parent process identifier PsParentUUID Field = "ps.parent.uuid" + // PsUID represents the real user identifier of the process + PsUID Field = "ps.uid" + // PsGID represents the real group identifier of the process + PsGID Field = "ps.gid" + // PsSignal represents the POSIX signal number + PsSignal Field = "ps.signal" + // PsTargetPID represents the target process identifier of kill, ptrace, or process_vm operations + PsTargetPID Field = "ps.target.pid" + // PsPtraceRequest represents the ptrace request code + PsPtraceRequest Field = "ps.ptrace.request" + // PsPrctlOption represents the prctl option code + PsPrctlOption Field = "ps.prctl.option" + // PsCloneFlags represents the clone flags bitmask + PsCloneFlags Field = "ps.clone.flags" // PsTokenIntegrityLevel represents the field that indicates the current process integrity level PsTokenIntegrityLevel = "ps.token.integrity_level" // PsTokenIsElevated represents the field that indicates if the current process token is elevated @@ -203,6 +217,8 @@ const ( ThreadStartAddress Field = "thread.start_address" // ThreadPID is the process identifier where the thread is created ThreadPID Field = "thread.pid" + // ThreadTID is the thread identifier + ThreadTID Field = "thread.tid" // ThreadTEB is the thread environment block base address ThreadTEB Field = "thread.teb_address" // ThreadAccessMask represents the thread access rights field @@ -361,6 +377,12 @@ const ( EvtNparams Field = "evt.nparams" // EvtArg represents the field sequence for generic argument access EvtArg Field = "evt.arg" + // EvtRetval represents the syscall return value + EvtRetval Field = "evt.retval" + // EvtSyscall represents the raw architecture-specific syscall number + EvtSyscall Field = "evt.syscall" + // EvtTruncated indicates whether variable-length event fields were truncated + EvtTruncated Field = "evt.truncated" // EvtIsDirectSyscall represents the field that designates if this event is // performing a direct syscall. EvtIsDirectSyscall Field = "evt.is_direct_syscall" @@ -442,6 +464,12 @@ const ( NetSIPNames Field = "net.sip.names" // NetDIPNames represents the destination IP names NetDIPNames Field = "net.dip.names" + // NetFamily represents the socket address family + NetFamily Field = "net.family" + // NetPath represents the filesystem path of an AF_UNIX socket + NetPath Field = "net.path" + // NetFD represents the socket file descriptor + NetFD Field = "net.fd" // FileObject represents the address of the file object FileObject Field = "file.object" @@ -453,6 +481,18 @@ const ( FilePathStem Field = "file.path.stem" // FileExtension represents the file extension (e.g. .exe or .dll) FileExtension Field = "file.extension" + // FileNewPath represents the destination path of a rename + FileNewPath Field = "file.new_path" + // FileDirFD represents a directory file descriptor, including AT_FDCWD + FileDirFD Field = "file.dirfd" + // FileFD represents a file descriptor + FileFD Field = "file.fd" + // FileFlags represents the raw openat, unlinkat, or renameat flags bitmask + FileFlags Field = "file.flags" + // FileMode represents the file creation mode supplied to openat + FileMode Field = "file.mode" + // FileTruncated indicates whether the file path was truncated + FileTruncated Field = "file.truncated" // FileOperation represents the file operation (e.g. create) FileOperation Field = "file.operation" // FileShareMask represents the file share mask @@ -639,6 +679,14 @@ const ( MemProtection Field = "mem.protection" // MemProtectionMask identifies the field that represents the memory protection in mask notation MemProtectionMask Field = "mem.protection.mask" + // MemFlags represents the mmap flags bitmask + MemFlags Field = "mem.flags" + // MemFD represents the file descriptor backing a mapping + MemFD Field = "mem.fd" + // MemOffset represents the file offset of a memory mapping + MemOffset Field = "mem.offset" + // MemTargetPID represents the target process identifier of a process_vm operation + MemTargetPID Field = "mem.target.pid" // DNSName identifies the field that represents the DNS name DNSName Field = "dns.name" @@ -936,37 +984,6 @@ var commonFields = map[Field]FieldInfo{ } return true }}}, - KevtSeq: {KevtSeq, "event sequence number", params.Uint64, []string{"kevt.seq > 666"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtSeq}}, nil}, - KevtCPU: {KevtCPU, "logical processor core where the event was generated", params.Uint8, []string{"kevt.cpu = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCPU}}, nil}, - KevtName: {KevtName, "symbolical event name", platformAnsiString(), []string{"kevt.name = 'CreateThread'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtName}}, nil}, - KevtCategory: {KevtCategory, "event category", platformAnsiString(), []string{"kevt.category = 'registry'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCategory}}, nil}, - KevtDesc: {KevtDesc, "event description", platformAnsiString(), []string{"kevt.desc contains 'Creates a new process'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDesc}}, nil}, - KevtHost: {KevtHost, "host name on which the event was produced", platformString(), []string{"kevt.host contains 'kitty'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtHost}}, nil}, - KevtTime: {KevtTime, "event timestamp as a time string", params.Time, []string{"kevt.time = '17:05:32'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTime}}, nil}, - KevtTimeHour: {KevtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"kevt.time.h = 23"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeHour}}, nil}, - KevtTimeMin: {KevtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"kevt.time.m = 54"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeMin}}, nil}, - KevtTimeSec: {KevtTimeSec, "second offset within the minute on which the event occurred", params.Time, []string{"kevt.time.s = 0"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeSec}}, nil}, - KevtTimeNs: {KevtTimeNs, "nanoseconds specified by event timestamp", params.Int64, []string{"kevt.time.ns > 1591191629102337000"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeNs}}, nil}, - KevtDate: {KevtDate, "event timestamp as a date string", params.Time, []string{"kevt.date = '2018-03-03'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDate}}, nil}, - KevtDateDay: {KevtDateDay, "day of the month on which the event occurred", params.Time, []string{"kevt.date.d = 12"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateDay}}, nil}, - KevtDateMonth: {KevtDateMonth, "month of the year on which the event occurred", params.Time, []string{"kevt.date.m = 11"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateMonth}}, nil}, - KevtDateYear: {KevtDateYear, "year on which the event occurred", params.Uint32, []string{"kevt.date.y = 2020"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateYear}}, nil}, - KevtDateTz: {KevtDateTz, "time zone associated with the event timestamp", platformAnsiString(), []string{"kevt.date.tz = 'UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateTz}}, nil}, - KevtDateWeek: {KevtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"kevt.date.week = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeek}}, nil}, - KevtDateWeekday: {KevtDateWeekday, "week day on which the event occurred", platformAnsiString(), []string{"kevt.date.weekday = 'Monday'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeekday}}, nil}, - KevtNparams: {KevtNparams, "number of parameters", params.Int8, []string{"kevt.nparams > 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtNparams}}, nil}, - KevtArg: {KevtArg, "event parameter", params.Object, []string{"kevt.arg[cmdline] istartswith 'C:\\Windows'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtArg}}, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { - for _, c := range s { - switch { - case unicode.IsLower(c): - case unicode.IsNumber(c): - case c == '_': - default: - return false - } - } - return true - }}}, PsName: {PsName, "process image name including the file extension", platformString(), []string{"ps.name contains 'firefox'"}, nil, nil}, PsCmdline: {PsCmdline, "process command line", platformString(), []string{"ps.cmdline contains 'java'"}, nil, nil}, PsExe: {PsExe, "full name of the process' executable", platformString(), []string{"ps.exe = 'C:\\Windows\\system32\\cmd.exe'"}, nil, nil}, diff --git a/pkg/filter/fields/defs_linux.go b/pkg/filter/fields/defs_linux.go index f0daa6b47..d8859cb32 100644 --- a/pkg/filter/fields/defs_linux.go +++ b/pkg/filter/fields/defs_linux.go @@ -7,6 +7,7 @@ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 @@ -26,9 +27,51 @@ func platformString() params.Type { return params.String } func platformAnsiString() params.Type { return params.String } var fields = platformFields(map[Field]FieldInfo{ - EvtPID: {EvtPID, "process identifier generating the event", params.Uint64, []string{"evt.pid = 6"}, nil, nil}, - EvtTID: {EvtTID, "thread identifier generating the event", params.Uint64, []string{"evt.tid = 1024"}, nil, nil}, - PsPid: {PsPid, "process identifier", params.Uint64, []string{"ps.pid = 1024"}, nil, nil}, - PsPpid: {PsPpid, "parent process identifier", params.Uint64, []string{"ps.ppid = 45"}, nil, nil}, - PsParentPid: {PsParentPid, "parent process id", params.Uint64, []string{"ps.parent.pid = 4"}, nil, nil}, + EvtPID: {EvtPID, "process identifier generating the event", params.Uint64, []string{"evt.pid = 6"}, nil, nil}, + EvtTID: {EvtTID, "thread identifier generating the event", params.Uint64, []string{"evt.tid = 1024"}, nil, nil}, + EvtRetval: {EvtRetval, "syscall return value", params.Int64, []string{"evt.retval < 0"}, nil, nil}, + EvtSyscall: {EvtSyscall, "raw architecture-specific syscall number", params.Uint32, []string{"evt.syscall = 59"}, nil, nil}, + EvtTruncated: {EvtTruncated, "indicates whether variable-length event fields were truncated", params.Bool, []string{"evt.truncated = true"}, nil, nil}, + PsPid: {PsPid, "process identifier", params.Uint64, []string{"ps.pid = 1024"}, nil, nil}, + PsPpid: {PsPpid, "parent process identifier", params.Uint64, []string{"ps.ppid = 45"}, nil, nil}, + PsParentPid: {PsParentPid, "parent process id", params.Uint64, []string{"ps.parent.pid = 4"}, nil, nil}, + PsUUID: {PsUUID, "unique process identifier", params.Uint64, []string{"ps.uuid > 6000054355"}, nil, nil}, + PsParentUUID: {PsParentUUID, "unique parent process identifier", params.Uint64, []string{"ps.parent.uuid > 6000054355"}, nil, nil}, + PsUID: {PsUID, "real user identifier of the process", params.Uint32, []string{"ps.uid = 0"}, nil, nil}, + PsGID: {PsGID, "real group identifier of the process", params.Uint32, []string{"ps.gid = 0"}, nil, nil}, + PsParentArgs: {PsParentArgs, "parent process command line arguments", params.Slice, []string{"ps.parent.args in ('-c', 'bash')"}, nil, nil}, + PsParentCwd: {PsParentCwd, "parent process current working directory", platformString(), []string{"ps.parent.cwd = '/home/user'"}, nil, nil}, + PsParentUsername: {PsParentUsername, "parent process username", platformString(), []string{"ps.parent.username = 'root'"}, nil, nil}, + PsParentEnvs: {PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('PATH:/usr/bin')"}, nil, nil}, + PsSignal: {PsSignal, "POSIX signal number", params.Int64, []string{"ps.signal = 9"}, nil, nil}, + PsTargetPID: {PsTargetPID, "target process identifier of kill, ptrace, or process_vm operations", params.Uint64, []string{"ps.target.pid = 4242"}, nil, nil}, + PsPtraceRequest: {PsPtraceRequest, "ptrace request code", params.Int64, []string{"ps.ptrace.request = 16"}, nil, nil}, + PsPrctlOption: {PsPrctlOption, "prctl option code", params.Int64, []string{"ps.prctl.option = 15"}, nil, nil}, + PsCloneFlags: {PsCloneFlags, "clone flags bitmask", params.Uint64, []string{"ps.clone.flags = 0"}, nil, nil}, + FilePath: {FilePath, "full file path", platformString(), []string{"file.path = '/etc/passwd'"}, nil, nil}, + FilePathStem: {FilePathStem, "full file path without extension", platformString(), []string{"file.path.stem = '/tmp/secret'"}, nil, nil}, + FileName: {FileName, "file base name", platformString(), []string{"file.name = 'passwd'"}, nil, nil}, + FileExtension: {FileExtension, "file extension", platformAnsiString(), []string{"file.extension = '.so'"}, nil, nil}, + FileNewPath: {FileNewPath, "destination path of a rename", platformString(), []string{"file.new_path = '/tmp/renamed'"}, nil, nil}, + FileDirFD: {FileDirFD, "directory file descriptor, including AT_FDCWD", params.Int64, []string{"file.dirfd < 0"}, nil, nil}, + FileFD: {FileFD, "file descriptor returned by openat", params.Int64, []string{"file.fd = 3"}, nil, nil}, + FileFlags: {FileFlags, "raw openat, unlinkat, or renameat flags bitmask", params.Uint64, []string{"file.flags = 0"}, nil, nil}, + FileMode: {FileMode, "file creation mode supplied to openat", params.Uint64, []string{"file.mode = 420"}, nil, nil}, + FileTruncated: {FileTruncated, "indicates whether the file path was truncated", params.Bool, []string{"file.truncated = true"}, nil, nil}, + NetDIP: {NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil}, + NetSIP: {NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil}, + NetDport: {NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil}, + NetSport: {NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil}, + NetFamily: {NetFamily, "socket address family", params.Uint16, []string{"net.family = 2"}, nil, nil}, + NetPath: {NetPath, "filesystem path of an AF_UNIX socket", platformString(), []string{"net.path = '/tmp/app.sock'"}, nil, nil}, + NetFD: {NetFD, "socket file descriptor", params.Int64, []string{"net.fd = 5"}, nil, nil}, + MemBaseAddress: {MemBaseAddress, "region base address", params.Uint64, []string{"mem.address = 8192"}, nil, nil}, + MemRegionSize: {MemRegionSize, "region size", params.Uint64, []string{"mem.size > 4096"}, nil, nil}, + MemProtection: {MemProtection, "mapping protection bitmask", params.Uint32, []string{"mem.protection = 3"}, nil, nil}, + MemFlags: {MemFlags, "mmap flags bitmask", params.Uint64, []string{"mem.flags = 1"}, nil, nil}, + MemFD: {MemFD, "file descriptor backing a mapping", params.Int64, []string{"mem.fd = 3"}, nil, nil}, + MemOffset: {MemOffset, "file offset of a memory mapping", params.Uint64, []string{"mem.offset = 0"}, nil, nil}, + MemTargetPID: {MemTargetPID, "target process identifier of a process_vm operation", params.Uint64, []string{"mem.target.pid = 4242"}, nil, nil}, + ThreadTID: {ThreadTID, "thread identifier", params.Uint64, []string{"thread.tid = 1024"}, nil, nil}, + ThreadPID: {ThreadPID, "thread group identifier of the thread", params.Uint64, []string{"thread.pid = 1024"}, nil, nil}, }) diff --git a/pkg/filter/fields/defs_linux_test.go b/pkg/filter/fields/defs_linux_test.go index 381e3ac5b..04318557a 100644 --- a/pkg/filter/fields/defs_linux_test.go +++ b/pkg/filter/fields/defs_linux_test.go @@ -7,6 +7,7 @@ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 @@ -31,14 +32,42 @@ func TestLinuxFields(t *testing.T) { require.True(t, IsField(string(EvtName))) require.True(t, IsField(string(PsName))) require.True(t, IsField(string(PsParentExe))) + require.True(t, IsField(string(PsUUID))) + require.True(t, IsField(string(PsUID))) + require.True(t, IsField(string(FilePath))) + require.True(t, IsField(string(FileNewPath))) + require.True(t, IsField(string(NetDIP))) + require.True(t, IsField(string(NetFamily))) + require.True(t, IsField(string(MemBaseAddress))) + require.True(t, IsField(string(MemFlags))) + require.True(t, IsField(string(ThreadTID))) + require.True(t, IsField(string(EvtRetval))) require.Equal(t, params.String, EvtName.Type()) require.Equal(t, params.String, PsName.Type()) require.Equal(t, params.Uint64, EvtPID.Type()) require.Equal(t, params.Uint64, EvtTID.Type()) require.Equal(t, params.Uint64, PsPid.Type()) - require.False(t, IsField(string(KevtPID))) - require.False(t, IsField(string(KevtTID))) - require.False(t, IsField(string(PsComm))) - require.False(t, IsField(string(RegistryPath))) - require.False(t, IsField(string(PeEntrypoint))) + require.Equal(t, params.Int64, EvtRetval.Type()) + require.Equal(t, params.IP, NetDIP.Type()) + require.Equal(t, params.Uint32, MemProtection.Type()) +} + +func TestLinuxExcludesWindowsOnlyFields(t *testing.T) { + unavailable := []Field{ + KevtPID, KevtTID, KevtSeq, KevtName, KevtArg, KevtCPU, KevtHost, + PsComm, PsSID, PsDomain, PsIsWOW64Field, PsPeNumSections, + RegistryPath, PeEntrypoint, HandleName, ImagePath, ModulePath, DllPath, + DNSName, ThreadpoolPoolID, FileObject, FileOperation, FileIsDLL, + MemPageType, MemAllocType, MemProtectionMask, ThreadTEB, + EvtIsDirectSyscall, EvtIsIndirectSyscall, + } + for _, field := range unavailable { + require.False(t, IsField(string(field)), "%s should be unavailable on Linux", field) + } +} + +func TestLinuxKeVtNotDeprecatedBecauseAbsent(t *testing.T) { + deprecated, d := IsDeprecated(KevtArg) + require.False(t, deprecated) + require.Nil(t, d) } diff --git a/pkg/filter/fields/defs_windows.go b/pkg/filter/fields/defs_windows.go index 14faab085..3647ac5e7 100644 --- a/pkg/filter/fields/defs_windows.go +++ b/pkg/filter/fields/defs_windows.go @@ -30,10 +30,41 @@ func platformString() params.Type { return params.UnicodeString } func platformAnsiString() params.Type { return params.AnsiString } var fields = platformFields(map[Field]FieldInfo{ - EvtPID: {EvtPID, "process identifier generating the event", params.Uint32, []string{"evt.pid = 6"}, nil, nil}, - EvtTID: {EvtTID, "thread identifier generating the event", params.Uint32, []string{"evt.tid = 1024"}, nil, nil}, - KevtPID: {KevtPID, "process identifier generating the event", params.Uint32, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil}, - KevtTID: {KevtTID, "thread identifier generating the event", params.Uint32, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil}, + EvtPID: {EvtPID, "process identifier generating the event", params.Uint32, []string{"evt.pid = 6"}, nil, nil}, + EvtTID: {EvtTID, "thread identifier generating the event", params.Uint32, []string{"evt.tid = 1024"}, nil, nil}, + KevtPID: {KevtPID, "process identifier generating the event", params.Uint32, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil}, + KevtTID: {KevtTID, "thread identifier generating the event", params.Uint32, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil}, + KevtSeq: {KevtSeq, "event sequence number", params.Uint64, []string{"kevt.seq > 666"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtSeq}}, nil}, + KevtCPU: {KevtCPU, "logical processor core where the event was generated", params.Uint8, []string{"kevt.cpu = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCPU}}, nil}, + KevtName: {KevtName, "symbolical event name", platformAnsiString(), []string{"kevt.name = 'CreateThread'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtName}}, nil}, + KevtCategory: {KevtCategory, "event category", platformAnsiString(), []string{"kevt.category = 'registry'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCategory}}, nil}, + KevtDesc: {KevtDesc, "event description", platformAnsiString(), []string{"kevt.desc contains 'Creates a new process'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDesc}}, nil}, + KevtHost: {KevtHost, "host name on which the event was produced", platformString(), []string{"kevt.host contains 'kitty'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtHost}}, nil}, + KevtTime: {KevtTime, "event timestamp as a time string", params.Time, []string{"kevt.time = '17:05:32'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTime}}, nil}, + KevtTimeHour: {KevtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"kevt.time.h = 23"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeHour}}, nil}, + KevtTimeMin: {KevtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"kevt.time.m = 54"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeMin}}, nil}, + KevtTimeSec: {KevtTimeSec, "second offset within the minute on which the event occurred", params.Time, []string{"kevt.time.s = 0"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeSec}}, nil}, + KevtTimeNs: {KevtTimeNs, "nanoseconds specified by event timestamp", params.Int64, []string{"kevt.time.ns > 1591191629102337000"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeNs}}, nil}, + KevtDate: {KevtDate, "event timestamp as a date string", params.Time, []string{"kevt.date = '2018-03-03'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDate}}, nil}, + KevtDateDay: {KevtDateDay, "day of the month on which the event occurred", params.Time, []string{"kevt.date.d = 12"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateDay}}, nil}, + KevtDateMonth: {KevtDateMonth, "month of the year on which the event occurred", params.Time, []string{"kevt.date.m = 11"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateMonth}}, nil}, + KevtDateYear: {KevtDateYear, "year on which the event occurred", params.Uint32, []string{"kevt.date.y = 2020"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateYear}}, nil}, + KevtDateTz: {KevtDateTz, "time zone associated with the event timestamp", platformAnsiString(), []string{"kevt.date.tz = 'UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateTz}}, nil}, + KevtDateWeek: {KevtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"kevt.date.week = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeek}}, nil}, + KevtDateWeekday: {KevtDateWeekday, "week day on which the event occurred", platformAnsiString(), []string{"kevt.date.weekday = 'Monday'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeekday}}, nil}, + KevtNparams: {KevtNparams, "number of parameters", params.Int8, []string{"kevt.nparams > 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtNparams}}, nil}, + KevtArg: {KevtArg, "event parameter", params.Object, []string{"kevt.arg[cmdline] istartswith 'C:\\Windows'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtArg}}, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { + for _, c := range s { + switch { + case unicode.IsLower(c): + case unicode.IsNumber(c): + case c == '_': + default: + return false + } + } + return true + }}}, PsPid: {PsPid, "process identifier", params.PID, []string{"ps.pid = 1024"}, nil, nil}, PsPpid: {PsPpid, "parent process identifier", params.PID, []string{"ps.ppid = 45"}, nil, nil}, PsParentPid: {PsParentPid, "parent process id", params.Uint32, []string{"ps.parent.pid = 4"}, nil, nil}, From c687d0fc205fd76bd9af27ea074f8aeea84cd321 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 16 Sep 2026 09:21:31 +0200 Subject: [PATCH 43/65] feat(filter): Evaluate Linux process, file, network, memory, and thread fields Wire accessors for the syscall event matrix, gate file/net/mem on the existing enable flags, and expose syscall return, number, and truncation on evt fields. --- pkg/filter/accessor.go | 2 +- pkg/filter/accessor_linux.go | 274 ++++++++++++++++++++++++++++- pkg/filter/accessor_stubs_linux.go | 5 +- pkg/filter/accessor_windows.go | 3 + pkg/filter/filter_linux.go | 11 ++ 5 files changed, 281 insertions(+), 14 deletions(-) diff --git a/pkg/filter/accessor.go b/pkg/filter/accessor.go index cb093e90d..925630515 100644 --- a/pkg/filter/accessor.go +++ b/pkg/filter/accessor.go @@ -144,7 +144,7 @@ func (*evtAccessor) Get(f Field, evt *event.Event) (params.Value, error) { return evt.Evasions&uint32(evasion.IndirectSyscall) != 0, nil } - return nil, nil + return platformEvtValue(f, evt) } // narrowAccessors dynamically disables filter accessors by walking diff --git a/pkg/filter/accessor_linux.go b/pkg/filter/accessor_linux.go index 432a11540..ad5e49a0c 100644 --- a/pkg/filter/accessor_linux.go +++ b/pkg/filter/accessor_linux.go @@ -7,6 +7,7 @@ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 @@ -21,10 +22,14 @@ package filter import ( + "path/filepath" + "strings" + "github.com/rabbitstack/fibratus/pkg/event" "github.com/rabbitstack/fibratus/pkg/event/params" "github.com/rabbitstack/fibratus/pkg/filter/fields" "github.com/rabbitstack/fibratus/pkg/ps" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" ) // GetAccessors returns the accessors available on Linux. @@ -32,7 +37,32 @@ func GetAccessors() []Accessor { return []Accessor{ newEventAccessor(), newPSAccessor(nil), + newFileAccessor(), + newNetworkAccessor(), + newMemAccessor(), + newThreadAccessor(), + } +} + +// platformEvtValue resolves evt fields available only on Linux. +func platformEvtValue(f Field, evt *event.Event) (params.Value, error) { + switch f.Name { + case fields.EvtRetval: + return evt.Params.GetInt64(params.Retval) + case fields.EvtSyscall: + return evt.Params.GetUint32(params.SyscallID) + case fields.EvtTruncated: + return evt.Params.TryGetUint32(params.Truncated) != 0, nil + default: + return nil, nil + } +} + +func getParentPs(e *event.Event) *pstypes.PS { + if e.PS == nil { + return nil } + return e.PS.Parent } type psAccessor struct { @@ -86,39 +116,245 @@ func (a *psAccessor) Get(f Field, e *event.Event) (params.Value, error) { return nil, ErrPsNil } return e.PS.Username, nil + case fields.PsUID: + if e.PS != nil { + return e.PS.UID, nil + } + return e.Params.GetUint32(params.UID) + case fields.PsGID: + if e.PS != nil { + return e.PS.GID, nil + } + return e.Params.GetUint32(params.GID) + case fields.PsUUID: + if e.PS == nil { + return nil, ErrPsNil + } + return e.PS.UUID(), nil case fields.PsEnvs: if e.PS == nil { return nil, ErrPsNil } - return e.PS.Envs, nil + if f.Arg != "" { + if v, ok := e.PS.Envs[f.Arg]; ok { + return v, nil + } + for k, v := range e.PS.Envs { + if strings.HasPrefix(k, f.Arg) { + return v, nil + } + } + return "", nil + } + envs := make([]string, 0, len(e.PS.Envs)) + for k, v := range e.PS.Envs { + envs = append(envs, k+":"+v) + } + return envs, nil case fields.PsParentPid: - if e.PS == nil || e.PS.Parent == nil { + parent := getParentPs(e) + if parent == nil { return nil, ErrPsNil } - return e.PS.Parent.PID, nil + return parent.PID, nil case fields.PsParentName: - if e.PS == nil || e.PS.Parent == nil { + parent := getParentPs(e) + if parent == nil { return nil, ErrPsNil } - return e.PS.Parent.Name, nil + return parent.Name, nil case fields.PsParentCmdline: - if e.PS == nil || e.PS.Parent == nil { + parent := getParentPs(e) + if parent == nil { return nil, ErrPsNil } - return e.PS.Parent.Cmdline, nil + return parent.Cmdline, nil case fields.PsParentExe: - if e.PS == nil || e.PS.Parent == nil { + parent := getParentPs(e) + if parent == nil { return nil, ErrPsNil } - return e.PS.Parent.Exe, nil + return parent.Exe, nil + case fields.PsParentArgs: + parent := getParentPs(e) + if parent == nil { + return nil, ErrPsNil + } + return parent.Args, nil + case fields.PsParentCwd: + parent := getParentPs(e) + if parent == nil { + return nil, ErrPsNil + } + return parent.Cwd, nil + case fields.PsParentUsername: + parent := getParentPs(e) + if parent == nil { + return nil, ErrPsNil + } + return parent.Username, nil + case fields.PsParentUUID: + parent := getParentPs(e) + if parent == nil { + return nil, ErrPsNil + } + return parent.UUID(), nil + case fields.PsParentEnvs: + parent := getParentPs(e) + if parent == nil { + return nil, ErrPsNil + } + envs := make([]string, 0, len(parent.Envs)) + for k, v := range parent.Envs { + envs = append(envs, k+":"+v) + } + return envs, nil + case fields.PsSignal: + sig, err := e.Params.GetInt32(params.Signal) + if err != nil { + return nil, err + } + return int64(sig), nil + case fields.PsTargetPID: + return e.Params.GetUint64(params.TargetProcessID) + case fields.PsPtraceRequest: + return e.Params.GetInt64(params.PtraceRequest) + case fields.PsPrctlOption: + return e.Params.GetInt64(params.PrctlOption) + case fields.PsCloneFlags: + return e.Params.GetUint64(params.CloneFlags) default: return nil, nil } } +type fileAccessor struct{} + +func (fileAccessor) SetFields([]Field) {} +func (fileAccessor) SetSegments([]fields.Segment) {} +func (fileAccessor) IsFieldAccessible(e *event.Event) bool { return e.Category == event.File } +func newFileAccessor() Accessor { return &fileAccessor{} } + +func (*fileAccessor) Get(f Field, e *event.Event) (params.Value, error) { + switch f.Name { + case fields.FilePath: + return e.GetParamAsString(params.FilePath), nil + case fields.FilePathStem: + return pathStem(e.GetParamAsString(params.FilePath)), nil + case fields.FileName: + return filepath.Base(e.GetParamAsString(params.FilePath)), nil + case fields.FileExtension: + return filepath.Ext(e.GetParamAsString(params.FilePath)), nil + case fields.FileNewPath: + return e.GetParamAsString(params.FileNewPath), nil + case fields.FileDirFD: + return e.Params.GetInt64(params.DirFD) + case fields.FileFD: + return e.Params.GetInt64(params.FD) + case fields.FileFlags: + return e.Params.GetUint64(params.FileFlags) + case fields.FileMode: + return e.Params.GetUint64(params.FileMode) + case fields.FileTruncated: + // for file events both truncation bits designate a clipped + // path: the source path or the rename destination + return e.Params.TryGetUint32(params.Truncated) != 0, nil + default: + return nil, nil + } +} + +type networkAccessor struct{} + +func (networkAccessor) SetFields([]Field) {} +func (networkAccessor) SetSegments([]fields.Segment) {} +func (networkAccessor) IsFieldAccessible(e *event.Event) bool { return e.Category == event.Net } +func newNetworkAccessor() Accessor { return &networkAccessor{} } + +func (*networkAccessor) Get(f Field, e *event.Event) (params.Value, error) { + switch f.Name { + case fields.NetDIP: + return e.Params.GetIP(params.NetDIP) + case fields.NetSIP: + return e.Params.GetIP(params.NetSIP) + case fields.NetDport: + return e.Params.GetUint16(params.NetDport) + case fields.NetSport: + return e.Params.GetUint16(params.NetSport) + case fields.NetFamily: + return e.Params.GetUint16(params.SockFamily) + case fields.NetPath: + return e.GetParamAsString(params.SockPath), nil + case fields.NetFD: + return e.Params.GetInt64(params.FD) + default: + return nil, nil + } +} + +type memAccessor struct{} + +func (memAccessor) SetFields([]Field) {} +func (memAccessor) SetSegments([]fields.Segment) {} +func (memAccessor) IsFieldAccessible(e *event.Event) bool { return e.Category == event.Mem } +func newMemAccessor() Accessor { return &memAccessor{} } + +func (*memAccessor) Get(f Field, e *event.Event) (params.Value, error) { + switch f.Name { + case fields.MemBaseAddress: + return e.Params.GetUint64(params.MemBaseAddress) + case fields.MemRegionSize: + return e.Params.GetUint64(params.MemRegionSize) + case fields.MemProtection: + return e.Params.GetUint32(params.MemProtect) + case fields.MemFlags: + return e.Params.GetUint64(params.MmapFlags) + case fields.MemFD: + return e.Params.GetInt64(params.FD) + case fields.MemOffset: + return e.Params.GetUint64(params.MmapOffset) + case fields.MemTargetPID: + return e.Params.GetUint64(params.TargetProcessID) + default: + return nil, nil + } +} + +type threadAccessor struct{} + +func (threadAccessor) SetFields([]Field) {} +func (threadAccessor) SetSegments([]fields.Segment) {} +func (threadAccessor) IsFieldAccessible(e *event.Event) bool { + return e.IsCreateThread() +} +func newThreadAccessor() Accessor { return &threadAccessor{} } + +func (*threadAccessor) Get(f Field, e *event.Event) (params.Value, error) { + switch f.Name { + case fields.ThreadTID: + return e.Tid, nil + case fields.ThreadPID: + return e.PID, nil + default: + return nil, nil + } +} + +func pathStem(p string) string { + n := strings.LastIndexByte(p, '.') + if n == -1 { + return p + } + return p[:n] +} + func (f *filter) pruneUnusedAccessors() { removeEvtAccessor := true removePsAccessor := true + removeFileAccessor := true + removeNetworkAccessor := true + removeMemAccessor := true + removeThreadAccessor := true for _, field := range f.fields { switch { @@ -126,6 +362,14 @@ func (f *filter) pruneUnusedAccessors() { removeEvtAccessor = false case field.Name.IsPsField(): removePsAccessor = false + case field.Name.IsFileField(): + removeFileAccessor = false + case field.Name.IsNetworkField(): + removeNetworkAccessor = false + case field.Name.IsMemField(): + removeMemAccessor = false + case field.Name.IsThreadField(): + removeThreadAccessor = false } } @@ -135,4 +379,16 @@ func (f *filter) pruneUnusedAccessors() { if removePsAccessor { f.removeAccessor(&psAccessor{}) } + if removeFileAccessor { + f.removeAccessor(&fileAccessor{}) + } + if removeNetworkAccessor { + f.removeAccessor(&networkAccessor{}) + } + if removeMemAccessor { + f.removeAccessor(&memAccessor{}) + } + if removeThreadAccessor { + f.removeAccessor(&threadAccessor{}) + } } diff --git a/pkg/filter/accessor_stubs_linux.go b/pkg/filter/accessor_stubs_linux.go index e89696f3b..f9e2166e7 100644 --- a/pkg/filter/accessor_stubs_linux.go +++ b/pkg/filter/accessor_stubs_linux.go @@ -7,6 +7,7 @@ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 @@ -34,13 +35,9 @@ func (noopAccessor) SetFields([]Field) {} func (noopAccessor) SetSegments([]fields.Segment) {} func (noopAccessor) IsFieldAccessible(*event.Event) bool { return false } -func newThreadAccessor() Accessor { return noopAccessor{} } func newModuleAccessor() Accessor { return noopAccessor{} } -func newFileAccessor() Accessor { return noopAccessor{} } func newRegistryAccessor() Accessor { return noopAccessor{} } -func newNetworkAccessor() Accessor { return noopAccessor{} } func newHandleAccessor() Accessor { return noopAccessor{} } func newPEAccessor() Accessor { return noopAccessor{} } -func newMemAccessor() Accessor { return noopAccessor{} } func newDNSAccessor() Accessor { return noopAccessor{} } func newThreadpoolAccessor() Accessor { return noopAccessor{} } diff --git a/pkg/filter/accessor_windows.go b/pkg/filter/accessor_windows.go index c1230d8bc..3044d9549 100644 --- a/pkg/filter/accessor_windows.go +++ b/pkg/filter/accessor_windows.go @@ -68,6 +68,9 @@ func getParentPs(e *event.Event) *pstypes.PS { return e.PS.Parent } +// platformEvtValue resolves evt fields available only on other platforms. +func platformEvtValue(Field, *event.Event) (params.Value, error) { return nil, nil } + // psAccessor extracts process's state or event specific values. type psAccessor struct { psnap psnap.Snapshotter diff --git a/pkg/filter/filter_linux.go b/pkg/filter/filter_linux.go index a5c7d6cff..652d3d1fc 100644 --- a/pkg/filter/filter_linux.go +++ b/pkg/filter/filter_linux.go @@ -53,6 +53,17 @@ func New(expr string, config *config.Config, options ...Option) Filter { accessors := []Accessor{ newEventAccessor(), newPSAccessor(opts.psnap), + newThreadAccessor(), + } + + if config.EventSource.EnableFileIOEvents { + accessors = append(accessors, newFileAccessor()) + } + if config.EventSource.EnableNetEvents { + accessors = append(accessors, newNetworkAccessor()) + } + if config.EventSource.EnableMemEvents { + accessors = append(accessors, newMemAccessor()) } fconfig := config.Filters From da70c082aaf2b22729c816114cd060aab36fa4f8 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 16 Sep 2026 09:21:36 +0200 Subject: [PATCH 44/65] test(filter): Cover Linux field compile, evaluation, defaults, and truncation Prove shared-name semantics, missing-value defaults, truncation bits, and that Windows-only and kevt fields cannot compile. --- pkg/filter/fields/defs_linux_test.go | 2 +- pkg/filter/filter_linux_test.go | 581 +++++++++++++++++++++++++++ 2 files changed, 582 insertions(+), 1 deletion(-) create mode 100644 pkg/filter/filter_linux_test.go diff --git a/pkg/filter/fields/defs_linux_test.go b/pkg/filter/fields/defs_linux_test.go index 04318557a..348a90442 100644 --- a/pkg/filter/fields/defs_linux_test.go +++ b/pkg/filter/fields/defs_linux_test.go @@ -66,7 +66,7 @@ func TestLinuxExcludesWindowsOnlyFields(t *testing.T) { } } -func TestLinuxKeVtNotDeprecatedBecauseAbsent(t *testing.T) { +func TestKevtDeprecationAbsentOnLinux(t *testing.T) { deprecated, d := IsDeprecated(KevtArg) require.False(t, deprecated) require.Nil(t, d) diff --git a/pkg/filter/filter_linux_test.go b/pkg/filter/filter_linux_test.go new file mode 100644 index 000000000..b3440b95b --- /dev/null +++ b/pkg/filter/filter_linux_test.go @@ -0,0 +1,581 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +import ( + "net" + "testing" + + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/filter/fields" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/stretchr/testify/require" +) + +var cfg = &config.Config{ + EventSource: config.EventSourceConfig{ + EnableFileIOEvents: true, + EnableNetEvents: true, + EnableMemEvents: true, + }, + Filters: &config.Filters{}, +} + +func evalFilter(t *testing.T, expr string, evt *event.Event) bool { + t.Helper() + f := New(expr, cfg) + require.NoError(t, f.Compile(), expr) + return f.Eval(evt) +} + +func testPS() *pstypes.PS { + parent := &pstypes.PS{ + PID: 1, + Name: "systemd", + Cmdline: "/sbin/init", + Exe: "/sbin/init", + Cwd: "/", + Args: []string{"/sbin/init"}, + Username: "root", + UID: 0, + GID: 0, + StartBootTime: 100, + Envs: map[string]string{"PATH": "/usr/sbin"}, + } + return &pstypes.PS{ + PID: 4242, + Ppid: 1, + Name: "bash", + Cmdline: "/bin/bash -lc test", + Exe: "/bin/bash", + Cwd: "/home/user", + Args: []string{"-lc", "test"}, + Username: "user", + UID: 1000, + GID: 1000, + StartBootTime: 200, + Envs: map[string]string{"HOME": "/home/user", "PATH": "/usr/bin"}, + Parent: parent, + } +} + +func TestFilterCompile(t *testing.T) { + f := New(`ps.name = 'bash'`, cfg) + require.NoError(t, f.Compile()) + f = New(`'bash'`, cfg) + require.EqualError(t, f.Compile(), "expected at least one field or operator but zero found") + f = New(`ps.name`, cfg) + require.EqualError(t, f.Compile(), "expected at least one field or operator but zero found") + f = New(`file.path = '/tmp/x'`, cfg) + require.NoError(t, f.Compile()) + f = New(`net.dport = 443`, cfg) + require.NoError(t, f.Compile()) + f = New(`mem.size > 4096`, cfg) + require.NoError(t, f.Compile()) + f = New(`ps.name =`, cfg) + require.Error(t, f.Compile()) +} + +func TestWindowsOnlyFieldsUnavailable(t *testing.T) { + exprs := []string{ + `kevt.pid = 1`, + `kevt.name = 'execve'`, + `kevt.arg[exe] = '/bin/bash'`, + `ps.sid = 'S-1-5-18'`, + `registry.path = 'HKLM'`, + `pe.address.entrypoint = '20110'`, + `file.object = 1`, + `mem.type = 'PRIVATE'`, + `mem.alloc = 'COMMIT'`, + `handle.name = 'mutant'`, + `dns.name = 'example.org'`, + `evt.is_direct_syscall = true`, + } + for _, expr := range exprs { + f := New(expr, cfg) + require.Error(t, f.Compile(), expr) + } +} + +func TestSharedFieldSemantics(t *testing.T) { + ps := testPS() + openat := &event.Event{ + Type: event.Openat, + Category: event.File, + Name: "openat", + PID: 4242, + Tid: 4242, + PS: ps, + Params: event.Params{ + params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/secret.txt"}, + }, + } + connect := &event.Event{ + Type: event.Connect, + Category: event.Net, + Name: "connect", + PID: 4242, + PS: ps, + Params: event.Params{ + params.NetDIP: {Name: params.NetDIP, Type: params.IPv4, Value: net.IPv4(1, 2, 3, 4).To4()}, + params.NetDport: {Name: params.NetDport, Type: params.Port, Value: uint16(443)}, + }, + } + mmap := &event.Event{ + Type: event.Mmap, + Category: event.Mem, + Name: "mmap", + PID: 4242, + PS: ps, + Params: event.Params{ + params.MemBaseAddress: {Name: params.MemBaseAddress, Type: params.Address, Value: uint64(8192)}, + params.MemRegionSize: {Name: params.MemRegionSize, Type: params.Uint64, Value: uint64(4096)}, + params.MemProtect: {Name: params.MemProtect, Type: params.Uint32, Value: uint32(3)}, + }, + } + + require.True(t, evalFilter(t, `ps.name = 'bash'`, openat)) + require.True(t, evalFilter(t, `ps.exe = '/bin/bash'`, openat)) + require.True(t, evalFilter(t, `ps.cmdline contains 'bash'`, openat)) + require.True(t, evalFilter(t, `ps.uuid > 0`, openat)) + require.True(t, evalFilter(t, `file.path = '/tmp/secret.txt'`, openat)) + require.True(t, evalFilter(t, `file.name = 'secret.txt'`, openat)) + require.True(t, evalFilter(t, `file.extension = '.txt'`, openat)) + require.True(t, evalFilter(t, `file.path.stem = '/tmp/secret'`, openat)) + require.True(t, evalFilter(t, `net.dip = 1.2.3.4`, connect)) + require.True(t, evalFilter(t, `net.dport = 443`, connect)) + require.True(t, evalFilter(t, `mem.address = 8192`, mmap)) + require.True(t, evalFilter(t, `mem.size = 4096`, mmap)) + require.True(t, evalFilter(t, `mem.protection = 3`, mmap)) +} + +func TestProcFilter(t *testing.T) { + ps := testPS() + execve := &event.Event{ + Type: event.Execve, + Category: event.Process, + Name: "execve", + PID: 4242, + Tid: 4242, + CPU: 2, + PS: ps, + Params: event.Params{ + params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(0)}, + params.SyscallID: {Name: params.SyscallID, Type: params.Uint32, Value: uint32(59)}, + params.UID: {Name: params.UID, Type: params.Uint32, Value: uint32(1000)}, + params.GID: {Name: params.GID, Type: params.Uint32, Value: uint32(1000)}, + params.Exe: {Name: params.Exe, Type: params.Path, Value: "/bin/bash"}, + }, + } + kill := &event.Event{ + Type: event.Kill, + Category: event.Process, + Name: "kill", + PID: 4242, + PS: ps, + Params: event.Params{ + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}, + params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(0)}, + }, + } + ptrace := &event.Event{ + Type: event.Ptrace, + Category: event.Process, + Name: "ptrace", + PID: 4242, + PS: ps, + Params: event.Params{ + params.PtraceRequest: {Name: params.PtraceRequest, Type: params.Int64, Value: int64(16)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + }, + } + prctl := &event.Event{ + Type: event.Prctl, + Category: event.Process, + Name: "prctl", + PID: 4242, + PS: ps, + Params: event.Params{ + params.PrctlOption: {Name: params.PrctlOption, Type: params.Int64, Value: int64(15)}, + }, + } + clone := &event.Event{ + Type: event.Clone, + Category: event.Process, + Name: "clone", + PID: 4242, + PS: ps, + Params: event.Params{ + params.CloneFlags: {Name: params.CloneFlags, Type: params.Uint64, Value: uint64(0)}, + }, + } + + tests := []struct { + evt *event.Event + filter string + want bool + }{ + {execve, `ps.name = 'bash'`, true}, + {execve, `ps.name = 'zsh'`, false}, + {execve, `ps.pid = 4242`, true}, + {execve, `ps.ppid = 1`, true}, + {execve, `ps.parent.pid = 1`, true}, + {execve, `ps.parent.name = 'systemd'`, true}, + {execve, `ps.parent.args in ('/sbin/init')`, true}, + {execve, `ps.parent.cwd = '/'`, true}, + {execve, `ps.parent.username = 'root'`, true}, + {execve, `ps.uid = 1000`, true}, + {execve, `ps.gid = 1000`, true}, + {execve, `ps.username = 'user'`, true}, + {execve, `ps.args in ('-lc', 'test')`, true}, + {execve, `ps.envs[HOME] = '/home/user'`, true}, + {execve, `ps.envs[HO] = '/home/user'`, true}, + {execve, `ps.uuid > 0`, true}, + {execve, `ps.parent.uuid > 0`, true}, + {execve, `evt.name = 'execve'`, true}, + {execve, `evt.pid = 4242`, true}, + {execve, `evt.tid = 4242`, true}, + {execve, `evt.cpu = 2`, true}, + {execve, `evt.retval = 0`, true}, + {execve, `evt.syscall = 59`, true}, + {execve, `evt.arg[exe] = '/bin/bash'`, true}, + {kill, `ps.signal = 9`, true}, + {kill, `ps.target.pid = 99`, true}, + {ptrace, `ps.ptrace.request = 16`, true}, + {ptrace, `ps.target.pid = 99`, true}, + {prctl, `ps.prctl.option = 15`, true}, + {clone, `ps.clone.flags = 0`, true}, + } + for i, tt := range tests { + got := evalFilter(t, tt.filter, tt.evt) + if got != tt.want { + t.Errorf("%d. %q mismatch: exp=%t got=%t", i, tt.filter, tt.want, got) + } + } +} + +func TestFileFilter(t *testing.T) { + openat := &event.Event{ + Type: event.Openat, + Category: event.File, + Name: "openat", + PID: 4242, + Params: event.Params{ + params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/etc/passwd"}, + params.DirFD: {Name: params.DirFD, Type: params.Int64, Value: int64(-100)}, + params.FileFlags: {Name: params.FileFlags, Type: params.Uint64, Value: uint64(0)}, + params.FileMode: {Name: params.FileMode, Type: params.Uint64, Value: uint64(420)}, + params.FD: {Name: params.FD, Type: params.Int64, Value: int64(3)}, + params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(3)}, + }, + } + rename := &event.Event{ + Type: event.Rename, + Category: event.File, + Name: "rename", + PID: 4242, + Params: event.Params{ + params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/old"}, + params.FileNewPath: {Name: params.FileNewPath, Type: params.Path, Value: "/tmp/new"}, + }, + } + unlink := &event.Event{ + Type: event.Unlink, + Category: event.File, + Name: "unlink", + PID: 4242, + Params: event.Params{ + params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/gone.log"}, + }, + } + + tests := []struct { + evt *event.Event + filter string + want bool + }{ + {openat, `file.path = '/etc/passwd'`, true}, + {openat, `file.name = 'passwd'`, true}, + {openat, `file.dirfd < 0`, true}, + {openat, `file.fd = 3`, true}, + {openat, `file.flags = 0`, true}, + {openat, `file.mode = 420`, true}, + {openat, `evt.retval = 3`, true}, + {rename, `file.new_path = '/tmp/new'`, true}, + {rename, `file.path = '/tmp/old'`, true}, + {unlink, `file.extension = '.log'`, true}, + {unlink, `file.name = 'gone.log'`, true}, + } + for i, tt := range tests { + got := evalFilter(t, tt.filter, tt.evt) + if got != tt.want { + t.Errorf("%d. %q mismatch: exp=%t got=%t", i, tt.filter, tt.want, got) + } + } +} + +func TestNetFilter(t *testing.T) { + connect := &event.Event{ + Type: event.Connect, + Category: event.Net, + Name: "connect", + PID: 4242, + Params: event.Params{ + params.FD: {Name: params.FD, Type: params.Int64, Value: int64(5)}, + params.SockFamily: {Name: params.SockFamily, Type: params.Uint16, Value: uint16(2)}, + params.NetDIP: {Name: params.NetDIP, Type: params.IPv4, Value: net.IPv4(172, 17, 0, 3).To4()}, + params.NetDport: {Name: params.NetDport, Type: params.Port, Value: uint16(443)}, + }, + } + accept := &event.Event{ + Type: event.Accept, + Category: event.Net, + Name: "accept", + PID: 4242, + Params: event.Params{ + params.FD: {Name: params.FD, Type: params.Int64, Value: int64(6)}, + params.SockFamily: {Name: params.SockFamily, Type: params.Uint16, Value: uint16(2)}, + params.NetSIP: {Name: params.NetSIP, Type: params.IPv4, Value: net.IPv4(127, 0, 0, 1).To4()}, + params.NetSport: {Name: params.NetSport, Type: params.Port, Value: uint16(80)}, + }, + } + unixc := &event.Event{ + Type: event.Connect, + Category: event.Net, + Name: "connect", + PID: 4242, + Params: event.Params{ + params.FD: {Name: params.FD, Type: params.Int64, Value: int64(7)}, + params.SockFamily: {Name: params.SockFamily, Type: params.Uint16, Value: uint16(1)}, + params.SockPath: {Name: params.SockPath, Type: params.Path, Value: "/tmp/app.sock"}, + }, + } + + require.True(t, evalFilter(t, `net.dip = 172.17.0.3`, connect)) + require.True(t, evalFilter(t, `net.dport = 443`, connect)) + require.True(t, evalFilter(t, `net.family = 2`, connect)) + require.True(t, evalFilter(t, `net.fd = 5`, connect)) + require.True(t, evalFilter(t, `net.sip = 127.0.0.1`, accept)) + require.True(t, evalFilter(t, `net.sport = 80`, accept)) + require.True(t, evalFilter(t, `net.path = '/tmp/app.sock'`, unixc)) + require.True(t, evalFilter(t, `net.family = 1`, unixc)) +} + +func TestMemFilter(t *testing.T) { + mmap := &event.Event{ + Type: event.Mmap, + Category: event.Mem, + Name: "mmap", + PID: 4242, + Params: event.Params{ + params.MemBaseAddress: {Name: params.MemBaseAddress, Type: params.Address, Value: uint64(8192)}, + params.MemRegionSize: {Name: params.MemRegionSize, Type: params.Uint64, Value: uint64(8192)}, + params.MemProtect: {Name: params.MemProtect, Type: params.Uint32, Value: uint32(3)}, + params.MmapFlags: {Name: params.MmapFlags, Type: params.Uint64, Value: uint64(1)}, + params.FD: {Name: params.FD, Type: params.Int64, Value: int64(3)}, + params.MmapOffset: {Name: params.MmapOffset, Type: params.Uint64, Value: uint64(0)}, + }, + } + vmread := &event.Event{ + Type: event.ProcessVMRead, + Category: event.Mem, + Name: "process_vm_readv", + PID: 4242, + Params: event.Params{ + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + params.MemBaseAddress: {Name: params.MemBaseAddress, Type: params.Address, Value: uint64(4096)}, + params.MemRegionSize: {Name: params.MemRegionSize, Type: params.Uint64, Value: uint64(16)}, + }, + } + vmwrite := &event.Event{ + Type: event.ProcessVMWrite, + Category: event.Mem, + Name: "process_vm_writev", + PID: 4242, + Params: event.Params{ + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(77)}, + params.MemBaseAddress: {Name: params.MemBaseAddress, Type: params.Address, Value: uint64(4096)}, + }, + } + + require.True(t, evalFilter(t, `mem.address = 8192`, mmap)) + require.True(t, evalFilter(t, `mem.size = 8192`, mmap)) + require.True(t, evalFilter(t, `mem.protection = 3`, mmap)) + require.True(t, evalFilter(t, `mem.flags = 1`, mmap)) + require.True(t, evalFilter(t, `mem.fd = 3`, mmap)) + require.True(t, evalFilter(t, `mem.offset = 0`, mmap)) + require.True(t, evalFilter(t, `mem.target.pid = 99`, vmread)) + require.True(t, evalFilter(t, `mem.target.pid = 77`, vmwrite)) +} + +func TestThreadFilter(t *testing.T) { + cloneThread := &event.Event{ + Type: event.Clone, + Category: event.Process, + Name: "clone", + PID: 4242, + Tid: 4243, + Params: event.Params{ + params.CloneFlags: {Name: params.CloneFlags, Type: params.Uint64, Value: uint64(0x00010000)}, + }, + } + cloneProc := &event.Event{ + Type: event.Clone, + Category: event.Process, + Name: "clone", + PID: 4242, + Tid: 4242, + Params: event.Params{ + params.CloneFlags: {Name: params.CloneFlags, Type: params.Uint64, Value: uint64(0)}, + }, + } + + require.True(t, evalFilter(t, `thread.tid = 4243`, cloneThread)) + require.True(t, evalFilter(t, `thread.pid = 4242`, cloneThread)) + require.False(t, evalFilter(t, `thread.tid = 4243`, cloneProc)) +} + +func TestDefaultAndMissingValues(t *testing.T) { + empty := &event.Event{ + Type: event.Execve, + Category: event.Process, + Name: "execve", + PID: 7, + Params: event.Params{}, + } + fileEvt := &event.Event{ + Type: event.Openat, + Category: event.File, + Name: "openat", + PID: 7, + Params: event.Params{}, + } + + require.True(t, evalFilter(t, `evt.retval = 0`, empty)) + require.True(t, evalFilter(t, `evt.truncated = false`, empty)) + require.True(t, evalFilter(t, `ps.signal = 0`, empty)) + require.True(t, evalFilter(t, `file.path = ''`, fileEvt)) + require.True(t, evalFilter(t, `not (file.path = '/tmp/x')`, fileEvt)) + require.True(t, evalFilter(t, `file.fd = 0`, fileEvt)) + require.True(t, evalFilter(t, `file.truncated = false`, fileEvt)) + require.True(t, evalFilter(t, `mem.size = 0`, &event.Event{Type: event.Mmap, Category: event.Mem, Name: "mmap", Params: event.Params{}})) +} + +func TestTruncatedFields(t *testing.T) { + filenameTrunc := &event.Event{ + Type: event.Openat, + Category: event.File, + Name: "openat", + Params: event.Params{ + params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/partial"}, + params.Truncated: {Name: params.Truncated, Type: params.Uint32, Value: uint32(1)}, + }, + } + auxTrunc := &event.Event{ + Type: event.Rename, + Category: event.File, + Name: "rename", + Params: event.Params{ + params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/old"}, + params.FileNewPath: {Name: params.FileNewPath, Type: params.Path, Value: "/tmp/partial-dest"}, + params.Truncated: {Name: params.Truncated, Type: params.Uint32, Value: uint32(2)}, + }, + } + + notTrunc := &event.Event{ + Type: event.Openat, + Category: event.File, + Name: "openat", + Params: event.Params{ + params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/full"}, + }, + } + + require.True(t, evalFilter(t, `file.truncated = true`, filenameTrunc)) + require.True(t, evalFilter(t, `evt.truncated = true`, filenameTrunc)) + require.True(t, evalFilter(t, `file.truncated = true`, auxTrunc)) + require.True(t, evalFilter(t, `evt.truncated = true`, auxTrunc)) + require.True(t, evalFilter(t, `file.truncated = false`, notTrunc)) + require.True(t, evalFilter(t, `evt.truncated = false`, notTrunc)) +} + +func TestEveryLinuxEventType(t *testing.T) { + ps := testPS() + cases := []struct { + evt *event.Event + filter string + }{ + {&event.Event{Type: event.Execve, Category: event.Process, Name: "execve", PS: ps, Params: event.Params{params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(0)}}}, `evt.name = 'execve' and ps.name = 'bash'`}, + {&event.Event{Type: event.Exit, Category: event.Process, Name: "exit", PS: ps, Params: event.Params{params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(0)}}}, `evt.name = 'exit' and evt.retval = 0`}, + {&event.Event{Type: event.Clone, Category: event.Process, Name: "clone", PS: ps, Params: event.Params{params.CloneFlags: {Name: params.CloneFlags, Type: params.Uint64, Value: uint64(0)}}}, `evt.name = 'clone' and ps.clone.flags = 0`}, + {&event.Event{Type: event.Openat, Category: event.File, Name: "openat", PS: ps, Params: event.Params{params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/x"}}}, `file.path = '/tmp/x'`}, + {&event.Event{Type: event.Unlink, Category: event.File, Name: "unlink", PS: ps, Params: event.Params{params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/x"}}}, `file.name = 'x'`}, + {&event.Event{Type: event.Rename, Category: event.File, Name: "rename", PS: ps, Params: event.Params{params.FileNewPath: {Name: params.FileNewPath, Type: params.Path, Value: "/tmp/y"}}}, `file.new_path = '/tmp/y'`}, + {&event.Event{Type: event.Connect, Category: event.Net, Name: "connect", PS: ps, Params: event.Params{params.NetDport: {Name: params.NetDport, Type: params.Port, Value: uint16(443)}}}, `net.dport = 443`}, + {&event.Event{Type: event.Accept, Category: event.Net, Name: "accept", PS: ps, Params: event.Params{params.NetSport: {Name: params.NetSport, Type: params.Port, Value: uint16(80)}}}, `net.sport = 80`}, + {&event.Event{Type: event.Mmap, Category: event.Mem, Name: "mmap", PS: ps, Params: event.Params{params.MemRegionSize: {Name: params.MemRegionSize, Type: params.Uint64, Value: uint64(4096)}}}, `mem.size = 4096`}, + {&event.Event{Type: event.ProcessVMRead, Category: event.Mem, Name: "process_vm_readv", PS: ps, Params: event.Params{params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(9)}}}, `mem.target.pid = 9`}, + {&event.Event{Type: event.ProcessVMWrite, Category: event.Mem, Name: "process_vm_writev", PS: ps, Params: event.Params{params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(8)}}}, `mem.target.pid = 8`}, + {&event.Event{Type: event.Kill, Category: event.Process, Name: "kill", PS: ps, Params: event.Params{params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}}}, `ps.signal = 9`}, + {&event.Event{Type: event.Ptrace, Category: event.Process, Name: "ptrace", PS: ps, Params: event.Params{params.PtraceRequest: {Name: params.PtraceRequest, Type: params.Int64, Value: int64(16)}}}, `ps.ptrace.request = 16`}, + {&event.Event{Type: event.Prctl, Category: event.Process, Name: "prctl", PS: ps, Params: event.Params{params.PrctlOption: {Name: params.PrctlOption, Type: params.Int64, Value: int64(15)}}}, `ps.prctl.option = 15`}, + } + for _, tt := range cases { + require.True(t, evalFilter(t, tt.filter, tt.evt), tt.filter) + } +} + +func TestIsFieldAccessible(t *testing.T) { + fileEvt := &event.Event{Category: event.File} + netEvt := &event.Event{Category: event.Net} + memEvt := &event.Event{Category: event.Mem} + procEvt := &event.Event{Category: event.Process, PS: testPS()} + cloneThread := &event.Event{ + Type: event.Clone, + Category: event.Process, + Params: event.Params{params.CloneFlags: {Name: params.CloneFlags, Type: params.Uint64, Value: uint64(0x00010000)}}, + } + + require.True(t, newFileAccessor().IsFieldAccessible(fileEvt)) + require.False(t, newFileAccessor().IsFieldAccessible(procEvt)) + require.True(t, newNetworkAccessor().IsFieldAccessible(netEvt)) + require.True(t, newMemAccessor().IsFieldAccessible(memEvt)) + require.True(t, newPSAccessor(nil).IsFieldAccessible(procEvt)) + require.True(t, newThreadAccessor().IsFieldAccessible(cloneThread)) + require.False(t, newThreadAccessor().IsFieldAccessible(procEvt)) +} + +func TestGetAccessorsIncludesMatrix(t *testing.T) { + accessors := GetAccessors() + require.Len(t, accessors, 6) +} + +func TestFieldCatalogTypes(t *testing.T) { + require.Equal(t, params.Uint64, fields.PsUUID.Type()) + require.Equal(t, params.Uint32, fields.PsUID.Type()) + require.Equal(t, params.Int64, fields.PsSignal.Type()) + require.Equal(t, params.Bool, fields.FileTruncated.Type()) + require.Equal(t, params.Bool, fields.EvtTruncated.Type()) +} From 08d0f2e6f121c31319ca4e7b7310eba653941121 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 16 Sep 2026 15:46:07 +0200 Subject: [PATCH 45/65] refactor(filter): Align Linux field names with catalog conventions Drop first-class truncated fields so callers inspect the truncated parameter through evt.arg. --- pkg/filter/accessor_linux.go | 18 ++++------- pkg/filter/fields/defs.go | 30 ++++++++----------- pkg/filter/fields/defs_linux.go | 16 +++++----- pkg/filter/fields/defs_linux_test.go | 7 +++-- pkg/filter/filter_linux_test.go | 45 +++++++++++++++------------- 5 files changed, 56 insertions(+), 60 deletions(-) diff --git a/pkg/filter/accessor_linux.go b/pkg/filter/accessor_linux.go index ad5e49a0c..100f6e41d 100644 --- a/pkg/filter/accessor_linux.go +++ b/pkg/filter/accessor_linux.go @@ -49,10 +49,8 @@ func platformEvtValue(f Field, evt *event.Event) (params.Value, error) { switch f.Name { case fields.EvtRetval: return evt.Params.GetInt64(params.Retval) - case fields.EvtSyscall: + case fields.EvtSyscallID: return evt.Params.GetUint32(params.SyscallID) - case fields.EvtTruncated: - return evt.Params.TryGetUint32(params.Truncated) != 0, nil default: return nil, nil } @@ -245,7 +243,7 @@ func (*fileAccessor) Get(f Field, e *event.Event) (params.Value, error) { return filepath.Base(e.GetParamAsString(params.FilePath)), nil case fields.FileExtension: return filepath.Ext(e.GetParamAsString(params.FilePath)), nil - case fields.FileNewPath: + case fields.FilePathTarget: return e.GetParamAsString(params.FileNewPath), nil case fields.FileDirFD: return e.Params.GetInt64(params.DirFD) @@ -255,10 +253,6 @@ func (*fileAccessor) Get(f Field, e *event.Event) (params.Value, error) { return e.Params.GetUint64(params.FileFlags) case fields.FileMode: return e.Params.GetUint64(params.FileMode) - case fields.FileTruncated: - // for file events both truncation bits designate a clipped - // path: the source path or the rename destination - return e.Params.TryGetUint32(params.Truncated) != 0, nil default: return nil, nil } @@ -283,7 +277,7 @@ func (*networkAccessor) Get(f Field, e *event.Event) (params.Value, error) { return e.Params.GetUint16(params.NetSport) case fields.NetFamily: return e.Params.GetUint16(params.SockFamily) - case fields.NetPath: + case fields.NetUnixPath: return e.GetParamAsString(params.SockPath), nil case fields.NetFD: return e.Params.GetInt64(params.FD) @@ -307,11 +301,11 @@ func (*memAccessor) Get(f Field, e *event.Event) (params.Value, error) { return e.Params.GetUint64(params.MemRegionSize) case fields.MemProtection: return e.Params.GetUint32(params.MemProtect) - case fields.MemFlags: + case fields.MemMmapFlags: return e.Params.GetUint64(params.MmapFlags) - case fields.MemFD: + case fields.MemMmapFD: return e.Params.GetInt64(params.FD) - case fields.MemOffset: + case fields.MemMmapOffset: return e.Params.GetUint64(params.MmapOffset) case fields.MemTargetPID: return e.Params.GetUint64(params.TargetProcessID) diff --git a/pkg/filter/fields/defs.go b/pkg/filter/fields/defs.go index 8f76f848d..fc4e387ca 100644 --- a/pkg/filter/fields/defs.go +++ b/pkg/filter/fields/defs.go @@ -130,7 +130,7 @@ const ( // PsPrctlOption represents the prctl option code PsPrctlOption Field = "ps.prctl.option" // PsCloneFlags represents the clone flags bitmask - PsCloneFlags Field = "ps.clone.flags" + PsCloneFlags Field = "ps.clone_flags" // PsTokenIntegrityLevel represents the field that indicates the current process integrity level PsTokenIntegrityLevel = "ps.token.integrity_level" // PsTokenIsElevated represents the field that indicates if the current process token is elevated @@ -379,10 +379,8 @@ const ( EvtArg Field = "evt.arg" // EvtRetval represents the syscall return value EvtRetval Field = "evt.retval" - // EvtSyscall represents the raw architecture-specific syscall number - EvtSyscall Field = "evt.syscall" - // EvtTruncated indicates whether variable-length event fields were truncated - EvtTruncated Field = "evt.truncated" + // EvtSyscallID represents the raw architecture-specific syscall number + EvtSyscallID Field = "evt.syscall_id" // EvtIsDirectSyscall represents the field that designates if this event is // performing a direct syscall. EvtIsDirectSyscall Field = "evt.is_direct_syscall" @@ -466,8 +464,8 @@ const ( NetDIPNames Field = "net.dip.names" // NetFamily represents the socket address family NetFamily Field = "net.family" - // NetPath represents the filesystem path of an AF_UNIX socket - NetPath Field = "net.path" + // NetUnixPath represents the filesystem path of an AF_UNIX socket + NetUnixPath Field = "net.unix_path" // NetFD represents the socket file descriptor NetFD Field = "net.fd" @@ -481,8 +479,8 @@ const ( FilePathStem Field = "file.path.stem" // FileExtension represents the file extension (e.g. .exe or .dll) FileExtension Field = "file.extension" - // FileNewPath represents the destination path of a rename - FileNewPath Field = "file.new_path" + // FilePathTarget represents the destination path of a rename or similar source/target file operation + FilePathTarget Field = "file.path.target" // FileDirFD represents a directory file descriptor, including AT_FDCWD FileDirFD Field = "file.dirfd" // FileFD represents a file descriptor @@ -491,8 +489,6 @@ const ( FileFlags Field = "file.flags" // FileMode represents the file creation mode supplied to openat FileMode Field = "file.mode" - // FileTruncated indicates whether the file path was truncated - FileTruncated Field = "file.truncated" // FileOperation represents the file operation (e.g. create) FileOperation Field = "file.operation" // FileShareMask represents the file share mask @@ -679,12 +675,12 @@ const ( MemProtection Field = "mem.protection" // MemProtectionMask identifies the field that represents the memory protection in mask notation MemProtectionMask Field = "mem.protection.mask" - // MemFlags represents the mmap flags bitmask - MemFlags Field = "mem.flags" - // MemFD represents the file descriptor backing a mapping - MemFD Field = "mem.fd" - // MemOffset represents the file offset of a memory mapping - MemOffset Field = "mem.offset" + // MemMmapFlags represents the mmap flags bitmask + MemMmapFlags Field = "mem.mmap.flags" + // MemMmapFD represents the file descriptor backing a mapping + MemMmapFD Field = "mem.mmap.fd" + // MemMmapOffset represents the file offset of a memory mapping + MemMmapOffset Field = "mem.mmap.offset" // MemTargetPID represents the target process identifier of a process_vm operation MemTargetPID Field = "mem.target.pid" diff --git a/pkg/filter/fields/defs_linux.go b/pkg/filter/fields/defs_linux.go index d8859cb32..f4f569596 100644 --- a/pkg/filter/fields/defs_linux.go +++ b/pkg/filter/fields/defs_linux.go @@ -30,8 +30,7 @@ var fields = platformFields(map[Field]FieldInfo{ EvtPID: {EvtPID, "process identifier generating the event", params.Uint64, []string{"evt.pid = 6"}, nil, nil}, EvtTID: {EvtTID, "thread identifier generating the event", params.Uint64, []string{"evt.tid = 1024"}, nil, nil}, EvtRetval: {EvtRetval, "syscall return value", params.Int64, []string{"evt.retval < 0"}, nil, nil}, - EvtSyscall: {EvtSyscall, "raw architecture-specific syscall number", params.Uint32, []string{"evt.syscall = 59"}, nil, nil}, - EvtTruncated: {EvtTruncated, "indicates whether variable-length event fields were truncated", params.Bool, []string{"evt.truncated = true"}, nil, nil}, + EvtSyscallID: {EvtSyscallID, "raw architecture-specific syscall number", params.Uint32, []string{"evt.syscall_id = 59"}, nil, nil}, PsPid: {PsPid, "process identifier", params.Uint64, []string{"ps.pid = 1024"}, nil, nil}, PsPpid: {PsPpid, "parent process identifier", params.Uint64, []string{"ps.ppid = 45"}, nil, nil}, PsParentPid: {PsParentPid, "parent process id", params.Uint64, []string{"ps.parent.pid = 4"}, nil, nil}, @@ -47,30 +46,29 @@ var fields = platformFields(map[Field]FieldInfo{ PsTargetPID: {PsTargetPID, "target process identifier of kill, ptrace, or process_vm operations", params.Uint64, []string{"ps.target.pid = 4242"}, nil, nil}, PsPtraceRequest: {PsPtraceRequest, "ptrace request code", params.Int64, []string{"ps.ptrace.request = 16"}, nil, nil}, PsPrctlOption: {PsPrctlOption, "prctl option code", params.Int64, []string{"ps.prctl.option = 15"}, nil, nil}, - PsCloneFlags: {PsCloneFlags, "clone flags bitmask", params.Uint64, []string{"ps.clone.flags = 0"}, nil, nil}, + PsCloneFlags: {PsCloneFlags, "clone flags bitmask", params.Uint64, []string{"ps.clone_flags = 0"}, nil, nil}, FilePath: {FilePath, "full file path", platformString(), []string{"file.path = '/etc/passwd'"}, nil, nil}, FilePathStem: {FilePathStem, "full file path without extension", platformString(), []string{"file.path.stem = '/tmp/secret'"}, nil, nil}, FileName: {FileName, "file base name", platformString(), []string{"file.name = 'passwd'"}, nil, nil}, FileExtension: {FileExtension, "file extension", platformAnsiString(), []string{"file.extension = '.so'"}, nil, nil}, - FileNewPath: {FileNewPath, "destination path of a rename", platformString(), []string{"file.new_path = '/tmp/renamed'"}, nil, nil}, + FilePathTarget: {FilePathTarget, "destination path of a rename or similar source/target file operation", platformString(), []string{"file.path.target = '/tmp/renamed'"}, nil, nil}, FileDirFD: {FileDirFD, "directory file descriptor, including AT_FDCWD", params.Int64, []string{"file.dirfd < 0"}, nil, nil}, FileFD: {FileFD, "file descriptor returned by openat", params.Int64, []string{"file.fd = 3"}, nil, nil}, FileFlags: {FileFlags, "raw openat, unlinkat, or renameat flags bitmask", params.Uint64, []string{"file.flags = 0"}, nil, nil}, FileMode: {FileMode, "file creation mode supplied to openat", params.Uint64, []string{"file.mode = 420"}, nil, nil}, - FileTruncated: {FileTruncated, "indicates whether the file path was truncated", params.Bool, []string{"file.truncated = true"}, nil, nil}, NetDIP: {NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil}, NetSIP: {NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil}, NetDport: {NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil}, NetSport: {NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil}, NetFamily: {NetFamily, "socket address family", params.Uint16, []string{"net.family = 2"}, nil, nil}, - NetPath: {NetPath, "filesystem path of an AF_UNIX socket", platformString(), []string{"net.path = '/tmp/app.sock'"}, nil, nil}, + NetUnixPath: {NetUnixPath, "filesystem path of an AF_UNIX socket", platformString(), []string{"net.unix_path = '/tmp/app.sock'"}, nil, nil}, NetFD: {NetFD, "socket file descriptor", params.Int64, []string{"net.fd = 5"}, nil, nil}, MemBaseAddress: {MemBaseAddress, "region base address", params.Uint64, []string{"mem.address = 8192"}, nil, nil}, MemRegionSize: {MemRegionSize, "region size", params.Uint64, []string{"mem.size > 4096"}, nil, nil}, MemProtection: {MemProtection, "mapping protection bitmask", params.Uint32, []string{"mem.protection = 3"}, nil, nil}, - MemFlags: {MemFlags, "mmap flags bitmask", params.Uint64, []string{"mem.flags = 1"}, nil, nil}, - MemFD: {MemFD, "file descriptor backing a mapping", params.Int64, []string{"mem.fd = 3"}, nil, nil}, - MemOffset: {MemOffset, "file offset of a memory mapping", params.Uint64, []string{"mem.offset = 0"}, nil, nil}, + MemMmapFlags: {MemMmapFlags, "mmap flags bitmask", params.Uint64, []string{"mem.mmap.flags = 1"}, nil, nil}, + MemMmapFD: {MemMmapFD, "file descriptor backing a mapping", params.Int64, []string{"mem.mmap.fd = 3"}, nil, nil}, + MemMmapOffset: {MemMmapOffset, "file offset of a memory mapping", params.Uint64, []string{"mem.mmap.offset = 0"}, nil, nil}, MemTargetPID: {MemTargetPID, "target process identifier of a process_vm operation", params.Uint64, []string{"mem.target.pid = 4242"}, nil, nil}, ThreadTID: {ThreadTID, "thread identifier", params.Uint64, []string{"thread.tid = 1024"}, nil, nil}, ThreadPID: {ThreadPID, "thread group identifier of the thread", params.Uint64, []string{"thread.pid = 1024"}, nil, nil}, diff --git a/pkg/filter/fields/defs_linux_test.go b/pkg/filter/fields/defs_linux_test.go index 348a90442..4058df534 100644 --- a/pkg/filter/fields/defs_linux_test.go +++ b/pkg/filter/fields/defs_linux_test.go @@ -35,13 +35,16 @@ func TestLinuxFields(t *testing.T) { require.True(t, IsField(string(PsUUID))) require.True(t, IsField(string(PsUID))) require.True(t, IsField(string(FilePath))) - require.True(t, IsField(string(FileNewPath))) + require.True(t, IsField(string(FilePathTarget))) require.True(t, IsField(string(NetDIP))) require.True(t, IsField(string(NetFamily))) require.True(t, IsField(string(MemBaseAddress))) - require.True(t, IsField(string(MemFlags))) + require.True(t, IsField(string(MemMmapFlags))) require.True(t, IsField(string(ThreadTID))) require.True(t, IsField(string(EvtRetval))) + require.True(t, IsField(string(EvtSyscallID))) + require.False(t, IsField("evt.truncated")) + require.False(t, IsField("file.truncated")) require.Equal(t, params.String, EvtName.Type()) require.Equal(t, params.String, PsName.Type()) require.Equal(t, params.Uint64, EvtPID.Type()) diff --git a/pkg/filter/filter_linux_test.go b/pkg/filter/filter_linux_test.go index b3440b95b..77e074279 100644 --- a/pkg/filter/filter_linux_test.go +++ b/pkg/filter/filter_linux_test.go @@ -111,6 +111,15 @@ func TestWindowsOnlyFieldsUnavailable(t *testing.T) { `handle.name = 'mutant'`, `dns.name = 'example.org'`, `evt.is_direct_syscall = true`, + `evt.truncated = true`, + `file.truncated = true`, + `file.new_path = '/tmp/x'`, + `net.path = '/tmp/app.sock'`, + `ps.clone.flags = 0`, + `evt.syscall = 59`, + `mem.flags = 1`, + `mem.fd = 3`, + `mem.offset = 0`, } for _, expr := range exprs { f := New(expr, cfg) @@ -259,14 +268,14 @@ func TestProcFilter(t *testing.T) { {execve, `evt.tid = 4242`, true}, {execve, `evt.cpu = 2`, true}, {execve, `evt.retval = 0`, true}, - {execve, `evt.syscall = 59`, true}, + {execve, `evt.syscall_id = 59`, true}, {execve, `evt.arg[exe] = '/bin/bash'`, true}, {kill, `ps.signal = 9`, true}, {kill, `ps.target.pid = 99`, true}, {ptrace, `ps.ptrace.request = 16`, true}, {ptrace, `ps.target.pid = 99`, true}, {prctl, `ps.prctl.option = 15`, true}, - {clone, `ps.clone.flags = 0`, true}, + {clone, `ps.clone_flags = 0`, true}, } for i, tt := range tests { got := evalFilter(t, tt.filter, tt.evt) @@ -323,7 +332,7 @@ func TestFileFilter(t *testing.T) { {openat, `file.flags = 0`, true}, {openat, `file.mode = 420`, true}, {openat, `evt.retval = 3`, true}, - {rename, `file.new_path = '/tmp/new'`, true}, + {rename, `file.path.target = '/tmp/new'`, true}, {rename, `file.path = '/tmp/old'`, true}, {unlink, `file.extension = '.log'`, true}, {unlink, `file.name = 'gone.log'`, true}, @@ -379,7 +388,7 @@ func TestNetFilter(t *testing.T) { require.True(t, evalFilter(t, `net.fd = 5`, connect)) require.True(t, evalFilter(t, `net.sip = 127.0.0.1`, accept)) require.True(t, evalFilter(t, `net.sport = 80`, accept)) - require.True(t, evalFilter(t, `net.path = '/tmp/app.sock'`, unixc)) + require.True(t, evalFilter(t, `net.unix_path = '/tmp/app.sock'`, unixc)) require.True(t, evalFilter(t, `net.family = 1`, unixc)) } @@ -423,9 +432,9 @@ func TestMemFilter(t *testing.T) { require.True(t, evalFilter(t, `mem.address = 8192`, mmap)) require.True(t, evalFilter(t, `mem.size = 8192`, mmap)) require.True(t, evalFilter(t, `mem.protection = 3`, mmap)) - require.True(t, evalFilter(t, `mem.flags = 1`, mmap)) - require.True(t, evalFilter(t, `mem.fd = 3`, mmap)) - require.True(t, evalFilter(t, `mem.offset = 0`, mmap)) + require.True(t, evalFilter(t, `mem.mmap.flags = 1`, mmap)) + require.True(t, evalFilter(t, `mem.mmap.fd = 3`, mmap)) + require.True(t, evalFilter(t, `mem.mmap.offset = 0`, mmap)) require.True(t, evalFilter(t, `mem.target.pid = 99`, vmread)) require.True(t, evalFilter(t, `mem.target.pid = 77`, vmwrite)) } @@ -474,12 +483,10 @@ func TestDefaultAndMissingValues(t *testing.T) { } require.True(t, evalFilter(t, `evt.retval = 0`, empty)) - require.True(t, evalFilter(t, `evt.truncated = false`, empty)) require.True(t, evalFilter(t, `ps.signal = 0`, empty)) require.True(t, evalFilter(t, `file.path = ''`, fileEvt)) require.True(t, evalFilter(t, `not (file.path = '/tmp/x')`, fileEvt)) require.True(t, evalFilter(t, `file.fd = 0`, fileEvt)) - require.True(t, evalFilter(t, `file.truncated = false`, fileEvt)) require.True(t, evalFilter(t, `mem.size = 0`, &event.Event{Type: event.Mmap, Category: event.Mem, Name: "mmap", Params: event.Params{}})) } @@ -509,16 +516,14 @@ func TestTruncatedFields(t *testing.T) { Category: event.File, Name: "openat", Params: event.Params{ - params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/full"}, + params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/full"}, + params.Truncated: {Name: params.Truncated, Type: params.Uint32, Value: uint32(0)}, }, } - require.True(t, evalFilter(t, `file.truncated = true`, filenameTrunc)) - require.True(t, evalFilter(t, `evt.truncated = true`, filenameTrunc)) - require.True(t, evalFilter(t, `file.truncated = true`, auxTrunc)) - require.True(t, evalFilter(t, `evt.truncated = true`, auxTrunc)) - require.True(t, evalFilter(t, `file.truncated = false`, notTrunc)) - require.True(t, evalFilter(t, `evt.truncated = false`, notTrunc)) + require.True(t, evalFilter(t, `evt.arg[truncated] = 1`, filenameTrunc)) + require.True(t, evalFilter(t, `evt.arg[truncated] = 2`, auxTrunc)) + require.True(t, evalFilter(t, `evt.arg[truncated] = 0`, notTrunc)) } func TestEveryLinuxEventType(t *testing.T) { @@ -529,10 +534,10 @@ func TestEveryLinuxEventType(t *testing.T) { }{ {&event.Event{Type: event.Execve, Category: event.Process, Name: "execve", PS: ps, Params: event.Params{params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(0)}}}, `evt.name = 'execve' and ps.name = 'bash'`}, {&event.Event{Type: event.Exit, Category: event.Process, Name: "exit", PS: ps, Params: event.Params{params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(0)}}}, `evt.name = 'exit' and evt.retval = 0`}, - {&event.Event{Type: event.Clone, Category: event.Process, Name: "clone", PS: ps, Params: event.Params{params.CloneFlags: {Name: params.CloneFlags, Type: params.Uint64, Value: uint64(0)}}}, `evt.name = 'clone' and ps.clone.flags = 0`}, + {&event.Event{Type: event.Clone, Category: event.Process, Name: "clone", PS: ps, Params: event.Params{params.CloneFlags: {Name: params.CloneFlags, Type: params.Uint64, Value: uint64(0)}}}, `evt.name = 'clone' and ps.clone_flags = 0`}, {&event.Event{Type: event.Openat, Category: event.File, Name: "openat", PS: ps, Params: event.Params{params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/x"}}}, `file.path = '/tmp/x'`}, {&event.Event{Type: event.Unlink, Category: event.File, Name: "unlink", PS: ps, Params: event.Params{params.FilePath: {Name: params.FilePath, Type: params.Path, Value: "/tmp/x"}}}, `file.name = 'x'`}, - {&event.Event{Type: event.Rename, Category: event.File, Name: "rename", PS: ps, Params: event.Params{params.FileNewPath: {Name: params.FileNewPath, Type: params.Path, Value: "/tmp/y"}}}, `file.new_path = '/tmp/y'`}, + {&event.Event{Type: event.Rename, Category: event.File, Name: "rename", PS: ps, Params: event.Params{params.FileNewPath: {Name: params.FileNewPath, Type: params.Path, Value: "/tmp/y"}}}, `file.path.target = '/tmp/y'`}, {&event.Event{Type: event.Connect, Category: event.Net, Name: "connect", PS: ps, Params: event.Params{params.NetDport: {Name: params.NetDport, Type: params.Port, Value: uint16(443)}}}, `net.dport = 443`}, {&event.Event{Type: event.Accept, Category: event.Net, Name: "accept", PS: ps, Params: event.Params{params.NetSport: {Name: params.NetSport, Type: params.Port, Value: uint16(80)}}}, `net.sport = 80`}, {&event.Event{Type: event.Mmap, Category: event.Mem, Name: "mmap", PS: ps, Params: event.Params{params.MemRegionSize: {Name: params.MemRegionSize, Type: params.Uint64, Value: uint64(4096)}}}, `mem.size = 4096`}, @@ -576,6 +581,6 @@ func TestFieldCatalogTypes(t *testing.T) { require.Equal(t, params.Uint64, fields.PsUUID.Type()) require.Equal(t, params.Uint32, fields.PsUID.Type()) require.Equal(t, params.Int64, fields.PsSignal.Type()) - require.Equal(t, params.Bool, fields.FileTruncated.Type()) - require.Equal(t, params.Bool, fields.EvtTruncated.Type()) + require.Equal(t, params.Uint32, fields.EvtSyscallID.Type()) + require.Equal(t, params.String, fields.FilePathTarget.Type()) } From d42955a378be52ae6a406af6142cabc85bb585c7 Mon Sep 17 00:00:00 2001 From: rabbitstack Date: Wed, 16 Sep 2026 18:20:18 +0200 Subject: [PATCH 46/65] feat(build): Add Makefile for build targets The Makefile script automates the process of compiling the eBPF programs, Fibratus binary, running tests, formatting, etc. The bpf2go now drops all generated Go files + ebpf bytecode inside a separate bpf package making it easier to navigate and distinguish the generated code. --- .github/workflows/linux-port.yml | 5 +- .gitignore | 1 + Makefile | 58 ++++++++++++ internal/ebpf/{ => bpf}/clone_bpfeb.go | 84 +++++++++--------- internal/ebpf/bpf/clone_bpfeb.o | Bin 0 -> 42672 bytes internal/ebpf/{ => bpf}/clone_bpfel.go | 84 +++++++++--------- internal/ebpf/bpf/clone_bpfel.o | Bin 0 -> 42288 bytes internal/ebpf/{ => bpf}/ctl_bpfeb.go | 84 +++++++++--------- internal/ebpf/bpf/ctl_bpfeb.o | Bin 0 -> 20648 bytes internal/ebpf/{ => bpf}/ctl_bpfel.go | 84 +++++++++--------- internal/ebpf/bpf/ctl_bpfel.o | Bin 0 -> 20264 bytes internal/ebpf/{ => bpf}/execve_bpfeb.go | 84 +++++++++--------- internal/ebpf/bpf/execve_bpfeb.o | Bin 0 -> 21424 bytes internal/ebpf/{ => bpf}/execve_bpfel.go | 84 +++++++++--------- internal/ebpf/bpf/execve_bpfel.o | Bin 0 -> 21232 bytes internal/ebpf/{ => bpf}/exit_bpfeb.go | 84 +++++++++--------- internal/ebpf/bpf/exit_bpfeb.o | Bin 0 -> 7720 bytes internal/ebpf/{ => bpf}/exit_bpfel.go | 84 +++++++++--------- internal/ebpf/bpf/exit_bpfel.o | Bin 0 -> 7720 bytes internal/ebpf/{ => bpf}/file_bpfeb.go | 84 +++++++++--------- internal/ebpf/bpf/file_bpfeb.o | Bin 0 -> 72800 bytes internal/ebpf/{ => bpf}/file_bpfel.go | 84 +++++++++--------- internal/ebpf/bpf/file_bpfel.o | Bin 0 -> 72032 bytes internal/ebpf/{ => bpf}/mem_bpfeb.go | 84 +++++++++--------- internal/ebpf/bpf/mem_bpfeb.o | Bin 0 -> 30584 bytes internal/ebpf/{ => bpf}/mem_bpfel.go | 84 +++++++++--------- internal/ebpf/bpf/mem_bpfel.o | Bin 0 -> 30296 bytes internal/ebpf/{ => bpf}/net_bpfeb.go | 84 +++++++++--------- internal/ebpf/bpf/net_bpfeb.o | Bin 0 -> 31896 bytes internal/ebpf/{ => bpf}/net_bpfel.go | 84 +++++++++--------- internal/ebpf/bpf/net_bpfel.o | Bin 0 -> 31608 bytes internal/ebpf/{ => bpf}/prociter_bpfeb.go | 84 +++++++++--------- internal/ebpf/bpf/prociter_bpfeb.o | Bin 0 -> 7000 bytes internal/ebpf/{ => bpf}/prociter_bpfel.go | 84 +++++++++--------- internal/ebpf/bpf/prociter_bpfel.o | Bin 0 -> 7000 bytes .../c/{proc_iter.bpf.c => prociter.bpf.c} | 0 internal/ebpf/clone_bpfeb.o | Bin 45192 -> 0 bytes internal/ebpf/clone_bpfel.o | Bin 44808 -> 0 bytes internal/ebpf/ctl_bpfeb.o | Bin 22144 -> 0 bytes internal/ebpf/ctl_bpfel.o | Bin 21760 -> 0 bytes internal/ebpf/execve_bpfeb.o | Bin 22768 -> 0 bytes internal/ebpf/execve_bpfel.o | Bin 22576 -> 0 bytes internal/ebpf/exit_bpfeb.o | Bin 7872 -> 0 bytes internal/ebpf/exit_bpfel.o | Bin 7872 -> 0 bytes internal/ebpf/file_bpfeb.o | Bin 77912 -> 0 bytes internal/ebpf/file_bpfel.o | Bin 77144 -> 0 bytes internal/ebpf/gen.go | 26 ------ internal/ebpf/generate.sh | 40 --------- internal/ebpf/loader.go | 63 ++++++------- internal/ebpf/mem_bpfeb.o | Bin 32216 -> 0 bytes internal/ebpf/mem_bpfel.o | Bin 31928 -> 0 bytes internal/ebpf/net_bpfeb.o | Bin 33600 -> 0 bytes internal/ebpf/net_bpfel.o | Bin 33312 -> 0 bytes internal/ebpf/prociter_bpfeb.o | Bin 7136 -> 0 bytes internal/ebpf/prociter_bpfel.o | Bin 7136 -> 0 bytes 55 files changed, 765 insertions(+), 772 deletions(-) create mode 100644 Makefile rename internal/ebpf/{ => bpf}/clone_bpfeb.go (68%) create mode 100644 internal/ebpf/bpf/clone_bpfeb.o rename internal/ebpf/{ => bpf}/clone_bpfel.go (68%) create mode 100644 internal/ebpf/bpf/clone_bpfel.o rename internal/ebpf/{ => bpf}/ctl_bpfeb.go (56%) create mode 100644 internal/ebpf/bpf/ctl_bpfeb.o rename internal/ebpf/{ => bpf}/ctl_bpfel.go (57%) create mode 100644 internal/ebpf/bpf/ctl_bpfel.o rename internal/ebpf/{ => bpf}/execve_bpfeb.go (61%) create mode 100644 internal/ebpf/bpf/execve_bpfeb.o rename internal/ebpf/{ => bpf}/execve_bpfel.go (62%) create mode 100644 internal/ebpf/bpf/execve_bpfel.o rename internal/ebpf/{ => bpf}/exit_bpfeb.go (57%) create mode 100644 internal/ebpf/bpf/exit_bpfeb.o rename internal/ebpf/{ => bpf}/exit_bpfel.go (57%) create mode 100644 internal/ebpf/bpf/exit_bpfel.o rename internal/ebpf/{ => bpf}/file_bpfeb.go (74%) create mode 100644 internal/ebpf/bpf/file_bpfeb.o rename internal/ebpf/{ => bpf}/file_bpfel.go (74%) create mode 100644 internal/ebpf/bpf/file_bpfel.o rename internal/ebpf/{ => bpf}/mem_bpfeb.go (66%) create mode 100644 internal/ebpf/bpf/mem_bpfeb.o rename internal/ebpf/{ => bpf}/mem_bpfel.go (67%) create mode 100644 internal/ebpf/bpf/mem_bpfel.o rename internal/ebpf/{ => bpf}/net_bpfeb.go (65%) create mode 100644 internal/ebpf/bpf/net_bpfeb.o rename internal/ebpf/{ => bpf}/net_bpfel.go (65%) create mode 100644 internal/ebpf/bpf/net_bpfel.o rename internal/ebpf/{ => bpf}/prociter_bpfeb.go (55%) create mode 100644 internal/ebpf/bpf/prociter_bpfeb.o rename internal/ebpf/{ => bpf}/prociter_bpfel.go (56%) create mode 100644 internal/ebpf/bpf/prociter_bpfel.o rename internal/ebpf/c/{proc_iter.bpf.c => prociter.bpf.c} (100%) delete mode 100644 internal/ebpf/clone_bpfeb.o delete mode 100644 internal/ebpf/clone_bpfel.o delete mode 100644 internal/ebpf/ctl_bpfeb.o delete mode 100644 internal/ebpf/ctl_bpfel.o delete mode 100644 internal/ebpf/execve_bpfeb.o delete mode 100644 internal/ebpf/execve_bpfel.o delete mode 100644 internal/ebpf/exit_bpfeb.o delete mode 100644 internal/ebpf/exit_bpfel.o delete mode 100644 internal/ebpf/file_bpfeb.o delete mode 100644 internal/ebpf/file_bpfel.o delete mode 100644 internal/ebpf/gen.go delete mode 100755 internal/ebpf/generate.sh delete mode 100644 internal/ebpf/mem_bpfeb.o delete mode 100644 internal/ebpf/mem_bpfel.o delete mode 100644 internal/ebpf/net_bpfeb.o delete mode 100644 internal/ebpf/net_bpfel.o delete mode 100644 internal/ebpf/prociter_bpfeb.o delete mode 100644 internal/ebpf/prociter_bpfel.o diff --git a/.github/workflows/linux-port.yml b/.github/workflows/linux-port.yml index 31c68cf90..e9a9c62c9 100644 --- a/.github/workflows/linux-port.yml +++ b/.github/workflows/linux-port.yml @@ -35,9 +35,8 @@ jobs: clang --version - name: Check generation drift run: | - chmod +x internal/ebpf/generate.sh - ./internal/ebpf/generate.sh - git diff --exit-code -- internal/ebpf + make ebpf + git diff --exit-code -- internal/ebpf/bpf - name: Unit tests run: go test ./internal/ebpf ./internal/bootstrap ./pkg/event ./pkg/ps ./pkg/api ./pkg/util/signals - name: Privileged process source diff --git a/.gitignore b/.gitignore index 02ca2865e..94721e74c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ cmd/fibratus/fibratus.exe cmd/fibratus/fibratus.syso +cmd/fibratus/fibratus cmd/systray/fibratus-systray.exe cmd/systray/fibratus-systray.syso diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..80cf47850 --- /dev/null +++ b/Makefile @@ -0,0 +1,58 @@ +.DEFAULT_GOAL := build + +SHELL=bash -o pipefail -e + +BPF2GO_VERSION := v0.20.0 + +# Specifies a list of build flags +TAGS ?= "" + +BPF_DIR := internal/ebpf + +BPF_FLAGS := \ + -go-package bpf \ + -output-dir $(BPF_DIR)/bpf \ + -cc clang \ + -target bpfel,bpfeb \ + -tags linux + +BPF_CFLAGS := \ + -I./$(BPF_DIR)/spike/c \ + -I./$(BPF_DIR)/c \ + -I./$(BPF_DIR)/c/common \ + -O2 \ + -g \ + -D__TARGET_ARCH_x86 + +# Find all eBPF sources. +BPF_SOURCES := $(wildcard $(BPF_DIR)/c/*.bpf.c) +BPF_NAMES := $(patsubst $(BPF_DIR)/c/%.bpf.c,%,$(BPF_SOURCES)) +BPF_TARGETS := $(foreach name,$(BPF_NAMES), \ + $(BPF_DIR)/$(name)_bpfel.go \ + $(BPF_DIR)/$(name)_bpfeb.go) + +CLANG ?= clang +GO ?= go +GOFMT ?= gofmt +BPF2GO ?= go run github.com/cilium/ebpf/cmd/bpf2go@$(BPF2GO_VERSION) + +.PHONY: ebpf +ebpf: $(BPF_TARGETS) +$(BPF_DIR)/%_bpfel.go $(BPF_DIR)/%_bpfeb.go &: $(BPF_DIR)/c/%.bpf.c + $(BPF2GO) $(BPF_FLAGS) -output-stem $* $(shell echo $* | sed 's/^./\U&/') $(BPF_DIR)/c/$*.bpf.c -- $(BPF_CFLAGS) + +.PHONY: build +build: + $(GO) build -tags $(TAGS) -o ./cmd/fibratus/fibratus ./cmd/fibratus/ + +.PHONY: fmt +fmt: + $(GOFMT) -e -s -l -w pkg cmd + +.PHONY: test +test: + $(GO) test ./... + +.PHONY: clean +clean: + rm -f cmd/fibratus/fibratus diff --git a/internal/ebpf/clone_bpfeb.go b/internal/ebpf/bpf/clone_bpfeb.go similarity index 68% rename from internal/ebpf/clone_bpfeb.go rename to internal/ebpf/bpf/clone_bpfeb.go index bca4d7573..e8366cd2a 100644 --- a/internal/ebpf/clone_bpfeb.go +++ b/internal/ebpf/bpf/clone_bpfeb.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (mips || mips64 || ppc64 || s390x) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type cloneScratchValue struct { +type CloneScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type cloneScratchValue struct { Aux [256]uint8 } -// loadClone returns the embedded CollectionSpec for clone. -func loadClone() (*ebpf.CollectionSpec, error) { +// LoadClone returns the embedded CollectionSpec for Clone. +func LoadClone() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_CloneBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load clone: %w", err) + return nil, fmt.Errorf("can't load Clone: %w", err) } return spec, err } -// loadCloneObjects loads clone and converts it into a struct. +// LoadCloneObjects loads Clone and converts it into a struct. // // The following types are suitable as obj argument: // -// *cloneObjects -// *clonePrograms -// *cloneMaps +// *CloneObjects +// *ClonePrograms +// *CloneMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadCloneObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadClone() +func LoadCloneObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadClone() if err != nil { return err } @@ -55,19 +55,19 @@ func loadCloneObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// cloneSpecs contains maps and programs before they are loaded into the kernel. +// CloneSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type cloneSpecs struct { - cloneProgramSpecs - cloneMapSpecs - cloneVariableSpecs +type CloneSpecs struct { + CloneProgramSpecs + CloneMapSpecs + CloneVariableSpecs } -// cloneProgramSpecs contains programs before they are loaded into the kernel. +// CloneProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type cloneProgramSpecs struct { +type CloneProgramSpecs struct { HandleSchedProcessFork *ebpf.ProgramSpec `ebpf:"handle_sched_process_fork"` HandleSysEnterClone *ebpf.ProgramSpec `ebpf:"handle_sys_enter_clone"` HandleSysEnterClone3 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_clone3"` @@ -79,10 +79,10 @@ type cloneProgramSpecs struct { HandleSysExitVfork *ebpf.ProgramSpec `ebpf:"handle_sys_exit_vfork"` } -// cloneMapSpecs contains maps before they are loaded into the kernel. +// CloneMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type cloneMapSpecs struct { +type CloneMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -90,32 +90,32 @@ type cloneMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// cloneVariableSpecs contains global variables before they are loaded into the kernel. +// CloneVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type cloneVariableSpecs struct { +type CloneVariableSpecs struct { } -// cloneObjects contains all objects after they have been loaded into the kernel. +// CloneObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. -type cloneObjects struct { - clonePrograms - cloneMaps - cloneVariables +// It can be passed to LoadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type CloneObjects struct { + ClonePrograms + CloneMaps + CloneVariables } -func (o *cloneObjects) Close() error { +func (o *CloneObjects) Close() error { return _CloneClose( - &o.clonePrograms, - &o.cloneMaps, + &o.ClonePrograms, + &o.CloneMaps, ) } -// cloneMaps contains all maps after they have been loaded into the kernel. +// CloneMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. -type cloneMaps struct { +// It can be passed to LoadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type CloneMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -123,7 +123,7 @@ type cloneMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *cloneMaps) Close() error { +func (m *CloneMaps) Close() error { return _CloneClose( m.DropCount, m.Enabled, @@ -133,16 +133,16 @@ func (m *cloneMaps) Close() error { ) } -// cloneVariables contains all global variables after they have been loaded into the kernel. +// CloneVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. -type cloneVariables struct { +// It can be passed to LoadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type CloneVariables struct { } -// clonePrograms contains all programs after they have been loaded into the kernel. +// ClonePrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. -type clonePrograms struct { +// It can be passed to LoadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type ClonePrograms struct { HandleSchedProcessFork *ebpf.Program `ebpf:"handle_sched_process_fork"` HandleSysEnterClone *ebpf.Program `ebpf:"handle_sys_enter_clone"` HandleSysEnterClone3 *ebpf.Program `ebpf:"handle_sys_enter_clone3"` @@ -154,7 +154,7 @@ type clonePrograms struct { HandleSysExitVfork *ebpf.Program `ebpf:"handle_sys_exit_vfork"` } -func (p *clonePrograms) Close() error { +func (p *ClonePrograms) Close() error { return _CloneClose( p.HandleSchedProcessFork, p.HandleSysEnterClone, diff --git a/internal/ebpf/bpf/clone_bpfeb.o b/internal/ebpf/bpf/clone_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..45c82786e0f3bbefd17a7cf424079da7e2846b67 GIT binary patch literal 42672 zcmeI4eUMw%dEO6zT`WjZBxH*cY*F%+?a-h?k)Y@gSXLOwGHs})&8;lAD@!Q=?t%oW zlxhHd!O?=@A*FGo^$U37C&?T!l%RGkQp2y^XG5} zJO&mxeyw6D!|VMfv{o>2p|uxGO!P)guExwZZ+%Df=0kEdX38_>)~#FLN!ZZV%U*uY zIYVD$o|DErEnZh#PTot@Yq4-r{GlE-LA5Eu-{ub$Z-fi=sXNpjb(`9yZc#hbHnm0F zq&BG=)CP5(TBp{iRceJ=qUNbH)M;v#nxUqtDQc4HQ4`cSHAWRd{Y{^`L+w$wsa@(8 zwL@)FThvWzle$4|P}iw-YK>Z@R;VRvo;pLFre>)bYMPp&CaE4ZL5)*mR1tG+%8kcs zQR4~U%*)jnj<>_tHg5HW)%fh|@p<#35(?uwW5tgjzTwdP9jZV6*M8RB4}pAkBuKFq z%47WBx?xLeBC~(*?d8AE{b2|A3oae=#kh$|`l=o~x*kj?GHF5=CH#$bxf-Lx-SEUW zT)mMJ9kkb9_uKD_d2>+wXMgjZmH()@^-YP#`iK6AGt8v9)f4|~<#2^sqUNb?oRq`U zpNQwk1Y7N&0(KH%`joI5|cYLB5}n4QhkB zPOVdG)GDtB{yHp zUNOhSKDb{CLWA&!Z`#u0zPs1?U$Lp1!FqM`=bit>pLNRn@5r^1o0pLOgjiV(+H}A1*rd+xucVC(~)A98KemPjq)Xk5%ct_4Sz4_kVbTIw&nNE!9ys-9O zcOPFXm}v>gbmH$gokv|dM^k(baOIx(9_5(u%TZuCX8An9a(G8xxP3kRa{B44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q~f&Vtl}BPCB;?6b;S+EO~oz69mQS6 zJ;nWDzBi^gp*X2HtvIWAMsZ1TRdHQ$Lvd4aOL0eWS8-2qf0z?7#U41YU!F)Q&M2N% zoL5{?TvNQRcti1~;V{yfv;*?_fye{zh$1(Z5 zF39qEU6AGTx**HvbwQTT>w+wwM+WvYkG-Mz8;ajj{GDNzpQ;R|cfT}1;QjjklZqcx zEcFeBe@?N~H)y{OmN`}O#c}^vaS8HoD3_|^ou#WzmOv7?D?g?U9-z= zP>cO#mwh8iRzp7rv-byCT)a^~*RrRCqx0JR$s0C|IW<53;#K+Kwk7;<pAcAfFNKbNq_^00~oENg3@I3Fs$opJgry9+@Bn+?-#;CnVo< z`yTP_=hlJfc1|IO{t+BiSq zj}K?)I4*v=8Mp(-PbUZ-RPy(~59h~6{^pp;FF&!adVc+=_N8koQBoH8o^j*Ia?3M%>A z7g%T@|Ip_aZ(XqMR)b;qc(qUV$E|M;v{&d);3?1G`y6X+=NX=XN}Pj^2l*%dHx!NF AlK=n! literal 0 HcmV?d00001 diff --git a/internal/ebpf/clone_bpfel.go b/internal/ebpf/bpf/clone_bpfel.go similarity index 68% rename from internal/ebpf/clone_bpfel.go rename to internal/ebpf/bpf/clone_bpfel.go index 64364fe61..7df15faff 100644 --- a/internal/ebpf/clone_bpfel.go +++ b/internal/ebpf/bpf/clone_bpfel.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type cloneScratchValue struct { +type CloneScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type cloneScratchValue struct { Aux [256]uint8 } -// loadClone returns the embedded CollectionSpec for clone. -func loadClone() (*ebpf.CollectionSpec, error) { +// LoadClone returns the embedded CollectionSpec for Clone. +func LoadClone() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_CloneBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load clone: %w", err) + return nil, fmt.Errorf("can't load Clone: %w", err) } return spec, err } -// loadCloneObjects loads clone and converts it into a struct. +// LoadCloneObjects loads Clone and converts it into a struct. // // The following types are suitable as obj argument: // -// *cloneObjects -// *clonePrograms -// *cloneMaps +// *CloneObjects +// *ClonePrograms +// *CloneMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadCloneObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadClone() +func LoadCloneObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadClone() if err != nil { return err } @@ -55,19 +55,19 @@ func loadCloneObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// cloneSpecs contains maps and programs before they are loaded into the kernel. +// CloneSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type cloneSpecs struct { - cloneProgramSpecs - cloneMapSpecs - cloneVariableSpecs +type CloneSpecs struct { + CloneProgramSpecs + CloneMapSpecs + CloneVariableSpecs } -// cloneProgramSpecs contains programs before they are loaded into the kernel. +// CloneProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type cloneProgramSpecs struct { +type CloneProgramSpecs struct { HandleSchedProcessFork *ebpf.ProgramSpec `ebpf:"handle_sched_process_fork"` HandleSysEnterClone *ebpf.ProgramSpec `ebpf:"handle_sys_enter_clone"` HandleSysEnterClone3 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_clone3"` @@ -79,10 +79,10 @@ type cloneProgramSpecs struct { HandleSysExitVfork *ebpf.ProgramSpec `ebpf:"handle_sys_exit_vfork"` } -// cloneMapSpecs contains maps before they are loaded into the kernel. +// CloneMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type cloneMapSpecs struct { +type CloneMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -90,32 +90,32 @@ type cloneMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// cloneVariableSpecs contains global variables before they are loaded into the kernel. +// CloneVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type cloneVariableSpecs struct { +type CloneVariableSpecs struct { } -// cloneObjects contains all objects after they have been loaded into the kernel. +// CloneObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. -type cloneObjects struct { - clonePrograms - cloneMaps - cloneVariables +// It can be passed to LoadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type CloneObjects struct { + ClonePrograms + CloneMaps + CloneVariables } -func (o *cloneObjects) Close() error { +func (o *CloneObjects) Close() error { return _CloneClose( - &o.clonePrograms, - &o.cloneMaps, + &o.ClonePrograms, + &o.CloneMaps, ) } -// cloneMaps contains all maps after they have been loaded into the kernel. +// CloneMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. -type cloneMaps struct { +// It can be passed to LoadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type CloneMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -123,7 +123,7 @@ type cloneMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *cloneMaps) Close() error { +func (m *CloneMaps) Close() error { return _CloneClose( m.DropCount, m.Enabled, @@ -133,16 +133,16 @@ func (m *cloneMaps) Close() error { ) } -// cloneVariables contains all global variables after they have been loaded into the kernel. +// CloneVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. -type cloneVariables struct { +// It can be passed to LoadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type CloneVariables struct { } -// clonePrograms contains all programs after they have been loaded into the kernel. +// ClonePrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. -type clonePrograms struct { +// It can be passed to LoadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. +type ClonePrograms struct { HandleSchedProcessFork *ebpf.Program `ebpf:"handle_sched_process_fork"` HandleSysEnterClone *ebpf.Program `ebpf:"handle_sys_enter_clone"` HandleSysEnterClone3 *ebpf.Program `ebpf:"handle_sys_enter_clone3"` @@ -154,7 +154,7 @@ type clonePrograms struct { HandleSysExitVfork *ebpf.Program `ebpf:"handle_sys_exit_vfork"` } -func (p *clonePrograms) Close() error { +func (p *ClonePrograms) Close() error { return _CloneClose( p.HandleSchedProcessFork, p.HandleSysEnterClone, diff --git a/internal/ebpf/bpf/clone_bpfel.o b/internal/ebpf/bpf/clone_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..e81f9adbdc06667c2660c4becf7547706dd020b4 GIT binary patch literal 42288 zcmeI5e~_a`de>VTd#zos?eX5Oteow;*LP-4>#TRjUgsiw&PM*RKAGD)557GZpD#$V zM!On3JENN)Ysqpd;&6xv4os!Opi0a!IpCtA9GI$Hu?igQ07oIJTww~5Vj!k6q#RJy znX0L)!0C?z^L@I%t$Fo~#y<#{gHqSN^Yo{m{@wjPZ+A<2_h-&ucrqG^81EwH`(}@P zs4=^Leb1k^-n6+JF{|-$OVvAKR$g<$6n_2>-;sdp->|{vrl>K0_|7};Bvj@<3$+A& ziKX6XF4_c_Z!#u;??uX5J&7EQsnr9@1m!qojM7l{Y)Q5HE@hW;hjN>8i?TzxN!g~{ zplngDQ#L7ADI1h^$_izfvP7AqoTi+j%uuE&QmSK{-wtqcoH~=`QrwE@hW; zhjN>8i?TzxN!g~{plngDQ#L7ADI1h^$_izfvP7AqoTi+j%uuE&QmSK{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;@)HYe-=@O zmERoFemSz#<$n=jL(9J(3b^-b|I>&wto-(n_REyg<^MN?4J*H!f&$Keug}q5de7g3 zXIS}(pLQ{(7*YCPj&OAO&!KQBUv;x-KjsqhnBM{ZO5CuU01QjtVfxi@WcYpgJ{Ye~ z+Lx#3rXP1P?&Lny$Jh4rKO_CH_LtcH91}|WB`aUPpZ{Xsbekl}@|Wc=zGudDjw81| z@_vzGQ-+n_Vfh-u{LfC<{?HY+Y@ Qno3D0A5r@9xxF?26aQh{i~s-t literal 0 HcmV?d00001 diff --git a/internal/ebpf/ctl_bpfeb.go b/internal/ebpf/bpf/ctl_bpfeb.go similarity index 56% rename from internal/ebpf/ctl_bpfeb.go rename to internal/ebpf/bpf/ctl_bpfeb.go index c41298b34..16ff6f0b1 100644 --- a/internal/ebpf/ctl_bpfeb.go +++ b/internal/ebpf/bpf/ctl_bpfeb.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (mips || mips64 || ppc64 || s390x) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type ctlScratchValue struct { +type CtlScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type ctlScratchValue struct { Aux [256]uint8 } -// loadCtl returns the embedded CollectionSpec for ctl. -func loadCtl() (*ebpf.CollectionSpec, error) { +// LoadCtl returns the embedded CollectionSpec for Ctl. +func LoadCtl() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_CtlBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load ctl: %w", err) + return nil, fmt.Errorf("can't load Ctl: %w", err) } return spec, err } -// loadCtlObjects loads ctl and converts it into a struct. +// LoadCtlObjects loads Ctl and converts it into a struct. // // The following types are suitable as obj argument: // -// *ctlObjects -// *ctlPrograms -// *ctlMaps +// *CtlObjects +// *CtlPrograms +// *CtlMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadCtlObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadCtl() +func LoadCtlObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadCtl() if err != nil { return err } @@ -55,26 +55,26 @@ func loadCtlObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// ctlSpecs contains maps and programs before they are loaded into the kernel. +// CtlSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type ctlSpecs struct { - ctlProgramSpecs - ctlMapSpecs - ctlVariableSpecs +type CtlSpecs struct { + CtlProgramSpecs + CtlMapSpecs + CtlVariableSpecs } -// ctlProgramSpecs contains programs before they are loaded into the kernel. +// CtlProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type ctlProgramSpecs struct { +type CtlProgramSpecs struct { HandleSysExit *ebpf.ProgramSpec `ebpf:"handle_sys_exit"` } -// ctlMapSpecs contains maps before they are loaded into the kernel. +// CtlMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type ctlMapSpecs struct { +type CtlMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -82,32 +82,32 @@ type ctlMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// ctlVariableSpecs contains global variables before they are loaded into the kernel. +// CtlVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type ctlVariableSpecs struct { +type CtlVariableSpecs struct { } -// ctlObjects contains all objects after they have been loaded into the kernel. +// CtlObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. -type ctlObjects struct { - ctlPrograms - ctlMaps - ctlVariables +// It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type CtlObjects struct { + CtlPrograms + CtlMaps + CtlVariables } -func (o *ctlObjects) Close() error { +func (o *CtlObjects) Close() error { return _CtlClose( - &o.ctlPrograms, - &o.ctlMaps, + &o.CtlPrograms, + &o.CtlMaps, ) } -// ctlMaps contains all maps after they have been loaded into the kernel. +// CtlMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. -type ctlMaps struct { +// It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type CtlMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -115,7 +115,7 @@ type ctlMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *ctlMaps) Close() error { +func (m *CtlMaps) Close() error { return _CtlClose( m.DropCount, m.Enabled, @@ -125,20 +125,20 @@ func (m *ctlMaps) Close() error { ) } -// ctlVariables contains all global variables after they have been loaded into the kernel. +// CtlVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. -type ctlVariables struct { +// It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type CtlVariables struct { } -// ctlPrograms contains all programs after they have been loaded into the kernel. +// CtlPrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. -type ctlPrograms struct { +// It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type CtlPrograms struct { HandleSysExit *ebpf.Program `ebpf:"handle_sys_exit"` } -func (p *ctlPrograms) Close() error { +func (p *CtlPrograms) Close() error { return _CtlClose( p.HandleSysExit, ) diff --git a/internal/ebpf/bpf/ctl_bpfeb.o b/internal/ebpf/bpf/ctl_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..fc3dd7f5939044c457c3b8b4fd92674a3037fbc2 GIT binary pat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#aazW!K- z`B{H#jm-LE9r7DcTycy|xV`u}$KJl3Juv=XF(m(2!nJD}53p}8c6A*4@fcfo z?8}ddy`l0+u~(SolQqY_d{V{_Z4S%-6mad8hwv#0VDDmmzJC02e4ze`H8Sg;kowS` zuYa=T*q5K&94x;tAhZ0wf@5DEbb||Twen)CuY0hesQ7(tWIBtU;Vfq_83VZj+)sw$ zB~Gp+?(tB(uv`J|3y4n$gf5&p%^!sFXP6d1bD{WLC?3JcMLfjTh>MSkZ-h9WR@@t8 zc@H&l+$^7HA}qFf?jRgWm-oVOy1eHNq>DYF@z_Zm(mx{S%kx!Q(RD7Q`}VCQoOFXt+=DOt9VOsZ;o zL2*rSQ*lf2y5hFtj^eK3EycY-##c`R{ok2X94O8x&MM9+E-0=kZYpjmURT^!+)>1rW+VcDLdKijOHiq4+b3tBPM%{F>qmieFd!ZN=YL{D$J6Dt>E_le-n)t@wcA zV~S5G{*2gDRxN1l6XO5plW>fZKiPsyi$@yXw| zy5H3JAEw&hjS|dMwfe%M{O+!fAHDW}cH@6lI)&eBHHs(A)XJGftF)#6YaN*UE4e<4 zTI>tx+iN>hd~Y2vH?lCWq0J(^F;`hZgZy^TcUciit*-hNLPuEHJ|8G-L~jXgj? zvy7uWHqAf>x*NCer!O!2%nELAzfVV$T>E-X<@e14m(MSezl+cGF+wGIX_WlVX?H5Qs@wy%@FuVzs KGCrSgKlOjyBmkfQ literal 0 HcmV?d00001 diff --git a/internal/ebpf/ctl_bpfel.go b/internal/ebpf/bpf/ctl_bpfel.go similarity index 57% rename from internal/ebpf/ctl_bpfel.go rename to internal/ebpf/bpf/ctl_bpfel.go index d28873580..dc85991c4 100644 --- a/internal/ebpf/ctl_bpfel.go +++ b/internal/ebpf/bpf/ctl_bpfel.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type ctlScratchValue struct { +type CtlScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type ctlScratchValue struct { Aux [256]uint8 } -// loadCtl returns the embedded CollectionSpec for ctl. -func loadCtl() (*ebpf.CollectionSpec, error) { +// LoadCtl returns the embedded CollectionSpec for Ctl. +func LoadCtl() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_CtlBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load ctl: %w", err) + return nil, fmt.Errorf("can't load Ctl: %w", err) } return spec, err } -// loadCtlObjects loads ctl and converts it into a struct. +// LoadCtlObjects loads Ctl and converts it into a struct. // // The following types are suitable as obj argument: // -// *ctlObjects -// *ctlPrograms -// *ctlMaps +// *CtlObjects +// *CtlPrograms +// *CtlMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadCtlObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadCtl() +func LoadCtlObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadCtl() if err != nil { return err } @@ -55,26 +55,26 @@ func loadCtlObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// ctlSpecs contains maps and programs before they are loaded into the kernel. +// CtlSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type ctlSpecs struct { - ctlProgramSpecs - ctlMapSpecs - ctlVariableSpecs +type CtlSpecs struct { + CtlProgramSpecs + CtlMapSpecs + CtlVariableSpecs } -// ctlProgramSpecs contains programs before they are loaded into the kernel. +// CtlProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type ctlProgramSpecs struct { +type CtlProgramSpecs struct { HandleSysExit *ebpf.ProgramSpec `ebpf:"handle_sys_exit"` } -// ctlMapSpecs contains maps before they are loaded into the kernel. +// CtlMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type ctlMapSpecs struct { +type CtlMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -82,32 +82,32 @@ type ctlMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// ctlVariableSpecs contains global variables before they are loaded into the kernel. +// CtlVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type ctlVariableSpecs struct { +type CtlVariableSpecs struct { } -// ctlObjects contains all objects after they have been loaded into the kernel. +// CtlObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. -type ctlObjects struct { - ctlPrograms - ctlMaps - ctlVariables +// It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type CtlObjects struct { + CtlPrograms + CtlMaps + CtlVariables } -func (o *ctlObjects) Close() error { +func (o *CtlObjects) Close() error { return _CtlClose( - &o.ctlPrograms, - &o.ctlMaps, + &o.CtlPrograms, + &o.CtlMaps, ) } -// ctlMaps contains all maps after they have been loaded into the kernel. +// CtlMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. -type ctlMaps struct { +// It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type CtlMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -115,7 +115,7 @@ type ctlMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *ctlMaps) Close() error { +func (m *CtlMaps) Close() error { return _CtlClose( m.DropCount, m.Enabled, @@ -125,20 +125,20 @@ func (m *ctlMaps) Close() error { ) } -// ctlVariables contains all global variables after they have been loaded into the kernel. +// CtlVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. -type ctlVariables struct { +// It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type CtlVariables struct { } -// ctlPrograms contains all programs after they have been loaded into the kernel. +// CtlPrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. -type ctlPrograms struct { +// It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. +type CtlPrograms struct { HandleSysExit *ebpf.Program `ebpf:"handle_sys_exit"` } -func (p *ctlPrograms) Close() error { +func (p *CtlPrograms) Close() error { return _CtlClose( p.HandleSysExit, ) diff --git a/internal/ebpf/bpf/ctl_bpfel.o b/internal/ebpf/bpf/ctl_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..3f289f5004b4e31af3935c2c8fa4b9214c39c156 GIT binary patch literal 20264 zcmeI3e{5UVb;qwM%aI(%X42Tz8gF@N(~Qm>nX%JWb<>n->r`2smT*%*>AI1$L|a5C zi6tpjiVBol+f3Nff$KI^C^C%cf=wIp2L}v@i?s;{mbJ@zy0Ux!>{GgYHdVyIK^mG0D z^B&nA?9aE~@&3rV-tatP_tA~nS#WTJ?$`Z1zUZ&Gk9K_}%iE$$gx(@`s zRx7X?JSSJDDf5&Qlv&Dg$_(WgWtuWY8BvZsrQPdP!Er5vZsP>xZiDN~dY$DxDfaCBE6+R2s~Mla zysCNxeZ>#T^W;_fP2mHG%L_rDFCjkyPcH1n6>`s=UVaJJ$a9#-s|BC!`hXwgd0>=&m*o)l>Uf;`8v}Eid_ogYI{|Twb8xS)kuppx;@b-&vsF zS)kuppx;@b-&vsFS)kuppx;@b-&vsFS)kuppx;^8#7fBi_bE3hdz6gM z6-<&#_znDd;Kp#Z7+{ z{K@~XKMLnG**CEe^;_5PAH(xP`jO|+wfv*ZSI1HRxb0_y-Rg5jo-Y!l-q#Rc5kUBZ zAaD+#|Gar_3w~{t{&S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B?JvJ(^{gblGe(fmr>@Obq+s^Qt68&MO|J@|Pjh4#`GxEE$ zDt`32^|KTGRplstuT(Fbb)&VV884~J)~{89;_vYKRkY_T(T<)z_C&y!cI1Y4f_Rpk zc_s2#xmA?eO6^R@eHITV0M}}--^sKMk1vY;8>T$cGg~|>lq9Z=KmkHb^&Gp literal 0 HcmV?d00001 diff --git a/internal/ebpf/execve_bpfeb.go b/internal/ebpf/bpf/execve_bpfeb.go similarity index 61% rename from internal/ebpf/execve_bpfeb.go rename to internal/ebpf/bpf/execve_bpfeb.go index c0d9eb2ac..9ed97d93b 100644 --- a/internal/ebpf/execve_bpfeb.go +++ b/internal/ebpf/bpf/execve_bpfeb.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (mips || mips64 || ppc64 || s390x) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type execveScratchValue struct { +type ExecveScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type execveScratchValue struct { Aux [256]uint8 } -// loadExecve returns the embedded CollectionSpec for execve. -func loadExecve() (*ebpf.CollectionSpec, error) { +// LoadExecve returns the embedded CollectionSpec for Execve. +func LoadExecve() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_ExecveBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load execve: %w", err) + return nil, fmt.Errorf("can't load Execve: %w", err) } return spec, err } -// loadExecveObjects loads execve and converts it into a struct. +// LoadExecveObjects loads Execve and converts it into a struct. // // The following types are suitable as obj argument: // -// *execveObjects -// *execvePrograms -// *execveMaps +// *ExecveObjects +// *ExecvePrograms +// *ExecveMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadExecveObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadExecve() +func LoadExecveObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadExecve() if err != nil { return err } @@ -55,29 +55,29 @@ func loadExecveObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// execveSpecs contains maps and programs before they are loaded into the kernel. +// ExecveSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type execveSpecs struct { - execveProgramSpecs - execveMapSpecs - execveVariableSpecs +type ExecveSpecs struct { + ExecveProgramSpecs + ExecveMapSpecs + ExecveVariableSpecs } -// execveProgramSpecs contains programs before they are loaded into the kernel. +// ExecveProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type execveProgramSpecs struct { +type ExecveProgramSpecs struct { HandleSysEnterExecve *ebpf.ProgramSpec `ebpf:"handle_sys_enter_execve"` HandleSysEnterExecveat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_execveat"` HandleSysExitExecve *ebpf.ProgramSpec `ebpf:"handle_sys_exit_execve"` HandleSysExitExecveat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_execveat"` } -// execveMapSpecs contains maps before they are loaded into the kernel. +// ExecveMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type execveMapSpecs struct { +type ExecveMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -85,32 +85,32 @@ type execveMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// execveVariableSpecs contains global variables before they are loaded into the kernel. +// ExecveVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type execveVariableSpecs struct { +type ExecveVariableSpecs struct { } -// execveObjects contains all objects after they have been loaded into the kernel. +// ExecveObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. -type execveObjects struct { - execvePrograms - execveMaps - execveVariables +// It can be passed to LoadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type ExecveObjects struct { + ExecvePrograms + ExecveMaps + ExecveVariables } -func (o *execveObjects) Close() error { +func (o *ExecveObjects) Close() error { return _ExecveClose( - &o.execvePrograms, - &o.execveMaps, + &o.ExecvePrograms, + &o.ExecveMaps, ) } -// execveMaps contains all maps after they have been loaded into the kernel. +// ExecveMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. -type execveMaps struct { +// It can be passed to LoadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type ExecveMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -118,7 +118,7 @@ type execveMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *execveMaps) Close() error { +func (m *ExecveMaps) Close() error { return _ExecveClose( m.DropCount, m.Enabled, @@ -128,23 +128,23 @@ func (m *execveMaps) Close() error { ) } -// execveVariables contains all global variables after they have been loaded into the kernel. +// ExecveVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. -type execveVariables struct { +// It can be passed to LoadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type ExecveVariables struct { } -// execvePrograms contains all programs after they have been loaded into the kernel. +// ExecvePrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. -type execvePrograms struct { +// It can be passed to LoadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type ExecvePrograms struct { HandleSysEnterExecve *ebpf.Program `ebpf:"handle_sys_enter_execve"` HandleSysEnterExecveat *ebpf.Program `ebpf:"handle_sys_enter_execveat"` HandleSysExitExecve *ebpf.Program `ebpf:"handle_sys_exit_execve"` HandleSysExitExecveat *ebpf.Program `ebpf:"handle_sys_exit_execveat"` } -func (p *execvePrograms) Close() error { +func (p *ExecvePrograms) Close() error { return _ExecveClose( p.HandleSysEnterExecve, p.HandleSysEnterExecveat, diff --git a/internal/ebpf/bpf/execve_bpfeb.o b/internal/ebpf/bpf/execve_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..7b84f35fac0071792d9c67dbaaa0c20a570688ea GIT binary patch literal 21424 zcmeI2Yiy*~S;x=J_%hzzByMgUNw6i0w)f2A@p#N^9x?N;2uC6|QxJG&-BOm< zTTE=?71Jp+@gdFmW> zmO4Y7rcO~OsSRp{TB7Eu1Jr(MA2mzup=PLQYCugMC`Gx=dZ7 zE>ah$^VB)&EOmxDO`W1nQXA9?wM5NR2dMqjK5CZQL(Ndr)PS0zc2bj65p%ih=H+b_ zvrqWy?Q+F@w7E^@N+1+7SML`!hV!v{#ihq?vuhz{$focs#@c`Ob1r|eV2;Km8?^ik6&?U-lSrE+4f9)&aJbEops6L{VaaJ)X7+MrgbC2F2JK<%gYQM1$@YKEGo z2GkU_lbWQ8$a>qLu2a{jtJD?hGIfc%NL`@LQ|G9&)EVkDb&5JkZBQ%J5;ad9p!QSy zs99Ze-P%X}Es~>{H@AwuDi>pdV%}JP)xKA9>(X?x9%1 z?~6Abv-O#)A9E`EC+_DPtS8BOUYYoqTgR6RreAWhp3Wb;o|CSg+cK_wtf%Dz{Alrh z6zB)~+4dyM2RFTP{dRaieLWMe(T|F`Inth_&-b73$BqyEIq(7gw0Jw-pGdphxHdmu z?Y2+Lee6r(|3s(j&%!}BAD<6!^TUCDvh#By5W+exm>#R=O-2;uY(FACOSbmGcKuA; z?(T!Qf7ts8@&}R+>301TI-SB!UgD8%>qUBl?CcfHBsnXJ^eM8n1D+=LGku0UK%OP% z$#diqd7fM$FOVDLMe-zhi9AJKCQp-B$TQ?s@+^6cJV#z9&yzRE3y$q@NdGL7lT2SC zcaoRMDe?+AAg_|sRZ;-Q&ogbGAu|9H=>HXwR@&GwS&XWUjiJT@^9P_?f zaQEqnPCm~U;>;gseepc=(_Wn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L%3M8ceZ5)+gE z@&ADGi9GT|4_RkC?EiWD?-*Gh>-6CPasb8Wj?H%Z^74H01Dw0qPs}0>hkO@lI(&JF z{70O-*>A8^9xC?zcOG9}>`R_q?BBSAG#rUMF44o6mpIuIcC)|2LIG6l+XpnLFE92V z#JP+8o6|_caozU!Aj59ts&HYniW50llZ&y}gwvOxo!+EH*-?zit zm;R4@{{l4~nPrDJ+|d->WZ#bIZuS>kxdV$(v5(&o?Gd&At+8uoY`;x1aZ8?VFf8A^ bqDQ2^V$UK$?pZq=53&F3{vl=b{7?M{X?ge& literal 0 HcmV?d00001 diff --git a/internal/ebpf/execve_bpfel.go b/internal/ebpf/bpf/execve_bpfel.go similarity index 62% rename from internal/ebpf/execve_bpfel.go rename to internal/ebpf/bpf/execve_bpfel.go index 5f4f6e613..1b73d6db5 100644 --- a/internal/ebpf/execve_bpfel.go +++ b/internal/ebpf/bpf/execve_bpfel.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type execveScratchValue struct { +type ExecveScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type execveScratchValue struct { Aux [256]uint8 } -// loadExecve returns the embedded CollectionSpec for execve. -func loadExecve() (*ebpf.CollectionSpec, error) { +// LoadExecve returns the embedded CollectionSpec for Execve. +func LoadExecve() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_ExecveBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load execve: %w", err) + return nil, fmt.Errorf("can't load Execve: %w", err) } return spec, err } -// loadExecveObjects loads execve and converts it into a struct. +// LoadExecveObjects loads Execve and converts it into a struct. // // The following types are suitable as obj argument: // -// *execveObjects -// *execvePrograms -// *execveMaps +// *ExecveObjects +// *ExecvePrograms +// *ExecveMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadExecveObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadExecve() +func LoadExecveObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadExecve() if err != nil { return err } @@ -55,29 +55,29 @@ func loadExecveObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// execveSpecs contains maps and programs before they are loaded into the kernel. +// ExecveSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type execveSpecs struct { - execveProgramSpecs - execveMapSpecs - execveVariableSpecs +type ExecveSpecs struct { + ExecveProgramSpecs + ExecveMapSpecs + ExecveVariableSpecs } -// execveProgramSpecs contains programs before they are loaded into the kernel. +// ExecveProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type execveProgramSpecs struct { +type ExecveProgramSpecs struct { HandleSysEnterExecve *ebpf.ProgramSpec `ebpf:"handle_sys_enter_execve"` HandleSysEnterExecveat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_execveat"` HandleSysExitExecve *ebpf.ProgramSpec `ebpf:"handle_sys_exit_execve"` HandleSysExitExecveat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_execveat"` } -// execveMapSpecs contains maps before they are loaded into the kernel. +// ExecveMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type execveMapSpecs struct { +type ExecveMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -85,32 +85,32 @@ type execveMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// execveVariableSpecs contains global variables before they are loaded into the kernel. +// ExecveVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type execveVariableSpecs struct { +type ExecveVariableSpecs struct { } -// execveObjects contains all objects after they have been loaded into the kernel. +// ExecveObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. -type execveObjects struct { - execvePrograms - execveMaps - execveVariables +// It can be passed to LoadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type ExecveObjects struct { + ExecvePrograms + ExecveMaps + ExecveVariables } -func (o *execveObjects) Close() error { +func (o *ExecveObjects) Close() error { return _ExecveClose( - &o.execvePrograms, - &o.execveMaps, + &o.ExecvePrograms, + &o.ExecveMaps, ) } -// execveMaps contains all maps after they have been loaded into the kernel. +// ExecveMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. -type execveMaps struct { +// It can be passed to LoadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type ExecveMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -118,7 +118,7 @@ type execveMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *execveMaps) Close() error { +func (m *ExecveMaps) Close() error { return _ExecveClose( m.DropCount, m.Enabled, @@ -128,23 +128,23 @@ func (m *execveMaps) Close() error { ) } -// execveVariables contains all global variables after they have been loaded into the kernel. +// ExecveVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. -type execveVariables struct { +// It can be passed to LoadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type ExecveVariables struct { } -// execvePrograms contains all programs after they have been loaded into the kernel. +// ExecvePrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. -type execvePrograms struct { +// It can be passed to LoadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. +type ExecvePrograms struct { HandleSysEnterExecve *ebpf.Program `ebpf:"handle_sys_enter_execve"` HandleSysEnterExecveat *ebpf.Program `ebpf:"handle_sys_enter_execveat"` HandleSysExitExecve *ebpf.Program `ebpf:"handle_sys_exit_execve"` HandleSysExitExecveat *ebpf.Program `ebpf:"handle_sys_exit_execveat"` } -func (p *execvePrograms) Close() error { +func (p *ExecvePrograms) Close() error { return _ExecveClose( p.HandleSysEnterExecve, p.HandleSysEnterExecveat, diff --git a/internal/ebpf/bpf/execve_bpfel.o b/internal/ebpf/bpf/execve_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..265b9cc7e0ed8d62fa0618928c7017cd4d74a1d3 GIT binary patch literal 21232 zcmeI3YiyiXTF1|fQ)ir}iJK-m#{F~V#A8JhcsVzNY)r`3X zDeJd(TdLodu<|V@OyL*b|3CsRzhQ&T?zl1UfAGNvJ*x0uK(qv1?sVy%>vRcjFh6Sp zE_4|aKzoU@F`Yt5#x$k_${xyY$^@mM+^_{Urq?OgC|4<0D6dd1Q!Y`qC>JRgDCa4g zl(UpGlv9*7$`WOfa)@$}a)2^RnW5~bOjD*P1IixCZps9uq1=$}LVvAOu2HU1u25c~ zT&7&2Y*8*!E>O->HYsN*XDFvAYm_C*BIOX}AmspMmNG-xPno7nQ3jMfl--mGN-Iob z&heq$du+hvybIrr-jNdDl34=%a>a$qd@M^i!tiGf$uItd#pR2x{-<5FrZDYT^6i6f z?Af?#-fwI(?=KgmG?cr`Ny#s!yyeimN?E_v*XrP`l;`ZP zF*mqnV!q7wJr{EeF}iNox3OQ!>43k%JZW>jh4m@U%|@rouk>#X{w+xiC;5IJervtE zaVh-zN3;Ksd9SVg-*epqd)91tW3D9KiSaK|4p9zL4p3$(GnD<5X-e)la{-zA%^dfe zIqo-et|J?B8@4|hbL*6Al&h30lvgO1DVHc)l#7%Ll=GBL%2~=8$|=ekWr?y#IYc=~ zIY61E%ux1IrYTdD0c8(mH)Vp-P;N-KqukX1wkQ`V7bxc`o0PMZ zGn7-5HOdlYk#dM~kaB=BOPQhUr%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4Ln9bWAf*gz-eRTMVr-mhk+o>vrd@d+f1K~N{GY@JJzPG8D@G@S5 z{sT78NnLoJ+ef-c3Y_l>`l5FMzjPmkZpKT1@#HT+TgPlH`3CgPf|zfDh zaGnQtqVGe{E%*auT=^7u=W_{}(f9@M*5^gavGQ#wpV#v5vplrtPPX?O^0NuKsPXTT zzmhQL7?%Hy{K14=)$(=l4*bQju6!5Xs;wh%Vw{XmfhWci!moMqC&|wz`{w8qyS)5T~yc7J2@^^tfI25nNcsux2<^N>)vdFaG8RZ`UTd!a}l^?*_;*PiRA6SfcfG;W^WBD4^H^w`_mz0-K zo_HVmRUYlnZcLGTmuD*4JO_RVPT2t^@5lO4xHja!2U55e@p$Gw9?x9I%b8p9J23`I z8<6~n^0dR5Tb7^Ja^^DL9&<q_hlvBoEVz3I2BJz7N{p60tyiKGgJle0X{SMX6= zKYc}CjVXMuh1m&7RTpLr>iFu1HhZ)E57(DbS5wl|%8>qJrmX8GdC{$4~73tW#UfQ8~g(klC~h7K+ZF&->v>10@=TtgAE-h z|F?(>W8?B&kek(S)AztqJQ#M=f8_q1){l6E{11h4j(^z3#LeI9D7)GGllrI4xYp(T z`TmOfkLJ(j-8r#JhJRv0-ggq?_RltN*8dspe_89Zf5y4}FTi)($c++U5n7j|?mxC4 b7k8|$qEH`E@i6gp{p0U@#zp<}Oh@@I(o?M< literal 0 HcmV?d00001 diff --git a/internal/ebpf/file_bpfeb.go b/internal/ebpf/bpf/file_bpfeb.go similarity index 74% rename from internal/ebpf/file_bpfeb.go rename to internal/ebpf/bpf/file_bpfeb.go index edf459214..aa41f2094 100644 --- a/internal/ebpf/file_bpfeb.go +++ b/internal/ebpf/bpf/file_bpfeb.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (mips || mips64 || ppc64 || s390x) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type fileScratchValue struct { +type FileScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type fileScratchValue struct { Aux [256]uint8 } -// loadFile returns the embedded CollectionSpec for file. -func loadFile() (*ebpf.CollectionSpec, error) { +// LoadFile returns the embedded CollectionSpec for File. +func LoadFile() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_FileBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load file: %w", err) + return nil, fmt.Errorf("can't load File: %w", err) } return spec, err } -// loadFileObjects loads file and converts it into a struct. +// LoadFileObjects loads File and converts it into a struct. // // The following types are suitable as obj argument: // -// *fileObjects -// *filePrograms -// *fileMaps +// *FileObjects +// *FilePrograms +// *FileMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadFileObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadFile() +func LoadFileObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadFile() if err != nil { return err } @@ -55,19 +55,19 @@ func loadFileObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// fileSpecs contains maps and programs before they are loaded into the kernel. +// FileSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type fileSpecs struct { - fileProgramSpecs - fileMapSpecs - fileVariableSpecs +type FileSpecs struct { + FileProgramSpecs + FileMapSpecs + FileVariableSpecs } -// fileProgramSpecs contains programs before they are loaded into the kernel. +// FileProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type fileProgramSpecs struct { +type FileProgramSpecs struct { HandleSysEnterOpen *ebpf.ProgramSpec `ebpf:"handle_sys_enter_open"` HandleSysEnterOpenat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_openat"` HandleSysEnterOpenat2 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_openat2"` @@ -86,10 +86,10 @@ type fileProgramSpecs struct { HandleSysExitUnlinkat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_unlinkat"` } -// fileMapSpecs contains maps before they are loaded into the kernel. +// FileMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type fileMapSpecs struct { +type FileMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -97,32 +97,32 @@ type fileMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// fileVariableSpecs contains global variables before they are loaded into the kernel. +// FileVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type fileVariableSpecs struct { +type FileVariableSpecs struct { } -// fileObjects contains all objects after they have been loaded into the kernel. +// FileObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. -type fileObjects struct { - filePrograms - fileMaps - fileVariables +// It can be passed to LoadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type FileObjects struct { + FilePrograms + FileMaps + FileVariables } -func (o *fileObjects) Close() error { +func (o *FileObjects) Close() error { return _FileClose( - &o.filePrograms, - &o.fileMaps, + &o.FilePrograms, + &o.FileMaps, ) } -// fileMaps contains all maps after they have been loaded into the kernel. +// FileMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. -type fileMaps struct { +// It can be passed to LoadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type FileMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -130,7 +130,7 @@ type fileMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *fileMaps) Close() error { +func (m *FileMaps) Close() error { return _FileClose( m.DropCount, m.Enabled, @@ -140,16 +140,16 @@ func (m *fileMaps) Close() error { ) } -// fileVariables contains all global variables after they have been loaded into the kernel. +// FileVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. -type fileVariables struct { +// It can be passed to LoadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type FileVariables struct { } -// filePrograms contains all programs after they have been loaded into the kernel. +// FilePrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. -type filePrograms struct { +// It can be passed to LoadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type FilePrograms struct { HandleSysEnterOpen *ebpf.Program `ebpf:"handle_sys_enter_open"` HandleSysEnterOpenat *ebpf.Program `ebpf:"handle_sys_enter_openat"` HandleSysEnterOpenat2 *ebpf.Program `ebpf:"handle_sys_enter_openat2"` @@ -168,7 +168,7 @@ type filePrograms struct { HandleSysExitUnlinkat *ebpf.Program `ebpf:"handle_sys_exit_unlinkat"` } -func (p *filePrograms) Close() error { +func (p *FilePrograms) Close() error { return _FileClose( p.HandleSysEnterOpen, p.HandleSysEnterOpenat, diff --git a/internal/ebpf/bpf/file_bpfeb.o b/internal/ebpf/bpf/file_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..6cba12704f041b853fc6a662db0fbeee251993e1 GIT binary patch literal 72800 zcmeI54UA*gb>A<^*N#X=7Y!rjkNC+fo z2T6bsr~&nyd;gd7-hYNG$x^mO%ZDM)``vTD?|t{Y`|jnNpL_h=hvM;=nH(|m4{{!I zm}tcHrfo}ke80!Unq?CxHNRxiRz7D^DqpbQW^VDqb`@L z@eE`DY0D$-HU}b;a91JzW42r(ZGJ?K;JybrgxrN3K=vVfkUNlF$Zg0DCz1KEY# zhU`FYLAD`VkPXN>WEHXmS%jR2EI{TVbC6lc3}gVAhD=#mLqC6;>wlNaCaLb)&!s;< zFKmxn>gHNKdGW1|PuS2V`$C``GcP{q+|l3Hah=3&vHd>guNzbTg0cDe#Lqkbi&e)6 zcf;lFSJ&@fe87c&Asi>l;{WgaEx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o7bl;r*HsbYmNap5B$hR`|2 zeRYZbrG7y-CA_|0BXX#%!V&umInli!dgSf*_3S6l=SWI zBt@<7e~27Dyg0`Gy?jkee;%PqA~k*8ldgvkuko(SXG;1vqTcO$J2ad>e0b$m`AkcH z2LZAoHGOSsJ$!gg{~`HIN&n6J>iNp$H~Mb)Y3c82XgNyq(e%B)Q2L3V756FWze7}d z=zB;ahYv4~34KqLk2fFjW&XsohS&6UO;`^fJ|*EF6P}X(?MU}Z?Vrd?_-X0aMW;te zKAOI+0q7A*KYm_#O8R%_)wATW>*VCyhZl$VynIbde-|ON9Gbp9Gtk3_Pf2*aSDBK2 zc4U2DvH!=lk4{PdPhIeX^85F~gwi*f#+3Bmr}G3k5`8NUzI=Ff(R;IL>6g@l9KQVe z&I3Jscqza6hJ2=^|6@J%{0jZQD;}n$zh#3Tl;6MSCX{|$$FC{re{|r&hlWe%;KK{W z|C@YGOMl;apOoLfPsfLs^2fg}ex{`V1k%4!|BruldiviEkbX&|_CNpLo>2NR)lEtN zQ$x|oF&9{I@a4mcOYGC~HKqLDZXrlkq^9rR59Gs3`D1sA`;_!QgZ_7=^2Y)RKP~+o z(dki=kEZY6LljD1{|D)`^lR{^?xEq#Qal>astU-#3+&UE`nNV|O8UR5W3wDN z?c?Dil)km;Q_}x)gn6(oCz}4d;Sfqc-dub6oUOMOloJuVUc>33@0JN4q5LM)ro_X_ SgY!RXxN~d2Gz^db>HiHkxuCKD literal 0 HcmV?d00001 diff --git a/internal/ebpf/file_bpfel.go b/internal/ebpf/bpf/file_bpfel.go similarity index 74% rename from internal/ebpf/file_bpfel.go rename to internal/ebpf/bpf/file_bpfel.go index 1b89ee110..1d702b970 100644 --- a/internal/ebpf/file_bpfel.go +++ b/internal/ebpf/bpf/file_bpfel.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type fileScratchValue struct { +type FileScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type fileScratchValue struct { Aux [256]uint8 } -// loadFile returns the embedded CollectionSpec for file. -func loadFile() (*ebpf.CollectionSpec, error) { +// LoadFile returns the embedded CollectionSpec for File. +func LoadFile() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_FileBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load file: %w", err) + return nil, fmt.Errorf("can't load File: %w", err) } return spec, err } -// loadFileObjects loads file and converts it into a struct. +// LoadFileObjects loads File and converts it into a struct. // // The following types are suitable as obj argument: // -// *fileObjects -// *filePrograms -// *fileMaps +// *FileObjects +// *FilePrograms +// *FileMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadFileObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadFile() +func LoadFileObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadFile() if err != nil { return err } @@ -55,19 +55,19 @@ func loadFileObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// fileSpecs contains maps and programs before they are loaded into the kernel. +// FileSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type fileSpecs struct { - fileProgramSpecs - fileMapSpecs - fileVariableSpecs +type FileSpecs struct { + FileProgramSpecs + FileMapSpecs + FileVariableSpecs } -// fileProgramSpecs contains programs before they are loaded into the kernel. +// FileProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type fileProgramSpecs struct { +type FileProgramSpecs struct { HandleSysEnterOpen *ebpf.ProgramSpec `ebpf:"handle_sys_enter_open"` HandleSysEnterOpenat *ebpf.ProgramSpec `ebpf:"handle_sys_enter_openat"` HandleSysEnterOpenat2 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_openat2"` @@ -86,10 +86,10 @@ type fileProgramSpecs struct { HandleSysExitUnlinkat *ebpf.ProgramSpec `ebpf:"handle_sys_exit_unlinkat"` } -// fileMapSpecs contains maps before they are loaded into the kernel. +// FileMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type fileMapSpecs struct { +type FileMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -97,32 +97,32 @@ type fileMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// fileVariableSpecs contains global variables before they are loaded into the kernel. +// FileVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type fileVariableSpecs struct { +type FileVariableSpecs struct { } -// fileObjects contains all objects after they have been loaded into the kernel. +// FileObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. -type fileObjects struct { - filePrograms - fileMaps - fileVariables +// It can be passed to LoadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type FileObjects struct { + FilePrograms + FileMaps + FileVariables } -func (o *fileObjects) Close() error { +func (o *FileObjects) Close() error { return _FileClose( - &o.filePrograms, - &o.fileMaps, + &o.FilePrograms, + &o.FileMaps, ) } -// fileMaps contains all maps after they have been loaded into the kernel. +// FileMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. -type fileMaps struct { +// It can be passed to LoadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type FileMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -130,7 +130,7 @@ type fileMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *fileMaps) Close() error { +func (m *FileMaps) Close() error { return _FileClose( m.DropCount, m.Enabled, @@ -140,16 +140,16 @@ func (m *fileMaps) Close() error { ) } -// fileVariables contains all global variables after they have been loaded into the kernel. +// FileVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. -type fileVariables struct { +// It can be passed to LoadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type FileVariables struct { } -// filePrograms contains all programs after they have been loaded into the kernel. +// FilePrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadFileObjects or ebpf.CollectionSpec.LoadAndAssign. -type filePrograms struct { +// It can be passed to LoadFileObjects or ebpf.CollectionSpec.LoadAndAssign. +type FilePrograms struct { HandleSysEnterOpen *ebpf.Program `ebpf:"handle_sys_enter_open"` HandleSysEnterOpenat *ebpf.Program `ebpf:"handle_sys_enter_openat"` HandleSysEnterOpenat2 *ebpf.Program `ebpf:"handle_sys_enter_openat2"` @@ -168,7 +168,7 @@ type filePrograms struct { HandleSysExitUnlinkat *ebpf.Program `ebpf:"handle_sys_exit_unlinkat"` } -func (p *filePrograms) Close() error { +func (p *FilePrograms) Close() error { return _FileClose( p.HandleSysEnterOpen, p.HandleSysEnterOpenat, diff --git a/internal/ebpf/bpf/file_bpfel.o b/internal/ebpf/bpf/file_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..86647ff9b619cec423ff886acb6ecca40b47e3a1 GIT binary patch literal 72032 zcmeI54U8M-ncru3Wr$0Sac>s?w@ zyxL`US2Ag)34u%Zh#+^_7Ve4-T$E0VJ2rI-whdxlk*kR!IS^MD-MdQ^j zl+5$Wt3EUeorFf99<*-~D6eiod(cg27rFuMK-(Cl>4O)d(phai_nulhg z8E6`sf+nE}XdD`Y`p_tJ5*mSe&_3F23)+KjLc7onXb0McwxCUD16qgHpli@7v;r+c z3(!0?3(Y{&&=fQYO+e$&7}SSGp_5kEt$XQ3JO0X35#z4o`~?}$O-T@NoWM> zLHp7havrR2L3_|mXcxKx?Lgbm7PJX%K_0h)(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1~(Vqx&2rUM%6!y{Db}fRtf9kPa=VrL`UVH_)Qz&QuS|0uu=K1ji~C{@>gw|3_^Om#Y6C?2y0z=Qe)UikW}) z)jd~!mw#3oe^mQNKVc*KWH4NOB+E1^Ea2UtcA2@m>D6?T~-s(>8}o)!*MC z|K^DL>y*a%>;I>Zs(&nR^G{r&{y*Dc{+av>8$VcoeU*mu{|`IlpPjeyFIE3v{7Ev~w)C?WbinyZS~>rcwEx73*A~UABKu$~;QDWB;9?KBtk+5XC5a2R;(xYI&VFgU;QWu*n7#i8 DYO)%5 literal 0 HcmV?d00001 diff --git a/internal/ebpf/mem_bpfeb.go b/internal/ebpf/bpf/mem_bpfeb.go similarity index 66% rename from internal/ebpf/mem_bpfeb.go rename to internal/ebpf/bpf/mem_bpfeb.go index 119afa03b..e5a1a1c02 100644 --- a/internal/ebpf/mem_bpfeb.go +++ b/internal/ebpf/bpf/mem_bpfeb.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (mips || mips64 || ppc64 || s390x) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type memScratchValue struct { +type MemScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type memScratchValue struct { Aux [256]uint8 } -// loadMem returns the embedded CollectionSpec for mem. -func loadMem() (*ebpf.CollectionSpec, error) { +// LoadMem returns the embedded CollectionSpec for Mem. +func LoadMem() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_MemBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load mem: %w", err) + return nil, fmt.Errorf("can't load Mem: %w", err) } return spec, err } -// loadMemObjects loads mem and converts it into a struct. +// LoadMemObjects loads Mem and converts it into a struct. // // The following types are suitable as obj argument: // -// *memObjects -// *memPrograms -// *memMaps +// *MemObjects +// *MemPrograms +// *MemMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadMemObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadMem() +func LoadMemObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadMem() if err != nil { return err } @@ -55,19 +55,19 @@ func loadMemObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// memSpecs contains maps and programs before they are loaded into the kernel. +// MemSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type memSpecs struct { - memProgramSpecs - memMapSpecs - memVariableSpecs +type MemSpecs struct { + MemProgramSpecs + MemMapSpecs + MemVariableSpecs } -// memProgramSpecs contains programs before they are loaded into the kernel. +// MemProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type memProgramSpecs struct { +type MemProgramSpecs struct { HandleSysEnterMmap *ebpf.ProgramSpec `ebpf:"handle_sys_enter_mmap"` HandleSysEnterProcessVmReadv *ebpf.ProgramSpec `ebpf:"handle_sys_enter_process_vm_readv"` HandleSysEnterProcessVmWritev *ebpf.ProgramSpec `ebpf:"handle_sys_enter_process_vm_writev"` @@ -76,10 +76,10 @@ type memProgramSpecs struct { HandleSysExitProcessVmWritev *ebpf.ProgramSpec `ebpf:"handle_sys_exit_process_vm_writev"` } -// memMapSpecs contains maps before they are loaded into the kernel. +// MemMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type memMapSpecs struct { +type MemMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -87,32 +87,32 @@ type memMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// memVariableSpecs contains global variables before they are loaded into the kernel. +// MemVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type memVariableSpecs struct { +type MemVariableSpecs struct { } -// memObjects contains all objects after they have been loaded into the kernel. +// MemObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. -type memObjects struct { - memPrograms - memMaps - memVariables +// It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type MemObjects struct { + MemPrograms + MemMaps + MemVariables } -func (o *memObjects) Close() error { +func (o *MemObjects) Close() error { return _MemClose( - &o.memPrograms, - &o.memMaps, + &o.MemPrograms, + &o.MemMaps, ) } -// memMaps contains all maps after they have been loaded into the kernel. +// MemMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. -type memMaps struct { +// It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type MemMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -120,7 +120,7 @@ type memMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *memMaps) Close() error { +func (m *MemMaps) Close() error { return _MemClose( m.DropCount, m.Enabled, @@ -130,16 +130,16 @@ func (m *memMaps) Close() error { ) } -// memVariables contains all global variables after they have been loaded into the kernel. +// MemVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. -type memVariables struct { +// It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type MemVariables struct { } -// memPrograms contains all programs after they have been loaded into the kernel. +// MemPrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. -type memPrograms struct { +// It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type MemPrograms struct { HandleSysEnterMmap *ebpf.Program `ebpf:"handle_sys_enter_mmap"` HandleSysEnterProcessVmReadv *ebpf.Program `ebpf:"handle_sys_enter_process_vm_readv"` HandleSysEnterProcessVmWritev *ebpf.Program `ebpf:"handle_sys_enter_process_vm_writev"` @@ -148,7 +148,7 @@ type memPrograms struct { HandleSysExitProcessVmWritev *ebpf.Program `ebpf:"handle_sys_exit_process_vm_writev"` } -func (p *memPrograms) Close() error { +func (p *MemPrograms) Close() error { return _MemClose( p.HandleSysEnterMmap, p.HandleSysEnterProcessVmReadv, diff --git a/internal/ebpf/bpf/mem_bpfeb.o b/internal/ebpf/bpf/mem_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..d27b2efd89f46db5344724329e56ec4b8a078c15 GIT binary patch literal 30584 zcmeI4du&_Rea8H zN)8pZD2HY%J7k5nwHpVdomv#Ay0(D+=wPnsW}@f{0?h_(>i_}m0R0hQ1X2tFI;;ZL z!TbKs`CjVsXUTDzwkS4T`0{%`=Xc)EdoC$|;>5`Z!{LzWT_N*RxC0(N3moTKmeTyZ z$%HNztlM0OTirGK#Y-FFx_HR>4|&F1x^!tH;q1;6pTF;1p(mKvfH6h!I>&G~#LcMi zg^GL{Gy0XEJKd)w{`^olN%g1+s?8Dh7+D12L$)5!b#j-wMqQ<@P&?E%wMAW~E>Rb$ zP3i)*L9J73)C#pk%~P|~5o(5-rVdk6)FjoTCa7_0j4Fcqn+@tZwM$*2u2NU19cr7} zqApXHsEgDlb%ENT)~PjWg<7KKsafg>HA78Php8!QlIl?t)HpRp6)|%+8W*240qnwu zj133&B;0(+*!WyZk~f+{L_v?v49>^NUwEo-e-7#k-Jp%6SvM;Lv=II(Lrc z`aM@3hLe2OCCD#eeugC-e||m@H-o}zp095+&m#jS^st1#uppnt=x`T2@eS85*jDVd z(mT|d`*Xlt>Wcq-Ib5NZsCjCZIzr7*(^NM; z%3)h#q~rR#9QJ5;e7FWx=LN4cBpM?i@Ho*qApUK)CFpT zTBp{i6>5o^r)H@m)C@IE9j2zJNvcOpP~+4XRRs0t`cgLQ5o^r)H@m)C@IE9j2zJNvcOpP~+4XRm9)_2Ilj|VzZ?aYW3=GbO~&`GJ$L1L_~rD|nR|idsF?kM z`o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oiiWd|wDqdDB{T(Aj9rdXRXlKGMQPCa-;VDk^%{6GA4zYq`RD+RNEy}E6&tu+|M=D&TMO>^*1 zJpI4qHAlwB@z)^ui@It2<#F%F>i(bh9>HH>%oI+WBh|SHtE`Xlf8&nv@+Pm4eD5Y_ z_${ufmz`%==0WhXFMgdz2>+LWeFrKiV>fuEgAj1boa7by1{{8R+r*demHIAOmw1J~ z3WvOdmn&^Qdmm5A^OjsG-12wkem(v8ab!IQ|84TO-}}I9zZZh`E_gxN0tMHjzUfB$>IK>nfE5XR5nAD@hNxIu>>kJt+@ zQSmnkJ=XD?jIiKGr26>-!}8swpT7!rThe*l@GWHs%-^uI={EI$+K-lpL)sr-mD*iKYrtDuVDWFHg)NwZMQm&n=<9M en>-f;uRwXj5?7vKwzxjpaGs$KRO0CQm-t`3Y<^b& literal 0 HcmV?d00001 diff --git a/internal/ebpf/mem_bpfel.go b/internal/ebpf/bpf/mem_bpfel.go similarity index 67% rename from internal/ebpf/mem_bpfel.go rename to internal/ebpf/bpf/mem_bpfel.go index 708b6d7b9..7a8d011c2 100644 --- a/internal/ebpf/mem_bpfel.go +++ b/internal/ebpf/bpf/mem_bpfel.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type memScratchValue struct { +type MemScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type memScratchValue struct { Aux [256]uint8 } -// loadMem returns the embedded CollectionSpec for mem. -func loadMem() (*ebpf.CollectionSpec, error) { +// LoadMem returns the embedded CollectionSpec for Mem. +func LoadMem() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_MemBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load mem: %w", err) + return nil, fmt.Errorf("can't load Mem: %w", err) } return spec, err } -// loadMemObjects loads mem and converts it into a struct. +// LoadMemObjects loads Mem and converts it into a struct. // // The following types are suitable as obj argument: // -// *memObjects -// *memPrograms -// *memMaps +// *MemObjects +// *MemPrograms +// *MemMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadMemObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadMem() +func LoadMemObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadMem() if err != nil { return err } @@ -55,19 +55,19 @@ func loadMemObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// memSpecs contains maps and programs before they are loaded into the kernel. +// MemSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type memSpecs struct { - memProgramSpecs - memMapSpecs - memVariableSpecs +type MemSpecs struct { + MemProgramSpecs + MemMapSpecs + MemVariableSpecs } -// memProgramSpecs contains programs before they are loaded into the kernel. +// MemProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type memProgramSpecs struct { +type MemProgramSpecs struct { HandleSysEnterMmap *ebpf.ProgramSpec `ebpf:"handle_sys_enter_mmap"` HandleSysEnterProcessVmReadv *ebpf.ProgramSpec `ebpf:"handle_sys_enter_process_vm_readv"` HandleSysEnterProcessVmWritev *ebpf.ProgramSpec `ebpf:"handle_sys_enter_process_vm_writev"` @@ -76,10 +76,10 @@ type memProgramSpecs struct { HandleSysExitProcessVmWritev *ebpf.ProgramSpec `ebpf:"handle_sys_exit_process_vm_writev"` } -// memMapSpecs contains maps before they are loaded into the kernel. +// MemMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type memMapSpecs struct { +type MemMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -87,32 +87,32 @@ type memMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// memVariableSpecs contains global variables before they are loaded into the kernel. +// MemVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type memVariableSpecs struct { +type MemVariableSpecs struct { } -// memObjects contains all objects after they have been loaded into the kernel. +// MemObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. -type memObjects struct { - memPrograms - memMaps - memVariables +// It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type MemObjects struct { + MemPrograms + MemMaps + MemVariables } -func (o *memObjects) Close() error { +func (o *MemObjects) Close() error { return _MemClose( - &o.memPrograms, - &o.memMaps, + &o.MemPrograms, + &o.MemMaps, ) } -// memMaps contains all maps after they have been loaded into the kernel. +// MemMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. -type memMaps struct { +// It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type MemMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -120,7 +120,7 @@ type memMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *memMaps) Close() error { +func (m *MemMaps) Close() error { return _MemClose( m.DropCount, m.Enabled, @@ -130,16 +130,16 @@ func (m *memMaps) Close() error { ) } -// memVariables contains all global variables after they have been loaded into the kernel. +// MemVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. -type memVariables struct { +// It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type MemVariables struct { } -// memPrograms contains all programs after they have been loaded into the kernel. +// MemPrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadMemObjects or ebpf.CollectionSpec.LoadAndAssign. -type memPrograms struct { +// It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. +type MemPrograms struct { HandleSysEnterMmap *ebpf.Program `ebpf:"handle_sys_enter_mmap"` HandleSysEnterProcessVmReadv *ebpf.Program `ebpf:"handle_sys_enter_process_vm_readv"` HandleSysEnterProcessVmWritev *ebpf.Program `ebpf:"handle_sys_enter_process_vm_writev"` @@ -148,7 +148,7 @@ type memPrograms struct { HandleSysExitProcessVmWritev *ebpf.Program `ebpf:"handle_sys_exit_process_vm_writev"` } -func (p *memPrograms) Close() error { +func (p *MemPrograms) Close() error { return _MemClose( p.HandleSysEnterMmap, p.HandleSysEnterProcessVmReadv, diff --git a/internal/ebpf/bpf/mem_bpfel.o b/internal/ebpf/bpf/mem_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..4af65725dfc1fffde6c9433c3381add4a3d3e92c GIT binary patch literal 30296 zcmeI5eQaCTdBzVZN1+|ZRvd>>({#OUvXpimTeg#yOVX4{?37uZR!E$dNt01DMVo5$ z!HSYYhAB#*S;ZDvA#AP24QZ!j1E#Ghpg%T*E4o@Jx`IHn!P`1OKsP{t6qtYxgMb#R zfNsd1_nhZYm#-zqNxEX#bl}V9{Lc6Hx##jy{@lq^4@M&q<4wf;+-#6{HKtkGu&1mw zWo|^s3vuWEDkANKHGk9k>*8|ZW#@i%)R^_xUw^${CHmX&7N^IU+f}AuBYcM8ZiwV9 zzk0P5lYjQDru&3VpjJwtB*xTA0kxmnM~zVpb={VvR$8O3Qdg+U)Qi+Mb&1-dE>ah$ z^VBAFmfE1!sTFF8TBHt9Gt@z9nwp{}sRPsmHK6uW`=~Lhp{}#t)~Ku073wneBDGCj zqPD1u)CKB1wMm_&HmG%Kg<7H(sYBEZb-rl?8k05w4ksQuJFYK&^dRCA2)yul3L z=fYKUfeYW~0#tL%r_Y6}=9pif3wNQ{1~)S9_u#7Sy0YW+>0GC*H-Xue9V z-pF$GyYg)0vu5Yx+n=9yS{Oe+AB(sOh3EO&7W2FZWxUFK#Ez?1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^?juYR&CCuMa{8!_A^0?xM6h96Q z*^86UD88zAR`IIhH$1=RMEVEb|AP;meBXobeZZVqtu|K8ndR#InNM7O_Kd*6KZ~$& z4*bz6e-RT-7W&o4!Rf*g?*6EAU(x=@-cr8<%k~lW748ELOleE^G5AA$_j``;&!hb> z;?0@)`PUZYm!!-11^?(LAO0uuXYf15)yg$V^? z!^+=gsxnl{muFu&e0s_E2F^pu_n!&v_eV+R51(Fm2InE=znoMoP5*i=o(%>WKJJeKF9B5fH+eAdvVGU vDnIg(r8`$_zcp=8__Df75<4C~Lj7g`Kfdw|a=`Jqf%A;?p^`@5f9bygzO}Tr literal 0 HcmV?d00001 diff --git a/internal/ebpf/net_bpfel.go b/internal/ebpf/bpf/net_bpfel.go similarity index 65% rename from internal/ebpf/net_bpfel.go rename to internal/ebpf/bpf/net_bpfel.go index da8e0c87a..95f7f27d6 100644 --- a/internal/ebpf/net_bpfel.go +++ b/internal/ebpf/bpf/net_bpfel.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type netScratchValue struct { +type NetScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type netScratchValue struct { Aux [256]uint8 } -// loadNet returns the embedded CollectionSpec for net. -func loadNet() (*ebpf.CollectionSpec, error) { +// LoadNet returns the embedded CollectionSpec for Net. +func LoadNet() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_NetBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load net: %w", err) + return nil, fmt.Errorf("can't load Net: %w", err) } return spec, err } -// loadNetObjects loads net and converts it into a struct. +// LoadNetObjects loads Net and converts it into a struct. // // The following types are suitable as obj argument: // -// *netObjects -// *netPrograms -// *netMaps +// *NetObjects +// *NetPrograms +// *NetMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadNetObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadNet() +func LoadNetObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadNet() if err != nil { return err } @@ -55,19 +55,19 @@ func loadNetObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// netSpecs contains maps and programs before they are loaded into the kernel. +// NetSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type netSpecs struct { - netProgramSpecs - netMapSpecs - netVariableSpecs +type NetSpecs struct { + NetProgramSpecs + NetMapSpecs + NetVariableSpecs } -// netProgramSpecs contains programs before they are loaded into the kernel. +// NetProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type netProgramSpecs struct { +type NetProgramSpecs struct { HandleSysEnterAccept *ebpf.ProgramSpec `ebpf:"handle_sys_enter_accept"` HandleSysEnterAccept4 *ebpf.ProgramSpec `ebpf:"handle_sys_enter_accept4"` HandleSysEnterConnect *ebpf.ProgramSpec `ebpf:"handle_sys_enter_connect"` @@ -76,10 +76,10 @@ type netProgramSpecs struct { HandleSysExitConnect *ebpf.ProgramSpec `ebpf:"handle_sys_exit_connect"` } -// netMapSpecs contains maps before they are loaded into the kernel. +// NetMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type netMapSpecs struct { +type NetMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -87,32 +87,32 @@ type netMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// netVariableSpecs contains global variables before they are loaded into the kernel. +// NetVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type netVariableSpecs struct { +type NetVariableSpecs struct { } -// netObjects contains all objects after they have been loaded into the kernel. +// NetObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadNetObjects or ebpf.CollectionSpec.LoadAndAssign. -type netObjects struct { - netPrograms - netMaps - netVariables +// It can be passed to LoadNetObjects or ebpf.CollectionSpec.LoadAndAssign. +type NetObjects struct { + NetPrograms + NetMaps + NetVariables } -func (o *netObjects) Close() error { +func (o *NetObjects) Close() error { return _NetClose( - &o.netPrograms, - &o.netMaps, + &o.NetPrograms, + &o.NetMaps, ) } -// netMaps contains all maps after they have been loaded into the kernel. +// NetMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadNetObjects or ebpf.CollectionSpec.LoadAndAssign. -type netMaps struct { +// It can be passed to LoadNetObjects or ebpf.CollectionSpec.LoadAndAssign. +type NetMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -120,7 +120,7 @@ type netMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *netMaps) Close() error { +func (m *NetMaps) Close() error { return _NetClose( m.DropCount, m.Enabled, @@ -130,16 +130,16 @@ func (m *netMaps) Close() error { ) } -// netVariables contains all global variables after they have been loaded into the kernel. +// NetVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadNetObjects or ebpf.CollectionSpec.LoadAndAssign. -type netVariables struct { +// It can be passed to LoadNetObjects or ebpf.CollectionSpec.LoadAndAssign. +type NetVariables struct { } -// netPrograms contains all programs after they have been loaded into the kernel. +// NetPrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadNetObjects or ebpf.CollectionSpec.LoadAndAssign. -type netPrograms struct { +// It can be passed to LoadNetObjects or ebpf.CollectionSpec.LoadAndAssign. +type NetPrograms struct { HandleSysEnterAccept *ebpf.Program `ebpf:"handle_sys_enter_accept"` HandleSysEnterAccept4 *ebpf.Program `ebpf:"handle_sys_enter_accept4"` HandleSysEnterConnect *ebpf.Program `ebpf:"handle_sys_enter_connect"` @@ -148,7 +148,7 @@ type netPrograms struct { HandleSysExitConnect *ebpf.Program `ebpf:"handle_sys_exit_connect"` } -func (p *netPrograms) Close() error { +func (p *NetPrograms) Close() error { return _NetClose( p.HandleSysEnterAccept, p.HandleSysEnterAccept4, diff --git a/internal/ebpf/bpf/net_bpfel.o b/internal/ebpf/bpf/net_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..e7502ebb54105f32af102fdc39e36d755b9273d4 GIT binary patch literal 31608 zcmeI5eT<_=eaFY%&BeDIm(7uL7D&pI60W{*xpVFgFafR(mkUk_VVm5w1_HLv>pL&m z7qc(H#zD1O8d-?87HY3%)5K6|SRe+D<*2ygLKgBK*^+0VG}8>7YyUU=b!36<$@B3gnjv9ue^2ki|XV!ES| zvgK!DR!s5ZFD>6^54ig-9dH@mU_M|2>Q5z5BV+1M1=I=ZI5kE!)Pc>Q{?rzAle$6e zQ`f0I>Ke66U8Q!YE7Uf%MQu_W)GD+NG{iJJc0wo7$o_sSRqCTA`Myd1{tANzG8x)D$&IO;7{s1a+Jm zqgpYw4>3GWUI<+LF_*5k=pJV&j z82=n!ins?cydG@ru^vc|++f~;UO>GMx(d75>HIbv*;jEra%IX>(?r_VfAZeYMz>o5u5taj z#`Wi#oj#_1ZD9MOer=1oN!_6Ksq54pb&cAku2MVH6>6K>qBf}wYL!}{mZ^DamO4qz zP}9^DHAziS1L_2IoEoDV>cEaC+E3l2ZczKwb!v~gM(t8psU7MHwM}hNo74uiO07`K z)I2pyoup={X=;j^q$a2Vb%HuhjZv-G`F#Vt^#d&DslY}QpSaEH@OkC>oAHkN6l~BbTt9EdR#^q;}voJTaTy6uD|N>G})C?k7pbg z5>_uoP#|0_5{Mu_7hZ@sEynXUycTig)Z8i2BCnDMCGS~Nbp6u#TkC(}=9`$&|vz;hltC%ljXLoB6+RJ#J@wA(9XNNIAnSPS-w4?D1 zd0@*yd&pa4XQ$C0UA?(0c4(_6=_%6b}u z??*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1Tc`&uNn3@_0x) z{r%iNm_I|@!tyIjDD9VY{(j&8Uqa!# zm7kD*s0OaACa1sO#TxTP+`L=)aX4N=UvEIxiRE)`7)<>D}Ve0?xr=`QOQQOOuGEn uq41H1UYJKz1J}^4bN%CMg<-g^tNhzVvj5O-!u@Z+OpiB+grC0&-td2z!?gwg literal 0 HcmV?d00001 diff --git a/internal/ebpf/prociter_bpfeb.go b/internal/ebpf/bpf/prociter_bpfeb.go similarity index 55% rename from internal/ebpf/prociter_bpfeb.go rename to internal/ebpf/bpf/prociter_bpfeb.go index b2a6fe6ef..1f27cf6de 100644 --- a/internal/ebpf/prociter_bpfeb.go +++ b/internal/ebpf/bpf/prociter_bpfeb.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (mips || mips64 || ppc64 || s390x) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type prociterScratchValue struct { +type ProciterScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type prociterScratchValue struct { Aux [256]uint8 } -// loadProciter returns the embedded CollectionSpec for prociter. -func loadProciter() (*ebpf.CollectionSpec, error) { +// LoadProciter returns the embedded CollectionSpec for Prociter. +func LoadProciter() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_ProciterBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load prociter: %w", err) + return nil, fmt.Errorf("can't load Prociter: %w", err) } return spec, err } -// loadProciterObjects loads prociter and converts it into a struct. +// LoadProciterObjects loads Prociter and converts it into a struct. // // The following types are suitable as obj argument: // -// *prociterObjects -// *prociterPrograms -// *prociterMaps +// *ProciterObjects +// *ProciterPrograms +// *ProciterMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadProciterObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadProciter() +func LoadProciterObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadProciter() if err != nil { return err } @@ -55,26 +55,26 @@ func loadProciterObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// prociterSpecs contains maps and programs before they are loaded into the kernel. +// ProciterSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type prociterSpecs struct { - prociterProgramSpecs - prociterMapSpecs - prociterVariableSpecs +type ProciterSpecs struct { + ProciterProgramSpecs + ProciterMapSpecs + ProciterVariableSpecs } -// prociterProgramSpecs contains programs before they are loaded into the kernel. +// ProciterProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type prociterProgramSpecs struct { +type ProciterProgramSpecs struct { DumpTask *ebpf.ProgramSpec `ebpf:"dump_task"` } -// prociterMapSpecs contains maps before they are loaded into the kernel. +// ProciterMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type prociterMapSpecs struct { +type ProciterMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -82,32 +82,32 @@ type prociterMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// prociterVariableSpecs contains global variables before they are loaded into the kernel. +// ProciterVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type prociterVariableSpecs struct { +type ProciterVariableSpecs struct { } -// prociterObjects contains all objects after they have been loaded into the kernel. +// ProciterObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. -type prociterObjects struct { - prociterPrograms - prociterMaps - prociterVariables +// It can be passed to LoadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type ProciterObjects struct { + ProciterPrograms + ProciterMaps + ProciterVariables } -func (o *prociterObjects) Close() error { +func (o *ProciterObjects) Close() error { return _ProciterClose( - &o.prociterPrograms, - &o.prociterMaps, + &o.ProciterPrograms, + &o.ProciterMaps, ) } -// prociterMaps contains all maps after they have been loaded into the kernel. +// ProciterMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. -type prociterMaps struct { +// It can be passed to LoadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type ProciterMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -115,7 +115,7 @@ type prociterMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *prociterMaps) Close() error { +func (m *ProciterMaps) Close() error { return _ProciterClose( m.DropCount, m.Enabled, @@ -125,20 +125,20 @@ func (m *prociterMaps) Close() error { ) } -// prociterVariables contains all global variables after they have been loaded into the kernel. +// ProciterVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. -type prociterVariables struct { +// It can be passed to LoadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type ProciterVariables struct { } -// prociterPrograms contains all programs after they have been loaded into the kernel. +// ProciterPrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. -type prociterPrograms struct { +// It can be passed to LoadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type ProciterPrograms struct { DumpTask *ebpf.Program `ebpf:"dump_task"` } -func (p *prociterPrograms) Close() error { +func (p *ProciterPrograms) Close() error { return _ProciterClose( p.DumpTask, ) diff --git a/internal/ebpf/bpf/prociter_bpfeb.o b/internal/ebpf/bpf/prociter_bpfeb.o new file mode 100644 index 0000000000000000000000000000000000000000..f90905f1502262522de0109e4724409c66afdee3 GIT binary patch literal 7000 zcmd5=YiwLc6+ZiL8`GwBUnD$xUD{w5XT3@KaFaILv~}yEP)uSVMMZb7*Vp#qeX)Bt z*iE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Z+&&r)?XWH*L8tmu+?*Y{GaeoZio-7WcsMvF{n#i0 zmLFXdQDIhIyQ@ctwAoxhz;P|E5AE348zaFEv{~=Tv>KNFFzhTfD&cI*Z4)(S!f0k@ z$W)F5yXYN;)7@$czs=SQa)YlQ3}msspZM`yD@TR0adFbz33O`lDi zX~%Th+=6PtH>&Z{?P6D>oy1gPY75Z9gm1oBZ2?vo?6bIcH+LzsK9L@nP zHXJ~#Lw|Z#cDmE`s$Fs9;2Ami*hAxwA0C$i_E|@2)k@sx#2c@_dGT==>K!`JgOT?? zNEY`hbD!dO2}gN`cN2G}?t+eQi?IztN6Fj)d03>zBc1-__?EPI@1QUF??s+wJ??&n zzm88Oj%uFkhOdb{$Io36V`m|^N%kb$mz7UR_672J<)LKnC+{h*OLl_oPb&X`WDm0b zwDO-xb_)H?H@B)B^IK*63(9*Uf55utE~Yr=drA3^L@uy?EyY>? zrgH3!zhJ)k0p*zQ8<^Aj-r#QomYt{{v?}WacdyLvly6tA^|`X;xmh4eu7wBubNZ7s zchcj?m8pLfh{D{M{#}2_1$mzLSQN(2yHx%uLrtuP^N#keC5OgWaJY{fWV1aVfZvLR zL#{U!#(s0kPRdPKyJn8zL z$4_|tl*gAnzT)v!k6-lo+GcLjmYPpyz^e~DUi5g$l&UfAKNR|G9h#J$UDu>vP+)s_`sN7xO}>fx6@V zIao?JO6l&sr|D71e`#;d*;I3L_Bj3!6#jN+DVgW`RUrFte(CX_XkI>O^47D?spqyu fC2roXE0}Qgz-1*v9#}@wfj6Vc0Ec literal 0 HcmV?d00001 diff --git a/internal/ebpf/prociter_bpfel.go b/internal/ebpf/bpf/prociter_bpfel.go similarity index 56% rename from internal/ebpf/prociter_bpfel.go rename to internal/ebpf/bpf/prociter_bpfel.go index 060cb3e58..7fc5ac494 100644 --- a/internal/ebpf/prociter_bpfel.go +++ b/internal/ebpf/bpf/prociter_bpfel.go @@ -1,7 +1,7 @@ // Code generated by bpf2go; DO NOT EDIT. //go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux -package ebpf +package bpf import ( "bytes" @@ -13,7 +13,7 @@ import ( "github.com/cilium/ebpf" ) -type prociterScratchValue struct { +type ProciterScratchValue struct { _ structs.HostLayout Arg0 uint64 Arg1 uint64 @@ -26,28 +26,28 @@ type prociterScratchValue struct { Aux [256]uint8 } -// loadProciter returns the embedded CollectionSpec for prociter. -func loadProciter() (*ebpf.CollectionSpec, error) { +// LoadProciter returns the embedded CollectionSpec for Prociter. +func LoadProciter() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_ProciterBytes) spec, err := ebpf.LoadCollectionSpecFromReader(reader) if err != nil { - return nil, fmt.Errorf("can't load prociter: %w", err) + return nil, fmt.Errorf("can't load Prociter: %w", err) } return spec, err } -// loadProciterObjects loads prociter and converts it into a struct. +// LoadProciterObjects loads Prociter and converts it into a struct. // // The following types are suitable as obj argument: // -// *prociterObjects -// *prociterPrograms -// *prociterMaps +// *ProciterObjects +// *ProciterPrograms +// *ProciterMaps // // See ebpf.CollectionSpec.LoadAndAssign documentation for details. -func loadProciterObjects(obj interface{}, opts *ebpf.CollectionOptions) error { - spec, err := loadProciter() +func LoadProciterObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadProciter() if err != nil { return err } @@ -55,26 +55,26 @@ func loadProciterObjects(obj interface{}, opts *ebpf.CollectionOptions) error { return spec.LoadAndAssign(obj, opts) } -// prociterSpecs contains maps and programs before they are loaded into the kernel. +// ProciterSpecs contains maps and programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type prociterSpecs struct { - prociterProgramSpecs - prociterMapSpecs - prociterVariableSpecs +type ProciterSpecs struct { + ProciterProgramSpecs + ProciterMapSpecs + ProciterVariableSpecs } -// prociterProgramSpecs contains programs before they are loaded into the kernel. +// ProciterProgramSpecs contains programs before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type prociterProgramSpecs struct { +type ProciterProgramSpecs struct { DumpTask *ebpf.ProgramSpec `ebpf:"dump_task"` } -// prociterMapSpecs contains maps before they are loaded into the kernel. +// ProciterMapSpecs contains maps before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type prociterMapSpecs struct { +type ProciterMapSpecs struct { DropCount *ebpf.MapSpec `ebpf:"drop_count"` Enabled *ebpf.MapSpec `ebpf:"enabled"` Events *ebpf.MapSpec `ebpf:"events"` @@ -82,32 +82,32 @@ type prociterMapSpecs struct { ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } -// prociterVariableSpecs contains global variables before they are loaded into the kernel. +// ProciterVariableSpecs contains global variables before they are loaded into the kernel. // // It can be passed ebpf.CollectionSpec.Assign. -type prociterVariableSpecs struct { +type ProciterVariableSpecs struct { } -// prociterObjects contains all objects after they have been loaded into the kernel. +// ProciterObjects contains all objects after they have been loaded into the kernel. // -// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. -type prociterObjects struct { - prociterPrograms - prociterMaps - prociterVariables +// It can be passed to LoadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type ProciterObjects struct { + ProciterPrograms + ProciterMaps + ProciterVariables } -func (o *prociterObjects) Close() error { +func (o *ProciterObjects) Close() error { return _ProciterClose( - &o.prociterPrograms, - &o.prociterMaps, + &o.ProciterPrograms, + &o.ProciterMaps, ) } -// prociterMaps contains all maps after they have been loaded into the kernel. +// ProciterMaps contains all maps after they have been loaded into the kernel. // -// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. -type prociterMaps struct { +// It can be passed to LoadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type ProciterMaps struct { DropCount *ebpf.Map `ebpf:"drop_count"` Enabled *ebpf.Map `ebpf:"enabled"` Events *ebpf.Map `ebpf:"events"` @@ -115,7 +115,7 @@ type prociterMaps struct { ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } -func (m *prociterMaps) Close() error { +func (m *ProciterMaps) Close() error { return _ProciterClose( m.DropCount, m.Enabled, @@ -125,20 +125,20 @@ func (m *prociterMaps) Close() error { ) } -// prociterVariables contains all global variables after they have been loaded into the kernel. +// ProciterVariables contains all global variables after they have been loaded into the kernel. // -// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. -type prociterVariables struct { +// It can be passed to LoadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type ProciterVariables struct { } -// prociterPrograms contains all programs after they have been loaded into the kernel. +// ProciterPrograms contains all programs after they have been loaded into the kernel. // -// It can be passed to loadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. -type prociterPrograms struct { +// It can be passed to LoadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. +type ProciterPrograms struct { DumpTask *ebpf.Program `ebpf:"dump_task"` } -func (p *prociterPrograms) Close() error { +func (p *ProciterPrograms) Close() error { return _ProciterClose( p.DumpTask, ) diff --git a/internal/ebpf/bpf/prociter_bpfel.o b/internal/ebpf/bpf/prociter_bpfel.o new file mode 100644 index 0000000000000000000000000000000000000000..9a541ebfbb99662e7df0cefe7379829e325c0149 GIT binary patch literal 7000 zcmd5=U2Ggz6+Yg&uI(m{9h$_@LMNpSc5&95q(8=OqfJ}4E(*mYfhMSEJYJ9O#rv1t z*neTk(p8I$1ojce2;>6x3QXL%IHs6U z98&ZY2NnAjyA?(8n#sV?lUEh5C|*{)sJN#1hT^K?ImH#lGm57bPbr>IJg(SKTvDtk zE+|eb9#ouCoK(yzjwxmohZH@ZbebNruo0Bct!ED;zh+Z#WxgJ70)TID4tO~ zt$0fDgyM0Lp+~!HKe=P; zOhN9LjmsUg?@jKcjbA>j{cN`5;eO@_E>vy#hK(AxRr}doF^=WKI?l}t%I$bIb(n1^ z!GQL&+4`3cdnRsEhxG>=bv)Z{GyY&e$GO?g??PbQ!uOZLdA$TZO9FY>f;?Ui3f||Q zIxza=)LwP{U%^lQ-XV5IA|p6+sQ=UwWv$H|b$YNlNBtC-Io=AMg@(}e z&;~RQ9e}Pv%TP$)COnd3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ociter.bpf.c diff --git a/internal/ebpf/clone_bpfeb.o b/internal/ebpf/clone_bpfeb.o deleted file mode 100644 index 091806274ed82a70ee62dc001f3623229903dcce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45192 zcmeI5eQ;yfdEO5I5(Iap6&y=4?8wqp>?l}ywZe+}fMt0LeXI<{Yl)H9Hf^f~uq3o# z#U&w+@C&m`tf)?X8K3W{BO8J z9(@ZOzfrVQ;OARSY^7q-LMzXkl<2EX`7~y_bLG!OFW)Jj#*78VT)A@P&oVZ&^|BwI zcFx!bnCGZ5XTKe68U8T0DO=^Q$r`D)t>J)X7TBH`Jd1{WDr3TatHBC)XMNogUN8P3Ns5{hc z>K1jA+NEw#*Qp)q8nsPbrM9R|YJ*y*)~IFb6m^nXq!y@oYL1$v2Gk5SO-)fn%*8R+ zA1@|NAbhzjpT@Ai9l5x6Wlvc3&pq8gFW)br(60+teEj&U4$VKH`u@N233oq)^4XOj z)n=@W{(t3FTUwKt{anZq!E_R%Ciawse|1$pjnUy= z4a7Izcr_>5Z?8}J_WMBD91{QO-}wH@f0McLEs4ka$NrEb%&5826aR~|@jA6eEmK`T znT=19i_`+u^^@7SEiux`(m$ZOeliN^Mb_)CRRqtx?O=De5G(NG(wF)EqTS4X7Dvnwp}Dp#B^uX3Z|SN8O=rQ@5y_ z)Gl>{x=!s-*QjmkDz!yzQXAAdwMH#dr>K+EBDFxxQ*+cTHK1mwX=;ip;_v6ti)G{T zsk!lD`kc8%?EU+-BGeCm;%i@T36R?MV?WIE~ZJDmqzIydF`9N@}5@?FX?;>%HCIi~qM!EyvQJb&$a_;UJm zRzA*h)Xk5C>XY)}{x8a7uMf*}-FGR^h|kBDCsZ$YU8B!K2aVIQn~eEIDgTOVM}zB= zBfI`vF?q5L0egXL^8wrYWaVaK?+45icHTgGfrNwI`d89U(e7pOhu!7_dxLEA0XNA7 zQE-cF^8v4tCuwh!r^svMGPy&pk=My}@&>s&F8MP4OuliTDS@*25E?vQu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#(9-(u(Pahu?TfxUc`EM{%87lev z?_K)%$UpJp@IN5`BTd+FBnnmrA3na=ZpX&~`F|?IC;?RR_utF(@sWT0zr+84{NK=p z4ac?WAOB+nI4J+Tjc!aCD*5|xq5NZa!vBE$Z`p$lhreu&@af~j8M^}?KHUP`q2p6+ zLI9Qg50ia-)Zcs+=K=ZO#{92Ue`TOt9hVy?v{13?gIPzQFkXe(Q~)^2YuP XJmcOF)r)1vV{#oO&Pm7p{4@UtnTfN= diff --git a/internal/ebpf/clone_bpfel.o b/internal/ebpf/clone_bpfel.o deleted file mode 100644 index c84804e216de00c9aa920875e16f10a00f9d59b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 44808 zcmeI5eQ;yfdEO5}i2_$EiCSqX)|Q>CSlM8u)e5`Zl@LkZLLVzb@mgY}wGG>90WOGL zu;P+1$z6kj+Q5qJK{9H?WE>hv)rPiH8WljOAsfN{VSUH7E7NoJP}frkWN> z)RxnDT>RmQ`n=~n2fTaXr!;tc++S8r`aO! zYE1JRTlS>2Cd~&Ba$$JL(!woKtCyUZ+%J6pEpfQ~RqJf7i5Ta`<~MvBY^|iSxt~=ZU4ZZIANOCbdP~psrKbs7>lBwLx8>)~UklxnDL+n=aEwME^au2a{jP3kJO zL0zHNsms(Fb&*=7R;VRvky@Z;scGsMHAPKQ6Vy00Mh&PV)FEn=YQ>K4t6?nW|>3kN)!dKjRS{@#= z0VN$t{~f3EHJ8r*epgRPM{0Pba)`e#$2iN8d%EQvT z=&wH4zUAQrS$a$SlU5h{Tt4ODl;iQ3)sOet=@0P(%jIF`KHldvH=MQZ3wA2g_}tcI80-k~v=wkC8c#52wkT--okgSB~;#!*C4xcE%dFBUAY$e>SR~0g}!C7E7w9_jqJ*`(6>l-gl3lqL z`YL2su7$o5*_CUduSjlKUFa*2SIAj%ot!2wlgG$4a*Di2PLiwS1i3DMn=Z^X!a_yP`nU3{7A<|VF|MFHCU7^;g%hVcmk?Q)jT&$2w)FQP&%~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4%A81D{FW=z{`mN} h6>t0ctCGT3WLtR<=$#0t@7GWc{|~3_<6SY_{{gOka~c2u diff --git a/internal/ebpf/execve_bpfeb.o b/internal/ebpf/execve_bpfeb.o deleted file mode 100644 index 87913ab3c3fffae0a004a9cad6f631ad3fcf5970..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22768 zcmeI3du(J^eaFwt*t6r^WMdwo=2dP8S!Nfpg!aWW}OFku5Gq@9@^&+d%k z$7E)ljI*dXg@RiZ$+T2hEo$9}BDduagQ(V2R6A9vI%@NWr6Sc5sB$YxEkPx>Ld9)S zx8L76-!pUPxAqc>)KT_1NcJ$Z3{f-QR+9?farvPsrVvLxC~Zu3h{7fQ@Z~?CqDGH*z)SJWu9a z*}ca6f`nXJvf;t=)XSx4QbM2sb%1JfM!2m9RDuyNvP<2eZd13Yo74?zi`t~FQ`e}g z)D`M7b&0x2U7$9o6>5o^qfSuAsTpdTI!aAZlhlAZK<%d{s3K^;*`@AKx2apyP3i`< zMQu{oscY0#>I!w4xIiP3bjPdQ75S5)C@IE9i^tINoqhHp!QP}R1tHz?B?aI z6?0hl>g(i=`DkOC)RjOeVy@mRY7FON^@_7cZnbM6V#p@{31iED?~5*eq2!q9j$U55 zwksAj?|1dQzj}{Le7!R1n%|^iecATRzv$LksGJ>%;_F%Xy;oK)(?_1<8t*m6 zE|h0od(D&mCNBA^`tRuaGoM(mi9BxWu_Sk6bUfF;(Z-dOvoqbtLhId*OW_ZGy!zj2 zu6^zHv9pIE)-+O~vWE=McW5;aG4^Q{~mCugW>s+(`+sI4*bNisa3y7^X)_LCD- z5tPg4O*yhd-llF*H>n%c7PU!Tr>;>~sVmfF>JoL4xDwT|F-6BN=jn_HlAQd4fDZ&XEIhiJT-? z9CKgIyM21TpYQYeDC0+&Uo^+~EHBFP_@1A4`#91|G|ZQ1#>MA8oR6l-JEE|UlDEkz z@)p_FbG|>aNe)E88)REAaEol~1#XfPqTqG1i139{3yIXAaJx2j@`tyeY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>Z;#E;)YNm+ z@>9Ypekv~?Aej* zI}K#m$w+p1)S=Un?7f1goD4fjIYC@&9HySi-Xn2SPGGeNtJPE4yPeg_NcJvQj1|Ns zIvvT5IIESB>?xsBPKKSNoFL_}iwgb8UF1>Z5!*YT_u=m_;-dFBZQtzyog{wGvIfI0 z9fpvf=VA$oyg_cX?UO#1quq-xzaL@t2MN$UTx!(?9(|KChSrZA(|yW+IOWpa+=NQ`_`QU6;qt#a td+nU<_XQd|@;LCDdP$_aZdfwsd(;w;bB<8ItBUntk~L{|&Y<;b#B< diff --git a/internal/ebpf/execve_bpfel.o b/internal/ebpf/execve_bpfel.o deleted file mode 100644 index d1daca3055c0d4d9a903a7a3998a0c1a9b0a1195..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22576 zcmeI3eQcyheaC0lcfPfA+&RZ(aey{Y2s!pHj&E(}#T?|=%f-nC4&o*kSOV>OZ@qVG z#V^b5`m)QS;uh+<2qd?q#-dScQrcQ={xFCtrlN|gQq^kn$4N!1B@l8eN-aSpw?f5g ztES)I%y-t${_G1Nq`pWVdG`OW*xGxI#pu0K9>>CtE;V!Vr(ADUhAvBs31+6|{{ zFlAnkl=U}sS*qV2v-*+~lmFBYUX_TKU$D{UNYt1gy!z^^-Ky|kfmxznZg=UPZg&X| zn_sXI*E);|5PFWSjZqDC#}?R_-KK6)H>n%c8`O2`8g-SrLS3dV zQ5UK6)H&)5wMH#bi_{TnhB{15Q&ZGIYLc3u2Gnk97d1vT)EyZvjMp}Gi@HhOpx&Ua zQ`e}g)D`M7b&0x2ou|%GXQ(x5iCUzNP&3qFYMPp&4pNiU1T~;`Q@f}!suj~%aD3a5 zP8;!Z&cz?W=tzk#$tpqk<%)}!^;nj8#Np4}CZG5d7MCl!`k!#sn*6L|$#)FC(Ydo{ z-S6zP?qAMJX(;!QQ^_w)dC8&qEo%J@uKo3H*T3C*wrxGWo%uKZc=bwt>B`gg)0o5V zGBF=v|DKMx3o(4%Ztv56DW?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1oScvbPb;tj=Higy&tduMUJzuk%xiU$>^6=xI| z71tEcDPB~(taw%Ny5bGRTZ(rS$9TWm?7!lK;z7k}#Tms##WlrqiWe0xD_&K+u6RT7 zmf{`7{`sNVe?CHZPADE!oK~DsTvS|BJg0b3@v`Do#p{YU6mKcsQ5@qVneT76;)LQs z#c9PE#YM$6#dC@m6)!7ZRlKfvL-Cg49mOa4peX&9qv5TJ?^FDU;>(Ih6@M(mvY&oh z@$-sbRQxr?uPDB!w}0TiWZ%6#XH9RlP^+5Wa$&sp;meQq3he%(uI0xYEkBTu46pIC zMEt-a{L2gZ)dqje2+O{CTa)l7$?oSD;h&`X-~O83@$u^u@>9MteyiM4*={@cuPJ1| zNgMai7iwYi7a{(~$G!NqS~YjY^j7K%!5v5(rHeL&JCoxo}lR;&Hl`<>OwK=wXYjTNLNIvvOkIIER`Y`;*ylRhU& zC&=07l0tu4_ZXfZ`3TWc)VZH?_yC`;ypfNa9*wYg-j+4vQ_WCoK(5oUdm}QxR(}89 z$mikl@6rCBiX4flW{e9AKkPJMy!;=9^wa0>V*Ecq_p5)2gA(I@%jC`cp1+O2e)X4F z{|FOG{c@|W>zDVF`_;cJ|1bgfqxxS(n*Hj(u}}Zy)=}3l?|b&EKPC-^`%(Ru?+^B? ze|w+)OFCWugQ#5U*K4qg|MbM|5-FUMv|;x-XzVmY436WGN=))0l6m0nqi!obFfu3hSR?eyLyn zNk!K$|Bu&p>D4L741CiidHwTts~NA``UE1PP3vwTE&r?p7h{7Z-<`q|3D@n!{5OT# Bx0e6_ diff --git a/internal/ebpf/exit_bpfeb.o b/internal/ebpf/exit_bpfeb.o deleted file mode 100644 index 0a2fc972b6eb391e6fc367ee6eccad2d85cc211e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7872 zcmd5>U2I%O6+Zi88q=0KZPSFdv^Nxj9UOa;^v5J^x(&E>DnqT*g%nY)uh-Z1D(l_t z{sg+2yYFFY{Hx!?KDoSAdx%-o-KzCJko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{tY{MQfJ z94=P>-`*nsc8~gB-Xs4<2YT0k4bLIm?=QIey7qINl=!{spZaqfBG~^|_Q?O*E%L7* z;>GGevPJ$C|JhNBs}>$Uh^U->d&e9=G}X7peaf61i9Zhu3WUVEwP@k^ft_$UpXB z8~VHU%x&EKT_@mR@OMcWw)HyS_Xr}yYjK=#p*{} diff --git a/internal/ebpf/gen.go b/internal/ebpf/gen.go deleted file mode 100644 index a0f07fc5c..000000000 --- a/internal/ebpf/gen.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ebpf - -// Regenerate with ./generate.sh (preferred) or go generate -tags linux. -// bpf2go version is pinned to github.com/cilium/ebpf v0.20.0. -// -//go:generate ./generate.sh diff --git a/internal/ebpf/generate.sh b/internal/ebpf/generate.sh deleted file mode 100755 index 83cb87d0f..000000000 --- a/internal/ebpf/generate.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -# Regenerate bpf2go bindings for the Linux eBPF syscall telemetry source. -set -euo pipefail - -ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd "$ROOT" - -if ! command -v clang >/dev/null 2>&1; then - echo "clang is required to regenerate eBPF objects" >&2 - exit 1 -fi - -# The process source is x86_64-only. Always compile CO-RE objects for that -# architecture so generation is host-independent. -export BPF_TARGET_ARCH=x86 - -CLANG_VERSION="$(clang --version | head -n1)" -echo "clang: ${CLANG_VERSION}" -echo "target arch: ${BPF_TARGET_ARCH}" - -INCLUDES=(-I./c -I./c/common -I./spike/c -O2 -g "-D__TARGET_ARCH_${BPF_TARGET_ARCH}") - -generate() { - local name="$1" - local src="$2" - go run github.com/cilium/ebpf/cmd/bpf2go@v0.20.0 \ - -go-package ebpf -output-dir . -cc clang -target bpfel,bpfeb -tags linux \ - "${name}" "${src}" -- "${INCLUDES[@]}" -} - -generate execve ./c/execve.bpf.c -generate exit ./c/exit.bpf.c -generate clone ./c/clone.bpf.c -generate prociter ./c/proc_iter.bpf.c -generate file ./c/file.bpf.c -generate net ./c/net.bpf.c -generate mem ./c/mem.bpf.c -generate ctl ./c/ctl.bpf.c - -echo "generated eBPF bindings" diff --git a/internal/ebpf/loader.go b/internal/ebpf/loader.go index 1228f5cef..7ea3dc4f9 100644 --- a/internal/ebpf/loader.go +++ b/internal/ebpf/loader.go @@ -31,6 +31,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" "github.com/cilium/ebpf/rlimit" + "github.com/rabbitstack/fibratus/internal/ebpf/bpf" "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/event" log "github.com/sirupsen/logrus" @@ -38,14 +39,14 @@ import ( ) type loader struct { - exec *execveObjects - exit *exitObjects - clone *cloneObjects - iter *prociterObjects - file *fileObjects - net *netObjects - mem *memObjects - ctl *ctlObjects + exec *bpf.ExecveObjects + exit *bpf.ExitObjects + clone *bpf.CloneObjects + iter *bpf.ProciterObjects + file *bpf.FileObjects + net *bpf.NetObjects + mem *bpf.MemObjects + ctl *bpf.CtlObjects links []link.Link iterLink *link.Iter once sync.Once @@ -56,40 +57,40 @@ func loadCollections() (*loader, error) { return nil, fmt.Errorf("removing memlock: %w", err) } - execSpec, err := loadExecve() + execSpec, err := bpf.LoadExecve() if err != nil { return nil, fmt.Errorf("loading execve collection spec: %w", err) } - exitSpec, err := loadExit() + exitSpec, err := bpf.LoadExit() if err != nil { return nil, fmt.Errorf("loading exit collection spec: %w", err) } - cloneSpec, err := loadClone() + cloneSpec, err := bpf.LoadClone() if err != nil { return nil, fmt.Errorf("loading clone collection spec: %w", err) } - iterSpec, err := loadProciter() + iterSpec, err := bpf.LoadProciter() if err != nil { return nil, fmt.Errorf("loading prociter collection spec: %w", err) } - fileSpec, err := loadFile() + fileSpec, err := bpf.LoadFile() if err != nil { return nil, fmt.Errorf("loading file collection spec: %w", err) } - netSpec, err := loadNet() + netSpec, err := bpf.LoadNet() if err != nil { return nil, fmt.Errorf("loading net collection spec: %w", err) } - memSpec, err := loadMem() + memSpec, err := bpf.LoadMem() if err != nil { return nil, fmt.Errorf("loading mem collection spec: %w", err) } - ctlSpec, err := loadCtl() + ctlSpec, err := bpf.LoadCtl() if err != nil { return nil, fmt.Errorf("loading ctl collection spec: %w", err) } - var execObjs execveObjects + var execObjs bpf.ExecveObjects if err := execSpec.LoadAndAssign(&execObjs, nil); err != nil { return nil, fmt.Errorf("loading execve objects: %w", err) } @@ -103,20 +104,20 @@ func loadCollections() (*loader, error) { } opts := &ebpf.CollectionOptions{MapReplacements: replacements} - var exitObjs exitObjects + var exitObjs bpf.ExitObjects if err := exitSpec.LoadAndAssign(&exitObjs, opts); err != nil { _ = execObjs.Close() return nil, fmt.Errorf("loading exit objects: %w", err) } - var cloneObjs cloneObjects + var cloneObjs bpf.CloneObjects if err := cloneSpec.LoadAndAssign(&cloneObjs, opts); err != nil { _ = exitObjs.Close() _ = execObjs.Close() return nil, fmt.Errorf("loading clone objects: %w", err) } - var iterObjs prociterObjects + var iterObjs bpf.ProciterObjects if err := iterSpec.LoadAndAssign(&iterObjs, opts); err != nil { _ = cloneObjs.Close() _ = exitObjs.Close() @@ -124,7 +125,7 @@ func loadCollections() (*loader, error) { return nil, fmt.Errorf("loading prociter objects: %w", err) } - var fileObjs fileObjects + var fileObjs bpf.FileObjects if err := fileSpec.LoadAndAssign(&fileObjs, opts); err != nil { _ = iterObjs.Close() _ = cloneObjs.Close() @@ -133,7 +134,7 @@ func loadCollections() (*loader, error) { return nil, fmt.Errorf("loading file objects: %w", err) } - var netObjs netObjects + var netObjs bpf.NetObjects if err := netSpec.LoadAndAssign(&netObjs, opts); err != nil { _ = fileObjs.Close() _ = iterObjs.Close() @@ -143,7 +144,7 @@ func loadCollections() (*loader, error) { return nil, fmt.Errorf("loading net objects: %w", err) } - var memObjs memObjects + var memObjs bpf.MemObjects if err := memSpec.LoadAndAssign(&memObjs, opts); err != nil { _ = netObjs.Close() _ = fileObjs.Close() @@ -154,7 +155,7 @@ func loadCollections() (*loader, error) { return nil, fmt.Errorf("loading mem objects: %w", err) } - var ctlObjs ctlObjects + var ctlObjs bpf.CtlObjects if err := ctlSpec.LoadAndAssign(&ctlObjs, opts); err != nil { _ = memObjs.Close() _ = netObjs.Close() @@ -387,37 +388,37 @@ func (l *loader) Close() error { // Replacement collections share maps owned by execve. Close only their // programs so the canonical maps are released once. if l.ctl != nil { - if e := l.ctl.ctlPrograms.Close(); e != nil { + if e := l.ctl.CtlPrograms.Close(); e != nil { err = e } } if l.mem != nil { - if e := l.mem.memPrograms.Close(); e != nil { + if e := l.mem.MemPrograms.Close(); e != nil { err = e } } if l.net != nil { - if e := l.net.netPrograms.Close(); e != nil { + if e := l.net.NetPrograms.Close(); e != nil { err = e } } if l.file != nil { - if e := l.file.filePrograms.Close(); e != nil { + if e := l.file.FilePrograms.Close(); e != nil { err = e } } if l.iter != nil { - if e := l.iter.prociterPrograms.Close(); e != nil { + if e := l.iter.ProciterPrograms.Close(); e != nil { err = e } } if l.exit != nil { - if e := l.exit.exitPrograms.Close(); e != nil { + if e := l.exit.ExitPrograms.Close(); e != nil { err = e } } if l.clone != nil { - if e := l.clone.clonePrograms.Close(); e != nil { + if e := l.clone.ClonePrograms.Close(); e != nil { err = e } } diff --git a/internal/ebpf/mem_bpfeb.o b/internal/ebpf/mem_bpfeb.o deleted file mode 100644 index 11508e9f158433e53380583dbc8c08bd4fc2e73c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32216 zcmeI4dyHdOeaDaOnOW~{HZhREltO!XGj|RA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zkse^KxMM+9?XdK!OyhreK+$N%8a z|KlM4UnHEsU%k~!7tD!;r5UTNkMVy~bpD=u&K6!~Ag7&7I5|^Di{~jPXA8FropEy7 z$tfojPEv)Jipkl+gw@m33F?``S(l!blp`2hgt1i^TRmGiBgUtlOgMoteVxMC^4Y>^ zXKZD{(b>W&@jTfdtyG5KyJeAzDm zoJRz|8Ta2y8T@Wx=*kSy07eGR$e+ON)7vAye7`t!$@+~%hvOJ&S z_x$~O`uKRRjmYl>_Q>CU|A%1v{UEe|`S|dNEaGFY{AJ&ftB70jmpwo(A7Ap9!^R%@ z-^lpB95!w^zC^|EX7|eft+Fr4Tt1$ofjv0#Ci!51j^C#LGS!RE9~_m#o{#UtskbGa zo%t;vcG~|8 diff --git a/internal/ebpf/mem_bpfel.o b/internal/ebpf/mem_bpfel.o deleted file mode 100644 index 486ecb3895c0573265b77acbde47bf943df265b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31928 zcmeI53v650ea0^-S*9PcmBeAxtX*%LETuiiru;~lM;*qAU1o7oA#obENlMWaZ3@wY z5h;fZTZ~)VNf^>j=sJxkvQA06P8+gLz*d9;DeK|qU5Kr>80Hb5APL2ZXk*aH2c<^&C8nz&obN%p`77Y zw;Sd1{k7N1dh4 zP#e@K>Lj&Jtx${90=1u-ruI=&)Fd@QjZmicwtaF@DFa8Jhl9$dAZS2vz7*=gXt+PNNI2I#96z2Bl% zZ)CZ8Y5=Mp!QSK)IMs8nxrPEacYd}Q+uf0)Ckq1uAw(D52jbCE7WD`5_OTf zK%J*HsdLm>>I}6(ouW=s>(mOhNG(wNscC8-HAPKQ6Vy00M)j#Z)NX2oYQ&81ZLrq5 zn9r~I#v^y}-9}sUmHVrk&zHC#3h%{LyJ*vW4(>iUchN2sxvqU6&wCD+k1N+@%X29U zfZ2{-C_rW2NeLxAr#Hjy@{w{#4KJ1O0kijdtCwD~D(T4nF6l@~B%Nn*RbR66v=;3% z0VN$t|1GEUWt+|o9k!m5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Yyr2I8-*dFxfy7mO^ zllOdKe(NJbdk^-YeTfV>Xy3ThAEZCNGs>m}4*S0j4%?^tXVVAe{b{#vT>3BlOX0*Z z{v1A}f1axdOM5(vFO&9rZXqoF^DN^p-;DBJZJ)FN+Dc)ARt9Wme6Tq;)iLBySv0NX)d?#eRgC`)(4{$#R>W5orI^PaZ&M<;DBd6CcV!gk6z3He6;CNHD{d%mDefrlD&A1sQ`}d)qj;crf0S>} zD9$O)D=sRYQe0NtP~1}7QQTF$p}42GuXsoCK=J-4-;q(AQ=C^^R6M1)thk}LrMRQG zt9V0kPjO%Ij^csh{ZW?RIfeJ%6FJ55E;xAqapEb(^8Prq&njM4{3XR-0|(EWCtg$h z8;ZZJ_&bXKV3hBa_r!sJx$}0#cPp0uhUuSDEd90iM}O$ab5EUry7a{3kA2vjUaq&6 z&FRJZ<~^)A(Kaa_yoyy|jA8 zD#z0JU+!Ia^2rA)A2N`$P9~i^SeY!kSf`VfhXo5x9;`eh^njDIPR=+%PHQ|%ouocc zc~J74aZ+&dVC9UBJxfL62d^7w|C`7g4p;bd#Ont7EprCb{D8DwHBuA5dS9Tl8lXlyKo#wvJH5`(Rx_f`v3)KzeHr-(1$Lizq2_TRq3 zSLHW4UYT{V$rH+IzqnzXggwi5_u)|rAqdNT!yo?*fw##o-y4q{a$ohwcMla~z4FN6^GoC};XJJV26I)RQvVp)=a+IX;XI^% z|FyCGKAKsr`1}GhI1j78Z&Taf4cYp|m&oDsOa1rbJf!~HrX?|cXCi(pJbZqM`ykH4 z>KA_~M-!*?->38WQGenY#2-@sdmFIfNKzf))8|Jp@iBb(a!UvY$3>s7fJmv|e{b*e zOa0=r4ypgHZCBV^_1}JHcUb*hm;a#u{(JwR{wVnV`e1!B+kFEDd_Lkqd%^bKi1Y3D z>)Yq|OV diff --git a/internal/ebpf/net_bpfel.o b/internal/ebpf/net_bpfel.o deleted file mode 100644 index ca639ddafb05f690ca4ee25c37bf6f989533114d..0000000000000000000000000000000000000000 GIT binary patch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m%xT3hBxTUzQxTAPOaaVCqabIyv zF7n|9=fC2F;*{cy;;iD5;)>#i;+EpJ;*R2PgjjCn-c=M^NME_zpVIkihnJ{Vt>A(_-l&4q4-V3-&XvgAAIuSrOQvHpSbY&W9H0Kv9e^& zEEH$XJbCr0GXi`6%*&?P^M~{Ng)(m;2#umzfTMQwFm!~JItAxnU`kem+=euOCy7yu=zjbaR$H3UYfja&Ma1Et#T}l z|K;12C!c&c_lSX0gw8uT=j5ytZ0xrZgs zStm&+59iL>&~sEIet6eF``;AqIb7kN^X(ewx6K)v=JV3B@thSj$ts$};Bo3XNrh;u zh$fGdou1E~b=|Zw?kMR5Lt{fRG*-dmk{E0iy|N&bjY~lfNCsN5?yg zyHs@;SCL4*!wJj5$8m$W^uV{%Bl}m_{SUy~<@fJ(eI7pc@o4@WK6w<99)vhgCGXUa zlWZ^26`!A%ljb)Nwpabz?6-gK>q;Bu_xxpe_Nu>~cPS|L_cVtQr0c(lu)XT{_dou9 zu`6wu-*W+;z3Pumx)kC5i`~%mKZLNo>QC}|%Rgsur493Yem^{W)t_ShWhRvImvp-R zXYk%;ulf`62i4$8YW?~AF4mZjApc(VxA*A3JTme5{rumxPyNk%Tn&F+|K+{fUiEkP z=)c^u>-x{3^Z2*x9Be%3>gR2~1AI!_u#>;BwpacZ^EbnZ;rI3X;D5~gp1mf{INvYu zI>d+T^Y>%OzgPb=*IkZ0Gs^tSEsU?dfv#WH^j`J1S$~t) z6(Vv8t?PduDj&J>);yx>I0i1o{g02C2I0D`A4LF`z%IA`oD1^rbtK<74qyKmbNqjy CHa%nj diff --git a/internal/ebpf/prociter_bpfeb.o b/internal/ebpf/prociter_bpfeb.o deleted file mode 100644 index 605d00f7e0ed0017031f5d3fdd2058be922d5864..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7136 zcmd5=U2I%O6+ZiuCZ;WM(}V;l^ae_>gR|KrP3tCYv`L%R1=E@&R0$Hgd%eE4SKdGN zC)iC(w<^#`{K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b/internal/ebpf/prociter_bpfel.o deleted file mode 100644 index 175940972b3e30d9b9ff3d71f13071c85d433a5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7136 zcmd5>U2I%O6+Yg$uI(m{oyLiQ7H*(5c5pVEq-|WcjW%i1x?oz9gepNo*VpT7d*%Jh z{sg;e>7tepi62==1PfKFsSwIT5k@LXDy75^fcg-LNK`1OeXsyQB>IpC5P2vH-#2rv z_wKaxg%^%;?svX3Xa3I2ojdEiaCq$TL`#cA(jxzo28+BR%Y6+yZOpW6Lgd2scEfsa zuNw^J4M=dZ)fivxd*0xM4(so88o!VbnTKB3V9UP=coBNJ&GIj|bs8h{qxWyoxcsX1 z-;O%(-@0|nZIAWYMXwZ0-~|x!ce)Lg+hoodr_Ytpg2?G}vx*an#}&sFM-|hG!-^@z z0Yy)-PqACET~QQonhcyicSG^I;+o<$#jA>MDXuDBR9sO!uehwZq`0VfRft~jnZs+d+BR!k`lD0+&0irtFsilTT^^M6C}y5gGRHN~rnZz--SUQ}FBJg>N{ zxTLtKcvi8lIImbzoK>7qJgzvdII5Ud99B#z4k&txeTv=FCP@ zkU3-HGH2|2lR0PO7fxzF+w6F_pE-idWm~>^i^lEHezuj2W8tKZbK9(PJD%PavkfKa z(SEjB|H4Vn#PzmVf3QWz)4$dDgB~5{Haow|fpH7pUkc~-67&KIDT8y7&gw@$^JSe!onpMY{*AyJ%VXhV-O z@}@eBr4wzmauq%nIe?#pvb{8PClu0kJ03a~@`ODZX*Rd3OG1Cbt{Tnen0Px~DBNR0 zqhHgnYK!R8$GQ()$J2Y4D9LN`I{ z&@8kEx(Y2qAzi(A#K#=18Qe`djoOAk@o_vb3GjKMPx5DfzD2 zY2f$Ot^o#)*s<9-vgMTzHiyLFkoGS6u!^U7S-q0B4y=_>U1P)OGfJhUnD#65gkY06o& zhvWTyMguwi|F(`%fA84Xu6u#;{sy!SKvRES!=K=sDe=Ceb!Ok6g{GnI9vXyi6?z>C z>Ee47?|T>c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F0ogD=tqUQ^Ea;ZtlPNKYmg*!xl?)GFU$BLvwnMsekmkzf3F6U zlB_J`4Ql`EmyWSRhf@B7Vqm|8`z`EA*+l)1&#$4rb2OS3|E7N|`K8moZl`rGIkjh7Y@$*-QuFIP4Keiti dcdRd Date: Mon, 21 Sep 2026 10:29:16 +0200 Subject: [PATCH 47/65] fix(build): Point Makefile bpf targets at the generated package Make looked for bindings next to the C sources, so every CI run rebuilt and failed the clang 18 drift check. --- .github/workflows/linux-port.yml | 2 +- Makefile | 43 ++++++++++++++++++----------- internal/ebpf/bpf/clone_bpfeb.o | Bin 42672 -> 45224 bytes internal/ebpf/bpf/clone_bpfel.o | Bin 42288 -> 44840 bytes internal/ebpf/bpf/ctl_bpfeb.o | Bin 20648 -> 22168 bytes internal/ebpf/bpf/ctl_bpfel.o | Bin 20264 -> 21784 bytes internal/ebpf/bpf/execve_bpfeb.o | Bin 21424 -> 22792 bytes internal/ebpf/bpf/execve_bpfel.o | Bin 21232 -> 22600 bytes internal/ebpf/bpf/exit_bpfeb.o | Bin 7720 -> 7904 bytes internal/ebpf/bpf/exit_bpfel.o | Bin 7720 -> 7904 bytes internal/ebpf/bpf/file_bpfeb.o | Bin 72800 -> 77944 bytes internal/ebpf/bpf/file_bpfel.o | Bin 72032 -> 77176 bytes internal/ebpf/bpf/mem_bpfeb.o | Bin 30584 -> 32248 bytes internal/ebpf/bpf/mem_bpfel.o | Bin 30296 -> 31960 bytes internal/ebpf/bpf/net_bpfeb.o | Bin 31896 -> 33632 bytes internal/ebpf/bpf/net_bpfel.o | Bin 31608 -> 33344 bytes internal/ebpf/bpf/prociter_bpfeb.o | Bin 7000 -> 7160 bytes internal/ebpf/bpf/prociter_bpfel.o | Bin 7000 -> 7160 bytes 18 files changed, 28 insertions(+), 17 deletions(-) diff --git a/.github/workflows/linux-port.yml b/.github/workflows/linux-port.yml index e9a9c62c9..68a0b432c 100644 --- a/.github/workflows/linux-port.yml +++ b/.github/workflows/linux-port.yml @@ -35,7 +35,7 @@ jobs: clang --version - name: Check generation drift run: | - make ebpf + make -B ebpf git diff --exit-code -- internal/ebpf/bpf - name: Unit tests run: go test ./internal/ebpf ./internal/bootstrap ./pkg/event ./pkg/ps ./pkg/api ./pkg/util/signals diff --git a/Makefile b/Makefile index 80cf47850..f2a352ba9 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,33 @@ .DEFAULT_GOAL := build -SHELL=bash -o pipefail -e +SHELL := /bin/bash +.SHELLFLAGS := -euo pipefail -c BPF2GO_VERSION := v0.20.0 # Specifies a list of build flags -TAGS ?= "" +TAGS ?= BPF_DIR := internal/ebpf +BPF_OUT := $(BPF_DIR)/bpf + +CLANG ?= clang +GO ?= go +GOFMT ?= gofmt +BPF2GO ?= go run github.com/cilium/ebpf/cmd/bpf2go@$(BPF2GO_VERSION) BPF_FLAGS := \ -go-package bpf \ - -output-dir $(BPF_DIR)/bpf \ - -cc clang \ + -output-dir $(BPF_OUT) \ + -cc $(CLANG) \ -target bpfel,bpfeb \ -tags linux +# Production headers first; spike/c is only the vmlinux.h fallback. BPF_CFLAGS := \ - -I./$(BPF_DIR)/spike/c \ -I./$(BPF_DIR)/c \ -I./$(BPF_DIR)/c/common \ + -I./$(BPF_DIR)/spike/c \ -O2 \ -g \ -D__TARGET_ARCH_x86 @@ -28,30 +36,33 @@ BPF_CFLAGS := \ BPF_SOURCES := $(wildcard $(BPF_DIR)/c/*.bpf.c) BPF_NAMES := $(patsubst $(BPF_DIR)/c/%.bpf.c,%,$(BPF_SOURCES)) BPF_TARGETS := $(foreach name,$(BPF_NAMES), \ - $(BPF_DIR)/$(name)_bpfel.go \ - $(BPF_DIR)/$(name)_bpfeb.go) + $(BPF_OUT)/$(name)_bpfel.go \ + $(BPF_OUT)/$(name)_bpfeb.go) -CLANG ?= clang -GO ?= go -GOFMT ?= gofmt -BPF2GO ?= go run github.com/cilium/ebpf/cmd/bpf2go@$(BPF2GO_VERSION) +titlecase = $(shell printf '%s' '$(1)' | awk '{print toupper(substr($$0,1,1)) substr($$0,2)}') .PHONY: ebpf ebpf: $(BPF_TARGETS) -$(BPF_DIR)/%_bpfel.go $(BPF_DIR)/%_bpfeb.go &: $(BPF_DIR)/c/%.bpf.c - $(BPF2GO) $(BPF_FLAGS) -output-stem $* $(shell echo $* | sed 's/^./\U&/') $(BPF_DIR)/c/$*.bpf.c -- $(BPF_CFLAGS) +$(BPF_OUT)/%_bpfel.go $(BPF_OUT)/%_bpfeb.go &: $(BPF_DIR)/c/%.bpf.c + $(BPF2GO) $(BPF_FLAGS) -output-stem $* $(call titlecase,$*) $(BPF_DIR)/c/$*.bpf.c -- $(BPF_CFLAGS) + +ifeq ($(strip $(TAGS)),) +BUILD_TAGS := +else +BUILD_TAGS := -tags $(TAGS) +endif .PHONY: build build: - $(GO) build -tags $(TAGS) -o ./cmd/fibratus/fibratus ./cmd/fibratus/ + $(GO) build $(BUILD_TAGS) -o ./cmd/fibratus/fibratus ./cmd/fibratus/ .PHONY: fmt fmt: - $(GOFMT) -e -s -l -w pkg cmd + $(GOFMT) -e -s -l -w pkg cmd internal .PHONY: test test: - $(GO) test ./... + $(GO) test ./internal/ebpf ./internal/bootstrap ./pkg/event ./pkg/ps ./pkg/api ./pkg/util/signals ./pkg/filter ./pkg/rules .PHONY: clean clean: diff --git a/internal/ebpf/bpf/clone_bpfeb.o b/internal/ebpf/bpf/clone_bpfeb.o index 45c82786e0f3bbefd17a7cf424079da7e2846b67..b8237d893fc6f55307b3ed0e75706f9b5ac4c440 100644 GIT binary patch literal 45224 zcmeI5e{iG6dEXZR34(Xh3AS`HtmwxpJC-X9HF7V>v@hmr~rxW9yd-2`RKKuLKclX_W0p2g3JoQL48Zq4?V*WSW zA&;&Fj$f--%JK6S6Im>oq|oAXCL#J-T|SMOSh@UXqL=QJPh&;`V=iC5{AVc}+IrcK z&pT)2N#;3h%o*`ISG9)V1?t5_G%Y^RfSRJ(6yb04hl)4CMYgG1)DCr%+NN$$*QqV) z8g-SrLS3ddsY}!bwN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S8HoD3_|^ou#WzmOv7?D?g?U9-z= zP>cO#mwh8iRzp7rv-byCT)a^~*RrRCqx0JR$s0C|IW<53;#K+Kwk7;<pAcAfFNKbNq_^00~oENg3@I3Fs$opJgry9+@Bn+?-#;CnVo< z`yTP_=hlJfc1|IO{t+BiSq zj}K?)I4*v=8Mp(-PbUZ-RPy(~59h~6{^pp;FF&!adVc+=_N8koQBoH8o^j*Ia?3M%>A z7g%T@|Ip_aZ(XqMR)b;qc(qUV$E|M;v{&d);3?1G`y6X+=NX=XN}Pj^2l*%dHx!NF AlK=n! diff --git a/internal/ebpf/bpf/clone_bpfel.o b/internal/ebpf/bpf/clone_bpfel.o index e81f9adbdc06667c2660c4becf7547706dd020b4..237b36968fe0fa6dbcb71abbc48717f6b2c28918 100644 GIT binary patch literal 44840 zcmeI5dvIgdecvxZEd{PtT57dRv9gq0`LV%Ds}*)v4^)!3&|_sNUQ4jFN?_S3fCZri zBQA-MTp1A529}i$(otHDC#5l|#-Zib#&Ww0}=53R6 z^}Novw(W6aje9pCWO;JJQ2F|>(buhbxxf8`_r&4SE5_NoGURzbc<;UUrc~m;0B>=6 zlDY2j&YB44uk<`0wl7jE)d*7Xyh_!lPEjYQVX8;%nw%=tEoz6lNo`X%s4eO`wMkv0 zHmIxAI(3;^qgJUUYLQx?W~eD@lA55#sWEDl8ln2sDe43@O!cT;X)d(a7PUj&q_(LW z)E0G}+N7>g8`M>5ow`h|QLEGvwMZ>cGt?9{Nlj4W)EG5NjZl5+6m^0crW)}oMRLYB z4wuHPyNtJMa8&kocZ|>Ofbn@LXXCwo#ddrdV6R*B{vOqh|MHYA&vrgrCZBxx3nNJW zz1Pt@qllBc;r->m^ZYQw+xt1w%Q$aFY{i1-+17x1NIH`59`Dm8=Ii6O;C2*QyL`Tm z<{LvBG&`rEA)wva&_(P&cV<>ISt%U8gpwYt#mH zm0G7RQ)|>JwL~pa3)BoXMNLu@)HpRpjZ!02pE^aIpoXa)wQKql^`~~Io76USgW965 zQ=8N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5`X?-!Xi}Pk-KpVkI9#wJ&y&uxEMKjUL%3M8ceZ5)+gE z@&ADGi9GT|4_RkC?EiWD?-*Gh>-6CPasb8Wj?H%Z^74H01Dw0qPs}0>hkO@lI(&JF z{70O-*>A8^9xC?zcOG9}>`R_q?BBSAG#rUMF44o6mpIuIcC)|2LIG6l+XpnLFE92V z#JP+8o6|_caozU!Aj59ts&HYniW50llZ&y}gwvOxo!+EH*-?zit zm;R4@{{l4~nPrDJ+|d->WZ#bIZuS>kxdV$(v5(&o?Gd&At+8uoY`;x1aZ8?VFf8A^ bqDQ2^V$UK$?pZq=53&F3{vl=b{7?M{X?ge& diff --git a/internal/ebpf/bpf/execve_bpfel.o b/internal/ebpf/bpf/execve_bpfel.o index 265b9cc7e0ed8d62fa0618928c7017cd4d74a1d3..300111f3a935bc00457ad72806285b72ba6c1850 100644 GIT binary patch literal 22600 zcmeI3du&_Rea8X=lh&b=C}BD;QS<1OK1R_LZEDej zB`Jq2vrWJ{K^<`*4rG38uOz!-+Z%IW&T?T7O&SkUA*TyU4+Bt zSFFdCE@J|?UZghW63EGz##}({rS?!`R72gd88+s&saw=d>IU^1b)C9KU8Sy2m#ItC zCUt>2Po1UKs3mHVI!Ya(4pTGKG&My{QWMmG+Dq-B#;At6Bi)7m+NN$%H>n%cYt(h> z8g-SrLS3dVQJd5S>O6IpTBDYzMd~PZggQ*kP}9^DHAziS18Og|hZ>_=F^xsXw;t)X z9-g%#h%FdhyX9=#a(q4WZ~w{4mGsh-=j_#(!)}?F zkFkBvMchIRuiNc?>M!|pz#ca5w<%x4`V`}4qjSqu`nLxAnnZ??biWC^yWZWnDj_V%OXUqCG7E98d82=)5lsZBkre>&VYKoeqa=%#&$lPxhx!){uzgcu0 z*;w4M{n1$5rfyL;sTL_)DI!w(_)6^6- zNlj1#YA>~i8lxKOj&wWveVe*P-K1_%uTj^jYt&Wh3U!&fL~T+RsPoiWYK>Z=7OA7u z5$Z5CLrqgt)Fd@Q4XC};9%_tg#m?`;a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)K*Kak&@&hF2uid#C4Xpc9|ZU@X4Olg~Y<=Lns>(Ti< zZqgk%h&$}On+J*wH%h#FPCbHiylNV=yR2~wxUO+4cwJ+D-|zn{$X7Kx-V5W8{22ey z(iRSe?8q+pE>V*ab5L&Vj`@2N*aE9bBl$)&qVjF>gHe(9QaK|l7gGKH0oyBBmqt40 eFSL79mV;@om`e9&Gf^+59}M$O+#FlX6Z!`rxshW4 diff --git a/internal/ebpf/bpf/file_bpfeb.o b/internal/ebpf/bpf/file_bpfeb.o index 6cba12704f041b853fc6a662db0fbeee251993e1..2ff0423638709ae6cd7498506a98696a022c3436 100644 GIT binary patch literal 77944 zcmeI550qn9eczv?nOUtdw(uWNz>tSAATR5+_K$7ZfFmz9h_EpeV<#d3BzaaIO*}gz z&&)0wmNudxpp#NEq!1KBlL<{gNlDL~9vUk-37(#kR84)FISozK!bzrtLv%{c$+XF7 z)P_^{_q+FdrTe}+v&PtQORINQ`rXg(cmLn}?(g0A-e`aPzB6x*$78|hhy{NwVNWr# zi1yW8LwS6^E{LsHf>3GwV?o-;$AXl~$IW*zHTO$T4V9lbqTfMqC=7z9o_cDSwsxb_ zub;G`*h46LItU(B)nkZveJWT`zWCXv_EbLJ)bAje>pZjkpD3GT!9!)+Mk(h#s<~K; zXCOmJ(;m^A8i-6nuR`L-OuIyy`iLArzYE!i+=1*tZbNnR&fxZS3IJRd1H{ENk>hAu9|>yS0bGNhe<3-MWS0WuG1=ifry)L8N{<1I3T-Oj%StUn7_e-=zPO1W5n z7O?&-VEtK$?b`IQKI9H$4{{r_3%Lc^f!u^_LvBE}Ae)d4$U0;VvJ6>-oP{hv<{@*C zS;!1z2$_aVK_($pNc*w=EChSt0pu=ZA94q>2e}Q|h1`PdKyE^|AvYjfkWI)2WF4{w zS%xe^&O#O-^N=~nEMx{UgiJ%GAd`?PoWGpDSPpDCHM>5|%?CHAeRRHJU2^C16Q;Iu z-n~R)1;M<@JqX`x_2CmAwtBbjAl=on-kb6z|0#_zR}QXI`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3r%ODaw)&M3|)E+{T4t|@LPZYgdn?kMgm z?kgTB9xC1&=Xg?aT5(2kPH{nTQE^RiLvc%STX9EmS8-qQK=DxV-ZXB6iY7Zev2*AzDtw-mP(cNBLO z%X$~GH;Em^vfhQl?PFG$WxWe?pg5~IuXtKwMsZGYL2*%WO>skUOL1FqM{!qiU-3ZkQ1RY4 zA4@7uE6ym+DK023Dy}JRC~hfkEAA-nD()*DC>|=_8)x~h5Wc@lb&#W}?V#YM$6 z#SO(R#cjnM#a+dH#RJ7d#e3s?Z&GnuaYk`YaY1oWaZPbUaZ7PqaYu1iabNL3@lf&J zINvAheQ5u6U!XXvIInnGaanO)aZ~Yz;!VX{ihGK;74InC9cTO6Bh=peQz|@AoK>7x zJgvB_xB(9BXYZHs4s%dS7q?e+MzfZzz6K@vkcW9mQ{fW$z^?juYR&CCuMa{8!_A^0?xM6h96Q z*^86UD88zAR`IIhH$1=RMEVEb|AP;meBXobeZZVqtu|K8ndR#InNM7O_Kd*6KZ~$& z4*bz6e-RT-7W&o4!Rf*g?*6EAU(x=@-cr8<%k~lW748ELOleE^G5AA$_j``;&!hb> z;?0@)`PUZYm!!-11^?(LAO0uuXYf15)yg$V^? z!^+=gsxnl{muFu&e0s_E2F^pu_n!&v_eV+R51(Fm2InE=znoMoP5*i=o(%>WKJJeKF9B5fH+eAdvVGU vDnIg(r8`$_zcp=8__Df75<4C~Lj7g`Kfdw|a=`Jqf%A;?p^`@5f9bygzO}Tr diff --git a/internal/ebpf/bpf/net_bpfel.o b/internal/ebpf/bpf/net_bpfel.o index e7502ebb54105f32af102fdc39e36d755b9273d4..6757c2ddaced3058f26040363a0d9c24fd1d631d 100644 GIT binary patch literal 33344 zcmeI5dyJ#kdEO5>vm@?mC5_kG(KxZ2PqDn=%Bx+@?#iZRX-#Rh5*@FViL6a&S1vir z;V#FT3q6-LX{soLr~;cR4Use(HZa<;lE6e_1Ovx_m|mc1;~+$v6w}sd=_V+~fD#Ol zBA5U{%Kp))&wI{u$d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Wc89v<^Ontz8+j=t$(i1Tc`&uNn3@_0x) z{r%iNm_I|@!tyIjDD9VY{(j&8Uqa!# zm7kD*s0OaACa1sO#TxTP+`L=)aX4N=UvEIxiRE)`7)<>D}Ve0?xr=`QOQQOOuGEn uq41H1UYJKz1J}^4bN%CMg<-g^tNhzVvj5O-!u@Z+OpiB+grC0&-td2z!?gwg diff --git a/internal/ebpf/bpf/prociter_bpfeb.o b/internal/ebpf/bpf/prociter_bpfeb.o index f90905f1502262522de0109e4724409c66afdee3..e93d91e49b93252f6ccb2e1fd343e3b520c79d5b 100644 GIT binary patch delta 434 zcmca%_QQOFKI4v!2HFCwIt&a<4wDlElo^#Kw+Q$%vQ54sV9Z+q6lG$7g3T;~^-Q5_ zfjnl22#Wwr3P>+Qh%@X!5}%I{XFh=>J_AYo$K(p(-SzB15k{zr1|ZFW;IrNVvO)4J zKnw(|FMtF{9>)IyWOE_-Y(ORhHxi!*$Od7kdNvgxn-jrj0D6D(CJ|XC#(>Ee#8!v{ zWq^Pgqyyw47JeZCL17Wm$@SthWPF^Q4B{;rz?3gUJa3%8ZJWTLk~=v+#y`W(EcZ zMj!@(1|VhuVkn>W4v-C!2Z;dz>kA+OV#D}ffNVAdAH-x}N8>nA;Vb@R1N|&CM!s8XVjQ{L-IeP y$K)GQ?u6{O9$L{>oLnJ!FDkTz$mm^?$;UNHb7#&82jgZ#n-<%8S;0ulgNA}D|)RbmEI{0H;oBH=^z>_BbdIYAl{MzOqoL{QwU{fFu9P$b#jD+1m}Nokf{s| zTPIgaY-gM?*--L7gUPW1%8ZJW8wLCsxh7u}Fy1U8Si>~=gYcGmW(Ed^ z1|S9jMj&PZ;ybJ$9)t~&e}TjY$$vrOvw;+X35a@jAeRS;&jIACAn`$3b$}QIfM#u0 z78PY;jG1gHzMh?%kB66EKydPZ@fnkgSR5z+kdWZ47l$aFF@8p*Fo2u_0um640RU5>C|>{o From 78bb439e2fbc7ce871c64f289ca8045bf7ccb3e4 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 21 Sep 2026 11:51:04 +0200 Subject: [PATCH 48/65] feat(rules): Signal kill after confirming process instance identity Revalidate PID plus start boot time from /proc before SIGKILL so a reused PID cannot be terminated. --- pkg/rules/action/kill_linux.go | 180 ++++++++++++++++- pkg/rules/action/kill_linux_test.go | 301 ++++++++++++++++++++++++++++ pkg/rules/action/kill_windows.go | 13 +- pkg/rules/engine.go | 4 +- 4 files changed, 489 insertions(+), 9 deletions(-) create mode 100644 pkg/rules/action/kill_linux_test.go diff --git a/pkg/rules/action/kill_linux.go b/pkg/rules/action/kill_linux.go index 1cc0bbbb0..8f993476c 100644 --- a/pkg/rules/action/kill_linux.go +++ b/pkg/rules/action/kill_linux.go @@ -7,6 +7,7 @@ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 @@ -21,13 +22,184 @@ package action import ( + "bytes" + "errors" "fmt" + "os" + "slices" + "strconv" + "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/util/multierror" + log "github.com/sirupsen/logrus" + "golang.org/x/sys/unix" ) -// Kill terminates all processes with specified pids. -// The signal-based Linux implementation lands with the detection work. -func Kill(pids []event.PID) error { - return fmt.Errorf("kill action is not implemented on Linux yet (pids=%v)", pids) +// userHZ is the tick rate in which /proc//stat expresses the process start +// time. The kernel derives that field from task->start_boottime through +// nsec_to_clock_t, so dividing the captured nanoseconds by the same tick length +// reproduces it exactly. +const userHZ = uint64(100) + +const nsecPerTick = uint64(1_000_000_000) / userHZ + +type processInstance struct { + pid event.PID + startBootTime uint64 +} + +type killer struct { + open func(pid event.PID) (int, error) + readStartTicks func(pid event.PID) (uint64, error) + signal func(fd int, sig unix.Signal) error + closeFD func(fd int) error +} + +var defaultKiller = killer{ + open: openPidfd, + readStartTicks: readProcStartTicks, + signal: sendSignal, + closeFD: unix.Close, +} + +// Kill terminates each process referenced by the action context. +func Kill(ctx *config.ActionContext) error { + return defaultKiller.kill(ctx) +} + +func (k killer) kill(ctx *config.ActionContext) error { + if ctx == nil { + return nil + } + instances := processInstances(ctx) + log.Infof("killing pids=%v", pids(instances)) + + errs := make([]error, 0) + for _, inst := range instances { + if err := k.killInstance(inst); err != nil { + errs = append(errs, err) + } + } + return multierror.Wrap(errs...) +} + +// killInstance signals the process only if it is still the instance the rule +// matched on. The pidfd pins the process identifier for as long as it is open, +// so the identifier cannot be recycled between the start time comparison and +// the delivery of the signal. +func (k killer) killInstance(inst processInstance) error { + if inst.pid == 0 { + return fmt.Errorf("refusing to kill pid 0") + } + if inst.startBootTime == 0 { + return fmt.Errorf("refusing to kill pid %d: missing process start time", inst.pid) + } + + fd, err := k.open(inst.pid) + if err != nil { + if isGone(err) { + return nil + } + return fmt.Errorf("couldn't pin pid %d for termination: %v", inst.pid, err) + } + defer func() { + _ = k.closeFD(fd) + }() + + ticks, err := k.readStartTicks(inst.pid) + if err != nil { + if isGone(err) { + return nil + } + return fmt.Errorf("couldn't revalidate pid %d: %v", inst.pid, err) + } + if ticks != inst.startBootTime/nsecPerTick { + return fmt.Errorf("refusing to kill pid %d: process instance identity does not match captured start time", inst.pid) + } + + if err := k.signal(fd, unix.SIGKILL); err != nil { + if isGone(err) { + return nil + } + return fmt.Errorf("failed to kill pid %d: %v", inst.pid, err) + } + return nil +} + +// processInstances resolves the distinct process instances the rule matched on. +// Clone events already carry the child identity, so the event process +// identifier always designates the process the rule fired for. +func processInstances(ctx *config.ActionContext) []processInstance { + seen := make(map[event.PID]processInstance, len(ctx.Events)) + for _, e := range ctx.Events { + if e == nil { + continue + } + start := e.GetParamAsUint64(params.StartBootTime) + if start == 0 && e.PS != nil { + start = e.PS.StartBootTime + } + seen[e.PID] = processInstance{pid: e.PID, startBootTime: start} + } + instances := make([]processInstance, 0, len(seen)) + for _, inst := range seen { + instances = append(instances, inst) + } + slices.SortFunc(instances, func(a, b processInstance) int { + return int(a.pid) - int(b.pid) + }) + return instances +} + +func pids(instances []processInstance) []event.PID { + p := make([]event.PID, 0, len(instances)) + for _, inst := range instances { + p = append(p, inst.pid) + } + return p +} + +func openPidfd(pid event.PID) (int, error) { + if pid > uint64(^uint32(0)>>1) { + return 0, fmt.Errorf("pid %d is out of range", pid) + } + return unix.PidfdOpen(int(pid), 0) +} + +func sendSignal(fd int, sig unix.Signal) error { + return unix.PidfdSendSignal(fd, sig, nil, 0) +} + +func readProcStartTicks(pid event.PID) (uint64, error) { + data, err := os.ReadFile(fmt.Sprintf("/proc/%d/stat", pid)) + if err != nil { + return 0, err + } + return parseProcStatStartTicks(data) +} + +// parseProcStatStartTicks extracts the starttime field from a /proc//stat +// record. The comm field is parenthesized and may itself contain spaces and +// parentheses, so the field split starts after its final delimiter. +func parseProcStatStartTicks(stat []byte) (uint64, error) { + i := bytes.LastIndexByte(stat, ')') + if i < 0 { + return 0, fmt.Errorf("malformed /proc stat: missing comm") + } + fields := bytes.Fields(stat[i+1:]) + // starttime is the 22nd field, which is index 19 once pid and comm are cut + if len(fields) < 20 { + return 0, fmt.Errorf("malformed /proc stat: too few fields") + } + ticks, err := strconv.ParseUint(string(fields[19]), 10, 64) + if err != nil { + return 0, fmt.Errorf("malformed /proc stat starttime: %w", err) + } + return ticks, nil +} + +func isGone(err error) bool { + return errors.Is(err, os.ErrNotExist) || errors.Is(err, unix.ESRCH) } diff --git a/pkg/rules/action/kill_linux_test.go b/pkg/rules/action/kill_linux_test.go new file mode 100644 index 000000000..b0bcd1c5a --- /dev/null +++ b/pkg/rules/action/kill_linux_test.go @@ -0,0 +1,301 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package action + +import ( + "fmt" + "os" + "os/exec" + "syscall" + "testing" + "time" + + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "golang.org/x/sys/unix" +) + +const ( + testPID = event.PID(4242) + testStartNs = uint64(1_234_500_000_000) + testStartTicks = testStartNs / nsecPerTick + testPidfd = 7 +) + +// recorder captures what a killer attempted so tests never signal a real process. +type recorder struct { + opened []event.PID + signaled []int + signals []unix.Signal + closed []int +} + +func (r *recorder) killer(ticks func(pid event.PID) (uint64, error)) killer { + return killer{ + open: func(pid event.PID) (int, error) { + r.opened = append(r.opened, pid) + return testPidfd, nil + }, + readStartTicks: ticks, + signal: func(fd int, sig unix.Signal) error { + r.signaled = append(r.signaled, fd) + r.signals = append(r.signals, sig) + return nil + }, + closeFD: func(fd int) error { + r.closed = append(r.closed, fd) + return nil + }, + } +} + +func constTicks(ticks uint64) func(event.PID) (uint64, error) { + return func(event.PID) (uint64, error) { return ticks, nil } +} + +func killEvent(pid event.PID, startNs uint64) *event.Event { + return &event.Event{ + Type: event.Execve, + Name: "execve", + Category: event.Process, + PID: pid, + PS: &pstypes.PS{ + PID: pid, + Name: "malware", + StartBootTime: startNs, + }, + Params: event.Params{ + params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: pid}, + params.StartBootTime: {Name: params.StartBootTime, Type: params.Uint64, Value: startNs}, + }, + } +} + +func killContext(evts ...*event.Event) *config.ActionContext { + return &config.ActionContext{Events: evts} +} + +func TestParseProcStatStartTicks(t *testing.T) { + stat := []byte("1 (systemd) S 0 1 1 0 -1 4194560 123 0 0 0 1 1 0 0 20 0 1 0 12345 123456 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n") + ticks, err := parseProcStatStartTicks(stat) + require.NoError(t, err) + assert.Equal(t, uint64(12345), ticks) + + // comm may contain spaces and parentheses + spaced := []byte("4242 (my (odd) process) S 1 4242 4242 0 -1 0 0 0 0 0 0 0 0 0 20 0 1 0 99 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n") + ticks, err = parseProcStatStartTicks(spaced) + require.NoError(t, err) + assert.Equal(t, uint64(99), ticks) + + _, err = parseProcStatStartTicks([]byte("1 systemd S 0 1")) + require.Error(t, err) + _, err = parseProcStatStartTicks([]byte("1 (systemd) S 0")) + require.Error(t, err) +} + +func TestReadProcStartTicks(t *testing.T) { + ticks, err := readProcStartTicks(event.PID(os.Getpid())) + require.NoError(t, err) + assert.Greater(t, ticks, uint64(0)) + + _, err = readProcStartTicks(event.PID(1 << 30)) + require.Error(t, err) + assert.True(t, isGone(err)) +} + +func TestKillSignalsMatchingInstance(t *testing.T) { + r := &recorder{} + k := r.killer(constTicks(testStartTicks)) + + require.NoError(t, k.kill(killContext(killEvent(testPID, testStartNs)))) + assert.Equal(t, []event.PID{testPID}, r.opened) + assert.Equal(t, []int{testPidfd}, r.signaled) + assert.Equal(t, []unix.Signal{unix.SIGKILL}, r.signals) + assert.Equal(t, []int{testPidfd}, r.closed) +} + +func TestKillPinsProcessBeforeRevalidating(t *testing.T) { + r := &recorder{} + var openedBeforeRead bool + k := r.killer(func(event.PID) (uint64, error) { + openedBeforeRead = len(r.opened) == 1 + return testStartTicks, nil + }) + + require.NoError(t, k.kill(killContext(killEvent(testPID, testStartNs)))) + assert.True(t, openedBeforeRead, "pidfd must be open before the start time is compared") +} + +func TestKillRefusesReusedPID(t *testing.T) { + r := &recorder{} + k := r.killer(constTicks(testStartTicks + 1)) + + err := k.kill(killContext(killEvent(testPID, testStartNs))) + require.Error(t, err) + assert.Contains(t, err.Error(), "process instance identity does not match") + assert.Empty(t, r.signaled) + assert.Equal(t, []int{testPidfd}, r.closed) +} + +func TestKillMissingProcessIsSuccess(t *testing.T) { + r := &recorder{} + k := r.killer(constTicks(testStartTicks)) + k.open = func(event.PID) (int, error) { return 0, unix.ESRCH } + + require.NoError(t, k.kill(killContext(killEvent(testPID, testStartNs)))) + assert.Empty(t, r.signaled) +} + +func TestKillProcessExitingDuringRevalidationIsSuccess(t *testing.T) { + r := &recorder{} + k := r.killer(func(event.PID) (uint64, error) { return 0, os.ErrNotExist }) + + require.NoError(t, k.kill(killContext(killEvent(testPID, testStartNs)))) + assert.Empty(t, r.signaled) + assert.Equal(t, []int{testPidfd}, r.closed) +} + +func TestKillESRCHOnSignalIsSuccess(t *testing.T) { + r := &recorder{} + k := r.killer(constTicks(testStartTicks)) + k.signal = func(int, unix.Signal) error { return unix.ESRCH } + + require.NoError(t, k.kill(killContext(killEvent(testPID, testStartNs)))) +} + +func TestKillRefusesMissingStartTime(t *testing.T) { + r := &recorder{} + k := r.killer(constTicks(testStartTicks)) + + evt := killEvent(testPID, 0) + evt.PS.StartBootTime = 0 + evt.Params.Remove(params.StartBootTime) + + err := k.kill(killContext(evt)) + require.Error(t, err) + assert.Contains(t, err.Error(), "missing process start time") + assert.Empty(t, r.opened) + assert.Empty(t, r.signaled) +} + +func TestKillUsesEventStartBootTimeWhenPSMissing(t *testing.T) { + r := &recorder{} + k := r.killer(constTicks(testStartTicks)) + + evt := killEvent(testPID, testStartNs) + evt.PS = nil + require.NoError(t, k.kill(killContext(evt))) + assert.Equal(t, []event.PID{testPID}, r.opened) +} + +// Clone events carry the child identity, so the event pid designates the +// process the rule matched on without consulting the pid parameter. +func TestKillResolvesCloneChildPid(t *testing.T) { + r := &recorder{} + k := r.killer(constTicks(testStartTicks)) + + clone := killEvent(testPID, testStartNs) + clone.Type = event.Clone + clone.Name = "clone" + clone.Params.Append(params.CloneFlags, params.Uint64, uint64(0)) + require.True(t, clone.IsCreateProcess()) + + require.NoError(t, k.kill(killContext(clone))) + assert.Equal(t, []event.PID{testPID}, r.opened) +} + +func TestKillDeduplicatesAndOrdersPids(t *testing.T) { + r := &recorder{} + k := r.killer(constTicks(testStartTicks)) + + err := k.kill(killContext( + killEvent(90, testStartNs), + killEvent(12, testStartNs), + killEvent(90, testStartNs), + )) + require.NoError(t, err) + assert.Equal(t, []event.PID{12, 90}, r.opened) +} + +func TestKillNilContext(t *testing.T) { + require.NoError(t, Kill(nil)) +} + +// TestKillTerminatesLiveProcess exercises the real pidfd and procfs path end to +// end, including the refusal branch when the captured start time disagrees. +func TestKillTerminatesLiveProcess(t *testing.T) { + start := func(t *testing.T) (event.PID, *exec.Cmd, uint64) { + t.Helper() + cmd := exec.Command("sleep", "300") + require.NoError(t, cmd.Start()) + t.Cleanup(func() { + _ = cmd.Process.Kill() + _, _ = cmd.Process.Wait() + }) + pid := event.PID(cmd.Process.Pid) + ticks, err := readProcStartTicks(pid) + require.NoError(t, err) + return pid, cmd, ticks * nsecPerTick + } + + t.Run("matching instance is terminated", func(t *testing.T) { + pid, cmd, startNs := start(t) + + require.NoError(t, Kill(killContext(killEvent(pid, startNs)))) + + state, err := cmd.Process.Wait() + require.NoError(t, err) + assert.Equal(t, syscall.SIGKILL, state.Sys().(syscall.WaitStatus).Signal()) + }) + + t.Run("mismatched instance is spared", func(t *testing.T) { + pid, _, startNs := start(t) + + err := Kill(killContext(killEvent(pid, startNs+uint64(time.Second)))) + require.Error(t, err) + assert.Contains(t, err.Error(), "process instance identity does not match") + + ticks, err := readProcStartTicks(pid) + require.NoError(t, err) + assert.Equal(t, startNs/nsecPerTick, ticks, "process should still be alive") + }) +} + +func TestOpenPidfdRejectsOutOfRangePid(t *testing.T) { + _, err := openPidfd(event.PID(1) << 40) + require.Error(t, err) + assert.Contains(t, err.Error(), "out of range") +} + +func TestKillReportsUnexpectedOpenError(t *testing.T) { + r := &recorder{} + k := r.killer(constTicks(testStartTicks)) + k.open = func(event.PID) (int, error) { return 0, fmt.Errorf("boom") } + + err := k.kill(killContext(killEvent(testPID, testStartNs))) + require.Error(t, err) + assert.Contains(t, err.Error(), "couldn't pin pid 4242") +} diff --git a/pkg/rules/action/kill_windows.go b/pkg/rules/action/kill_windows.go index 1b2bf830a..80da07678 100644 --- a/pkg/rules/action/kill_windows.go +++ b/pkg/rules/action/kill_windows.go @@ -23,13 +23,20 @@ import ( "os" "syscall" - "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/util/multierror" + log "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) -// Kill terminates all processes with specified pids. -func Kill(pids []event.PID) error { +// Kill terminates all processes referenced by the action context. +func Kill(ctx *config.ActionContext) error { + if ctx == nil { + return nil + } + pids := ctx.UniquePids() + log.Infof("killing pids=%v", pids) + errs := make([]error, 0) for _, pid := range pids { err := terminate(pid) diff --git a/pkg/rules/engine.go b/pkg/rules/engine.go index 618880af8..3c045d7ae 100644 --- a/pkg/rules/engine.go +++ b/pkg/rules/engine.go @@ -303,8 +303,8 @@ func (e *Engine) processActions() error { for _, act := range actions { switch t := act.(type) { case config.KillAction: - log.Infof("executing kill action: pids=%v rule=%s", m.ctx.UniquePids(), f.Name) - if err := action.Kill(m.ctx.UniquePids()); err != nil { + log.Infof("executing kill action: rule=%s", f.Name) + if err := action.Kill(m.ctx); err != nil { return ErrRuleAction(f.Name, err) } case config.IsolateAction: From c1d5e6100e1ffa0b6873edc1bac6d8cb31312f8e Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 21 Sep 2026 11:54:39 +0200 Subject: [PATCH 49/65] feat(rules): Add Linux macros and rules for execve, ptrace, kill, and connect Ship an initial Linux detection set in a dedicated tree so Windows packaging and rule validation stay on the Windows catalog. --- make.bat | 4 +- ...ontrol_interpreter_outbound_connection.yml | 32 +++++++++++ ...ense_evasion_process_traced_via_ptrace.yml | 27 +++++++++ ...cess_executed_from_temporary_directory.yml | 25 ++++++++ .../impact_process_terminated_via_sigkill.yml | 26 +++++++++ rules/linux/macros/macros.yml | 57 +++++++++++++++++++ 6 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 rules/linux/command_and_control_interpreter_outbound_connection.yml create mode 100644 rules/linux/defense_evasion_process_traced_via_ptrace.yml create mode 100644 rules/linux/execution_process_executed_from_temporary_directory.yml create mode 100644 rules/linux/impact_process_terminated_via_sigkill.yml create mode 100644 rules/linux/macros/macros.yml diff --git a/make.bat b/make.bat index 4ee340d22..5d89dba6b 100644 --- a/make.bat +++ b/make.bat @@ -119,7 +119,7 @@ copy /y ".\cmd\fibratus\fibratus.ico" "%RELEASE_DIR%\Bin" copy /y ".\configs\fibratus.yml" "%RELEASE_DIR%\Config\fibratus.yml" robocopy ".\filaments" "%RELEASE_DIR%\Filaments" /E /S /XF *.md /XD __pycache__ .idea -robocopy ".\rules" "%RELEASE_DIR%\Rules" /E /S /XF *.md *.png +robocopy ".\rules" "%RELEASE_DIR%\Rules" /E /S /XF *.md *.png /XD linux :: Download the embedded Python distribution echo Downloading Python %PYTHON_VER%... @@ -177,7 +177,7 @@ copy /y ".\cmd\systray\fibratus-systray.exe" "%RELEASE_DIR%\Bin" copy /y ".\cmd\fibratus\fibratus.ico" "%RELEASE_DIR%\Bin" copy /y ".\configs\fibratus.yml" "%RELEASE_DIR%\Config\fibratus.yml" -robocopy ".\rules" "%RELEASE_DIR%\Rules" /E /S /XF *.md *.png +robocopy ".\rules" "%RELEASE_DIR%\Rules" /E /S /XF *.md *.png /XD linux :: Copy Debug Help DLL copy %SystemRoot%\System32\dbghelp.dll "%RELEASE_DIR%\Bin" diff --git a/rules/linux/command_and_control_interpreter_outbound_connection.yml b/rules/linux/command_and_control_interpreter_outbound_connection.yml new file mode 100644 index 000000000..b6868d1e3 --- /dev/null +++ b/rules/linux/command_and_control_interpreter_outbound_connection.yml @@ -0,0 +1,32 @@ +name: Interpreter established an outbound connection +id: bf1a30dc-8e54-46c7-9b9c-28c3b7169129 +version: 1.0.0 +description: | + Identifies a script interpreter that executes and then opens an outbound + IP connection. This sequence is commonly used for reverse shells and + follow-on command and control after a dropper runs under bash, python, + or a similar interpreter. The socket families are AF_INET and AF_INET6, + so local UNIX domain sockets are out of scope. +labels: + tactic.id: TA0011 + tactic.name: Command and Control + tactic.ref: https://attack.mitre.org/tactics/TA0011/ + technique.id: T1071 + technique.name: Application Layer Protocol + technique.ref: https://attack.mitre.org/techniques/T1071/ +references: + - https://attack.mitre.org/techniques/T1071/ + +condition: > + sequence + maxspan 30s + by ps.uuid + |execve and ps.name in script_interpreters| + |connect and net.family in (2, 10) and net.dport != 0| + + +output: > + %1.ps.name connected to %2.net.dip:%2.net.dport after execution + +severity: high +min-engine-version: 3.0.0 diff --git a/rules/linux/defense_evasion_process_traced_via_ptrace.yml b/rules/linux/defense_evasion_process_traced_via_ptrace.yml new file mode 100644 index 000000000..3db43d734 --- /dev/null +++ b/rules/linux/defense_evasion_process_traced_via_ptrace.yml @@ -0,0 +1,27 @@ +name: Process traced via ptrace +id: 992bc26b-b4c2-47d8-bf76-e7fb895caa1e +version: 1.0.0 +description: | + Identifies a process attaching to another process with ptrace. + PTRACE_ATTACH and PTRACE_SEIZE are used to inspect or modify another + process, including for injection and credential theft. Requests denied + by the kernel also match, since a blocked attempt carries the same intent + and often precedes a privilege escalation attempt. +labels: + tactic.id: TA0005 + tactic.name: Defense Evasion + tactic.ref: https://attack.mitre.org/tactics/TA0005/ + technique.id: T1055 + technique.name: Process Injection + technique.ref: https://attack.mitre.org/techniques/T1055/ +references: + - https://man7.org/linux/man-pages/man2/ptrace.2.html + +condition: > + ptrace_attach and ps.target.pid != 0 and ps.target.pid != evt.pid + +output: > + %ps.name attached to process %ps.target.pid via ptrace + +severity: high +min-engine-version: 3.0.0 diff --git a/rules/linux/execution_process_executed_from_temporary_directory.yml b/rules/linux/execution_process_executed_from_temporary_directory.yml new file mode 100644 index 000000000..ecd5711f3 --- /dev/null +++ b/rules/linux/execution_process_executed_from_temporary_directory.yml @@ -0,0 +1,25 @@ +name: Process executed from a temporary directory +id: 640b10f4-e9ad-487d-a04a-917595ab93c4 +version: 1.0.0 +description: | + Identifies programs executed from world-writable temporary directories. + Adversaries stage payloads in /tmp, /var/tmp, or /dev/shm to avoid writing + into more tightly controlled filesystem locations. +labels: + tactic.id: TA0002 + tactic.name: Execution + tactic.ref: https://attack.mitre.org/tactics/TA0002/ + technique.id: T1059 + technique.name: Command and Scripting Interpreter + technique.ref: https://attack.mitre.org/techniques/T1059/ +references: + - https://attack.mitre.org/techniques/T1059/ + +condition: > + execve and ps.exe matches world_writable_exec_paths + +output: > + %ps.name executed %ps.exe from a world-writable directory + +severity: high +min-engine-version: 3.0.0 diff --git a/rules/linux/impact_process_terminated_via_sigkill.yml b/rules/linux/impact_process_terminated_via_sigkill.yml new file mode 100644 index 000000000..4c835d5fe --- /dev/null +++ b/rules/linux/impact_process_terminated_via_sigkill.yml @@ -0,0 +1,26 @@ +name: Process terminated via SIGKILL +id: cada79b8-9cfe-4ee9-8240-d3550e0859a7 +version: 1.0.0 +description: | + Identifies a process sending SIGKILL to a different process. + Adversaries use SIGKILL to stop security agents, terminate forensic + tools, or disrupt services that cannot catch the signal. Requests denied + by the kernel also match, since a blocked attempt carries the same intent. +labels: + tactic.id: TA0040 + tactic.name: Impact + tactic.ref: https://attack.mitre.org/tactics/TA0040/ + technique.id: T1489 + technique.name: Service Stop + technique.ref: https://attack.mitre.org/techniques/T1489/ +references: + - https://man7.org/linux/man-pages/man2/kill.2.html + +condition: > + sigkill and ps.target.pid != 0 and ps.target.pid != evt.pid + +output: > + %ps.name sent SIGKILL to process %ps.target.pid + +severity: medium +min-engine-version: 3.0.0 diff --git a/rules/linux/macros/macros.yml b/rules/linux/macros/macros.yml new file mode 100644 index 000000000..9b87619fc --- /dev/null +++ b/rules/linux/macros/macros.yml @@ -0,0 +1,57 @@ +- macro: execve + expr: evt.name = 'execve' and evt.retval = 0 + description: | + Matches a successful program execution. Failed execve calls are excluded + because no new program image is mapped. + +- macro: ptrace + expr: evt.name = 'ptrace' + description: | + Matches a ptrace request, whether or not the kernel permitted it. + +- macro: ptrace_attach + expr: ptrace and (ps.ptrace.request = 16 or ps.ptrace.request = 16902) + description: | + Matches a PTRACE_ATTACH (16) or PTRACE_SEIZE (16902) request. Denied + attempts are in scope because they reveal the same intent. + +- macro: send_signal + expr: evt.name = 'kill' + description: | + Matches a kill syscall, whether or not the signal was delivered. + +- macro: sigkill + expr: send_signal and ps.signal = 9 + description: | + Matches a SIGKILL request. Denied attempts are in scope because they + reveal the same intent. + +- macro: connect + expr: evt.name = 'connect' + description: | + Matches a socket connect syscall. Refused and unreachable destinations + are in scope because they still indicate outbound intent. + +- macro: world_writable_exec_paths + list: + - '/tmp/*' + - '/var/tmp/*' + - '/dev/shm/*' + description: | + Common world-writable directories used to stage and execute payloads. + +- macro: script_interpreters + list: + - bash + - sh + - dash + - zsh + - python + - python3 + - perl + - php + - ruby + - node + - lua + description: | + Script interpreter process names commonly used for staging outbound access. From 630f8559e510e480057221b40171a6960fd2a75e Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 21 Sep 2026 11:54:44 +0200 Subject: [PATCH 50/65] test(rules): Cover Linux detection compile, matches, and sequences Prove Linux types are indexed, shipped rules fire, sequence lifecycle matches, and shared field fixtures compile on both platforms. --- .github/workflows/linux-port.yml | 8 +- Makefile | 14 +- pkg/rules/_fixtures/kill_action_linux.yml | 7 + pkg/rules/_fixtures/shared/semantic_net.yml | 5 + .../_fixtures/shared/semantic_process.yml | 5 + pkg/rules/compiler_linux_test.go | 61 +++++ pkg/rules/compiler_windows_test.go | 1 + pkg/rules/engine_linux_test.go | 243 ++++++++++++++++++ pkg/rules/engine_windows_test.go | 27 ++ 9 files changed, 369 insertions(+), 2 deletions(-) create mode 100644 pkg/rules/_fixtures/kill_action_linux.yml create mode 100644 pkg/rules/_fixtures/shared/semantic_net.yml create mode 100644 pkg/rules/_fixtures/shared/semantic_process.yml diff --git a/.github/workflows/linux-port.yml b/.github/workflows/linux-port.yml index 68a0b432c..667ef3e8a 100644 --- a/.github/workflows/linux-port.yml +++ b/.github/workflows/linux-port.yml @@ -38,6 +38,12 @@ jobs: make -B ebpf git diff --exit-code -- internal/ebpf/bpf - name: Unit tests - run: go test ./internal/ebpf ./internal/bootstrap ./pkg/event ./pkg/ps ./pkg/api ./pkg/util/signals + run: make test + - name: Validate rules + run: | + make build + ./cmd/fibratus/fibratus rules validate \ + --filters.rules.from-paths="rules/linux/*.yml" \ + --filters.macros.from-paths="rules/linux/macros/*.yml" - name: Privileged process source run: sudo -E env "PATH=$PATH" go test -tags ebpf_integration -count=1 ./internal/ebpf diff --git a/Makefile b/Makefile index f2a352ba9..3d82486be 100644 --- a/Makefile +++ b/Makefile @@ -60,9 +60,21 @@ build: fmt: $(GOFMT) -e -s -l -w pkg cmd internal +TEST_PKGS := \ + ./internal/ebpf \ + ./internal/bootstrap \ + ./pkg/api \ + ./pkg/config \ + ./pkg/event \ + ./pkg/filter \ + ./pkg/ps \ + ./pkg/rules \ + ./pkg/rules/action \ + ./pkg/util/signals + .PHONY: test test: - $(GO) test ./internal/ebpf ./internal/bootstrap ./pkg/event ./pkg/ps ./pkg/api ./pkg/util/signals ./pkg/filter ./pkg/rules + $(GO) test $(TEST_PKGS) .PHONY: clean clean: diff --git a/pkg/rules/_fixtures/kill_action_linux.yml b/pkg/rules/_fixtures/kill_action_linux.yml new file mode 100644 index 000000000..46f117847 --- /dev/null +++ b/pkg/rules/_fixtures/kill_action_linux.yml @@ -0,0 +1,7 @@ +name: Kill process executed from a temporary directory +id: 33333333-3333-4333-8333-333333333333 +version: 1.0.0 +condition: evt.name = 'execve' and ps.exe imatches '/tmp/*' +action: + - name: kill +min-engine-version: 3.0.0 diff --git a/pkg/rules/_fixtures/shared/semantic_net.yml b/pkg/rules/_fixtures/shared/semantic_net.yml new file mode 100644 index 000000000..7039155b6 --- /dev/null +++ b/pkg/rules/_fixtures/shared/semantic_net.yml @@ -0,0 +1,5 @@ +name: match destination port +id: 22222222-2222-4222-8222-222222222222 +version: 1.0.0 +condition: evt.category = 'net' and net.dport = 443 +min-engine-version: 2.0.0 diff --git a/pkg/rules/_fixtures/shared/semantic_process.yml b/pkg/rules/_fixtures/shared/semantic_process.yml new file mode 100644 index 000000000..806e994e3 --- /dev/null +++ b/pkg/rules/_fixtures/shared/semantic_process.yml @@ -0,0 +1,5 @@ +name: match process category +id: 11111111-1111-4111-8111-111111111111 +version: 1.0.0 +condition: evt.category = 'process' +min-engine-version: 2.0.0 diff --git a/pkg/rules/compiler_linux_test.go b/pkg/rules/compiler_linux_test.go index 5ab4c325b..fdb2ba7ce 100644 --- a/pkg/rules/compiler_linux_test.go +++ b/pkg/rules/compiler_linux_test.go @@ -50,3 +50,64 @@ condition: evt.name = 'execve' and ps.name = 'bash' require.NotNil(t, result) require.True(t, result.HasProcEvents) } + +func TestCompilerShippedLinuxRules(t *testing.T) { + cfg := newLinuxConfig(filepath.Join("..", "..", "rules", "linux", "*.yml")) + filters, result, err := newCompiler(ps.NewSnapshotter(), cfg).compile() + require.NoError(t, err) + require.NotEmpty(t, filters) + require.NotNil(t, result) + require.True(t, result.HasProcEvents) + require.True(t, result.HasNetworkEvents) + + // every shipped rule carries the labels the rule validator warns about + for f := range filters { + for _, label := range []string{"tactic.id", "tactic.name", "tactic.ref", "technique.id", "technique.name", "technique.ref"} { + require.True(t, f.HasLabel(label), "%s is missing the %s label", f.Name, label) + } + } +} + +func TestCompilerSharedSemanticFixtures(t *testing.T) { + cfg := newLinuxConfig("_fixtures/shared/*.yml") + filters, result, err := newCompiler(ps.NewSnapshotter(), cfg).compile() + require.NoError(t, err) + require.Len(t, filters, 2) + require.NotNil(t, result) +} + +func TestCompilerRejectsWindowsEventNames(t *testing.T) { + rule := filepath.Join(t.TempDir(), "windows.yml") + require.NoError(t, os.WriteFile(rule, []byte(`name: Windows process execution +id: 5d17dc44-cc9f-4f13-9a31-23c6529ff46e +version: 1.0.0 +min-engine-version: 3.0.0 +condition: evt.name = 'CreateProcess' +`), 0o600)) + + cfg := &config.Config{ + Filters: &config.Filters{ + Rules: config.Rules{FromPaths: []string{rule}}, + }, + } + _, _, err := newCompiler(ps.NewSnapshotter(), cfg).compile() + require.EqualError(t, err, ErrUnknownEventName("Windows process execution", "CreateProcess").Error()) +} + +func TestCompilerRejectsDeprecatedFields(t *testing.T) { + rule := filepath.Join(t.TempDir(), "kevt.yml") + require.NoError(t, os.WriteFile(rule, []byte(`name: Deprecated field +id: 6d17dc44-cc9f-4f13-9a31-23c6529ff46e +version: 1.0.0 +min-engine-version: 3.0.0 +condition: kevt.name = 'execve' +`), 0o600)) + + cfg := &config.Config{ + Filters: &config.Filters{ + Rules: config.Rules{FromPaths: []string{rule}}, + }, + } + _, _, err := newCompiler(ps.NewSnapshotter(), cfg).compile() + require.Error(t, err) +} diff --git a/pkg/rules/compiler_windows_test.go b/pkg/rules/compiler_windows_test.go index b6df59ac8..48463fe30 100644 --- a/pkg/rules/compiler_windows_test.go +++ b/pkg/rules/compiler_windows_test.go @@ -84,6 +84,7 @@ func TestCompileEventCategoryFieldNames(t *testing.T) { {"_fixtures/field_values/incorrect_event_name_in_operator.yml", ErrUnknownEventName("match https connections", "CreateProc")}, {"_fixtures/field_values/correct_category_name_field.yml", nil}, {"_fixtures/field_values/incorrect_category_name_field.yml", ErrUnknownCategoryName("match https connections", "pipe")}, + {"_fixtures/shared/*.yml", nil}, } for _, tt := range tests { diff --git a/pkg/rules/engine_linux_test.go b/pkg/rules/engine_linux_test.go index 5d514a30f..30d7090ed 100644 --- a/pkg/rules/engine_linux_test.go +++ b/pkg/rules/engine_linux_test.go @@ -7,6 +7,7 @@ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 @@ -21,16 +22,258 @@ package rules import ( + "net" + "path/filepath" "testing" + "time" + "github.com/rabbitstack/fibratus/pkg/alertsender" "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" "github.com/rabbitstack/fibratus/pkg/ps" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) +type mockNoneSender struct{} + +func (s *mockNoneSender) Send(alertsender.Alert) error { return nil } +func (s *mockNoneSender) Type() alertsender.Type { return alertsender.None } +func (s *mockNoneSender) Shutdown() error { return nil } +func (s *mockNoneSender) SupportsMarkdown() bool { return true } + +func makeNoneSender(alertsender.Config) (alertsender.Sender, error) { + return &mockNoneSender{}, nil +} + +func init() { + alertsender.Register(alertsender.None, makeNoneSender) +} + +func newLinuxConfig(fromFiles ...string) *config.Config { + return &config.Config{ + EventSource: config.EventSourceConfig{ + EnableFileIOEvents: true, + EnableNetEvents: true, + EnableMemEvents: true, + }, + Filters: &config.Filters{ + Rules: config.Rules{ + FromPaths: fromFiles, + }, + Macros: config.Macros{ + FromPaths: []string{filepath.Join("..", "..", "rules", "linux", "macros", "*")}, + }, + }, + } +} + +func compileRules(t *testing.T, e *Engine) *config.RulesCompileResult { + t.Helper() + rs, err := e.Compile() + require.NoError(t, err) + require.NotNil(t, rs) + return rs +} + +func processEvent(t *testing.T, e *Engine, evt *event.Event) bool { + t.Helper() + match, err := e.ProcessEvent(evt) + require.NoError(t, err) + return match +} + +func testPS(name, exe string, pid uint64, start uint64) *pstypes.PS { + return &pstypes.PS{ + PID: pid, + Ppid: 1, + Name: name, + Cmdline: exe, + Exe: exe, + StartBootTime: start, + Parent: &pstypes.PS{PID: 1, Name: "systemd", StartBootTime: 1}, + } +} + func TestNewEngineAcceptsSnapshotter(t *testing.T) { cfg := &config.Config{Filters: &config.Filters{}} e := NewEngine(ps.NewSnapshotter(), cfg) require.NotNil(t, e) require.NotNil(t, e.compiler) } + +func TestCompileIndexesLinuxTypesAndCategories(t *testing.T) { + e := NewEngine(ps.NewSnapshotter(), newLinuxConfig( + filepath.Join("..", "..", "rules", "linux", "*.yml"), + "_fixtures/shared/*.yml", + )) + rs := compileRules(t, e) + + require.True(t, rs.HasProcEvents) + require.True(t, rs.HasNetworkEvents) + assert.Contains(t, rs.UsedEvents, event.Execve) + assert.Contains(t, rs.UsedEvents, event.Ptrace) + assert.Contains(t, rs.UsedEvents, event.Kill) + assert.Contains(t, rs.UsedEvents, event.Connect) + + assert.NotEmpty(t, e.filters.types[event.Execve]) + assert.NotEmpty(t, e.filters.types[event.Ptrace]) + assert.NotEmpty(t, e.filters.types[event.Kill]) + assert.NotEmpty(t, e.filters.types[event.Connect]) + assert.NotEmpty(t, e.filters.categories[event.Process.Index()]) + assert.NotEmpty(t, e.filters.categories[event.Net.Index()]) +} + +func TestRunLinuxDetectionRules(t *testing.T) { + require.NoError(t, alertsender.LoadAll([]alertsender.Config{{Type: alertsender.None}})) + + e := NewEngine(ps.NewSnapshotter(), newLinuxConfig(filepath.Join("..", "..", "rules", "linux", "*.yml"))) + compileRules(t, e) + + tmpPS := testPS("dropper", "/tmp/dropper", 4242, 200) + execTmp := &event.Event{ + Type: event.Execve, + Name: "execve", + Category: event.Process, + PID: 4242, + Timestamp: time.Now(), + PS: tmpPS, + Params: event.Params{ + params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: uint64(4242)}, + params.Exe: {Name: params.Exe, Type: params.Path, Value: "/tmp/dropper"}, + params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(0)}, + }, + Metadata: make(map[event.MetadataKey]any), + } + require.True(t, processEvent(t, e, execTmp)) + + ptrace := &event.Event{ + Type: event.Ptrace, + Name: "ptrace", + Category: event.Process, + PID: 4242, + Timestamp: time.Now(), + PS: testPS("injector", "/usr/bin/injector", 4242, 200), + Params: event.Params{ + params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: uint64(4242)}, + params.PtraceRequest: {Name: params.PtraceRequest, Type: params.Int64, Value: int64(16)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + }, + Metadata: make(map[event.MetadataKey]any), + } + require.True(t, processEvent(t, e, ptrace)) + + sigkill := &event.Event{ + Type: event.Kill, + Name: "kill", + Category: event.Process, + PID: 4242, + Timestamp: time.Now(), + PS: testPS("killer", "/usr/bin/killer", 4242, 200), + Params: event.Params{ + params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: uint64(4242)}, + params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + }, + Metadata: make(map[event.MetadataKey]any), + } + require.True(t, processEvent(t, e, sigkill)) + + selfKill := &event.Event{ + Type: event.Kill, + Name: "kill", + Category: event.Process, + PID: 4242, + Timestamp: time.Now(), + PS: testPS("killer", "/usr/bin/killer", 4242, 200), + Params: event.Params{ + params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: uint64(4242)}, + params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(4242)}, + }, + Metadata: make(map[event.MetadataKey]any), + } + require.False(t, processEvent(t, e, selfKill)) +} + +func TestLinuxLifecycleSequence(t *testing.T) { + require.NoError(t, alertsender.LoadAll([]alertsender.Config{{Type: alertsender.None}})) + + e := NewEngine(ps.NewSnapshotter(), newLinuxConfig(filepath.Join("..", "..", "rules", "linux", "command_and_control_interpreter_outbound_connection.yml"))) + compileRules(t, e) + + ps := testPS("bash", "/bin/bash", 4242, 200) + execve := &event.Event{ + Seq: 1, + Type: event.Execve, + Name: "execve", + Category: event.Process, + PID: 4242, + Timestamp: time.Now(), + PS: ps, + Params: event.Params{ + params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: uint64(4242)}, + params.Exe: {Name: params.Exe, Type: params.Path, Value: "/bin/bash"}, + params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(0)}, + }, + Metadata: make(map[event.MetadataKey]any), + } + connect := &event.Event{ + Seq: 2, + Type: event.Connect, + Name: "connect", + Category: event.Net, + PID: 4242, + Timestamp: time.Now().Add(time.Second), + PS: ps, + Params: event.Params{ + params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: uint64(4242)}, + params.SockFamily: {Name: params.SockFamily, Type: params.Uint16, Value: uint16(2)}, + params.NetDIP: {Name: params.NetDIP, Type: params.IPv4, Value: net.IPv4(1, 2, 3, 4).To4()}, + params.NetDport: {Name: params.NetDport, Type: params.Port, Value: uint16(4444)}, + }, + Metadata: make(map[event.MetadataKey]any), + } + + require.False(t, processEvent(t, e, execve)) + require.True(t, processEvent(t, e, connect)) +} + +func TestSharedSemanticRuleFixtures(t *testing.T) { + require.NoError(t, alertsender.LoadAll([]alertsender.Config{{Type: alertsender.None}})) + + e := NewEngine(ps.NewSnapshotter(), newLinuxConfig("_fixtures/shared/*.yml")) + compileRules(t, e) + + proc := &event.Event{ + Type: event.Execve, + Name: "execve", + Category: event.Process, + PID: 7, + PS: testPS("bash", "/bin/bash", 7, 10), + Params: event.Params{}, + Metadata: make(map[event.MetadataKey]any), + } + netevt := &event.Event{ + Type: event.Connect, + Name: "connect", + Category: event.Net, + PID: 7, + PS: testPS("bash", "/bin/bash", 7, 10), + Params: event.Params{ + params.NetDport: {Name: params.NetDport, Type: params.Port, Value: uint16(443)}, + }, + Metadata: make(map[event.MetadataKey]any), + } + + require.True(t, processEvent(t, e, proc)) + require.True(t, processEvent(t, e, netevt)) +} + +func TestCompileKillActionRule(t *testing.T) { + e := NewEngine(ps.NewSnapshotter(), newLinuxConfig("_fixtures/kill_action_linux.yml")) + compileRules(t, e) + assert.NotEmpty(t, e.filters.types[event.Execve]) +} diff --git a/pkg/rules/engine_windows_test.go b/pkg/rules/engine_windows_test.go index 19cef6c04..52bde3447 100644 --- a/pkg/rules/engine_windows_test.go +++ b/pkg/rules/engine_windows_test.go @@ -176,6 +176,33 @@ func TestRunSimpleRules(t *testing.T) { } } +func TestSharedSemanticRuleFixtures(t *testing.T) { + e := NewEngine(new(ps.SnapshotterMock), newConfig("_fixtures/shared/*.yml")) + compileRules(t, e) + + proc := &event.Event{ + Type: event.CreateProcess, + Name: "CreateProcess", + Category: event.Process, + PID: 859, + Params: event.Params{}, + Metadata: make(map[event.MetadataKey]any), + } + netevt := &event.Event{ + Type: event.RecvTCPv4, + Name: "Recv", + Category: event.Net, + PID: 859, + Params: event.Params{ + params.NetDport: {Name: params.NetDport, Type: params.Uint16, Value: uint16(443)}, + }, + Metadata: make(map[event.MetadataKey]any), + } + + require.True(t, wrapProcessEvent(proc, e.ProcessEvent)) + require.True(t, wrapProcessEvent(netevt, e.ProcessEvent)) +} + func TestRunSequenceRule(t *testing.T) { log.SetLevel(log.DebugLevel) From 27249b21fbe49b32be1c7fd77208e94e2685dcc7 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 21 Sep 2026 12:28:37 +0200 Subject: [PATCH 51/65] fix(ebpf): Preserve the pid_t sign of signal and trace targets The kill, ptrace, and process_vm target was truncated through uint32 and widened as unsigned, so kill(-1) surfaced as 4294967295. Carry the argument as a signed value and expose ps.target.pid and mem.target.pid as signed, so a process group or broadcast target stays distinguishable from a process identifier. --- internal/ebpf/events.go | 6 +-- internal/ebpf/events_test.go | 36 +++++++++++++++++ pkg/filter/accessor_linux.go | 4 +- pkg/filter/fields/defs_linux.go | 4 +- pkg/filter/filter_linux_test.go | 40 ++++++++++++++++--- pkg/rules/engine_linux_test.go | 6 +-- .../impact_process_terminated_via_sigkill.yml | 8 +++- 7 files changed, 87 insertions(+), 17 deletions(-) diff --git a/internal/ebpf/events.go b/internal/ebpf/events.go index ec78e5add..761325283 100644 --- a/internal/ebpf/events.go +++ b/internal/ebpf/events.go @@ -164,16 +164,16 @@ func (r rawEvent) toEvent() *event.Event { evt.Params.Append(params.FD, params.Int64, int64(r.Arg3)) evt.Params.Append(params.MmapOffset, params.Uint64, r.Arg0) case event.ProcessVMRead, event.ProcessVMWrite: - evt.Params.Append(params.TargetProcessID, params.PID, uint64(uint32(r.Arg0))) + evt.Params.Append(params.TargetProcessID, params.Int64, int64(int32(r.Arg0))) evt.Params.Append(params.MemBaseAddress, params.Address, r.Arg2) evt.Params.Append(params.MemRegionSize, params.Uint64, r.Arg3) evt.Params.Append(params.MmapFlags, params.Uint64, r.Flags) case event.Kill: - evt.Params.Append(params.TargetProcessID, params.PID, uint64(uint32(r.Arg0))) + evt.Params.Append(params.TargetProcessID, params.Int64, int64(int32(r.Arg0))) evt.Params.Append(params.Signal, params.Int32, int32(r.Arg1)) case event.Ptrace: evt.Params.Append(params.PtraceRequest, params.Int64, int64(r.Arg0)) - evt.Params.Append(params.TargetProcessID, params.PID, uint64(uint32(r.Arg1))) + evt.Params.Append(params.TargetProcessID, params.Int64, int64(int32(r.Arg1))) evt.Params.Append(params.PtraceAddr, params.Address, r.Arg2) evt.Params.Append(params.PtraceData, params.Uint64, r.Arg3) case event.Prctl: diff --git a/internal/ebpf/events_test.go b/internal/ebpf/events_test.go index da221ec6c..9c7524433 100644 --- a/internal/ebpf/events_test.go +++ b/internal/ebpf/events_test.go @@ -146,3 +146,39 @@ func TestSucceededHelper(t *testing.T) { evt.Params.Append(params.Retval, params.Int64, int64(-2)) assert.False(t, succeeded(evt)) } + +// The first argument of kill is a pid_t whose sign selects the scope of the +// signal, so it must survive the conversion to an event parameter. +func TestSignalTargetKeepsPidSign(t *testing.T) { + var tests = []struct { + name string + arg0 uint64 + want int64 + }{ + {"single process", 4242, 4242}, + {"caller process group", 0, 0}, + {"every permitted process", uint64(^uint32(0)), -1}, + {"process group", uint64(uint32(0xFFFFEF6E)), -4242}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + evt := rawEvent{Type: uint32(event.Kill), Arg0: tt.arg0, Arg1: 9}.toEvent() + target, err := evt.Params.GetInt64(params.TargetProcessID) + require.NoError(t, err) + assert.Equal(t, tt.want, target) + }) + } +} + +func TestPtraceAndProcessVMTargetsAreSigned(t *testing.T) { + ptrace := rawEvent{Type: uint32(event.Ptrace), Arg0: 16, Arg1: 4242}.toEvent() + target, err := ptrace.Params.GetInt64(params.TargetProcessID) + require.NoError(t, err) + assert.Equal(t, int64(4242), target) + + vmread := rawEvent{Type: uint32(event.ProcessVMRead), Arg0: 4242}.toEvent() + target, err = vmread.Params.GetInt64(params.TargetProcessID) + require.NoError(t, err) + assert.Equal(t, int64(4242), target) +} diff --git a/pkg/filter/accessor_linux.go b/pkg/filter/accessor_linux.go index 100f6e41d..3c61eb9b6 100644 --- a/pkg/filter/accessor_linux.go +++ b/pkg/filter/accessor_linux.go @@ -214,7 +214,7 @@ func (a *psAccessor) Get(f Field, e *event.Event) (params.Value, error) { } return int64(sig), nil case fields.PsTargetPID: - return e.Params.GetUint64(params.TargetProcessID) + return e.Params.GetInt64(params.TargetProcessID) case fields.PsPtraceRequest: return e.Params.GetInt64(params.PtraceRequest) case fields.PsPrctlOption: @@ -308,7 +308,7 @@ func (*memAccessor) Get(f Field, e *event.Event) (params.Value, error) { case fields.MemMmapOffset: return e.Params.GetUint64(params.MmapOffset) case fields.MemTargetPID: - return e.Params.GetUint64(params.TargetProcessID) + return e.Params.GetInt64(params.TargetProcessID) default: return nil, nil } diff --git a/pkg/filter/fields/defs_linux.go b/pkg/filter/fields/defs_linux.go index f4f569596..26e643df2 100644 --- a/pkg/filter/fields/defs_linux.go +++ b/pkg/filter/fields/defs_linux.go @@ -43,7 +43,7 @@ var fields = platformFields(map[Field]FieldInfo{ PsParentUsername: {PsParentUsername, "parent process username", platformString(), []string{"ps.parent.username = 'root'"}, nil, nil}, PsParentEnvs: {PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('PATH:/usr/bin')"}, nil, nil}, PsSignal: {PsSignal, "POSIX signal number", params.Int64, []string{"ps.signal = 9"}, nil, nil}, - PsTargetPID: {PsTargetPID, "target process identifier of kill, ptrace, or process_vm operations", params.Uint64, []string{"ps.target.pid = 4242"}, nil, nil}, + PsTargetPID: {PsTargetPID, "target process identifier of kill, ptrace, or process_vm operations. Signal targets keep the pid_t sign, where zero is the caller process group, -1 is every permitted process, and any other negative value is the process group of its absolute value", params.Int64, []string{"ps.target.pid = 4242", "ps.target.pid < 0"}, nil, nil}, PsPtraceRequest: {PsPtraceRequest, "ptrace request code", params.Int64, []string{"ps.ptrace.request = 16"}, nil, nil}, PsPrctlOption: {PsPrctlOption, "prctl option code", params.Int64, []string{"ps.prctl.option = 15"}, nil, nil}, PsCloneFlags: {PsCloneFlags, "clone flags bitmask", params.Uint64, []string{"ps.clone_flags = 0"}, nil, nil}, @@ -69,7 +69,7 @@ var fields = platformFields(map[Field]FieldInfo{ MemMmapFlags: {MemMmapFlags, "mmap flags bitmask", params.Uint64, []string{"mem.mmap.flags = 1"}, nil, nil}, MemMmapFD: {MemMmapFD, "file descriptor backing a mapping", params.Int64, []string{"mem.mmap.fd = 3"}, nil, nil}, MemMmapOffset: {MemMmapOffset, "file offset of a memory mapping", params.Uint64, []string{"mem.mmap.offset = 0"}, nil, nil}, - MemTargetPID: {MemTargetPID, "target process identifier of a process_vm operation", params.Uint64, []string{"mem.target.pid = 4242"}, nil, nil}, + MemTargetPID: {MemTargetPID, "target process identifier of a process_vm operation", params.Int64, []string{"mem.target.pid = 4242"}, nil, nil}, ThreadTID: {ThreadTID, "thread identifier", params.Uint64, []string{"thread.tid = 1024"}, nil, nil}, ThreadPID: {ThreadPID, "thread group identifier of the thread", params.Uint64, []string{"thread.pid = 1024"}, nil, nil}, }) diff --git a/pkg/filter/filter_linux_test.go b/pkg/filter/filter_linux_test.go index 77e074279..4370c5e76 100644 --- a/pkg/filter/filter_linux_test.go +++ b/pkg/filter/filter_linux_test.go @@ -204,11 +204,34 @@ func TestProcFilter(t *testing.T) { PID: 4242, PS: ps, Params: event.Params{ - params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(99)}, params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}, params.Retval: {Name: params.Retval, Type: params.Int64, Value: int64(0)}, }, } + // kill accepts a pid_t whose sign selects the scope of the signal + broadcastKill := &event.Event{ + Type: event.Kill, + Category: event.Process, + Name: "kill", + PID: 4242, + PS: ps, + Params: event.Params{ + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(-1)}, + params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}, + }, + } + groupKill := &event.Event{ + Type: event.Kill, + Category: event.Process, + Name: "kill", + PID: 4242, + PS: ps, + Params: event.Params{ + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(-4242)}, + params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}, + }, + } ptrace := &event.Event{ Type: event.Ptrace, Category: event.Process, @@ -217,7 +240,7 @@ func TestProcFilter(t *testing.T) { PS: ps, Params: event.Params{ params.PtraceRequest: {Name: params.PtraceRequest, Type: params.Int64, Value: int64(16)}, - params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(99)}, }, } prctl := &event.Event{ @@ -272,6 +295,11 @@ func TestProcFilter(t *testing.T) { {execve, `evt.arg[exe] = '/bin/bash'`, true}, {kill, `ps.signal = 9`, true}, {kill, `ps.target.pid = 99`, true}, + {kill, `ps.target.pid > 0`, true}, + {kill, `ps.target.pid < 0`, false}, + {broadcastKill, `ps.target.pid < 0`, true}, + {broadcastKill, `ps.target.pid > 0`, false}, + {groupKill, `ps.target.pid < 0`, true}, {ptrace, `ps.ptrace.request = 16`, true}, {ptrace, `ps.target.pid = 99`, true}, {prctl, `ps.prctl.option = 15`, true}, @@ -413,7 +441,7 @@ func TestMemFilter(t *testing.T) { Name: "process_vm_readv", PID: 4242, Params: event.Params{ - params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(99)}, params.MemBaseAddress: {Name: params.MemBaseAddress, Type: params.Address, Value: uint64(4096)}, params.MemRegionSize: {Name: params.MemRegionSize, Type: params.Uint64, Value: uint64(16)}, }, @@ -424,7 +452,7 @@ func TestMemFilter(t *testing.T) { Name: "process_vm_writev", PID: 4242, Params: event.Params{ - params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(77)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(77)}, params.MemBaseAddress: {Name: params.MemBaseAddress, Type: params.Address, Value: uint64(4096)}, }, } @@ -541,8 +569,8 @@ func TestEveryLinuxEventType(t *testing.T) { {&event.Event{Type: event.Connect, Category: event.Net, Name: "connect", PS: ps, Params: event.Params{params.NetDport: {Name: params.NetDport, Type: params.Port, Value: uint16(443)}}}, `net.dport = 443`}, {&event.Event{Type: event.Accept, Category: event.Net, Name: "accept", PS: ps, Params: event.Params{params.NetSport: {Name: params.NetSport, Type: params.Port, Value: uint16(80)}}}, `net.sport = 80`}, {&event.Event{Type: event.Mmap, Category: event.Mem, Name: "mmap", PS: ps, Params: event.Params{params.MemRegionSize: {Name: params.MemRegionSize, Type: params.Uint64, Value: uint64(4096)}}}, `mem.size = 4096`}, - {&event.Event{Type: event.ProcessVMRead, Category: event.Mem, Name: "process_vm_readv", PS: ps, Params: event.Params{params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(9)}}}, `mem.target.pid = 9`}, - {&event.Event{Type: event.ProcessVMWrite, Category: event.Mem, Name: "process_vm_writev", PS: ps, Params: event.Params{params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(8)}}}, `mem.target.pid = 8`}, + {&event.Event{Type: event.ProcessVMRead, Category: event.Mem, Name: "process_vm_readv", PS: ps, Params: event.Params{params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(9)}}}, `mem.target.pid = 9`}, + {&event.Event{Type: event.ProcessVMWrite, Category: event.Mem, Name: "process_vm_writev", PS: ps, Params: event.Params{params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(8)}}}, `mem.target.pid = 8`}, {&event.Event{Type: event.Kill, Category: event.Process, Name: "kill", PS: ps, Params: event.Params{params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}}}, `ps.signal = 9`}, {&event.Event{Type: event.Ptrace, Category: event.Process, Name: "ptrace", PS: ps, Params: event.Params{params.PtraceRequest: {Name: params.PtraceRequest, Type: params.Int64, Value: int64(16)}}}, `ps.ptrace.request = 16`}, {&event.Event{Type: event.Prctl, Category: event.Process, Name: "prctl", PS: ps, Params: event.Params{params.PrctlOption: {Name: params.PrctlOption, Type: params.Int64, Value: int64(15)}}}, `ps.prctl.option = 15`}, diff --git a/pkg/rules/engine_linux_test.go b/pkg/rules/engine_linux_test.go index 30d7090ed..932d75c12 100644 --- a/pkg/rules/engine_linux_test.go +++ b/pkg/rules/engine_linux_test.go @@ -159,7 +159,7 @@ func TestRunLinuxDetectionRules(t *testing.T) { Params: event.Params{ params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: uint64(4242)}, params.PtraceRequest: {Name: params.PtraceRequest, Type: params.Int64, Value: int64(16)}, - params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(99)}, }, Metadata: make(map[event.MetadataKey]any), } @@ -175,7 +175,7 @@ func TestRunLinuxDetectionRules(t *testing.T) { Params: event.Params{ params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: uint64(4242)}, params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}, - params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(99)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(99)}, }, Metadata: make(map[event.MetadataKey]any), } @@ -191,7 +191,7 @@ func TestRunLinuxDetectionRules(t *testing.T) { Params: event.Params{ params.ProcessID: {Name: params.ProcessID, Type: params.PID, Value: uint64(4242)}, params.Signal: {Name: params.Signal, Type: params.Int32, Value: int32(9)}, - params.TargetProcessID: {Name: params.TargetProcessID, Type: params.PID, Value: uint64(4242)}, + params.TargetProcessID: {Name: params.TargetProcessID, Type: params.Int64, Value: int64(4242)}, }, Metadata: make(map[event.MetadataKey]any), } diff --git a/rules/linux/impact_process_terminated_via_sigkill.yml b/rules/linux/impact_process_terminated_via_sigkill.yml index 4c835d5fe..e2d5d5256 100644 --- a/rules/linux/impact_process_terminated_via_sigkill.yml +++ b/rules/linux/impact_process_terminated_via_sigkill.yml @@ -6,6 +6,12 @@ description: | Adversaries use SIGKILL to stop security agents, terminate forensic tools, or disrupt services that cannot catch the signal. Requests denied by the kernel also match, since a blocked attempt carries the same intent. + + The target keeps the pid_t sign of the syscall argument, so a negative + target denotes a process group and -1 denotes every process the caller is + permitted to signal. Narrow this rule with ps.target.pid < 0 to look only + for those broader terminations. Signals a process sends to its own group + are out of scope. labels: tactic.id: TA0040 tactic.name: Impact @@ -20,7 +26,7 @@ condition: > sigkill and ps.target.pid != 0 and ps.target.pid != evt.pid output: > - %ps.name sent SIGKILL to process %ps.target.pid + %ps.name sent SIGKILL to target %ps.target.pid severity: medium min-engine-version: 3.0.0 From 99d831c90090d45be9baf76d8099c6cd544284be Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 21 Sep 2026 16:05:36 +0200 Subject: [PATCH 52/65] feat(filter): Extract conservative equality, list, and prefix prefilters --- pkg/filter/approver.go | 569 +++++++++++++++++++++++++ pkg/filter/approver_fuzz_linux_test.go | 114 +++++ pkg/filter/approver_linux.go | 36 ++ pkg/filter/approver_linux_test.go | 140 ++++++ pkg/filter/approver_windows.go | 27 ++ pkg/rules/compiler.go | 27 ++ pkg/rules/compiler_linux_test.go | 68 ++- pkg/rules/engine.go | 10 + 8 files changed, 990 insertions(+), 1 deletion(-) create mode 100644 pkg/filter/approver.go create mode 100644 pkg/filter/approver_fuzz_linux_test.go create mode 100644 pkg/filter/approver_linux.go create mode 100644 pkg/filter/approver_linux_test.go create mode 100644 pkg/filter/approver_windows.go diff --git a/pkg/filter/approver.go b/pkg/filter/approver.go new file mode 100644 index 000000000..12b4bb42e --- /dev/null +++ b/pkg/filter/approver.go @@ -0,0 +1,569 @@ +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +import ( + "slices" + "strconv" + "strings" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/filter/fields" + "github.com/rabbitstack/fibratus/pkg/filter/ql" +) + +// ApproverProvider is an optional filter capability that exposes a +// conservative, kernel-safe extraction of positive predicates. Filters +// that do not implement it are treated as unextractable, which forces +// default-allow for every event type they could match. +type ApproverProvider interface { + ApproverExtraction() Extraction +} + +// Extraction is the conservative predicate set taken from one compiled +// filter. Unsupported is set when the AST contains a shape that cannot +// be proven as a superset of matches (OR, NOT, inequality, regex, range, +// function, bound field, or sequence). +type Extraction struct { + Unsupported bool + Types []event.Type + TypesScoped bool + PIDs []uint64 + FileExact []string + FilePrefix []string + Ports []uint16 +} + +// TypePolicy is the in-kernel prefilter for one event type. DefaultAllow +// means userspace must see every event of that type. Otherwise an event +// must satisfy every required field, matching the union of allowed values. +type TypePolicy struct { + DefaultAllow bool + RequirePID bool + RequireFilename bool + RequirePort bool + PIDs []uint64 + FileExact []string + FilePrefix []string + Ports []uint16 +} + +// ApproverPlan is a platform-neutral description of per-type prefilters. +// It is derived from compiled filters and is not stored on RulesCompileResult, +// which remains a usage summary. +type ApproverPlan struct { + policies map[event.Type]TypePolicy +} + +// Sample is the subset of event fields the in-kernel approver can observe. +type Sample struct { + Type event.Type + PID uint64 + Filename string + Port uint16 + Truncated bool +} + +// AllowAllPlan returns a plan that never drops events. +func AllowAllPlan() *ApproverPlan { + return &ApproverPlan{policies: map[event.Type]TypePolicy{}} +} + +// PlanFromFilter builds a plan from a single compiled filter, typically the CLI +// expression supplied through SetFilter. +func PlanFromFilter(f Filter) *ApproverPlan { + if f == nil { + return AllowAllPlan() + } + return BuildApproverPlan([]Filter{f}) +} + +// BuildApproverPlan unions extractable predicates across filters. A type is +// default-allow when any applicable filter is unextractable, when no filter +// applies, or when the applicable filters do not share a required field. +func BuildApproverPlan(filters []Filter) *ApproverPlan { + plan := AllowAllPlan() + if len(filters) == 0 { + return plan + } + + byType := make(map[event.Type][]Extraction) + blocked := make(map[event.Type]bool) + + for _, f := range filters { + provider, ok := f.(ApproverProvider) + if !ok { + for _, typ := range event.All() { + blocked[typ] = true + } + continue + } + ex := provider.ApproverExtraction() + types := scopedTypes(ex) + if ex.Unsupported { + for _, typ := range types { + blocked[typ] = true + } + continue + } + for _, typ := range types { + byType[typ] = append(byType[typ], ex) + } + } + + for _, typ := range event.All() { + if blocked[typ] || len(byType[typ]) == 0 { + plan.policies[typ] = TypePolicy{DefaultAllow: true} + continue + } + plan.policies[typ] = policyFromClauses(byType[typ]) + } + return plan +} + +// Union combines plans by intersecting required fields and unioning their +// allowed values. Any default-allow policy wins, which is the safe direction. +func Union(plans ...*ApproverPlan) *ApproverPlan { + var out *ApproverPlan + for _, p := range plans { + if p == nil { + continue + } + if out == nil { + out = clonePlan(p) + continue + } + for _, typ := range event.All() { + out.policies[typ] = unionPolicy(out.Policy(typ), p.Policy(typ)) + } + } + if out == nil { + return AllowAllPlan() + } + return out +} + +// Policy returns the prefilter for an event type. Missing types default-allow. +func (p *ApproverPlan) Policy(t event.Type) TypePolicy { + if p == nil || p.policies == nil { + return TypePolicy{DefaultAllow: true} + } + pol, ok := p.policies[t] + if !ok { + return TypePolicy{DefaultAllow: true} + } + return pol +} + +// Allows reports whether the kernel prefilter would keep the sample. A true +// userspace match must always produce true here; false positives are allowed. +func (p *ApproverPlan) Allows(s Sample) bool { + if AlwaysAllowed(s.Type) { + return true + } + pol := p.Policy(s.Type) + if pol.DefaultAllow { + return true + } + if pol.RequirePID && !slices.Contains(pol.PIDs, s.PID) { + return false + } + if pol.RequireFilename && !s.Truncated && !matchFilename(pol, s.Filename) { + return false + } + if pol.RequirePort && !slices.Contains(pol.Ports, s.Port) { + return false + } + return true +} + +var _ ApproverProvider = (*filter)(nil) + +func (f *filter) ApproverExtraction() Extraction { + if f.seq != nil { + // Sequence matching is stateful: an early stage has to reach userspace + // for a later one to ever fire, so no stage can be prefiltered. Scope + // the block to the event names and categories in the filter's string + // fields, which is the same set rules.Engine indexes the sequence by, + // so the approver and the engine cannot disagree about which types can + // reach the rule. + ex := Extraction{Unsupported: true, TypesScoped: true} + ex.Types = typesFromStringFields(f.stringFields) + return ex + } + return extractFromExpr(f.expr) +} + +// typesFromStringFields mirrors the event name and category indexing performed +// by rules.Engine.Compile. +func typesFromStringFields(stringFields map[fields.Field][]string) []event.Type { + var types []event.Type + for _, name := range stringFields[fields.EvtName] { + types = append(types, event.NameToTypes(name)...) + } + for _, name := range stringFields[fields.EvtCategory] { + if !event.IsCategoryKnown(name) { + continue + } + cat := event.Category(name) + for _, typ := range event.All() { + if typ.Category() == cat { + types = append(types, typ) + } + } + } + return uniqueTypes(types) +} + +func extractFromExpr(root ql.Node) Extraction { + var ex Extraction + if root == nil { + ex.Unsupported = true + return ex + } + ql.WalkFunc(root, func(n ql.Node) { + switch node := n.(type) { + case *ql.NotExpr, *ql.Function: + ex.Unsupported = true + case *ql.BinaryExpr: + extractBinary(&ex, node) + } + }) + ex.Types = uniqueTypes(ex.Types) + ex.PIDs = uniqueUint64(ex.PIDs) + ex.FileExact = uniqueStrings(ex.FileExact) + ex.FilePrefix = uniqueStrings(ex.FilePrefix) + ex.Ports = uniqueUint16(ex.Ports) + return ex +} + +func extractBinary(ex *Extraction, expr *ql.BinaryExpr) { + switch expr.Op { + case ql.And: + return + case ql.Or: + ex.Unsupported = true + return + } + + lhs, ok := expr.LHS.(*ql.FieldLiteral) + if !ok { + ex.Unsupported = true + return + } + if _, ok := expr.RHS.(*ql.BoundFieldLiteral); ok { + ex.Unsupported = true + return + } + + switch lhs.Field { + case fields.EvtName: + extractEventNames(ex, expr) + case fields.EvtCategory: + extractCategories(ex, expr) + case fields.EvtPID, fields.PsPid: + extractPIDs(ex, expr) + case fields.FilePath: + extractFilenames(ex, expr) + case fields.NetDport: + extractPorts(ex, expr) + default: + // ps.name is deliberately absent. The only process name the kernel can + // read cheaply is the live task comm, while ps.name is snapshot state + // captured at execve. They diverge under prctl(PR_SET_NAME) and when + // the snapshot falls back to an executable basename longer than comm's + // 16 bytes, either of which would drop a matching event. + ex.Unsupported = true + } +} + +func extractEventNames(ex *Extraction, expr *ql.BinaryExpr) { + if expr.Op != ql.Eq && expr.Op != ql.In { + ex.Unsupported = true + return + } + names, ok := rhsStrings(expr.RHS) + if !ok { + ex.Unsupported = true + return + } + ex.TypesScoped = true + for _, name := range names { + typ := event.NameToType(name) + if typ == event.UnknownType { + continue + } + ex.Types = append(ex.Types, typ) + } +} + +func extractCategories(ex *Extraction, expr *ql.BinaryExpr) { + if expr.Op != ql.Eq && expr.Op != ql.In { + ex.Unsupported = true + return + } + names, ok := rhsStrings(expr.RHS) + if !ok { + ex.Unsupported = true + return + } + ex.TypesScoped = true + for _, name := range names { + if !event.IsCategoryKnown(name) { + continue + } + cat := event.Category(name) + for _, typ := range event.All() { + if typ.Category() == cat { + ex.Types = append(ex.Types, typ) + } + } + } +} + +func extractPIDs(ex *Extraction, expr *ql.BinaryExpr) { + if expr.Op != ql.Eq && expr.Op != ql.In { + ex.Unsupported = true + return + } + nums, ok := rhsUint64(expr.RHS) + if !ok { + ex.Unsupported = true + return + } + ex.PIDs = append(ex.PIDs, nums...) +} + +func extractFilenames(ex *Extraction, expr *ql.BinaryExpr) { + switch expr.Op { + case ql.Eq, ql.In: + names, ok := rhsStrings(expr.RHS) + if !ok { + ex.Unsupported = true + return + } + ex.FileExact = append(ex.FileExact, names...) + case ql.Startswith: + names, ok := rhsStrings(expr.RHS) + if !ok { + ex.Unsupported = true + return + } + for _, name := range names { + if name == "" { + continue + } + ex.FilePrefix = append(ex.FilePrefix, name) + } + default: + ex.Unsupported = true + } +} + +func extractPorts(ex *Extraction, expr *ql.BinaryExpr) { + if expr.Op != ql.Eq && expr.Op != ql.In { + ex.Unsupported = true + return + } + nums, ok := rhsUint64(expr.RHS) + if !ok { + ex.Unsupported = true + return + } + for _, n := range nums { + if n > 65535 { + ex.Unsupported = true + return + } + ex.Ports = append(ex.Ports, uint16(n)) + } +} + +// scopedTypes resolves which event types an extraction speaks for. An +// extraction that names no event type at all covers every type, which is right +// for a CLI filter because the source evaluates it against every event. Rules +// are not in that position: rules.Engine discards a rule without an event name +// or category, so the compiler keeps unscoped rules out of the plan entirely +// rather than letting their predicates constrain anything here. +func scopedTypes(ex Extraction) []event.Type { + if len(ex.Types) > 0 { + return uniqueTypes(ex.Types) + } + if ex.TypesScoped { + return nil + } + return event.All() +} + +func policyFromClauses(clauses []Extraction) TypePolicy { + reqPID, reqFile, reqPort := true, true, true + for _, c := range clauses { + if len(c.PIDs) == 0 { + reqPID = false + } + if len(c.FileExact)+len(c.FilePrefix) == 0 { + reqFile = false + } + if len(c.Ports) == 0 { + reqPort = false + } + } + if !reqPID && !reqFile && !reqPort { + return TypePolicy{DefaultAllow: true} + } + pol := TypePolicy{ + RequirePID: reqPID, + RequireFilename: reqFile, + RequirePort: reqPort, + } + for _, c := range clauses { + if reqPID { + pol.PIDs = append(pol.PIDs, c.PIDs...) + } + if reqFile { + pol.FileExact = append(pol.FileExact, c.FileExact...) + pol.FilePrefix = append(pol.FilePrefix, c.FilePrefix...) + } + if reqPort { + pol.Ports = append(pol.Ports, c.Ports...) + } + } + pol.PIDs = uniqueUint64(pol.PIDs) + pol.FileExact = uniqueStrings(pol.FileExact) + pol.FilePrefix = uniqueStrings(pol.FilePrefix) + pol.Ports = uniqueUint16(pol.Ports) + return pol +} + +func unionPolicy(a, b TypePolicy) TypePolicy { + if a.DefaultAllow || b.DefaultAllow { + return TypePolicy{DefaultAllow: true} + } + reqPID := a.RequirePID && b.RequirePID + reqFile := a.RequireFilename && b.RequireFilename + reqPort := a.RequirePort && b.RequirePort + if !reqPID && !reqFile && !reqPort { + return TypePolicy{DefaultAllow: true} + } + pol := TypePolicy{ + RequirePID: reqPID, + RequireFilename: reqFile, + RequirePort: reqPort, + } + if reqPID { + pol.PIDs = uniqueUint64(append(append([]uint64{}, a.PIDs...), b.PIDs...)) + } + if reqFile { + pol.FileExact = uniqueStrings(append(append([]string{}, a.FileExact...), b.FileExact...)) + pol.FilePrefix = uniqueStrings(append(append([]string{}, a.FilePrefix...), b.FilePrefix...)) + } + if reqPort { + pol.Ports = uniqueUint16(append(append([]uint16{}, a.Ports...), b.Ports...)) + } + return pol +} + +func clonePlan(p *ApproverPlan) *ApproverPlan { + out := AllowAllPlan() + for typ, pol := range p.policies { + out.policies[typ] = pol + } + return out +} + +func matchFilename(pol TypePolicy, path string) bool { + if slices.Contains(pol.FileExact, path) { + return true + } + for _, prefix := range pol.FilePrefix { + if strings.HasPrefix(path, prefix) { + return true + } + } + return false +} + +func rhsStrings(n ql.Node) ([]string, bool) { + switch v := n.(type) { + case *ql.StringLiteral: + return []string{v.Value}, true + case *ql.ListLiteral: + return v.Values, true + } + return nil, false +} + +func rhsUint64(n ql.Node) ([]uint64, bool) { + switch v := n.(type) { + case *ql.IntegerLiteral: + if v.Value < 0 { + return nil, false + } + return []uint64{uint64(v.Value)}, true + case *ql.UnsignedLiteral: + return []uint64{v.Value}, true + case *ql.StringLiteral: + n, err := strconv.ParseUint(v.Value, 10, 64) + if err != nil { + return nil, false + } + return []uint64{n}, true + case *ql.ListLiteral: + out := make([]uint64, 0, len(v.Values)) + for _, s := range v.Values { + n, err := strconv.ParseUint(s, 10, 64) + if err != nil { + return nil, false + } + out = append(out, n) + } + return out, true + } + return nil, false +} + +func uniqueTypes(in []event.Type) []event.Type { + return unique(in, func(a, b event.Type) bool { return a == b }) +} + +func uniqueUint64(in []uint64) []uint64 { + return unique(in, func(a, b uint64) bool { return a == b }) +} + +func uniqueUint16(in []uint16) []uint16 { + return unique(in, func(a, b uint16) bool { return a == b }) +} + +func uniqueStrings(in []string) []string { + return unique(in, func(a, b string) bool { return a == b }) +} + +func unique[T any](in []T, eq func(T, T) bool) []T { + if len(in) == 0 { + return nil + } + out := make([]T, 0, len(in)) + for _, v := range in { + if slices.ContainsFunc(out, func(e T) bool { return eq(e, v) }) { + continue + } + out = append(out, v) + } + return out +} diff --git a/pkg/filter/approver_fuzz_linux_test.go b/pkg/filter/approver_fuzz_linux_test.go new file mode 100644 index 000000000..910bd6b5a --- /dev/null +++ b/pkg/filter/approver_fuzz_linux_test.go @@ -0,0 +1,114 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" + "github.com/stretchr/testify/require" +) + +// fuzzExprs mixes extractable shapes with shapes that must fall back to +// default-allow, so the property holds across both paths. +var fuzzExprs = []string{ + "evt.name = 'openat' and file.path startswith '/tmp'", + "evt.name = 'openat' and file.path = '/etc/passwd'", + "evt.name = 'openat' and file.path in ('/tmp/a', '/tmp/b') and ps.pid = 42", + "evt.name in ('openat', 'connect') and ps.pid in (1, 42)", + "evt.category = 'file' and file.path startswith '/var'", + "evt.name = 'connect' and net.dport in (80, 443)", + "evt.name = 'connect' and net.dport = 443 and ps.pid = 42", + "evt.name = 'kill' and ps.pid = 42", + "evt.name = 'openat' and file.path != '/tmp/x'", + "evt.name = 'openat' and not (file.path = '/tmp/x')", + "evt.name = 'openat' and (ps.pid = 1 or file.path = '/tmp/x')", + "evt.name = 'openat' and file.path matches '/tmp/*'", + "evt.name = 'openat' and ps.name = 'bash'", + "file.path startswith '/tmp'", + "ps.pid = 42", +} + +var fuzzTypes = []event.Type{ + event.Openat, event.Connect, event.Kill, event.Execve, event.Mmap, event.Accept, +} + +func fuzzEvent(typ event.Type, pid uint64, path string, port uint16) *event.Event { + evt := &event.Event{ + Type: typ, + Category: typ.Category(), + Name: typ.String(), + PID: pid, + PS: &pstypes.PS{PID: pid, Name: "fuzz", Exe: "/bin/fuzz"}, + Params: event.Params{}, + } + switch typ { + case event.Openat, event.Unlink, event.Rename: + evt.Params[params.FilePath] = &event.Param{Name: params.FilePath, Type: params.Path, Value: path} + case event.Connect: + evt.Params[params.NetDport] = &event.Param{Name: params.NetDport, Type: params.Port, Value: port} + case event.Accept: + evt.Params[params.NetSport] = &event.Param{Name: params.NetSport, Type: params.Port, Value: port} + } + return evt +} + +// FuzzApproverNoFalseNegatives is the core soundness property: whatever the +// userspace filter matches, the in-kernel prefilter must also keep. +func FuzzApproverNoFalseNegatives(f *testing.F) { + f.Add(0, 0, uint64(42), "/tmp/payload", uint16(443)) + f.Add(2, 1, uint64(1), "/var/tmp/x", uint16(80)) + f.Add(5, 3, uint64(0), "/etc/passwd", uint16(22)) + f.Add(8, 2, uint64(4242), "", uint16(0)) + + compiled := make([]Filter, len(fuzzExprs)) + plans := make([]*ApproverPlan, len(fuzzExprs)) + for i, expr := range fuzzExprs { + compiled[i] = mustCompileApprover(f, expr) + plans[i] = PlanFromFilter(compiled[i]) + } + + f.Fuzz(func(t *testing.T, exprIdx, typeIdx int, pid uint64, path string, port uint16) { + i := abs(exprIdx) % len(compiled) + typ := fuzzTypes[abs(typeIdx)%len(fuzzTypes)] + + evt := fuzzEvent(typ, pid, path, port) + if !compiled[i].Eval(evt) { + return + } + sample := Sample{Type: typ, PID: pid, Port: port} + if typ == event.Openat || typ == event.Unlink || typ == event.Rename { + sample.Filename = path + } + require.True(t, plans[i].Allows(sample), + "prefilter dropped a userspace match: expr=%q type=%s pid=%d path=%q port=%d", + fuzzExprs[i], typ, pid, path, port) + }) +} + +func abs(n int) int { + if n < 0 { + return -n - 1 + } + return n +} diff --git a/pkg/filter/approver_linux.go b/pkg/filter/approver_linux.go new file mode 100644 index 000000000..3d1f80037 --- /dev/null +++ b/pkg/filter/approver_linux.go @@ -0,0 +1,36 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +import "github.com/rabbitstack/fibratus/pkg/event" + +// AlwaysAllowed reports event types the process snapshotter consumes. Dropping +// one in the kernel would desynchronize process identity from live tasks, so no +// prefilter is ever installed for them regardless of what the rules ask for. +// Mirrored by the leading check in event_approved in c/common/approvers.h. +func AlwaysAllowed(t event.Type) bool { + switch t { + case event.Execve, event.Exit, event.Clone, event.UnknownType: + return true + default: + return false + } +} diff --git a/pkg/filter/approver_linux_test.go b/pkg/filter/approver_linux_test.go new file mode 100644 index 000000000..8d60a95ea --- /dev/null +++ b/pkg/filter/approver_linux_test.go @@ -0,0 +1,140 @@ +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func compileApprover(t *testing.T, expr string) Filter { + t.Helper() + return mustCompileApprover(t, expr) +} + +func mustCompileApprover(tb testing.TB, expr string) Filter { + tb.Helper() + f := New(expr, &config.Config{ + EventSource: config.EventSourceConfig{ + EnableFileIOEvents: true, + EnableNetEvents: true, + EnableMemEvents: true, + }, + Filters: &config.Filters{}, + }) + require.NoError(tb, f.Compile(), expr) + return f +} + +func TestExtractEqualityListPrefix(t *testing.T) { + f := compileApprover(t, "evt.name = 'openat' and file.path startswith '/tmp' and ps.pid in (1, 42)") + ex := f.(ApproverProvider).ApproverExtraction() + require.False(t, ex.Unsupported) + assert.Equal(t, []event.Type{event.Openat}, ex.Types) + assert.ElementsMatch(t, []uint64{1, 42}, ex.PIDs) + assert.Equal(t, []string{"/tmp"}, ex.FilePrefix) +} + +func TestExtractPortList(t *testing.T) { + f := compileApprover(t, "evt.name = 'connect' and net.dport in (80, 443)") + ex := f.(ApproverProvider).ApproverExtraction() + require.False(t, ex.Unsupported) + assert.Equal(t, []uint16{80, 443}, ex.Ports) +} + +func TestExtractUnsupportedShapesDefaultAllow(t *testing.T) { + cases := []string{ + "evt.name = 'openat' and file.path != '/etc/passwd'", + "evt.name = 'openat' and not (file.path = '/etc/passwd')", + "evt.name = 'openat' and (ps.pid = 1 or file.path = '/tmp/x')", + "evt.name = 'openat' and file.path matches '/tmp/*'", + "evt.name = 'openat' and ps.pid > 1", + "evt.name = 'openat' and lower(file.path) = '/tmp/x'", + `sequence +|evt.name = 'execve'| +|evt.name = 'connect'|`, + } + for _, expr := range cases { + f := compileApprover(t, expr) + plan := PlanFromFilter(f) + assert.True(t, plan.Policy(event.Openat).DefaultAllow || plan.Policy(event.Connect).DefaultAllow || plan.Policy(event.Execve).DefaultAllow, expr) + } + + orPlan := PlanFromFilter(compileApprover(t, "evt.name = 'openat' and (ps.pid = 1 or file.path = '/tmp/x')")) + assert.True(t, orPlan.Policy(event.Openat).DefaultAllow) + + seqPlan := PlanFromFilter(compileApprover(t, `sequence +|evt.name = 'execve'| +|evt.name = 'connect'|`)) + assert.True(t, seqPlan.Policy(event.Execve).DefaultAllow) + assert.True(t, seqPlan.Policy(event.Connect).DefaultAllow) +} + +// ps.name is snapshot state while the kernel can only read the live task comm, +// so a process name predicate must never narrow the in-kernel prefilter. +func TestProcessNameIsNotExtractable(t *testing.T) { + plan := PlanFromFilter(compileApprover(t, "evt.name = 'openat' and ps.name = 'bash'")) + assert.True(t, plan.Policy(event.Openat).DefaultAllow) + + mixed := PlanFromFilter(compileApprover(t, "evt.name = 'openat' and ps.name = 'bash' and file.path startswith '/tmp'")) + assert.True(t, mixed.Policy(event.Openat).DefaultAllow) +} + +func TestBuildPlanIntersectsRequiredFields(t *testing.T) { + pid := compileApprover(t, "evt.name = 'openat' and ps.pid = 7") + path := compileApprover(t, "evt.name = 'openat' and file.path startswith '/tmp'") + mixed := BuildApproverPlan([]Filter{pid, path}) + assert.True(t, mixed.Policy(event.Openat).DefaultAllow, "different required fields cannot be ANDed across rules") + + a := compileApprover(t, "evt.name = 'openat' and file.path startswith '/tmp'") + b := compileApprover(t, "evt.name = 'openat' and file.path startswith '/var'") + union := BuildApproverPlan([]Filter{a, b}) + pol := union.Policy(event.Openat) + require.False(t, pol.DefaultAllow) + assert.True(t, pol.RequireFilename) + assert.ElementsMatch(t, []string{"/tmp", "/var"}, pol.FilePrefix) +} + +func TestAllowsNeverFalseNegative(t *testing.T) { + f := compileApprover(t, "evt.name = 'openat' and file.path startswith '/tmp' and ps.pid = 42") + plan := PlanFromFilter(f) + + keep := Sample{Type: event.Openat, PID: 42, Filename: "/tmp/payload"} + drop := Sample{Type: event.Openat, PID: 7, Filename: "/etc/passwd"} + assert.True(t, plan.Allows(keep)) + assert.False(t, plan.Allows(drop)) + assert.True(t, plan.Allows(Sample{Type: event.Openat, PID: 42, Filename: "/tmp", Truncated: true})) +} + +func TestUnionCLIAndRules(t *testing.T) { + rules := PlanFromFilter(compileApprover(t, "evt.name = 'connect' and net.dport in (80, 443)")) + cli := PlanFromFilter(compileApprover(t, "evt.name = 'connect' and net.dport = 443")) + combined := Union(rules, cli) + pol := combined.Policy(event.Connect) + require.False(t, pol.DefaultAllow) + assert.True(t, pol.RequirePort) + assert.ElementsMatch(t, []uint16{80, 443}, pol.Ports) + assert.True(t, combined.Allows(Sample{Type: event.Connect, Port: 80})) + assert.True(t, combined.Allows(Sample{Type: event.Connect, Port: 443})) + assert.False(t, combined.Allows(Sample{Type: event.Connect, Port: 22})) +} diff --git a/pkg/filter/approver_windows.go b/pkg/filter/approver_windows.go new file mode 100644 index 000000000..36f674911 --- /dev/null +++ b/pkg/filter/approver_windows.go @@ -0,0 +1,27 @@ +//go:build windows + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package filter + +import "github.com/rabbitstack/fibratus/pkg/event" + +// AlwaysAllowed has no Windows counterpart because the ETW source does its own +// approver work in internal/etw/approvers. +func AlwaysAllowed(event.Type) bool { return false } diff --git a/pkg/rules/compiler.go b/pkg/rules/compiler.go index bd320eec8..8c3a84d6b 100644 --- a/pkg/rules/compiler.go +++ b/pkg/rules/compiler.go @@ -61,6 +61,7 @@ type compiler struct { psnap ps.Snapshotter config *config.Config approvers config.Approvers + plan *filter.ApproverPlan } func newCompiler(psnap ps.Snapshotter, cfg *config.Config) *compiler { @@ -151,6 +152,7 @@ func (c *compiler) compile() (map[*config.FilterConfig]filter.Filter, *config.Ru } if len(filters) == 0 { + c.plan = filter.AllowAllPlan() return filters, nil, nil } @@ -159,9 +161,34 @@ func (c *compiler) compile() (map[*config.FilterConfig]filter.Filter, *config.Ru r.Approvers = c.approvers } + providers := make([]filter.Filter, 0, len(filters)) + for _, fltr := range filters { + if !isApproverScoped(fltr) { + continue + } + providers = append(providers, fltr) + } + c.plan = filter.BuildApproverPlan(providers) + return filters, r, nil } +func isApproverScoped(f filter.Filter) bool { + for name := range f.GetStringFields() { + if name == fields.EvtName || name == fields.EvtCategory { + return true + } + } + return false +} + +func (c *compiler) ApproverPlan() *filter.ApproverPlan { + if c == nil || c.plan == nil { + return filter.AllowAllPlan() + } + return c.plan +} + func (c *compiler) visitApproverPredicates(node ql.Node) { walk := func(n ql.Node) { expr, ok := n.(*ql.BinaryExpr) diff --git a/pkg/rules/compiler_linux_test.go b/pkg/rules/compiler_linux_test.go index fdb2ba7ce..351280417 100644 --- a/pkg/rules/compiler_linux_test.go +++ b/pkg/rules/compiler_linux_test.go @@ -26,6 +26,7 @@ import ( "testing" "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" "github.com/rabbitstack/fibratus/pkg/ps" "github.com/stretchr/testify/require" ) @@ -51,9 +52,35 @@ condition: evt.name = 'execve' and ps.name = 'bash' require.True(t, result.HasProcEvents) } +func TestCompilerExtractableApproverPlan(t *testing.T) { + rule := filepath.Join(t.TempDir(), "openat.yml") + require.NoError(t, os.WriteFile(rule, []byte(`name: Temporary file open +id: 7c1c2d3e-4f5a-6789-abcd-ef0123456789 +version: 1.0.0 +min-engine-version: 3.0.0 +condition: evt.name = 'openat' and file.path startswith '/tmp' +`), 0o600)) + + cfg := &config.Config{ + EventSource: config.EventSourceConfig{EnableFileIOEvents: true}, + Filters: &config.Filters{ + Rules: config.Rules{FromPaths: []string{rule}}, + }, + } + c := newCompiler(ps.NewSnapshotter(), cfg) + _, result, err := c.compile() + require.NoError(t, err) + require.NotNil(t, result) + pol := c.ApproverPlan().Policy(event.Openat) + require.False(t, pol.DefaultAllow) + require.True(t, pol.RequireFilename) + require.Equal(t, []string{"/tmp"}, pol.FilePrefix) +} + func TestCompilerShippedLinuxRules(t *testing.T) { cfg := newLinuxConfig(filepath.Join("..", "..", "rules", "linux", "*.yml")) - filters, result, err := newCompiler(ps.NewSnapshotter(), cfg).compile() + c := newCompiler(ps.NewSnapshotter(), cfg) + filters, result, err := c.compile() require.NoError(t, err) require.NotEmpty(t, filters) require.NotNil(t, result) @@ -66,6 +93,45 @@ func TestCompilerShippedLinuxRules(t *testing.T) { require.True(t, f.HasLabel(label), "%s is missing the %s label", f.Name, label) } } + + plan := c.ApproverPlan() + require.True(t, plan.Policy(event.Execve).DefaultAllow) + require.True(t, plan.Policy(event.Connect).DefaultAllow) + require.True(t, plan.Policy(event.Ptrace).DefaultAllow) + require.True(t, plan.Policy(event.Kill).DefaultAllow) +} + +// The approver scopes a sequence rule to the event names and categories in its +// string fields, on the assumption that the engine indexes the sequence by that +// same set and so never evaluates a stage against any other type. Pin it here: +// if indexing ever widens, the approver would under-block and drop events a +// sequence stage needs. +func TestEngineIndexesSequenceByStringFieldTypes(t *testing.T) { + rule := filepath.Join(t.TempDir(), "sequence.yml") + require.NoError(t, os.WriteFile(rule, []byte(`name: Execve then unscoped stage +id: 8e2f1a5b-3c4d-4e6f-8a9b-0c1d2e3f4a5b +version: 1.0.0 +min-engine-version: 3.0.0 +condition: > + sequence + maxspan 1m + |evt.name = 'execve'| + |ps.pid = 5| +`), 0o600)) + + cfg := newLinuxConfig(rule) + e := NewEngine(ps.NewSnapshotter(), cfg) + _, err := e.Compile() + require.NoError(t, err) + + require.Len(t, e.filters.types[event.Execve], 1, "sequence must be indexed under execve") + for _, typ := range event.All() { + if typ == event.Execve { + continue + } + require.Empty(t, e.filters.types[typ], "sequence must not be indexed under %s", typ) + } + require.Empty(t, e.filters.categories, "sequence names no category") } func TestCompilerSharedSemanticFixtures(t *testing.T) { diff --git a/pkg/rules/engine.go b/pkg/rules/engine.go index 3c045d7ae..b6ac00c0b 100644 --- a/pkg/rules/engine.go +++ b/pkg/rules/engine.go @@ -146,6 +146,16 @@ func NewEngine(psnap ps.Snapshotter, config *config.Config) *Engine { return e } +// ApproverPlan returns the conservative in-kernel prefilter derived from the +// compiled ruleset. RulesCompileResult stays a usage summary and is not used +// as predicate data. +func (e *Engine) ApproverPlan() *filter.ApproverPlan { + if e == nil || e.compiler == nil { + return filter.AllowAllPlan() + } + return e.compiler.ApproverPlan() +} + func (e *Engine) gcSequences() { for { <-e.scavenger.C From a2b08a79cb376f952d95e9128017edd04fa92847 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 21 Sep 2026 16:05:36 +0200 Subject: [PATCH 53/65] feat(ebpf): Prefilter syscalls with versioned in-kernel maps --- internal/ebpf/approver.go | 257 ++++++++++++++++++++++++++++ internal/ebpf/bpf/clone_bpfeb.go | 78 +++++++-- internal/ebpf/bpf/clone_bpfeb.o | Bin 45224 -> 47720 bytes internal/ebpf/bpf/clone_bpfel.go | 78 +++++++-- internal/ebpf/bpf/clone_bpfel.o | Bin 44840 -> 47336 bytes internal/ebpf/bpf/ctl_bpfeb.go | 78 +++++++-- internal/ebpf/bpf/ctl_bpfeb.o | Bin 22168 -> 48016 bytes internal/ebpf/bpf/ctl_bpfel.go | 78 +++++++-- internal/ebpf/bpf/ctl_bpfel.o | Bin 21784 -> 47632 bytes internal/ebpf/bpf/execve_bpfeb.go | 78 +++++++-- internal/ebpf/bpf/execve_bpfeb.o | Bin 22792 -> 25296 bytes internal/ebpf/bpf/execve_bpfel.go | 78 +++++++-- internal/ebpf/bpf/execve_bpfel.o | Bin 22600 -> 25104 bytes internal/ebpf/bpf/exit_bpfeb.go | 78 +++++++-- internal/ebpf/bpf/exit_bpfeb.o | Bin 7904 -> 10432 bytes internal/ebpf/bpf/exit_bpfel.go | 78 +++++++-- internal/ebpf/bpf/exit_bpfel.o | Bin 7904 -> 10432 bytes internal/ebpf/bpf/file_bpfeb.go | 78 +++++++-- internal/ebpf/bpf/file_bpfeb.o | Bin 77944 -> 167576 bytes internal/ebpf/bpf/file_bpfel.go | 78 +++++++-- internal/ebpf/bpf/file_bpfel.o | Bin 77176 -> 166808 bytes internal/ebpf/bpf/mem_bpfeb.go | 78 +++++++-- internal/ebpf/bpf/mem_bpfeb.o | Bin 32248 -> 68248 bytes internal/ebpf/bpf/mem_bpfel.go | 78 +++++++-- internal/ebpf/bpf/mem_bpfel.o | Bin 31960 -> 67960 bytes internal/ebpf/bpf/net_bpfeb.go | 78 +++++++-- internal/ebpf/bpf/net_bpfeb.o | Bin 33632 -> 70208 bytes internal/ebpf/bpf/net_bpfel.go | 78 +++++++-- internal/ebpf/bpf/net_bpfel.o | Bin 33344 -> 69920 bytes internal/ebpf/bpf/prociter_bpfeb.go | 78 +++++++-- internal/ebpf/bpf/prociter_bpfeb.o | Bin 7160 -> 9696 bytes internal/ebpf/bpf/prociter_bpfel.go | 78 +++++++-- internal/ebpf/bpf/prociter_bpfel.o | Bin 7160 -> 9696 bytes internal/ebpf/c/common/approvers.h | 237 +++++++++++++++++++++++++ internal/ebpf/c/common/events.h | 24 +++ internal/ebpf/doc.go | 6 +- internal/ebpf/loader.go | 8 +- internal/ebpf/maps.go | 29 +++- 38 files changed, 1635 insertions(+), 174 deletions(-) create mode 100644 internal/ebpf/approver.go create mode 100644 internal/ebpf/c/common/approvers.h diff --git a/internal/ebpf/approver.go b/internal/ebpf/approver.go new file mode 100644 index 000000000..854494964 --- /dev/null +++ b/internal/ebpf/approver.go @@ -0,0 +1,257 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "fmt" + + "github.com/cilium/ebpf" + "github.com/rabbitstack/fibratus/internal/ebpf/bpf" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/filter" +) + +func (l *loader) populateApprovers(plan *filter.ApproverPlan) error { + if l == nil || l.exec == nil { + return fmt.Errorf("approver maps are not loaded") + } + if plan == nil { + plan = filter.AllowAllPlan() + } + + cur, err := l.approverGen() + if err != nil { + return err + } + inactive := uint32(1) - cur + if err := l.clearGeneration(inactive); err != nil { + return fmt.Errorf("clearing inactive approver generation: %w", err) + } + if err := l.writePlan(inactive, plan); err != nil { + return err + } + // The retired generation is left populated on purpose. A program that read + // the old generation before the flip still resolves its lookups against it; + // wiping it here would turn those in-flight events into drops. The next + // reload clears it before reusing it. + if err := l.exec.ApproverGen.Put(uint32(0), inactive); err != nil { + return fmt.Errorf("flipping approver generation: %w", err) + } + return nil +} + +func (l *loader) approverGen() (uint32, error) { + var key, gen uint32 + if err := l.exec.ApproverGen.Lookup(&key, &gen); err != nil { + return 0, fmt.Errorf("reading approver generation: %w", err) + } + return gen & 1, nil +} + +func (l *loader) approverRejects() uint64 { + var key uint32 + var n uint64 + if l.exec == nil || l.exec.ApproverReject == nil { + return 0 + } + _ = l.exec.ApproverReject.Lookup(&key, &n) + return n +} + +func (l *loader) writePlan(gen uint32, plan *filter.ApproverPlan) error { + for i := uint32(0); i < approverTypeMax; i++ { + key := gen*approverTypeMax + i + typ := event.Type(i) + pol := plan.Policy(typ) + mode := policyMode(pol, typ) + if err := l.exec.ApproverMode.Put(&key, &mode); err != nil { + return fmt.Errorf("writing approver mode for type %d: %w", i, err) + } + if mode == 0 { + continue + } + if err := l.writePolicy(gen, typ, pol); err != nil { + return err + } + } + return nil +} + +func policyMode(pol filter.TypePolicy, typ event.Type) uint8 { + if filter.AlwaysAllowed(typ) || !typ.Exists() || pol.DefaultAllow { + return 0 + } + var mode uint8 + if pol.RequirePID { + mode |= approverReqPID + } + if pol.RequireFilename { + mode |= approverReqFile + } + // The kernel only parses a destination port out of the stashed sockaddr for + // connect. Enforcing a port on any other type would compare against zero and + // drop everything, so those types keep the rest of their policy instead. + if pol.RequirePort && typ == event.Connect { + mode |= approverReqPort + } + return mode +} + +func (l *loader) writePolicy(gen uint32, typ event.Type, pol filter.TypePolicy) error { + id := uint32(typ) + present := uint8(1) + if pol.RequirePID { + for _, pid := range pol.PIDs { + key := bpf.ExecveApproverPidKey{Gen: gen, Type: id, Pid: pid} + if err := l.exec.ApproverPid.Put(&key, &present); err != nil { + return fmt.Errorf("writing pid approver: %w", err) + } + } + } + if pol.RequirePort && typ == event.Connect { + for _, port := range pol.Ports { + key := bpf.ExecveApproverPortKey{Gen: gen, Type: id, Port: port} + if err := l.exec.ApproverPort.Put(&key, &present); err != nil { + return fmt.Errorf("writing port approver: %w", err) + } + } + } + if pol.RequireFilename { + for _, path := range pol.FileExact { + key := bpf.ExecveApproverFileKey{Gen: gen, Type: id} + copy(key.Path[:], path) + if err := l.exec.ApproverFileEq.Put(&key, &present); err != nil { + return fmt.Errorf("writing file approver: %w", err) + } + } + pre := l.prefixMap(gen) + if pre == nil { + return fmt.Errorf("missing filename prefix map for generation %d", gen) + } + for _, prefix := range pol.FilePrefix { + if prefix == "" || len(prefix) > len(bpf.ExecveApproverLpmKey{}.Path) { + continue + } + key := bpf.ExecveApproverLpmKey{Prefixlen: uint32(len(prefix) * 8)} + copy(key.Path[:], prefix) + if err := pre.Put(&key, &present); err != nil { + return fmt.Errorf("writing file prefix approver: %w", err) + } + } + } + return nil +} + +func (l *loader) prefixMap(gen uint32) *ebpf.Map { + if gen == 0 { + return l.exec.ApproverFilePre0 + } + return l.exec.ApproverFilePre1 +} + +func (l *loader) clearGeneration(gen uint32) error { + if err := deleteHashGen(l.exec.ApproverPid, gen, func(k bpf.ExecveApproverPidKey) uint32 { return k.Gen }); err != nil { + return err + } + if err := deleteHashGen(l.exec.ApproverPort, gen, func(k bpf.ExecveApproverPortKey) uint32 { return k.Gen }); err != nil { + return err + } + if err := deleteHashGen(l.exec.ApproverFileEq, gen, func(k bpf.ExecveApproverFileKey) uint32 { return k.Gen }); err != nil { + return err + } + if err := deleteAll(l.prefixMap(gen)); err != nil { + return err + } + for i := uint32(0); i < approverTypeMax; i++ { + key := gen*approverTypeMax + i + var mode uint8 + if err := l.exec.ApproverMode.Put(&key, &mode); err != nil { + return err + } + } + return nil +} + +func deleteHashGen[K any](m *ebpf.Map, gen uint32, genOf func(K) uint32) error { + if m == nil { + return fmt.Errorf("missing approver map") + } + var key K + var val uint8 + stale := make([]K, 0) + iter := m.Iterate() + for iter.Next(&key, &val) { + if genOf(key) == gen { + stale = append(stale, key) + } + } + if err := iter.Err(); err != nil { + return err + } + for i := range stale { + if err := m.Delete(&stale[i]); err != nil { + return err + } + } + return nil +} + +func deleteAll(m *ebpf.Map) error { + if m == nil { + return fmt.Errorf("missing approver map") + } + var key bpf.ExecveApproverLpmKey + var val uint8 + stale := make([]bpf.ExecveApproverLpmKey, 0) + iter := m.Iterate() + for iter.Next(&key, &val) { + stale = append(stale, key) + } + if err := iter.Err(); err != nil { + return err + } + for i := range stale { + if err := m.Delete(&stale[i]); err != nil { + return err + } + } + return nil +} + +func sharedMaps(exec *bpf.ExecveObjects) map[string]*ebpf.Map { + return map[string]*ebpf.Map{ + eventsMapName: exec.Events, + dropCountMapName: exec.DropCount, + scratchMapName: exec.Scratch, + scratchHeapMapName: exec.ScratchHeap, + enabledMapName: exec.Enabled, + approverGenMapName: exec.ApproverGen, + approverModeMapName: exec.ApproverMode, + approverPIDMapName: exec.ApproverPid, + approverPortMapName: exec.ApproverPort, + approverFileEqMapName: exec.ApproverFileEq, + approverFilePre0Name: exec.ApproverFilePre0, + approverFilePre1Name: exec.ApproverFilePre1, + approverFileHeapName: exec.ApproverFileHeap, + approverLPMHeapName: exec.ApproverLpmHeap, + approverRejectMapName: exec.ApproverReject, + } +} diff --git a/internal/ebpf/bpf/clone_bpfeb.go b/internal/ebpf/bpf/clone_bpfeb.go index e8366cd2a..d3d15e461 100644 --- a/internal/ebpf/bpf/clone_bpfeb.go +++ b/internal/ebpf/bpf/clone_bpfeb.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type CloneApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type CloneApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type CloneApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type CloneApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type CloneScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -83,11 +111,21 @@ type CloneProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type CloneMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // CloneVariableSpecs contains global variables before they are loaded into the kernel. @@ -116,15 +154,35 @@ func (o *CloneObjects) Close() error { // // It can be passed to LoadCloneObjects or ebpf.CollectionSpec.LoadAndAssign. type CloneMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *CloneMaps) Close() error { return _CloneClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/clone_bpfeb.o b/internal/ebpf/bpf/clone_bpfeb.o index b8237d893fc6f55307b3ed0e75706f9b5ac4c440..34882e98cb706c0330e9cc3869096e4749310e95 100644 GIT binary patch literal 47720 zcmeI43vgstncq)$>(LsIXBx0g1Abgy-X1d^_ssaw81K-2476deg&7+GhVCAzXIfYz zwIz++@{pv-nnhU*rBEbvww$b%B1@-gLsW?qD=D(msjxv+OA1wBH>zDKQ4%Vv1gcPN z2&+`sb^hNu|I>Z?8)>k!EU6-WOIQE%`@ZwO=bm%#?c4p=PM&&KJRUQhEoS}{;lR-G zAn;Ezmh$|6gNZGaO-g9tNs|7^f~ZES0@|32k{ zu}4|vpfRV#bgpI{(bLq6$+#^W8i@y*rrI3AwtT3V;g9W5x2apyP3i`9ow`PCQ&*`g z)E0G_+N3T~7pVKe68U8Sy2ThwK0le$D*q&BE^YK>Z@mZ)RYQEGvjr{<_xYK9t7)6^6-Nfj{{huwI* zIAkK>OC|Yl49DAni_0(V2&?hAqsQl^J0%vzb>50kAAixI`CC*!{ue&!&WE6!ZHZE8 z#7Y?dFTH4MYZBwX`SQx&<@~S%{7ILOc{F8)B!AV8ZQTy$lNdCyhb8`tOY+|s9q+|R ztnvDbS%}ZNizc?AMQLEGv)s2(M z_$awR%~RbtnT*>SBcBZI5!H>8$#{yKq>7+i&J&ZdZSod%le$4&r>;@k)K%&VwMAW~ zHmOV0MQVdur`D)dYKb~V9in%cb?O?m zOcl^A$<`L<-D{owoXy>I)~idOcJ_xq>6GW+!HZQlFCqT{@r;+u zHKI?;KVzctlCkx@be&~0?DDO;^U|c4kJmT*da$0^OLw_+2ah_v^!jc-n0|JcPm=jO zx$t^-9$ze*QHjZXQm;6lyInrlW_cap>OJsN>M`K!QD!~Hc|E~;LYzPIAMgL7K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AC!NJ`DX(8 zOE{hXEy#RO{!L!j>A~sZGgN0bHpE%e|tdv zvVR!jEXZ(!jjx@zD^`H$g#{C=@UeBNZ9q|X% zKm4MNkzqusza-`IcjI5q30)_Nl6gu#@mpoSk=}>SU*?oS`4^afmFJPfv;XFA`oRzAM!x$Cn20USa--)&3vIctyc`z{ji6b_d^w~4&}1>v~TQ~&?~ diff --git a/internal/ebpf/bpf/ctl_bpfeb.go b/internal/ebpf/bpf/ctl_bpfeb.go index 16ff6f0b1..4ca490886 100644 --- a/internal/ebpf/bpf/ctl_bpfeb.go +++ b/internal/ebpf/bpf/ctl_bpfeb.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type CtlApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type CtlApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type CtlApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type CtlApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type CtlScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -75,11 +103,21 @@ type CtlProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type CtlMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // CtlVariableSpecs contains global variables before they are loaded into the kernel. @@ -108,15 +146,35 @@ func (o *CtlObjects) Close() error { // // It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. type CtlMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *CtlMaps) Close() error { return _CtlClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/ctl_bpfeb.o b/internal/ebpf/bpf/ctl_bpfeb.o index 63c85584abdebe8666b8ed7c18b95adafcb63e7a..769b9f2c6ff59b42f63a784d912f2d46b82eb699 100644 GIT binary patch literal 48016 zcmeI5eQ;dYdEU?N0t6@#;+h{aERoceEh-C!q89vw_?0CIieOAhYlTkWLlt%WChGH^^PJstUy7tCr<0_^JGywz@4V;xp7-2Ou72X+ktdVMglTOF^BshPh?WI` z`MjkZ|Mr-~xltQ7s|#JPN$A{5rd#xlwEQ)hE8DG_<^4{tJm9no_76VzVDXK}a`#WU z=$Fp@tq&F@`0_7(P!}C9na3cPSC`D=(7jM;+jytx`bDU(C%V&m*uGw!@7zCd_1~_Y z%%8p?{{w9Q*FRX0_I<>1%yN#S@Bhv6`TAPp^<`Hd+tYLG>umo9soj{a$c=NaJ03Pp z{xE;y^QPk`gfX7eqN_`Z8OSd{e;N9%&zHJhf-bQ9k3G(<{@rGLZ_~eJciulYm(jmr z^uxTwaaf)1`a$8Bzu}J48)YG5j(y|K#&5MT`)$6Zi4LlWIkwbXr(UCeo7$wlPqp(M z>E9zasP9s*Qs1H0sc%#5JVXAs$TjMl)OqUb)GF2bEAq{eU!_*4m#LSi7pZonknaL{ zmU^CAqP{|%p-xka)Jf_Db&Oh|K1Us<9;N1~N2o*8L28b=n>s+&ks! zau~f_apR!cvv{-iTygy{SC+T}R;N4dJn-$i5^q;>b=3J;Nr`%DqHLc*`|fC*uM{LV z*1tmM)1s|@jv9AdPe`mWy4_bEb@A=>v~!2VsQ%vK_;%(beXHFGIlWf6)>>RZ$r^-bzL^>u2M`WkhP`YN?Ty-dAC zy+|!nFHmQx=cy&?E7Te4G_^>bq)t%Bs0HeC)M4sTYMy$8Iz%0$=BT@=1Jte5E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hp@Hc zIdgbr{eo5c(*GIcna3W>ESTPG4X4treWUe{V;Y9Q%7t z?f=hX(uyxH@Y6UwtNQW^)E*6=p!)s=<^RXrz+ts*J`jP&9xp4obu){l0OCw2V)6ZGw-{ud*QZ=V1F diff --git a/internal/ebpf/bpf/ctl_bpfel.go b/internal/ebpf/bpf/ctl_bpfel.go index dc85991c4..74590e969 100644 --- a/internal/ebpf/bpf/ctl_bpfel.go +++ b/internal/ebpf/bpf/ctl_bpfel.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type CtlApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type CtlApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type CtlApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type CtlApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type CtlScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -75,11 +103,21 @@ type CtlProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type CtlMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // CtlVariableSpecs contains global variables before they are loaded into the kernel. @@ -108,15 +146,35 @@ func (o *CtlObjects) Close() error { // // It can be passed to LoadCtlObjects or ebpf.CollectionSpec.LoadAndAssign. type CtlMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *CtlMaps) Close() error { return _CtlClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/ctl_bpfel.o b/internal/ebpf/bpf/ctl_bpfel.o index 84c760c08400ce81aa939c234f98691cd147777b..23b8cbee96b4dfdb371c8b252da95e80e1f68c69 100644 GIT binary patch literal 47632 zcmeI5e{fvab>A)2~Izu<>i~=JH+pZi<12@XdCecLjLDoK+;N`#)CV2`@Nt0>)m_zp7VZU`Q?L$A53l7U?glXKQ=2Q zsm9d)a3vnuXk@OXlBc)3^se@oHgoLs2RdxRtJFxEV(0S~&2`s1J^!N9&6L0N&O7hC znlgrKe3iB@&~|!m=^ZXH^-Rrbq2qRQj<~Di4s)N?4W>ZaW@haEct0WW)$WJub-zo! z)8BIYzg$1Le(-MfUqt_JT(JGWl6I&Wa~e z(wCt>f;OOULzkd$LF>>9&_(E*&>Hj&D1STD@6zkgD)cqzJoFW41^O~{4*C+b3}vh1 zc4wi_Lrc)J&}rxyXc77>bP_raO`s#tA?P492R#byhaQ1up@*S;&;!s2dM~sWx)+*( z?u4eHw?ISaP0()W4bT9(71{ya1hrzOUT8Q!hV_(x;VsMg7cM%#;MwQJHSDv?kO5PO zu|A(5<%M?s>o(aOBWR=OL!{iJ{Ef?(w7J@WaNZm5TK?!f?~KCvoE6ix;b=?${C@GwbfrFR z^QX2{ZGX6b9P&3_-8`R1|GU~BvF$a-xgFo@jB8i>(eqEb^skcet{*pd+4}x?*ZzK^ z=Ki>)d|;a)y~s$q4E+(b0eu^~1bquyhhBg#Lf?eepl?7Ipsz!#(AS{z&{v=p=*!SK z=u6Nt^c-{+`aHA*Jqw+No`Dvj&q61maXEg#3N?Z$Cy`*Gab zk2r4aPaL=QJB~xU-+bWe#c}I66*X+CiE;`k`?`;qT7AGmsPJc#@p@}1@bS1*o7kUxZcr}@Cu zi{o+RC&+i24_v)Ceir$Y$ak6#T)j9xgZv`$o#q2qFOJV5e;WBt^MR`u$Im0bgnXy@ zz}1W6bI6}XzSDf*>c#O($S)(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#BtCjKGy{;H5h)Z-jo*Q>oE91E{LT8+eIY~M}$}txe`s2IE}0>7v;Tj_zmH1$ zP^XW`z9TNcC2jHT^y%e3>tApkP=0I$HaK~|)#H462@JoFO!vex=Y709!liuwzRrhB z`Au90lz&?rHn>y+=u2SMWAJn2;aD@u>^^_4*RyNG92BSCO8NL!!n$zzUzxjc!S-8=#;#oS@#GzS*oFEl@?IFCVPn^S ScH8;w`wU5QH*G%O;r|9dU0Oc? diff --git a/internal/ebpf/bpf/execve_bpfel.go b/internal/ebpf/bpf/execve_bpfel.go index 1b73d6db5..d463e5a10 100644 --- a/internal/ebpf/bpf/execve_bpfel.go +++ b/internal/ebpf/bpf/execve_bpfel.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type ExecveApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type ExecveApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type ExecveApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type ExecveApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type ExecveScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -78,11 +106,21 @@ type ExecveProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type ExecveMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // ExecveVariableSpecs contains global variables before they are loaded into the kernel. @@ -111,15 +149,35 @@ func (o *ExecveObjects) Close() error { // // It can be passed to LoadExecveObjects or ebpf.CollectionSpec.LoadAndAssign. type ExecveMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *ExecveMaps) Close() error { return _ExecveClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/execve_bpfel.o b/internal/ebpf/bpf/execve_bpfel.o index 300111f3a935bc00457ad72806285b72ba6c1850..5e46cdabc1e47721b22c2b187d6ab94136ea36df 100644 GIT binary patch literal 25104 zcmeI3e{9@meaD|WC(bzui5ptiutLB6LAV6R@sG4MDGisjE^Z0bq)Bmsa=x4|ITQc5 zp3muBkBOTA&)Wcb6*JaW2~&_}X=t-1SiP;R78{eLG075@W&xW#iEY;CA0A`FnzVKA z&-1*W^Y=csLo1|BoBYVn_w#vup5MQ}-|v0>sqXU+Mp0H}d zycsb|w>DZTy(MPli%yvIumAKlF}(bOHJg1=V}APDYp*q{%s-1@F}+;x;$5nD5%!vo zTf@}`V*+T;P?jg+$jO-UL_pb0*+?0qG?W`Q!}7#Bna6?T5_g<7s>ITL{mNMFCr z%IbP;vS{PWzVY(DO+E~@eBI^y4D10oecf#o>H3>(#Ak4|_Ig*J@V=Hsn5;Xgp{zGA z?}F~jk$OlA{l0hj%>d!AI4S$1>|2tL)I{=m8ou-uw@%AVy*8rcBl*AKe7@@Pxuwpv zQ}U4(-l!fD?(30aJ>Lcy(<@ow+wu|HXf~}Ulf7)puMo~DYe$z%QMO=TTF1z`5DJr3uKTVEHb{E6^ zYU;A~@==)u7}tpF$8uAG?8+}U^*Bz&t-KU*8I&S{<#Lm=ry@?KoBFN26mj{Mn~G$X z*Hj@VtSmQ8l6%NgSQ;MO;0~O>Vy}MO;0~O@STIQe>6s-TqvP zxO$YE+`e6kxO!lm8Q;|d<4bn+!1$86k2m#_xxY8{k-6_T^^;va%1v3at4Fyh=h;pa zu$7oEWOp8yB0NW%`Wepiw8@>%n8%FY%W$5rO+DldTMpV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`%| zcnVE}2j+oND3V-kySp__V!txCVE;>(T$~AAHMdv@1!tp@Bo}$0 zM!>zfg(IdAF;3;yvgFdV6k0pE09Q+>|J&qp4Y|dl5+)aS>+LTbJ{!w(3--Ts$>kby zi-iZLWXT09{<_>^l`^?-$iF7HSX9E~at*l!`(L``;@tnM<`%yHB}*>y6kjd3*!iCw zN|9WyA-6dBpOZ}qlFQX|i~X=+|M?Rek)l2%oD6s#UoT821wSWvQSk2sr*L)IKg5{` zGz8oN{)pfi!KVcCbGvMu@1nu~Zy>#T)f!#aQM)sNo5w#V^UOT-ERGxNd$49Ny)Jr~ zuAq+%{k@K~QLo24;+AQ5T23QZxDfr(Zd^{2KK)Nb&l%lIPl-Nb^Ciom=sB=nN;~7~ zb)B(WUlN}gU!Q*!eGf<2Lvw~c)S2EHv%3f`i^nhQX2E6gct!O7c$_!%h0e4Q(Xp<$ z^$*)AyeuA{iQXTNM?~+B$K#^+$D=5Ee>@uO#f0^5yJFV!;^U9USEBdFV^;M18Rw;c z0n~U_o0o&|0`xJ8+P}ovKgkv73<~s(_D^YJpDC<$Cy~%^?uf_on0kz)J6J2HKiL^H?g`0t#O7FO`EqlMH>TYY>lxuD#@Mdt_$X26MkME0z@99PFpe_2$zMQdA z$M&}vb-H(dTov2&q5TcU1^wQ>xSrgfGCtG2xwtykroV)GM8|S1#;~ngglDe7*rvy! z%Gjz81O5j*()! zqsx>2OMZ)btVuT(wyU{zeW=i|`gPdM?tc%0jXG{l-6czo=;nOFxLdzhh==q1uRc&n I|GAL(58~HAivR!s diff --git a/internal/ebpf/bpf/exit_bpfeb.go b/internal/ebpf/bpf/exit_bpfeb.go index 48d5ce17b..ce9bfc931 100644 --- a/internal/ebpf/bpf/exit_bpfeb.go +++ b/internal/ebpf/bpf/exit_bpfeb.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type ExitApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type ExitApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type ExitApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type ExitApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type ExitScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -75,11 +103,21 @@ type ExitProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type ExitMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // ExitVariableSpecs contains global variables before they are loaded into the kernel. @@ -108,15 +146,35 @@ func (o *ExitObjects) Close() error { // // It can be passed to LoadExitObjects or ebpf.CollectionSpec.LoadAndAssign. type ExitMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *ExitMaps) Close() error { return _ExitClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/exit_bpfeb.o b/internal/ebpf/bpf/exit_bpfeb.o index 4ddda18ccbcbb6e849367373f04984c26461a3ee..cc57f9c8146a68f6e8f0e5b2db0c6854112b078f 100644 GIT binary patch literal 10432 zcmeHLU2I&%6`oyhoS1~-KtjU*4T0bU$64nOlZ12$Byqri8v+d!dc9s>|B&_WvOkec zkh-O`jYKP1r4>A&)f7VH)57EB3t3F?T^Pn+;SaJ68o;1WRs#*OK`0%wJv z6PyuzUvOIRtYA&>l;D)$3BgIhmjx#Tj|)}>#{>(4!-9Q+hXs2Dy9HB%U4lu$Ho-t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Ij33DOO;c#e@vWab{vY!fdUW2Z m_3o{*R_3qYQLK^Z#2dQ~Tt9eR2cutq)?hpZWE+3}tN#U9leCQh delta 2212 zcmZ{lU1(fI6vxl~N@A*QHl)cWt!7E{h3IzcM{R1GEU{^0%|k2!3xZ8(w?vG(Hj8XQ z+3kZ^pSpG)nun+nL<3fc)`vb6x(}&DkrF7BN=pe+G5FFv1dJf)|9|hy?pW}^%sIa^ zXJ*cwGdo*;d1Zeo>290*HZ>Wj)tb%q!J0_eE__$J;;ES}%>{u=o>;>2b%1~BKonrhfqcm_^nEDcciVHkTIzUR;&{sy`}v;^$G zq3KWKG?*Lx9fQ2V(Y$^oK!@Rf9ylXaaka92N}DUFKfOo?ku^i`4@5bk(VQe70IoF4)|T% zVP1{3h`qSDBbdO0Va8sUxMR334!$_#gW_HUdpZH{4RIHmz$HCS#>MpJqJ+KkA|o%dABs*6Pe@qip3mX)%=&p7ffKyVkWQ=v5(E? zw~G{T3&R?Q4mkaUX4ITt=%+QG5&0e)`oo$(#cAV&{87zci(J_XK5FqM@VI9Dgcngl ze^T?WB1<)>zn_g9!Q&!7w;&*IF*5dxnqNZsIDXb*j+Zo_6uHBM=OeCM+6FK$IU8)* z30{Y$#8H1b+~yF&`jEYgnwO$+Gl9qdpZL`W#&NtH_qh?ouR}-18$~%>^4*^F6!W z*dDdg)9<#_sYLINq0?{wGZJ3JqF%JB+IaAk+DKJ;^H)R%b8?wx$JX8`z!`;Rh?!=- GD*i9+Lf{zy diff --git a/internal/ebpf/bpf/exit_bpfel.go b/internal/ebpf/bpf/exit_bpfel.go index 146c15056..98c83f8cd 100644 --- a/internal/ebpf/bpf/exit_bpfel.go +++ b/internal/ebpf/bpf/exit_bpfel.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type ExitApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type ExitApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type ExitApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type ExitApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type ExitScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -75,11 +103,21 @@ type ExitProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type ExitMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // ExitVariableSpecs contains global variables before they are loaded into the kernel. @@ -108,15 +146,35 @@ func (o *ExitObjects) Close() error { // // It can be passed to LoadExitObjects or ebpf.CollectionSpec.LoadAndAssign. type ExitMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *ExitMaps) Close() error { return _ExitClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/exit_bpfel.o b/internal/ebpf/bpf/exit_bpfel.o index 92dbc6818a50023a13ca5807016b2179138058b8..6471cbdd2ee0adeeea878fc2a1254bf64ede9355 100644 GIT binary patch literal 10432 zcmeHNZ)}y-89%*1X|a|TXaxm*5yciuxdp@uf>*Q%TD2lNbh@{785f0z>+ZG ziHqNsJ>fae^Lw7>Jm>#?-}jX7_Vn(G)YPbuYSb61fe)}Jr0(w`P}NY~?d*p-i) zOuhvwr^Ji97HHFwYq%j57#1D(R~0FqT2cF`v77MQDJ$5zKrs@H#N4aUlxn3vt9esi;=x zl`T$t#GC@E)iHLSMmW24h^ku*d57ri(>9}DHYOh9-4e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z;)cepovaw z+{E`HMT^7WG36Io#{y1R90r$_kD~70!4xZ3H*Eu!lpC7w95p`)D_~j^*Pn?-tRao- zL!LpTaXIW0IQ{l`PPbj>^pYFU1TBb2?pDq|#JK~ScwYzfD_1+@^zj1Mv|d2u$Eyub zOXKX2_xMfJpECD1#!KIN1)nz&p47u-%@^z>G+!EiVz{?$`@sXBw}N(lQS)VOsak7= zh>6dabAD6eKpcuyE(a~?9r5``jEX)PG{0N4x8WS0^=NJU z5#wx5m|$!6iKBz}Rms=oVKbv1tt*28tXP4VJe6>Zjpmb7%K6Y-LFzT*bhK_MSBC$8 zWNWrvG*>zjk4p%z|ktEp0!{{Tv9=6V1C diff --git a/internal/ebpf/bpf/file_bpfeb.go b/internal/ebpf/bpf/file_bpfeb.go index aa41f2094..28c624010 100644 --- a/internal/ebpf/bpf/file_bpfeb.go +++ b/internal/ebpf/bpf/file_bpfeb.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type FileApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type FileApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type FileApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type FileApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type FileScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -90,11 +118,21 @@ type FileProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type FileMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // FileVariableSpecs contains global variables before they are loaded into the kernel. @@ -123,15 +161,35 @@ func (o *FileObjects) Close() error { // // It can be passed to LoadFileObjects or ebpf.CollectionSpec.LoadAndAssign. type FileMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *FileMaps) Close() error { return _FileClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/file_bpfeb.o b/internal/ebpf/bpf/file_bpfeb.o index 2ff0423638709ae6cd7498506a98696a022c3436..77478a41aefc426cfa05720e249cc9cd43b86524 100644 GIT binary patch literal 167576 zcmeF)4}4s8z32Z)XlW{i4$?xvss|_-N`L?bA`~2;K+pmK0t6^zLJ~TKw4J7DNodhQ z3Pdazv`Eyd5i10(8nxP})kduv6*Veql&VpyMy+n|E_-ixmtB7E@B6$aO+w2bufNAW z_TK4(^gYk{%$YfJ<~{#U!`m)eaB*>QQDXE@QR3fpc+3%_lSHEUo*^s6-zO%D+UpZh zQ2WD)Qs?qSGUOKjotV_{k>~dWZ<`bTP9&y8iNy2IKfk9mp8L4)*S+zfqHDP9$%(}6 z;i%=DZe}vEIC%Br&+iVoB^UlqBpP~N+4*lvd$Ghd>G(S8a&8XCtj-jdkrC z$`Xzbq0<-ndMUj=$`OtqCWpvDa)9h7`^a9hhwLW1$WF3@%#m$mmduc8vX-nStH=~t zNmh_$WJH#dNwS0tq3fU6L+&O=$YFAb93%(GezK43C40zjvWx5_JIEZ_MrO$jnI>z= zYO;zE0LR?>CA1`x0KCEAEa@-;jyTa)+$$etEs$c4oZ%mejb*E#49{ z@d&B=v9C}2-SPc*%;gM*lZ?4Pj|5M+KaaeO`*U$vE`NW%CYhMBkMkMa&-olMaeehT zFz^bNFUsHVXQqo6gyrhr8*k4o*&scRJn{T1x?VFA#SeP9DMgdW5Q&BHCHu(DWG}gi>>)Rj-Q)(ci(F53lIzG0 zaxIx7*N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9Y<*AT$bu-kH8bQMft<9=3XC`ta>G39Gk(B@ydz)H!qxoWo%p#L~Cff*X;78$Dv>Ff5#&!pin|0_MI0wnr_}rO3W(#iQHcL`$gU75Kg{xEGVXIOIBwmS z=o~l)DTML4Gkw$+!pLowB)-9;K&QaN&|~StCYUr44x)Mx9NRkN?G${Z_t*{w2uAFj z@1t{D#M}@f7`1zvZ5elCkYMD%xwd6&3S-W+Bif3ww2?ck+-~JIE7GRM^B53%6bL;6 zbP7CdH421E`66Fb!F zu;BJ*68S>$-S^8~oUl89enTSflH)kJH(s|6uATI@zSh&lA42$lzD53F6x97b4}y2% zJO1@8@^2&m3<7HY+hyncXT+^n{o9w@i0=FJmb&pBPsu^A`ltT04H2xrb|vSpmxsOb zU)^Klzft{lIn^uw3i8j`WIV0EhU5J8`{2FuU%`83?suP%OeenM?@0V!`L}x1|I!}$ ze`SmO*ALhn-l+b+wMG6Te`4cjteE;=CdXX=#|C=We+|ze-0v?SnNEDiNr~U9{srV8 z?Efoz^uJDNuK(Qln-Rm=tNxLkjTn1_`cFyx zUiGi9+4#ZwU)Ll5V_W2(nY8iWsQ%F{@^2ykj7`SW|9~8G{XdEEN2j@$eAY(PIWxFv zTLrgyaZopopF#YEU|>0R`8(%pBqFD&e(Q+;BY5B2g{SWD_DTF+?VtEBHbw>!)&9L( zc9*~Ff3-=y@*jHMMm&i7H@NQi#Q6V=U4r8P diff --git a/internal/ebpf/bpf/mem_bpfeb.go b/internal/ebpf/bpf/mem_bpfeb.go index e5a1a1c02..5f8e03f39 100644 --- a/internal/ebpf/bpf/mem_bpfeb.go +++ b/internal/ebpf/bpf/mem_bpfeb.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type MemApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type MemApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type MemApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type MemApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type MemScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -80,11 +108,21 @@ type MemProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type MemMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // MemVariableSpecs contains global variables before they are loaded into the kernel. @@ -113,15 +151,35 @@ func (o *MemObjects) Close() error { // // It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. type MemMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *MemMaps) Close() error { return _MemClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/mem_bpfeb.o b/internal/ebpf/bpf/mem_bpfeb.o index 789506c53f60bba3ebb51fc06a387b66e2214959..2618d083eb972a4b950235558494a4458267d970 100644 GIT binary patch literal 68248 zcmeI54SXC|dG%*kaw5l$qr@K(V4RKZgmrKn`6G!SA>Du-HpK}damXe(XcbBJn#lHA zlEWICB8q`+F;vjB21g(ZsiZ3nM_Ml(k3ZeM7%+4g8T_?2XtCIC7qOVED#?Tk4Z2B`_QKbVnDOQ)oh(h2Ff zbWA!b9gz-8E7Bq9pmac5mi9|a(xS8=%}aCAR%uq6k+w*irD!hGPcy+oMrWZrVm`hLmbp=ajjlUIc0?$3m(<0g53 zh`}#O54EdbZw~vTeAdpmWr-c1Q^xN2oO%YwXVS_=$LB4L!I`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tt2n2)thlbYsko(hRq?vwj^a(lUBx?t z{KB~6F~v#6X~kK^ImKngb;V7^Eyb&f*A;gZZz}F8-WlW<#TAb!PAX0-&MM9+E-S7p zZYpjmURAuVxTAPeaaZxqAm0#IJf=9QIITFVcnTbPUvooE@zaVwqWDvaKd<R|;nTmw-KsZ9~IRZ2o)4=?8~@Rqy}D1aoY9 z8o$89ubAiYKRon)AmslGg=6^TTdjD`99vkLvC8@w|GT2Ici(+F|2hLX>15o=seD>I zPdGW9f346dCnuepa5C;BmA_R?PUpw1o}`XbPvuX$^sJ;D!Pp{HH}%KIvrK z35@CM6vmcM=TACgE8~t%=TC^|DJLhLoNzMkB;^Fjj=T6yk?c4o(eu9||A{nWyQi}_ zve{|Gkv_Eylo=8K6EeUGa$gseCYKkNEQa;=m>AGq1>J;PBt) zWxTJ`cXi0}d@BFXiLa-RkLTKm{Jp>)`P=XR5Ny96g!V2UA0ClKeC(CK>??8=a7+HO z2gv2)Oa5}$*dzbzHm$Y$9@078r;jgD@wc;k<^S#+Bl-IK??Zijf{e`&ux@_*SH!f^S1aD-1EUpy}2_UUHCqkp}-OSiAT z|9;oUm-@dN_a6Dbyzb&(wf?e??U8?e%*F5ZzyE$Xlz-$qq5S>$WVEAAI($50ue=f! zzmMy&j^AR0Wgn61^9Ra*=hKU?%x+0Kj~hRy0z&gQDs8$~{n>uK`r|8ed-?p){t@{* z2H*Y+_Hy^8bKUq6??VmcAGsZVd*$!r2e6UxCx62vS2+KFo_qGJZMTLE3V+mgNb-CX ezCz`VN?iMeVA#O9b5*CqIjF?B#c?nHvHt-}92A8B diff --git a/internal/ebpf/bpf/mem_bpfel.go b/internal/ebpf/bpf/mem_bpfel.go index 7a8d011c2..e807e14ec 100644 --- a/internal/ebpf/bpf/mem_bpfel.go +++ b/internal/ebpf/bpf/mem_bpfel.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type MemApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type MemApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type MemApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type MemApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type MemScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -80,11 +108,21 @@ type MemProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type MemMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // MemVariableSpecs contains global variables before they are loaded into the kernel. @@ -113,15 +151,35 @@ func (o *MemObjects) Close() error { // // It can be passed to LoadMemObjects or ebpf.CollectionSpec.LoadAndAssign. type MemMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *MemMaps) Close() error { return _MemClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/mem_bpfel.o b/internal/ebpf/bpf/mem_bpfel.o index 5d167155c1fe6007eabdf0ef3e4c0424d1d8988b..db032814f4af231089eedf0b9c55148ca480c9c5 100644 GIT binary patch literal 67960 zcmeI54R~BvdFQXjvOIQV=OnQe5!^CKOc)!-kw20QB!mgrVN#qR5+|7ihtc(D>~SJn zBOO_cGNz~{#Z&51LDOZ*rl3H!ow8}GwxOA}p;o&Arfj;XZ3+V1R=XQowFFkQX{#+M z?E9Ygf2BLGBqyPLpwD*BqdWieJLlZDOEnR}1!yl3D3n<6bOUf^21fASV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ms z{rrg3cCEf~#Yx5eiU$-I71tF{E1p%{46xikv=lEYURJ!SIKo?H=}$?oS8+^nLUBrQ zT5&x!op&nli*yrB4k z;w8l^irpg(SKl7ll!NtGoCxsE2$xcvR$NeAQ9Px%p?FSlQ*lf2qT*%6tBNB%rn;uT zr9S*`u-Y6`{t3k?#c9O_#TCUB7YnJM*82>UvW%vLUBrQ zT5&;fMe&s4hT=KJO~oz6i;9;OuPTnn56ofO^;aBIoKT!noK{>=Tv0rwxS@DXaZ_lB74SIzLPGloHttUl9KbKf%GuN2fl_tEDC^_7-{qWm@WG>* zyFAEYD}7duWD??d$jZ^ookB;f9JX@EN}rW@<_-yRG}CAFFtv|*By-fJXC!V3fej+C zQ3N)6G;>4(AGXqG1%c^m6@d*O%^bFYjr3VMnmHtnN30ySa>z=bmADlo+h^ljMY4T% zs=cGn|HSj>u60s)qhuWqDNjDGZpSzZ2XW(Lowj?jZR@nix)3yf^cL~m^H>*$j}IJr zUqO61QYYIk))INzYMk!!cS58pE zzs`Tx2KhI6-|Wi4WZLl^%irEvul|j7>MxI;bpGFf8Uw9iMZ?K-&&{s z5>Dqou|fXD8{q--R`q`tVb;q(_6ZZ+d-=wn+j{j++yoDpx2nJFiRI diff --git a/internal/ebpf/bpf/net_bpfeb.go b/internal/ebpf/bpf/net_bpfeb.go index 6f3c05914..c83567465 100644 --- a/internal/ebpf/bpf/net_bpfeb.go +++ b/internal/ebpf/bpf/net_bpfeb.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type NetApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type NetApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type NetApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type NetApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type NetScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -80,11 +108,21 @@ type NetProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type NetMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // NetVariableSpecs contains global variables before they are loaded into the kernel. @@ -113,15 +151,35 @@ func (o *NetObjects) Close() error { // // It can be passed to LoadNetObjects or ebpf.CollectionSpec.LoadAndAssign. type NetMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *NetMaps) Close() error { return _NetClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/net_bpfeb.o b/internal/ebpf/bpf/net_bpfeb.o index e33bd9ac6a36c08fa0c205773053d4ba130edc76..f4ccf10ccf7f3dea24b37193e0ec57d438ac052c 100644 GIT binary patch literal 70208 zcmeIb4R{<^dG|fLE8DBYiIv133ncM4{$On!NB#&bkc3TQ2cX2#Onw{5>J9*+f$Pb~N;mLmy`2vQf8 zl(PJ}EQp;vpv%FD4%G$ypL%LWmQJp7=?lUjcPNh67ln$ZYg#%*EKH)-Xuu} zm~Tl(kQY8tlAl4)Uwv-%p3G^n;O3m$7S#VnNjaL2r>P+|Mb$MUo+OJPe@wRrI!&IU zPEseRBDFxxQ*+cFYB#lunx$r_ozyfnq^77H)Ff2| z+aJtOr>RraN$Lc3oLZ-jQESvuYLz-dtx$)lWon69q!y@oYL41N?WT57v(yZ=lbWW6 z)D*RYnxu*ZN0tRHy-zVX^1>jLrK7h8n(xR<0xj?SAB$ajevptjkB4}FU!dzd5lU(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net_bpfel.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type NetApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type NetApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type NetApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type NetApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type NetScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -80,11 +108,21 @@ type NetProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type NetMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // NetVariableSpecs contains global variables before they are loaded into the kernel. @@ -113,15 +151,35 @@ func (o *NetObjects) Close() error { // // It can be passed to LoadNetObjects or ebpf.CollectionSpec.LoadAndAssign. type NetMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *NetMaps) Close() error { return _NetClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/net_bpfel.o b/internal/ebpf/bpf/net_bpfel.o index 6757c2ddaced3058f26040363a0d9c24fd1d631d..217e34e79e8dc89e5fbcda368982b6c582c0c5c3 100644 GIT binary patch literal 69920 zcmeI54}4@-S@&=LY<70L-JUL+G?XpeZI?1zw%hEV!T{ScrCUgKX+zniQz*^c&SpE? zW_Kq!*)VB}1TA$e1x73~FIGrPl@Y5(t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$;r`#R z`mZ>tIITFNxTv_SxURUVxTUzQxTCnMct>$haZGM1;QHsk;<)0Z;ucW_U@k5Fq53v+=Rq>08=M}%K_%+495@NAG-&Fi9 z#ot!^mf}BG{P9mbb@}Nl&!nEb^u*)l>}sLBYR)bf=FdL$!ZT+D_W!AuO|$Qh=iP78 zhO&iz$+myKaDu@P)rZQEACmb$S|RP*w{D*x+-6(0kJvZoPzwIR5%(Ll@LzoJf7!#F zou9w8Ais`Z#$O`o|BTK5sgJYxZT9NSb#r#5vS5{CY5cF>u0HkDquGxc$OR`;P9Dup zC0(e~sq9Au6HXq@enjY^lM7DHJ3&qxd4W1by_kJe@|<^)aPnyOybZlTMdC;I478iW zi~CPj_$PgP2KtUUL(_awS~iunf+kr-lNdZjy&$O&Z57evDYDax+4HWOR;C;!oM32d zD2B!=cuEq3t)ll<6I9fdaPdwNp1?Wxy>RlkrTFN0sJPjR!wD6Mwa4nB_S$EEtd zVUO%zVfROXJLUK9b$uQ__VH-G3!gj+N%cdVr59+K%SrR=2-~mzUH03* z_jRQW@_YUoJp0w($+;91`(LF(0TmZa}L%YarN^y z-vK@)ZP>}*VB0T$lldFr#PIw2eemC9e$QUxXPs|@*C9S!pTD0${{8x2yzX-3m{I0m zZee`=e*9%lr2X1;FT0RY|7Ce5(Dloj-mm@+>u>P7LPRd1b^RYgQBZ1 diff --git a/internal/ebpf/bpf/prociter_bpfeb.go b/internal/ebpf/bpf/prociter_bpfeb.go index 1f27cf6de..7c35590d7 100644 --- a/internal/ebpf/bpf/prociter_bpfeb.go +++ b/internal/ebpf/bpf/prociter_bpfeb.go @@ -13,6 +13,34 @@ import ( "github.com/cilium/ebpf" ) +type ProciterApproverFileKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Path [256]uint8 +} + +type ProciterApproverLpmKey struct { + _ structs.HostLayout + Prefixlen uint32 + Path [256]uint8 +} + +type ProciterApproverPidKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Pid uint64 +} + +type ProciterApproverPortKey struct { + _ structs.HostLayout + Gen uint32 + Type uint32 + Port uint16 + Pad uint16 +} + type ProciterScratchValue struct { _ structs.HostLayout Arg0 uint64 @@ -75,11 +103,21 @@ type ProciterProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type ProciterMapSpecs struct { - DropCount *ebpf.MapSpec `ebpf:"drop_count"` - Enabled *ebpf.MapSpec `ebpf:"enabled"` - Events *ebpf.MapSpec `ebpf:"events"` - Scratch *ebpf.MapSpec `ebpf:"scratch"` - ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.MapSpec `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.MapSpec `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.MapSpec `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.MapSpec `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.MapSpec `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.MapSpec `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.MapSpec `ebpf:"approver_mode"` + ApproverPid *ebpf.MapSpec `ebpf:"approver_pid"` + ApproverPort *ebpf.MapSpec `ebpf:"approver_port"` + ApproverReject *ebpf.MapSpec `ebpf:"approver_reject"` + DropCount *ebpf.MapSpec `ebpf:"drop_count"` + Enabled *ebpf.MapSpec `ebpf:"enabled"` + Events *ebpf.MapSpec `ebpf:"events"` + Scratch *ebpf.MapSpec `ebpf:"scratch"` + ScratchHeap *ebpf.MapSpec `ebpf:"scratch_heap"` } // ProciterVariableSpecs contains global variables before they are loaded into the kernel. @@ -108,15 +146,35 @@ func (o *ProciterObjects) Close() error { // // It can be passed to LoadProciterObjects or ebpf.CollectionSpec.LoadAndAssign. type ProciterMaps struct { - DropCount *ebpf.Map `ebpf:"drop_count"` - Enabled *ebpf.Map `ebpf:"enabled"` - Events *ebpf.Map `ebpf:"events"` - Scratch *ebpf.Map `ebpf:"scratch"` - ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` + ApproverFileEq *ebpf.Map `ebpf:"approver_file_eq"` + ApproverFileHeap *ebpf.Map `ebpf:"approver_file_heap"` + ApproverFilePre0 *ebpf.Map `ebpf:"approver_file_pre_0"` + ApproverFilePre1 *ebpf.Map `ebpf:"approver_file_pre_1"` + ApproverGen *ebpf.Map `ebpf:"approver_gen"` + ApproverLpmHeap *ebpf.Map `ebpf:"approver_lpm_heap"` + ApproverMode *ebpf.Map `ebpf:"approver_mode"` + ApproverPid *ebpf.Map `ebpf:"approver_pid"` + ApproverPort *ebpf.Map `ebpf:"approver_port"` + ApproverReject *ebpf.Map `ebpf:"approver_reject"` + DropCount *ebpf.Map `ebpf:"drop_count"` + Enabled *ebpf.Map `ebpf:"enabled"` + Events *ebpf.Map `ebpf:"events"` + Scratch *ebpf.Map `ebpf:"scratch"` + ScratchHeap *ebpf.Map `ebpf:"scratch_heap"` } func (m *ProciterMaps) Close() error { return _ProciterClose( + m.ApproverFileEq, + m.ApproverFileHeap, + m.ApproverFilePre0, + m.ApproverFilePre1, + m.ApproverGen, + m.ApproverLpmHeap, + m.ApproverMode, + m.ApproverPid, + m.ApproverPort, + m.ApproverReject, m.DropCount, m.Enabled, m.Events, diff --git a/internal/ebpf/bpf/prociter_bpfeb.o b/internal/ebpf/bpf/prociter_bpfeb.o index e93d91e49b93252f6ccb2e1fd343e3b520c79d5b..541573a5db7284d3d4bc6e0b1e80662f2f3d482e 100644 GIT binary patch literal 9696 zcmeHLZH!!189p+_uR-aBV* zcdI7+GM>zPpZ9ssd(L^!d(OEZ^VRLU?uo}^Dl9SeF?7oi)<9V?t(hy=D^+ajDK(F5 zaalEp-Zyy#E>#`GCl0D-iN_D~s#H(6!Qgt_p%$M!o-&rN8~EDEj8PuSsLQEke|q6O z@#L+%Ds`Eo)P)Nd&PV%`_OZoE73p`}j2C-XW|UNFAMFQn@v`8AU`BAS;E>=BL0524 zP)Ce@dWAcJJ%V~<)a(2JX~wv*PXx~io)tVJcv^5q@RVRv@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D25@ W-rHDO7Yr-t-DcnkHMhjOPWu;opvOc2 diff --git a/internal/ebpf/c/common/approvers.h b/internal/ebpf/c/common/approvers.h new file mode 100644 index 000000000..0aa935591 --- /dev/null +++ b/internal/ebpf/c/common/approvers.h @@ -0,0 +1,237 @@ +/* Conservative in-kernel approvers. Default-allow unless userspace + * populated a proven superset of equality/list/prefix predicates. + */ + +#pragma once + +#ifndef BPF_F_NO_PREALLOC +#define BPF_F_NO_PREALLOC (1U << 0) +#endif + +#define APPR_REQ_PID (1u << 0) +#define APPR_REQ_FILE (1u << 1) +#define APPR_REQ_PORT (1u << 2) + +#define APPR_GENS 2 +#define APPR_MODE_MAX (EVT_TYPE_MAX * APPR_GENS) + +struct approver_pid_key { + u32 gen; + u32 type; + u64 pid; +}; + +struct approver_port_key { + u32 gen; + u32 type; + u16 port; + u16 pad; +}; + +struct approver_file_key { + u32 gen; + u32 type; + u8 path[EVT_FILENAME_LEN]; +}; + +struct approver_lpm_key { + u32 prefixlen; + u8 path[EVT_FILENAME_LEN]; +}; + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __uint(max_entries, 1); + __type(key, u32); + __type(value, u32); +} approver_gen SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __uint(max_entries, APPR_MODE_MAX); + __type(key, u32); + __type(value, u8); +} approver_mode SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 1024); + __type(key, struct approver_pid_key); + __type(value, u8); +} approver_pid SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 1024); + __type(key, struct approver_port_key); + __type(value, u8); +} approver_port SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 1024); + __type(key, struct approver_file_key); + __type(value, u8); +} approver_file_eq SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_LPM_TRIE); + __uint(max_entries, 256); + __uint(map_flags, BPF_F_NO_PREALLOC); + __type(key, struct approver_lpm_key); + __type(value, u8); +} approver_file_pre_0 SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_LPM_TRIE); + __uint(max_entries, 256); + __uint(map_flags, BPF_F_NO_PREALLOC); + __type(key, struct approver_lpm_key); + __type(value, u8); +} approver_file_pre_1 SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __uint(max_entries, 1); + __type(key, u32); + __type(value, struct approver_file_key); +} approver_file_heap SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __uint(max_entries, 1); + __type(key, u32); + __type(value, struct approver_lpm_key); +} approver_lpm_heap SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __uint(max_entries, 1); + __type(key, u32); + __type(value, u64); +} approver_reject SEC(".maps"); + +static __always_inline void account_approver_reject(void) +{ + u32 key = 0; + u64 *count; + + count = bpf_map_lookup_elem(&approver_reject, &key); + if (!count) + return; + __sync_fetch_and_add(count, 1); +} + +static __always_inline u32 approver_generation(void) +{ + u32 key = 0; + u32 *gen; + + gen = bpf_map_lookup_elem(&approver_gen, &key); + if (!gen) + return 0; + return *gen & 1; +} + +static __always_inline u16 sockaddr_dport(const u8 *aux) +{ + u16 family; + u16 port; + + if (!aux) + return 0; + family = (u16)aux[0] | ((u16)aux[1] << 8); + if (family != 2 && family != 10) + return 0; + port = ((u16)aux[2] << 8) | aux[3]; + return port; +} + +static __always_inline int stash_filename(const u8 *filename) +{ + struct approver_file_key *exact; + u32 zero = 0; + + exact = bpf_map_lookup_elem(&approver_file_heap, &zero); + if (!exact) + return 0; + __builtin_memset(exact, 0, sizeof(*exact)); + if (filename) + __builtin_memcpy(exact->path, filename, EVT_FILENAME_LEN); + return 1; +} + +static __always_inline int approver_file_match(u32 gen, u32 type) +{ + struct approver_file_key *exact; + struct approver_lpm_key *lpm; + u32 zero = 0; + + exact = bpf_map_lookup_elem(&approver_file_heap, &zero); + if (exact) { + exact->gen = gen; + exact->type = type; + if (bpf_map_lookup_elem(&approver_file_eq, exact)) + return 1; + lpm = bpf_map_lookup_elem(&approver_lpm_heap, &zero); + if (lpm) { + __builtin_memset(lpm, 0, sizeof(*lpm)); + lpm->prefixlen = EVT_FILENAME_LEN * 8; + __builtin_memcpy(lpm->path, exact->path, EVT_FILENAME_LEN); + if (gen) { + if (bpf_map_lookup_elem(&approver_file_pre_1, lpm)) + return 1; + } else if (bpf_map_lookup_elem(&approver_file_pre_0, lpm)) { + return 1; + } + } + } + return 0; +} + +static __always_inline int event_approved(u32 type, u16 port, u32 truncated) +{ + u32 gen; + u32 mode_key; + u8 *mode; + struct approver_pid_key pkey = {}; + struct approver_port_key rkey = {}; + + if (type == EVT_TYPE_SNAPSHOT || type == EVT_TYPE_EXECVE || + type == EVT_TYPE_EXIT || type == EVT_TYPE_CLONE) + return 1; + if (type >= EVT_TYPE_MAX) + return 1; + + gen = approver_generation(); + mode_key = gen * EVT_TYPE_MAX + type; + if (mode_key >= APPR_MODE_MAX) + return 1; + mode = bpf_map_lookup_elem(&approver_mode, &mode_key); + if (!mode || *mode == 0) + return 1; + + if (*mode & APPR_REQ_PID) { + pkey.gen = gen; + pkey.type = type; + pkey.pid = bpf_get_current_pid_tgid() >> 32; + if (!bpf_map_lookup_elem(&approver_pid, &pkey)) + return 0; + } + + if (*mode & APPR_REQ_FILE) { + if (!(truncated & TRUNC_FILENAME) && + !approver_file_match(gen, type)) + return 0; + } + + if (*mode & APPR_REQ_PORT) { + rkey.gen = gen; + rkey.type = type; + rkey.port = port; + if (!bpf_map_lookup_elem(&approver_port, &rkey)) + return 0; + } + + return 1; +} diff --git a/internal/ebpf/c/common/events.h b/internal/ebpf/c/common/events.h index 185eea59c..e9df5bc41 100644 --- a/internal/ebpf/c/common/events.h +++ b/internal/ebpf/c/common/events.h @@ -138,6 +138,8 @@ struct { __type(value, u8); } enabled SEC(".maps"); +#include "approvers.h" + static __always_inline void account_drop(void) { u32 key = 0; @@ -256,12 +258,29 @@ static __always_inline int submit_from_scratch(u32 type, long ret, u32 syscall_i u64 key = bpf_get_current_pid_tgid(); struct scratch_value *val; struct syscall_event *e; + u16 port = 0; + u32 truncated = 0; if (!type_enabled(type)) { bpf_map_delete_elem(&scratch, &key); return 0; } + val = bpf_map_lookup_elem(&scratch, &key); + if (val) { + truncated = val->truncated; + if (type == EVT_TYPE_CONNECT) + port = sockaddr_dport(val->aux); + stash_filename(val->filename); + } else { + stash_filename(NULL); + } + if (!event_approved(type, port, truncated)) { + account_approver_reject(); + bpf_map_delete_elem(&scratch, &key); + return 0; + } + e = reserve_event(); if (!e) { bpf_map_delete_elem(&scratch, &key); @@ -318,6 +337,11 @@ static __always_inline int submit_args(u32 type, long ret, u32 syscall_id, if (!type_enabled(type)) return 0; + stash_filename(NULL); + if (!event_approved(type, 0, 0)) { + account_approver_reject(); + return 0; + } e = reserve_event(); if (!e) diff --git a/internal/ebpf/doc.go b/internal/ebpf/doc.go index d283bd6b7..97119d250 100644 --- a/internal/ebpf/doc.go +++ b/internal/ebpf/doc.go @@ -19,6 +19,8 @@ // Package ebpf hosts the Linux eBPF instrumentation backend. The event // source loads CO-RE programs, captures process, file, network, memory, // and process-control syscalls, and reconciles live events against an -// iter/task baseline. The spike subdirectory remains as a feasibility -// prototype. +// iter/task baseline. Optional in-kernel approvers drop events that cannot +// match compiled rules or the CLI filter, using only positive equality, +// list, and prefix predicates. The spike subdirectory remains as a +// feasibility prototype. package ebpf diff --git a/internal/ebpf/loader.go b/internal/ebpf/loader.go index 7ea3dc4f9..cb7ea0af1 100644 --- a/internal/ebpf/loader.go +++ b/internal/ebpf/loader.go @@ -95,13 +95,7 @@ func loadCollections() (*loader, error) { return nil, fmt.Errorf("loading execve objects: %w", err) } - replacements := map[string]*ebpf.Map{ - eventsMapName: execObjs.Events, - dropCountMapName: execObjs.DropCount, - scratchMapName: execObjs.Scratch, - scratchHeapMapName: execObjs.ScratchHeap, - enabledMapName: execObjs.Enabled, - } + replacements := sharedMaps(&execObjs) opts := &ebpf.CollectionOptions{MapReplacements: replacements} var exitObjs bpf.ExitObjects diff --git a/internal/ebpf/maps.go b/internal/ebpf/maps.go index c07a9de62..51f129b46 100644 --- a/internal/ebpf/maps.go +++ b/internal/ebpf/maps.go @@ -21,9 +21,28 @@ package ebpf const ( - eventsMapName = "events" - dropCountMapName = "drop_count" - scratchMapName = "scratch" - scratchHeapMapName = "scratch_heap" - enabledMapName = "enabled" + eventsMapName = "events" + dropCountMapName = "drop_count" + scratchMapName = "scratch" + scratchHeapMapName = "scratch_heap" + enabledMapName = "enabled" + approverGenMapName = "approver_gen" + approverModeMapName = "approver_mode" + approverPIDMapName = "approver_pid" + approverPortMapName = "approver_port" + approverFileEqMapName = "approver_file_eq" + approverFilePre0Name = "approver_file_pre_0" + approverFilePre1Name = "approver_file_pre_1" + approverFileHeapName = "approver_file_heap" + approverLPMHeapName = "approver_lpm_heap" + approverRejectMapName = "approver_reject" +) + +// Mirrors APPR_REQ_* and EVT_TYPE_MAX in c/common/approvers.h. Both sides index +// the mode array as generation*approverTypeMax+type, so the values must agree. +const ( + approverReqPID = 1 << 0 + approverReqFile = 1 << 1 + approverReqPort = 1 << 2 + approverTypeMax = 32 ) From bdfe3400340199f6843dfcc9d510e8150ea88521 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 21 Sep 2026 16:05:36 +0200 Subject: [PATCH 54/65] feat(ebpf): Apply rule and CLI prefilters after maps load --- internal/bootstrap/bootstrap_linux.go | 4 +- internal/bootstrap/source_linux.go | 3 +- internal/ebpf/approver_integration_test.go | 140 +++++++++++++++++++++ internal/ebpf/approver_test.go | 125 ++++++++++++++++++ internal/ebpf/consumer.go | 1 + internal/ebpf/source.go | 52 ++++++-- internal/ebpf/source_integration_test.go | 4 +- internal/ebpf/source_test.go | 5 +- 8 files changed, 319 insertions(+), 15 deletions(-) create mode 100644 internal/ebpf/approver_integration_test.go create mode 100644 internal/ebpf/approver_test.go diff --git a/internal/bootstrap/bootstrap_linux.go b/internal/bootstrap/bootstrap_linux.go index 7a25fd788..5208dab0c 100644 --- a/internal/bootstrap/bootstrap_linux.go +++ b/internal/bootstrap/bootstrap_linux.go @@ -95,6 +95,7 @@ func NewApp(cfg *config.Config, options ...Option) (*App, error) { var engine *rules.Engine var rs *config.RulesCompileResult + var plan *filter.ApproverPlan if cfg.Filters != nil && cfg.Filters.Rules.Enabled && !cfg.ForwardMode && !cfg.IsCaptureSet() && !cfg.IsFilamentSet() { engine = rules.NewEngine(psnap, cfg) var err error @@ -102,6 +103,7 @@ func NewApp(cfg *config.Config, options ...Option) (*App, error) { if err != nil { return nil, err } + plan = engine.ApproverPlan() if rs != nil { log.Infof("rules compile summary: %s", rs) } @@ -111,7 +113,7 @@ func NewApp(cfg *config.Config, options ...Option) (*App, error) { return &App{ config: cfg, - evs: NewEventSourceControl(psnap, cfg, rs), + evs: NewEventSourceControl(psnap, cfg, rs, plan), engine: engine, psnap: psnap, signals: sigs, diff --git a/internal/bootstrap/source_linux.go b/internal/bootstrap/source_linux.go index c341c9b55..69765e6d9 100644 --- a/internal/bootstrap/source_linux.go +++ b/internal/bootstrap/source_linux.go @@ -39,8 +39,9 @@ func NewEventSourceControl( psnap ps.Snapshotter, cfg *config.Config, compiler *config.RulesCompileResult, + plan *filter.ApproverPlan, ) *EventSourceControl { - return &EventSourceControl{evs: libebpf.NewEventSource(psnap, cfg, compiler)} + return &EventSourceControl{evs: libebpf.NewEventSource(psnap, cfg, compiler, plan)} } func (s *EventSourceControl) Open(cfg *config.Config) error { diff --git a/internal/ebpf/approver_integration_test.go b/internal/ebpf/approver_integration_test.go new file mode 100644 index 000000000..e599c10c6 --- /dev/null +++ b/internal/ebpf/approver_integration_test.go @@ -0,0 +1,140 @@ +//go:build linux && ebpf_integration + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/filter" + "github.com/rabbitstack/fibratus/pkg/ps" + "github.com/stretchr/testify/require" +) + +// TestApproverDecisionsMatchLoadedPrograms exercises the compiled BPF logic +// rather than the Go model in ApproverPlan.Allows. The two are separate +// implementations of the same predicate, so the soundness property is only +// worth as much as this test. +func TestApproverDecisionsMatchLoadedPrograms(t *testing.T) { + dir := t.TempDir() + allowed := filepath.Join(dir, "allowed.txt") + require.NoError(t, os.WriteFile(allowed, []byte("x"), 0o600)) + + cfg := testConfig() + plan := filter.PlanFromFilter(mustCompile(t, + "evt.name = 'openat' and file.path startswith '"+dir+"'")) + + es := NewEventSource(ps.NewSnapshotter(), cfg, nil, plan).(*EventSource) + require.NoError(t, es.Open(cfg)) + t.Cleanup(func() { _ = es.Close() }) + + before := es.loader.approverRejects() + + // Inside the approved prefix, so the kernel must let this one through. + fd, err := os.Open(allowed) + require.NoError(t, err) + _ = fd.Close() + + // Outside it, so the kernel must reject these without reserving ringbuf space. + for range 20 { + if f, err := os.Open("/etc/hostname"); err == nil { + _ = f.Close() + } + } + + deadline := time.Now().Add(5 * time.Second) + var sawAllowed, sawRejectedPath bool + for time.Now().Before(deadline) && !sawAllowed { + select { + case evt := <-es.Events(): + if evt.Type != event.Openat { + continue + } + switch evt.GetParamAsString(params.FilePath) { + case allowed: + sawAllowed = true + case "/etc/hostname": + sawRejectedPath = true + } + case err := <-es.Errors(): + t.Fatalf("event source error: %v", err) + case <-time.After(50 * time.Millisecond): + } + } + + require.True(t, sawAllowed, "openat inside the approved prefix was dropped in the kernel") + require.False(t, sawRejectedPath, "openat outside the approved prefix reached userspace") + require.Greater(t, es.loader.approverRejects(), before, "approver reject counter did not advance") +} + +func TestApproverGenerationFlipAndFailedReload(t *testing.T) { + ldr, err := loadCollections() + if err != nil { + t.Fatalf("loading collections: %v", err) + } + t.Cleanup(func() { _ = ldr.Close() }) + + plan := filter.PlanFromFilter(mustCompile(t, "evt.name = 'openat' and file.path startswith '/tmp'")) + require.NoError(t, ldr.populateApprovers(plan)) + gen, err := ldr.approverGen() + require.NoError(t, err) + require.Equal(t, uint32(1), gen) + + require.NoError(t, ldr.populateApprovers(plan)) + gen, err = ldr.approverGen() + require.NoError(t, err) + require.Equal(t, uint32(0), gen) + + oversized := filter.BuildApproverPlan(manyPrefixFilters(t, 300)) + require.Error(t, ldr.populateApprovers(oversized)) + still, err := ldr.approverGen() + require.NoError(t, err) + require.Equal(t, gen, still) +} + +func mustCompile(t *testing.T, expr string) filter.Filter { + t.Helper() + f := filter.New(expr, testConfig()) + require.NoError(t, f.Compile()) + return f +} + +func manyPrefixFilters(t *testing.T, n int) []filter.Filter { + t.Helper() + out := make([]filter.Filter, 0, n) + for i := 0; i < n; i++ { + expr := "evt.name = 'openat' and file.path startswith '" + "/t" + itoa3(i) + "'" + out = append(out, mustCompile(t, expr)) + } + return out +} + +func itoa3(n int) string { + return string([]byte{ + byte('0' + (n/100)%10), + byte('0' + (n/10)%10), + byte('0' + n%10), + }) +} diff --git a/internal/ebpf/approver_test.go b/internal/ebpf/approver_test.go new file mode 100644 index 000000000..36ad5eb23 --- /dev/null +++ b/internal/ebpf/approver_test.go @@ -0,0 +1,125 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "testing" + + "github.com/rabbitstack/fibratus/internal/ebpf/bpf" + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/filter" + "github.com/rabbitstack/fibratus/pkg/ps" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestSetFilterStoresBeforeOpen(t *testing.T) { + cfg := testConfig() + es := NewEventSource(ps.NewSnapshotter(), cfg, nil, nil).(*EventSource) + f := filter.New("evt.name = 'openat' and file.path startswith '/tmp'", cfg) + require.NoError(t, f.Compile()) + es.SetFilter(f) + require.NotNil(t, es.cliPlan) + pol := es.cliPlan.Policy(event.Openat) + require.False(t, pol.DefaultAllow) + assert.True(t, pol.RequireFilename) + assert.Nil(t, es.loader) +} + +func TestReloadApproversWithoutMapsIsNoop(t *testing.T) { + es := NewEventSource(ps.NewSnapshotter(), testConfig(), nil, nil).(*EventSource) + require.NoError(t, es.reloadApprovers()) +} + +func TestPolicyModeKeepsProcessState(t *testing.T) { + pol := filter.TypePolicy{RequireFilename: true, FilePrefix: []string{"/tmp"}} + assert.Equal(t, uint8(0), policyMode(pol, event.Execve)) + assert.Equal(t, uint8(0), policyMode(pol, event.Exit)) + assert.Equal(t, uint8(0), policyMode(pol, event.Clone)) + assert.Equal(t, uint8(approverReqFile), policyMode(pol, event.Openat)) +} + +func TestModeArrayMatchesGeneratedMap(t *testing.T) { + spec, err := bpf.LoadExecve() + require.NoError(t, err) + require.Equal(t, uint32(approverTypeMax*2), spec.Maps[approverModeMapName].MaxEntries, + "approverTypeMax must mirror EVT_TYPE_MAX in c/common/approvers.h") +} + +func BenchmarkApproverReduction(b *testing.B) { + cfg := &config.Config{ + EventSource: config.EventSourceConfig{EnableFileIOEvents: true}, + Filters: &config.Filters{}, + } + f := filter.New("evt.name = 'openat' and file.path startswith '/tmp'", cfg) + if err := f.Compile(); err != nil { + b.Fatal(err) + } + plan := filter.PlanFromFilter(f) + paths := []string{"/tmp/a", "/tmp/b", "/var/log/syslog", "/etc/passwd", "/usr/bin/ls"} + kept := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + s := filter.Sample{Type: event.Openat, Filename: paths[i%len(paths)]} + if plan.Allows(s) { + kept++ + } + } + b.StopTimer() + if b.N > 0 { + b.ReportMetric(float64(b.N-kept)/float64(b.N), "drop_ratio") + } +} + +func TestApproverSoundnessTable(t *testing.T) { + cfg := testConfig() + cases := []struct { + expr string + keep filter.Sample + drop filter.Sample + }{ + { + expr: "evt.name = 'openat' and file.path startswith '/tmp'", + keep: filter.Sample{Type: event.Openat, Filename: "/tmp/x"}, + drop: filter.Sample{Type: event.Openat, Filename: "/etc/passwd"}, + }, + { + expr: "evt.name = 'connect' and net.dport in (80, 443)", + keep: filter.Sample{Type: event.Connect, Port: 443}, + drop: filter.Sample{Type: event.Connect, Port: 22}, + }, + { + expr: "evt.name = 'kill' and ps.pid = 9", + keep: filter.Sample{Type: event.Kill, PID: 9}, + drop: filter.Sample{Type: event.Kill, PID: 1}, + }, + } + for _, tt := range cases { + t.Run(tt.expr, func(t *testing.T) { + f := filter.New(tt.expr, cfg) + require.NoError(t, f.Compile()) + plan := filter.PlanFromFilter(f) + assert.True(t, plan.Allows(tt.keep), tt.expr) + assert.False(t, plan.Allows(tt.drop), tt.expr) + }) + } +} diff --git a/internal/ebpf/consumer.go b/internal/ebpf/consumer.go index ea5ea037b..36d466d6f 100644 --- a/internal/ebpf/consumer.go +++ b/internal/ebpf/consumer.go @@ -42,6 +42,7 @@ var ( lateSnapshots = expvar.NewInt("ebpf.startup.snapshot.late") enrichmentMiss = expvar.NewInt("ebpf.enrichment.miss") ringbufDrops = expvar.NewInt("ebpf.ringbuf.drops") + approverDrops = expvar.NewInt("ebpf.approver.drops") ) func applyProcessState(psnap ps.Snapshotter, evt *event.Event) { diff --git a/internal/ebpf/source.go b/internal/ebpf/source.go index e692659f1..c88a093ba 100644 --- a/internal/ebpf/source.go +++ b/internal/ebpf/source.go @@ -50,8 +50,11 @@ type EventSource struct { evts chan *event.Event errs chan error - filter filter.Filter - listeners []event.Listener + filter filter.Filter + rulesPlan *filter.ApproverPlan + cliPlan *filter.ApproverPlan + approverMu sync.Mutex + listeners []event.Listener loader *loader reader *ringReader @@ -67,9 +70,7 @@ type EventSource struct { } // NewEventSource constructs the Linux eBPF event source. -func NewEventSource(psnap ps.Snapshotter, cfg *config.Config, _ *config.RulesCompileResult) source.EventSource { - // Startup replay pushes queued events before the aggregator starts - // consuming, so the channel must be able to absorb a full pending queue. +func NewEventSource(psnap ps.Snapshotter, cfg *config.Config, _ *config.RulesCompileResult, plan *filter.ApproverPlan) source.EventSource { evts := make(chan *event.Event, defaultPendingCap) return &EventSource{ psnap: psnap, @@ -82,6 +83,7 @@ func NewEventSource(psnap ps.Snapshotter, cfg *config.Config, _ *config.RulesCom pendingCap: defaultPendingCap, stop: make(chan struct{}), done: make(chan struct{}), + rulesPlan: plan, } } @@ -111,8 +113,12 @@ func (e *EventSource) Open(cfg *config.Config) error { if err := ldr.setEnabledTypes(&e.config.EventSource); err != nil { _ = ldr.Close() + e.loader = nil return err } + if err := e.reloadApprovers(); err != nil { + log.Warnf("approver population failed, default-allow: %v", err) + } rd, err := newRingReader(ldr.eventsMap()) if err != nil { @@ -135,11 +141,21 @@ func (e *EventSource) Open(cfg *config.Config) error { time.Sleep(startupDrain) e.finishBaseline() - ringbufDrops.Add(int64(ldr.dropCount())) + e.sampleCounters() log.Infof("eBPF process source is live; %s", e.startupSummary()) return nil } +// sampleCounters mirrors the cumulative kernel-side counters into expvars. The +// maps hold running totals, so this reads them rather than accumulating. +func (e *EventSource) sampleCounters() { + if e.loader == nil { + return + } + ringbufDrops.Set(int64(e.loader.dropCount())) + approverDrops.Set(int64(e.loader.approverRejects())) +} + func (e *EventSource) Close() error { var err error e.once.Do(func() { @@ -149,6 +165,7 @@ func (e *EventSource) Close() error { _ = e.reader.Close() } if e.loader != nil { + e.sampleCounters() err = e.loader.Close() } if started { @@ -168,7 +185,24 @@ func (e *EventSource) Errors() <-chan error { return e.errs } func (e *EventSource) Events() <-chan *event.Event { return e.q.Events() } -func (e *EventSource) SetFilter(f filter.Filter) { e.filter = f } +func (e *EventSource) SetFilter(f filter.Filter) { + e.filter = f + e.approverMu.Lock() + e.cliPlan = filter.PlanFromFilter(f) + e.approverMu.Unlock() + if err := e.reloadApprovers(); err != nil { + log.Warnf("approver reload failed, keeping previous policy: %v", err) + } +} + +func (e *EventSource) reloadApprovers() error { + e.approverMu.Lock() + defer e.approverMu.Unlock() + if e.loader == nil { + return nil + } + return e.loader.populateApprovers(filter.Union(e.rulesPlan, e.cliPlan)) +} func (e *EventSource) RegisterEventListener(lis event.Listener) { e.listeners = append(e.listeners, lis) @@ -310,6 +344,6 @@ func (e *EventSource) dispatch(evt *event.Event) { } func (e *EventSource) startupSummary() string { - return fmt.Sprintf("pending_queued=%d pending_dropped=%d replay_applied=%d snapshot_upserts=%d", - pendingQueued.Value(), pendingDropped.Value(), replayApplied.Value(), snapshotUpserts.Value()) + return fmt.Sprintf("pending_queued=%d pending_dropped=%d replay_applied=%d snapshot_upserts=%d approver_drops=%d", + pendingQueued.Value(), pendingDropped.Value(), replayApplied.Value(), snapshotUpserts.Value(), approverDrops.Value()) } diff --git a/internal/ebpf/source_integration_test.go b/internal/ebpf/source_integration_test.go index f43c1feac..59e5b654b 100644 --- a/internal/ebpf/source_integration_test.go +++ b/internal/ebpf/source_integration_test.go @@ -34,7 +34,7 @@ import ( func TestLiveProcessSource(t *testing.T) { cfg := testConfig() - es := NewEventSource(ps.NewSnapshotter(), cfg, nil).(*EventSource) + es := NewEventSource(ps.NewSnapshotter(), cfg, nil, nil).(*EventSource) if err := es.Open(cfg); err != nil { t.Fatalf("opening process source: %v", err) } @@ -86,7 +86,7 @@ func execLookPath() string { func TestLiveSyscallTelemetry(t *testing.T) { cfg := testConfig() - es := NewEventSource(ps.NewSnapshotter(), cfg, nil).(*EventSource) + es := NewEventSource(ps.NewSnapshotter(), cfg, nil, nil).(*EventSource) if err := es.Open(cfg); err != nil { t.Fatalf("opening process source: %v", err) } diff --git a/internal/ebpf/source_test.go b/internal/ebpf/source_test.go index 7d01d2d1a..3503c79b6 100644 --- a/internal/ebpf/source_test.go +++ b/internal/ebpf/source_test.go @@ -36,12 +36,13 @@ func testConfig() *config.Config { cfg.EventSource.EnableNetEvents = true cfg.EventSource.EnableMemEvents = true cfg.EventSource.Init() + cfg.Filters = &config.Filters{} return cfg } func TestStartupReplayAndLateSnapshot(t *testing.T) { cfg := testConfig() - es := NewEventSource(ps.NewSnapshotter(), cfg, nil).(*EventSource) + es := NewEventSource(ps.NewSnapshotter(), cfg, nil, nil).(*EventSource) hot := sampleExecve() hot.PID = 42 @@ -91,7 +92,7 @@ func TestStartupReplayAndLateSnapshot(t *testing.T) { func TestPIDReuseKeepsDistinctUUIDs(t *testing.T) { cfg := testConfig() - es := NewEventSource(ps.NewSnapshotter(), cfg, nil).(*EventSource) + es := NewEventSource(ps.NewSnapshotter(), cfg, nil, nil).(*EventSource) es.live.Store(true) first := sampleExecve() From 0f0f76657bbdb658310634b59aaf53765d649160 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Tue, 22 Sep 2026 10:08:01 +0200 Subject: [PATCH 55/65] feat(ebpf): Approve file paths written as trailing-star patterns Let the matches operator narrow the in-kernel prefilter instead of forcing default-allow, by rewriting the patterns that have an exact kernel equivalent rather than matching globs in BPF. A pattern with no wildcard becomes an exact lookup, and one ending in a single star becomes an LPM prefix. Both rewrites are exact, not merely conservative, because a trailing star spans every remaining byte including a path separator, exactly as wildcard.matchCaseSensitive does. Runs of stars collapse first, so /tmp/** arrives here as /tmp/*. A star anywhere else, or any '?', leaves the event type default-allow. Matching globs in the kernel was the obvious approach and does not survive the verifier. A faithful port of matchCaseSensitive backtracks, so every byte comparison forks a path the verifier has to walk: at eight patterns it exceeded the 8192 jump-sequence limit, and cutting it to two patterns over 64 steps still burned the full 1M instruction budget across 29668 states. Directory-aware globbing would verify more cheaply but reject paths the operator accepts in userspace, which is the silent false negative this prefilter exists to avoid. imatches stays unsupported: folding in the kernel would have to agree with unicode.ToLower on every rune. --- internal/ebpf/approver_integration_test.go | 43 ++++++++----- internal/ebpf/bpf/ctl_bpfeb.o | Bin 48016 -> 48016 bytes internal/ebpf/bpf/ctl_bpfel.o | Bin 47632 -> 47632 bytes internal/ebpf/bpf/file_bpfeb.o | Bin 167576 -> 167576 bytes internal/ebpf/bpf/file_bpfel.o | Bin 166808 -> 166808 bytes internal/ebpf/bpf/mem_bpfeb.o | Bin 68248 -> 68248 bytes internal/ebpf/bpf/mem_bpfel.o | Bin 67960 -> 67960 bytes internal/ebpf/bpf/net_bpfeb.o | Bin 70208 -> 70208 bytes internal/ebpf/bpf/net_bpfel.o | Bin 69920 -> 69920 bytes internal/ebpf/c/common/approvers.h | 12 ++++ pkg/filter/approver.go | 71 +++++++++++++++++++++ pkg/filter/approver_fuzz_linux_test.go | 7 ++ pkg/filter/approver_linux_test.go | 57 +++++++++++++++++ 13 files changed, 175 insertions(+), 15 deletions(-) diff --git a/internal/ebpf/approver_integration_test.go b/internal/ebpf/approver_integration_test.go index e599c10c6..b8949d859 100644 --- a/internal/ebpf/approver_integration_test.go +++ b/internal/ebpf/approver_integration_test.go @@ -43,36 +43,45 @@ func TestApproverDecisionsMatchLoadedPrograms(t *testing.T) { require.NoError(t, os.WriteFile(allowed, []byte("x"), 0o600)) cfg := testConfig() + // Written as a matches pattern rather than startswith so the rewrite into + // the LPM trie is covered too. plan := filter.PlanFromFilter(mustCompile(t, - "evt.name = 'openat' and file.path startswith '"+dir+"'")) + "evt.name = 'openat' and file.path matches '"+dir+"/*'")) es := NewEventSource(ps.NewSnapshotter(), cfg, nil, plan).(*EventSource) require.NoError(t, es.Open(cfg)) t.Cleanup(func() { _ = es.Close() }) before := es.loader.approverRejects() - - // Inside the approved prefix, so the kernel must let this one through. - fd, err := os.Open(allowed) - require.NoError(t, err) - _ = fd.Close() - - // Outside it, so the kernel must reject these without reserving ringbuf space. - for range 20 { - if f, err := os.Open("/etc/hostname"); err == nil { + touch := func(path string) { + if f, err := os.Open(path); err == nil { _ = f.Close() } } - deadline := time.Now().Add(5 * time.Second) + // Keep generating attempts while draining. Correlating sys_enter_openat + // with its exit goes through a bounded LRU map, so on a loaded machine any + // single open can lose its scratch entry and arrive with no path at all. + // Retrying makes the assertion about the approver rather than about that. + attempts := time.NewTicker(100 * time.Millisecond) + defer attempts.Stop() + touch(allowed) + touch("/etc/hostname") + + deadline := time.Now().Add(30 * time.Second) var sawAllowed, sawRejectedPath bool + seen := make([]string, 0, 16) for time.Now().Before(deadline) && !sawAllowed { select { case evt := <-es.Events(): if evt.Type != event.Openat { continue } - switch evt.GetParamAsString(params.FilePath) { + path := evt.GetParamAsString(params.FilePath) + if len(seen) < cap(seen) { + seen = append(seen, path) + } + switch path { case allowed: sawAllowed = true case "/etc/hostname": @@ -80,12 +89,16 @@ func TestApproverDecisionsMatchLoadedPrograms(t *testing.T) { } case err := <-es.Errors(): t.Fatalf("event source error: %v", err) - case <-time.After(50 * time.Millisecond): + case <-attempts.C: + touch(allowed) + touch("/etc/hostname") } } - require.True(t, sawAllowed, "openat inside the approved prefix was dropped in the kernel") - require.False(t, sawRejectedPath, "openat outside the approved prefix reached userspace") + require.True(t, sawAllowed, + "openat matching the approved pattern never reached userspace; wanted %q, saw %q, rejects %d -> %d", + allowed, seen, before, es.loader.approverRejects()) + require.False(t, sawRejectedPath, "openat outside the approved pattern reached userspace") require.Greater(t, es.loader.approverRejects(), before, "approver reject counter did not advance") } diff --git a/internal/ebpf/bpf/ctl_bpfeb.o b/internal/ebpf/bpf/ctl_bpfeb.o index 769b9f2c6ff59b42f63a784d912f2d46b82eb699..0769585e811e3f8f658ee0e8720c87baf8f9f0df 100644 GIT binary patch delta 4220 zcmZ9OF^D5o7{@=~B(qu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/ebpf/bpf/file_bpfeb.o b/internal/ebpf/bpf/file_bpfeb.o index 77478a41aefc426cfa05720e249cc9cd43b86524..46747d3c1d3006e7f1efa3450364162d558e9a86 100644 GIT binary patch delta 7595 zcmeI0ziX307{|YN7xE@=t=fj<)e3K_lY(d_lR*SsbhBc?ZpJNxNCr`dLNXK@aLEvO z6ZORof^n-*sDomLiUm7l@J9r}Qbim@GF0qP(C6|#39tSI3Ec1wpL_0o?!I^Lm*?KA z`*z*8%PZnkLsYzML!{4EZ9rsz=sZ0iA!||M9P>BG2NF;h0=5#6j}(xY3s}8^tau)! zxunx1D*PI!NmTz$lWcOD8K~S8kbK5`6YBIK;udoQa@w=*iS)JOF>3B|a|bd*vrFzU ze}T-!ffPc#mzdtsYOG&S`3d3!A)Y3tXAt)mX_(S=on|Izj?F?9_Ykwl9`7U0hvGDi zRDt;h)V%J0C&W5lVZIBsFiy;?5qk(#*8P__{uD=4P0zbIXi&9d#LFS}&fllysFSo5 zFGp+>s%{bUa>OU0nl!FMeYCs*?+-C3&hiKGToBirx#qp5VM-gcnNE>k%Rshu+A{MQ z$PO)s!}8*@kZ)=BPL<;Y$WJsaXZb&FG5e5TX}O(E=68_ab^k8&7E1C*1USgL>~Y9$ z0-z73r_0VlZd2Ut^DW37((JNsdjWEn25^sZ|30%$`#DsE1h{h??{l7c_cBzA6uX6f z12JuwTMV&|mjfP~g4&=BcB{-Mpw>0lna@G3d0Ahi54ZI^*SVR#vo;BLI{{k_h;8q- zFWgB9+JH3m)%!U10y47t*cX4I#;rp}r=%V*`G_N>(spN(gYXZiov)Y%cJvsd1Tljdw}JZn6w?|24x rQbS#5f4?{Xv;BKzb2c_-<54&puWpH}rp}r=YwGOi)Y-+KVq)np4hpzB delta 7595 zcmeI0ziX307{|YNCwY^%t+q{*w^n#lopjMorh^E&*g>#j!3=^CGGq|RAey0&3_=So z8H6`cU(99%hX{doP|ToM(4m7rA_#^Gj?zVRDCl!}pM+Qcf&^}OhtECFdw1Wv_u+f@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Pk2fg(V?9eAZbNDkm zysfCz;zhWtonN4#Xrsk-_)sF-#X*G^@ZQW|ZFt@t1=C(SHskE9ltXq{R^tx^}hjnRn+OTd_qL5ZgSeI5MlD$?d z*q{fx)fL0s>XX-Qt5S)yDwRm9QQUfQ%&=}XVOY1Cgwg8I8@JUwrqb#xEUgw{X|)7P zt1B(ufTh)4SXynud#%!dcfq995G<{RaGj;qC@if?6k>@&T1{iWI1BH!D!uT)Z8g8Y z!EJdKmR3u!v|5JI>RiojwT`K@+JMpOR?TfS8uwmaS`Ds0KWLTcpjA|I(5m~->c4FD J_~xGr{{WKMuWSGS diff --git a/internal/ebpf/c/common/approvers.h b/internal/ebpf/c/common/approvers.h index 0aa935591..c9496b3f8 100644 --- a/internal/ebpf/c/common/approvers.h +++ b/internal/ebpf/c/common/approvers.h @@ -15,6 +15,13 @@ #define APPR_GENS 2 #define APPR_MODE_MAX (EVT_TYPE_MAX * APPR_GENS) +/* There is no in-kernel glob matcher. A backtracking matcher forks a verifier + * path at every byte comparison, and even two patterns over 64 steps exhausts + * the 1M instruction budget. Userspace instead rewrites the patterns it can + * prove equivalent to a prefix into the LPM trie below, and leaves the rest + * default-allow. + */ + struct approver_pid_key { u32 gen; u32 type; @@ -39,6 +46,7 @@ struct approver_lpm_key { u8 path[EVT_FILENAME_LEN]; }; + struct { __uint(type, BPF_MAP_TYPE_ARRAY); __uint(max_entries, 1); @@ -111,6 +119,7 @@ struct { __type(value, u64); } approver_reject SEC(".maps"); + static __always_inline void account_approver_reject(void) { u32 key = 0; @@ -214,6 +223,9 @@ static __always_inline int event_approved(u32 type, u16 port, u32 truncated) if (*mode & APPR_REQ_PID) { pkey.gen = gen; pkey.type = type; + /* The init-namespace tgid, which is also what fill_current_ids puts on + * the event, so a ps.pid predicate compares like with like. + */ pkey.pid = bpf_get_current_pid_tgid() >> 32; if (!bpf_map_lookup_elem(&approver_pid, &pkey)) return 0; diff --git a/pkg/filter/approver.go b/pkg/filter/approver.go index 12b4bb42e..453bdb94e 100644 --- a/pkg/filter/approver.go +++ b/pkg/filter/approver.go @@ -371,7 +371,28 @@ func extractFilenames(ex *Extraction, expr *ql.BinaryExpr) { } ex.FilePrefix = append(ex.FilePrefix, name) } + case ql.Matches: + names, ok := rhsStrings(expr.RHS) + if !ok { + ex.Unsupported = true + return + } + for _, name := range names { + literal, prefix, ok := globAsPrefix(name) + if !ok { + ex.Unsupported = true + return + } + switch { + case literal != "": + ex.FileExact = append(ex.FileExact, literal) + case prefix != "": + ex.FilePrefix = append(ex.FilePrefix, prefix) + } + } default: + // imatches stays out: case folding the path in the kernel would have to + // agree with unicode.ToLower on every rune userspace folds. ex.Unsupported = true } } @@ -487,6 +508,56 @@ func clonePlan(p *ApproverPlan) *ApproverPlan { return out } +// globAsPrefix rewrites a matches pattern into the exact or prefix form the +// kernel can already evaluate. There is no in-kernel glob matcher because a +// backtracking one is not verifiable, so only patterns provably equivalent to +// one of those two forms are accepted: +// +// /etc/passwd -> exact, no wildcard at all +// /tmp/* -> prefix, since '*' spans every remaining byte including '/' +// * -> vacuous, matches everything and constrains nothing +// +// A '*' anywhere but the end, or any '?', reports false and leaves the event +// type default-allow. Callers must pass the pattern through collapseStars so +// /tmp/** reaches here as /tmp/*. +func globAsPrefix(pattern string) (literal, prefix string, ok bool) { + pattern = collapseStars(pattern) + if strings.ContainsRune(pattern, '?') { + return "", "", false + } + switch strings.Count(pattern, "*") { + case 0: + return pattern, "", true + case 1: + if !strings.HasSuffix(pattern, "*") { + return "", "", false + } + return "", strings.TrimSuffix(pattern, "*"), true + default: + return "", "", false + } +} + +// collapseStars rewrites runs of '*' as a single '*'. The two are equivalent to +// matchCaseSensitive, which only ever remembers the most recent star position. +func collapseStars(pattern string) string { + if !strings.Contains(pattern, "**") { + return pattern + } + var b strings.Builder + b.Grow(len(pattern)) + var prevStar bool + for i := range len(pattern) { + c := pattern[i] + if c == '*' && prevStar { + continue + } + prevStar = c == '*' + b.WriteByte(c) + } + return b.String() +} + func matchFilename(pol TypePolicy, path string) bool { if slices.Contains(pol.FileExact, path) { return true diff --git a/pkg/filter/approver_fuzz_linux_test.go b/pkg/filter/approver_fuzz_linux_test.go index 910bd6b5a..6e64728c0 100644 --- a/pkg/filter/approver_fuzz_linux_test.go +++ b/pkg/filter/approver_fuzz_linux_test.go @@ -37,6 +37,13 @@ var fuzzExprs = []string{ "evt.name = 'openat' and file.path in ('/tmp/a', '/tmp/b') and ps.pid = 42", "evt.name in ('openat', 'connect') and ps.pid in (1, 42)", "evt.category = 'file' and file.path startswith '/var'", + "evt.name = 'openat' and file.path matches '/tmp/*'", + "evt.name = 'openat' and file.path matches ('/tmp/*', '/var/tmp/**')", + "evt.name = 'openat' and file.path matches '/etc/passwd'", + "evt.name = 'openat' and file.path matches '/tmp/*/evil'", + "evt.name = 'openat' and file.path matches '*.so'", + "evt.name = 'openat' and file.path matches '*'", + "evt.name = 'openat' and file.path imatches '/TMP/*'", "evt.name = 'connect' and net.dport in (80, 443)", "evt.name = 'connect' and net.dport = 443 and ps.pid = 42", "evt.name = 'kill' and ps.pid = 42", diff --git a/pkg/filter/approver_linux_test.go b/pkg/filter/approver_linux_test.go index 8d60a95ea..0eaf07089 100644 --- a/pkg/filter/approver_linux_test.go +++ b/pkg/filter/approver_linux_test.go @@ -23,6 +23,7 @@ import ( "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/util/wildcard" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -100,6 +101,62 @@ func TestProcessNameIsNotExtractable(t *testing.T) { assert.True(t, mixed.Policy(event.Openat).DefaultAllow) } +func TestExtractMatchesTrailingStar(t *testing.T) { + f := compileApprover(t, "evt.name = 'openat' and file.path matches ('/tmp/*', '/var/tmp/*')") + ex := f.(ApproverProvider).ApproverExtraction() + require.False(t, ex.Unsupported) + assert.Equal(t, []string{"/tmp/", "/var/tmp/"}, ex.FilePrefix) + + plan := PlanFromFilter(f) + assert.True(t, plan.Allows(Sample{Type: event.Openat, Filename: "/tmp/dropper"})) + assert.True(t, plan.Allows(Sample{Type: event.Openat, Filename: "/tmp/a/b/c"})) + assert.True(t, plan.Allows(Sample{Type: event.Openat, Filename: "/var/tmp/x"})) + assert.False(t, plan.Allows(Sample{Type: event.Openat, Filename: "/etc/passwd"})) +} + +// A trailing '*' spans every remaining byte, separators included, so rewriting +// it to a prefix is exact rather than merely conservative. +func TestTrailingStarRewriteMatchesOperator(t *testing.T) { + paths := []string{"/tmp/x", "/tmp/a/b/c", "/tmp/", "/tmpfoo", "/etc/passwd", ""} + for _, pattern := range []string{"/tmp/*", "/tmp/**", "/etc/passwd", "*"} { + literal, prefix, ok := globAsPrefix(pattern) + require.True(t, ok, pattern) + pol := TypePolicy{RequireFilename: true} + switch { + case literal != "": + pol.FileExact = []string{literal} + case prefix != "": + pol.FilePrefix = []string{prefix} + default: + continue // '*' constrains nothing + } + for _, path := range paths { + assert.Equal(t, wildcard.Match(pattern, path, true), matchFilename(pol, path), + "pattern=%q path=%q", pattern, path) + } + } +} + +// Patterns that are not reducible to a prefix have no kernel equivalent, so +// they must widen to default-allow rather than be approximated. +func TestNonPrefixGlobsAreDefaultAllow(t *testing.T) { + for _, expr := range []string{ + "evt.name = 'openat' and file.path matches '/tmp/*/evil'", + "evt.name = 'openat' and file.path matches '*.so'", + "evt.name = 'openat' and file.path matches '/tmp/?vil'", + "evt.name = 'openat' and file.path matches ('/tmp/*', '*.so')", + "evt.name = 'openat' and file.path imatches '/TMP/*'", + } { + plan := PlanFromFilter(compileApprover(t, expr)) + assert.True(t, plan.Policy(event.Openat).DefaultAllow, expr) + } +} + +func TestVacuousStarDoesNotConstrain(t *testing.T) { + plan := PlanFromFilter(compileApprover(t, "evt.name = 'openat' and file.path matches '*'")) + assert.True(t, plan.Policy(event.Openat).DefaultAllow) +} + func TestBuildPlanIntersectsRequiredFields(t *testing.T) { pid := compileApprover(t, "evt.name = 'openat' and ps.pid = 7") path := compileApprover(t, "evt.name = 'openat' and file.path startswith '/tmp'") From 5fb51d6d13e2b74a14724f7bbd764bac2a35cc35 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Tue, 22 Sep 2026 11:56:42 +0200 Subject: [PATCH 56/65] test(ebpf): Cover path lists and separate capture from approval Pin that a list of literal paths resolves entirely in the kernel's exact-match hash, since nothing about it needs the wildcard machinery. Run the privileged prefilter test twice, once with no approver and once with one. The first pass establishes that the capture path reports the open at all, so a failure in the second pass is about the prefilter and not about an enter/exit correlation that lost its scratch entry. --- internal/ebpf/approver_integration_test.go | 98 +++++++++++++++------- pkg/filter/approver_fuzz_linux_test.go | 1 - pkg/filter/approver_linux_test.go | 35 +++++--- 3 files changed, 89 insertions(+), 45 deletions(-) diff --git a/internal/ebpf/approver_integration_test.go b/internal/ebpf/approver_integration_test.go index b8949d859..a29af5e27 100644 --- a/internal/ebpf/approver_integration_test.go +++ b/internal/ebpf/approver_integration_test.go @@ -21,7 +21,9 @@ package ebpf import ( + "fmt" "os" + "os/exec" "path/filepath" "testing" "time" @@ -42,64 +44,98 @@ func TestApproverDecisionsMatchLoadedPrograms(t *testing.T) { allowed := filepath.Join(dir, "allowed.txt") require.NoError(t, os.WriteFile(allowed, []byte("x"), 0o600)) - cfg := testConfig() + // Establish first that the capture path reports this exact open with no + // approver installed. If that fails, the problem is the enter/exit + // correlation rather than the prefilter, and the second phase would + // otherwise blame the approver for it. + baseline := watchOpens(t, nil, allowed) + require.True(t, baseline.sawAllowed, + "capture never reported the open with no approver installed; pid=%d selfOpens=%d saw %q", + os.Getpid(), baseline.selfOpens, baseline.seen) + // Written as a matches pattern rather than startswith so the rewrite into // the LPM trie is covered too. plan := filter.PlanFromFilter(mustCompile(t, "evt.name = 'openat' and file.path matches '"+dir+"/*'")) + got := watchOpens(t, plan, allowed) + + require.True(t, got.sawAllowed, + "openat matching the approved pattern never reached userspace; wanted %q, selfOpens=%d saw %q, rejects %d -> %d", + allowed, got.selfOpens, got.seen, got.rejectsBefore, got.rejectsAfter) + require.False(t, got.sawDenied, "openat outside the approved pattern reached userspace") + require.Greater(t, got.rejectsAfter, got.rejectsBefore, "approver reject counter did not advance") +} + +type openWatch struct { + sawAllowed bool + sawDenied bool + seen []string + selfOpens int + rejectsBefore uint64 + rejectsAfter uint64 +} + +const deniedPath = "/etc/hostname" +// watchOpens repeatedly opens allowed and a denied path while draining events, +// returning what reached userspace. Correlating sys_enter_openat with its exit +// goes through a bounded LRU map, so on a loaded machine any single open can +// lose its scratch entry and arrive with no path at all. Retrying keeps the +// assertions about the approver rather than about that. +func watchOpens(t *testing.T, plan *filter.ApproverPlan, allowed string) openWatch { + t.Helper() + cfg := testConfig() es := NewEventSource(ps.NewSnapshotter(), cfg, nil, plan).(*EventSource) require.NoError(t, es.Open(cfg)) - t.Cleanup(func() { _ = es.Close() }) + defer func() { _ = es.Close() }() - before := es.loader.approverRejects() - touch := func(path string) { - if f, err := os.Open(path); err == nil { - _ = f.Close() - } - } + w := openWatch{seen: make([]string, 0, 16), rejectsBefore: es.loader.approverRejects()} - // Keep generating attempts while draining. Correlating sys_enter_openat - // with its exit goes through a bounded LRU map, so on a loaded machine any - // single open can lose its scratch entry and arrive with no path at all. - // Retrying makes the assertion about the approver rather than about that. - attempts := time.NewTicker(100 * time.Millisecond) + attempts := time.NewTicker(200 * time.Millisecond) defer attempts.Stop() - touch(allowed) - touch("/etc/hostname") + touch := func() { openFromChild(t, allowed) } + touch() - deadline := time.Now().Add(30 * time.Second) - var sawAllowed, sawRejectedPath bool - seen := make([]string, 0, 16) - for time.Now().Before(deadline) && !sawAllowed { + deadline := time.Now().Add(20 * time.Second) + for time.Now().Before(deadline) && !w.sawAllowed { select { case evt := <-es.Events(): if evt.Type != event.Openat { continue } path := evt.GetParamAsString(params.FilePath) - if len(seen) < cap(seen) { - seen = append(seen, path) + if evt.PID == uint64(os.Getpid()) { + w.selfOpens++ + } + if len(w.seen) < cap(w.seen) { + w.seen = append(w.seen, fmt.Sprintf("pid=%d sys=%d %s", + evt.PID, evt.GetParamAsUint32(params.SyscallID), path)) } switch path { case allowed: - sawAllowed = true - case "/etc/hostname": - sawRejectedPath = true + w.sawAllowed = true + case deniedPath: + w.sawDenied = true } case err := <-es.Errors(): t.Fatalf("event source error: %v", err) case <-attempts.C: - touch(allowed) - touch("/etc/hostname") + touch() } } + w.rejectsAfter = es.loader.approverRejects() + return w +} - require.True(t, sawAllowed, - "openat matching the approved pattern never reached userspace; wanted %q, saw %q, rejects %d -> %d", - allowed, seen, before, es.loader.approverRejects()) - require.False(t, sawRejectedPath, "openat outside the approved pattern reached userspace") - require.Greater(t, es.loader.approverRejects(), before, "approver reject counter did not advance") +// openFromChild opens the two paths from a short-lived child rather than from +// the test process. Syscall tracepoints did not report this process's own opens +// on every runner, while child processes are reported reliably, which is also +// how the other privileged tests here drive syscalls. +func openFromChild(t *testing.T, allowed string) { + t.Helper() + cmd := exec.Command("/bin/sh", "-c", "cat -- \"$1\" >/dev/null 2>&1; cat -- \"$2\" >/dev/null 2>&1", + "sh", allowed, deniedPath) + _ = cmd.Run() } func TestApproverGenerationFlipAndFailedReload(t *testing.T) { diff --git a/pkg/filter/approver_fuzz_linux_test.go b/pkg/filter/approver_fuzz_linux_test.go index 6e64728c0..664bed6da 100644 --- a/pkg/filter/approver_fuzz_linux_test.go +++ b/pkg/filter/approver_fuzz_linux_test.go @@ -50,7 +50,6 @@ var fuzzExprs = []string{ "evt.name = 'openat' and file.path != '/tmp/x'", "evt.name = 'openat' and not (file.path = '/tmp/x')", "evt.name = 'openat' and (ps.pid = 1 or file.path = '/tmp/x')", - "evt.name = 'openat' and file.path matches '/tmp/*'", "evt.name = 'openat' and ps.name = 'bash'", "file.path startswith '/tmp'", "ps.pid = 42", diff --git a/pkg/filter/approver_linux_test.go b/pkg/filter/approver_linux_test.go index 0eaf07089..e970c24cf 100644 --- a/pkg/filter/approver_linux_test.go +++ b/pkg/filter/approver_linux_test.go @@ -64,26 +64,17 @@ func TestExtractPortList(t *testing.T) { } func TestExtractUnsupportedShapesDefaultAllow(t *testing.T) { - cases := []string{ + for _, expr := range []string{ "evt.name = 'openat' and file.path != '/etc/passwd'", "evt.name = 'openat' and not (file.path = '/etc/passwd')", "evt.name = 'openat' and (ps.pid = 1 or file.path = '/tmp/x')", - "evt.name = 'openat' and file.path matches '/tmp/*'", "evt.name = 'openat' and ps.pid > 1", "evt.name = 'openat' and lower(file.path) = '/tmp/x'", - `sequence -|evt.name = 'execve'| -|evt.name = 'connect'|`, - } - for _, expr := range cases { - f := compileApprover(t, expr) - plan := PlanFromFilter(f) - assert.True(t, plan.Policy(event.Openat).DefaultAllow || plan.Policy(event.Connect).DefaultAllow || plan.Policy(event.Execve).DefaultAllow, expr) + } { + plan := PlanFromFilter(compileApprover(t, expr)) + assert.True(t, plan.Policy(event.Openat).DefaultAllow, expr) } - orPlan := PlanFromFilter(compileApprover(t, "evt.name = 'openat' and (ps.pid = 1 or file.path = '/tmp/x')")) - assert.True(t, orPlan.Policy(event.Openat).DefaultAllow) - seqPlan := PlanFromFilter(compileApprover(t, `sequence |evt.name = 'execve'| |evt.name = 'connect'|`)) @@ -91,6 +82,24 @@ func TestExtractUnsupportedShapesDefaultAllow(t *testing.T) { assert.True(t, seqPlan.Policy(event.Connect).DefaultAllow) } +// A list of literal paths needs no wildcard machinery: every element is an +// exact key, so the whole condition resolves in the kernel's hash lookup. +func TestExtractFilePathList(t *testing.T) { + f := compileApprover(t, "evt.name = 'openat' and file.path in ('/etc/passwd', '/etc/shadow')") + ex := f.(ApproverProvider).ApproverExtraction() + require.False(t, ex.Unsupported) + assert.Equal(t, []string{"/etc/passwd", "/etc/shadow"}, ex.FileExact) + assert.Empty(t, ex.FilePrefix) + + plan := PlanFromFilter(f) + pol := plan.Policy(event.Openat) + require.False(t, pol.DefaultAllow) + assert.True(t, pol.RequireFilename) + assert.True(t, plan.Allows(Sample{Type: event.Openat, Filename: "/etc/passwd"})) + assert.True(t, plan.Allows(Sample{Type: event.Openat, Filename: "/etc/shadow"})) + assert.False(t, plan.Allows(Sample{Type: event.Openat, Filename: "/etc/hosts"})) +} + // ps.name is snapshot state while the kernel can only read the live task comm, // so a process name predicate must never narrow the in-kernel prefilter. func TestProcessNameIsNotExtractable(t *testing.T) { From 7cbb4b99c437f01d1fed7c010b6f359a9b0c3317 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 23 Sep 2026 10:49:40 +0200 Subject: [PATCH 57/65] refactor: Confine platform-only helpers to their build tags Several helpers in shared files are reachable only from Windows code, so a Linux build sees them as dead. Move containsEventTypes and containsFieldMatch next to their only caller in compiler_windows.go, and isNumber next to the field definitions that validate with it. Drop the Linux framePID and threadpool accessor stubs, which nothing calls now that callstack and threadpool fields are Windows-only. event.PID is an alias for the same integer the params accessor already returns on both platforms, so the conversions around MustGetPid never converted anything. This makes the packages the Linux port owns lint clean, which the next commit turns into a CI gate. --- pkg/filter/accessor_stubs_linux.go | 11 +++-- pkg/filter/fields/defs_windows.go | 11 +++++ pkg/filter/fields/fields.go | 12 ----- pkg/filter/util_linux.go | 28 ------------ pkg/rules/compiler.go | 71 ------------------------------ pkg/rules/compiler_windows.go | 69 +++++++++++++++++++++++++++++ pkg/rules/engine_linux_test.go | 7 +++ pkg/rules/sequence.go | 8 ++-- 8 files changed, 96 insertions(+), 121 deletions(-) delete mode 100644 pkg/filter/util_linux.go diff --git a/pkg/filter/accessor_stubs_linux.go b/pkg/filter/accessor_stubs_linux.go index f9e2166e7..298f22b92 100644 --- a/pkg/filter/accessor_stubs_linux.go +++ b/pkg/filter/accessor_stubs_linux.go @@ -35,9 +35,8 @@ func (noopAccessor) SetFields([]Field) {} func (noopAccessor) SetSegments([]fields.Segment) {} func (noopAccessor) IsFieldAccessible(*event.Event) bool { return false } -func newModuleAccessor() Accessor { return noopAccessor{} } -func newRegistryAccessor() Accessor { return noopAccessor{} } -func newHandleAccessor() Accessor { return noopAccessor{} } -func newPEAccessor() Accessor { return noopAccessor{} } -func newDNSAccessor() Accessor { return noopAccessor{} } -func newThreadpoolAccessor() Accessor { return noopAccessor{} } +func newModuleAccessor() Accessor { return noopAccessor{} } +func newRegistryAccessor() Accessor { return noopAccessor{} } +func newHandleAccessor() Accessor { return noopAccessor{} } +func newPEAccessor() Accessor { return noopAccessor{} } +func newDNSAccessor() Accessor { return noopAccessor{} } diff --git a/pkg/filter/fields/defs_windows.go b/pkg/filter/fields/defs_windows.go index 3647ac5e7..1e48cc2d8 100644 --- a/pkg/filter/fields/defs_windows.go +++ b/pkg/filter/fields/defs_windows.go @@ -29,6 +29,17 @@ import ( func platformString() params.Type { return params.UnicodeString } func platformAnsiString() params.Type { return params.AnsiString } +// isNumber is the field argument validation function that +// returns true if all characters are digits. +var isNumber = func(s string) bool { + for _, c := range s { + if !unicode.IsNumber(c) { + return false + } + } + return true +} + var fields = platformFields(map[Field]FieldInfo{ EvtPID: {EvtPID, "process identifier generating the event", params.Uint32, []string{"evt.pid = 6"}, nil, nil}, EvtTID: {EvtTID, "thread identifier generating the event", params.Uint32, []string{"evt.tid = 1024"}, nil, nil}, diff --git a/pkg/filter/fields/fields.go b/pkg/filter/fields/fields.go index 56c920a89..272a32a12 100644 --- a/pkg/filter/fields/fields.go +++ b/pkg/filter/fields/fields.go @@ -21,7 +21,6 @@ package fields import ( "github.com/rabbitstack/fibratus/pkg/event/params" "sort" - "unicode" ) // FieldInfo is the field metadata descriptor. @@ -34,17 +33,6 @@ type FieldInfo struct { Argument *Argument } -// isNumber is the field argument validation function that -// returns true if all characters are digits. -var isNumber = func(s string) bool { - for _, c := range s { - if !unicode.IsNumber(c) { - return false - } - } - return true -} - // Argument defines field argument information. type Argument struct { // Optional indicates if the argument is optional. diff --git a/pkg/filter/util_linux.go b/pkg/filter/util_linux.go deleted file mode 100644 index 752ccdb36..000000000 --- a/pkg/filter/util_linux.go +++ /dev/null @@ -1,28 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package filter - -import "github.com/rabbitstack/fibratus/pkg/event" - -// framePID returns the process identifier associated with the event. -func framePID(e *event.Event) event.PID { - return e.PID -} diff --git a/pkg/rules/compiler.go b/pkg/rules/compiler.go index 8c3a84d6b..494119cae 100644 --- a/pkg/rules/compiler.go +++ b/pkg/rules/compiler.go @@ -21,8 +21,6 @@ package rules import ( "expvar" "fmt" - "slices" - "strings" semver "github.com/hashicorp/go-version" "github.com/rabbitstack/fibratus/pkg/config" @@ -247,75 +245,6 @@ func (c *compiler) visitApproverPredicates(node ql.Node) { ql.WalkFunc(node, walk) } -func (c *compiler) containsEventTypes(root ql.Node, types ...event.Type) bool { - var contains bool - ql.WalkFunc(root, func(n ql.Node) { - expr, ok := n.(*ql.BinaryExpr) - if !ok { - return - } - lhs, ok := expr.LHS.(*ql.FieldLiteral) - if !ok || lhs.Field != fields.EvtName { - return - } - - vals, ok := rhsToStrings(expr.RHS) - if !ok { - return - } - - evts := make([]event.Type, 0, len(vals)) - for _, v := range vals { - typ, ok := event.ParseType(v) - if !ok { - continue - } - evts = append(evts, typ) - } - - for _, typ := range types { - if slices.Contains(evts, typ) { - contains = true - return - } - } - }) - return contains -} - -func (c *compiler) containsFieldMatch(root ql.Node, field fields.Field, op ql.Token, val string) bool { - var contains bool - ql.WalkFunc(root, func(n ql.Node) { - expr, ok := n.(*ql.BinaryExpr) - if !ok { - return - } - - lhs, ok := expr.LHS.(*ql.FieldLiteral) - if !ok || lhs.Field != field { - return - } - - if expr.Op != op { - return - } - - values, ok := rhsToStrings(expr.RHS) - if !ok { - return - } - for _, v := range values { - if strings.EqualFold(v, val) { - contains = true - return - } - } - }) - return contains -} - -// isNegated walks up the AST to check if the given node -// is a direct child of a NOT unary expression. func (c *compiler) isNegated(root ql.Node, node ql.Node) bool { negated := false ql.WalkFunc(root, func(n ql.Node) { diff --git a/pkg/rules/compiler_windows.go b/pkg/rules/compiler_windows.go index 8b8320cc2..6a0affa08 100644 --- a/pkg/rules/compiler_windows.go +++ b/pkg/rules/compiler_windows.go @@ -22,6 +22,9 @@ package rules import ( + "slices" + "strings" + "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/event" "github.com/rabbitstack/fibratus/pkg/filter/fields" @@ -61,3 +64,69 @@ func updatePlatformCompileResult(rs *config.RulesCompileResult, typ event.Type) rs.HasAuditAPIEvents = true } } + +func (c *compiler) containsEventTypes(root ql.Node, types ...event.Type) bool { + var contains bool + ql.WalkFunc(root, func(n ql.Node) { + expr, ok := n.(*ql.BinaryExpr) + if !ok { + return + } + lhs, ok := expr.LHS.(*ql.FieldLiteral) + if !ok || lhs.Field != fields.EvtName { + return + } + + vals, ok := rhsToStrings(expr.RHS) + if !ok { + return + } + + evts := make([]event.Type, 0, len(vals)) + for _, v := range vals { + evts = append(evts, event.NameToType(v)) + } + + for _, typ := range types { + if slices.Contains(evts, typ) { + contains = true + return + } + } + }) + return contains +} + +func (c *compiler) containsFieldMatch(root ql.Node, field fields.Field, op ql.Token, val string) bool { + var contains bool + ql.WalkFunc(root, func(n ql.Node) { + expr, ok := n.(*ql.BinaryExpr) + if !ok { + return + } + + lhs, ok := expr.LHS.(*ql.FieldLiteral) + if !ok || lhs.Field != field { + return + } + + if expr.Op != op { + return + } + + values, ok := rhsToStrings(expr.RHS) + if !ok { + return + } + for _, v := range values { + if strings.EqualFold(v, val) { + contains = true + return + } + } + }) + return contains +} + +// isNegated walks up the AST to check if the given node +// is a direct child of a NOT unary expression. diff --git a/pkg/rules/engine_linux_test.go b/pkg/rules/engine_linux_test.go index 932d75c12..d7ebb224f 100644 --- a/pkg/rules/engine_linux_test.go +++ b/pkg/rules/engine_linux_test.go @@ -237,8 +237,15 @@ func TestLinuxLifecycleSequence(t *testing.T) { Metadata: make(map[event.MetadataKey]any), } + require.Len(t, e.sequences, 1) + ss := e.sequences[0] + require.True(t, ss.isInitialState()) + require.False(t, processEvent(t, e, execve)) + require.False(t, ss.isInitialState(), "the execve stage should have advanced the machine") + require.True(t, processEvent(t, e, connect)) + require.True(t, ss.isInitialState(), "a fired sequence resets for the next match") } func TestSharedSemanticRuleFixtures(t *testing.T) { diff --git a/pkg/rules/sequence.go b/pkg/rules/sequence.go index 58d335696..8564da761 100644 --- a/pkg/rules/sequence.go +++ b/pkg/rules/sequence.go @@ -566,17 +566,17 @@ func (s *sequenceState) expire(e *event.Event) bool { // process spawned by CreateProcess, and it pertains // to the final sequence slot, it is safe to expire // the whole sequence - pid := event.PID(rhs.Params.MustGetPid()) + pid := rhs.Params.MustGetPid() if lhs.IsCreateProcess() && isFinalSlot { - return event.PID(lhs.Params.MustGetPid()) == pid + return lhs.Params.MustGetPid() == pid } if lhs.IsCreateThread() { // if the pids differ, the thread // is created in a remote process. // Sequence can be expired only if // the remote process terminates - if lhs.PID != event.PID(lhs.Params.MustGetPid()) { - return event.PID(lhs.Params.MustGetPid()) == pid + if lhs.PID != lhs.Params.MustGetPid() { + return lhs.Params.MustGetPid() == pid } } return lhs.PID == pid From 6e374ea70253566b3771351074668d98faa98ecd Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 23 Sep 2026 11:07:52 +0200 Subject: [PATCH 58/65] feat(build): Add Linux build, lint, and generation-drift targets check-clang refuses to generate with the wrong clang major. The committed objects are byte-compared in CI and clang records its version in BTF, so generating with a different major rewrites every object and fails the drift check with a diff that looks like a source change. ebpf-drift turns that comparison into something runnable locally rather than a pair of CI steps, and build-linux cross-compiles from the committed objects to prove a checkout needs no clang. lint covers a narrower set than the tests. Packages outside it hold helpers only Windows reaches, so `unused` flags them on every Linux run with nothing to fix on this side. --- Makefile | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3d82486be..67cc96b7f 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,15 @@ SHELL := /bin/bash .SHELLFLAGS := -euo pipefail -c BPF2GO_VERSION := v0.20.0 +GOLANGCI_LINT_VERSION := v2.9.0 + +# The committed objects are byte-compared in CI, and clang encodes its version +# into BTF, so generating with a different major produces a spurious diff. +CLANG_VERSION := 18 + +# The generated objects target x86-64 and the runtime refuses other +# architectures, so building the binary pins the same one. +TARGET_ARCH ?= amd64 # Specifies a list of build flags TAGS ?= @@ -42,19 +51,42 @@ BPF_TARGETS := $(foreach name,$(BPF_NAMES), \ titlecase = $(shell printf '%s' '$(1)' | awk '{print toupper(substr($$0,1,1)) substr($$0,2)}') .PHONY: ebpf -ebpf: $(BPF_TARGETS) +ebpf: check-clang $(BPF_TARGETS) $(BPF_OUT)/%_bpfel.go $(BPF_OUT)/%_bpfeb.go &: $(BPF_DIR)/c/%.bpf.c $(BPF2GO) $(BPF_FLAGS) -output-stem $* $(call titlecase,$*) $(BPF_DIR)/c/$*.bpf.c -- $(BPF_CFLAGS) +.PHONY: check-clang +check-clang: + @command -v $(CLANG) >/dev/null 2>&1 || { \ + echo "$(CLANG) not found. Generating the eBPF objects needs clang $(CLANG_VERSION)."; \ + exit 1; \ + } + @have=$$($(CLANG) --version | sed -n 's/.*clang version \([0-9]*\).*/\1/p' | head -1); \ + if [ "$$have" != "$(CLANG_VERSION)" ]; then \ + echo "clang $$have found but the committed objects were generated with $(CLANG_VERSION)."; \ + echo "Regenerating with another major rewrites every object and fails ebpf-drift."; \ + echo "Point CLANG at the right binary, e.g. make ebpf CLANG=clang-$(CLANG_VERSION)."; \ + exit 1; \ + fi + +# Regenerating must be reproducible: same sources and same clang, same bytes. +.PHONY: ebpf-drift +ebpf-drift: + $(MAKE) -B ebpf + git diff --exit-code -- $(BPF_OUT) + ifeq ($(strip $(TAGS)),) BUILD_TAGS := else BUILD_TAGS := -tags $(TAGS) endif +# Builds from the committed objects alone, so a fresh checkout needs no clang +# and no kernel headers. Naming the target pair keeps this buildable from a +# developer machine that is neither, which is the cheapest way to prove it. .PHONY: build build: - $(GO) build $(BUILD_TAGS) -o ./cmd/fibratus/fibratus ./cmd/fibratus/ + GOOS=linux GOARCH=$(TARGET_ARCH) $(GO) build $(BUILD_TAGS) -o ./cmd/fibratus/fibratus ./cmd/fibratus/ .PHONY: fmt fmt: @@ -76,6 +108,28 @@ TEST_PKGS := \ test: $(GO) test $(TEST_PKGS) +.PHONY: test-race +test-race: + $(GO) test -race $(TEST_PKGS) + +# Needs a 5.9+ kernel with runtime BTF, and root to load and attach. +.PHONY: test-integration +test-integration: + $(GO) test -tags ebpf_integration -count=1 ./internal/ebpf + +# Narrower than TEST_PKGS on purpose. Packages outside this set carry helpers +# that only Windows reaches, so `unused` reports them on every Linux run and +# there is nothing to fix without moving Windows code around. +LINT_PKGS := \ + ./internal/ebpf/... \ + ./internal/bootstrap/... \ + ./pkg/filter/... \ + ./pkg/rules/... + +.PHONY: lint +lint: + golangci-lint run $(LINT_PKGS) + .PHONY: clean clean: rm -f cmd/fibratus/fibratus From f719ceac44900e8bd518213db7b5b879ec5c51ef Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 23 Sep 2026 11:12:50 +0200 Subject: [PATCH 59/65] ci: Extend the Linux workflow to lint, race, and a prerequisite probe Build before clang is installed, so the step fails if anything starts depending on generation tools at build time rather than on the committed objects. Probe the runtime contract as its own step. Without it a runner that lost runtime BTF or fell below the kernel floor produces a green suite that never loaded a program, because every test would fail the same way for a reason buried in a wrapped error. Pin clang to the major the objects were generated with, otherwise the drift check reports a diff on every unrelated change. --- .github/workflows/linux-port.yml | 29 ++++++++--- Makefile | 8 +++ .../ebpf/prerequisites_integration_test.go | 49 +++++++++++++++++++ 3 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 internal/ebpf/prerequisites_integration_test.go diff --git a/.github/workflows/linux-port.yml b/.github/workflows/linux-port.yml index 667ef3e8a..adebae1fa 100644 --- a/.github/workflows/linux-port.yml +++ b/.github/workflows/linux-port.yml @@ -12,6 +12,8 @@ concurrency: env: GO_VERSION: 1.26.x + GOLANGCI_LINT_VERSION: v2.9.0 + CLANG_VERSION: 18 jobs: ebpf: @@ -28,22 +30,37 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + # Deliberately before clang is installed: a checkout must build from the + # committed objects alone. + - name: Build without generation tools + run: make - name: Install clang run: | sudo apt-get update - sudo apt-get install -y clang llvm - clang --version + sudo apt-get install -y clang-${{ env.CLANG_VERSION }} llvm-${{ env.CLANG_VERSION }} + clang-${{ env.CLANG_VERSION }} --version + # The versioned packages ship no unversioned symlinks, so name both tools. - name: Check generation drift + run: make ebpf-drift CLANG=clang-${{ env.CLANG_VERSION }} LLVM_STRIP=llvm-strip-${{ env.CLANG_VERSION }} + - name: Install golangci-lint run: | - make -B ebpf - git diff --exit-code -- internal/ebpf/bpf + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${{ env.GOLANGCI_LINT_VERSION }} + - name: Lint + run: | + export PATH=$(go env GOPATH)/bin:$PATH + make lint - name: Unit tests run: make test + - name: Race tests + run: make test-race - name: Validate rules run: | - make build ./cmd/fibratus/fibratus rules validate \ --filters.rules.from-paths="rules/linux/*.yml" \ --filters.macros.from-paths="rules/linux/macros/*.yml" + # Fails, rather than skips, when the runner cannot host the backend, so a + # green integration run always means programs actually loaded. + - name: Probe eBPF prerequisites + run: sudo -E env "PATH=$PATH" go test -tags ebpf_integration -count=1 -run TestPrerequisitesAreMet -v ./internal/ebpf - name: Privileged process source - run: sudo -E env "PATH=$PATH" go test -tags ebpf_integration -count=1 ./internal/ebpf + run: sudo -E env "PATH=$PATH" make test-integration diff --git a/Makefile b/Makefile index 67cc96b7f..2abb04bdd 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ BPF_DIR := internal/ebpf BPF_OUT := $(BPF_DIR)/bpf CLANG ?= clang +LLVM_STRIP ?= llvm-strip GO ?= go GOFMT ?= gofmt BPF2GO ?= go run github.com/cilium/ebpf/cmd/bpf2go@$(BPF2GO_VERSION) @@ -29,6 +30,7 @@ BPF_FLAGS := \ -go-package bpf \ -output-dir $(BPF_OUT) \ -cc $(CLANG) \ + -strip $(LLVM_STRIP) \ -target bpfel,bpfeb \ -tags linux @@ -61,6 +63,12 @@ check-clang: echo "$(CLANG) not found. Generating the eBPF objects needs clang $(CLANG_VERSION)."; \ exit 1; \ } + @command -v $(LLVM_STRIP) >/dev/null 2>&1 || { \ + echo "$(LLVM_STRIP) not found. Versioned llvm packages ship llvm-strip-$(CLANG_VERSION)"; \ + echo "without the unversioned name bpf2go looks for."; \ + echo "Point LLVM_STRIP at it, e.g. make ebpf LLVM_STRIP=llvm-strip-$(CLANG_VERSION)."; \ + exit 1; \ + } @have=$$($(CLANG) --version | sed -n 's/.*clang version \([0-9]*\).*/\1/p' | head -1); \ if [ "$$have" != "$(CLANG_VERSION)" ]; then \ echo "clang $$have found but the committed objects were generated with $(CLANG_VERSION)."; \ diff --git a/internal/ebpf/prerequisites_integration_test.go b/internal/ebpf/prerequisites_integration_test.go new file mode 100644 index 000000000..3a7a8e755 --- /dev/null +++ b/internal/ebpf/prerequisites_integration_test.go @@ -0,0 +1,49 @@ +//go:build linux && ebpf_integration + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +// TestPrerequisitesAreMet asserts the host satisfies the runtime contract +// instead of skipping when it does not. A runner that silently loses runtime +// BTF, or drops below the kernel floor, would otherwise report a green suite +// that never loaded a program. It runs the same gate Open does, so the arch +// check is covered too. +func TestPrerequisitesAreMet(t *testing.T) { + report, err := checkRuntimeSupport() + if report != nil { + t.Logf("kernel=%s (ok=%v, floor=%s) btf=%s (ok=%v) ringbuf=%v ringbuf_helper=%v tracing=%v iter=%v", + report.KernelRelease, report.KernelOK, MinKernelVersion, + report.BTFPath, report.BTFOK, + report.RingbufOK, report.RingbufHelper, report.TracingOK, report.IterOK) + } + require.NoError(t, err, "host does not meet the Linux eBPF runtime contract") + require.NotNil(t, report) + require.True(t, report.KernelOK) + require.True(t, report.BTFOK) + require.True(t, report.RingbufOK) + require.True(t, report.TracingOK) + require.True(t, report.IterOK) +} From 3733934365f76159cea3fe0d2635c5af36ac1ea4 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 23 Sep 2026 11:14:50 +0200 Subject: [PATCH 60/65] docs: Describe the Linux runtime contract and capabilities Covers what the backend refuses to start without, which capabilities replace running as root, and how to read the probe output. Calls out the two cases capabilities cannot fix, kernel lockdown and the pre-5.11 memlock accounting, because both surface as permission errors that look like a missing capability. Documents which attachment warnings are expected, since the optional legacy tracepoints log a permission denial on kernels that refuse a perf link on them and that is not a fault. --- docs/_sidebar.md | 1 + docs/setup/linux.md | 93 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 docs/setup/linux.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 7d893b36c..8e8df8af5 100755 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -2,6 +2,7 @@ * [Installation](setup/installation.md) * [Quick Start](setup/quick-start.md) * [Configuration](setup/configuration.md) + * [Linux](setup/linux.md) * --- * [Architecture](architecture.md) * --- diff --git a/docs/setup/linux.md b/docs/setup/linux.md new file mode 100644 index 000000000..0287c5a01 --- /dev/null +++ b/docs/setup/linux.md @@ -0,0 +1,93 @@ +# Linux + +On Linux, Fibratus collects telemetry through eBPF CO-RE programs attached to syscall and scheduler tracepoints, instead of ETW. The rule engine, filters, actions, and outputs are the same on both platforms. + +## Runtime prerequisites + +These are hard requirements. Fibratus probes each one at startup and refuses to run if any is missing, rather than degrading to partial telemetry. + +| Requirement | Why | +| --- | --- | +| Linux 5.9 or later | BPF task iterators, used to build the initial process tree, appear in 5.9 | +| Runtime kernel BTF at `/sys/kernel/btf/vmlinux` | CO-RE relocations and `iter/task` attachment resolve against the running kernel's own type information | +| `x86_64` | The shipped BPF objects are built for this architecture | +| Ring buffer map support | Events reach userspace through `BPF_MAP_TYPE_RINGBUF` | + +There is no BTFHub download and no embedded build-host BTF. A kernel compiled without `CONFIG_DEBUG_INFO_BTF` cannot run the backend, and no amount of configuration works around it. Most distribution kernels from 5.9 onwards enable it; if `/sys/kernel/btf/vmlinux` is absent, the kernel was built without it. + +Nothing needs to be compiled at install time. The BPF objects are generated ahead of time and committed, so neither clang nor kernel headers are required on the host. + +## Capabilities + +Running as root works. To run unprivileged, grant: + +| Capability | Needed for | +| --- | --- | +| `CAP_BPF` | Loading programs and creating maps | +| `CAP_PERFMON` | Attaching to tracepoints | +| `CAP_SYS_PTRACE` | Reading `/proc//exe` and `/proc//cmdline` of processes owned by other users | +| `CAP_KILL` | Only if a rule uses the `kill` action against processes you do not own | + +`CAP_BPF` and `CAP_PERFMON` were split out of `CAP_SYS_ADMIN` in 5.8. On a kernel that predates the split, or on a distribution that has not adopted it, `CAP_SYS_ADMIN` is the equivalent. + +Two environment-specific cases override all of the above. Under kernel lockdown in `confidentiality` mode, loading tracing programs is refused no matter which capabilities you hold; check with `cat /sys/kernel/security/lockdown`. Below 5.11, BPF memory is charged against `RLIMIT_MEMLOCK`, so a low limit causes load failures that read as permission errors; Fibratus raises the limit at startup, which itself needs privilege. + +## Reading a failed startup + +Fibratus prints the probe result before anything else: + +``` +eBPF prerequisites ok: kernel=6.8.0-40-generic btf=/sys/kernel/btf/vmlinux ringbuf=true iter=true +``` + +When a prerequisite is missing it refuses to start and names every failure at once, so one run tells you everything that needs fixing: + +``` +eBPF prerequisites: kernel 5.4.0-91-generic is below required 5.9; usable kernel BTF required at /sys/kernel/btf/vmlinux +``` + +Failures after that line are attachment problems rather than prerequisite problems. `cannot create bpf perf link: permission denied` on an optional tracepoint is expected and harmless: `fork`, `vfork`, and the legacy `open`, `unlink`, and `rename` syscalls are skipped when the kernel refuses a perf link on them, because libc routes through `clone`, `openat`, `unlinkat`, and `renameat` anyway. The same message on a required tracepoint is fatal and means capabilities or lockdown. + +## Process enrichment + +The initial process tree comes from a single `iter/task` pass over `task_struct`, which is race-free against processes starting during startup. Executable paths and command lines are then filled in best effort from `/proc//exe` and `/proc//cmdline`. + +That second step is allowed to fail. A process that exits between the iterator pass and the procfs read leaves those two fields empty, and Fibratus counts it rather than dropping the process. Enrichment never replaces what the iterator produced, so a failed read cannot corrupt process identity. + +## Metrics + +Counters are exported as expvars and available through `fibratus stats`. + +| Metric | Meaning | +| --- | --- | +| `ebpf.events.processed` | Events decoded from the ring buffer | +| `ebpf.events.excluded` | Events dropped in userspace by config or filters | +| `ebpf.events.unknown` | Records carrying a type this build does not know | +| `ebpf.events.parse.errors` | Malformed ring buffer records | +| `ebpf.ringbuf.drops` | Events the kernel could not queue because the ring buffer was full | +| `ebpf.approver.drops` | Events rejected in the kernel by an approver, before reaching the ring buffer | +| `ebpf.enrichment.miss` | Processes whose procfs enrichment failed | +| `ebpf.startup.pending.queued` | Live events buffered while the baseline scan ran | +| `ebpf.startup.pending.dropped` | Live events discarded because that buffer was full | +| `ebpf.startup.replay.applied` | Buffered events replayed once the baseline completed | +| `ebpf.startup.snapshot.upserts` | Processes recorded by the baseline scan | +| `ebpf.startup.snapshot.late` | Baseline records that arrived after the switch to live dispatch | + +`ebpf.ringbuf.drops` growing steadily is the signal that consumers are not keeping up; it is the one counter worth alerting on. `ebpf.approver.drops` growing is normal and desirable, since it counts work avoided. + +## Building from source + +Ordinary builds consume the committed objects: + +``` +make +``` + +Regenerating them needs clang, pinned to the major the committed objects were built with, because clang records its version in BTF and a different major rewrites every object: + +``` +make ebpf # regenerate +make ebpf-drift # regenerate and fail if the result differs from what is committed +``` + +Other targets: `make test`, `make test-race`, `make lint`, and `make test-integration`, which needs root and a host meeting the prerequisites above. From d3be6a56b53318ae8f8be948adc403bce2318105 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 23 Sep 2026 17:32:24 +0200 Subject: [PATCH 61/65] feat(config): Default the Linux API transport to a UNIX socket The shared default bound the API to localhost:8080, so a Linux install listened on the network before anyone asked it to. Defaulting to a socket under /var/run leaves reachability to filesystem permissions, and a TCP address still works when it is set explicitly. Windows keeps its existing default through the same platform hook the config file and rule paths already use. --- pkg/config/config.go | 2 +- pkg/config/config_linux.go | 4 +++ pkg/config/config_linux_test.go | 46 +++++++++++++++++++++++++++++++++ pkg/config/config_windows.go | 2 ++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 pkg/config/config_linux_test.go diff --git a/pkg/config/config.go b/pkg/config/config.go index a5e135e12..6de93c8c7 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -273,7 +273,7 @@ func (c *Config) addFlags() { c.flags.String(filamentPath, defaultFilamentPath(), "Denotes the directory where filaments are located") } if c.opts.run || c.opts.replay || c.opts.capture || c.opts.stats { - c.flags.String(transport, "localhost:8080", "Specifies the underlying transport protocol for the API HTTP server") + c.flags.String(transport, defaultTransport(), "Specifies the underlying transport protocol for the API HTTP server") c.flags.Duration(timeout, 15*time.Second, "Determines the timeout for the API server responses") } c.Log.AddFlags(c.flags) diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index 7d803ce89..167516995 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -44,3 +44,7 @@ func defaultRulesPaths() []string { func defaultMacrosPaths() []string { return []string{filepath.Join("/etc", "fibratus", "rules", "macros", "*")} } + +// defaultTransport keeps the API off the network unless someone asks for it. +// Filesystem permissions on the socket then decide who can reach it. +func defaultTransport() string { return "unix:///var/run/fibratus.sock" } diff --git a/pkg/config/config_linux_test.go b/pkg/config/config_linux_test.go new file mode 100644 index 000000000..68d1bd774 --- /dev/null +++ b/pkg/config/config_linux_test.go @@ -0,0 +1,46 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "path/filepath" + "testing" + + "github.com/spf13/cobra" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestLinuxDefaults(t *testing.T) { + // No config file on the box, which is the state a fresh install starts in. + c := NewWithOpts(WithRun()) + cmd := &cobra.Command{} + c.MustViperize(cmd) + require.NoError(t, c.Init()) + + // The API stays off the network unless asked, so a default install exposes + // nothing beyond what socket permissions allow. + assert.Equal(t, "unix:///var/run/fibratus.sock", c.API.Transport) + + assert.Equal(t, filepath.Join("/etc", "fibratus", "fibratus.yml"), defaultConfigFile()) + assert.Equal(t, []string{filepath.Join("/etc", "fibratus", "rules", "*")}, defaultRulesPaths()) + assert.Equal(t, []string{filepath.Join("/etc", "fibratus", "rules", "macros", "*")}, defaultMacrosPaths()) +} diff --git a/pkg/config/config_windows.go b/pkg/config/config_windows.go index 0826dbfb3..4c39baa14 100644 --- a/pkg/config/config_windows.go +++ b/pkg/config/config_windows.go @@ -131,6 +131,8 @@ func defaultMacrosPaths() []string { return []string{filepath.Join(defaultRulesDir(), "Macros", "*")} } +func defaultTransport() string { return "localhost:8080" } + func defaultRulesDir() string { exe, err := os.Executable() if err != nil { From e2113d1c7fdf9d63cba8663e70860c8904b26836 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 23 Sep 2026 17:40:52 +0200 Subject: [PATCH 62/65] feat(build): Package Fibratus for deb and rpm with a systemd unit Ships the binary, a Linux configuration, the rules, and a service unit. The BPF objects need no separate packaging because bpf2go embeds them in the binary. The unit starts as root, since attaching a syscall tracepoint reads its id from /sys/kernel/tracing and that is root-only on stock kernels. What constrains it is the bounding set, which drops everything except loading programs, attaching to tracepoints, reading other users' procfs entries, and signalling a target for the kill action. ProtectSystem is full rather than strict because strict also mounts /run read-only and the API socket lives there, and ProtectProc stays permissive because hiding other processes would silently empty ps.exe and ps.cmdline. The shipped configuration omits the Windows-only sections instead of carrying them inert, so what is in the file is what the platform reads. --- .github/workflows/linux-port.yml | 6 ++ .gitignore | 3 + Makefile | 12 +++ build/linux/fibratus.service | 44 +++++++++++ build/linux/nfpm.yaml | 46 +++++++++++ configs/fibratus-linux.yml | 132 +++++++++++++++++++++++++++++++ 6 files changed, 243 insertions(+) create mode 100644 build/linux/fibratus.service create mode 100644 build/linux/nfpm.yaml create mode 100644 configs/fibratus-linux.yml diff --git a/.github/workflows/linux-port.yml b/.github/workflows/linux-port.yml index adebae1fa..91061f369 100644 --- a/.github/workflows/linux-port.yml +++ b/.github/workflows/linux-port.yml @@ -64,3 +64,9 @@ jobs: run: sudo -E env "PATH=$PATH" go test -tags ebpf_integration -count=1 -run TestPrerequisitesAreMet -v ./internal/ebpf - name: Privileged process source run: sudo -E env "PATH=$PATH" make test-integration + - name: Package + run: make pkg + - uses: actions/upload-artifact@v4 + with: + name: fibratus-linux-packages + path: build/pkg/* diff --git a/.gitignore b/.gitignore index 94721e74c..d1664f9cc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ build/msi/*.msi .idea filaments/__pycache__ + +# Linux packages +build/pkg/ diff --git a/Makefile b/Makefile index 2abb04bdd..e93b372a0 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ SHELL := /bin/bash BPF2GO_VERSION := v0.20.0 GOLANGCI_LINT_VERSION := v2.9.0 +NFPM_VERSION := v2.43.0 # The committed objects are byte-compared in CI, and clang encodes its version # into BTF, so generating with a different major produces a spurious diff. @@ -138,6 +139,17 @@ LINT_PKGS := \ lint: golangci-lint run $(LINT_PKGS) +VERSION ?= 0.0.0 +PKG_DIR := build/pkg +NFPM ?= go run github.com/goreleaser/nfpm/v2/cmd/nfpm@$(NFPM_VERSION) + +.PHONY: pkg +pkg: build + @mkdir -p $(PKG_DIR) + VERSION=$(VERSION) $(NFPM) package --config build/linux/nfpm.yaml --packager deb --target $(PKG_DIR) + VERSION=$(VERSION) $(NFPM) package --config build/linux/nfpm.yaml --packager rpm --target $(PKG_DIR) + .PHONY: clean clean: rm -f cmd/fibratus/fibratus + rm -rf $(PKG_DIR) diff --git a/build/linux/fibratus.service b/build/linux/fibratus.service new file mode 100644 index 000000000..3e0d265b0 --- /dev/null +++ b/build/linux/fibratus.service @@ -0,0 +1,44 @@ +[Unit] +Description=Fibratus +Documentation=https://www.fibratus.io +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/fibratus run +Restart=on-failure +RestartSec=5s + +# Fibratus starts as root because attaching a syscall tracepoint reads its id +# from /sys/kernel/tracing, which is root-only on stock distributions. The +# bounding set is what actually constrains it: everything below is dropped, so +# the process keeps only what the backend and the kill action need. +# +# CAP_BPF load programs, create and update maps +# CAP_PERFMON attach to tracepoints +# CAP_SYS_PTRACE read /proc//exe and cmdline of other users' processes +# CAP_KILL signal a target, needed only by the kill rule action +# +# CAP_BPF and CAP_PERFMON were split out of CAP_SYS_ADMIN in 5.8. On a kernel +# that predates the split, replace both with CAP_SYS_ADMIN. +CapabilityBoundingSet=CAP_BPF CAP_PERFMON CAP_SYS_PTRACE CAP_KILL +AmbientCapabilities=CAP_BPF CAP_PERFMON CAP_SYS_PTRACE CAP_KILL +NoNewPrivileges=yes + +# full rather than strict: strict would also mount /run read-only and the API +# socket lives there. +ProtectSystem=full +ProtectHome=yes +PrivateTmp=yes +ProtectKernelTunables=yes +ProtectKernelModules=yes +ProtectControlGroups=yes +RestrictSUIDSGID=yes +LockPersonality=yes + +# Process enrichment reads other processes' procfs entries, so this must stay +# permissive. Hiding them would silently empty ps.exe and ps.cmdline. +ProtectProc=default + +[Install] +WantedBy=multi-user.target diff --git a/build/linux/nfpm.yaml b/build/linux/nfpm.yaml new file mode 100644 index 000000000..7d272a362 --- /dev/null +++ b/build/linux/nfpm.yaml @@ -0,0 +1,46 @@ +name: fibratus +arch: amd64 +platform: linux +version: ${VERSION} +section: admin +priority: optional +maintainer: Nedim Sabic Sabic +description: | + Security sensor for realtime threat detection and protection +vendor: Fibratus +homepage: https://fibratus.io +license: Apache-2.0 + +# The BPF objects are embedded in the binary at compile time, so there is +# nothing to ship alongside it. +contents: + - src: ./cmd/fibratus/fibratus + dst: /usr/bin/fibratus + + - src: ./configs/fibratus-linux.yml + dst: /etc/fibratus/fibratus.yml + type: config|noreplace + + - src: ./rules/linux/*.yml + dst: /etc/fibratus/rules/ + + - src: ./rules/linux/macros/macros.yml + dst: /etc/fibratus/rules/macros/macros.yml + + - src: ./build/linux/fibratus.service + dst: /lib/systemd/system/fibratus.service + +overrides: + rpm: + contents: + - src: ./cmd/fibratus/fibratus + dst: /usr/bin/fibratus + - src: ./configs/fibratus-linux.yml + dst: /etc/fibratus/fibratus.yml + type: config|noreplace + - src: ./rules/linux/*.yml + dst: /etc/fibratus/rules/ + - src: ./rules/linux/macros/macros.yml + dst: /etc/fibratus/rules/macros/macros.yml + - src: ./build/linux/fibratus.service + dst: /usr/lib/systemd/system/fibratus.service diff --git a/configs/fibratus-linux.yml b/configs/fibratus-linux.yml new file mode 100644 index 000000000..51b9fb446 --- /dev/null +++ b/configs/fibratus-linux.yml @@ -0,0 +1,132 @@ +# Fibratus configuration for Linux. +# +# Only the settings that apply to the eBPF backend are listed here. Windows-only +# sections, such as filaments, PE introspection, YARA scanning, and handle or +# evasion telemetry, have no effect on this platform and are left out rather +# than shipped inert. + +# =============================== Event source ========================================= + +eventsource: + # Process telemetry is always collected. Execve, exit, and clone build the + # process state every other event is correlated against, so they cannot be + # disabled. + + # Collects openat, unlink, and rename. This is the highest-volume family by a + # wide margin on a busy host. + enable-fileio: true + + # Collects connect and accept. + enable-net: true + + # Collects mmap, process_vm_readv, and process_vm_writev. + enable-mem: true + + # Drops events before they reach the aggregator, by event name or by the + # image name of the process that produced them. + #blacklist: + # events: + # - openat + # images: + # - fibratus + +# =============================== Aggregator =========================================== + +aggregator: + # Determines the flush period that triggers the flushing of the event batches to output sinks + flush-period: 500ms + + # Represents the max time to wait before announcing failed flushing of enqueued events when fibratus + # is stopped + flush-timeout: 4s + +# =============================== Filters and rules ==================================== + +filters: + rules: + # Enables the rule engine. With no rules loaded every event reaches the + # outputs; with rules loaded only matching events do. + enabled: true + + # Rule definitions. The package installs the shipped Linux rules here. + from-paths: + - /etc/fibratus/rules/*.yml + + macros: + from-paths: + - /etc/fibratus/rules/macros/*.yml + +# =============================== API ================================================== + +api: + # The transport for the API HTTP server. A unix:// path keeps the API off the + # network and leaves access to the socket's filesystem permissions. A host:port + # value exposes it over TCP instead, e.g. 192.168.1.32:8084. + transport: unix:///var/run/fibratus.sock + + # Represents the timeout interval for the HTTP server responses. + timeout: 5s + +# =============================== Logging ============================================== + +logging: + # Specifies the minimum allowed log level. Anything logged below this log level will + # not get dumped to a file or stdout stream + level: info + + # Represents the log file format + #formatter: json + + # Under systemd, logging to stdout routes through the journal + log-stdout: true + + # Alternative directory for log files + #path: /var/log/fibratus + +# =============================== Outputs ============================================== + +output: + # Console output writes the event to the standard output stream. + console: + enabled: true + + # Indicates if the console output is colorized + colorize: true + + # The "pretty" format replaces specifiers in the template, "json" emits the + # event as a raw JSON string + format: pretty + + # Elasticsearch output indexes event bulks into Elasticsearch clusters. + elasticsearch: + enabled: false + #servers: + # - http://localhost:9200 + + # HTTP output posts event batches to an HTTP endpoint. + http: + enabled: false + #endpoint: http://localhost:8081 + + # AMQP output publishes events to a message broker. + amqp: + enabled: false + #url: amqp://localhost:5672 + +# =============================== Alert senders ======================================== + +alertsenders: + mail: + enabled: false + #host: smtp.gmail.com + #port: 587 + + slack: + enabled: false + #url: https://hooks.slack.com/services/... + +# =============================== General ============================================== + +# Forwards events to the output sinks without running the rule engine or +# building the full process state. +forward: false From 7e66a7afbdbdb010841ee060f7e4f832c73d56e2 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 23 Sep 2026 17:48:13 +0200 Subject: [PATCH 63/65] feat(cli): Report eBPF counters in stats and cover both API transports The Linux Stats struct was an empty placeholder, so the command rendered a table with no rows against a sensor that publishes a dozen counters. It now carries the capture, drop, startup handover, and rule engine expvars, grouped in the order they are useful to read. Covers the endpoints the config and stats commands call over a socket and over TCP, including a socket left behind by an unclean shutdown, which would otherwise need manual cleanup before a restart. The privileged test drives the same path against a live capture, since unit tests can only prove the counters exist, not that a running sensor moves them. --- cmd/fibratus/app/stats/stats_linux.go | 28 ++++++- internal/ebpf/stats_integration_test.go | 94 +++++++++++++++++++++ pkg/api/server_linux_test.go | 103 ++++++++++++++++++++++++ 3 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 internal/ebpf/stats_integration_test.go create mode 100644 pkg/api/server_linux_test.go diff --git a/cmd/fibratus/app/stats/stats_linux.go b/cmd/fibratus/app/stats/stats_linux.go index da5a11dfb..67ac58257 100644 --- a/cmd/fibratus/app/stats/stats_linux.go +++ b/cmd/fibratus/app/stats/stats_linux.go @@ -21,4 +21,30 @@ package stats // Stats stores runtime statistics that are retrieved from the expvar endpoint. -type Stats struct{} +// Field order is the order the table renders in, so counters are grouped by the +// stage they describe: capture, then the kernel-side drops worth alerting on, +// then the startup handover, then the rule engine. +type Stats struct { + EventsProcessed int `json:"ebpf.events.processed"` + EventsExcluded int `json:"ebpf.events.excluded"` + EventsUnknown int `json:"ebpf.events.unknown"` + EventsParseErrs int `json:"ebpf.events.parse.errors"` + + RingbufDrops int `json:"ebpf.ringbuf.drops"` + ApproverDrops int `json:"ebpf.approver.drops"` + + EnrichmentMiss int `json:"ebpf.enrichment.miss"` + + StartupPendingQueued int `json:"ebpf.startup.pending.queued"` + StartupPendingDropped int `json:"ebpf.startup.pending.dropped"` + StartupReplayApplied int `json:"ebpf.startup.replay.applied"` + StartupSnapshotUpserts int `json:"ebpf.startup.snapshot.upserts"` + StartupSnapshotLate int `json:"ebpf.startup.snapshot.late"` + + FiltersCount int `json:"filter.filters.count"` + FilterMatches map[string]int `json:"filter.matches"` + + AggregatorBatchEvents int `json:"aggregator.batch.events"` + AggregatorFlushesCount int `json:"aggregator.flushes.count"` + AggregatorEventErrors int `json:"aggregator.event.errors"` +} diff --git a/internal/ebpf/stats_integration_test.go b/internal/ebpf/stats_integration_test.go new file mode 100644 index 000000000..1ff99a911 --- /dev/null +++ b/internal/ebpf/stats_integration_test.go @@ -0,0 +1,94 @@ +//go:build linux && ebpf_integration + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ebpf + +import ( + "encoding/json" + "os/exec" + "path/filepath" + "testing" + "time" + + "github.com/rabbitstack/fibratus/pkg/api" + "github.com/rabbitstack/fibratus/pkg/ps" + "github.com/rabbitstack/fibratus/pkg/util/rest" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// TestStatsSurfaceOverLiveCapture drives the same path fibratus stats takes: +// the API over its default UNIX socket, reading expvars produced by a live +// capture. Unit tests can assert the counters exist, but only this shows the +// command surface reporting numbers a running sensor actually moved. +func TestStatsSurfaceOverLiveCapture(t *testing.T) { + socket := filepath.Join(t.TempDir(), "fibratus.sock") + cfg := testConfig() + cfg.API.Transport = "unix://" + socket + cfg.API.Timeout = 5 * time.Second + + es := NewEventSource(ps.NewSnapshotter(), cfg, nil, nil).(*EventSource) + require.NoError(t, es.Open(cfg)) + t.Cleanup(func() { _ = es.Close() }) + + require.NoError(t, api.StartServer(cfg)) + t.Cleanup(func() { require.NoError(t, api.CloseServer()) }) + + // Drain, otherwise the queue fills and the counters stop advancing. + go func() { + for range es.Events() { + } + }() + + var vars map[string]any + deadline := time.Now().Add(20 * time.Second) + for time.Now().Before(deadline) { + _ = exec.Command("/bin/sh", "-c", "true").Run() + + body, err := rest.Get(rest.WithTransport(cfg.API.Transport), rest.WithURI("debug/vars")) + require.NoError(t, err) + require.NoError(t, json.Unmarshal(body, &vars)) + if processed, ok := vars["ebpf.events.processed"].(float64); ok && processed > 0 { + break + } + time.Sleep(200 * time.Millisecond) + } + + require.Contains(t, vars, "ebpf.events.processed") + assert.Greater(t, vars["ebpf.events.processed"], float64(0), "no events were captured") + + // Every counter the Linux stats table renders has to be present, or the + // command prints a zero for something that is simply not published. + for _, name := range []string{ + "ebpf.events.excluded", + "ebpf.events.unknown", + "ebpf.events.parse.errors", + "ebpf.ringbuf.drops", + "ebpf.approver.drops", + "ebpf.enrichment.miss", + "ebpf.startup.pending.queued", + "ebpf.startup.pending.dropped", + "ebpf.startup.replay.applied", + "ebpf.startup.snapshot.upserts", + "ebpf.startup.snapshot.late", + } { + assert.Contains(t, vars, name) + } +} diff --git a/pkg/api/server_linux_test.go b/pkg/api/server_linux_test.go new file mode 100644 index 000000000..038714dc2 --- /dev/null +++ b/pkg/api/server_linux_test.go @@ -0,0 +1,103 @@ +//go:build linux + +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Package api_test lives outside the package because the REST client imports +// the API for its local transport dialer. +package api_test + +import ( + "encoding/json" + "net" + "os" + "path/filepath" + "testing" + + "github.com/rabbitstack/fibratus/pkg/api" + "github.com/rabbitstack/fibratus/pkg/config" + "github.com/rabbitstack/fibratus/pkg/util/rest" + "github.com/spf13/cobra" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// The config endpoint renders through viper, so the config has to come from +// the normal construction path rather than a bare struct. +func newConfig(t *testing.T, transport string) *config.Config { + t.Helper() + c := config.NewWithOpts(config.WithRun()) + c.MustViperize(&cobra.Command{}) + require.NoError(t, c.Init()) + c.API.Transport = transport + return c +} + +func freeTCPAddr(t *testing.T) string { + t.Helper() + l, err := net.Listen("tcp", "127.0.0.1:0") + require.NoError(t, err) + addr := l.Addr().String() + require.NoError(t, l.Close()) + return addr +} + +// The endpoints behind fibratus config and fibratus stats have to answer over +// both transports, since a socket is the default and a TCP address is what an +// operator switches to for remote access. +func TestServerServesBothTransports(t *testing.T) { + for _, transport := range []string{ + "unix://" + filepath.Join(t.TempDir(), "fibratus.sock"), + freeTCPAddr(t), + } { + t.Run(transport, func(t *testing.T) { + cfg := newConfig(t, transport) + require.NoError(t, api.StartServer(cfg)) + t.Cleanup(func() { require.NoError(t, api.CloseServer()) }) + + body, err := rest.Get(rest.WithTransport(transport), rest.WithURI("debug/vars")) + require.NoError(t, err) + var vars map[string]any + require.NoError(t, json.Unmarshal(body, &vars)) + assert.Contains(t, vars, "cmdline", "expvar payload is what fibratus stats reads") + + // This endpoint renders the config as text, which is what + // fibratus config prints verbatim. + body, err = rest.Get(rest.WithTransport(transport), rest.WithURI("config")) + require.NoError(t, err) + for _, section := range []string{"aggregator", "api", "eventsource", "filters", "output"} { + assert.Contains(t, string(body), section) + } + }) + } +} + +// A socket left behind by a killed process must not keep the server from +// starting, otherwise an unclean shutdown needs manual cleanup before restart. +func TestServerReplacesStaleSocket(t *testing.T) { + socket := filepath.Join(t.TempDir(), "fibratus.sock") + require.NoError(t, os.WriteFile(socket, nil, 0o600)) + + cfg := newConfig(t, "unix://"+socket) + require.NoError(t, api.StartServer(cfg)) + t.Cleanup(func() { require.NoError(t, api.CloseServer()) }) + + body, err := rest.Get(rest.WithTransport("unix://"+socket), rest.WithURI("debug/vars")) + require.NoError(t, err) + assert.NotEmpty(t, body) +} From 21baf529bf2050001fdee4ae3b50720e1ba0995d Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 23 Sep 2026 17:49:03 +0200 Subject: [PATCH 64/65] docs: Add Linux install and quick-start instructions Covers the package layout, running in the foreground against a filter, and the service. Notes that an idle host with rules enabled is expected to be quiet, since only matching events reach the outputs and silence otherwise reads as a broken install. Records why the unit runs as root and what the bounding set leaves it. --- docs/setup/linux.md | 63 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/docs/setup/linux.md b/docs/setup/linux.md index 0287c5a01..d6d6f1a52 100644 --- a/docs/setup/linux.md +++ b/docs/setup/linux.md @@ -2,6 +2,64 @@ On Linux, Fibratus collects telemetry through eBPF CO-RE programs attached to syscall and scheduler tracepoints, instead of ETW. The rule engine, filters, actions, and outputs are the same on both platforms. +## Installing + +Packages are built for `x86_64` and carry the binary, a configuration, the shipped rules, and a systemd unit. The BPF objects are compiled into the binary, so there is nothing else to install and no compiler is needed on the host. + +``` +# Debian, Ubuntu +sudo dpkg -i fibratus__amd64.deb + +# RHEL, Fedora, Rocky, openSUSE +sudo rpm -i fibratus--1.x86_64.rpm +``` + +| Path | Contents | +| --- | --- | +| `/usr/bin/fibratus` | The binary | +| `/etc/fibratus/fibratus.yml` | Configuration, preserved across upgrades | +| `/etc/fibratus/rules/` | Shipped detection rules | +| `/etc/fibratus/rules/macros/` | Macros the rules expand | +| `/lib/systemd/system/fibratus.service` | Service unit, `/usr/lib/...` on RPM distributions | + +## Quick start + +Check the host before starting anything. This refuses to run and names every unmet requirement at once, rather than failing later inside the capture: + +``` +sudo fibratus rules validate +``` + +Run in the foreground to see events as they arrive: + +``` +sudo fibratus run +``` + +Narrow it with a filter expression, using the same language the rules use: + +``` +sudo fibratus run "evt.name = 'openat' and file.path startswith '/etc'" +``` + +Then run it as a service: + +``` +sudo systemctl enable --now fibratus +sudo systemctl status fibratus +sudo journalctl -u fibratus -f +``` + +The unit logs to the journal. With the rule engine enabled, only events matching a rule reach the outputs, so an idle host is expected to be quiet; drop the rules or set `filters.rules.enabled` to `false` to see the raw stream. + +Inspect a running instance over the API socket: + +``` +sudo fibratus config # the configuration as loaded +sudo fibratus stats # capture, drop, and rule engine counters +sudo fibratus list events +``` + ## Runtime prerequisites These are hard requirements. Fibratus probes each one at startup and refuses to run if any is missing, rather than degrading to partial telemetry. @@ -19,7 +77,7 @@ Nothing needs to be compiled at install time. The BPF objects are generated ahea ## Capabilities -Running as root works. To run unprivileged, grant: +The packaged unit starts Fibratus as root, because attaching a syscall tracepoint reads its id from `/sys/kernel/tracing`, which is root-only on stock distributions. What limits it is the bounding set in the unit, which drops everything except the four capabilities below. Granting these to an unprivileged invocation works too, provided tracefs is readable: | Capability | Needed for | | --- | --- | @@ -80,7 +138,8 @@ Counters are exported as expvars and available through `fibratus stats`. Ordinary builds consume the committed objects: ``` -make +make # the binary +make pkg # deb and rpm into build/pkg ``` Regenerating them needs clang, pinned to the major the committed objects were built with, because clang records its version in BTF and a different major rewrites every object: From 639c8b1866125ef68a5e1390c7c67d58e5b0a0c9 Mon Sep 17 00:00:00 2001 From: rabbitstack Date: Mon, 28 Sep 2026 18:48:22 +0200 Subject: [PATCH 65/65] refactor(linux,windows): Reconcile post-rebase state Apply conflict resolutions and other activities to foment a stricter, cleaner, and more idiomatic code for multi platform support. --- .gitignore | 8 +- .golangci.yml | 13 +- internal/bootstrap/bootstrap_linux.go | 12 +- internal/bootstrap/bootstrap_windows.go | 27 +- internal/bootstrap/config.go | 3 +- internal/ebpf/approver.go | 2 +- internal/ebpf/consumer.go | 4 +- internal/ebpf/enrich.go | 2 +- internal/ebpf/events.go | 32 +- internal/ebpf/events_test.go | 5 +- internal/ebpf/matrix_test.go | 7 +- internal/ebpf/proc_iter.go | 6 +- internal/ebpf/source.go | 12 +- internal/etw/consumer.go | 2 +- internal/etw/source.go | 2 +- internal/etw/source_test.go | 2 +- pkg/aggregator/aggregator.go | 1 - pkg/aggregator/aggregator_windows.go | 4 +- pkg/aggregator/transformers/config.go | 37 +- pkg/aggregator/transformers/transformer.go | 20 + pkg/alertsender/alert.go | 2 +- pkg/alertsender/alert_linux.go | 26 +- pkg/alertsender/alert_windows.go | 36 +- pkg/alertsender/config.go | 37 +- pkg/alertsender/sender.go | 3 + .../dialer_linux.go} | 23 +- .../dialer_windows.go} | 21 +- pkg/api/listener.go | 45 +- pkg/api/listener_linux.go | 37 +- pkg/api/listener_windows.go | 73 + pkg/api/server.go | 43 +- pkg/api/server_linux.go | 62 - pkg/api/server_linux_test.go | 13 +- pkg/api/server_windows.go | 68 - pkg/callstack/callstack_linux.go | 15 +- pkg/config/alertsender.go | 63 +- pkg/config/alertsender_linux_test.go | 6 +- pkg/config/alertsender_windows.go | 31 +- pkg/config/alertsender_windows_test.go | 63 + pkg/config/config.go | 127 +- pkg/config/config_linux.go | 50 +- pkg/config/config_linux_test.go | 8 +- pkg/config/config_windows.go | 106 +- pkg/config/eventsource.go | 190 +-- pkg/config/eventsource_linux.go | 22 +- pkg/config/eventsource_linux_test.go | 11 +- pkg/config/eventsource_test.go | 4 +- pkg/config/eventsource_windows.go | 98 +- pkg/config/filters.go | 7 +- pkg/config/output.go | 150 +- pkg/config/output_linux.go | 26 - pkg/config/output_linux_test.go | 38 - pkg/config/output_windows.go | 58 - pkg/config/output_windows_test.go | 41 - pkg/config/print.go | 10 +- pkg/config/schema.go | 7 +- .../schema_linux.go} | 11 +- .../schema_windows.go} | 9 +- pkg/config/schemas/config.schema.linux.json | 859 ++++++++++++ .../config.schema.windows.json} | 3 - pkg/config/{ => schemas}/macros.schema.json | 0 pkg/config/{ => schemas}/rules.schema.json | 0 pkg/config/transformer.go | 103 +- pkg/event/batch_linux_test.go | 2 +- pkg/event/event.go | 4 +- pkg/event/event_linux.go | 9 +- pkg/event/event_linux_test.go | 12 +- pkg/event/flags.go | 21 +- pkg/event/formatter.go | 131 +- pkg/event/formatter_linux.go | 117 +- pkg/event/formatter_linux_test.go | 4 +- pkg/event/formatter_windows.go | 140 +- pkg/event/marshaller.go | 8 - pkg/event/marshaller_linux.go | 9 +- pkg/event/marshaller_linux_test.go | 4 +- pkg/event/marshaller_windows.go | 10 - pkg/event/metainfo.go | 68 +- pkg/event/metainfo_linux.go | 78 +- pkg/event/metainfo_windows.go | 55 - pkg/event/param.go | 145 +- pkg/event/param_linux.go | 149 +- pkg/event/param_windows.go | 183 ++- pkg/event/params/names.go | 5 - pkg/event/params/names_windows.go | 46 +- pkg/event/params/param_types.go | 37 - pkg/event/params/params_windows.go | 258 ---- pkg/event/params/types.go | 2 +- pkg/event/params/types_linux.go | 35 +- pkg/event/params/types_windows.go | 35 +- pkg/event/pid_linux.go | 27 - pkg/event/pid_windows.go | 27 - pkg/event/queue.go | 60 +- pkg/event/queue_linux.go | 34 +- pkg/event/queue_linux_test.go | 2 +- pkg/event/queue_windows.go | 72 +- pkg/event/types_linux.go | 133 +- pkg/event/types_linux_test.go | 60 - pkg/filter/accessor.go | 12 +- pkg/filter/accessor_linux.go | 20 +- pkg/filter/accessor_stubs_linux.go | 42 - pkg/filter/accessor_windows.go | 18 +- pkg/filter/accessor_windows_test.go | 10 +- pkg/filter/approver.go | 36 +- pkg/filter/approver_linux.go | 2 +- pkg/filter/fields/defs.go | 91 +- pkg/filter/fields/defs_linux.go | 95 +- pkg/filter/fields/defs_linux_test.go | 8 +- pkg/filter/fields/defs_windows.go | 561 ++++---- pkg/filter/fields/fields_windows.go | 1238 ----------------- pkg/filter/filter.go | 39 - pkg/filter/filter_linux.go | 31 + pkg/filter/filter_windows.go | 39 + pkg/filter/util_windows.go | 4 +- pkg/outputs/config.go | 29 +- pkg/ps/snapshotter_impl_windows.go | 756 ---------- pkg/ps/snapshotter_linux.go | 22 +- pkg/ps/snapshotter_windows.go | 737 +++++++++- pkg/ps/types/types_linux.go | 22 +- pkg/rules/action/kill_linux.go | 19 +- pkg/rules/action/kill_linux_test.go | 47 +- pkg/rules/compiler.go | 10 +- pkg/rules/compiler_windows.go | 11 +- pkg/rules/engine_windows_test.go | 8 +- pkg/{config => util/mapdecoder}/decoder.go | 14 +- pkg/util/rest/rest_windows_test.go | 6 +- 125 files changed, 3807 insertions(+), 4908 deletions(-) rename pkg/{event/bitset_linux_test.go => api/dialer_linux.go} (59%) rename pkg/{config/alertsender_linux.go => api/dialer_windows.go} (57%) create mode 100644 pkg/api/listener_windows.go delete mode 100644 pkg/api/server_linux.go delete mode 100644 pkg/api/server_windows.go create mode 100644 pkg/config/alertsender_windows_test.go delete mode 100644 pkg/config/output_linux.go delete mode 100644 pkg/config/output_linux_test.go delete mode 100644 pkg/config/output_windows.go delete mode 100644 pkg/config/output_windows_test.go rename pkg/{event/bitset_linux.go => config/schema_linux.go} (81%) rename pkg/{event/bitset_windows.go => config/schema_windows.go} (80%) create mode 100644 pkg/config/schemas/config.schema.linux.json rename pkg/config/{config.schema.json => schemas/config.schema.windows.json} (99%) rename pkg/config/{ => schemas}/macros.schema.json (100%) rename pkg/config/{ => schemas}/rules.schema.json (100%) delete mode 100644 pkg/event/params/params_windows.go delete mode 100644 pkg/event/pid_linux.go delete mode 100644 pkg/event/pid_windows.go delete mode 100644 pkg/event/types_linux_test.go delete mode 100644 pkg/filter/accessor_stubs_linux.go delete mode 100644 pkg/filter/fields/fields_windows.go delete mode 100644 pkg/ps/snapshotter_impl_windows.go rename pkg/{config => util/mapdecoder}/decoder.go (85%) diff --git a/.gitignore b/.gitignore index d1664f9cc..86a383098 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,24 @@ +# Binaries cmd/fibratus/fibratus.exe cmd/fibratus/fibratus.syso cmd/fibratus/fibratus - cmd/systray/fibratus-systray.exe cmd/systray/fibratus-systray.syso +# Resource message table pkg/util/eventlog/mc/* !pkg/util/eventlog/mc/gen.go +# Windows MSI package build/msi/fibratus-* build/msi/*.wixpdb build/msi/*.msi +# IDE .idea +.vscode + +# Python bytecode cache filaments/__pycache__ # Linux packages diff --git a/.golangci.yml b/.golangci.yml index abc35b26c..a571fc4f5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,8 +1,8 @@ version: "2" -run: - build-tags: - - cap - - filament +# run: +# build-tags: +# - cap +# - filament linters: default: none @@ -43,7 +43,7 @@ linters: path: pkg/util/ports/iana_ports.go - linters: - goconst - path: pkg/event/flags.go + path: pkg/event/flags_windows.go - linters: - goconst path: pkg/filter/ql/functions/(.+)\.go @@ -56,6 +56,9 @@ linters: - linters: - goconst path: pkg/filter/fields/fields_windows.go + - linters: + - goconst + path: pkg/filter/fields/defs_windows.go - linters: - goconst path: cmd/fibratus/app/list/list.go diff --git a/internal/bootstrap/bootstrap_linux.go b/internal/bootstrap/bootstrap_linux.go index 5208dab0c..25dc8bdf9 100644 --- a/internal/bootstrap/bootstrap_linux.go +++ b/internal/bootstrap/bootstrap_linux.go @@ -60,6 +60,7 @@ type App struct { agg *aggregator.BufferedAggregator signals chan struct{} instance net.Listener + server *api.Server } // Option enables changing the behaviour of the bootstrap application. @@ -111,12 +112,18 @@ func NewApp(cfg *config.Config, options ...Option) (*App, error) { log.Info("rule engine is disabled") } + server, err := api.NewServer(cfg) + if err != nil { + return nil, err + } + return &App{ config: cfg, evs: NewEventSourceControl(psnap, cfg, rs, plan), engine: engine, psnap: psnap, signals: sigs, + server: server, }, nil } @@ -164,7 +171,8 @@ func (f *App) Run(args []string) error { if err != nil { return err } - return api.StartServer(cfg) + f.server.Start() + return nil } // Wait waits for the app to receive the termination signal. @@ -192,7 +200,7 @@ func (f *App) Shutdown() error { errs = append(errs, err) } } - if err := api.CloseServer(); err != nil { + if err := f.server.Stop(context.Background()); err != nil { errs = append(errs, err) } if err := alertsender.ShutdownAll(); err != nil { diff --git a/internal/bootstrap/bootstrap_windows.go b/internal/bootstrap/bootstrap_windows.go index 630b5f563..29307ce6d 100644 --- a/internal/bootstrap/bootstrap_windows.go +++ b/internal/bootstrap/bootstrap_windows.go @@ -67,6 +67,7 @@ type App struct { writer cap.Writer reader cap.Reader signals chan struct{} + server *api.Server } // Option enables changing the behaviour of the bootstrap application. @@ -126,6 +127,10 @@ func NewApp(cfg *config.Config, options ...Option) (*App, error) { sigs = signals.Install() } if opts.isCaptureReplay { + server, err := api.NewServer(cfg) + if err != nil { + return nil, err + } reader, err := cap.NewReader(cfg.CapFile, cfg) if err != nil { return nil, err @@ -134,6 +139,7 @@ func NewApp(cfg *config.Config, options ...Option) (*App, error) { config: cfg, reader: reader, signals: sigs, + server: server, } return app, nil } @@ -163,6 +169,11 @@ func NewApp(cfg *config.Config, options ...Option) (*App, error) { evs := NewEventSourceControl(psnap, hsnap, cfg, rs) + server, err := api.NewServer(cfg) + if err != nil { + return nil, err + } + app := &App{ config: cfg, evs: evs, @@ -170,6 +181,7 @@ func NewApp(cfg *config.Config, options ...Option) (*App, error) { hsnap: hsnap, psnap: psnap, signals: sigs, + server: server, } return app, nil @@ -275,8 +287,8 @@ func (f *App) Run(args []string) error { return err } } - // start the HTTP server - return api.StartServer(cfg) + f.server.Start() + return nil } // WriteCapture writes the event stream to the capture file. @@ -310,7 +322,10 @@ func (f *App) WriteCapture(args []string) error { log.Warnf("fail to write event to capture: %v", err) } }() - return api.StartServer(f.config) + + f.server.Start() + + return nil } // ReadCapture reconstructs the event stream from the capture file. @@ -367,8 +382,8 @@ func (f *App) ReadCapture(ctx context.Context, args []string) error { return err } } - - return api.StartServer(f.config) + f.server.Start() + return nil } // Wait waits for the app to receive the termination signal. @@ -422,7 +437,7 @@ func (f *App) Shutdown() error { if err := handle.CloseTimeout(); err != nil { errs = append(errs, err) } - if err := api.CloseServer(); err != nil { + if err := f.server.Stop(context.Background()); err != nil { errs = append(errs, err) } if err := alertsender.ShutdownAll(); err != nil { diff --git a/internal/bootstrap/config.go b/internal/bootstrap/config.go index 81c56e904..b02cb88fa 100644 --- a/internal/bootstrap/config.go +++ b/internal/bootstrap/config.go @@ -19,10 +19,11 @@ package bootstrap import ( + "os" + "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/util/log" "github.com/sirupsen/logrus" - "os" ) // InitConfigAndLogger initializes the configuration and sets up the logger. diff --git a/internal/ebpf/approver.go b/internal/ebpf/approver.go index 854494964..7a51a715b 100644 --- a/internal/ebpf/approver.go +++ b/internal/ebpf/approver.go @@ -96,7 +96,7 @@ func (l *loader) writePlan(gen uint32, plan *filter.ApproverPlan) error { } func policyMode(pol filter.TypePolicy, typ event.Type) uint8 { - if filter.AlwaysAllowed(typ) || !typ.Exists() || pol.DefaultAllow { + if filter.AlwaysAllowed(typ) || pol.DefaultAllow { return 0 } var mode uint8 diff --git a/internal/ebpf/consumer.go b/internal/ebpf/consumer.go index 36d466d6f..a0c893aa8 100644 --- a/internal/ebpf/consumer.go +++ b/internal/ebpf/consumer.go @@ -156,7 +156,7 @@ func buildPS(evt *event.Event, psnap ps.Snapshotter) *pstypes.PS { } ps := &pstypes.PS{ PID: evt.PID, - Ppid: evt.GetParamAsUint64(params.ProcessParentID), + Ppid: evt.GetParamAsUint32(params.ProcessParentID), Name: name, Cmdline: cmdline, Exe: exe, @@ -164,7 +164,7 @@ func buildPS(evt *event.Event, psnap ps.Snapshotter) *pstypes.PS { StartBootTime: evt.GetParamAsUint64(params.StartBootTime), UID: evt.GetParamAsUint32(params.UID), GID: evt.GetParamAsUint32(params.GID), - Threads: make(map[uint64]pstypes.Thread), + Threads: make(map[uint32]pstypes.Thread), } if ok && existing != nil && existing.StartBootTime == ps.StartBootTime && existing.Threads != nil { ps.Threads = existing.Threads diff --git a/internal/ebpf/enrich.go b/internal/ebpf/enrich.go index 19bbe0741..dcd8f6049 100644 --- a/internal/ebpf/enrich.go +++ b/internal/ebpf/enrich.go @@ -28,7 +28,7 @@ import ( // enrichFromProc best-effort reads /proc//{exe,cmdline}. Failures leave // fields empty and never replace the iterator baseline scan. -func enrichFromProc(pid uint64) (exe string, cmdline string, err error) { +func enrichFromProc(pid uint32) (exe string, cmdline string, err error) { exe, err = os.Readlink(fmt.Sprintf("/proc/%d/exe", pid)) if err != nil { exe = "" diff --git a/internal/ebpf/events.go b/internal/ebpf/events.go index 761325283..6ec7aa2fb 100644 --- a/internal/ebpf/events.go +++ b/internal/ebpf/events.go @@ -78,18 +78,14 @@ func (r rawEvent) filename() string { return cString(r.Filename[:]) } func (r rawEvent) aux() string { return cString(r.Aux[:]) } func (r rawEvent) eventType() event.Type { - typ := event.Type(r.Type) - if typ.Exists() { - return typ - } - return event.UnknownType + return event.Type(r.Type) } -func (r rawEvent) processID() uint64 { +func (r rawEvent) processID() uint32 { if r.PID != 0 { - return uint64(r.PID) + return r.PID } - return uint64(r.TGID) + return r.TGID } // toEvent converts the raw eBPF record into an event. The sequence number is @@ -97,22 +93,18 @@ func (r rawEvent) processID() uint64 { // the sequencer only for events that pass exclusion and filtering. func (r rawEvent) toEvent() *event.Event { typ := r.eventType() - info := event.TypeToEventInfo(typ) evt := &event.Event{ - PID: r.processID(), - Tid: uint64(r.TID), - Type: typ, - Name: info.Name, - Category: info.Category, - Description: info.Description, - Host: hostname.Get(), - Timestamp: time.Unix(0, int64(r.TimestampNs)), - Params: event.Params{}, - Metadata: make(event.Metadata), + PID: r.processID(), + Tid: r.TID, + Type: typ, + Host: hostname.Get(), + Timestamp: time.Unix(0, int64(r.TimestampNs)), + Params: event.Params{}, + Metadata: make(event.Metadata), } evt.Params.Append(params.ProcessID, params.PID, evt.PID) evt.Params.Append(params.ThreadID, params.TID, evt.Tid) - evt.Params.Append(params.ProcessParentID, params.PID, uint64(r.PPID)) + evt.Params.Append(params.ProcessParentID, params.PID, r.PPID) evt.Params.Append(params.ProcessName, params.String, r.comm()) evt.Params.Append(params.UID, params.Uint32, r.UID) evt.Params.Append(params.GID, params.Uint32, r.GID) diff --git a/internal/ebpf/events_test.go b/internal/ebpf/events_test.go index 9c7524433..5fd75dd63 100644 --- a/internal/ebpf/events_test.go +++ b/internal/ebpf/events_test.go @@ -113,15 +113,14 @@ func encodeRaw(t *testing.T, ev rawEvent) []byte { type golden struct { Name string `json:"name"` - PID uint64 `json:"pid"` - Tid uint64 `json:"tid"` + PID uint32 `json:"pid"` + Tid uint32 `json:"tid"` Seq uint64 `json:"seq"` Params map[string]string `json:"params"` } func goldenEvent(evt *event.Event) golden { g := golden{ - Name: evt.Name, PID: evt.PID, Tid: evt.Tid, Seq: evt.Seq, diff --git a/internal/ebpf/matrix_test.go b/internal/ebpf/matrix_test.go index 7e3dd91ee..de4904281 100644 --- a/internal/ebpf/matrix_test.go +++ b/internal/ebpf/matrix_test.go @@ -64,7 +64,6 @@ func syscallMatrix() []matrixRow { func TestSyscallEventMatrix(t *testing.T) { seen := map[event.Type]bool{} for _, row := range syscallMatrix() { - assert.True(t, row.typ.Exists(), row.name) assert.Equal(t, row.name, row.typ.String()) assert.NotEmpty(t, row.syscalls) assert.NotEmpty(t, row.hook) @@ -87,7 +86,7 @@ func TestSyscallEventMatrix(t *testing.T) { assert.NoErrorf(t, err, "%s missing param %s", row.name, name) } } - for _, typ := range event.All() { + for _, typ := range event.AllTypes() { assert.Truef(t, seen[typ], "event type %s missing from the syscall matrix", typ) } } @@ -119,7 +118,7 @@ func TestParseSockaddr(t *testing.T) { func TestMmapUpdatesProcessState(t *testing.T) { snap := ps.NewSnapshotter() - ps := &pstypes.PS{PID: 9, Name: "target", StartBootTime: 1, Threads: map[uint64]pstypes.Thread{}} + ps := &pstypes.PS{PID: 9, Name: "target", StartBootTime: 1, Threads: map[uint32]pstypes.Thread{}} snap.Put(ps) raw := rawEvent{Type: uint32(event.Mmap), PID: 9, TGID: 9, Retval: 0x1000, Arg0: 4096, Arg1: 8192, Arg2: 3, Arg3: 3, Flags: 0} @@ -135,7 +134,7 @@ func TestMmapUpdatesProcessState(t *testing.T) { func TestAnonymousMmapSkipped(t *testing.T) { snap := ps.NewSnapshotter() - ps := &pstypes.PS{PID: 9, Name: "target", StartBootTime: 1, Threads: map[uint64]pstypes.Thread{}} + ps := &pstypes.PS{PID: 9, Name: "target", StartBootTime: 1, Threads: map[uint32]pstypes.Thread{}} snap.Put(ps) raw := rawEvent{Type: uint32(event.Mmap), PID: 9, TGID: 9, Retval: 0x1000, Arg1: 8192, Arg2: 3, Arg3: ^uint64(0), Flags: 0x20} diff --git a/internal/ebpf/proc_iter.go b/internal/ebpf/proc_iter.go index 75bba914c..698044034 100644 --- a/internal/ebpf/proc_iter.go +++ b/internal/ebpf/proc_iter.go @@ -36,8 +36,8 @@ func snapshotFromRaw(r rawEvent, exe, cmdline string) *pstypes.PS { } args := splitCmdline(cmdline) return &pstypes.PS{ - PID: uint64(r.TGID), - Ppid: uint64(r.PPID), + PID: r.TGID, + Ppid: r.PPID, Name: name, Cmdline: cmdline, Exe: exe, @@ -45,7 +45,7 @@ func snapshotFromRaw(r rawEvent, exe, cmdline string) *pstypes.PS { StartBootTime: r.StartBootTime, UID: r.UID, GID: r.GID, - Threads: make(map[uint64]pstypes.Thread), + Threads: make(map[uint32]pstypes.Thread), } } diff --git a/internal/ebpf/source.go b/internal/ebpf/source.go index c88a093ba..ef9aeff8e 100644 --- a/internal/ebpf/source.go +++ b/internal/ebpf/source.go @@ -242,11 +242,7 @@ func (e *EventSource) handleRecord(raw []byte) { return } typ := rec.eventType() - if typ == event.UnknownType { - eventsUnknown.Add(1) - return - } - if e.config != nil && !e.config.EventSource.EventExists(typ.ID()) { + if typ == event.Unknown { eventsUnknown.Add(1) return } @@ -267,7 +263,7 @@ func (e *EventSource) handleSnapshot(rec rawEvent) { lateSnapshots.Add(1) return } - exe, cmdline, err := enrichFromProc(uint64(rec.TGID)) + exe, cmdline, err := enrichFromProc(rec.TGID) if err != nil { enrichmentMiss.Add(1) } @@ -318,11 +314,11 @@ func (e *EventSource) dispatch(evt *event.Event) { eventsProcessed.Add(1) if e.config != nil { - if e.config.EventSource.ExcludeEvent(evt.Type.ID()) { + if e.config.EventSource.ExcludeEvent(evt.Type) { eventsExcluded.Add(1) return } - if e.config.EventSource.ExcludeImage(evt.PS) { + if e.config.EventSource.ExcludeProcess(evt.PS) { eventsExcluded.Add(1) return } diff --git a/internal/etw/consumer.go b/internal/etw/consumer.go index 0044309c6..fc7131afb 100644 --- a/internal/etw/consumer.go +++ b/internal/etw/consumer.go @@ -135,7 +135,7 @@ func (c *Consumer) ProcessEvent(r *etw.EventRecord) error { // the filter is evaluated on the event to // decide whether it should get dropped if (evt.IsDropped(c.config.IsCaptureSet()) || - c.config.EventSource.ExcludeImage(evt.PS)) && !evt.IsStackWalk() { + c.config.EventSource.ExcludeProcess(evt.PS)) && !evt.IsStackWalk() { eventsExcluded.Add(1) return nil } diff --git a/internal/etw/source.go b/internal/etw/source.go index db0924c0a..edc919fe5 100644 --- a/internal/etw/source.go +++ b/internal/etw/source.go @@ -142,7 +142,7 @@ func (e *EventSource) Open(config *config.Config) error { continue } if typ == event.CreateProcess || typ == event.TerminateProcess || - typ == event.LoadModule || typ == event.UnloadModule { + typ == event.TerminateThread || typ == event.LoadModule || typ == event.UnloadModule { // always allow fundamental events continue } diff --git a/internal/etw/source_test.go b/internal/etw/source_test.go index 139827c22..40a3c7a98 100644 --- a/internal/etw/source_test.go +++ b/internal/etw/source_test.go @@ -1130,7 +1130,7 @@ func testCallstackEnrichment(t *testing.T, hsnap handle.Snapshotter, psnap ps.Sn BufferSize: 1024, MinBuffers: uint32(runtime.NumCPU() * 2), MaxBuffers: uint32((runtime.NumCPU() * 2) + 20), - ExcludedImages: []string{"System"}, + ExcludedProcesses: []string{"System"}, ExcludedEvents: []string{"WriteFile", "ReadFile", "RegOpenKey", "RegCloseKey", "CloseFile"}, FlushTimer: 1, } diff --git a/pkg/aggregator/aggregator.go b/pkg/aggregator/aggregator.go index 78029d495..d389119b4 100644 --- a/pkg/aggregator/aggregator.go +++ b/pkg/aggregator/aggregator.go @@ -37,7 +37,6 @@ import ( _ "github.com/rabbitstack/fibratus/pkg/outputs/null" // initialize alert senders - _ "github.com/rabbitstack/fibratus/pkg/alertsender/eventlog" _ "github.com/rabbitstack/fibratus/pkg/alertsender/mail" _ "github.com/rabbitstack/fibratus/pkg/alertsender/slack" diff --git a/pkg/aggregator/aggregator_windows.go b/pkg/aggregator/aggregator_windows.go index 2e18307a0..9a379b1db 100644 --- a/pkg/aggregator/aggregator_windows.go +++ b/pkg/aggregator/aggregator_windows.go @@ -22,7 +22,7 @@ package aggregator import ( - // initialize Windows-only outputs and alert senders + // initialize Windows-only alert senders + _ "github.com/rabbitstack/fibratus/pkg/alertsender/eventlog" _ "github.com/rabbitstack/fibratus/pkg/alertsender/systray" - _ "github.com/rabbitstack/fibratus/pkg/outputs/eventlog" ) diff --git a/pkg/aggregator/transformers/config.go b/pkg/aggregator/transformers/config.go index b80270fc7..d0dae0094 100644 --- a/pkg/aggregator/transformers/config.go +++ b/pkg/aggregator/transformers/config.go @@ -18,13 +18,46 @@ package transformers -import "fmt" +import ( + "fmt" + + "github.com/rabbitstack/fibratus/pkg/util/mapdecoder" +) // ErrInvalidConfig signals an invalid transformer configuration var ErrInvalidConfig = func(name Type) error { return fmt.Errorf("invalid config for %q transformer", name) } +// ConfigLoader decodes raw config for a single transformer type. +// enabled reports whether the transformer's Enabled flag was set. +type ConfigLoader func(any) (Config, bool, error) + +// ConfigLoaders is the registry of configured transformers. +type ConfigLoaders map[Type]ConfigLoader + +func (loaders ConfigLoaders) Register(typ Type, loader ConfigLoader) { + if _, ok := loaders[typ]; ok { + panic(fmt.Sprintf("transformer loader %q is already registered", typ)) + } + loaders[typ] = loader +} + // Config acts as a container for the transformer configuration structures. type Config struct { Type Type - Transformer interface{} + Transformer any +} + +// LoadFromConfig builds a transformer loader for a config type T, decoding +// raw into it and reporting whether the transformer is enabled. +func LoadFromConfig[T any](typ Type, enabled func(T) bool) ConfigLoader { + return func(raw any) (Config, bool, error) { + var cfg T + if err := mapdecoder.Decode(raw, &cfg); err != nil { + return Config{}, false, err + } + if !enabled(cfg) { + return Config{}, false, nil + } + return Config{Type: typ, Transformer: cfg}, true, nil + } } diff --git a/pkg/aggregator/transformers/transformer.go b/pkg/aggregator/transformers/transformer.go index e08841637..d89a93e05 100644 --- a/pkg/aggregator/transformers/transformer.go +++ b/pkg/aggregator/transformers/transformer.go @@ -20,6 +20,7 @@ package transformers import ( "fmt" + "github.com/rabbitstack/fibratus/pkg/event" ) @@ -42,6 +43,7 @@ const ( Trim // Tags represents the tags transformer type. This transformer appends tags to the event's metadata. Tags + None ) // String returns the type human-readable name. @@ -62,6 +64,24 @@ func (typ Type) String() string { } } +// TypeFromString converts the string representation of the transformer to its corresponding type. +func TypeFromString(s string) Type { + switch s { + case "remove": + return Remove + case "rename": + return Rename + case "replace": + return Replace + case "trim": + return Trim + case "tags": + return Tags + default: + return None + } +} + // Register registers a singleton instance of the provided transformer. func Register(typ Type, factory Factory) { if _, ok := transformers[typ]; ok { diff --git a/pkg/alertsender/alert.go b/pkg/alertsender/alert.go index 1fa7f2331..8fb024fff 100644 --- a/pkg/alertsender/alert.go +++ b/pkg/alertsender/alert.go @@ -200,7 +200,7 @@ func (a Alert) MarshalJSON() ([]byte, error) { for _, e := range a.Events { evt := alertJSONEvent{ Name: e.Name(), - Category: e.Category.String(), + Category: e.Category().String(), Timestamp: e.Timestamp, Params: make(map[string]any), Callstack: alertCallstack(e), diff --git a/pkg/alertsender/alert_linux.go b/pkg/alertsender/alert_linux.go index 4f3703c11..1c07fe3ba 100644 --- a/pkg/alertsender/alert_linux.go +++ b/pkg/alertsender/alert_linux.go @@ -23,19 +23,19 @@ package alertsender import "github.com/rabbitstack/fibratus/pkg/event" type alertProcess struct { - PID event.PID `json:"pid"` - TID event.TID `json:"tid"` - PPID event.PID `json:"ppid"` - Name string `json:"name"` - Exe string `json:"exe"` - Cmdline string `json:"cmdline,omitempty"` - Pname string `json:"parent_name,omitempty"` - Pcmdline string `json:"parent_cmdline,omitempty"` - Cwd string `json:"cwd,omitempty"` - UID uint32 `json:"uid"` - GID uint32 `json:"gid"` - Username string `json:"username"` - Ancestors []string `json:"ancestors"` + PID uint32 `json:"pid"` + TID uint32 `json:"tid"` + PPID uint32 `json:"ppid"` + Name string `json:"name"` + Exe string `json:"exe"` + Cmdline string `json:"cmdline,omitempty"` + Pname string `json:"parent_name,omitempty"` + Pcmdline string `json:"parent_cmdline,omitempty"` + Cwd string `json:"cwd,omitempty"` + UID uint32 `json:"uid"` + GID uint32 `json:"gid"` + Username string `json:"username"` + Ancestors []string `json:"ancestors"` } func newAlertProcess(e *event.Event) *alertProcess { diff --git a/pkg/alertsender/alert_windows.go b/pkg/alertsender/alert_windows.go index c92870749..b2cb17b47 100644 --- a/pkg/alertsender/alert_windows.go +++ b/pkg/alertsender/alert_windows.go @@ -28,24 +28,24 @@ import ( ) type alertProcess struct { - PID event.PID `json:"pid"` - TID event.TID `json:"tid"` - PPID event.PID `json:"ppid"` - Name string `json:"name"` - Exe string `json:"exe"` - Cmdline string `json:"cmdline,omitempty"` - Pname string `json:"parent_name,omitempty"` - Pcmdline string `json:"parent_cmdline,omitempty"` - Cwd string `json:"cwd,omitempty"` - SID string `json:"sid"` - Username string `json:"username"` - Domain string `json:"domain"` - SessionID uint32 `json:"session_id"` - IntegrityLevel string `json:"integrity_level"` - IsWOW64 bool `json:"is_wow64"` - IsPackaged bool `json:"is_packaged"` - IsProtected bool `json:"is_protected"` - Ancestors []string `json:"ancestors"` + PID uint32 `json:"pid"` + TID uint32 `json:"tid"` + PPID uint32 `json:"ppid"` + Name string `json:"name"` + Exe string `json:"exe"` + Cmdline string `json:"cmdline,omitempty"` + Pname string `json:"parent_name,omitempty"` + Pcmdline string `json:"parent_cmdline,omitempty"` + Cwd string `json:"cwd,omitempty"` + SID string `json:"sid"` + Username string `json:"username"` + Domain string `json:"domain"` + SessionID uint32 `json:"session_id"` + IntegrityLevel string `json:"integrity_level"` + IsWOW64 bool `json:"is_wow64"` + IsPackaged bool `json:"is_packaged"` + IsProtected bool `json:"is_protected"` + Ancestors []string `json:"ancestors"` } func newAlertProcess(e *event.Event) *alertProcess { diff --git a/pkg/alertsender/config.go b/pkg/alertsender/config.go index 5052c4f6e..5b89e2c9a 100644 --- a/pkg/alertsender/config.go +++ b/pkg/alertsender/config.go @@ -18,8 +18,43 @@ package alertsender +import ( + "fmt" + + "github.com/rabbitstack/fibratus/pkg/util/mapdecoder" +) + +// ConfigLoader defines the alert sender configuration loader. +type ConfigLoader func(any) (Config, bool, error) + // Config is the container for the alert sender configuration structure. type Config struct { Type Type - Sender interface{} + Sender any +} + +// ConfigLoaders is the registry of configured alert senders. +type ConfigLoaders map[Type]ConfigLoader + +// Register registers a new alert sender config loader. +func (loaders ConfigLoaders) Register(typ Type, loader ConfigLoader) { + if _, ok := loaders[typ]; ok { + panic(fmt.Sprintf("alertsender loader %q is already registered", typ)) + } + loaders[typ] = loader +} + +// LoadFromConfig builds a sender loader for a config type T, decoding +// raw into it and skipping it when the enabled predicate reports false. +func LoadFromConfig[T any](typ Type, enabled func(T) bool) ConfigLoader { + return func(raw any) (Config, bool, error) { + var cfg T + if err := mapdecoder.Decode(raw, &cfg); err != nil { + return Config{}, false, err + } + if !enabled(cfg) { + return Config{}, false, nil + } + return Config{Type: typ, Sender: cfg}, true, nil + } } diff --git a/pkg/alertsender/sender.go b/pkg/alertsender/sender.go index 80fa70946..6ecba0464 100644 --- a/pkg/alertsender/sender.go +++ b/pkg/alertsender/sender.go @@ -20,6 +20,7 @@ package alertsender import ( "fmt" + "github.com/rabbitstack/fibratus/pkg/util/multierror" ) @@ -93,6 +94,8 @@ func ToType(s string) Type { return Noop case "systray": return Systray + case "eventlog": + return Eventlog default: return None } diff --git a/pkg/event/bitset_linux_test.go b/pkg/api/dialer_linux.go similarity index 59% rename from pkg/event/bitset_linux_test.go rename to pkg/api/dialer_linux.go index 1385c4574..ade0ad059 100644 --- a/pkg/event/bitset_linux_test.go +++ b/pkg/api/dialer_linux.go @@ -1,7 +1,5 @@ -//go:build linux - /* - * Copyright 2026 by Mostafa Moradian + * Copyright 2019-2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -18,17 +16,18 @@ * limitations under the License. */ -package event +package api import ( - "testing" - - "github.com/stretchr/testify/assert" + "context" + "net" + "strings" ) -func TestLinuxBitSets(t *testing.T) { - bitsets := &BitSets{} - bitsets.SetBit(TypeBitSet, Execve) - assert.True(t, bitsets.IsBitSet(&Event{Type: Execve})) - assert.False(t, bitsets.IsBitSet(&Event{Type: Exit})) +// DialLocalTransport creates a dialer for the Linux UNIX domain socket transport. +func DialLocalTransport(path string) func(context.Context, string, string) (net.Conn, error) { + path = strings.TrimPrefix(path, "unix://") + return func(ctx context.Context, _, _ string) (net.Conn, error) { + return (&net.Dialer{}).DialContext(ctx, "unix", path) + } } diff --git a/pkg/config/alertsender_linux.go b/pkg/api/dialer_windows.go similarity index 57% rename from pkg/config/alertsender_linux.go rename to pkg/api/dialer_windows.go index 74c780c5d..72b6b7e27 100644 --- a/pkg/config/alertsender_linux.go +++ b/pkg/api/dialer_windows.go @@ -1,7 +1,5 @@ -//go:build linux - /* - * Copyright 2026 by Mostafa Moradian + * Copyright 2019-2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -18,10 +16,19 @@ * limitations under the License. */ -package config +package api + +import ( + "context" + "net" -import "github.com/rabbitstack/fibratus/pkg/alertsender" + "github.com/Microsoft/go-winio" +) -func (c *Config) loadPlatformAlertSender(_ string, _ interface{}, _ *[]alertsender.Config) error { - return nil +// DialLocalTransport creates a dialer to be used with the http.Client to connect to a named pipe. +func DialLocalTransport(path string) func(context.Context, string, string) (net.Conn, error) { + npipe := transformPipePath(path) + return func(ctx context.Context, _, _ string) (net.Conn, error) { + return winio.DialPipeContext(ctx, npipe) + } } diff --git a/pkg/api/listener.go b/pkg/api/listener.go index f9eac573f..7f3de1463 100644 --- a/pkg/api/listener.go +++ b/pkg/api/listener.go @@ -1,6 +1,3 @@ -//go:build windows -// +build windows - /* * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io @@ -22,49 +19,11 @@ package api import ( - "context" - "fmt" "net" - "strings" - - "github.com/Microsoft/go-winio" ) -// MakePipeListener produces a new listener for receiving requests over a named pipe. -func MakePipeListener(pipePath, descriptor string) (net.Listener, error) { - npipe := transformPipePath(pipePath) - l, err := winio.ListenPipe(npipe, &winio.PipeConfig{SecurityDescriptor: descriptor}) - if err != nil { - return nil, fmt.Errorf("fail to listen on the %q pipe: %v", pipePath, err) - } - return l, nil -} - -// makeTCPListener produces a new listener for receiving requests over TCP. -func makeTCPListener(addr string) (net.Listener, error) { +// MakeTCPListener produces a new listener for receiving requests over TCP. +func MakeTCPListener(addr string) (net.Listener, error) { //nolint:noctx return net.Listen("tcp", addr) } - -// DialLocalTransport creates a dialer for the Windows named pipe transport. -func DialLocalTransport(pipePath string) func(context.Context, string, string) (net.Conn, error) { - npipe := transformPipePath(pipePath) - return func(ctx context.Context, _, _ string) (net.Conn, error) { - return winio.DialPipeContext(ctx, npipe) - } -} - -// transformPipePath takes an input type name defined as a URI like `npipe:///hello` and transform it into -// `\\.\pipe\hello`. Borrowed from https://github.com/elastic/beats/blob/master/libbeat/api/npipe/listener_windows.go -func transformPipePath(name string) string { - if strings.HasPrefix(name, "npipe:///") { - path := strings.TrimPrefix(name, "npipe:///") - return `\\.\pipe\` + path - } - - if strings.HasPrefix(name, `\\.\pipe\`) { - return name - } - - return name -} diff --git a/pkg/api/listener_linux.go b/pkg/api/listener_linux.go index cd145dc41..3bd8abe5a 100644 --- a/pkg/api/listener_linux.go +++ b/pkg/api/listener_linux.go @@ -2,6 +2,7 @@ /* * Copyright 2026 by Mostafa Moradian + * Copyright 2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -21,15 +22,39 @@ package api import ( - "context" + "fmt" "net" + "os" "strings" ) -// DialLocalTransport creates a dialer for the Linux UNIX domain socket transport. -func DialLocalTransport(path string) func(context.Context, string, string) (net.Conn, error) { - path = strings.TrimPrefix(path, "unix://") - return func(ctx context.Context, _, _ string) (net.Conn, error) { - return (&net.Dialer{}).DialContext(ctx, "unix", path) +// MakeListener builds a new listener that either accepts traffic over UNIX domain socket or TCP. +func MakeListener(transport string) (net.Listener, error) { + if strings.HasPrefix(transport, "unix://") { + path := strings.TrimPrefix(transport, "unix://") + return makeUNIXSocketListener(path) } + return MakeTCPListener(transport) +} + +// makeUNIXSocketListener produces a new listener for receiving requests over a UNIX domain socket. +func makeUNIXSocketListener(path string) (net.Listener, error) { + // remove any stale socket file left behind by a previous run. + if err := os.Remove(path); err != nil && !os.IsNotExist(err) { + return nil, fmt.Errorf("failed to remove stale socket %q: %v", path, err) + } + + l, err := net.Listen("unix", path) + if err != nil { + return nil, fmt.Errorf("fail to listen on the %q socket: %v", path, err) + } + + // restrict the socket to the owning user only, mirroring the + // single-user access granted to the named pipe on Windows. + if err := os.Chmod(path, 0600); err != nil { + l.Close() + return nil, fmt.Errorf("failed to set permissions on the %q socket: %v", path, err) + } + + return l, nil } diff --git a/pkg/api/listener_windows.go b/pkg/api/listener_windows.go new file mode 100644 index 000000000..65e584590 --- /dev/null +++ b/pkg/api/listener_windows.go @@ -0,0 +1,73 @@ +//go:build windows + +/* + * Copyright 2019-2020 by Nedim Sabic Sabic + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package api + +import ( + "fmt" + "net" + "os/user" + "strings" + + "github.com/Microsoft/go-winio" +) + +// MakeListener builds a new listener that either accepts traffic over named pipe or TCP socket. +func MakeListener(transport string) (net.Listener, error) { + if strings.HasPrefix(transport, `npipe:///`) { + usr, err := user.Current() + if err != nil { + return nil, fmt.Errorf("failed to retrieve the current user: %v", err) + } + // Named pipe security and access rights. + // We create the pipe and the specific users should only be able to write to it. + // See docs: https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipe-security-and-access-rights + // String definition: https://docs.microsoft.com/en-us/windows/win32/secauthz/ace-strings + // Give generic read/write access to the specified user. + descriptor := "D:P(A;;GA;;;" + usr.Uid + ")" + return makePipeListener(transport, descriptor) + } + return MakeTCPListener(transport) +} + +// makePipeListener produces a new listener for receiving requests over a named pipe. +func makePipeListener(pipePath, descriptor string) (net.Listener, error) { + npipe := transformPipePath(pipePath) + l, err := winio.ListenPipe(npipe, &winio.PipeConfig{SecurityDescriptor: descriptor}) + if err != nil { + return nil, fmt.Errorf("fail to listen on the %q pipe: %v", pipePath, err) + } + return l, nil +} + +// transformPipePath takes an input type name defined as a URI like `npipe:///hello` and transform it into +// `\\.\pipe\hello`. Borrowed from https://github.com/elastic/beats/blob/master/libbeat/api/npipe/listener_windows.go +func transformPipePath(name string) string { + if strings.HasPrefix(name, "npipe:///") { + path := strings.TrimPrefix(name, "npipe:///") + return `\\.\pipe\` + path + } + + if strings.HasPrefix(name, `\\.\pipe\`) { + return name + } + + return name +} diff --git a/pkg/api/server.go b/pkg/api/server.go index 2d1848c8b..c0412a757 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -1,5 +1,5 @@ /* - * Copyright 2020-2021 by Nedim Sabic Sabic + * Copyright 2020-2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -19,34 +19,54 @@ package api import ( + "context" + "errors" "expvar" - "github.com/rabbitstack/fibratus/pkg/api/handler" - "github.com/rabbitstack/fibratus/pkg/config" - log "github.com/sirupsen/logrus" "net" "net/http" "net/http/pprof" "runtime/debug" "strings" + + "github.com/rabbitstack/fibratus/pkg/api/handler" + "github.com/rabbitstack/fibratus/pkg/config" + log "github.com/sirupsen/logrus" ) -func setupServer(lis net.Listener, c *config.Config) { +// Server wraps http.Server and owns the router lifecycle. +type Server struct { + http *http.Server + lis net.Listener +} + +// NewServer builds a Server bound to the given listener, wired +// with the config, debug/vars and pprof endpoints. +func NewServer(c *config.Config) (*Server, error) { mux := http.NewServeMux() mux.Handle("/config", handler.Config(c)) mux.Handle("/debug/vars", expvar.Handler()) mux.HandleFunc("/debug/pprof/", pprof.Index) mux.HandleFunc("/debug/pprof/profile", pprof.Profile) - mux.HandleFunc("/debug/freemem", func(writer http.ResponseWriter, request *http.Request) { + mux.HandleFunc("/debug/freemem", func(w http.ResponseWriter, r *http.Request) { debug.FreeOSMemory() }) - srv := &http.Server{ - Handler: mux, + lis, err := MakeListener(c.API.Transport) + if err != nil { + return nil, err } + return &Server{ + lis: lis, + http: &http.Server{Handler: mux}, + }, nil +} + +// Start begins serving in the background. It does not block. +func (s *Server) Start() { go func() { - if err := srv.Serve(lis); err != nil && err != http.ErrServerClosed { + if err := s.http.Serve(s.lis); err != nil && !errors.Is(err, http.ErrServerClosed) { if strings.Contains(err.Error(), "use of closed network connection") { return } @@ -54,3 +74,8 @@ func setupServer(lis net.Listener, c *config.Config) { } }() } + +// Stop gracefully shuts down the server. +func (s *Server) Stop(ctx context.Context) error { + return s.http.Shutdown(ctx) +} diff --git a/pkg/api/server_linux.go b/pkg/api/server_linux.go deleted file mode 100644 index 72dcd0db1..000000000 --- a/pkg/api/server_linux.go +++ /dev/null @@ -1,62 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package api - -import ( - "fmt" - "net" - "os" - "strings" - - "github.com/rabbitstack/fibratus/pkg/config" -) - -var listener net.Listener - -// StartServer starts the HTTP server with the specified configuration. -func StartServer(c *config.Config) error { - var err error - transport := c.API.Transport - if strings.HasPrefix(transport, "unix://") { - path := strings.TrimPrefix(transport, "unix://") - _ = os.Remove(path) - listener, err = net.Listen("unix", path) - if err != nil { - return fmt.Errorf("fail to listen on the %q socket: %w", path, err) - } - } else { - listener, err = net.Listen("tcp", transport) - if err != nil { - return fmt.Errorf("fail to listen on %q: %w", transport, err) - } - } - - setupServer(listener, c) - return nil -} - -// CloseServer shutdowns the server by stopping the listener. -func CloseServer() error { - if listener != nil { - return listener.Close() - } - return nil -} diff --git a/pkg/api/server_linux_test.go b/pkg/api/server_linux_test.go index 038714dc2..2295bc58d 100644 --- a/pkg/api/server_linux_test.go +++ b/pkg/api/server_linux_test.go @@ -23,6 +23,7 @@ package api_test import ( + "context" "encoding/json" "net" "os" @@ -67,8 +68,10 @@ func TestServerServesBothTransports(t *testing.T) { } { t.Run(transport, func(t *testing.T) { cfg := newConfig(t, transport) - require.NoError(t, api.StartServer(cfg)) - t.Cleanup(func() { require.NoError(t, api.CloseServer()) }) + srv, err := api.NewServer(cfg) + require.NoError(t, err) + srv.Start() + t.Cleanup(func() { require.NoError(t, srv.Stop(context.Background())) }) body, err := rest.Get(rest.WithTransport(transport), rest.WithURI("debug/vars")) require.NoError(t, err) @@ -94,8 +97,10 @@ func TestServerReplacesStaleSocket(t *testing.T) { require.NoError(t, os.WriteFile(socket, nil, 0o600)) cfg := newConfig(t, "unix://"+socket) - require.NoError(t, api.StartServer(cfg)) - t.Cleanup(func() { require.NoError(t, api.CloseServer()) }) + srv, err := api.NewServer(cfg) + require.NoError(t, err) + srv.Start() + t.Cleanup(func() { require.NoError(t, srv.Stop(context.Background())) }) body, err := rest.Get(rest.WithTransport("unix://"+socket), rest.WithURI("debug/vars")) require.NoError(t, err) diff --git a/pkg/api/server_windows.go b/pkg/api/server_windows.go deleted file mode 100644 index 2884a0a2b..000000000 --- a/pkg/api/server_windows.go +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2019-2020 by Nedim Sabic Sabic - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package api - -import ( - "fmt" - "github.com/rabbitstack/fibratus/pkg/config" - "net" - "os/user" - "strings" -) - -var listener net.Listener - -// StartServer starts the HTTP server with the specified configuration. -func StartServer(c *config.Config) error { - var err error - apiConfig := c.API - if strings.HasPrefix(apiConfig.Transport, `npipe:///`) { - usr, err := user.Current() - if err != nil { - return fmt.Errorf("failed to retrieve the current user: %v", err) - } - // Named pipe security and access rights. - // We create the pipe and the specific users should only be able to write to it. - // See docs: https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipe-security-and-access-rights - // String definition: https://docs.microsoft.com/en-us/windows/win32/secauthz/ace-strings - // Give generic read/write access to the specified user. - descriptor := "D:P(A;;GA;;;" + usr.Uid + ")" - listener, err = MakePipeListener(apiConfig.Transport, descriptor) - if err != nil { - return err - } - } else { - listener, err = makeTCPListener(apiConfig.Transport) - } - if err != nil { - return err - } - - setupServer(listener, c) - - return nil -} - -// CloseServer shutdowns the server by stopping the listener. -func CloseServer() error { - if listener != nil { - return listener.Close() - } - return nil -} diff --git a/pkg/callstack/callstack_linux.go b/pkg/callstack/callstack_linux.go index 711cfb678..b3530e7d3 100644 --- a/pkg/callstack/callstack_linux.go +++ b/pkg/callstack/callstack_linux.go @@ -20,8 +20,6 @@ package callstack -import "strings" - // Callstack is a sequence of stack frames. type Callstack []Frame @@ -53,18 +51,7 @@ func (s *Callstack) Depth() int { return len(*s) } func (s *Callstack) IsEmpty() bool { return s.Depth() == 0 } func (s Callstack) String() string { - if len(s) == 0 { - return "" - } - parts := make([]string, 0, len(s)) - for _, f := range s { - if f.Symbol != "" { - parts = append(parts, f.Symbol) - continue - } - parts = append(parts, f.Module) - } - return strings.Join(parts, " < ") + return "" } // Colorize returns a plain string representation on Linux. diff --git a/pkg/config/alertsender.go b/pkg/config/alertsender.go index 5abc11343..a600a2c15 100644 --- a/pkg/config/alertsender.go +++ b/pkg/config/alertsender.go @@ -29,62 +29,51 @@ import ( "github.com/rabbitstack/fibratus/pkg/alertsender/slack" ) -var errNoAlertsendersSection = errors.New("no alertsenders section in config") +var ErrNoAlertsendersSection = errors.New("no alertsenders section in config") -var errAlertsenderConfig = func(sender string, err error) error { +var ErrAlertsenderConfig = func(sender string, err error) error { return fmt.Errorf("%s alert sender invalid config: %v", sender, err) } -func (c *Config) tryLoadAlertSenders() error { +var senders = alertsender.ConfigLoaders{} + +func init() { + senders.Register(alertsender.Mail, alertsender.LoadFromConfig(alertsender.Mail, func(c mail.Config) bool { return c.Enabled })) + senders.Register(alertsender.Slack, alertsender.LoadFromConfig(alertsender.Slack, func(c slack.Config) bool { return c.Enabled })) +} + +// TryLoadAlertSenders loads configs for all registered alert senders. +func (c *BaseConfig) TryLoadAlertSenders() error { if c.ForwardMode || c.IsCaptureSet() { // In event forwarding mode or capture control, alert senders are useless return nil } - configs := make([]alertsender.Config, 0) alertsenders := c.viper.AllSettings()["alertsenders"] if alertsenders == nil { - return errNoAlertsendersSection + return ErrNoAlertsendersSection } - mapping, ok := alertsenders.(map[string]interface{}) + mapping, ok := alertsenders.(map[string]any) if !ok { return fmt.Errorf("expected map[string]interface{} type for alertsenders but found %s", reflect.TypeOf(alertsenders)) } - for typ, config := range mapping { - switch typ { - case "mail": - var mailConfig mail.Config - if err := decode(config, &mailConfig); err != nil { - return errAlertsenderConfig(typ, err) - } - if !mailConfig.Enabled { - continue - } - configs = append(configs, alertsender.Config{ - Type: alertsender.Mail, - Sender: mailConfig, - }) - case "slack": - var slackConfig slack.Config - if err := decode(config, &slackConfig); err != nil { - return errAlertsenderConfig(typ, err) - } - if !slackConfig.Enabled { - continue - } - configs = append(configs, alertsender.Config{ - Type: alertsender.Slack, - Sender: slackConfig, - }) - default: - if err := c.loadPlatformAlertSender(typ, config, &configs); err != nil { - return err - } + configs := make([]alertsender.Config, 0, len(mapping)) + for name, raw := range mapping { + loader, ok := senders[alertsender.ToType(name)] + if !ok { + return fmt.Errorf("unknown alertsender type %q", name) } + cfg, enabled, err := loader(raw) + if err != nil { + return ErrAlertsenderConfig(name, err) + } + if !enabled { + continue + } + configs = append(configs, cfg) } - c.Alertsenders = configs return nil diff --git a/pkg/config/alertsender_linux_test.go b/pkg/config/alertsender_linux_test.go index d48b3c364..174d56d9d 100644 --- a/pkg/config/alertsender_linux_test.go +++ b/pkg/config/alertsender_linux_test.go @@ -1,5 +1,3 @@ -//go:build linux - /* * Copyright 2026 by Mostafa Moradian * https://www.fibratus.io @@ -29,7 +27,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestAlertSendersLinux(t *testing.T) { +func TestAlertSenders(t *testing.T) { c := NewWithOpts(WithRun()) c.viper.Set("alertsenders", map[string]interface{}{ "mail": map[string]interface{}{ @@ -44,7 +42,7 @@ func TestAlertSendersLinux(t *testing.T) { "systray": map[string]interface{}{"enabled": true}, }) - require.NoError(t, c.tryLoadAlertSenders()) + require.NoError(t, c.TryLoadAlertSenders()) require.Len(t, c.Alertsenders, 2) for _, sender := range c.Alertsenders { switch sender.Type { diff --git a/pkg/config/alertsender_windows.go b/pkg/config/alertsender_windows.go index 83eaf8cc1..70e1bc0a0 100644 --- a/pkg/config/alertsender_windows.go +++ b/pkg/config/alertsender_windows.go @@ -27,32 +27,7 @@ import ( "github.com/rabbitstack/fibratus/pkg/alertsender/systray" ) -func (c *Config) loadPlatformAlertSender(typ string, config interface{}, configs *[]alertsender.Config) error { - switch typ { - case "systray": - var systrayConfig systray.Config - if err := decode(config, &systrayConfig); err != nil { - return errAlertsenderConfig(typ, err) - } - if !systrayConfig.Enabled { - return nil - } - *configs = append(*configs, alertsender.Config{ - Type: alertsender.Systray, - Sender: systrayConfig, - }) - case "eventlog": - var eventlogConfig eventlog.Config - if err := decode(config, &eventlogConfig); err != nil { - return errAlertsenderConfig(typ, err) - } - if !eventlogConfig.Enabled { - return nil - } - *configs = append(*configs, alertsender.Config{ - Type: alertsender.Eventlog, - Sender: eventlogConfig, - }) - } - return nil +func init() { + senders.Register(alertsender.Eventlog, alertsender.LoadFromConfig(alertsender.Eventlog, func(c eventlog.Config) bool { return c.Enabled })) + senders.Register(alertsender.Systray, alertsender.LoadFromConfig(alertsender.Systray, func(c systray.Config) bool { return c.Enabled })) } diff --git a/pkg/config/alertsender_windows_test.go b/pkg/config/alertsender_windows_test.go new file mode 100644 index 000000000..993fbfecf --- /dev/null +++ b/pkg/config/alertsender_windows_test.go @@ -0,0 +1,63 @@ +/* + * Copyright 2026 by Mostafa Moradian + * https://www.fibratus.io + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "testing" + + "github.com/rabbitstack/fibratus/pkg/alertsender" + "github.com/rabbitstack/fibratus/pkg/alertsender/eventlog" + "github.com/rabbitstack/fibratus/pkg/alertsender/mail" + "github.com/rabbitstack/fibratus/pkg/alertsender/slack" + "github.com/rabbitstack/fibratus/pkg/alertsender/systray" + "github.com/stretchr/testify/require" +) + +func TestAlertSenders(t *testing.T) { + c := NewWithOpts(WithRun()) + c.viper.Set("alertsenders", map[string]interface{}{ + "mail": map[string]interface{}{ + "enabled": true, + "host": "smtp.example.com", + }, + "slack": map[string]interface{}{ + "enabled": true, + "url": "https://example.com/hook", + }, + "eventlog": map[string]interface{}{"enabled": true}, + "systray": map[string]interface{}{"enabled": true}, + }) + + require.NoError(t, c.TryLoadAlertSenders()) + require.Len(t, c.Alertsenders, 4) + for _, sender := range c.Alertsenders { + switch sender.Type { + case alertsender.Mail: + require.IsType(t, mail.Config{}, sender.Sender) + case alertsender.Slack: + require.IsType(t, slack.Config{}, sender.Sender) + case alertsender.Systray: + require.IsType(t, systray.Config{}, sender.Sender) + case alertsender.Eventlog: + require.IsType(t, eventlog.Config{}, sender.Sender) + default: + require.Failf(t, "unexpected sender", "%v", sender.Type) + } + } +} diff --git a/pkg/config/config.go b/pkg/config/config.go index 6de93c8c7..4f56a1b0c 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -56,30 +56,38 @@ const ( forwardMode = "forward" ) -// Config stores configuration options for fine-tuning the behaviour of Fibratus. -type Config struct { - platformConfig - +// BaseConfig stores configuration options that are platform-neutral. +type BaseConfig struct { // EventSource stores options for fine-tuning the event source. EventSource EventSourceConfig `json:"eventsource" yaml:"eventsource"` + // Filament contains filament settings. Filament FilamentConfig `json:"filament" yaml:"filament"` + // API stores global HTTP API preferences. API APIConfig `json:"api" yaml:"api"` + // Output stores the currently active output configuration. Output outputs.Config + // Aggregator stores event aggregator configuration. Aggregator aggregator.Config `json:"aggregator" yaml:"aggregator"` + // Log contains logging configuration. Log log.Config `json:"logging" yaml:"logging"` + // Transformers stores transformer configurations. Transformers []transformers.Config + // Alertsenders stores alert sender configurations. Alertsenders []alertsender.Config + // Filters contains filter and rule definitions. Filters *Filters `json:"filters" yaml:"filters"` + // ForwardMode designates whether event forwarding mode is engaged. ForwardMode bool `json:"forward" yaml:"forward"` + // CapFile is the path to the capture file. CapFile string @@ -119,8 +127,8 @@ func WithStats() Option { return func(o *Options) { o.stats = true } } // WithValidate determines whether the validate command is executed. func WithValidate() Option { return func(o *Options) { o.validate = true } } -// NewWithOpts builds a new configuration store from files, environment variables, and flags. -func NewWithOpts(options ...Option) *Config { +// newWithOpts builds a new base configuration store from files, environment variables, and flags. +func newWithOpts(options ...Option) BaseConfig { opts := &Options{} for _, option := range options { option(opts) @@ -130,17 +138,16 @@ func NewWithOpts(options ...Option) *Config { v.AutomaticEnv() v.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_")) - c := &Config{ - platformConfig: newPlatformConfig(), - EventSource: EventSourceConfig{}, - Filament: FilamentConfig{}, - API: APIConfig{}, - Aggregator: aggregator.Config{}, - Log: log.Config{}, - Filters: &Filters{}, - flags: new(pflag.FlagSet), - viper: v, - opts: opts, + c := BaseConfig{ + EventSource: EventSourceConfig{}, + Filament: FilamentConfig{}, + API: APIConfig{}, + Aggregator: aggregator.Config{}, + Log: log.Config{}, + Filters: &Filters{}, + flags: new(pflag.FlagSet), + viper: v, + opts: opts, } if opts.run || opts.replay { @@ -159,12 +166,12 @@ func NewWithOpts(options ...Option) *Config { } c.addFlags() - c.addPlatformFlags() + return c } // MustViperize adds the configuration flags to the Cobra command. -func (c *Config) MustViperize(cmd *cobra.Command) { +func (c *BaseConfig) MustViperize(cmd *cobra.Command) { cmd.PersistentFlags().AddFlagSet(c.flags) if err := c.viper.BindPFlags(cmd.PersistentFlags()); err != nil { panic(err) @@ -176,8 +183,29 @@ func (c *Config) MustViperize(cmd *cobra.Command) { } } -// Init initializes the configuration state from Viper. -func (c *Config) Init() error { +// init initializes the configuration state from Viper and +// loads/decodes output, transformer and alert sender configs. +func (c *BaseConfig) init() error { + c.initFromViper() + + if !c.opts.run && !c.opts.replay { + return nil + } + + if err := c.TryLoadOutput(); err != nil { + return err + } + if err := c.TryLoadTransformers(); err != nil { + return err + } + if err := c.TryLoadAlertSenders(); err != nil { + return err + } + + return nil +} + +func (c *BaseConfig) initFromViper() { c.EventSource.initFromViper(c.viper) c.Filament.initFromViper(c.viper) c.API.initFromViper(c.viper) @@ -186,43 +214,36 @@ func (c *Config) Init() error { c.Filters.initFromViper(c.viper) c.ForwardMode = c.viper.GetBool(forwardMode) c.CapFile = c.viper.GetString(capFile) - c.initPlatform() - - if c.opts.run || c.opts.replay { - if err := c.tryLoadOutput(); err != nil { - return err - } - if err := c.tryLoadTransformers(); err != nil { - return err - } - if err := c.tryLoadAlertSenders(); err != nil { - return err - } - } - return nil } -func (c *Config) GetConfigFile() string { return c.viper.GetString(configFile) } +// GetConfigFile gets the path of the configuration file from Viper value. +func (c *BaseConfig) GetConfigFile() string { return c.viper.GetString(configFile) } -func (c *Config) GetFilters() []*FilterConfig { +// GetFilters returns all rule filters loaded into the engine. +func (c *BaseConfig) GetFilters() []*FilterConfig { if c.Filters == nil { return nil } return c.Filters.filters } -func (c *Config) TryLoadFile(file string) error { +// TryLoadFile attempts to load the configuration file from specified path on the file system. +func (c *BaseConfig) TryLoadFile(file string) error { c.viper.SetConfigFile(file) return c.viper.ReadInConfig() } -func (c *Config) validateConfig() error { +// Validate ensures that all configuration options provided by user have the expected values. It returns +// a list of validation errors prefixed with the offending configuration property/flag. +func (c *BaseConfig) Validate() error { + // we'll first validate the structure and values of the config file file := c.viper.GetString(configFile) - var out interface{} + var out any b, err := os.ReadFile(file) if err != nil { return err } + switch filepath.Ext(file) { case ".yaml", ".yml": err = yaml.Unmarshal(b, &out) @@ -234,32 +255,37 @@ func (c *Config) validateConfig() error { if err != nil { return fmt.Errorf("couldn't read the config file: %v", err) } + + // validate config file content valid, errs := validate(configSchema, out) if !valid || len(errs) > 0 { return fmt.Errorf("invalid config: %v", multierror.Wrap(errs...)) } + + // now validate the Viper config flags valid, errs = validate(configSchema, c.viper.AllSettings()) if !valid || len(errs) > 0 { return fmt.Errorf("invalid config: %v", multierror.Wrap(errs...)) } + return nil } -func (c *Config) IsCaptureSet() bool { return c.CapFile != "" } -func (c *Config) IsFilamentSet() bool { return c.Filament.Name != "" } -func (c *Config) ConfigExists() bool { _, err := os.Stat(c.File()); return err == nil } -func (c *Config) File() string { return c.viper.GetString(configFile) } +func (c *BaseConfig) IsCaptureSet() bool { return c.CapFile != "" } +func (c *BaseConfig) IsFilamentSet() bool { return c.Filament.Name != "" } +func (c *BaseConfig) ConfigExists() bool { _, err := os.Stat(c.File()); return err == nil } +func (c *BaseConfig) File() string { return c.viper.GetString(configFile) } -func (c *Config) addFlags() { - c.flags.String(configFile, defaultConfigFile(), "Indicates the location of the configuration file") +func (c *BaseConfig) addFlags() { + c.flags.String(configFile, configFilePath, "Indicates the location of the configuration file") if c.opts.run { c.flags.Bool(forwardMode, false, "Designates if event forwarding mode is engaged") } if c.opts.run || c.opts.replay || c.opts.validate { c.flags.StringP(filamentName, "f", "", "Specifies the filament to execute") c.flags.Bool(rulesEnabled, true, "Indicates if the rule engine is enabled and rules loaded") - c.flags.StringSlice(rulesFromPaths, defaultRulesPaths(), "Comma-separated list of rules files") - c.flags.StringSlice(macrosFromPaths, defaultMacrosPaths(), "Comma-separated list of macro files") + c.flags.StringSlice(rulesFromPaths, rulesPaths, "Comma-separated list of rules files") + c.flags.StringSlice(macrosFromPaths, macrosPaths, "Comma-separated list of macro files") c.flags.StringSlice(rulesFromURLs, nil, "Comma-separated list of rules URL resources") c.flags.Bool(matchAll, true, "Indicates if the match all strategy is enabled for the rule engine") } @@ -270,11 +296,12 @@ func (c *Config) addFlags() { c.flags.StringP(capFile, "k", "", "The path of the input cap file") } if c.opts.run || c.opts.replay || c.opts.list || c.opts.validate { - c.flags.String(filamentPath, defaultFilamentPath(), "Denotes the directory where filaments are located") + c.flags.String(filamentPath, filamentsPaths, "Denotes the directory where filaments are located") } if c.opts.run || c.opts.replay || c.opts.capture || c.opts.stats { - c.flags.String(transport, defaultTransport(), "Specifies the underlying transport protocol for the API HTTP server") + c.flags.String(transport, apiTransport, "Specifies the underlying transport protocol for the API HTTP server") c.flags.Duration(timeout, 15*time.Second, "Determines the timeout for the API server responses") } c.Log.AddFlags(c.flags) + c.EventSource.AddFlags(c.flags) } diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index 167516995..20eb0c41d 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -20,31 +20,43 @@ package config -import "path/filepath" +import ( + "path/filepath" +) -type platformConfig struct{} +var ( + // configFilePath defines the default value for the configuration file path + configFilePath = filepath.Join("/etc", "fibratus", "fibratus.yml") -func newPlatformConfig() platformConfig { return platformConfig{} } + // filamentsPaths defines the default directory containing filament scripts + filamentsPaths = filepath.Join("/usr", "share", "fibratus", "filaments") -func (c *Config) addPlatformFlags() { - c.EventSource.AddFlags(c.flags) -} + // rulesPaths defines default rule paths + rulesPaths = []string{filepath.Join("/etc", "fibratus", "rules", "*")} -func (c *Config) initPlatform() {} + // macrosPaths defines default macro paths + macrosPaths = []string{filepath.Join("/etc", "fibratus", "rules", "macros", "*")} -func (c *Config) Validate() error { return c.validateConfig() } + // apiTransport apiTransport defines the default transport protocol for + // the API server. It keeps the API off the network unless someone asks + // for it. Filesystem permissions on the socket then decide who can reach it. + apiTransport = "unix:///var/run/fibratus.sock" +) -func defaultConfigFile() string { return filepath.Join("/etc", "fibratus", "fibratus.yml") } -func defaultFilamentPath() string { - return filepath.Join("/usr", "share", "fibratus", "filaments") -} -func defaultRulesPaths() []string { - return []string{filepath.Join("/etc", "fibratus", "rules", "*")} +// Config exposes the platform configuration options. +type Config struct { + BaseConfig } -func defaultMacrosPaths() []string { - return []string{filepath.Join("/etc", "fibratus", "rules", "macros", "*")} + +// NewWithOpts builds a new platform configuration store. +func NewWithOpts(options ...Option) *Config { + c := &Config{ + BaseConfig: newWithOpts(options...), + } + return c } -// defaultTransport keeps the API off the network unless someone asks for it. -// Filesystem permissions on the socket then decide who can reach it. -func defaultTransport() string { return "unix:///var/run/fibratus.sock" } +// Init initializes the config state. +func (c *Config) Init() error { + return c.BaseConfig.init() +} diff --git a/pkg/config/config_linux_test.go b/pkg/config/config_linux_test.go index 68d1bd774..c1922d507 100644 --- a/pkg/config/config_linux_test.go +++ b/pkg/config/config_linux_test.go @@ -29,7 +29,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestLinuxDefaults(t *testing.T) { +func TestDefaults(t *testing.T) { // No config file on the box, which is the state a fresh install starts in. c := NewWithOpts(WithRun()) cmd := &cobra.Command{} @@ -40,7 +40,7 @@ func TestLinuxDefaults(t *testing.T) { // nothing beyond what socket permissions allow. assert.Equal(t, "unix:///var/run/fibratus.sock", c.API.Transport) - assert.Equal(t, filepath.Join("/etc", "fibratus", "fibratus.yml"), defaultConfigFile()) - assert.Equal(t, []string{filepath.Join("/etc", "fibratus", "rules", "*")}, defaultRulesPaths()) - assert.Equal(t, []string{filepath.Join("/etc", "fibratus", "rules", "macros", "*")}, defaultMacrosPaths()) + assert.Equal(t, filepath.Join("/etc", "fibratus", "fibratus.yml"), configFilePath) + assert.Equal(t, []string{filepath.Join("/etc", "fibratus", "rules", "*")}, rulesPaths) + assert.Equal(t, []string{filepath.Join("/etc", "fibratus", "rules", "macros", "*")}, macrosPaths) } diff --git a/pkg/config/config_windows.go b/pkg/config/config_windows.go index 4c39baa14..8a983cb85 100644 --- a/pkg/config/config_windows.go +++ b/pkg/config/config_windows.go @@ -44,30 +44,80 @@ const ( serializeThreads = "event.serialize-threads" serializeModules = "event.serialize-modules" + serializeEnvs = "event.serialize-envs" serializeHandles = "event.serialize-handles" serializePE = "event.serialize-pe" - serializeEnvs = "event.serialize-envs" ) -type platformConfig struct { - PE pe.Config `json:"pe" yaml:"pe"` - InitHandleSnapshot bool `json:"init-handle-snapshot" yaml:"init-handle-snapshot"` - EnumerateHandles bool `json:"enumerate-handles" yaml:"enumerate-handles"` - SymbolPaths string `json:"symbol-paths" yaml:"symbols-paths"` - SymbolizeKernelAddresses bool `json:"symbolize-kernel-addresses" yaml:"symbolize-kernel-addresses"` - DebugPrivilege bool `json:"debug-privilege" yaml:"debug-privilege"` - Yara yara.Config `json:"yara" yaml:"yara"` - Evasion evasion.Config `json:"evasion" yaml:"evasion"` +var ( + // configFilePath defines the default value for the configuration file path + configFilePath = filepath.Join(os.Getenv("PROGRAMFILES"), "fibratus", "config", "fibratus.yml") + + // filamentsPaths defines the default directory containing filament scripts + filamentsPaths = filepath.Join(os.Getenv("PROGRAMFILES"), "fibratus", "filaments") + + // rulesPaths defines default rule paths + rulesPaths = []string{filepath.Join(rulesDir(), "*")} + + // macrosPaths defines default macro paths + macrosPaths = []string{filepath.Join(rulesDir(), "Macros", "*")} + + // apiTransport defines the default transport protocol for the API server + apiTransport = "http://localhost:8482" +) + +// Config exposes the platform configuration options. +type Config struct { + BaseConfig + // PE contains the settings that influences the behaviour of the PE (Portable Executable) reader. + PE pe.Config `json:"pe" yaml:"pe"` + + // InitHandleSnapshot indicates whether initial handle snapshot is built + InitHandleSnapshot bool `json:"init-handle-snapshot" yaml:"init-handle-snapshot"` + + // EnumerateHandles indicates if process handles are collected during startup or + // when a new process is spawn + EnumerateHandles bool `json:"enumerate-handles" yaml:"enumerate-handles"` + + // SymbolPaths designates the path or a series of paths separated by a semicolon + // that is used to search for symbols files. + SymbolPaths string `json:"symbol-paths" yaml:"symbols-paths"` + + // SymbolizeKernelAddresses determines if kernel stack addresses are symbolized. + SymbolizeKernelAddresses bool `json:"symbolize-kernel-addresses" yaml:"symbolize-kernel-addresses"` + + // DebugPrivilege dictates if the SeDebugPrivilege is injected into + // Fibratus process' access token. + DebugPrivilege bool `json:"debug-privilege" yaml:"debug-privilege"` + + // Yara contains configuration that influences the behaviour of the Yara engine + Yara yara.Config `json:"yara" yaml:"yara"` + + // Evasion controls the detection of evasion behaviours. + Evasion evasion.Config `json:"evasion" yaml:"evasion"` } -func newPlatformConfig() platformConfig { - return platformConfig{ - PE: pe.Config{}, - Yara: yara.Config{}, +// NewWithOpts builds a new platform configuration store. +func NewWithOpts(options ...Option) *Config { + c := &Config{ + BaseConfig: newWithOpts(options...), + PE: pe.Config{}, + Yara: yara.Config{}, } + + c.addFlags() + + return c +} + +// Init initializes the config state. +func (c *Config) Init() error { + c.initFromViper() + return c.init() } -func (c *Config) addPlatformFlags() { +// addFlags populates the platform flags set. +func (c *Config) addFlags() { if c.opts.run || c.opts.replay { systray.AddFlags(c.flags) eventlog.AddFlags(c.flags) @@ -75,7 +125,6 @@ func (c *Config) addPlatformFlags() { } if c.opts.run || c.opts.capture { pe.AddFlags(c.flags) - c.EventSource.AddFlags(c.flags) } if c.opts.run { evasion.AddFlags(c.flags) @@ -94,7 +143,7 @@ func (c *Config) addPlatformFlags() { } } -func (c *Config) initPlatform() { +func (c *Config) initFromViper() { c.PE.InitFromViper(c.viper) c.Yara.InitFromViper(c.viper) c.InitHandleSnapshot = c.viper.GetBool(initHandleSnapshot) @@ -112,28 +161,7 @@ func (c *Config) initPlatform() { } } -// Validate validates the configuration file and merged Viper settings against the schema. -func (c *Config) Validate() error { return c.validateConfig() } - -func defaultConfigFile() string { - return filepath.Join(os.Getenv("PROGRAMFILES"), "fibratus", "config", "fibratus.yml") -} - -func defaultFilamentPath() string { - return filepath.Join(os.Getenv("PROGRAMFILES"), "fibratus", "filaments") -} - -func defaultRulesPaths() []string { - return []string{filepath.Join(defaultRulesDir(), "*")} -} - -func defaultMacrosPaths() []string { - return []string{filepath.Join(defaultRulesDir(), "Macros", "*")} -} - -func defaultTransport() string { return "localhost:8080" } - -func defaultRulesDir() string { +func rulesDir() string { exe, err := os.Executable() if err != nil { exe = filepath.Join(os.Getenv("ProgramFiles"), "Fibratus", "Bin", "fibratus.exe") diff --git a/pkg/config/eventsource.go b/pkg/config/eventsource.go index a6edb2be8..1fe873c2e 100644 --- a/pkg/config/eventsource.go +++ b/pkg/config/eventsource.go @@ -21,190 +21,68 @@ package config import ( "github.com/rabbitstack/fibratus/pkg/event" -<<<<<<< HEAD - "github.com/rabbitstack/fibratus/pkg/util/bitmap" - -======= ->>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" - "github.com/rabbitstack/fibratus/pkg/util/bitmask" + "github.com/rabbitstack/fibratus/pkg/util/bitmap" ) -<<<<<<< HEAD -const ( - enableThreadEvents = "eventsource.enable-thread" - enableRegistryEvents = "eventsource.enable-registry" - enableNetEvents = "eventsource.enable-net" - enableFileIOEvents = "eventsource.enable-fileio" - enableVAMapEvents = "eventsource.enable-vamap" - enableModuleEvents = "eventsource.enable-module" - enableMemEvents = "eventsource.enable-mem" - enableAuditAPIEvents = "eventsource.enable-audit-api" - enableDNSEvents = "eventsource.enable-dns" - stackEnrichment = "eventsource.stack-enrichment" - bufferSize = "eventsource.buffer-size" - minBuffers = "eventsource.min-buffers" - maxBuffers = "eventsource.max-buffers" - flushInterval = "eventsource.flush-interval" - - excludedEvents = "eventsource.blacklist.events" - excludedImages = "eventsource.blacklist.images" +const excludedEvents = "eventsource.blacklist.events" +const excludedProcesses = "eventsource.blacklist.images" - maxBufferSize = uint32(512) -) +// EventFilter defines the dropped event types bitmap and the processes exclusion map. +type EventFilter struct { + // Types is the bitmap with dropped event masks. + Types bitmap.Bitmap[event.Type] -var ( - defaultMinBuffers = uint32(runtime.NumCPU() * 2) - defaultMaxBuffers = uint32(runtime.NumCPU() * 8) - defaultFlushInterval = time.Second -) + // Processes contains the list of process executables names + // that are dropped in the event processing pipeline. + Processes map[string]bool +} -// EventSourceConfig stores different configuration options for fine-tuning the event source. -type EventSourceConfig struct { - // EnableThreadEvents indicates if thread events are collected by the ETW provider. - EnableThreadEvents bool `json:"enable-thread" yaml:"enable-thread"` - // EnableRegistryEvents indicates if registry events are collected by the ETW provider. - EnableRegistryEvents bool `json:"enable-registry" yaml:"enable-registry"` - // EnableNetEvents determines whether network (TCP/UDP) events are collected by the ETW provider. - EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` - // EnableFileIOEvents indicates if file I/O events are collected by the ETW provider. - EnableFileIOEvents bool `json:"enable-fileio" yaml:"enable-fileio"` - // EnableVAMapEvents indicates if VA map/unmap events are collected by the ETW provider. - EnableVAMapEvents bool `json:"enable-vamap" yaml:"enable-vamap"` - // EnableModuleEvents indicates if module events are collected by the ETW provider. - EnableModuleEvents bool `json:"enable-image" yaml:"enable-module"` - // EnableMemEvents indicates whether memory manager events are enabled. - EnableMemEvents bool `json:"enable-memory" yaml:"enable-memory"` - // EnableAuditAPIEvents indicates if kernel audit API calls events are enabled - EnableAuditAPIEvents bool `json:"enable-audit-api" yaml:"enable-audit-api"` - // EnableDNSEvents indicates if DNS client events are enabled - EnableDNSEvents bool `json:"enable-dns" yaml:"enable-dns"` - // StackEnrichment indicates if stack enrichment is enabled for eligible events. - StackEnrichment bool `json:"stack-enrichment" yaml:"stack-enrichment"` - // BufferSize represents the amount of memory allocated for each event tracing session buffer, in kilobytes. - // The buffer size affects the rate at which buffers fill and must be flushed (small buffer size requires - // less memory, but it increases the rate at which buffers must be flushed). - BufferSize uint32 `json:"buffer-size" yaml:"buffer-size"` - // MinBuffers determines the minimum number of buffers allocated for the event tracing session's buffer pool. - MinBuffers uint32 `json:"min-buffers" yaml:"min-buffers"` - // MaxBuffers is the maximum number of buffers allocated for the event tracing session's buffer pool. - MaxBuffers uint32 `json:"max-buffers" yaml:"max-buffers"` - // FlushTimer specifies how often the trace buffers are forcibly flushed. - FlushTimer time.Duration `json:"flush-interval" yaml:"flush-interval"` +// BaseEventSourceConfig contains platform-neutral event source configuration. +type BaseEventSourceConfig struct { + EventFilter // ExcludedEvents are kernel event names that will be dropped from the kernel event stream. ExcludedEvents []string `json:"blacklist.events" yaml:"blacklist.events"` - // ExcludedImages are process image names that will be rejected if they generate a kernel event. - ExcludedImages []string `json:"blacklist.images" yaml:"blacklist.images"` - - dropBitmap bitmap.Bitmap[event.Type] - - excludedImages map[string]bool + // ExcludedProcesses are process image names that will be rejected if they generate a kernel event. + ExcludedProcesses []string `json:"blacklist.images" yaml:"blacklist.images"` } -func (c *EventSourceConfig) initFromViper(v *viper.Viper) { - c.EnableThreadEvents = v.GetBool(enableThreadEvents) - c.EnableRegistryEvents = v.GetBool(enableRegistryEvents) - c.EnableNetEvents = v.GetBool(enableNetEvents) - c.EnableFileIOEvents = v.GetBool(enableFileIOEvents) - c.EnableVAMapEvents = v.GetBool(enableVAMapEvents) - c.EnableModuleEvents = v.GetBool(enableModuleEvents) - c.EnableMemEvents = v.GetBool(enableMemEvents) - c.EnableAuditAPIEvents = v.GetBool(enableAuditAPIEvents) - c.EnableDNSEvents = v.GetBool(enableDNSEvents) - c.StackEnrichment = v.GetBool(stackEnrichment) - c.BufferSize = uint32(v.GetInt(bufferSize)) - c.MinBuffers = uint32(v.GetInt(minBuffers)) - c.MaxBuffers = uint32(v.GetInt(maxBuffers)) - c.FlushTimer = v.GetDuration(flushInterval) - c.ExcludedEvents = v.GetStringSlice(excludedEvents) - c.ExcludedImages = v.GetStringSlice(excludedImages) - - c.excludedImages = make(map[string]bool) +// Init initializes event and process exclusion rules. +func (c *BaseEventSourceConfig) Init() { + c.Processes = make(map[string]bool) for _, name := range c.ExcludedEvents { if typ, ok := event.ParseType(name); ok { - c.dropBitmap.Set(typ) + c.Types.Set(typ) } } - for _, name := range c.ExcludedImages { - c.excludedImages[name] = true - } -} - -// Init is an exported method to allow initializing exclusion maps from external modules. -func (c *EventSourceConfig) Init() { - c.excludedImages = make(map[string]bool) - - for _, name := range c.ExcludedEvents { - if typ, ok := event.ParseType(name); ok { - c.dropBitmap.Set(typ) -======= -type eventSourceConfig struct { - dropMasks *bitmask.Bitmask - allMasks *bitmask.Bitmask - excludedImages map[string]bool -} - -func (c *EventSourceConfig) initEventMasks(types []event.Type) { - c.dropMasks = bitmask.New() - c.allMasks = bitmask.New() - c.excludedImages = make(map[string]bool) - - for _, name := range c.ExcludedEvents { - for _, typ := range event.NameToTypes(name) { - if typ != event.UnknownType { - c.dropMasks.Set(typ.ID()) - } ->>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) - } - } - for _, typ := range types { - c.allMasks.Set(typ.ID()) - } - for _, name := range c.ExcludedImages { - c.excludedImages[name] = true + for _, name := range c.ExcludedProcesses { + c.Processes[name] = true } } -// Init initializes event and image exclusion maps. -func (c *EventSourceConfig) Init() { - c.initEventMasks(platformEventTypes()) -} - +// SetDropMask inserts the event mask in the bitset to +// instruct the given event type should be dropped from +// the event stream. func (c *EventSourceConfig) SetDropMask(typ event.Type) { -<<<<<<< HEAD - c.dropBitmap.Set(typ) -======= - if c.dropMasks == nil { - c.dropMasks = bitmask.New() - } - c.dropMasks.Set(typ.ID()) ->>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) + c.Types.Set(typ) } +// TestDropMask checks if the specified event type has +// the drop mask in the bitset. func (c *EventSourceConfig) TestDropMask(typ event.Type) bool { -<<<<<<< HEAD - return c.dropBitmap.Has(typ) + return c.Types.Has(typ) } // ExcludeEvent determines whether the event type is declared // in the exclusion list. func (c *EventSourceConfig) ExcludeEvent(typ event.Type) bool { - return c.dropBitmap.Has(typ) -======= - return c.dropMasks != nil && c.dropMasks.IsSet(typ.ID()) -} - -func (c *EventSourceConfig) ExcludeEvent(id uint) bool { - return c.dropMasks != nil && c.dropMasks.IsSet(id) -} - -func (c *EventSourceConfig) EventExists(id uint) bool { - return c.allMasks != nil && c.allMasks.IsSet(id) ->>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) + return c.Types.Has(typ) } -func (c *EventSourceConfig) ExcludeImage(ps *pstypes.PS) bool { - return ps != nil && c.excludedImages[ps.Name] +// ExcludeProcess determines whether the event is excluded by the +// originating process name. +func (c *EventSourceConfig) ExcludeProcess(ps *pstypes.PS) bool { + return ps != nil && c.Processes[ps.Name] } diff --git a/pkg/config/eventsource_linux.go b/pkg/config/eventsource_linux.go index 77d02f209..3eb6adbdc 100644 --- a/pkg/config/eventsource_linux.go +++ b/pkg/config/eventsource_linux.go @@ -21,7 +21,6 @@ package config import ( - "github.com/rabbitstack/fibratus/pkg/event" "github.com/spf13/pflag" "github.com/spf13/viper" ) @@ -30,18 +29,15 @@ const ( enableFileIOEvents = "eventsource.enable-fileio" enableNetEvents = "eventsource.enable-net" enableMemEvents = "eventsource.enable-mem" - excludedEvents = "eventsource.blacklist.events" - excludedImages = "eventsource.blacklist.images" ) -type EventSourceConfig struct { - eventSourceConfig +// EventSourceConfig stores different configuration options for fine-tuning the event source. - ExcludedEvents []string `json:"blacklist.events" yaml:"blacklist.events"` - ExcludedImages []string `json:"blacklist.images" yaml:"blacklist.images"` - EnableFileIOEvents bool `json:"enable-fileio" yaml:"enable-fileio"` - EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` - EnableMemEvents bool `json:"enable-mem" yaml:"enable-mem"` +type EventSourceConfig struct { + BaseEventSourceConfig + EnableFileIOEvents bool `json:"enable-fileio" yaml:"enable-fileio"` + EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` + EnableMemEvents bool `json:"enable-mem" yaml:"enable-mem"` } func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { @@ -49,7 +45,7 @@ func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { flags.Bool(enableNetEvents, true, "Determines whether network events are collected") flags.Bool(enableMemEvents, true, "Determines whether memory events are collected") flags.StringSlice(excludedEvents, nil, "A list of event names to drop") - flags.StringSlice(excludedImages, nil, "A list of image names to drop") + flags.StringSlice(excludedProcesses, nil, "A list of image names to drop") } func (c *EventSourceConfig) initFromViper(v *viper.Viper) { @@ -57,8 +53,6 @@ func (c *EventSourceConfig) initFromViper(v *viper.Viper) { c.EnableNetEvents = v.GetBool(enableNetEvents) c.EnableMemEvents = v.GetBool(enableMemEvents) c.ExcludedEvents = v.GetStringSlice(excludedEvents) - c.ExcludedImages = v.GetStringSlice(excludedImages) + c.ExcludedProcesses = v.GetStringSlice(excludedProcesses) c.Init() } - -func platformEventTypes() []event.Type { return event.All() } diff --git a/pkg/config/eventsource_linux_test.go b/pkg/config/eventsource_linux_test.go index 555e6d0bd..1de2d0691 100644 --- a/pkg/config/eventsource_linux_test.go +++ b/pkg/config/eventsource_linux_test.go @@ -30,7 +30,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestEventSourceConfigLinux(t *testing.T) { +func TestEventSourceConfig(t *testing.T) { c := NewWithOpts(WithRun()) require.NoError(t, c.flags.Parse([]string{ "--eventsource.enable-fileio=false", @@ -41,14 +41,11 @@ func TestEventSourceConfigLinux(t *testing.T) { require.NoError(t, c.Init()) require.False(t, c.EventSource.EnableFileIOEvents) - require.True(t, c.EventSource.ExcludeEvent(event.Execve.ID())) - require.True(t, c.EventSource.ExcludeImage(&pstypes.PS{Name: "systemd"})) - for _, typ := range event.All() { - require.True(t, c.EventSource.EventExists(typ.ID())) - } + require.True(t, c.EventSource.ExcludeEvent(event.Execve)) + require.True(t, c.EventSource.ExcludeProcess(&pstypes.PS{Name: "systemd"})) } -func TestValidateLinuxEventSource(t *testing.T) { +func TestValidateEventSource(t *testing.T) { file := filepath.Join(t.TempDir(), "fibratus.yml") require.NoError(t, os.WriteFile(file, []byte(`eventsource: enable-fileio: true diff --git a/pkg/config/eventsource_test.go b/pkg/config/eventsource_test.go index 815fb8ff9..512979593 100644 --- a/pkg/config/eventsource_test.go +++ b/pkg/config/eventsource_test.go @@ -58,6 +58,6 @@ func TestEventSourceConfig(t *testing.T) { assert.False(t, c.EventSource.ExcludeEvent(event.CreateProcess)) - assert.True(t, c.EventSource.ExcludeImage(&pstypes.PS{Name: "svchost.exe"})) - assert.False(t, c.EventSource.ExcludeImage(&pstypes.PS{Name: "explorer.exe"})) + assert.True(t, c.EventSource.ExcludeProcess(&pstypes.PS{Name: "svchost.exe"})) + assert.False(t, c.EventSource.ExcludeProcess(&pstypes.PS{Name: "explorer.exe"})) } diff --git a/pkg/config/eventsource_windows.go b/pkg/config/eventsource_windows.go index 499724bdd..d8f9bc8e9 100644 --- a/pkg/config/eventsource_windows.go +++ b/pkg/config/eventsource_windows.go @@ -24,31 +24,27 @@ import ( "runtime" "time" - "github.com/rabbitstack/fibratus/pkg/event" "github.com/spf13/pflag" "github.com/spf13/viper" ) const ( - enableThreadEvents = "eventsource.enable-thread" - enableRegistryEvents = "eventsource.enable-registry" - enableNetEvents = "eventsource.enable-net" - enableFileIOEvents = "eventsource.enable-fileio" - enableVAMapEvents = "eventsource.enable-vamap" - enableModuleEvents = "eventsource.enable-module" - enableHandleEvents = "eventsource.enable-handle" - enableMemEvents = "eventsource.enable-mem" - enableAuditAPIEvents = "eventsource.enable-audit-api" - enableDNSEvents = "eventsource.enable-dns" - enableThreadpoolEvents = "eventsource.enable-threadpool" - stackEnrichment = "eventsource.stack-enrichment" - bufferSize = "eventsource.buffer-size" - minBuffers = "eventsource.min-buffers" - maxBuffers = "eventsource.max-buffers" - flushInterval = "eventsource.flush-interval" - excludedEvents = "eventsource.blacklist.events" - excludedImages = "eventsource.blacklist.images" - maxBufferSize = uint32(512) + enableThreadEvents = "eventsource.enable-thread" + enableRegistryEvents = "eventsource.enable-registry" + enableNetEvents = "eventsource.enable-net" + enableFileIOEvents = "eventsource.enable-fileio" + enableVAMapEvents = "eventsource.enable-vamap" + enableModuleEvents = "eventsource.enable-module" + enableMemEvents = "eventsource.enable-mem" + enableAuditAPIEvents = "eventsource.enable-audit-api" + enableDNSEvents = "eventsource.enable-dns" + stackEnrichment = "eventsource.stack-enrichment" + bufferSize = "eventsource.buffer-size" + minBuffers = "eventsource.min-buffers" + maxBuffers = "eventsource.max-buffers" + flushInterval = "eventsource.flush-interval" + + maxBufferSize = uint32(512) ) var ( @@ -57,27 +53,39 @@ var ( defaultFlushInterval = time.Second ) +// EventSourceConfig stores different configuration options for fine-tuning the event source. type EventSourceConfig struct { - eventSourceConfig - - ExcludedEvents []string `json:"blacklist.events" yaml:"blacklist.events"` - ExcludedImages []string `json:"blacklist.images" yaml:"blacklist.images"` - EnableThreadEvents bool `json:"enable-thread" yaml:"enable-thread"` - EnableRegistryEvents bool `json:"enable-registry" yaml:"enable-registry"` - EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` - EnableFileIOEvents bool `json:"enable-fileio" yaml:"enable-fileio"` - EnableVAMapEvents bool `json:"enable-vamap" yaml:"enable-vamap"` - EnableModuleEvents bool `json:"enable-image" yaml:"enable-module"` - EnableHandleEvents bool `json:"enable-handle" yaml:"enable-handle"` - EnableMemEvents bool `json:"enable-memory" yaml:"enable-memory"` - EnableAuditAPIEvents bool `json:"enable-audit-api" yaml:"enable-audit-api"` - EnableDNSEvents bool `json:"enable-dns" yaml:"enable-dns"` - EnableThreadpoolEvents bool `json:"enable-threadpool" yaml:"enable-threadpool"` - StackEnrichment bool `json:"stack-enrichment" yaml:"stack-enrichment"` - BufferSize uint32 `json:"buffer-size" yaml:"buffer-size"` - MinBuffers uint32 `json:"min-buffers" yaml:"min-buffers"` - MaxBuffers uint32 `json:"max-buffers" yaml:"max-buffers"` - FlushTimer time.Duration `json:"flush-interval" yaml:"flush-interval"` + BaseEventSourceConfig + // EnableThreadEvents indicates if thread events are collected by the ETW provider. + EnableThreadEvents bool `json:"enable-thread" yaml:"enable-thread"` + // EnableRegistryEvents indicates if registry events are collected by the ETW provider. + EnableRegistryEvents bool `json:"enable-registry" yaml:"enable-registry"` + // EnableNetEvents determines whether network (TCP/UDP) events are collected by the ETW provider. + EnableNetEvents bool `json:"enable-net" yaml:"enable-net"` + // EnableFileIOEvents indicates if file I/O events are collected by the ETW provider. + EnableFileIOEvents bool `json:"enable-fileio" yaml:"enable-fileio"` + // EnableVAMapEvents indicates if VA map/unmap events are collected by the ETW provider. + EnableVAMapEvents bool `json:"enable-vamap" yaml:"enable-vamap"` + // EnableModuleEvents indicates if module events are collected by the ETW provider. + EnableModuleEvents bool `json:"enable-image" yaml:"enable-module"` + // EnableMemEvents indicates whether memory manager events are enabled. + EnableMemEvents bool `json:"enable-memory" yaml:"enable-memory"` + // EnableAuditAPIEvents indicates if kernel audit API calls events are enabled + EnableAuditAPIEvents bool `json:"enable-audit-api" yaml:"enable-audit-api"` + // EnableDNSEvents indicates if DNS client events are enabled + EnableDNSEvents bool `json:"enable-dns" yaml:"enable-dns"` + // StackEnrichment indicates if stack enrichment is enabled for eligible events. + StackEnrichment bool `json:"stack-enrichment" yaml:"stack-enrichment"` + // BufferSize represents the amount of memory allocated for each event tracing session buffer, in kilobytes. + // The buffer size affects the rate at which buffers fill and must be flushed (small buffer size requires + // less memory, but it increases the rate at which buffers must be flushed). + BufferSize uint32 `json:"buffer-size" yaml:"buffer-size"` + // MinBuffers determines the minimum number of buffers allocated for the event tracing session's buffer pool. + MinBuffers uint32 `json:"min-buffers" yaml:"min-buffers"` + // MaxBuffers is the maximum number of buffers allocated for the event tracing session's buffer pool. + MaxBuffers uint32 `json:"max-buffers" yaml:"max-buffers"` + // FlushTimer specifies how often the trace buffers are forcibly flushed. + FlushTimer time.Duration `json:"flush-interval" yaml:"flush-interval"` } func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { @@ -87,18 +95,16 @@ func (c *EventSourceConfig) AddFlags(flags *pflag.FlagSet) { flags.Bool(enableFileIOEvents, true, "Determines whether file I/O events are collected") flags.Bool(enableVAMapEvents, true, "Determines whether VA map/unmap events are collected") flags.Bool(enableModuleEvents, true, "Determines whether module events are collected") - flags.Bool(enableHandleEvents, false, "Determines whether handle events are collected") flags.Bool(enableMemEvents, true, "Determines whether memory events are collected") flags.Bool(enableAuditAPIEvents, true, "Determines whether audit API events are collected") flags.Bool(enableDNSEvents, true, "Determines whether DNS events are collected") - flags.Bool(enableThreadpoolEvents, true, "Determines whether thread pool events are collected") flags.Bool(stackEnrichment, true, "Indicates if stack enrichment is enabled") flags.Int(bufferSize, int(maxBufferSize), "Represents the trace buffer size in kilobytes") flags.Int(minBuffers, int(defaultMinBuffers), "Determines the minimum trace buffer count") flags.Int(maxBuffers, int(defaultMaxBuffers), "Determines the maximum trace buffer count") flags.Duration(flushInterval, defaultFlushInterval, "Specifies how often trace buffers are flushed") flags.StringSlice(excludedEvents, nil, "A list of event names to drop") - flags.StringSlice(excludedImages, nil, "A list of image names to drop") + flags.StringSlice(excludedProcesses, nil, "A list of image names to drop") } func (c *EventSourceConfig) initFromViper(v *viper.Viper) { @@ -108,19 +114,15 @@ func (c *EventSourceConfig) initFromViper(v *viper.Viper) { c.EnableFileIOEvents = v.GetBool(enableFileIOEvents) c.EnableVAMapEvents = v.GetBool(enableVAMapEvents) c.EnableModuleEvents = v.GetBool(enableModuleEvents) - c.EnableHandleEvents = v.GetBool(enableHandleEvents) c.EnableMemEvents = v.GetBool(enableMemEvents) c.EnableAuditAPIEvents = v.GetBool(enableAuditAPIEvents) c.EnableDNSEvents = v.GetBool(enableDNSEvents) - c.EnableThreadpoolEvents = v.GetBool(enableThreadpoolEvents) c.StackEnrichment = v.GetBool(stackEnrichment) c.BufferSize = uint32(v.GetInt(bufferSize)) c.MinBuffers = uint32(v.GetInt(minBuffers)) c.MaxBuffers = uint32(v.GetInt(maxBuffers)) c.FlushTimer = v.GetDuration(flushInterval) c.ExcludedEvents = v.GetStringSlice(excludedEvents) - c.ExcludedImages = v.GetStringSlice(excludedImages) + c.ExcludedProcesses = v.GetStringSlice(excludedProcesses) c.Init() } - -func platformEventTypes() []event.Type { return event.AllWithState() } diff --git a/pkg/config/filters.go b/pkg/config/filters.go index e728d4d65..6bf4a81b3 100644 --- a/pkg/config/filters.go +++ b/pkg/config/filters.go @@ -34,6 +34,7 @@ import ( "github.com/Masterminds/sprig/v3" "github.com/rabbitstack/fibratus/pkg/event" "github.com/rabbitstack/fibratus/pkg/util/convert" + "github.com/rabbitstack/fibratus/pkg/util/mapdecoder" "github.com/rabbitstack/fibratus/pkg/util/multierror" log "github.com/sirupsen/logrus" "github.com/spf13/viper" @@ -79,7 +80,7 @@ func (f FilterConfig) DecodeActions() ([]any, error) { actions := make([]any, 0, len(f.Action)) dec := func(m map[string]any, o any) error { - err := decode(m, &o) + err := mapdecoder.Decode(m, &o) if err != nil { return err } @@ -170,8 +171,8 @@ type ActionContext struct { // UniquePids returns a set of process identifiers // from each matched event to be used in actions // such as the process kill action. -func (ctx *ActionContext) UniquePids() []event.PID { - pids := make(map[event.PID]struct{}) +func (ctx *ActionContext) UniquePids() []uint32 { + pids := make(map[uint32]struct{}) for _, e := range ctx.Events { if e.IsCreateProcess() { pids[e.Params.MustGetPid()] = struct{}{} diff --git a/pkg/config/output.go b/pkg/config/output.go index af45c34d7..83901cc27 100644 --- a/pkg/config/output.go +++ b/pkg/config/output.go @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2019-2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -22,7 +22,7 @@ import ( "errors" "fmt" "reflect" - "strconv" + "strings" "github.com/rabbitstack/fibratus/pkg/outputs" "github.com/rabbitstack/fibratus/pkg/outputs/amqp" @@ -30,116 +30,78 @@ import ( "github.com/rabbitstack/fibratus/pkg/outputs/elasticsearch" "github.com/rabbitstack/fibratus/pkg/outputs/http" "github.com/rabbitstack/fibratus/pkg/outputs/null" - log "github.com/sirupsen/logrus" ) -var errNoOutputSection = errors.New("no output section in config") +var ErrNoOutputSection = errors.New("no output section in config") -var errOutputConfig = func(output string, err error) error { return fmt.Errorf("%s output invalid config: %v", output, err) } +var ErrOutputConfig = func(output outputs.Type, err error) error { + return fmt.Errorf("%s output invalid config: %v", output, err) +} + +var outs = outputs.ConfigLoaders{} -func (c *Config) tryLoadOutput() error { +func init() { + outs.Register(outputs.Console, outputs.LoadFromConfig[console.Config](outputs.Console)) + outs.Register(outputs.AMQP, outputs.LoadFromConfig[amqp.Config](outputs.AMQP)) + outs.Register(outputs.Elasticsearch, outputs.LoadFromConfig[elasticsearch.Config](outputs.Elasticsearch)) + outs.Register(outputs.HTTP, outputs.LoadFromConfig[http.Config](outputs.HTTP)) +} + +// TryLoadOutput attempts the locate an active output config and load it. +func (c *BaseConfig) TryLoadOutput() error { output := c.viper.AllSettings()["output"] if output == nil { - return errNoOutputSection + return ErrNoOutputSection } - mapping, ok := output.(map[string]interface{}) + + mapping, ok := output.(map[string]any) if !ok { return fmt.Errorf("expected map[string]interface{} type for output but found %s", reflect.TypeOf(output)) } - humNum := func(n int) string { - switch n { - case 2: - return "two" - case 3: - return "three" - case 4: - return "four" - case 5: - return "five" - case 6: - return "six" - case 7: - return "seven" - default: - return strconv.Itoa(n) - } - } - // don't permit if there are various outputs enabled at a time - activeOutputs := findActiveOutputs(mapping) - if len(activeOutputs) > 1 { - return fmt.Errorf("expected one but found %s active outputs: %s", humNum(len(activeOutputs)), activeOutputs) - } - - for typ, config := range mapping { - switch outputs.TypeFromString(typ) { - case outputs.Console: - var consoleConfig console.Config - if err := decode(config, &consoleConfig); err != nil { - return errOutputConfig(typ, err) - } - if !consoleConfig.Enabled { - continue - } - c.Output.Type, c.Output.Output = outputs.Console, consoleConfig - case outputs.AMQP: - var amqpConfig amqp.Config - if err := decode(config, &amqpConfig); err != nil { - return errOutputConfig(typ, err) - } - if !amqpConfig.Enabled { - continue - } - c.Output.Type, c.Output.Output = outputs.AMQP, amqpConfig - case outputs.Elasticsearch: - var esConfig elasticsearch.Config - if err := decode(config, &esConfig); err != nil { - return errOutputConfig(typ, err) - } - if !esConfig.Enabled { - continue - } - c.Output.Type, c.Output.Output = outputs.Elasticsearch, esConfig - case outputs.HTTP: - var httpConfig http.Config - if err := decode(config, &httpConfig); err != nil { - return errOutputConfig(typ, err) - } - if !httpConfig.Enabled { - continue - } - c.Output.Type, c.Output.Output = outputs.HTTP, httpConfig -<<<<<<< HEAD -======= - - default: - if err := c.loadPlatformOutput(outputs.TypeFromString(typ), typ, config); err != nil { - return err - } ->>>>>>> ce1f8af (refactor(config): share platform-neutral configuration) - } + active, err := findActiveOutput(mapping) + if err != nil { + return err } - if c.adjustPlatformOutput() { - return nil - } - - // default to null output - if c.Output.Output == nil { - log.Warn("all outputs disabled. Defaulting to null output") + switch active { + case "": c.Output.Type, c.Output.Output = outputs.Null, &null.Config{} + default: + typ := outputs.TypeFromString(active) + loader, ok := outs[typ] + if !ok { + return fmt.Errorf("unknown output type %q", typ) + } + c.Output, err = loader(mapping[active]) + if err != nil { + return ErrOutputConfig(typ, err) + } } - return nil } -func findActiveOutputs(outputs map[string]interface{}) []string { - outputTypes := make([]string, 0) - for typ, rawConfig := range outputs { - enabled, ok := rawConfig.(map[string]interface{})["enabled"].(bool) - if ok && enabled { - outputTypes = append(outputTypes, typ) +// findActiveOutput returns an error if there are various outputs enabled +// at a time or either returns the active output name or an empty string if +// no outputs are enabled. +func findActiveOutput(mapping map[string]interface{}) (string, error) { + active := make([]string, 0, len(mapping)) + for typ, raw := range mapping { + output, ok := raw.(map[string]any) + if !ok { + continue } + if enabled, _ := output["enabled"].(bool); enabled { + active = append(active, typ) + } + } + switch { + case len(active) > 1: + return "", fmt.Errorf("expected one but found %d active outputs: %s", len(active), strings.Join(active, ", ")) + case len(active) == 0: + return "", nil + case len(active) == 1: + return active[0], nil } - return outputTypes + return "", nil } diff --git a/pkg/config/output_linux.go b/pkg/config/output_linux.go deleted file mode 100644 index 85cd3833b..000000000 --- a/pkg/config/output_linux.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package config - -import "github.com/rabbitstack/fibratus/pkg/outputs" - -func (c *Config) loadPlatformOutput(_ outputs.Type, _ string, _ interface{}) error { return nil } -func (c *Config) adjustPlatformOutput() bool { return false } diff --git a/pkg/config/output_linux_test.go b/pkg/config/output_linux_test.go deleted file mode 100644 index a6055c2d3..000000000 --- a/pkg/config/output_linux_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package config - -import ( - "testing" - - "github.com/rabbitstack/fibratus/pkg/outputs/null" - "github.com/stretchr/testify/require" -) - -func TestEventlogOutputDefaultsToNull(t *testing.T) { - c := NewWithOpts(WithRun()) - require.NoError(t, c.flags.Parse([]string{"--config-file=_fixtures/eventlog-output.yml"})) - require.NoError(t, c.viper.BindPFlags(c.flags)) - require.NoError(t, c.TryLoadFile(c.GetConfigFile())) - require.NoError(t, c.Init()) - - require.IsType(t, &null.Config{}, c.Output.Output) -} diff --git a/pkg/config/output_windows.go b/pkg/config/output_windows.go deleted file mode 100644 index 1e2a8b850..000000000 --- a/pkg/config/output_windows.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build windows - -/* - * Copyright 2019-2020 by Nedim Sabic Sabic - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package config - -import ( - "github.com/rabbitstack/fibratus/pkg/outputs" - "github.com/rabbitstack/fibratus/pkg/outputs/eventlog" - "github.com/rabbitstack/fibratus/pkg/outputs/null" - log "github.com/sirupsen/logrus" - "golang.org/x/sys/windows/svc" -) - -func (c *Config) loadPlatformOutput(output outputs.Type, typ string, config interface{}) error { - if output != outputs.Eventlog { - return nil - } - var eventlogConfig eventlog.Config - if err := decode(config, &eventlogConfig); err != nil { - return errOutputConfig(typ, err) - } - if eventlogConfig.Enabled { - c.Output.Type, c.Output.Output = outputs.Eventlog, eventlogConfig - } - return nil -} - -func (c *Config) adjustPlatformOutput() bool { - if !isWindowsService() || c.Output.Type != outputs.Console || c.Output.Output == nil { - return false - } - log.Warn("running in non-interactive session with console output. " + - "Please configure a different output type. Defaulting to null output") - c.Output.Type, c.Output.Output = outputs.Null, &null.Config{} - return true -} - -func isWindowsService() bool { - isWinService, err := svc.IsWindowsService() - return err == nil && isWinService -} diff --git a/pkg/config/output_windows_test.go b/pkg/config/output_windows_test.go deleted file mode 100644 index c6ab53816..000000000 --- a/pkg/config/output_windows_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build windows - -/* - * Copyright 2019-2020 by Nedim Sabic Sabic - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package config - -import ( - "testing" - - "github.com/rabbitstack/fibratus/pkg/outputs/eventlog" - "github.com/stretchr/testify/require" -) - -func TestEventlogOutput(t *testing.T) { - c := NewWithOpts(WithRun()) - require.NoError(t, c.flags.Parse([]string{"--config-file=_fixtures/eventlog-output.yml"})) - require.NoError(t, c.viper.BindPFlags(c.flags)) - require.NoError(t, c.TryLoadFile(c.GetConfigFile())) - require.NoError(t, c.Init()) - - require.IsType(t, eventlog.Config{}, c.Output.Output) - eventlogConfig := c.Output.Output.(eventlog.Config) - require.True(t, eventlogConfig.Enabled) - require.Equal(t, "INFO", eventlogConfig.Level) -} diff --git a/pkg/config/print.go b/pkg/config/print.go index 2f29c62b5..3db586699 100644 --- a/pkg/config/print.go +++ b/pkg/config/print.go @@ -26,7 +26,7 @@ import ( "strings" ) -func (c *Config) printArray(arr []interface{}) string { +func (c *BaseConfig) printArray(arr []interface{}) string { var buffer bytes.Buffer for v := range arr { fmt.Fprintf(&buffer, "%v;", v) @@ -34,7 +34,7 @@ func (c *Config) printArray(arr []interface{}) string { return buffer.String() } -func (c *Config) printMap(m map[string]interface{}) string { +func (c *BaseConfig) printMap(m map[string]interface{}) string { var buffer bytes.Buffer buffer.WriteString("[") for k, v := range m { @@ -54,7 +54,7 @@ func (c *Config) printMap(m map[string]interface{}) string { return buffer.String() } -func (c *Config) print(value interface{}) string { +func (c *BaseConfig) print(value interface{}) string { t := reflect.TypeOf(value) switch t.Kind() { case reflect.Array: @@ -66,7 +66,7 @@ func (c *Config) print(value interface{}) string { } } -func (c *Config) printLine(buffer *bytes.Buffer, maxLength int, key string, value string) { +func (c *BaseConfig) printLine(buffer *bytes.Buffer, maxLength int, key string, value string) { if value != "" { buffer.WriteString("\n\t") buffer.WriteString(key) @@ -78,7 +78,7 @@ func (c *Config) printLine(buffer *bytes.Buffer, maxLength int, key string, valu } // Print returns the string with all the config options pretty-printed. -func (c *Config) Print() string { +func (c *BaseConfig) Print() string { opts := c.viper.AllSettings() var buffer bytes.Buffer diff --git a/pkg/config/schema.go b/pkg/config/schema.go index 19e95a811..117f8e2f0 100644 --- a/pkg/config/schema.go +++ b/pkg/config/schema.go @@ -20,11 +20,8 @@ package config import _ "embed" -//go:embed config.schema.json -var configSchema string - -//go:embed rules.schema.json +//go:embed schemas/rules.schema.json var rulesSchema string -//go:embed macros.schema.json +//go:embed schemas/macros.schema.json var macrosSchema string diff --git a/pkg/event/bitset_linux.go b/pkg/config/schema_linux.go similarity index 81% rename from pkg/event/bitset_linux.go rename to pkg/config/schema_linux.go index f78bc4079..8e9bd7c19 100644 --- a/pkg/event/bitset_linux.go +++ b/pkg/config/schema_linux.go @@ -1,7 +1,5 @@ -//go:build linux - /* - * Copyright 2026 by Mostafa Moradian + * Copyright 2019-2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -18,6 +16,9 @@ * limitations under the License. */ -package event +package config + +import _ "embed" -func typeBitIndex(typ Type) uint { return typ.ID() } +//go:embed schemas/config.schema.linux.json +var configSchema string diff --git a/pkg/event/bitset_windows.go b/pkg/config/schema_windows.go similarity index 80% rename from pkg/event/bitset_windows.go rename to pkg/config/schema_windows.go index 0a07df44c..8afb09b43 100644 --- a/pkg/event/bitset_windows.go +++ b/pkg/config/schema_windows.go @@ -1,5 +1,5 @@ /* - * Copyright 2026 by Mostafa Moradian + * Copyright 2019-2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -16,6 +16,9 @@ * limitations under the License. */ -package event +package config -func typeBitIndex(typ Type) uint { return uint(typ.HookID()) } +import _ "embed" + +//go:embed schemas/config.schema.windows.json +var configSchema string diff --git a/pkg/config/schemas/config.schema.linux.json b/pkg/config/schemas/config.schema.linux.json new file mode 100644 index 000000000..bf474b82d --- /dev/null +++ b/pkg/config/schemas/config.schema.linux.json @@ -0,0 +1,859 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "yara": { + "$id": "#yara", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + } + }, + "type": "object", + "properties": { + "aggregator": { + "type": "object", + "properties": { + "flush-period": { + "type": "string", + "minLength": 2, + "pattern": "[0-9]+ms|s" + }, + "flush-timeout": { + "type": "string", + "minLength": 2, + "pattern": "[0-9]+s" + } + }, + "additionalProperties": false + }, + "alertsenders": { + "type": "object", + "anyOf": [ + { + "properties": { + "mail": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "host": { + "type": "string" + }, + "port": { + "type": "number" + }, + "user": { + "type": "string" + }, + "password": { + "type": "string" + }, + "from": { + "type": "string" + }, + "to": { + "type": "array", + "items": { + "type": "string", + "format": "email" + } + }, + "content-type": { + "type": "string" + }, + "use-template": { + "type": "boolean" + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "properties": { + "from": { + "type": "string", + "format": "email" + }, + "to": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "format": "email" + } + } + } + }, + "additionalProperties": false + }, + "slack": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "workspace": { + "type": "string" + }, + "channel": { + "type": "string" + }, + "emoji": { + "type": "string" + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "properties": { + "url": { + "type": "string", + "format": "uri", + "minLength": 1, + "pattern": "^(https?|http?)://" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "api": { + "type": "object", + "properties": { + "transport": { + "type": "string", + "minLength": 3 + }, + "timeout": { + "type": "string", + "minLength": 2, + "pattern": "[0-9]+s" + } + }, + "additionalProperties": false + }, + "config-file": { + "type": "string" + }, + "forward": { + "type": "boolean" + }, + "cap": { + "type": "object", + "properties": { + "file": { + "type": "string" + } + }, + "additionalProperties": false + }, + "filament": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "flush-period": { + "type": "string", + "minLength": 2, + "pattern": "[0-9]+ms|s" + } + }, + "additionalProperties": false + }, + "filters": { + "type": "object", + "properties": { + "match-all": { + "type": "boolean" + }, + "rules": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "from-paths": { + "type": [ + "array", + "null" + ], + "items": [ + { + "type": "string", + "minLength": 4 + } + ] + }, + "from-urls": { + "type": [ + "array", + "null" + ], + "items": [ + { + "type": "string", + "minLength": 8 + } + ] + } + }, + "additionalProperties": false + }, + "macros": { + "type": "object", + "properties": { + "from-paths": { + "type": [ + "array", + "null" + ], + "items": [ + { + "type": "string", + "minLength": 4 + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "event": { + "type": "object", + "properties": { + "serialize-threads": { + "type": "boolean" + }, + "serialize-envs": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "eventsource": { + "type": "object", + "properties": { + "enable-thread": { + "type": "boolean" + }, + "enable-fileio": { + "type": "boolean" + }, + "enable-net": { + "type": "boolean" + }, + "enable-mem": { + "type": "boolean" + }, + "blacklist": { + "type": "object", + "properties": { + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "execve", + "exit", + "clone", + "openat", + "unlink", + "rename", + "connect", + "accept", + "mmap", + "process_vm_read", + "process_vm_write", + "kill", + "ptrace", + "prctl" + ] + } + }, + "images": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "logging": { + "type": "object", + "properties": { + "level": { + "type": "string" + }, + "max-age": { + "type": "integer" + }, + "max-backups": { + "type": "integer", + "minimum": 1 + }, + "max-size": { + "type": "integer", + "minimum": 1 + }, + "formatter": { + "type": "string", + "enum": [ + "json", + "text" + ] + }, + "path": { + "type": "string" + }, + "log-stdout": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "output": { + "type": "object", + "anyOf": [ + { + "properties": { + "console": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "colorize": { + "type": "boolean" + }, + "format": { + "type": "string", + "enum": [ + "json", + "pretty" + ] + }, + "template": { + "type": "string" + }, + "kv-delimiter": { + "type": "string" + } + }, + "additionalProperties": false + }, + "elasticsearch": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "servers": { + "type": "array", + "items": [ + { + "type": "string", + "minItems": 1, + "format": "uri", + "minLength": 1, + "maxLength": 255, + "pattern": "^(https?|http?)://" + } + ] + }, + "timeout": { + "type": "string" + }, + "index-name": { + "type": "string", + "minLength": 1 + }, + "template-config": { + "type": "string" + }, + "template-name": { + "type": "string", + "minLength": 1 + }, + "healthcheck": { + "type": "boolean" + }, + "bulk-workers": { + "type": "integer", + "minimum": 1 + }, + "sniff": { + "type": "boolean" + }, + "trace-log": { + "type": "boolean" + }, + "gzip-compression": { + "type": "boolean" + }, + "healthcheck-interval": { + "type": "string", + "minLength": 2, + "pattern": "[0-9]+s|m}" + }, + "healthcheck-timeout": { + "type": "string", + "minLength": 2, + "pattern": "[0-9]+s|m}" + }, + "flush-period": { + "type": "string", + "minLength": 2, + "pattern": "[0-9]+s|m}" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "tls-key": { + "type": "string" + }, + "tls-cert": { + "type": "string" + }, + "tls-ca": { + "type": "string" + }, + "tls-insecure-skip-verify": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "amqp": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "url": { + "type": "string", + "format": "uri", + "minLength": 1, + "maxLength": 255, + "pattern": "^(amqps?|amqp?)://" + }, + "timeout": { + "type": "string", + "minLength": 2, + "pattern": "[0-9]+s|m}" + }, + "exchange": { + "type": "string", + "minLength": 1 + }, + "exchange-type": { + "type": "string", + "enum": [ + "direct", + "topic", + "fanout", + "header", + "x-consistent-hash" + ] + }, + "routing-key": { + "type": "string", + "minLength": 1 + }, + "delivery-mode": { + "type": "string", + "enum": [ + "transient", + "persistent" + ] + }, + "vhost": { + "type": "string", + "minLength": 1 + }, + "passive": { + "type": "boolean" + }, + "durable": { + "type": "boolean" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "tls-key": { + "type": "string" + }, + "tls-cert": { + "type": "string" + }, + "tls-ca": { + "type": "string" + }, + "tls-insecure-skip-verify": { + "type": "boolean" + }, + "headers": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false + }, + "http": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "endpoints": { + "type": "array", + "items": [ + { + "type": "string", + "minItems": 1, + "format": "uri", + "minLength": 1, + "maxLength": 255, + "pattern": "^(https?|http?)://" + } + ] + }, + "timeout": { + "type": "string", + "minLength": 2, + "pattern": "[0-9]+s|m}" + }, + "method": { + "type": "string", + "enum": [ + "POST", + "PUT" + ] + }, + "serializer": { + "type": "string", + "enum": [ + "json" + ] + }, + "enable-gzip": { + "type": "boolean" + }, + "proxy-url": { + "type": "string" + }, + "proxy-username": { + "type": "string" + }, + "proxy-password": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "tls-key": { + "type": "string" + }, + "tls-cert": { + "type": "string" + }, + "tls-ca": { + "type": "string" + }, + "tls-insecure-skip-verify": { + "type": "boolean" + }, + "headers": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "transformers": { + "type": "object", + "anyOf": [ + { + "properties": { + "remove": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "params": { + "type": "array", + "items": [ + { + "type": "string" + } + ] + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "properties": { + "params": { + "type": "array", + "minItems": 1, + "items": [ + { + "type": "string" + } + ] + } + } + }, + "additionalProperties": false + }, + "rename": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "params": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "old": { + "type": "string", + "minLength": 1 + }, + "new": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false + } + ] + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "properties": { + "params": { + "minItems": 1 + } + } + }, + "additionalProperties": false + }, + "replace": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "replacements": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "param": { + "type": "string", + "minLength": 1 + }, + "old": { + "type": "string", + "minLength": 1 + }, + "new": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "properties": { + "replacements": { + "minItems": 1 + } + } + }, + "additionalProperties": false + }, + "tags": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "tags": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "key": { + "type": "string", + "minLength": 1 + }, + "value": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false + } + ] + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "properties": { + "tags": { + "minItems": 1 + } + } + }, + "additionalProperties": false + }, + "trim": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "prefixes": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "param": { + "type": "string", + "minLength": 1 + }, + "trim": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false + } + ] + }, + "suffixes": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "param": { + "type": "string", + "minLength": 1 + }, + "trim": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false + } + ] + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "properties": { + "suffixes": { + "minItems": 1 + }, + "prefixes": { + "minItems": 1 + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/pkg/config/config.schema.json b/pkg/config/schemas/config.schema.windows.json similarity index 99% rename from pkg/config/config.schema.json rename to pkg/config/schemas/config.schema.windows.json index 863d99fb1..9db99916b 100644 --- a/pkg/config/config.schema.json +++ b/pkg/config/schemas/config.schema.windows.json @@ -389,9 +389,6 @@ "items": { "type": "string", "enum": [ - "execve", - "exit", - "clone", "CreateThread", "TerminateThread", "OpenProcess", diff --git a/pkg/config/macros.schema.json b/pkg/config/schemas/macros.schema.json similarity index 100% rename from pkg/config/macros.schema.json rename to pkg/config/schemas/macros.schema.json diff --git a/pkg/config/rules.schema.json b/pkg/config/schemas/rules.schema.json similarity index 100% rename from pkg/config/rules.schema.json rename to pkg/config/schemas/rules.schema.json diff --git a/pkg/config/transformer.go b/pkg/config/transformer.go index 96b214b1d..0cef4ca38 100644 --- a/pkg/config/transformer.go +++ b/pkg/config/transformer.go @@ -30,92 +30,43 @@ import ( "github.com/rabbitstack/fibratus/pkg/aggregator/transformers/trim" ) -var errTransformerConfig = func(t string, err error) error { return fmt.Errorf("%s transformer invalid config: %v", t, err) } +var ErrTransformerConfig = func(t string, err error) error { return fmt.Errorf("%s transformer invalid config: %v", t, err) } -func (c *Config) tryLoadTransformers() error { +var trans = transformers.ConfigLoaders{} + +func init() { + trans.Register(transformers.Remove, transformers.LoadFromConfig(transformers.Remove, func(c remove.Config) bool { return c.Enabled })) + trans.Register(transformers.Rename, transformers.LoadFromConfig(transformers.Rename, func(c rename.Config) bool { return c.Enabled })) + trans.Register(transformers.Replace, transformers.LoadFromConfig(transformers.Replace, func(c replace.Config) bool { return c.Enabled })) + trans.Register(transformers.Trim, transformers.LoadFromConfig(transformers.Trim, func(c trim.Config) bool { return c.Enabled })) + trans.Register(transformers.Tags, transformers.LoadFromConfig(transformers.Tags, func(c tags.Config) bool { return c.Enabled })) +} + +// TryLoadTransformers attempts to load all registered transformer configs. +func (c *BaseConfig) TryLoadTransformers() error { transforms := c.viper.AllSettings()["transformers"] if transforms == nil { return nil } - mapping, ok := transforms.(map[string]interface{}) + mapping, ok := transforms.(map[string]any) if !ok { return fmt.Errorf("expected map[string]interface{} type for transformers but found %s", reflect.TypeOf(transforms)) } - configs := make([]transformers.Config, 0) - - for typ, config := range mapping { - switch typ { - case "remove": - var removeConfig remove.Config - if err := decode(config, &removeConfig); err != nil { - return errTransformerConfig(typ, err) - } - if !removeConfig.Enabled { - continue - } - config := transformers.Config{ - Type: transformers.Remove, - Transformer: removeConfig, - } - configs = append(configs, config) - - case "rename": - var renameConfig rename.Config - if err := decode(config, &renameConfig); err != nil { - return errTransformerConfig(typ, err) - } - if !renameConfig.Enabled { - continue - } - config := transformers.Config{ - Type: transformers.Rename, - Transformer: renameConfig, - } - configs = append(configs, config) - - case "replace": - var replaceConfig replace.Config - if err := decode(config, &replaceConfig); err != nil { - return errTransformerConfig(typ, err) - } - if !replaceConfig.Enabled { - continue - } - config := transformers.Config{ - Type: transformers.Replace, - Transformer: replaceConfig, - } - configs = append(configs, config) - - case "trim": - var trimConfig trim.Config - if err := decode(config, &trimConfig); err != nil { - return errTransformerConfig(typ, err) - } - if !trimConfig.Enabled { - continue - } - config := transformers.Config{ - Type: transformers.Trim, - Transformer: trimConfig, - } - configs = append(configs, config) - - case "tags": - var tagsConfig tags.Config - if err := decode(config, &tagsConfig); err != nil { - return errTransformerConfig(typ, err) - } - if !tagsConfig.Enabled { - continue - } - config := transformers.Config{ - Type: transformers.Tags, - Transformer: tagsConfig, - } - configs = append(configs, config) + configs := make([]transformers.Config, 0, len(mapping)) + for typ, raw := range mapping { + loader, ok := trans[transformers.TypeFromString(typ)] + if !ok { + return fmt.Errorf("unknown transformer type %q", typ) + } + cfg, enabled, err := loader(raw) + if err != nil { + return ErrTransformerConfig(typ, err) + } + if !enabled { + continue } + configs = append(configs, cfg) } c.Transformers = configs diff --git a/pkg/event/batch_linux_test.go b/pkg/event/batch_linux_test.go index 23f2766dc..84a9d609c 100644 --- a/pkg/event/batch_linux_test.go +++ b/pkg/event/batch_linux_test.go @@ -27,7 +27,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestLinuxBatchMarshalJSON(t *testing.T) { +func TestBatchMarshalJSON(t *testing.T) { batch := NewBatch(&Event{PID: 42, Type: Execve}, &Event{PID: 43, Type: Exit}) require.EqualValues(t, 2, batch.Len()) diff --git a/pkg/event/event.go b/pkg/event/event.go index 5d0856aa8..6d334caca 100644 --- a/pkg/event/event.go +++ b/pkg/event/event.go @@ -74,9 +74,9 @@ type Event struct { // Timestamp represents the temporal occurrence of the event. Timestamp time.Time `json:"timestamp"` // PID is the identifier of the process that generated the event. - PID PID `json:"pid"` + PID uint32 `json:"pid"` // Tid is the thread identifier of the thread that generated the event. - Tid TID `json:"tid"` + Tid uint32 `json:"tid"` // Evasions is the bitmask that stores detected evasion types on this event. Evasions uint32 `json:"-"` // Type is the internal representation of the event. This field should be diff --git a/pkg/event/event_linux.go b/pkg/event/event_linux.go index a2113821e..275dbe9c3 100644 --- a/pkg/event/event_linux.go +++ b/pkg/event/event_linux.go @@ -24,18 +24,17 @@ import ( "os" "github.com/rabbitstack/fibratus/pkg/event/params" + "golang.org/x/sys/unix" ) -const cloneThread = uint64(0x00010000) - // IsCreateProcess reports whether clone creates a new process. func (e *Event) IsCreateProcess() bool { - return e.Type == Clone && e.Params.TryGetUint64(params.CloneFlags)&cloneThread == 0 + return e.Type == Clone && e.Params.TryGetUint64(params.CloneFlags)&unix.CLONE_THREAD == 0 } // IsCreateThread reports whether clone creates a thread in the current process. func (e *Event) IsCreateThread() bool { - return e.Type == Clone && e.Params.TryGetUint64(params.CloneFlags)&cloneThread != 0 + return e.Type == Clone && e.Params.TryGetUint64(params.CloneFlags)&unix.CLONE_THREAD != 0 } // IsTerminateProcess reports whether the event exits a process. @@ -49,7 +48,7 @@ func (e *Event) PartialKey() uint64 { // DropCurrentProc determines if events generated by the Fibratus process are dropped. var DropCurrentProc = true -var currentPid = uint64(os.Getpid()) +var currentPid = uint32(os.Getpid()) // IsDropped reports whether the event should be omitted from the output queue. func (e *Event) IsDropped(_ bool) bool { diff --git a/pkg/event/event_linux_test.go b/pkg/event/event_linux_test.go index 0a3efa597..4dc19e716 100644 --- a/pkg/event/event_linux_test.go +++ b/pkg/event/event_linux_test.go @@ -26,9 +26,10 @@ import ( "github.com/rabbitstack/fibratus/pkg/event/params" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "golang.org/x/sys/unix" ) -func TestLinuxParamBasics(t *testing.T) { +func TestParamBasics(t *testing.T) { p := NewParam(params.ProcessID, params.PID, uint64(42)) require.NotNil(t, p) assert.Equal(t, "42", p.String()) @@ -38,12 +39,11 @@ func TestLinuxParamBasics(t *testing.T) { assert.Equal(t, "bash", pars.MustGetString(params.ProcessName)) } -func TestLinuxEventTypeHelpers(t *testing.T) { +func TestEventTypeHelpers(t *testing.T) { e := &Event{Type: Execve, PID: 1} assert.False(t, e.IsCreateProcess()) - assert.Equal(t, RawSyscallTracepoint, e.Type.Source()) - assert.Equal(t, Process, e.Type.Category()) - assert.Equal(t, uint(Execve), e.Type.ID()) + assert.Equal(t, Process, e.Category()) + assert.Equal(t, Execve, e.Type) processClone := &Event{Type: Clone, Params: Params{}} processClone.Params.Append(params.CloneFlags, params.Uint64, uint64(0)) @@ -51,7 +51,7 @@ func TestLinuxEventTypeHelpers(t *testing.T) { assert.False(t, processClone.IsCreateThread()) threadClone := &Event{Type: Clone, Params: Params{}} - threadClone.Params.Append(params.CloneFlags, params.Uint64, cloneThread) + threadClone.Params.Append(params.CloneFlags, params.Uint64, unix.CLONE_THREAD) assert.False(t, threadClone.IsCreateProcess()) assert.True(t, threadClone.IsCreateThread()) } diff --git a/pkg/event/flags.go b/pkg/event/flags.go index cf5a6878c..8a77a812e 100644 --- a/pkg/event/flags.go +++ b/pkg/event/flags.go @@ -35,17 +35,22 @@ type ParamFlags []ParamFlag // String returns the names of all flags in the bitmask, separated by pipes. func (flags ParamFlags) String(value uint64) string { - var ( - names strings.Builder - separator string - ) + if value == 0 { + return "" + } + + var b strings.Builder + b.Grow(64) // rough estimate + for _, flag := range flags { if flag.eval(value) { - names.WriteString(separator) - names.WriteString(flag.Name) - separator = "|" + if b.Len() > 0 { + b.WriteByte('|') + } + b.WriteString(flag.Name) value &= ^flag.Value } } - return names.String() + + return b.String() } diff --git a/pkg/event/formatter.go b/pkg/event/formatter.go index 3e596bdb7..0b057fc2f 100644 --- a/pkg/event/formatter.go +++ b/pkg/event/formatter.go @@ -68,9 +68,11 @@ const ( var ( // tmplRegexp defines the regular expression for parsing template fields. tmplRegexp = regexp.MustCompile(`({{2}.*?}{2})`) + // tmplNormRegepx defines the regular expression for normalizing the template. This basically consists in removing // the brackets and trailing/leading spaces from the field name. tmplNormRegexp = regexp.MustCompile(`({{2}\s*([A-Za-z.]+)\s*}{2})`) + // tmplExpandParamsRegexp determines whether Params. fields are expanded tmplExpandParamsRegexp = regexp.MustCompile(`{{\s*.Params.\S+}}`) ) @@ -87,7 +89,6 @@ var fields = map[string]bool{ exe: true, cmd: true, tid: true, - sid: true, proc: true, cat: true, desc: true, @@ -96,7 +97,6 @@ var fields = map[string]bool{ parameters: true, meta: true, host: true, - pe: true, cstack: true, } @@ -109,13 +109,14 @@ func hintFields() string { return strings.Join(s, " ") } -// Formatter deals with producing event's output that is dictated by the template. +// Formatter contains the core functionality substituting template tags +// with the corresponding values from the map and returning the result. type Formatter struct { t *fasttemplate.Template expandParamsDot bool } -// NewFormatter builds a new instance of event's formatter. +// NewFormatter builds a new instance of the event formatter. func NewFormatter(template string) (*Formatter, error) { // check basic template format and ensure all fields // defined in the template are known to us @@ -143,8 +144,9 @@ func NewFormatter(template string) (*Formatter, error) { } } - // user might define the tag such as `{{ .Seq }}` or {{ .Seq}}`. We have to make sure - // inner spaces are removed before building the fast template instance + // user might define the tag such as `{{ .Seq }}` or {{ .Seq}}`. + // We have to make sure inner spaces are removed before building + // the fast template instance norm := normalizeTemplate(template) t, err := fasttemplate.NewTemplate(norm, startTag, endTag) if err != nil { @@ -157,12 +159,9 @@ func NewFormatter(template string) (*Formatter, error) { }, nil } -// Format applies the template on the provided event. -func (f *Formatter) Format(evt *Event) []byte { - if evt == nil { - return []byte{} - } - values := map[string]interface{}{ +// eventMap returns the map populated with canonical event fields. +func (f *Formatter) eventMap(evt *Event) map[string]any { + return map[string]any{ ts: evt.Timestamp.String(), pid: strconv.FormatUint(uint64(evt.PID), 10), tid: strconv.FormatUint(uint64(evt.Tid), 10), @@ -175,34 +174,6 @@ func (f *Formatter) Format(evt *Event) []byte { meta: evt.Metadata.String(), parameters: evt.Params.String(), } - - // add process metadata - ps := evt.PS - if ps != nil { - values[proc] = ps.Name - values[ppid] = strconv.FormatUint(uint64(ps.Ppid), 10) - values[cwd] = ps.Cwd - values[exe] = ps.Exe - values[cmd] = ps.Cmdline - values[sid] = ps.SID - parent := ps.Parent - if parent != nil { - values[pproc] = parent.Name - values[pexe] = parent.Exe - values[pcmd] = parent.Cmdline - } - addPlatformProcessFormatValues(ps, values) - } - - addPlatformFormatValues(evt, values) - - if f.expandParamsDot { - for _, par := range evt.Params { - values[".Params."+caser.String(par.Name)] = par.String() - } - } - - return f.t.ExecuteString(values) } // ColorFormatter wraps a Formatter and re-renders each template tag with @@ -251,86 +222,6 @@ func (f *ColorFormatter) Format(e *Event) []byte { return bytes.TrimRight(b.Bytes(), "\n") } -// colourTag maps a bare tag name to its coloured string representation. -func (f *ColorFormatter) colourTag(tag string, e *Event) string { - if value, ok := colourPlatformProcessTag(tag, e); ok { - return value - } - switch tag { - case seq: - // sequence number is ok to render as dim gray - return colorizer.SpanDim(colorizer.Span(colorizer.Gray, strconv.FormatUint(e.Seq, 10))) - case ts: - return f.colourTimestamp(e) - case cpu: - return colorizer.Span(colorizer.Yellow, strconv.FormatUint(uint64(e.CPU), 10)) - case proc: - // render process name with bold green as it is the most important - // identity anchor on the line. Analysts scan for it first. - ps := e.PS - if ps == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.SpanBold(colorizer.Green, ps.Name) - case pid: - return colorizer.Span(colorizer.Green, strconv.FormatUint(uint64(e.PID), 10)) - case ppid: - ps := e.PS - if ps == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.Span(colorizer.Green, strconv.FormatUint(uint64(ps.Ppid), 10)) - case tid: - return colorizer.Span(colorizer.Green, strconv.FormatUint(uint64(e.Tid), 10)) - case exe: - ps := e.PS - if ps == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.Span(colorizer.White, ps.Exe) - case pexe: - ps := e.PS - if ps == nil || ps.Parent == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.Span(colorizer.White, ps.Parent.Exe) - case cmd: - ps := e.PS - if ps == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.Span(colorizer.White, ps.Cmdline) - case pcmd: - ps := e.PS - if ps == nil || ps.Parent == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.Span(colorizer.White, ps.Parent.Cmdline) - case cwd: - ps := e.PS - if ps == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.Span(colorizer.White, ps.Cwd) - case pproc: - ps := e.PS - if ps == nil || ps.Parent == nil { - return colorizer.Span(colorizer.Gray, "N/A") - } - return colorizer.Span(colorizer.Green, ps.Parent.Name) - case typ: - return e.Type.color() - case cat: - return colorizer.Span(colorizer.Magenta, e.Category().String()) - case parameters: - return e.Params.Colorize() - case cstack: - return colourPlatformTag(tag, e) - } - - return "" -} - // colourTimestamp renders the timestamp tag with: // - date in blue, time in cyan, tz components dim gray // - a Δt suffix showing the gap from the previous event, colour-coded by diff --git a/pkg/event/formatter_linux.go b/pkg/event/formatter_linux.go index 8ac7533d0..8b4a587af 100644 --- a/pkg/event/formatter_linux.go +++ b/pkg/event/formatter_linux.go @@ -20,12 +20,119 @@ package event -import pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" +import ( + "fmt" + "strconv" -func addPlatformFormatValues(_ *Event, _ map[string]interface{}) {} + "github.com/rabbitstack/fibratus/pkg/util/colorizer" +) -func addPlatformProcessFormatValues(_ *pstypes.PS, _ map[string]interface{}) {} +// Format applies the template on the provided event. +func (f *Formatter) Format(evt *Event) []byte { + if evt == nil { + return []byte{} + } -func colourPlatformTag(_ string, _ *Event) string { return "" } + values := f.eventMap(evt) -func colourPlatformProcessTag(_ string, _ *Event) (string, bool) { return "", false } + ps := evt.PS + if ps != nil { + values[proc] = ps.Name + values[ppid] = strconv.FormatUint(uint64(ps.Ppid), 10) + values[cwd] = ps.Cwd + values[exe] = ps.Exe + values[cmd] = ps.Cmdline + parent := ps.Parent + + if parent != nil { + values[pproc] = parent.Name + values[pexe] = parent.Exe + values[pcmd] = parent.Cmdline + } + } + + if f.expandParamsDot { + for _, par := range evt.Params { + values[".Params."+caser.String(par.Name)] = par.String() + } + } + + return f.t.ExecuteString(values) +} + +// colourTag maps a bare tag name to its coloured string representation. +func (f *ColorFormatter) colourTag(tag string, e *Event) string { + switch tag { + case seq: + // sequence number is ok to render as dim gray + return colorizer.SpanDim(colorizer.Span(colorizer.Gray, strconv.FormatUint(e.Seq, 10))) + case ts: + return f.colourTimestamp(e) + case cpu: + return colorizer.Span(colorizer.Yellow, strconv.FormatUint(uint64(e.CPU), 10)) + case proc: + // render process name with bold green as it is the most important + // identity anchor on the line. Analysts scan for it first. + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.SpanBold(colorizer.Green, ps.Name) + case pid: + return colorizer.Span(colorizer.Green, strconv.FormatUint(uint64(e.PID), 10)) + case ppid: + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.Green, strconv.FormatUint(uint64(ps.Ppid), 10)) + case tid: + return colorizer.Span(colorizer.Green, strconv.FormatUint(uint64(e.Tid), 10)) + case exe: + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Exe) + case pexe: + ps := e.PS + if ps == nil || ps.Parent == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Parent.Exe) + case cmd: + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Cmdline) + case pcmd: + ps := e.PS + if ps == nil || ps.Parent == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Parent.Cmdline) + case cwd: + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Cwd) + case pproc: + ps := e.PS + if ps == nil || ps.Parent == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.Green, ps.Parent.Name) + case typ: + return e.Type.color() + case cat: + return colorizer.Span(colorizer.Magenta, e.Category().String()) + case parameters: + return e.Params.Colorize() + case cstack: + return fmt.Sprintf("\n%s", e.Callstack.Colorize()) + } + + return "" +} diff --git a/pkg/event/formatter_linux_test.go b/pkg/event/formatter_linux_test.go index 5c016fd83..2f534f9a6 100644 --- a/pkg/event/formatter_linux_test.go +++ b/pkg/event/formatter_linux_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestLinuxFormatter(t *testing.T) { +func TestFormatter(t *testing.T) { formatter, err := NewFormatter("{{.Type}} pid={{.Pid}} tid={{.Tid}}") require.NoError(t, err) @@ -37,8 +37,6 @@ func TestLinuxFormatter(t *testing.T) { PID: 42, Tid: 43, Type: Execve, - Name: Execve.String(), - Category: Process, } assert.Equal(t, "execve pid=42 tid=43", string(formatter.Format(event))) } diff --git a/pkg/event/formatter_windows.go b/pkg/event/formatter_windows.go index 2b6ad3017..30006a8e7 100644 --- a/pkg/event/formatter_windows.go +++ b/pkg/event/formatter_windows.go @@ -20,35 +20,141 @@ package event import ( "fmt" + "strconv" - pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" "github.com/rabbitstack/fibratus/pkg/util/colorizer" ) -func addPlatformProcessFormatValues(ps *pstypes.PS, values map[string]interface{}) { - values[sid] = ps.SID - if ps.PE != nil { - values[pe] = ps.PE.String() - } +func init() { + fields[sid] = true + fields[pe] = true } -func colourPlatformTag(_ string, evt *Event) string { - return fmt.Sprintf("\n%s", evt.Callstack.Colorize()) +// Format applies the template on the provided event. +func (f *Formatter) Format(evt *Event) []byte { + if evt == nil { + return []byte{} + } + + values := f.eventMap(evt) + + ps := evt.PS + if ps != nil { + values[proc] = ps.Name + values[ppid] = strconv.FormatUint(uint64(ps.Ppid), 10) + values[cwd] = ps.Cwd + values[exe] = ps.Exe + values[cmd] = ps.Cmdline + values[sid] = ps.SID + parent := ps.Parent + + if parent != nil { + values[pproc] = parent.Name + values[pexe] = parent.Exe + values[pcmd] = parent.Cmdline + } + + if ps.PE != nil { + values[pe] = ps.PE.String() + } + } + + if !evt.Callstack.IsEmpty() { + values[cstack] = evt.Callstack.String() + } + + if f.expandParamsDot { + for _, par := range evt.Params { + values[".Params."+caser.String(par.Name)] = par.String() + } + } + + return f.t.ExecuteString(values) } -func colourPlatformProcessTag(tag string, evt *Event) (string, bool) { +// colourTag maps a bare tag name to its coloured string representation. +func (f *ColorFormatter) colourTag(tag string, e *Event) string { switch tag { + case seq: + // sequence number is ok to render as dim gray + return colorizer.SpanDim(colorizer.Span(colorizer.Gray, strconv.FormatUint(e.Seq, 10))) + case ts: + return f.colourTimestamp(e) + case cpu: + return colorizer.Span(colorizer.Yellow, strconv.FormatUint(uint64(e.CPU), 10)) + case proc: + // render process name with bold green as it is the most important + // identity anchor on the line. Analysts scan for it first. + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.SpanBold(colorizer.Green, ps.Name) + case pid: + return colorizer.Span(colorizer.Green, strconv.FormatUint(uint64(e.PID), 10)) + case ppid: + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.Green, strconv.FormatUint(uint64(ps.Ppid), 10)) + case tid: + return colorizer.Span(colorizer.Green, strconv.FormatUint(uint64(e.Tid), 10)) + case exe: + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Exe) + case pexe: + ps := e.PS + if ps == nil || ps.Parent == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Parent.Exe) + case cmd: + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Cmdline) + case pcmd: + ps := e.PS + if ps == nil || ps.Parent == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Parent.Cmdline) + case cwd: + ps := e.PS + if ps == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.White, ps.Cwd) + case pproc: + ps := e.PS + if ps == nil || ps.Parent == nil { + return colorizer.Span(colorizer.Gray, "N/A") + } + return colorizer.Span(colorizer.Green, ps.Parent.Name) case sid: - if evt.PS == nil { - return colorizer.Span(colorizer.Gray, "N/A"), true + if e.PS == nil { + return colorizer.Span(colorizer.Gray, "N/A") } - return colorizer.Span(colorizer.Gray, evt.PS.SID), true + return colorizer.Span(colorizer.Gray, e.PS.SID) case pe: - if evt.PS == nil || evt.PS.PE == nil { - return colorizer.Span(colorizer.Gray, "N/A"), true + if e.PS == nil || e.PS.PE == nil { + return colorizer.Span(colorizer.Gray, "N/A") } - return colorizer.Span(colorizer.Magenta, evt.PS.PE.String()), true - default: - return "", false + return colorizer.Span(colorizer.Magenta, e.PS.PE.String()) + case typ: + return e.Type.color() + case cat: + return colorizer.Span(colorizer.Magenta, e.Category().String()) + case parameters: + return e.Params.Colorize() + case cstack: + return fmt.Sprintf("\n%s", e.Callstack.Colorize()) } + + return "" } diff --git a/pkg/event/marshaller.go b/pkg/event/marshaller.go index 973bc129c..01008265f 100644 --- a/pkg/event/marshaller.go +++ b/pkg/event/marshaller.go @@ -24,14 +24,6 @@ import ( "unicode/utf8" ) -type serializationConfig struct { - handles bool - threads bool - modules bool - envs bool - pe bool -} - type jsonStream struct { buf []byte } diff --git a/pkg/event/marshaller_linux.go b/pkg/event/marshaller_linux.go index a785ddda2..44853f526 100644 --- a/pkg/event/marshaller_linux.go +++ b/pkg/event/marshaller_linux.go @@ -30,14 +30,9 @@ import ( // SerializeEnvs indicates if environment variables are serialized with process state. var SerializeEnvs bool -func serializationOptions() serializationConfig { - return serializationConfig{envs: SerializeEnvs} -} - // MarshalJSON serializes the event to JSON. func (e *Event) MarshalJSON() []byte { - type plainEvent Event - b, err := json.Marshal((*plainEvent)(e)) + b, err := json.Marshal(e) if err != nil { return []byte("{}") } @@ -46,5 +41,5 @@ func (e *Event) MarshalJSON() []byte { // UnmarshalRaw recovers an event from a capture buffer. func (e *Event) UnmarshalRaw(_ []byte, _ capver.Version) error { - return fmt.Errorf("event capture unmarshalling is not implemented on Linux") + return fmt.Errorf("event capture is not implemented on Linux") } diff --git a/pkg/event/marshaller_linux_test.go b/pkg/event/marshaller_linux_test.go index 53e9b6c5c..a334b4133 100644 --- a/pkg/event/marshaller_linux_test.go +++ b/pkg/event/marshaller_linux_test.go @@ -28,8 +28,8 @@ import ( "github.com/stretchr/testify/require" ) -func TestLinuxMarshalJSON(t *testing.T) { - event := &Event{PID: 42, Tid: 43, Type: Execve, Name: Execve.String(), Category: Process} +func TestMarshalJSON(t *testing.T) { + event := &Event{PID: 42, Tid: 43, Type: Execve} var decoded map[string]interface{} require.NoError(t, json.Unmarshal(event.MarshalJSON(), &decoded)) assert.Equal(t, float64(42), decoded["pid"]) diff --git a/pkg/event/marshaller_windows.go b/pkg/event/marshaller_windows.go index 244d39095..1473e454b 100644 --- a/pkg/event/marshaller_windows.go +++ b/pkg/event/marshaller_windows.go @@ -51,16 +51,6 @@ var ( SerializeEnvs bool ) -func serializationOptions() serializationConfig { - return serializationConfig{ - handles: SerializeHandles, - threads: SerializeThreads, - modules: SerializeModules, - envs: SerializeEnvs, - pe: SerializePE, - } -} - // unmarshalTimestampErrors counts timestamp unmarshal errors var unmarshalTimestampErrors = expvar.NewInt("event.timestamp.unmarshal.errors") diff --git a/pkg/event/metainfo.go b/pkg/event/metainfo.go index 289196db4..8ab1384b5 100644 --- a/pkg/event/metainfo.go +++ b/pkg/event/metainfo.go @@ -18,37 +18,59 @@ package event -import ( - "cmp" - "slices" -) +import "slices" -// Info describes an event's human-readable name, category, and purpose. +// Flags represents the event flags +type Flags uint8 + +// Info describes the event meta info such as human-readable name, category and description. type Info struct { - Name string - Category Category + // Name is the human-readable representation of the event (e.g. CreateProcess, DeleteFile). + Name string + // Category designates the category to which event pertains. (e.g. process, network) + Category Category + // Subcategory designates the event subcategory if any. For example, the network category + // can be further subcategorized, such as DNS subcategory. + Subcategory Subcategory + // Source describes the event source origin for this event. For example, if it was captured + // from the NT Kernel Logger or eBPF raw syscall tracepoint. + Source Source + // Description is the short explanation that describes the purpose of the event. Description string + // Flags describes additional properties of the event. + Flags Flags } -// GetTypesMeta returns event type metadata without duplicate display names. -func GetTypesMeta() []Info { - infos := make([]Info, 0, len(events)) -outer: - for _, info := range events { - for _, existing := range infos { - if existing.Name == info.Name { - continue outer - } +// All returns all event types. +func AllTypes() []Type { + types := make([]Type, 0) + for i := range table { + if Type(i) == Unknown { + continue } - infos = append(infos, info) + types = append(types, Type(i)) } - slices.SortFunc(infos, func(a, b Info) int { - return cmp.Or(cmp.Compare(a.Category, b.Category), cmp.Compare(a.Name, b.Name)) + return types +} + +// GetTypeInfo returns metadata about the specified event type. +func GetTypeInfo(typ Type) Info { + return table[typ] +} + +// NameToType converts a human-readable event name to its internal type representation. +func ParseType(s string) (Type, bool) { + i := slices.IndexFunc(table[:], func(info Info) bool { + return info.Name == s }) - return infos + if i == -1 { + return Unknown, false + } + return Type(i), true } -// IsKnown reports whether the event name is registered. -func IsKnown(name string) bool { - return NameToType(name) != UnknownType +// IsKnown indicates if the event type is known given the event name. +func IsTypeKnown(s string) (exists bool) { + _, exists = ParseType(s) + return } diff --git a/pkg/event/metainfo_linux.go b/pkg/event/metainfo_linux.go index e00d08ee3..fee0bdfdb 100644 --- a/pkg/event/metainfo_linux.go +++ b/pkg/event/metainfo_linux.go @@ -2,6 +2,7 @@ /* * Copyright 2026 by Mostafa Moradian + * Copyright 2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -20,54 +21,35 @@ package event -import "slices" - -var events map[Type]Info -var types map[string]Type - -func init() { - all := All() - events = make(map[Type]Info, len(all)) - types = make(map[string]Type, len(all)) - for _, typ := range all { - events[typ] = Info{Name: typ.String(), Category: typ.Category(), Description: typ.Description()} - types[typ.String()] = typ - } -} - -// All returns all Linux event types. -func All() []Type { - return []Type{ - Execve, Exit, Clone, - Openat, Unlink, Rename, - Connect, Accept, - Mmap, ProcessVMRead, ProcessVMWrite, - Kill, Ptrace, Prctl, - } -} - -// MaxTypeID returns the largest Linux event type identifier. -func MaxTypeID() uint16 { - return uint16(slices.Max(All())) -} - -// TypeToEventInfo returns metadata for an event type. -func TypeToEventInfo(typ Type) Info { - if info, ok := events[typ]; ok { - return info - } - return Info{Name: "N/A", Category: Unknown} -} - -// NameToType converts an event name to its type. -func NameToType(name string) Type { - if typ, ok := types[name]; ok { - return typ - } - return UnknownType +import ( + "cmp" + "slices" +) + +var table = [MaxEvent]Info{ + Execve: {Name: "execve", Category: Process, Source: RawSyscallTracepoint, Description: "Executes a program"}, + Exit: {Name: "exit", Category: Process, Source: RawSyscallTracepoint, Description: "Exit all threads in a process"}, + Openat: {Name: "openat", Category: File, Source: RawSyscallTracepoint, Description: "Opens or creates a file"}, + Unlink: {Name: "unlink", Category: File, Source: RawSyscallTracepoint, Description: "Removes a directory entry"}, + Rename: {Name: "rename", Category: File, Source: RawSyscallTracepoint, Description: "Renames a file or directory"}, + Connect: {Name: "connect", Category: Network, Source: RawSyscallTracepoint, Description: "Initiates a socket connection"}, + Accept: {Name: "accept", Category: Network, Source: RawSyscallTracepoint, Description: "Accepts a socket connection"}, + Mmap: {Name: "mmap", Category: Memory, Source: RawSyscallTracepoint, Description: "Maps files or devices into memory"}, + ProcessVMRead: {Name: "process_vm_read", Category: Memory, Source: RawSyscallTracepoint, Description: "Reads memory from another process"}, + ProcessVMWrite: {Name: "process_vm_write", Category: Memory, Source: RawSyscallTracepoint, Description: "Writes memory into another process"}, + Kill: {Name: "kill", Category: Process, Source: RawSyscallTracepoint, Description: "Sends a signal to a process"}, + Ptrace: {Name: "ptrace", Category: Process, Source: RawSyscallTracepoint, Description: "Traces or controls another process"}, + Prctl: {Name: "prctl", Category: Process, Source: RawSyscallTracepoint, Description: "Performs a process-control operation"}, } -// NameToTypes converts an event name to its possible internal types. -func NameToTypes(name string) []Type { - return []Type{NameToType(name)} +// GetTypesInfo returns event types metadata. +func GetTypesInfo() []Info { + t := table[:] + t = slices.DeleteFunc(t, func(info Info) bool { + return info.Name == "" + }) + slices.SortFunc(t, func(a, b Info) int { + return cmp.Or(cmp.Compare(a.Category, b.Category), cmp.Compare(a.Name, b.Name)) + }) + return t } diff --git a/pkg/event/metainfo_windows.go b/pkg/event/metainfo_windows.go index 4817fbcd2..121bfdd0d 100644 --- a/pkg/event/metainfo_windows.go +++ b/pkg/event/metainfo_windows.go @@ -23,9 +23,6 @@ import ( "slices" ) -// Flags represents the event flags -type Flags uint8 - const ( // OnlyState indicates the event produces internal state // and is never published to the event stream. @@ -40,24 +37,6 @@ const ( WaitStack Flags = 1 << 3 ) -// Info describes the event meta info such as human-readable name, category and description. -type Info struct { - // Name is the human-readable representation of the event (e.g. CreateProcess, DeleteFile). - Name string - // Category designates the category to which event pertains. (e.g. process, network) - Category Category - // Subcategory designates the event subcategory if any. For example, the network category - // can be further subcategorized, such as DNS subcategory. - Subcategory Subcategory - // Source describes the event source origin for this event. For example, if it was captured - // from the NT Kernel Logger or a different event source. - Source Source - // Description is the short explanation that describes the purpose of the event. - Description string - // Flags describes additional properties of the event. - Flags Flags -} - var table = [MaxEvent]Info{ CreateProcess: {Name: "CreateProcess", Category: Process, Source: SystemLogger, Description: "Creates a new process and its primary thread", Flags: WaitStack}, TerminateProcess: {Name: "TerminateProcess", Category: Process, Source: SystemLogger, Description: "Terminates the process and all of its threads"}, @@ -122,23 +101,6 @@ var table = [MaxEvent]Info{ CreateSymbolicLinkObject: {Name: "CreateSymbolicLinkObject", Category: Object, Source: SecurityTelemetryLogger, Description: "Creates the symbolic link within the object manager directory"}, } -// All returns all event types. -func AllTypes() []Type { - types := make([]Type, 0) - for i := range table { - if Type(i) == Unknown { - continue - } - types = append(types, Type(i)) - } - return types -} - -// GetTypeInfo returns metadata about the specified event type. -func GetTypeInfo(typ Type) Info { - return table[typ] -} - // GetTypesInfo returns event types metadata excluding only-state events. func GetTypesInfo() []Info { t := table[:] @@ -150,20 +112,3 @@ func GetTypesInfo() []Info { }) return t } - -// NameToType converts a human-readable event name to its internal type representation. -func ParseType(s string) (Type, bool) { - i := slices.IndexFunc(table[:], func(info Info) bool { - return info.Name == s - }) - if i == -1 { - return Unknown, false - } - return Type(i), true -} - -// IsKnown indicates if the event type is known given the event name. -func IsTypeKnown(s string) (exists bool) { - _, exists = ParseType(s) - return -} diff --git a/pkg/event/param.go b/pkg/event/param.go index 344a2785a..11d0ea747 100644 --- a/pkg/event/param.go +++ b/pkg/event/param.go @@ -23,7 +23,6 @@ import ( "net" "reflect" "sort" - "strconv" "strings" "time" @@ -99,115 +98,12 @@ type Param struct { Enum ParamEnum `json:"enum"` } -// NewParam creates a parameter and normalizes its value for the current platform. -func NewParam(name string, typ params.Type, value params.Value, options ...ParamOption) *Param { - var opts paramOpts - for _, opt := range options { - opt(&opts) - } - return &Param{ - Name: name, - Type: typ, - Value: normalizeParamValue(typ, value), - Flags: opts.flags, - Enum: opts.enum, - } -} - -// String returns the string representation of the parameter value. -func (p Param) String() string { - if p.Value == nil { - return "" - } - if value, ok := formatPlatformParam(p); ok { - return value - } - switch p.Type { - case params.Path: - return fmt.Sprintf("%v", p.Value) - case params.Address: - v, ok := p.Value.(uint64) - if !ok { - return "" - } - return va.Address(v).String() - case params.Int8: - return strconv.Itoa(int(p.Value.(int8))) - case params.Uint8: - return strconv.Itoa(int(p.Value.(uint8))) - case params.Int16: - return strconv.Itoa(int(p.Value.(int16))) - case params.Uint16, params.Port: - return strconv.Itoa(int(p.Value.(uint16))) - case params.Uint32: - return strconv.FormatUint(uint64(p.Value.(uint32)), 10) - case params.PID, params.TID: - return formatPlatformID(p.Value) - case params.Int32: - return strconv.Itoa(int(p.Value.(int32))) - case params.Uint64: - return strconv.FormatUint(p.Value.(uint64), 10) - case params.Int64: - return strconv.FormatInt(p.Value.(int64), 10) - case params.IPv4, params.IPv6: - return p.Value.(net.IP).String() - case params.Bool: - return strconv.FormatBool(p.Value.(bool)) - case params.Float: - return strconv.FormatFloat(float64(p.Value.(float32)), 'f', 6, 32) - case params.Double: - return strconv.FormatFloat(p.Value.(float64), 'f', 6, 64) - case params.Time: - return p.Value.(time.Time).String() - case params.Enum: - if p.Enum == nil { - return "" - } - v, ok := p.Value.(uint32) - if !ok { - return "" - } - return p.Enum[v] - case params.Flags, params.Flags64: - if p.Flags == nil { - return "" - } - switch v := p.Value.(type) { - case uint32: - return p.Flags.String(uint64(v)) - case uint64: - return p.Flags.String(v) - default: - return "" - } - case params.Slice: - switch slice := p.Value.(type) { - case []string: - return strings.Join(slice, ",") - default: - return fmt.Sprintf("%v", slice) - } - case params.Binary: - return string(p.Value.([]byte)) - } - return fmt.Sprintf("%v", p.Value) -} - // IsNumber determines if the parameter stores the integer value type. func (p Param) IsNumber() bool { return p.Type == params.Int8 || p.Type == params.Int16 || p.Type == params.Int32 || p.Type == params.Int64 || p.Type == params.Uint8 || p.Type == params.Uint16 || p.Type == params.Uint32 || p.Type == params.Uint64 } -// CaptureType returns the event type saved inside the capture file. -// Captures usually override the type of the parameter to provide -// consistent replay experience. For example, the file path param -// type is converted to string param type, as drive mapping is performed -// on the target where the capture is being taken. -func (p Param) CaptureType() params.Type { - return captureParamType(p.Type) -} - // Params is the type that represents the sequence of event parameters type Params map[string]*Param @@ -718,7 +614,7 @@ func (pars Params) findParam(name string) (*Param, error) { // Colorize renders the full parameter list for the {{.Params}} tag. // Each entry is formatted as: key value, with the key in -// amber, the seperator dim, and the value semantically coloured. +// amber, the separator dim, and the value semantically coloured. func (pars Params) Colorize() string { if len(pars) == 0 { return "" @@ -745,42 +641,3 @@ func (pars Params) Colorize() string { return b.String() } - -// color applies a semantic colour to a single parameter value based -// on its type and for string types its content. -func (p *Param) color() string { - if color, ok := platformParamColor(p); ok { - return color - } - switch p.Type { - case params.Address: - return colorizer.SpanDim(colorizer.Span(colorizer.Gray, "0x"+p.String())) - - case params.Int8, params.Int16, params.Int32, params.Int64, - params.Uint8, params.Uint16, params.Uint32, params.Uint64, - params.Float, params.Double: - return colorizer.Span(colorizer.Yellow, p.String()) - - case params.Bool: - b, ok := p.Value.(bool) - if !ok { - return colorizer.Span(colorizer.Coral, p.String()) - } - if b { - return colorizer.Span(colorizer.Green, p.String()) - } - return colorizer.Span(colorizer.Coral, p.String()) - - case params.IPv4, params.IPv6: - return colorizer.Span(colorizer.Blue, p.String()) - - case params.Port: - return colorizer.Span(colorizer.Cyan, p.String()) - - case params.PID, params.TID: - return colorizer.Span(colorizer.Green, p.String()) - - default: - return colorizer.Span(colorizer.White, p.String()) - } -} diff --git a/pkg/event/param_linux.go b/pkg/event/param_linux.go index 761a72143..9cee4cad9 100644 --- a/pkg/event/param_linux.go +++ b/pkg/event/param_linux.go @@ -22,42 +22,139 @@ package event import ( "fmt" + "net" "strconv" + "strings" + "time" "github.com/rabbitstack/fibratus/pkg/event/params" "github.com/rabbitstack/fibratus/pkg/util/colorizer" + "github.com/rabbitstack/fibratus/pkg/util/va" ) -func normalizeParamValue(_ params.Type, value params.Value) params.Value { return value } +// NewParam creates a new event parameter. +func NewParam(name string, typ params.Type, value params.Value, options ...ParamOption) *Param { + var opts paramOpts + for _, opt := range options { + opt(&opts) + } + return &Param{Name: name, Type: typ, Value: value, Flags: opts.flags, Enum: opts.enum} +} -func formatPlatformParam(p Param) (string, bool) { - if p.Type != params.String { - return "", false +func (p *Param) String() string { + if p.Value == nil { + return "" } - value, ok := p.Value.(string) - if !ok { - return fmt.Sprintf("%v", p.Value), true + switch p.Type { + case params.String, params.Path: + return p.Value.(string) + case params.Address: + v, ok := p.Value.(uint64) + if !ok { + return "" + } + return va.Address(v).String() + case params.Int8: + return strconv.Itoa(int(p.Value.(int8))) + case params.Uint8: + return strconv.Itoa(int(p.Value.(uint8))) + case params.Int16: + return strconv.Itoa(int(p.Value.(int16))) + case params.Uint16, params.Port: + return strconv.Itoa(int(p.Value.(uint16))) + case params.Uint32: + return strconv.FormatUint(uint64(p.Value.(uint32)), 10) + case params.PID, params.TID: + return strconv.FormatUint(uint64(p.Value.(uint32)), 10) + case params.Int32: + return strconv.Itoa(int(p.Value.(int32))) + case params.Uint64: + return strconv.FormatUint(p.Value.(uint64), 10) + case params.Int64: + return strconv.FormatInt(p.Value.(int64), 10) + case params.IPv4, params.IPv6: + return p.Value.(net.IP).String() + case params.Bool: + return strconv.FormatBool(p.Value.(bool)) + case params.Float: + return strconv.FormatFloat(float64(p.Value.(float32)), 'f', 6, 32) + case params.Double: + return strconv.FormatFloat(p.Value.(float64), 'f', 6, 64) + case params.Time: + return p.Value.(time.Time).String() + case params.Enum: + if p.Enum == nil { + return "" + } + v, ok := p.Value.(uint32) + if !ok { + return "" + } + return p.Enum[v] + case params.Flags, params.Flags64: + if p.Flags == nil { + return "" + } + switch v := p.Value.(type) { + case uint32: + return p.Flags.String(uint64(v)) + case uint64: + return p.Flags.String(v) + default: + return "" + } + case params.Slice: + switch slice := p.Value.(type) { + case []string: + return strings.Join(slice, ",") + default: + return fmt.Sprintf("%v", slice) + } + case params.Binary: + return string(p.Value.([]byte)) + default: + return fmt.Sprintf("%v", p.Value) } - return value, true } -func formatPlatformID(value params.Value) string { - return strconv.FormatUint(value.(uint64), 10) +func (p Param) CaptureType() params.Type { + return p.Type } -func captureParamType(typ params.Type) params.Type { return typ } - -func platformParamColor(p *Param) (string, bool) { +// color applies a semantic colour to a single parameter value based +// on its type and for string types its content. +func (p *Param) color() string { switch p.Type { case params.String: - return colorizer.Span(colorizer.White, p.String()), true + return colorizer.Span(colorizer.White, p.String()) case params.Status: if p.String() == "0" { - return colorizer.Span(colorizer.Green, p.String()), true + return colorizer.Span(colorizer.Green, p.String()) + } + return colorizer.Span(colorizer.Red, p.String()) + case params.Address: + return colorizer.SpanDim(colorizer.Span(colorizer.Gray, "0x"+p.String())) + case params.Int8, params.Int16, params.Int32, params.Int64, + params.Uint8, params.Uint16, params.Uint32, params.Uint64, + params.Float, params.Double: + return colorizer.Span(colorizer.Yellow, p.String()) + case params.Bool: + b, ok := p.Value.(bool) + if !ok { + return colorizer.Span(colorizer.Coral, p.String()) + } + if b { + return colorizer.Span(colorizer.Green, p.String()) } - return colorizer.Span(colorizer.Red, p.String()), true + return colorizer.Span(colorizer.Coral, p.String()) + case params.IPv4, params.IPv6: + return colorizer.Span(colorizer.Blue, p.String()) + case params.Port: + return colorizer.Span(colorizer.Cyan, p.String()) + case params.PID, params.TID: + return colorizer.Span(colorizer.Green, p.String()) default: - return "", false + return colorizer.Span(colorizer.White, p.String()) } } @@ -67,12 +164,12 @@ func NewParamFromCapture(name string, typ params.Type, value params.Value, _ Typ } // GetPid returns the process identifier. -func (pars Params) GetPid() (uint64, error) { +func (pars Params) GetPid() (uint32, error) { return pars.getID(params.ProcessID, params.PID) } // MustGetPid returns the process identifier or panics. -func (pars Params) MustGetPid() uint64 { +func (pars Params) MustGetPid() uint32 { id, err := pars.GetPid() if err != nil { panic(err) @@ -81,12 +178,12 @@ func (pars Params) MustGetPid() uint64 { } // GetPpid returns the parent process identifier. -func (pars Params) GetPpid() (uint64, error) { +func (pars Params) GetPpid() (uint32, error) { return pars.getID(params.ProcessParentID, params.PID) } // MustGetPpid returns the parent process identifier or panics. -func (pars Params) MustGetPpid() uint64 { +func (pars Params) MustGetPpid() uint32 { id, err := pars.GetPpid() if err != nil { panic(err) @@ -95,12 +192,12 @@ func (pars Params) MustGetPpid() uint64 { } // GetTid returns the thread identifier. -func (pars Params) GetTid() (uint64, error) { +func (pars Params) GetTid() (uint32, error) { return pars.getID(params.ThreadID, params.TID) } // MustGetTid returns the thread identifier or panics. -func (pars Params) MustGetTid() uint64 { +func (pars Params) MustGetTid() uint32 { id, err := pars.GetTid() if err != nil { panic(err) @@ -108,7 +205,7 @@ func (pars Params) MustGetTid() uint64 { return id } -func (pars Params) getID(name string, typ params.Type) (uint64, error) { +func (pars Params) getID(name string, typ params.Type) (uint32, error) { param, err := pars.findParam(name) if err != nil { return 0, err @@ -116,9 +213,9 @@ func (pars Params) getID(name string, typ params.Type) (uint64, error) { if param.Type != typ { return 0, fmt.Errorf("%q parameter has unexpected identifier type", name) } - value, ok := param.Value.(uint64) + value, ok := param.Value.(uint32) if !ok { - return 0, fmt.Errorf("unable to type cast %q parameter to uint64 identifier", name) + return 0, fmt.Errorf("unable to type cast %q parameter to uint32 identifier", name) } return value, nil } diff --git a/pkg/event/param_windows.go b/pkg/event/param_windows.go index a5b8efde8..b5ee734f7 100644 --- a/pkg/event/param_windows.go +++ b/pkg/event/param_windows.go @@ -21,7 +21,10 @@ package event import ( "expvar" "fmt" + "net" "strconv" + "strings" + "time" "unsafe" "github.com/rabbitstack/fibratus/pkg/event/params" @@ -34,86 +37,149 @@ import ( "github.com/rabbitstack/fibratus/pkg/util/ip" "github.com/rabbitstack/fibratus/pkg/util/key" "github.com/rabbitstack/fibratus/pkg/util/ntstatus" + "github.com/rabbitstack/fibratus/pkg/util/va" "golang.org/x/sys/windows" ) var unknownKeysCount = expvar.NewInt("registry.unknown.keys.count") -func normalizeParamValue(typ params.Type, value params.Value) params.Value { +// NewParam creates a new event parameter. Since the parameter type is already categorized, +// we can coerce the value to the appropriate representation (e.g. hex, IP address) +func NewParam(name string, typ params.Type, value params.Value, options ...ParamOption) *Param { + var opts paramOpts + for _, opt := range options { + opt(&opts) + } + var v params.Value switch typ { case params.IPv4: - return ip.ToIPv4(value.(uint32)) + v = ip.ToIPv4(value.(uint32)) case params.IPv6: - return ip.ToIPv6(value.([]byte)) + v = ip.ToIPv6(value.([]byte)) case params.Port: - return windows.Ntohs(value.(uint16)) + v = windows.Ntohs(value.(uint16)) default: - return value + v = value } + return &Param{Name: name, Type: typ, Value: v, Flags: opts.flags, Enum: opts.enum} } -func formatPlatformParam(p Param) (string, bool) { +func (p Param) String() string { + if p.Value == nil { + return "" + } switch p.Type { case params.UnicodeString, params.AnsiString, params.Path: - return p.Value.(string), true + return p.Value.(string) case params.SID, params.WbemSID: sid, err := getSID(&p) if err != nil { - return "", true + return "" } if p.Name == params.ProcessTokenIntegrityLevel { - return sys.RidToString(sid), true + return sys.RidToString(sid) } - return sid.String(), true + return sid.String() case params.DOSPath: - return fs.GetDevMapper().Convert(p.Value.(string)), true + return fs.GetDevMapper().Convert(p.Value.(string)) case params.Key: rootKey, keyName := key.Format(p.Value.(string)) if keyName != "" && rootKey != key.Invalid { - return rootKey.String() + "\\" + keyName, true + return rootKey.String() + "\\" + keyName } if rootKey != key.Invalid { - return rootKey.String(), true + return rootKey.String() } unknownKeysCount.Add(1) - return keyName, true + return keyName case params.HandleType: - return htypes.ConvertTypeIDToName(p.Value.(uint16)), true + return htypes.ConvertTypeIDToName(p.Value.(uint16)) case params.Status: - value, ok := p.Value.(uint32) + v, ok := p.Value.(uint32) if !ok { - return "", true + return "" + } + return ntstatus.FormatMessage(v) + case params.Address: + v, ok := p.Value.(uint64) + if !ok { + return "" + } + return va.Address(v).String() + case params.Int8: + return strconv.Itoa(int(p.Value.(int8))) + case params.Uint8: + return strconv.Itoa(int(p.Value.(uint8))) + case params.Int16: + return strconv.Itoa(int(p.Value.(int16))) + case params.Uint16, params.Port: + return strconv.Itoa(int(p.Value.(uint16))) + case params.Uint32, params.PID, params.TID: + return strconv.Itoa(int(p.Value.(uint32))) + case params.Int32: + return strconv.Itoa(int(p.Value.(int32))) + case params.Uint64: + return strconv.FormatUint(p.Value.(uint64), 10) + case params.Int64: + return strconv.Itoa(int(p.Value.(int64))) + case params.IPv4, params.IPv6: + return p.Value.(net.IP).String() + case params.Bool: + return strconv.FormatBool(p.Value.(bool)) + case params.Float: + return strconv.FormatFloat(float64(p.Value.(float32)), 'f', 6, 32) + case params.Double: + return strconv.FormatFloat(p.Value.(float64), 'f', 6, 64) + case params.Time: + return p.Value.(time.Time).String() + case params.Enum: + if p.Enum == nil { + return "" + } + e := p.Value + v, ok := e.(uint32) + if !ok { + return "" + } + return p.Enum[v] + case params.Flags, params.Flags64: + if p.Flags == nil { + return "" + } + f := p.Value + switch v := f.(type) { + case uint32: + return p.Flags.String(uint64(v)) + case uint64: + return p.Flags.String(v) + default: + return "" } - return ntstatus.FormatMessage(value), true + case params.Slice: + switch slice := p.Value.(type) { + case []string: + return strings.Join(slice, ",") + default: + return fmt.Sprintf("%v", slice) + } + case params.Binary: + return string(p.Value.([]byte)) default: - return "", false + return fmt.Sprintf("%v", p.Value) } } -func formatPlatformID(value params.Value) string { - return strconv.FormatUint(uint64(value.(uint32)), 10) -} - -func captureParamType(typ params.Type) params.Type { - switch typ { +// CaptureType returns the event type saved inside the capture file. +// Captures usually override the type of the parameter to provide +// consistent replay experience. For example, the file path param +// type is converted to string param type, as drive mapping is performed +// on the target where the capture is being taken. +func (p Param) CaptureType() params.Type { + switch p.Type { case params.HandleType, params.DOSPath, params.Key: return params.UnicodeString default: - return typ - } -} - -func platformParamColor(p *Param) (string, bool) { - switch p.Type { - case params.UnicodeString, params.AnsiString, params.SID: - return colorizer.Span(colorizer.White, p.String()), true - case params.Status: - if p.String() == ntstatus.Success { - return colorizer.Span(colorizer.Green, p.String()), true - } - return colorizer.Span(colorizer.Red, p.String()), true - default: - return "", false + return p.Type } } @@ -298,3 +364,40 @@ func (e *Event) decodeParams(r *etw.EventRecord) { } } } + +// color applies a semantic colour to a single parameter value based +// on its type and for string types its content. +func (p *Param) color() string { + switch p.Type { + case params.UnicodeString, params.AnsiString, params.SID: + return colorizer.Span(colorizer.White, p.String()) + case params.Status: + if p.String() == ntstatus.Success { + return colorizer.Span(colorizer.Green, p.String()) + } + return colorizer.Span(colorizer.Red, p.String()) + case params.Address: + return colorizer.SpanDim(colorizer.Span(colorizer.Gray, "0x"+p.String())) + case params.Int8, params.Int16, params.Int32, params.Int64, + params.Uint8, params.Uint16, params.Uint32, params.Uint64, + params.Float, params.Double: + return colorizer.Span(colorizer.Yellow, p.String()) + case params.Bool: + b, ok := p.Value.(bool) + if !ok { + return colorizer.Span(colorizer.Coral, p.String()) + } + if b { + return colorizer.Span(colorizer.Green, p.String()) + } + return colorizer.Span(colorizer.Coral, p.String()) + case params.IPv4, params.IPv6: + return colorizer.Span(colorizer.Blue, p.String()) + case params.Port: + return colorizer.Span(colorizer.Cyan, p.String()) + case params.PID, params.TID: + return colorizer.Span(colorizer.Green, p.String()) + default: + return colorizer.Span(colorizer.White, p.String()) + } +} diff --git a/pkg/event/params/names.go b/pkg/event/params/names.go index 153a8d14f..054c7d4a8 100644 --- a/pkg/event/params/names.go +++ b/pkg/event/params/names.go @@ -147,9 +147,4 @@ const ( MemProtectMask = "protection_mask" // MemPageType identifies the parameter that represents the allocated region type. MemPageType = "page_type" - - // LinkSource identifies the parameter that represents the source symbolic link object or other kernel object - LinkSource = "source" - // LinkTarget identifies the parameter that represents the target symbolic link object or other kernel object - LinkTarget = "target" ) diff --git a/pkg/event/params/names_windows.go b/pkg/event/params/names_windows.go index a05e33f26..8a70e270d 100644 --- a/pkg/event/params/names_windows.go +++ b/pkg/event/params/names_windows.go @@ -115,46 +115,8 @@ const ( ModuleCertNotBefore = "cert_not_before" // ModuleCertNotAfter is the end of the module certificate validity period. ModuleCertNotAfter = "cert_not_after" - // HandleID identifies the handle. - HandleID = "handle_id" - // HandleSourceID identifies the source handle. - HandleSourceID = "handle_source_id" - // HandleObject identifies the kernel object backing the handle. - HandleObject = "handle_object" - // HandleObjectName is the handle object name. - HandleObjectName = "handle_name" - // HandleObjectTypeID is the handle object type identifier. - HandleObjectTypeID = "type_id" - // ThreadpoolPoolID identifies the thread pool. - ThreadpoolPoolID = "pool_id" - // ThreadpoolTaskID identifies the thread pool task. - ThreadpoolTaskID = "task_id" - // ThreadpoolCallback is the thread pool callback address. - ThreadpoolCallback = "callback" - // ThreadpoolCallbackSymbol is the thread pool callback symbol. - ThreadpoolCallbackSymbol = "callback_symbol" - // ThreadpoolCallbackModule is the module containing the callback. - ThreadpoolCallbackModule = "callback_module" - // ThreadpoolContext is the thread pool callback context. - ThreadpoolContext = "context" - // ThreadpoolContextRip is the instruction pointer in the callback context. - ThreadpoolContextRip = "context_rip" - // ThreadpoolContextRipSymbol is the symbol for the context instruction pointer. - ThreadpoolContextRipSymbol = "context_rip_symbol" - // ThreadpoolContextRipModule is the module containing the context instruction pointer. - ThreadpoolContextRipModule = "context_rip_module" - // ThreadpoolSubprocessTag is the thread pool subprocess tag. - ThreadpoolSubprocessTag = "subprocess_tag" - // ThreadpoolTimerDuetime is the timer due time. - ThreadpoolTimerDuetime = "duetime" - // ThreadpoolTimerSubqueue is the timer subqueue. - ThreadpoolTimerSubqueue = "subqueue" - // ThreadpoolTimer identifies the timer. - ThreadpoolTimer = "timer" - // ThreadpoolTimerPeriod is the timer period. - ThreadpoolTimerPeriod = "period" - // ThreadpoolTimerWindow is the timer window. - ThreadpoolTimerWindow = "window" - // ThreadpoolTimerAbsolute indicates whether the timer due time is absolute. - ThreadpoolTimerAbsolute = "absolute" + // LinkSource identifies the parameter that represents the source symbolic link object or other kernel object + LinkSource = "source" + // LinkTarget identifies the parameter that represents the target symbolic link object or other kernel object + LinkTarget = "target" ) diff --git a/pkg/event/params/param_types.go b/pkg/event/params/param_types.go index c62ee303e..55e546d64 100644 --- a/pkg/event/params/param_types.go +++ b/pkg/event/params/param_types.go @@ -81,40 +81,3 @@ const ( // Address is a memory address. Address Type = 36 ) - -// String returns the type name. -func (t Type) String() string { - if name := platformTypeString(t); name != "" { - return name - } - switch t { - case Int8: - return "int8" - case Uint8: - return "uint8" - case Int16: - return "int16" - case Uint16: - return "uint16" - case Int32: - return "int32" - case Uint32: - return "uint32" - case Int64: - return "int64" - case Uint64: - return "uint64" - case TID: - return "tid" - case PID: - return "pid" - case Port: - return "port" - case IPv6: - return "ipv6" - case IPv4: - return "ipv4" - default: - return "unknown" - } -} diff --git a/pkg/event/params/params_windows.go b/pkg/event/params/params_windows.go deleted file mode 100644 index edc02ca49..000000000 --- a/pkg/event/params/params_windows.go +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright 2019-2020 by Nedim Sabic Sabic - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package params - -const ( - // NTStatus is the parameter that identifies the NTSTATUS value. - NTStatus = "status" - - // ProcessID represents the process identifier. - ProcessID = "pid" - // TargetProcessID represents the target process identifier. - TargetProcessID = "target_pid" - // ProcessObject field represents the address of the process object in the kernel. - ProcessObject = "kproc" - // ThreadID field represents the thread identifier. - ThreadID = "tid" - // Callstack field represents the thread callstack. - Callstack = "callstack" - // CallstackTimestamp field identifvies the callstack timestamp parameter. - CallstackTimestamp = "callstack_timestamp" - // ProcessParentID field represents the parent process identifier. - ProcessParentID = "ppid" - // ProcessRealParentID field presents the real parent process identifier. - ProcessRealParentID = "real_ppid" - // SessionID fields represents the session identifier. - SessionID = "session_id" - // UserSID field is the security identifier associated to the process token under which it is run. - UserSID = "sid" - // Username field represents the username under which the event was generated. - Username = "username" - // Domain field represents the domain under which the event was generated. - Domain = "domain" - // ProcessName field denotes the process Module name. - ProcessName = "name" - // Exe field denotes the full path of the executable. - Exe = "exe" - // Cmdline field represents the process command line. - Cmdline = "cmdline" - // DTB field denotes the address of the process directory table. - DTB = "directory_table_base" - // ProcessFlags field denotes the process creation flags - ProcessFlags = "flags" - // ExitStatus is the field that represents the process exit status. - ExitStatus = "exit_status" - // StartTime field denotes the process start time. - StartTime = "start_time" - // ProcessTokenIntegrityLevel field denotes the process integrity level. - ProcessTokenIntegrityLevel = "token_integrity_level" - // ProcessTokenElevationType field designates the process token elevation type. - ProcessTokenElevationType = "token_elevation_type" - // ProcessTokenIsElevated field designates if the process token is elevated. - ProcessTokenIsElevated = "token_is_elevated" - - // DesiredAccess field denotes the access rights for different kernel objects such as processes or threads. - DesiredAccess = "desired_access" - - // BasePrio field is the thread base priority assigned by the scheduler. - BasePrio = "base_prio" - // IOPrio represents the filed that indicates the thread I/O priority. - IOPrio = "io_prio" - // PagePrio field denotes page priority. - PagePrio = "page_prio" - // KstackBase field is the start address of the kernel space stack. - KstackBase = "kstack" - // KstackLimit field is the end address of the kernel space stack. - KstackLimit = "kstack_limit" - // UstackBase field is the start address of the user space stack. - UstackBase = "ustack" - // UstackLimit field is the end address of the user space stack. - UstackLimit = "ustack_limit" - // StartAddress field is the thread start address. - StartAddress = "start_address" - // StartAddressSymbol field is the symbol associated with the thread start address. - StartAddressSymbol = "start_address_symbol" - // StartAddressModule field is the module where the thread start address is mapped. - StartAddressModule = "start_address_module" - // TEB field is the address of the Thread Environment Block (TEB) - TEB = "teb" - - // FileObject determines the field name for the file object pointer. - FileObject = "file_object" - // FilePath represents the field that designates the absolute path of the file. - FilePath = "file_path" - // FileCreateOptions is the field that represents the values passed in the CreateDispositions parameter to the NtCreateFile function. - FileCreateOptions = "create_options" - // FileOperation is the field that represents the values passed in the CreateOptions parameter to the NtCreateFile function. - FileOperation = "create_disposition" - // FileCreated represents the name for the file creation field. - FileCreated = "created" - // FileAccessed represents the name for the file access field. - FileAccessed = "accessed" - // FileModified represents the name for the file modification field. - FileModified = "modified" - // FileShareMask represents the field name for the share access mask. - FileShareMask = "share_mask" - // FileType represents the field name that indicates the file type. - FileType = "type" - // FileAttributes is the field that represents file attribute values. - FileAttributes = "attributes" - // FileIoSize is the filed that represents the number of bytes in file read/write operations. - FileIoSize = "io_size" - // FileOffset represents the file for the file offset in read/write operations. - FileOffset = "offset" - // FileInfoClass represents the file information class. - FileInfoClass = "class" - // FileKey represents the directory key identifier in EnumDirectory events. - FileKey = "file_key" - // FileDirectory represents the field for the directory name in EnumDirectory events. - FileDirectory = "directory" - // FileIrpPtr represents the I/O request packet id. - FileIrpPtr = "irp" - // FileExtraInfo is the parameter that represents extra information returned by the file system for the operation. For example for a read request, the actual number of bytes that were read. - FileExtraInfo = "extra_info" - // FileIsDLL is the parameter that indicates if the file is a DLL - FileIsDLL = "is_dll" - // FileIsDriver is the parameter that indicates if the file is a driver - FileIsDriver = "is_driver" - // FileIsExecutable is the parameter that indicates if the file is an executable - FileIsExecutable = "is_exec" - // FileIsDotnet is the parameter that indicates if the file is a .NET assembly - FileIsDotnet = "is_dotnet" - - // FileViewBase is the parameter that represents the base address of the mapped section. - FileViewBase = "view_base" - // FileViewSize is the parameter that represents the size of the mapped section. - FileViewSize = "view_size" - // FileViewSectionType is the parameter that represents the mapped section type. - FileViewSectionType = "section_type" - - // RegKeyHandle identifies the parameter name for the registry key handle. - RegKeyHandle = "key_handle" - // RegKCB identifies the parameter name for the registry key control block. - RegKCB = "kcb" - // RegPath represents the parameter name for the fully qualified key path. - RegPath = "key_path" - // RegValue identifies the parameter name that contains the value - RegValue = "value" - // RegValueType identifies the parameter that represents registry value type e.g (DWORD, BINARY) - RegValueType = "value_type" - // RegData identifies the parameter that stores the captured registry data - RegData = "data" - - // ModuleBase identifies the parameter name for the base address of the process in which the Mmdule is loaded. - ModuleBase = "base_address" - // ModuleSize represents the parameter name for the size of the module in bytes. - ModuleSize = "module_size" - // ModuleCheckSum is the parameter name for module checksum. - ModuleCheckSum = "checksum" - // ModuleTimeDateStamp is the parametter name for module timedate stamp. - ModuleTimeDateStamp = "timedate_stamp" - // ModuleDefaultBase is the parameter name that represents module's base address. - ModuleDefaultBase = "default_address" - // ModulePath is the parameter name that denotes the file path and extension of the DLL/executable Module. - ModulePath = "file_path" - // ModuleSignatureLevel is the parameter denoting the loaded module signature level. - ModuleSignatureLevel = "signature_level" - // ModuleSignatureType is the parameter denoting the loaded module signature type. - ModuleSignatureType = "signature_type" - // ModuleCertSubject is the parameter that indicates the subject of the certificate is the entity its public key is associated with. - ModuleCertSubject = "cert_subject" - // ModuleCertIssuer is the parameter that represents the certificate authority (CA). - ModuleCertIssuer = "cert_issuer" - // ModuleCertSerial is the parameter that represents the serial number MUST be a positive integer assigned - // by the CA to each certificate. - ModuleCertSerial = "cert_serial" - // ModuleCertNotBefore is the parameter that specifies the certificate won't be valid before this timestamp. - ModuleCertNotBefore = "cert_not_before" - // ModuleCertNotAfter is the parameter that specifies the certificate won't be valid after this timestamp. - ModuleCertNotAfter = "cert_not_after" - - // NetSize identifies the parameter name that represents the packet size. - NetSize = "size" - // NetDIP is the parameter name that denotes the destination IP address. - NetDIP = "dip" - // NetSIP is the parameter name that denotes the source IP address. - NetSIP = "sip" - // NetDport identifies the parameter name that represents destination port number. - NetDport = "dport" - // NetSport identifies the parameter name that represents source port number. - NetSport = "sport" - // NetMSS is the parameter name that represents the maximum TCP segment size. - NetMSS = "mss" - // NetRcvWin is the parameter name that represents TCP segment's receive window size. - NetRcvWin = "rcvwin" - // NetSAckopt is the parameter name that represents Selective Acknowledgment option in TCP header. - NetSAckopt = "sack_opt" - // NetTsopt is the parameter name that represents the time stamp option in TCP header. - NetTsopt = "timestamp_opt" - // NetWsopt is the parameter name that represents the window scale option in TCP header. - NetWsopt = "window_scale_opt" - // NetRcvWinScale is the parameter name that represents the TCP receive window scaling factor. - NetRcvWinScale = "recv_winscale" - // NetSendWinScale is the parameter name that represents the TCP send window scaling factor. - NetSendWinScale = "send_winscale" - // NetSeqNum is the parameter name that represents the TCP sequence number. - NetSeqNum = "seqnum" - // NetStartTime is the parameter name that represents the TCP start time. - NetStartTime = "start_time" - // NetEndTime is the parameter name that represents the TCP end time. - NetEndTime = "end_time" - // NetConnID is the parameter name that represents a unique connection identifier. - NetConnID = "connid" - // NetL4Proto is the parameter name that identifies the Layer 4 protocol name. - NetL4Proto = "l4_proto" - // NetDportName is the field that denotes the destination port name. - NetDportName = "dport_name" - // NetSportName is the field that denotes the source port name. - NetSportName = "sport_name" - // NetSIPNames is the field that denotes the source IP address names. - NetSIPNames = "sip_names" - // NetDIPNames is the field that denotes the destination IP address names. - NetDIPNames = "dip_names" - - // DNSName is the field that represents the DNS query name - DNSName = "name" - // DNSRR is the field that represents the DNS record type - DNSRR = "rr" - // DNSOpts is the field that represents the DNS options - DNSOpts = "options" - // DNSRcode is the field that represents the DNS response code - DNSRcode = "rcode" - // DNSAnswers is the field that represents DNS response answers - DNSAnswers = "answers" - - // MemBaseAddress identifies the parameter that denotes the allocation base address. - MemBaseAddress = "base_address" - // MemRegionSize identifies the parameter that represents the allocated region size. - MemRegionSize = "region_size" - // MemAllocType identifies the parameter that represents allocation flags. - MemAllocType = "alloc_type" - // MemProtect identifies the parameter that represents the memory protection for the range of pages. - MemProtect = "protection" - // MemProtectMask identifies the parameter that represents the memory protection in mask notation - MemProtectMask = "protection_mask" - // MemPageType identifies the parameter that represents the allocated region type. - MemPageType = "page_type" - - // LinkSource identifies the parameter that represents the source symbolic link object or other kernel object - LinkSource = "source" - // LinkTarget identifies the parameter that represents the target symbolic link object or other kernel object - LinkTarget = "target" -) diff --git a/pkg/event/params/types.go b/pkg/event/params/types.go index e492cb3e6..02c25a14e 100644 --- a/pkg/event/params/types.go +++ b/pkg/event/params/types.go @@ -24,4 +24,4 @@ const ( ) // Value defines the container for parameter values -type Value interface{} +type Value any diff --git a/pkg/event/params/types_linux.go b/pkg/event/params/types_linux.go index a7c933239..49fe49245 100644 --- a/pkg/event/params/types_linux.go +++ b/pkg/event/params/types_linux.go @@ -25,9 +25,38 @@ const ( String Type = 1 ) -func platformTypeString(t Type) string { - if t == String { +// String returns the type name. +func (t Type) String() string { + switch t { + case String: return "string" + case Int8: + return "int8" + case Uint8: + return "uint8" + case Int16: + return "int16" + case Uint16: + return "uint16" + case Int32: + return "int32" + case Uint32: + return "uint32" + case Int64: + return "int64" + case Uint64: + return "uint64" + case TID: + return "tid" + case PID: + return "pid" + case Port: + return "port" + case IPv6: + return "ipv6" + case IPv4: + return "ipv4" + default: + return "unknown" } - return "" } diff --git a/pkg/event/params/types_windows.go b/pkg/event/params/types_windows.go index a342c0b85..c8e8c5846 100644 --- a/pkg/event/params/types_windows.go +++ b/pkg/event/params/types_windows.go @@ -37,17 +37,48 @@ const ( Key Type = 33 // HandleType is a Windows handle type. HandleType Type = 37 + // String is the future generic string type. + String Type = 38 ) -func platformTypeString(t Type) string { +// String returns the type name. +func (t Type) String() string { switch t { case UnicodeString: return "unicode" case AnsiString: return "ansi" + case String: + return "string" case SID, WbemSID: return "sid" + case Int8: + return "int8" + case Uint8: + return "uint8" + case Int16: + return "int16" + case Uint16: + return "uint16" + case Int32: + return "int32" + case Uint32: + return "uint32" + case Int64: + return "int64" + case Uint64: + return "uint64" + case TID: + return "tid" + case PID: + return "pid" + case Port: + return "port" + case IPv6: + return "ipv6" + case IPv4: + return "ipv4" default: - return "" + return "unknown" } } diff --git a/pkg/event/pid_linux.go b/pkg/event/pid_linux.go deleted file mode 100644 index a16deb920..000000000 --- a/pkg/event/pid_linux.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package event - -// PID is the process identifier type on Linux (kernel PIDs are 64-bit). -type PID = uint64 - -// TID is the thread identifier type on Linux (kernel thread IDs are 64-bit). -type TID = uint64 diff --git a/pkg/event/pid_windows.go b/pkg/event/pid_windows.go deleted file mode 100644 index 835c23063..000000000 --- a/pkg/event/pid_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build windows - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package event - -// PID is the process identifier type on Windows. -type PID = uint32 - -// TID is the thread identifier type on Windows. -type TID = uint32 diff --git a/pkg/event/queue.go b/pkg/event/queue.go index 9055de150..35d422795 100644 --- a/pkg/event/queue.go +++ b/pkg/event/queue.go @@ -40,41 +40,15 @@ type Listener interface { CanEnqueue() bool } -// Queue is the channel-backed data structure for +// queue is the channel-backed data structure for // pushing captured events and invoking listeners. -type Queue struct { - queuePlatform - +type queue struct { q chan *Event listeners []Listener stackEnrichment bool enqueueAlways bool } -// NewQueue constructs a new queue with the given channel size. -func NewQueue(size int, stackEnrichment bool, enqueueAlways bool) *Queue { - q := &Queue{ - q: make(chan *Event, size), - listeners: make([]Listener, 0), - stackEnrichment: stackEnrichment, - enqueueAlways: enqueueAlways, - } - q.initPlatform() - return q -} - -// NewQueueWithChannel constructs a new queue with a custom channel. -func NewQueueWithChannel(ch chan *Event, stackEnrichment bool, enqueueAlways bool) *Queue { - q := &Queue{ - q: ch, - listeners: make([]Listener, 0), - stackEnrichment: stackEnrichment, - enqueueAlways: enqueueAlways, - } - q.initPlatform() - return q -} - // RegisterListener registers a new queue event listener. The listener // is invoked before the event is pushed to the queue. func (q *Queue) RegisterListener(listener Listener) { @@ -84,36 +58,6 @@ func (q *Queue) RegisterListener(listener Listener) { // Events returns the channel with all queued events. func (q *Queue) Events() <-chan *Event { return q.q } -// Close closes the queue disposing allocated resources. -func (q *Queue) Close() { q.closePlatform() } - -// Push pushes a new event to the channel. Prior to -// sending the event to the channel, all registered -// listeners are invoked. The event is sent to the -// channel if one of the listeners agrees so and no -// errors are thrown. If the event depends on the state -// of subsequent events, then we store it in the backlog -// cache. The event is fetched from the backlog cache if -// the matching event arrives, i.e. that backlog key holds -// the value that was used to index the delayed event in the -// backlog. -// It is also the responsibility of the event queue to perform -// callstack enrichment if enabled. We first -// check if the current event is eligible for stack -// enrichment. If such condition is given, the event -// is pushed into callstack decorator FIFO queue. -// The stack return addresses are stored inside StackWalk -// event which is published after the acting event. -// Then, the originating event is popped from the queue, -// enriched with callstack parameter and forwarded to the -// event queue. -func (q *Queue) Push(e *Event) error { - if handled, err := q.pushPlatform(e); handled || err != nil { - return err - } - return q.push(e) -} - func (q *Queue) push(e *Event) error { var enqueue bool if q.enqueueAlways { diff --git a/pkg/event/queue_linux.go b/pkg/event/queue_linux.go index 76705f077..f0c91ef99 100644 --- a/pkg/event/queue_linux.go +++ b/pkg/event/queue_linux.go @@ -20,10 +20,36 @@ package event -type queuePlatform struct{} +type Queue struct { + queue +} -func (q *Queue) initPlatform() {} +// NewQueue constructs a new queue with the given channel size. +func NewQueue(size int, stackEnrichment bool, enqueueAlways bool) *Queue { + return &Queue{ + queue: queue{ + q: make(chan *Event, size), + listeners: make([]Listener, 0), + stackEnrichment: stackEnrichment, + enqueueAlways: enqueueAlways, + }, + } +} -func (q *Queue) closePlatform() {} +// NewQueueWithChannel constructs a new queue with a custom channel. +func NewQueueWithChannel(ch chan *Event, stackEnrichment bool, enqueueAlways bool) *Queue { + return &Queue{ + queue: queue{ + q: ch, + listeners: make([]Listener, 0), + stackEnrichment: stackEnrichment, + enqueueAlways: enqueueAlways, + }, + } +} -func (q *Queue) pushPlatform(_ *Event) (bool, error) { return false, nil } +func (q *Queue) Push(e *Event) error { + return q.push(e) +} + +func (q *Queue) Close() {} diff --git a/pkg/event/queue_linux_test.go b/pkg/event/queue_linux_test.go index d6fdbcb35..cebd5780d 100644 --- a/pkg/event/queue_linux_test.go +++ b/pkg/event/queue_linux_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestLinuxQueuePush(t *testing.T) { +func TestQueuePush(t *testing.T) { queue := NewQueue(1, false, false) t.Cleanup(queue.Close) diff --git a/pkg/event/queue_windows.go b/pkg/event/queue_windows.go index 9866c468f..24594c9f1 100644 --- a/pkg/event/queue_windows.go +++ b/pkg/event/queue_windows.go @@ -18,31 +18,83 @@ package event -type queuePlatform struct { +type Queue struct { + queue decorator *StackwalkDecorator } -func (q *Queue) initPlatform() { +// NewQueue constructs a new queue with the given channel size. +func NewQueue(size int, stackEnrichment bool, enqueueAlways bool) *Queue { + q := &Queue{ + queue: queue{ + q: make(chan *Event, size), + listeners: make([]Listener, 0), + stackEnrichment: stackEnrichment, + enqueueAlways: enqueueAlways, + }, + } + q.decorator = NewStackwalkDecorator(q) + + return q +} + +// NewQueueWithChannel constructs a new queue with a custom channel. +func NewQueueWithChannel(ch chan *Event, stackEnrichment bool, enqueueAlways bool) *Queue { + q := &Queue{ + queue: queue{ + q: ch, + listeners: make([]Listener, 0), + stackEnrichment: stackEnrichment, + enqueueAlways: enqueueAlways, + }, + } + + q.decorator = NewStackwalkDecorator(q) + + return q } -func (q *Queue) closePlatform() { +// Close closes the queue disposing allocated resources. +func (q *Queue) Close() { q.decorator.Stop() } -func (q *Queue) pushPlatform(e *Event) (bool, error) { +// Push pushes a new event to the channel. Prior to +// sending the event to the channel, all registered +// listeners are invoked. The event is sent to the +// channel if one of the listeners agrees so and no +// errors are thrown. If the event depends on the state +// of subsequent events, then we store it in the backlog +// cache. The event is fetched from the backlog cache if +// the matching event arrives, i.e. that backlog key holds +// the value that was used to index the delayed event in the +// backlog. +// It is also the responsibility of the event queue to perform +// callstack enrichment if enabled. We first +// check if the current event is eligible for stack +// enrichment. If such condition is given, the event +// is pushed into callstack decorator FIFO queue. +// The stack return addresses are stored inside StackWalk +// event which is published after the acting event. +// Then, the originating event is popped from the queue, +// enriched with callstack parameter and forwarded to the +// event queue. +func (q *Queue) Push(e *Event) error { if q.stackEnrichment { - if e.Type.CanEnrichStack() { + // store pending event for callstack enrichment + if e.Type.WaitStack() { q.decorator.Push(e) - return true, nil + return nil } + // decorate events with callstack return addresses if e.IsStackWalk() { - q.decorator.Pop(e) - return true, nil + e = q.decorator.Pop(e) } } + // drop stack walk events if e.IsStackWalk() { - return true, nil + return nil } - return false, nil + return q.push(e) } diff --git a/pkg/event/types_linux.go b/pkg/event/types_linux.go index 883947e0b..0a05bae4a 100644 --- a/pkg/event/types_linux.go +++ b/pkg/event/types_linux.go @@ -2,6 +2,7 @@ /* * Copyright 2026 by Mostafa Moradian + * Copyright 2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -22,14 +23,13 @@ package event import ( "github.com/rabbitstack/fibratus/pkg/util/colorizer" - "github.com/rabbitstack/fibratus/pkg/util/hashers" ) // Source identifies a Linux event source. type Source uint8 const ( - // RawSyscallTracepoint identifies events from the raw_syscalls tracepoint. + // RawSyscallTracepoint identifies events from the raw syscall tracepoint. RawSyscallTracepoint Source = iota ) @@ -37,7 +37,7 @@ const ( type Type uint16 const ( - UnknownType Type = iota + Unknown Type = iota Execve Exit Clone @@ -52,132 +52,11 @@ const ( Kill Ptrace Prctl + MaxEvent ) -// String returns the event type name. -func (t Type) String() string { - switch t { - case Execve: - return "execve" - case Exit: - return "exit" - case Clone: - return "clone" - case Openat: - return "openat" - case Unlink: - return "unlink" - case Rename: - return "rename" - case Connect: - return "connect" - case Accept: - return "accept" - case Mmap: - return "mmap" - case ProcessVMRead: - return "process_vm_readv" - case ProcessVMWrite: - return "process_vm_writev" - case Kill: - return "kill" - case Ptrace: - return "ptrace" - case Prctl: - return "prctl" - default: - return "" - } -} - -// Category returns the event type category. -func (t Type) Category() Category { - switch t { - case Execve, Exit, Clone, Kill, Ptrace, Prctl: - return Process - case Openat, Unlink, Rename: - return File - case Connect, Accept: - return Net - case Mmap, ProcessVMRead, ProcessVMWrite: - return Mem - default: - return Unknown - } -} - -// Subcategory returns the event type subcategory. -func (t Type) Subcategory() Subcategory { return None } - -// Description returns a brief description of the event type. -func (t Type) Description() string { - switch t { - case Execve: - return "Executes a program" - case Exit: - return "Exit all threads in a process" - case Clone: - return "Creates a child process or a thread" - case Openat: - return "Opens or creates a file" - case Unlink: - return "Removes a directory entry" - case Rename: - return "Renames a file" - case Connect: - return "Initiates a socket connection" - case Accept: - return "Accepts a socket connection" - case Mmap: - return "Maps files or devices into memory" - case ProcessVMRead: - return "Reads memory from another process" - case ProcessVMWrite: - return "Writes memory into another process" - case Kill: - return "Sends a signal to a process" - case Ptrace: - return "Traces or controls another process" - case Prctl: - return "Performs a process-control operation" - default: - return "" - } -} - -// Hash calculates the hash of the event type name. -func (t Type) Hash() uint32 { - if t == UnknownType { - return 0 - } - return hashers.FnvUint32([]byte(t.String())) -} - -// Exists reports whether the event type is known. -func (t Type) Exists() bool { - switch t { - case Execve, Exit, Clone, Openat, Unlink, Rename, Connect, Accept, Mmap, ProcessVMRead, ProcessVMWrite, Kill, Ptrace, Prctl: - return true - default: - return false - } -} - -// UnmarshalYAML converts an event name to its type. -func (t *Type) UnmarshalYAML(unmarshal func(interface{}) error) error { - var name string - if err := unmarshal(&name); err != nil { - return err - } - *t = NameToType(name) - return nil -} - -// ID returns the stable numeric event identifier. -func (t Type) ID() uint { return uint(t) } - -// Source returns the event source. -func (t Type) Source() Source { return RawSyscallTracepoint } +// String returns the event type string representation. +func (t Type) String() string { return table[t].Name } func (t Type) color() string { return colorizer.SpanBold(colorizer.White, t.String()) diff --git a/pkg/event/types_linux_test.go b/pkg/event/types_linux_test.go deleted file mode 100644 index 9cee20881..000000000 --- a/pkg/event/types_linux_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package event - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestLinuxEventCatalog(t *testing.T) { - assert.Equal(t, uint16(1), uint16(Execve)) - assert.Equal(t, uint16(14), uint16(Prctl)) - assert.Equal(t, File, Openat.Category()) - assert.Equal(t, Net, Connect.Category()) - assert.Equal(t, Mem, Mmap.Category()) - assert.Equal(t, Process, Kill.Category()) - assert.Equal(t, "process_vm_readv", ProcessVMRead.String()) - assert.True(t, Openat.Exists()) - for _, typ := range All() { - assert.True(t, typ.Exists()) - assert.Equal(t, typ, NameToType(typ.String())) - assert.NotEmpty(t, typ.Description()) - assert.Equal(t, typ.Category(), TypeToEventInfo(typ).Category) - } - assert.Equal(t, uint16(Prctl), MaxTypeID()) -} - -func TestLinuxEventCatalogRejectsWindowsNames(t *testing.T) { - for _, name := range []string{ - "CreateProcess", - "TerminateProcess", - "ProcessRundown", - "CreateFile", - "CreateThread", - "LoadImage", - "RegOpenKey", - "RecvTCPv4", - } { - assert.Equal(t, UnknownType, NameToType(name), name) - } -} diff --git a/pkg/filter/accessor.go b/pkg/filter/accessor.go index 925630515..e81644511 100644 --- a/pkg/filter/accessor.go +++ b/pkg/filter/accessor.go @@ -24,7 +24,6 @@ import ( "reflect" "time" - "github.com/rabbitstack/fibratus/internal/evasion" "github.com/rabbitstack/fibratus/pkg/event" "github.com/rabbitstack/fibratus/pkg/event/params" "github.com/rabbitstack/fibratus/pkg/filter/fields" @@ -37,7 +36,7 @@ var ( // Accessor dictates the behaviour of the field accessors. One of the main responsibilities of the accessor is // to extract the underlying parameter for the field given in the filter expression. It can also produce a value -// from the non-params constructs such as process' state or PE metadata. +// from the non-params constructs such as process' state. type Accessor interface { // Get fetches the parameter value for the specified filter field. Get(f Field, evt *event.Event) (params.Value, error) @@ -66,7 +65,7 @@ func newEventAccessor() Accessor { const timeFmt = "15:04:05" const dateFmt = "2006-01-02" -func (*evtAccessor) Get(f Field, evt *event.Event) (params.Value, error) { +func (*evtAccessor) get(f Field, evt *event.Event) (params.Value, error) { switch f.Name { case fields.EvtSeq, fields.KevtSeq: return evt.Seq, nil @@ -138,13 +137,8 @@ func (*evtAccessor) Get(f Field, evt *event.Event) (params.Value, error) { default: return evt.GetParamAsString(name), nil } - case fields.EvtIsDirectSyscall: - return evt.Evasions&uint32(evasion.DirectSyscall) != 0, nil - case fields.EvtIsIndirectSyscall: - return evt.Evasions&uint32(evasion.IndirectSyscall) != 0, nil } - - return platformEvtValue(f, evt) + return nil, nil } // narrowAccessors dynamically disables filter accessors by walking diff --git a/pkg/filter/accessor_linux.go b/pkg/filter/accessor_linux.go index 3c61eb9b6..ae137d04f 100644 --- a/pkg/filter/accessor_linux.go +++ b/pkg/filter/accessor_linux.go @@ -44,16 +44,20 @@ func GetAccessors() []Accessor { } } -// platformEvtValue resolves evt fields available only on Linux. -func platformEvtValue(f Field, evt *event.Event) (params.Value, error) { +func (e *evtAccessor) Get(f Field, evt *event.Event) (params.Value, error) { + v, err := e.get(f, evt) + if v != nil { + return v, err + } + switch f.Name { case fields.EvtRetval: return evt.Params.GetInt64(params.Retval) case fields.EvtSyscallID: return evt.Params.GetUint32(params.SyscallID) - default: - return nil, nil } + + return nil, err } func getParentPs(e *event.Event) *pstypes.PS { @@ -70,7 +74,7 @@ type psAccessor struct { func (psAccessor) SetFields([]Field) {} func (psAccessor) SetSegments([]fields.Segment) {} func (psAccessor) IsFieldAccessible(e *event.Event) bool { - return e.PS != nil || e.Category == event.Process + return e.PS != nil || e.Category() == event.Process } func newPSAccessor(psnap ps.Snapshotter) Accessor { return &psAccessor{psnap: psnap} } @@ -230,7 +234,7 @@ type fileAccessor struct{} func (fileAccessor) SetFields([]Field) {} func (fileAccessor) SetSegments([]fields.Segment) {} -func (fileAccessor) IsFieldAccessible(e *event.Event) bool { return e.Category == event.File } +func (fileAccessor) IsFieldAccessible(e *event.Event) bool { return e.Category() == event.File } func newFileAccessor() Accessor { return &fileAccessor{} } func (*fileAccessor) Get(f Field, e *event.Event) (params.Value, error) { @@ -262,7 +266,7 @@ type networkAccessor struct{} func (networkAccessor) SetFields([]Field) {} func (networkAccessor) SetSegments([]fields.Segment) {} -func (networkAccessor) IsFieldAccessible(e *event.Event) bool { return e.Category == event.Net } +func (networkAccessor) IsFieldAccessible(e *event.Event) bool { return e.Category() == event.Network } func newNetworkAccessor() Accessor { return &networkAccessor{} } func (*networkAccessor) Get(f Field, e *event.Event) (params.Value, error) { @@ -290,7 +294,7 @@ type memAccessor struct{} func (memAccessor) SetFields([]Field) {} func (memAccessor) SetSegments([]fields.Segment) {} -func (memAccessor) IsFieldAccessible(e *event.Event) bool { return e.Category == event.Mem } +func (memAccessor) IsFieldAccessible(e *event.Event) bool { return e.Category() == event.Memory } func newMemAccessor() Accessor { return &memAccessor{} } func (*memAccessor) Get(f Field, e *event.Event) (params.Value, error) { diff --git a/pkg/filter/accessor_stubs_linux.go b/pkg/filter/accessor_stubs_linux.go deleted file mode 100644 index 298f22b92..000000000 --- a/pkg/filter/accessor_stubs_linux.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build linux - -/* - * Copyright 2026 by Mostafa Moradian - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package filter - -import ( - "github.com/rabbitstack/fibratus/pkg/event" - "github.com/rabbitstack/fibratus/pkg/event/params" - "github.com/rabbitstack/fibratus/pkg/filter/fields" -) - -// noopAccessor satisfies Accessor for Windows-only field families on Linux. -type noopAccessor struct{} - -func (noopAccessor) Get(Field, *event.Event) (params.Value, error) { return nil, nil } -func (noopAccessor) SetFields([]Field) {} -func (noopAccessor) SetSegments([]fields.Segment) {} -func (noopAccessor) IsFieldAccessible(*event.Event) bool { return false } - -func newModuleAccessor() Accessor { return noopAccessor{} } -func newRegistryAccessor() Accessor { return noopAccessor{} } -func newHandleAccessor() Accessor { return noopAccessor{} } -func newPEAccessor() Accessor { return noopAccessor{} } -func newDNSAccessor() Accessor { return noopAccessor{} } diff --git a/pkg/filter/accessor_windows.go b/pkg/filter/accessor_windows.go index 3044d9549..9e8b7c738 100644 --- a/pkg/filter/accessor_windows.go +++ b/pkg/filter/accessor_windows.go @@ -26,6 +26,7 @@ import ( "strings" "time" + "github.com/rabbitstack/fibratus/internal/evasion" "github.com/rabbitstack/fibratus/pkg/callstack" "github.com/rabbitstack/fibratus/pkg/fs" "github.com/rabbitstack/fibratus/pkg/network" @@ -68,8 +69,21 @@ func getParentPs(e *event.Event) *pstypes.PS { return e.PS.Parent } -// platformEvtValue resolves evt fields available only on other platforms. -func platformEvtValue(Field, *event.Event) (params.Value, error) { return nil, nil } +func (e *evtAccessor) Get(f Field, evt *event.Event) (params.Value, error) { + v, err := e.get(f, evt) + if v != nil { + return v, err + } + + switch f.Name { + case fields.EvtIsDirectSyscall: + return evt.Evasions&uint32(evasion.DirectSyscall) != 0, nil + case fields.EvtIsIndirectSyscall: + return evt.Evasions&uint32(evasion.IndirectSyscall) != 0, nil + } + + return nil, err +} // psAccessor extracts process's state or event specific values. type psAccessor struct { diff --git a/pkg/filter/accessor_windows_test.go b/pkg/filter/accessor_windows_test.go index 7e2fc5056..822ddb7cb 100644 --- a/pkg/filter/accessor_windows_test.go +++ b/pkg/filter/accessor_windows_test.go @@ -71,7 +71,7 @@ func TestNarrowAccessors(t *testing.T) { assert.Len(t, pea.fields, 2) } -func eventWithCallstack(typ event.Type, category event.Category) *event.Event { +func eventWithCallstack(typ event.Type) *event.Event { e := &event.Event{Type: typ} e.Callstack = []callstack.Frame{{ Addr: 0x7ffb5c1d0396, @@ -115,22 +115,22 @@ func TestIsFieldAccessible(t *testing.T) { }, { newThreadAccessor(), - eventWithCallstack(event.CreateProcess, event.Process), + eventWithCallstack(event.CreateProcess), true, }, { newThreadAccessor(), - eventWithCallstack(event.RegSetValue, event.Registry), + eventWithCallstack(event.RegSetValue), true, }, { newRegistryAccessor(), - eventWithCallstack(event.RegSetValue, event.Registry), + eventWithCallstack(event.RegSetValue), true, }, { newNetworkAccessor(), - eventWithCallstack(event.RegSetValue, event.Registry), + eventWithCallstack(event.RegSetValue), false, }, { diff --git a/pkg/filter/approver.go b/pkg/filter/approver.go index 453bdb94e..25a3c3a9d 100644 --- a/pkg/filter/approver.go +++ b/pkg/filter/approver.go @@ -109,7 +109,7 @@ func BuildApproverPlan(filters []Filter) *ApproverPlan { for _, f := range filters { provider, ok := f.(ApproverProvider) if !ok { - for _, typ := range event.All() { + for _, typ := range event.AllTypes() { blocked[typ] = true } continue @@ -127,7 +127,7 @@ func BuildApproverPlan(filters []Filter) *ApproverPlan { } } - for _, typ := range event.All() { + for _, typ := range event.AllTypes() { if blocked[typ] || len(byType[typ]) == 0 { plan.policies[typ] = TypePolicy{DefaultAllow: true} continue @@ -149,7 +149,7 @@ func Union(plans ...*ApproverPlan) *ApproverPlan { out = clonePlan(p) continue } - for _, typ := range event.All() { + for _, typ := range event.AllTypes() { out.policies[typ] = unionPolicy(out.Policy(typ), p.Policy(typ)) } } @@ -215,15 +215,20 @@ func (f *filter) ApproverExtraction() Extraction { func typesFromStringFields(stringFields map[fields.Field][]string) []event.Type { var types []event.Type for _, name := range stringFields[fields.EvtName] { - types = append(types, event.NameToTypes(name)...) + typ, ok := event.ParseType(name) + if !ok { + continue + } + types = append(types, typ) } for _, name := range stringFields[fields.EvtCategory] { - if !event.IsCategoryKnown(name) { + cat, ok := event.ParseCategory(name) + if !ok { continue } - cat := event.Category(name) - for _, typ := range event.All() { - if typ.Category() == cat { + for _, typ := range event.AllTypes() { + info := event.GetTypeInfo(typ) + if info.Category == cat { types = append(types, typ) } } @@ -305,8 +310,8 @@ func extractEventNames(ex *Extraction, expr *ql.BinaryExpr) { } ex.TypesScoped = true for _, name := range names { - typ := event.NameToType(name) - if typ == event.UnknownType { + typ, ok := event.ParseType(name) + if !ok { continue } ex.Types = append(ex.Types, typ) @@ -325,12 +330,13 @@ func extractCategories(ex *Extraction, expr *ql.BinaryExpr) { } ex.TypesScoped = true for _, name := range names { - if !event.IsCategoryKnown(name) { + cat, ok := event.ParseCategory(name) + if !ok { continue } - cat := event.Category(name) - for _, typ := range event.All() { - if typ.Category() == cat { + for _, typ := range event.AllTypes() { + info := event.GetTypeInfo(typ) + if info.Category == cat { ex.Types = append(ex.Types, typ) } } @@ -429,7 +435,7 @@ func scopedTypes(ex Extraction) []event.Type { if ex.TypesScoped { return nil } - return event.All() + return event.AllTypes() } func policyFromClauses(clauses []Extraction) TypePolicy { diff --git a/pkg/filter/approver_linux.go b/pkg/filter/approver_linux.go index 3d1f80037..fb6af4d1d 100644 --- a/pkg/filter/approver_linux.go +++ b/pkg/filter/approver_linux.go @@ -28,7 +28,7 @@ import "github.com/rabbitstack/fibratus/pkg/event" // Mirrored by the leading check in event_approved in c/common/approvers.h. func AlwaysAllowed(t event.Type) bool { switch t { - case event.Execve, event.Exit, event.Clone, event.UnknownType: + case event.Execve, event.Exit, event.Clone, event.Unknown: return true default: return false diff --git a/pkg/filter/fields/defs.go b/pkg/filter/fields/defs.go index fc4e387ca..4fb2d1d99 100644 --- a/pkg/filter/fields/defs.go +++ b/pkg/filter/fields/defs.go @@ -433,15 +433,6 @@ const ( // KevtArg represents the field sequence for generic argument access KevtArg Field = "kevt.arg" - // HandleID represents the handle identifier within the process address space - HandleID Field = "handle.id" - // HandleObject represents the handle object address - HandleObject Field = "handle.object" - // HandleName represents the handle name - HandleName Field = "handle.name" - // HandleType represents the handle type (e.g. file) - HandleType Field = "handle.type" - // NetDIP represents network destination IP address NetDIP Field = "net.dip" // NetSIP represents the source IP address @@ -694,39 +685,6 @@ const ( DNSAnswers Field = "dns.answers" // DNSRcode identifies the field that represents the DNS response code DNSRcode Field = "dns.rcode" - - // ThreadpoolPoolID identifies the field that represents the thread pool identifier - ThreadpoolPoolID = "threadpool.id" - // ThreadpoolTaskID identifies the field that represents the thread pool task identifier - ThreadpoolTaskID = "threadpool.task.id" - // ThreadpoolCallbackAddress identifies the field that represents the address of the callback function - ThreadpoolCallbackAddress = "threadpool.callback.address" - // ThreadpoolCallbackSymbol identifies the field that represents the callback symbol - ThreadpoolCallbackSymbol = "threadpool.callback.symbol" - // ThreadpoolCallbackModule identifies the field that represents the module containing the callback symbol - ThreadpoolCallbackModule = "threadpool.callback.module" - // ThreadpoolCallbackContext identifies the field that represents the address of the callback context - ThreadpoolCallbackContext = "threadpool.callback.context" - // ThreadpoolCallbackContextRip identifies the field that represents the value of instruction pointer contained in the callback context - ThreadpoolCallbackContextRip = "threadpool.callback.context.rip" - // ThreadpoolCallbackContextRipSymbol identifies the field that represents the symbol name associated with the instruction pointer in callback context - ThreadpoolCallbackContextRipSymbol = "threadpool.callback.context.rip.symbol" - // ThreadpoolCallbackContextRipModule identifies the field that represents the module name associated with the instruction pointer in callback context - ThreadpoolCallbackContextRipModule = "threadpool.callback.context.rip.module" - // ThreadpoolSubprocessTag identifies the field that represents the service identifier associated with the thread pool - ThreadpoolSubprocessTag = "threadpool.subprocess_tag" - // ThreadpoolTimerDuetime identifies the field that represents the timer due time - ThreadpoolTimerDuetime = "threadpool.timer.duetime" - // ThreadpoolTimerSubqueue identifies the field that represents the memory address of the timer subqueue - ThreadpoolTimerSubqueue = "threadpool.timer.subqueue" - // ThreadpoolTimer identifies the field that represents the memory address of the timer object - ThreadpoolTimer = "threadpool.timer.address" - // ThreadpoolTimerPeriod identifies the field that represents the period of the timer - ThreadpoolTimerPeriod = "threadpool.timer.period" - // ThreadpoolTimerWindow identifies the field that represents the timer tolerate period - ThreadpoolTimerWindow = "threadpool.timer.window" - // ThreadpoolTimerAbsolute identifies the field that indicates if the timer is absolute or relative - ThreadpoolTimerAbsolute = "threadpool.timer.is_absolute" ) // String casts the field type to string. @@ -743,16 +701,14 @@ func (f Field) IsImageField() bool { return strings.HasPrefix(string(f), "ima func (f Field) IsFileField() bool { return strings.HasPrefix(string(f), "file.") } func (f Field) IsRegistryField() bool { return strings.HasPrefix(string(f), "registry.") } func (f Field) IsNetworkField() bool { return strings.HasPrefix(string(f), "net.") } -func (f Field) IsHandleField() bool { return strings.HasPrefix(string(f), "handle.") } func (f Field) IsPeField() bool { return strings.HasPrefix(string(f), "pe.") || strings.HasPrefix(string(f), "ps.pe.") || strings.HasPrefix(string(f), "ps.signature.") } func (f Field) IsModuleField() bool { return strings.HasPrefix(string(f), "module.") || strings.HasPrefix(string(f), "dll.") } -func (f Field) IsMemField() bool { return strings.HasPrefix(string(f), "mem.") } -func (f Field) IsDNSField() bool { return strings.HasPrefix(string(f), "dns.") } -func (f Field) IsThreadpoolField() bool { return strings.HasPrefix(string(f), "threadpool.") } +func (f Field) IsMemField() bool { return strings.HasPrefix(string(f), "mem.") } +func (f Field) IsDNSField() bool { return strings.HasPrefix(string(f), "dns.") } func (f Field) IsPeSection() bool { return f == PeNumSections || f == PsPeNumSections } func (f Field) IsPeSymbol() bool { @@ -948,13 +904,15 @@ func IsPseudoField(f Field) bool { func (f Field) IsPeSectionsPseudo() bool { return f == PeSections || f == PsPeSections } -var commonFields = map[Field]FieldInfo{ +var fields = map[Field]FieldInfo{ + EvtPID: {EvtPID, "process identifier generating the event", params.Uint32, []string{"evt.pid = 6"}, nil, nil}, + EvtTID: {EvtTID, "thread identifier generating the event", params.Uint32, []string{"evt.tid = 1024"}, nil, nil}, EvtSeq: {EvtSeq, "event sequence number", params.Uint64, []string{"evt.seq > 666"}, nil, nil}, EvtCPU: {EvtCPU, "logical processor core where the event was generated", params.Uint8, []string{"evt.cpu = 2"}, nil, nil}, - EvtName: {EvtName, "symbolical event name", platformAnsiString(), []string{"evt.name = 'CreateThread'"}, nil, nil}, - EvtCategory: {EvtCategory, "event category", platformAnsiString(), []string{"evt.category = 'registry'"}, nil, nil}, - EvtDesc: {EvtDesc, "event description", platformAnsiString(), []string{"evt.desc contains 'Creates a new process'"}, nil, nil}, - EvtHost: {EvtHost, "host name on which the event was produced", platformString(), []string{"evt.host contains 'kitty'"}, nil, nil}, + EvtName: {EvtName, "symbolical event name", params.String, []string{"evt.name = 'CreateThread'"}, nil, nil}, + EvtCategory: {EvtCategory, "event category", params.String, []string{"evt.category = 'registry'"}, nil, nil}, + EvtDesc: {EvtDesc, "event description", params.String, []string{"evt.desc contains 'Creates a new process'"}, nil, nil}, + EvtHost: {EvtHost, "host name on which the event was produced", params.String, []string{"evt.host contains 'kitty'"}, nil, nil}, EvtTime: {EvtTime, "event timestamp as a time string", params.Time, []string{"evt.time = '17:05:32'"}, nil, nil}, EvtTimeHour: {EvtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"evt.time.h = 23"}, nil, nil}, EvtTimeMin: {EvtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"evt.time.m = 54"}, nil, nil}, @@ -964,9 +922,9 @@ var commonFields = map[Field]FieldInfo{ EvtDateDay: {EvtDateDay, "day of the month on which the event occurred", params.Time, []string{"evt.date.d = 12"}, nil, nil}, EvtDateMonth: {EvtDateMonth, "month of the year on which the event occurred", params.Time, []string{"evt.date.m = 11"}, nil, nil}, EvtDateYear: {EvtDateYear, "year on which the event occurred", params.Uint32, []string{"evt.date.y = 2020"}, nil, nil}, - EvtDateTz: {EvtDateTz, "time zone associated with the event timestamp", platformAnsiString(), []string{"evt.date.tz = 'UTC'"}, nil, nil}, + EvtDateTz: {EvtDateTz, "time zone associated with the event timestamp", params.String, []string{"evt.date.tz = 'UTC'"}, nil, nil}, EvtDateWeek: {EvtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"evt.date.week = 2"}, nil, nil}, - EvtDateWeekday: {EvtDateWeekday, "week day on which the event occurred", platformAnsiString(), []string{"evt.date.weekday = 'Monday'"}, nil, nil}, + EvtDateWeekday: {EvtDateWeekday, "week day on which the event occurred", params.String, []string{"evt.date.weekday = 'Monday'"}, nil, nil}, EvtNparams: {EvtNparams, "number of parameters", params.Int8, []string{"evt.nparams > 2"}, nil, nil}, EvtArg: {EvtArg, "event parameter", params.Object, []string{"evt.arg[cmdline] istartswith 'C:\\Windows'"}, nil, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { for _, c := range s { @@ -980,27 +938,16 @@ var commonFields = map[Field]FieldInfo{ } return true }}}, - PsName: {PsName, "process image name including the file extension", platformString(), []string{"ps.name contains 'firefox'"}, nil, nil}, - PsCmdline: {PsCmdline, "process command line", platformString(), []string{"ps.cmdline contains 'java'"}, nil, nil}, - PsExe: {PsExe, "full name of the process' executable", platformString(), []string{"ps.exe = 'C:\\Windows\\system32\\cmd.exe'"}, nil, nil}, + PsName: {PsName, "process image name including the file extension", params.String, []string{"ps.name contains 'firefox'"}, nil, nil}, + PsCmdline: {PsCmdline, "process command line", params.String, []string{"ps.cmdline contains 'java'"}, nil, nil}, + PsExe: {PsExe, "full name of the process' executable", params.String, []string{"ps.exe = 'C:\\Windows\\system32\\cmd.exe'"}, nil, nil}, PsArgs: {PsArgs, "process command line arguments", params.Slice, []string{"ps.args in ('/cdir', '/-C')"}, nil, nil}, - PsCwd: {PsCwd, "process current working directory", platformString(), []string{"ps.cwd = 'C:\\Users\\Default'"}, nil, nil}, - PsUsername: {PsUsername, "process username", platformString(), []string{"ps.username contains 'system'"}, nil, nil}, + PsCwd: {PsCwd, "process current working directory", params.String, []string{"ps.cwd = 'C:\\Users\\Default'"}, nil, nil}, + PsUsername: {PsUsername, "process username", params.String, []string{"ps.username contains 'system'"}, nil, nil}, PsEnvs: {PsEnvs, "process environment variables", params.Slice, []string{"ps.envs in ('SystemRoot:C:\\WINDOWS')", "ps.envs[windir] = 'C:\\WINDOWS'"}, nil, &Argument{Optional: true, ValidationFunc: func(arg string) bool { return true }}}, - PsParentName: {PsParentName, "parent process image name including the file extension", platformString(), []string{"ps.parent.name contains 'cmd.exe'"}, nil, nil}, - PsParentCmdline: {PsParentCmdline, "parent process command line", platformString(), []string{"ps.parent.cmdline contains 'java'"}, nil, nil}, - PsParentExe: {PsParentExe, "full name of the parent process' executable", platformString(), []string{"ps.parent.exe = 'C:\\Windows\\system32\\explorer.exe'"}, nil, nil}, -} - -func platformFields(platform map[Field]FieldInfo) map[Field]FieldInfo { - fields := make(map[Field]FieldInfo, len(commonFields)+len(platform)) - for field, info := range commonFields { - fields[field] = info - } - for field, info := range platform { - fields[field] = info - } - return fields + PsParentName: {PsParentName, "parent process image name including the file extension", params.String, []string{"ps.parent.name contains 'cmd.exe'"}, nil, nil}, + PsParentCmdline: {PsParentCmdline, "parent process command line", params.String, []string{"ps.parent.cmdline contains 'java'"}, nil, nil}, + PsParentExe: {PsParentExe, "full name of the parent process' executable", params.String, []string{"ps.parent.exe = 'C:\\Windows\\system32\\explorer.exe'"}, nil, nil}, } // ArgumentOf returns argument data for the specified field. diff --git a/pkg/filter/fields/defs_linux.go b/pkg/filter/fields/defs_linux.go index 26e643df2..8e9805702 100644 --- a/pkg/filter/fields/defs_linux.go +++ b/pkg/filter/fields/defs_linux.go @@ -23,53 +23,48 @@ package fields import "github.com/rabbitstack/fibratus/pkg/event/params" -func platformString() params.Type { return params.String } -func platformAnsiString() params.Type { return params.String } - -var fields = platformFields(map[Field]FieldInfo{ - EvtPID: {EvtPID, "process identifier generating the event", params.Uint64, []string{"evt.pid = 6"}, nil, nil}, - EvtTID: {EvtTID, "thread identifier generating the event", params.Uint64, []string{"evt.tid = 1024"}, nil, nil}, - EvtRetval: {EvtRetval, "syscall return value", params.Int64, []string{"evt.retval < 0"}, nil, nil}, - EvtSyscallID: {EvtSyscallID, "raw architecture-specific syscall number", params.Uint32, []string{"evt.syscall_id = 59"}, nil, nil}, - PsPid: {PsPid, "process identifier", params.Uint64, []string{"ps.pid = 1024"}, nil, nil}, - PsPpid: {PsPpid, "parent process identifier", params.Uint64, []string{"ps.ppid = 45"}, nil, nil}, - PsParentPid: {PsParentPid, "parent process id", params.Uint64, []string{"ps.parent.pid = 4"}, nil, nil}, - PsUUID: {PsUUID, "unique process identifier", params.Uint64, []string{"ps.uuid > 6000054355"}, nil, nil}, - PsParentUUID: {PsParentUUID, "unique parent process identifier", params.Uint64, []string{"ps.parent.uuid > 6000054355"}, nil, nil}, - PsUID: {PsUID, "real user identifier of the process", params.Uint32, []string{"ps.uid = 0"}, nil, nil}, - PsGID: {PsGID, "real group identifier of the process", params.Uint32, []string{"ps.gid = 0"}, nil, nil}, - PsParentArgs: {PsParentArgs, "parent process command line arguments", params.Slice, []string{"ps.parent.args in ('-c', 'bash')"}, nil, nil}, - PsParentCwd: {PsParentCwd, "parent process current working directory", platformString(), []string{"ps.parent.cwd = '/home/user'"}, nil, nil}, - PsParentUsername: {PsParentUsername, "parent process username", platformString(), []string{"ps.parent.username = 'root'"}, nil, nil}, - PsParentEnvs: {PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('PATH:/usr/bin')"}, nil, nil}, - PsSignal: {PsSignal, "POSIX signal number", params.Int64, []string{"ps.signal = 9"}, nil, nil}, - PsTargetPID: {PsTargetPID, "target process identifier of kill, ptrace, or process_vm operations. Signal targets keep the pid_t sign, where zero is the caller process group, -1 is every permitted process, and any other negative value is the process group of its absolute value", params.Int64, []string{"ps.target.pid = 4242", "ps.target.pid < 0"}, nil, nil}, - PsPtraceRequest: {PsPtraceRequest, "ptrace request code", params.Int64, []string{"ps.ptrace.request = 16"}, nil, nil}, - PsPrctlOption: {PsPrctlOption, "prctl option code", params.Int64, []string{"ps.prctl.option = 15"}, nil, nil}, - PsCloneFlags: {PsCloneFlags, "clone flags bitmask", params.Uint64, []string{"ps.clone_flags = 0"}, nil, nil}, - FilePath: {FilePath, "full file path", platformString(), []string{"file.path = '/etc/passwd'"}, nil, nil}, - FilePathStem: {FilePathStem, "full file path without extension", platformString(), []string{"file.path.stem = '/tmp/secret'"}, nil, nil}, - FileName: {FileName, "file base name", platformString(), []string{"file.name = 'passwd'"}, nil, nil}, - FileExtension: {FileExtension, "file extension", platformAnsiString(), []string{"file.extension = '.so'"}, nil, nil}, - FilePathTarget: {FilePathTarget, "destination path of a rename or similar source/target file operation", platformString(), []string{"file.path.target = '/tmp/renamed'"}, nil, nil}, - FileDirFD: {FileDirFD, "directory file descriptor, including AT_FDCWD", params.Int64, []string{"file.dirfd < 0"}, nil, nil}, - FileFD: {FileFD, "file descriptor returned by openat", params.Int64, []string{"file.fd = 3"}, nil, nil}, - FileFlags: {FileFlags, "raw openat, unlinkat, or renameat flags bitmask", params.Uint64, []string{"file.flags = 0"}, nil, nil}, - FileMode: {FileMode, "file creation mode supplied to openat", params.Uint64, []string{"file.mode = 420"}, nil, nil}, - NetDIP: {NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil}, - NetSIP: {NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil}, - NetDport: {NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil}, - NetSport: {NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil}, - NetFamily: {NetFamily, "socket address family", params.Uint16, []string{"net.family = 2"}, nil, nil}, - NetUnixPath: {NetUnixPath, "filesystem path of an AF_UNIX socket", platformString(), []string{"net.unix_path = '/tmp/app.sock'"}, nil, nil}, - NetFD: {NetFD, "socket file descriptor", params.Int64, []string{"net.fd = 5"}, nil, nil}, - MemBaseAddress: {MemBaseAddress, "region base address", params.Uint64, []string{"mem.address = 8192"}, nil, nil}, - MemRegionSize: {MemRegionSize, "region size", params.Uint64, []string{"mem.size > 4096"}, nil, nil}, - MemProtection: {MemProtection, "mapping protection bitmask", params.Uint32, []string{"mem.protection = 3"}, nil, nil}, - MemMmapFlags: {MemMmapFlags, "mmap flags bitmask", params.Uint64, []string{"mem.mmap.flags = 1"}, nil, nil}, - MemMmapFD: {MemMmapFD, "file descriptor backing a mapping", params.Int64, []string{"mem.mmap.fd = 3"}, nil, nil}, - MemMmapOffset: {MemMmapOffset, "file offset of a memory mapping", params.Uint64, []string{"mem.mmap.offset = 0"}, nil, nil}, - MemTargetPID: {MemTargetPID, "target process identifier of a process_vm operation", params.Int64, []string{"mem.target.pid = 4242"}, nil, nil}, - ThreadTID: {ThreadTID, "thread identifier", params.Uint64, []string{"thread.tid = 1024"}, nil, nil}, - ThreadPID: {ThreadPID, "thread group identifier of the thread", params.Uint64, []string{"thread.pid = 1024"}, nil, nil}, -}) +func init() { + fields[EvtRetval] = FieldInfo{EvtRetval, "syscall return value", params.Int64, []string{"evt.retval < 0"}, nil, nil} + fields[EvtSyscallID] = FieldInfo{EvtSyscallID, "raw architecture-specific syscall number", params.Uint32, []string{"evt.syscall_id = 59"}, nil, nil} + fields[PsPid] = FieldInfo{PsPid, "process identifier", params.Uint64, []string{"ps.pid = 1024"}, nil, nil} + fields[PsPpid] = FieldInfo{PsPpid, "parent process identifier", params.Uint64, []string{"ps.ppid = 45"}, nil, nil} + fields[PsParentPid] = FieldInfo{PsParentPid, "parent process id", params.Uint64, []string{"ps.parent.pid = 4"}, nil, nil} + fields[PsUUID] = FieldInfo{PsUUID, "unique process identifier", params.Uint64, []string{"ps.uuid > 6000054355"}, nil, nil} + fields[PsParentUUID] = FieldInfo{PsParentUUID, "unique parent process identifier", params.Uint64, []string{"ps.parent.uuid > 6000054355"}, nil, nil} + fields[PsUID] = FieldInfo{PsUID, "real user identifier of the process", params.Uint32, []string{"ps.uid = 0"}, nil, nil} + fields[PsGID] = FieldInfo{PsGID, "real group identifier of the process", params.Uint32, []string{"ps.gid = 0"}, nil, nil} + fields[PsParentArgs] = FieldInfo{PsParentArgs, "parent process command line arguments", params.Slice, []string{"ps.parent.args in ('-c', 'bash')"}, nil, nil} + fields[PsParentCwd] = FieldInfo{PsParentCwd, "parent process current working directory", params.String, []string{"ps.parent.cwd = '/home/user'"}, nil, nil} + fields[PsParentUsername] = FieldInfo{PsParentUsername, "parent process username", params.String, []string{"ps.parent.username = 'root'"}, nil, nil} + fields[PsParentEnvs] = FieldInfo{PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('PATH:/usr/bin')"}, nil, nil} + fields[PsSignal] = FieldInfo{PsSignal, "POSIX signal number", params.Int64, []string{"ps.signal = 9"}, nil, nil} + fields[PsTargetPID] = FieldInfo{PsTargetPID, "target process identifier of kill, ptrace, or process_vm operations. Signal targets keep the pid_t sign, where zero is the caller process group, -1 is every permitted process, and any other negative value is the process group of its absolute value", params.Int64, []string{"ps.target.pid = 4242", "ps.target.pid < 0"}, nil, nil} + fields[PsPtraceRequest] = FieldInfo{PsPtraceRequest, "ptrace request code", params.Int64, []string{"ps.ptrace.request = 16"}, nil, nil} + fields[PsPrctlOption] = FieldInfo{PsPrctlOption, "prctl option code", params.Int64, []string{"ps.prctl.option = 15"}, nil, nil} + fields[PsCloneFlags] = FieldInfo{PsCloneFlags, "clone flags bitmask", params.Uint64, []string{"ps.clone_flags = 0"}, nil, nil} + fields[FilePath] = FieldInfo{FilePath, "full file path", params.String, []string{"file.path = '/etc/passwd'"}, nil, nil} + fields[FilePathStem] = FieldInfo{FilePathStem, "full file path without extension", params.String, []string{"file.path.stem = '/tmp/secret'"}, nil, nil} + fields[FileName] = FieldInfo{FileName, "file base name", params.String, []string{"file.name = 'passwd'"}, nil, nil} + fields[FileExtension] = FieldInfo{FileExtension, "file extension", params.String, []string{"file.extension = '.so'"}, nil, nil} + fields[FilePathTarget] = FieldInfo{FilePathTarget, "destination path of a rename or similar source/target file operation", params.String, []string{"file.path.target = '/tmp/renamed'"}, nil, nil} + fields[FileDirFD] = FieldInfo{FileDirFD, "directory file descriptor, including AT_FDCWD", params.Int64, []string{"file.dirfd < 0"}, nil, nil} + fields[FileFD] = FieldInfo{FileFD, "file descriptor returned by openat", params.Int64, []string{"file.fd = 3"}, nil, nil} + fields[FileFlags] = FieldInfo{FileFlags, "raw openat, unlinkat, or renameat flags bitmask", params.Uint64, []string{"file.flags = 0"}, nil, nil} + fields[FileMode] = FieldInfo{FileMode, "file creation mode supplied to openat", params.Uint64, []string{"file.mode = 420"}, nil, nil} + fields[NetDIP] = FieldInfo{NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil} + fields[NetSIP] = FieldInfo{NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil} + fields[NetDport] = FieldInfo{NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil} + fields[NetSport] = FieldInfo{NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil} + fields[NetFamily] = FieldInfo{NetFamily, "socket address family", params.Uint16, []string{"net.family = 2"}, nil, nil} + fields[NetUnixPath] = FieldInfo{NetUnixPath, "filesystem path of an AF_UNIX socket", params.String, []string{"net.unix_path = '/tmp/app.sock'"}, nil, nil} + fields[NetFD] = FieldInfo{NetFD, "socket file descriptor", params.Int64, []string{"net.fd = 5"}, nil, nil} + fields[MemBaseAddress] = FieldInfo{MemBaseAddress, "region base address", params.Uint64, []string{"mem.address = 8192"}, nil, nil} + fields[MemRegionSize] = FieldInfo{MemRegionSize, "region size", params.Uint64, []string{"mem.size > 4096"}, nil, nil} + fields[MemProtection] = FieldInfo{MemProtection, "mapping protection bitmask", params.Uint32, []string{"mem.protection = 3"}, nil, nil} + fields[MemMmapFlags] = FieldInfo{MemMmapFlags, "mmap flags bitmask", params.Uint64, []string{"mem.mmap.flags = 1"}, nil, nil} + fields[MemMmapFD] = FieldInfo{MemMmapFD, "file descriptor backing a mapping", params.Int64, []string{"mem.mmap.fd = 3"}, nil, nil} + fields[MemMmapOffset] = FieldInfo{MemMmapOffset, "file offset of a memory mapping", params.Uint64, []string{"mem.mmap.offset = 0"}, nil, nil} + fields[MemTargetPID] = FieldInfo{MemTargetPID, "target process identifier of a process_vm operation", params.Int64, []string{"mem.target.pid = 4242"}, nil, nil} + fields[ThreadTID] = FieldInfo{ThreadTID, "thread identifier", params.Uint64, []string{"thread.tid = 1024"}, nil, nil} + fields[ThreadPID] = FieldInfo{ThreadPID, "thread group identifier of the thread", params.Uint64, []string{"thread.pid = 1024"}, nil, nil} +} diff --git a/pkg/filter/fields/defs_linux_test.go b/pkg/filter/fields/defs_linux_test.go index 4058df534..6a1242c8a 100644 --- a/pkg/filter/fields/defs_linux_test.go +++ b/pkg/filter/fields/defs_linux_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestLinuxFields(t *testing.T) { +func TestFields(t *testing.T) { require.True(t, IsField(string(EvtName))) require.True(t, IsField(string(PsName))) require.True(t, IsField(string(PsParentExe))) @@ -55,12 +55,12 @@ func TestLinuxFields(t *testing.T) { require.Equal(t, params.Uint32, MemProtection.Type()) } -func TestLinuxExcludesWindowsOnlyFields(t *testing.T) { +func TestExcludesWindowsOnlyFields(t *testing.T) { unavailable := []Field{ KevtPID, KevtTID, KevtSeq, KevtName, KevtArg, KevtCPU, KevtHost, PsComm, PsSID, PsDomain, PsIsWOW64Field, PsPeNumSections, - RegistryPath, PeEntrypoint, HandleName, ImagePath, ModulePath, DllPath, - DNSName, ThreadpoolPoolID, FileObject, FileOperation, FileIsDLL, + RegistryPath, PeEntrypoint, ImagePath, ModulePath, DllPath, + DNSName, FileObject, FileOperation, FileIsDLL, MemPageType, MemAllocType, MemProtectionMask, ThreadTEB, EvtIsDirectSyscall, EvtIsIndirectSyscall, } diff --git a/pkg/filter/fields/defs_windows.go b/pkg/filter/fields/defs_windows.go index 1e48cc2d8..fbc76a21a 100644 --- a/pkg/filter/fields/defs_windows.go +++ b/pkg/filter/fields/defs_windows.go @@ -26,9 +26,6 @@ import ( "github.com/rabbitstack/fibratus/pkg/event/params" ) -func platformString() params.Type { return params.UnicodeString } -func platformAnsiString() params.Type { return params.AnsiString } - // isNumber is the field argument validation function that // returns true if all characters are digits. var isNumber = func(s string) bool { @@ -40,31 +37,29 @@ var isNumber = func(s string) bool { return true } -var fields = platformFields(map[Field]FieldInfo{ - EvtPID: {EvtPID, "process identifier generating the event", params.Uint32, []string{"evt.pid = 6"}, nil, nil}, - EvtTID: {EvtTID, "thread identifier generating the event", params.Uint32, []string{"evt.tid = 1024"}, nil, nil}, - KevtPID: {KevtPID, "process identifier generating the event", params.Uint32, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil}, - KevtTID: {KevtTID, "thread identifier generating the event", params.Uint32, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil}, - KevtSeq: {KevtSeq, "event sequence number", params.Uint64, []string{"kevt.seq > 666"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtSeq}}, nil}, - KevtCPU: {KevtCPU, "logical processor core where the event was generated", params.Uint8, []string{"kevt.cpu = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCPU}}, nil}, - KevtName: {KevtName, "symbolical event name", platformAnsiString(), []string{"kevt.name = 'CreateThread'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtName}}, nil}, - KevtCategory: {KevtCategory, "event category", platformAnsiString(), []string{"kevt.category = 'registry'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCategory}}, nil}, - KevtDesc: {KevtDesc, "event description", platformAnsiString(), []string{"kevt.desc contains 'Creates a new process'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDesc}}, nil}, - KevtHost: {KevtHost, "host name on which the event was produced", platformString(), []string{"kevt.host contains 'kitty'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtHost}}, nil}, - KevtTime: {KevtTime, "event timestamp as a time string", params.Time, []string{"kevt.time = '17:05:32'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTime}}, nil}, - KevtTimeHour: {KevtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"kevt.time.h = 23"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeHour}}, nil}, - KevtTimeMin: {KevtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"kevt.time.m = 54"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeMin}}, nil}, - KevtTimeSec: {KevtTimeSec, "second offset within the minute on which the event occurred", params.Time, []string{"kevt.time.s = 0"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeSec}}, nil}, - KevtTimeNs: {KevtTimeNs, "nanoseconds specified by event timestamp", params.Int64, []string{"kevt.time.ns > 1591191629102337000"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeNs}}, nil}, - KevtDate: {KevtDate, "event timestamp as a date string", params.Time, []string{"kevt.date = '2018-03-03'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDate}}, nil}, - KevtDateDay: {KevtDateDay, "day of the month on which the event occurred", params.Time, []string{"kevt.date.d = 12"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateDay}}, nil}, - KevtDateMonth: {KevtDateMonth, "month of the year on which the event occurred", params.Time, []string{"kevt.date.m = 11"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateMonth}}, nil}, - KevtDateYear: {KevtDateYear, "year on which the event occurred", params.Uint32, []string{"kevt.date.y = 2020"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateYear}}, nil}, - KevtDateTz: {KevtDateTz, "time zone associated with the event timestamp", platformAnsiString(), []string{"kevt.date.tz = 'UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateTz}}, nil}, - KevtDateWeek: {KevtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"kevt.date.week = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeek}}, nil}, - KevtDateWeekday: {KevtDateWeekday, "week day on which the event occurred", platformAnsiString(), []string{"kevt.date.weekday = 'Monday'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeekday}}, nil}, - KevtNparams: {KevtNparams, "number of parameters", params.Int8, []string{"kevt.nparams > 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtNparams}}, nil}, - KevtArg: {KevtArg, "event parameter", params.Object, []string{"kevt.arg[cmdline] istartswith 'C:\\Windows'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtArg}}, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { +func init() { + fields[KevtPID] = FieldInfo{KevtPID, "process identifier generating the event", params.Uint32, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil} + fields[KevtTID] = FieldInfo{KevtTID, "thread identifier generating the event", params.Uint32, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil} + fields[KevtSeq] = FieldInfo{KevtSeq, "event sequence number", params.Uint64, []string{"kevt.seq > 666"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtSeq}}, nil} + fields[KevtCPU] = FieldInfo{KevtCPU, "logical processor core where the event was generated", params.Uint8, []string{"kevt.cpu = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCPU}}, nil} + fields[KevtName] = FieldInfo{KevtName, "symbolical event name", params.AnsiString, []string{"kevt.name = 'CreateThread'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtName}}, nil} + fields[KevtCategory] = FieldInfo{KevtCategory, "event category", params.AnsiString, []string{"kevt.category = 'registry'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCategory}}, nil} + fields[KevtDesc] = FieldInfo{KevtDesc, "event description", params.AnsiString, []string{"kevt.desc contains 'Creates a new process'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDesc}}, nil} + fields[KevtHost] = FieldInfo{KevtHost, "host name on which the event was produced", params.UnicodeString, []string{"kevt.host contains 'kitty'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtHost}}, nil} + fields[KevtTime] = FieldInfo{KevtTime, "event timestamp as a time string", params.Time, []string{"kevt.time = '17:05:32'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTime}}, nil} + fields[KevtTimeHour] = FieldInfo{KevtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"kevt.time.h = 23"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeHour}}, nil} + fields[KevtTimeMin] = FieldInfo{KevtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"kevt.time.m = 54"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeMin}}, nil} + fields[KevtTimeSec] = FieldInfo{KevtTimeSec, "second offset within the minute on which the event occurred", params.Time, []string{"kevt.time.s = 0"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeSec}}, nil} + fields[KevtTimeNs] = FieldInfo{KevtTimeNs, "nanoseconds specified by event timestamp", params.Int64, []string{"kevt.time.ns > 1591191629102337000"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeNs}}, nil} + fields[KevtDate] = FieldInfo{KevtDate, "event timestamp as a date string", params.Time, []string{"kevt.date = '2018-03-03'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDate}}, nil} + fields[KevtDateDay] = FieldInfo{KevtDateDay, "day of the month on which the event occurred", params.Time, []string{"kevt.date.d = 12"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateDay}}, nil} + fields[KevtDateMonth] = FieldInfo{KevtDateMonth, "month of the year on which the event occurred", params.Time, []string{"kevt.date.m = 11"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateMonth}}, nil} + fields[KevtDateYear] = FieldInfo{KevtDateYear, "year on which the event occurred", params.Uint32, []string{"kevt.date.y = 2020"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateYear}}, nil} + fields[KevtDateTz] = FieldInfo{KevtDateTz, "time zone associated with the event timestamp", params.AnsiString, []string{"kevt.date.tz = 'UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateTz}}, nil} + fields[KevtDateWeek] = FieldInfo{KevtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"kevt.date.week = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeek}}, nil} + fields[KevtDateWeekday] = FieldInfo{KevtDateWeekday, "week day on which the event occurred", params.AnsiString, []string{"kevt.date.weekday = 'Monday'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeekday}}, nil} + fields[KevtNparams] = FieldInfo{KevtNparams, "number of parameters", params.Int8, []string{"kevt.nparams > 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtNparams}}, nil} + fields[KevtArg] = FieldInfo{KevtArg, "event parameter", params.Object, []string{"kevt.arg[cmdline] istartswith 'C:\\Windows'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtArg}}, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { for _, c := range s { switch { case unicode.IsLower(c): @@ -75,63 +70,63 @@ var fields = platformFields(map[Field]FieldInfo{ } } return true - }}}, - PsPid: {PsPid, "process identifier", params.PID, []string{"ps.pid = 1024"}, nil, nil}, - PsPpid: {PsPpid, "parent process identifier", params.PID, []string{"ps.ppid = 45"}, nil, nil}, - PsParentPid: {PsParentPid, "parent process id", params.Uint32, []string{"ps.parent.pid = 4"}, nil, nil}, - EvtIsDirectSyscall: {EvtIsDirectSyscall, "indicates if the event is performing a direct syscall", params.Bool, []string{"evt.is_direct_syscall = true"}, nil, nil}, - EvtIsIndirectSyscall: {EvtIsIndirectSyscall, "indicates if the event is performing an indirect syscall", params.Bool, []string{"evt.is_indirect_syscall = true"}, nil, nil}, - PsComm: {PsComm, "process command line", params.UnicodeString, []string{"ps.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsCmdline}}, nil}, - PsSID: {PsSID, "security identifier under which this process is run", params.UnicodeString, []string{"ps.sid contains 'SYSTEM'"}, nil, nil}, - PsSessionID: {PsSessionID, "unique identifier for the current session", params.Int16, []string{"ps.sessionid = 1"}, nil, nil}, - PsDomain: {PsDomain, "process domain", params.UnicodeString, []string{"ps.domain contains 'SERVICE'"}, nil, nil}, - PsHandleNames: {PsHandleNames, "allocated process handle names", params.Slice, []string{"ps.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, - PsHandleTypes: {PsHandleTypes, "allocated process handle types", params.Slice, []string{"ps.handle.types in ('Key', 'Mutant', 'Section')"}, nil, nil}, - PsDTB: {PsDTB, "process directory table base address", params.Address, []string{"ps.dtb = '7ffe0000'"}, nil, nil}, - PsModuleNames: {PsModuleNames, "modules loaded by the process", params.Slice, []string{"ps.modules in ('crypt32.dll', 'xul.dll')"}, nil, nil}, - PsParentComm: {PsParentComm, "parent process command line", params.UnicodeString, []string{"ps.parent.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsParentCmdline}}, nil}, - PsParentArgs: {PsParentArgs, "parent process command line arguments", params.Slice, []string{"ps.parent.args in ('/cdir', '/-C')"}, nil, nil}, - PsParentCwd: {PsParentCwd, "parent process current working directory", params.UnicodeString, []string{"ps.parent.cwd = 'C:\\Temp'"}, nil, nil}, - PsParentSID: {PsParentSID, "security identifier under which the parent process is run", params.UnicodeString, []string{"ps.parent.sid contains 'SYSTEM'"}, nil, nil}, - PsParentDomain: {PsParentDomain, "parent process domain", params.UnicodeString, []string{"ps.parent.domain contains 'SERVICE'"}, nil, nil}, - PsParentUsername: {PsParentUsername, "parent process username", params.UnicodeString, []string{"ps.parent.username contains 'system'"}, nil, nil}, - PsParentSessionID: {PsParentSessionID, "unique identifier for the current session of parent process", params.Int16, []string{"ps.parent.sessionid = 1"}, nil, nil}, - PsParentEnvs: {PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('MOZ_CRASHREPORTER_DATA_DIRECTORY')"}, nil, nil}, - PsParentHandles: {PsParentHandles, "allocated parent process handle names", params.Slice, []string{"ps.parent.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, - PsParentHandleTypes: {PsParentHandleTypes, "allocated parent process handle types", params.Slice, []string{"ps.parent.handle.types in ('File', 'SymbolicLink')"}, nil, nil}, - PsParentDTB: {PsParentDTB, "parent process directory table base address", params.Address, []string{"ps.parent.dtb = '7ffe0000'"}, nil, nil}, - PsAccessMask: {PsAccessMask, "process desired access rights", params.AnsiString, []string{"ps.access.mask = '0x1400'"}, nil, nil}, - PsAccessMaskNames: {PsAccessMaskNames, "process desired access rights as a string list", params.Slice, []string{"ps.access.mask.names in ('SUSPEND_RESUME')"}, nil, nil}, - PsAccessStatus: {PsAccessStatus, "process access status", params.UnicodeString, []string{"ps.access.status = 'access is denied.'"}, nil, nil}, - PsUUID: {PsUUID, "unique process identifier", params.Uint64, []string{"ps.uuid > 6000054355"}, nil, nil}, - PsParentUUID: {PsParentUUID, "unique parent process identifier", params.Uint64, []string{"ps.parent.uuid > 6000054355"}, nil, nil}, - PsIsWOW64Field: {PsIsWOW64Field, "indicates if the process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.is_wow64"}, nil, nil}, - PsIsPackagedField: {PsIsPackagedField, "indicates if the process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.is_packaged"}, nil, nil}, - PsIsProtectedField: {PsIsProtectedField, "indicates if the process generating the event is a protected process", params.Bool, []string{"ps.is_protected"}, nil, nil}, - PsParentIsWOW64Field: {PsParentIsWOW64Field, "indicates if the parent process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.parent.is_wow64"}, nil, nil}, - PsParentIsPackagedField: {PsParentIsPackagedField, "indicates if the parent process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.parent.is_packaged"}, nil, nil}, - PsParentIsProtectedField: {PsParentIsProtectedField, "indicates if the the parent process generating the event is a protected process", params.Bool, []string{"ps.parent.is_protected"}, nil, nil}, - PsAncestor: {PsAncestor, "the process ancestor name", params.UnicodeString, []string{"ps.ancestor[1] = 'svchost.exe'", "ps.ancestor in ('winword.exe')"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, - PsTokenIntegrityLevel: {PsTokenIntegrityLevel, "process token integrity level", params.UnicodeString, []string{"ps.token.integrity_level = 'SYSTEM'"}, nil, nil}, - PsTokenIsElevated: {PsTokenIsElevated, "indicates if the process token is elevated", params.Bool, []string{"ps.token.is_elevated = true"}, nil, nil}, - PsTokenElevationType: {PsTokenElevationType, "process token elevation type", params.AnsiString, []string{"ps.token.elevation_type = 'LIMITED'"}, nil, nil}, - PsParentTokenIntegrityLevel: {PsParentTokenIntegrityLevel, "parent process token integrity level", params.UnicodeString, []string{"ps.parent.token.integrity_level = 'HIGH'"}, nil, nil}, - PsParentTokenIsElevated: {PsParentTokenIsElevated, "indicates if the parent process token is elevated", params.Bool, []string{"ps.parent.token.is_elevated = true"}, nil, nil}, - PsParentTokenElevationType: {PsParentTokenElevationType, "parent process token elevation type", params.AnsiString, []string{"ps.parent.token.elevation_type = 'LIMITED'"}, nil, nil}, - PsSignatureExists: {PsSignatureExists, "indicates if the process executable has a valid signature", params.Bool, []string{"ps.signature.exists"}, nil, nil}, - PsSignatureTrusted: {PsSignatureTrusted, "indicates if the process executable signature certificate chain is trusted", params.Bool, []string{"ps.signature.trusted"}, nil, nil}, - PsSignatureSerial: {PsSignatureSerial, "represents signature serial number", params.UnicodeString, []string{"ps.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, - PsSignatureSubject: {PsSignatureSubject, "represents signature subject", params.UnicodeString, []string{"ps.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - PsSignatureIssuer: {PsSignatureIssuer, "represents signature CA", params.UnicodeString, []string{"ps.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - PsSignatureAfter: {PsSignatureAfter, "represents certificate expiration date", params.Time, []string{"ps.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - PsSignatureBefore: {PsSignatureBefore, "represents certificate enrollment date", params.Time, []string{"ps.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - PsPeNumSections: {PsPeNumSections, "number of PE sections", params.Uint16, []string{"ps.pe.nsections < 5"}, nil, nil}, - PsPeNumSymbols: {PsPeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"ps.pe.nsymbols > 230"}, nil, nil}, - PsPeBaseAddress: {PsPeBaseAddress, "executable base address", params.Address, []string{"ps.pe.address.base = '140000000'"}, nil, nil}, - PsPeEntrypoint: {PsPeEntrypoint, "address of the entrypoint function", params.Address, []string{"ps.pe.address.entrypoint = '20110'"}, nil, nil}, - PsPeSymbols: {PsPeSymbols, "imported symbols", params.Slice, []string{"ps.pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, nil, nil}, - PsPeImports: {PsPeImports, "imported dynamic linked libraries", params.Slice, []string{"ps.pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, nil, nil}, - PsPeResources: {PsPeResources, "version resources", params.Map, []string{"ps.pe.resources[FileDescription] = 'Notepad'"}, nil, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { + }}} + fields[PsPid] = FieldInfo{PsPid, "process identifier", params.PID, []string{"ps.pid = 1024"}, nil, nil} + fields[PsPpid] = FieldInfo{PsPpid, "parent process identifier", params.PID, []string{"ps.ppid = 45"}, nil, nil} + fields[PsParentPid] = FieldInfo{PsParentPid, "parent process id", params.Uint32, []string{"ps.parent.pid = 4"}, nil, nil} + fields[EvtIsDirectSyscall] = FieldInfo{EvtIsDirectSyscall, "indicates if the event is performing a direct syscall", params.Bool, []string{"evt.is_direct_syscall = true"}, nil, nil} + fields[EvtIsIndirectSyscall] = FieldInfo{EvtIsIndirectSyscall, "indicates if the event is performing an indirect syscall", params.Bool, []string{"evt.is_indirect_syscall = true"}, nil, nil} + fields[PsComm] = FieldInfo{PsComm, "process command line", params.UnicodeString, []string{"ps.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsCmdline}}, nil} + fields[PsSID] = FieldInfo{PsSID, "security identifier under which this process is run", params.UnicodeString, []string{"ps.sid contains 'SYSTEM'"}, nil, nil} + fields[PsSessionID] = FieldInfo{PsSessionID, "unique identifier for the current session", params.Int16, []string{"ps.sessionid = 1"}, nil, nil} + fields[PsDomain] = FieldInfo{PsDomain, "process domain", params.UnicodeString, []string{"ps.domain contains 'SERVICE'"}, nil, nil} + fields[PsHandleNames] = FieldInfo{PsHandleNames, "allocated process handle names", params.Slice, []string{"ps.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil} + fields[PsHandleTypes] = FieldInfo{PsHandleTypes, "allocated process handle types", params.Slice, []string{"ps.handle.types in ('Key', 'Mutant', 'Section')"}, nil, nil} + fields[PsDTB] = FieldInfo{PsDTB, "process directory table base address", params.Address, []string{"ps.dtb = '7ffe0000'"}, nil, nil} + fields[PsModuleNames] = FieldInfo{PsModuleNames, "modules loaded by the process", params.Slice, []string{"ps.modules in ('crypt32.dll', 'xul.dll')"}, nil, nil} + fields[PsParentComm] = FieldInfo{PsParentComm, "parent process command line", params.UnicodeString, []string{"ps.parent.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsParentCmdline}}, nil} + fields[PsParentArgs] = FieldInfo{PsParentArgs, "parent process command line arguments", params.Slice, []string{"ps.parent.args in ('/cdir', '/-C')"}, nil, nil} + fields[PsParentCwd] = FieldInfo{PsParentCwd, "parent process current working directory", params.UnicodeString, []string{"ps.parent.cwd = 'C:\\Temp'"}, nil, nil} + fields[PsParentSID] = FieldInfo{PsParentSID, "security identifier under which the parent process is run", params.UnicodeString, []string{"ps.parent.sid contains 'SYSTEM'"}, nil, nil} + fields[PsParentDomain] = FieldInfo{PsParentDomain, "parent process domain", params.UnicodeString, []string{"ps.parent.domain contains 'SERVICE'"}, nil, nil} + fields[PsParentUsername] = FieldInfo{PsParentUsername, "parent process username", params.UnicodeString, []string{"ps.parent.username contains 'system'"}, nil, nil} + fields[PsParentSessionID] = FieldInfo{PsParentSessionID, "unique identifier for the current session of parent process", params.Int16, []string{"ps.parent.sessionid = 1"}, nil, nil} + fields[PsParentEnvs] = FieldInfo{PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('MOZ_CRASHREPORTER_DATA_DIRECTORY')"}, nil, nil} + fields[PsParentHandles] = FieldInfo{PsParentHandles, "allocated parent process handle names", params.Slice, []string{"ps.parent.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil} + fields[PsParentHandleTypes] = FieldInfo{PsParentHandleTypes, "allocated parent process handle types", params.Slice, []string{"ps.parent.handle.types in ('File', 'SymbolicLink')"}, nil, nil} + fields[PsParentDTB] = FieldInfo{PsParentDTB, "parent process directory table base address", params.Address, []string{"ps.parent.dtb = '7ffe0000'"}, nil, nil} + fields[PsAccessMask] = FieldInfo{PsAccessMask, "process desired access rights", params.AnsiString, []string{"ps.access.mask = '0x1400'"}, nil, nil} + fields[PsAccessMaskNames] = FieldInfo{PsAccessMaskNames, "process desired access rights as a string list", params.Slice, []string{"ps.access.mask.names in ('SUSPEND_RESUME')"}, nil, nil} + fields[PsAccessStatus] = FieldInfo{PsAccessStatus, "process access status", params.UnicodeString, []string{"ps.access.status = 'access is denied.'"}, nil, nil} + fields[PsUUID] = FieldInfo{PsUUID, "unique process identifier", params.Uint64, []string{"ps.uuid > 6000054355"}, nil, nil} + fields[PsParentUUID] = FieldInfo{PsParentUUID, "unique parent process identifier", params.Uint64, []string{"ps.parent.uuid > 6000054355"}, nil, nil} + fields[PsIsWOW64Field] = FieldInfo{PsIsWOW64Field, "indicates if the process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.is_wow64"}, nil, nil} + fields[PsIsPackagedField] = FieldInfo{PsIsPackagedField, "indicates if the process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.is_packaged"}, nil, nil} + fields[PsIsProtectedField] = FieldInfo{PsIsProtectedField, "indicates if the process generating the event is a protected process", params.Bool, []string{"ps.is_protected"}, nil, nil} + fields[PsParentIsWOW64Field] = FieldInfo{PsParentIsWOW64Field, "indicates if the parent process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.parent.is_wow64"}, nil, nil} + fields[PsParentIsPackagedField] = FieldInfo{PsParentIsPackagedField, "indicates if the parent process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.parent.is_packaged"}, nil, nil} + fields[PsParentIsProtectedField] = FieldInfo{PsParentIsProtectedField, "indicates if the the parent process generating the event is a protected process", params.Bool, []string{"ps.parent.is_protected"}, nil, nil} + fields[PsAncestor] = FieldInfo{PsAncestor, "the process ancestor name", params.UnicodeString, []string{"ps.ancestor[1] = 'svchost.exe'", "ps.ancestor in ('winword.exe')"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}} + fields[PsTokenIntegrityLevel] = FieldInfo{PsTokenIntegrityLevel, "process token integrity level", params.UnicodeString, []string{"ps.token.integrity_level = 'SYSTEM'"}, nil, nil} + fields[PsTokenIsElevated] = FieldInfo{PsTokenIsElevated, "indicates if the process token is elevated", params.Bool, []string{"ps.token.is_elevated = true"}, nil, nil} + fields[PsTokenElevationType] = FieldInfo{PsTokenElevationType, "process token elevation type", params.AnsiString, []string{"ps.token.elevation_type = 'LIMITED'"}, nil, nil} + fields[PsParentTokenIntegrityLevel] = FieldInfo{PsParentTokenIntegrityLevel, "parent process token integrity level", params.UnicodeString, []string{"ps.parent.token.integrity_level = 'HIGH'"}, nil, nil} + fields[PsParentTokenIsElevated] = FieldInfo{PsParentTokenIsElevated, "indicates if the parent process token is elevated", params.Bool, []string{"ps.parent.token.is_elevated = true"}, nil, nil} + fields[PsParentTokenElevationType] = FieldInfo{PsParentTokenElevationType, "parent process token elevation type", params.AnsiString, []string{"ps.parent.token.elevation_type = 'LIMITED'"}, nil, nil} + fields[PsSignatureExists] = FieldInfo{PsSignatureExists, "indicates if the process executable has a valid signature", params.Bool, []string{"ps.signature.exists"}, nil, nil} + fields[PsSignatureTrusted] = FieldInfo{PsSignatureTrusted, "indicates if the process executable signature certificate chain is trusted", params.Bool, []string{"ps.signature.trusted"}, nil, nil} + fields[PsSignatureSerial] = FieldInfo{PsSignatureSerial, "represents signature serial number", params.UnicodeString, []string{"ps.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil} + fields[PsSignatureSubject] = FieldInfo{PsSignatureSubject, "represents signature subject", params.UnicodeString, []string{"ps.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil} + fields[PsSignatureIssuer] = FieldInfo{PsSignatureIssuer, "represents signature CA", params.UnicodeString, []string{"ps.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil} + fields[PsSignatureAfter] = FieldInfo{PsSignatureAfter, "represents certificate expiration date", params.Time, []string{"ps.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil} + fields[PsSignatureBefore] = FieldInfo{PsSignatureBefore, "represents certificate enrollment date", params.Time, []string{"ps.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil} + fields[PsPeNumSections] = FieldInfo{PsPeNumSections, "number of PE sections", params.Uint16, []string{"ps.pe.nsections < 5"}, nil, nil} + fields[PsPeNumSymbols] = FieldInfo{PsPeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"ps.pe.nsymbols > 230"}, nil, nil} + fields[PsPeBaseAddress] = FieldInfo{PsPeBaseAddress, "executable base address", params.Address, []string{"ps.pe.address.base = '140000000'"}, nil, nil} + fields[PsPeEntrypoint] = FieldInfo{PsPeEntrypoint, "address of the entrypoint function", params.Address, []string{"ps.pe.address.entrypoint = '20110'"}, nil, nil} + fields[PsPeSymbols] = FieldInfo{PsPeSymbols, "imported symbols", params.Slice, []string{"ps.pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, nil, nil} + fields[PsPeImports] = FieldInfo{PsPeImports, "imported dynamic linked libraries", params.Slice, []string{"ps.pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, nil, nil} + fields[PsPeResources] = FieldInfo{PsPeResources, "version resources", params.Map, []string{"ps.pe.resources[FileDescription] = 'Notepad'"}, nil, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { for _, c := range s { switch { case unicode.IsLower(c): @@ -143,164 +138,160 @@ var fields = platformFields(map[Field]FieldInfo{ } } return true - }}}, - PsPeCompany: {PsPeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.company = 'Microsoft Corporation'"}, nil, nil}, - PsPeCopyright: {PsPeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"ps.pe.copyright = '© Microsoft Corporation'"}, nil, nil}, - PsPeDescription: {PsPeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.description = 'Notepad'"}, nil, nil}, - PsPeFileName: {PsPeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.name = 'NOTEPAD.EXE'"}, nil, nil}, - PsPeFileVersion: {PsPeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, nil, nil}, - PsPeProduct: {PsPeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product = 'Microsoft® Windows® Operating System'"}, nil, nil}, - PsPeProductVersion: {PsPeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product.version = '10.0.18362.693'"}, nil, nil}, - PsPeImphash: {PsPeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, nil, nil}, - PsPeIsDotnet: {PsPeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"ps.pe.is_dotnet"}, nil, nil}, - PsPeAnomalies: {PsPeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"ps.pe.anomalies in ('number of sections is 0')"}, nil, nil}, - PsPeIsModified: {PsPeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"ps.pe.is_modified"}, nil, nil}, - ThreadBasePrio: {ThreadBasePrio, "scheduler priority of the thread", params.Int8, []string{"thread.prio = 5"}, nil, nil}, - ThreadIOPrio: {ThreadIOPrio, "I/O priority hint for scheduling I/O operations", params.Int8, []string{"thread.io.prio = 4"}, nil, nil}, - ThreadPagePrio: {ThreadPagePrio, "memory page priority hint for memory pages accessed by the thread", params.Int8, []string{"thread.page.prio = 12"}, nil, nil}, - ThreadKstackBase: {ThreadKstackBase, "base address of the thread's kernel space stack", params.Address, []string{"thread.kstack.base = 'a65d800000'"}, nil, nil}, - ThreadKstackLimit: {ThreadKstackLimit, "limit of the thread's kernel space stack", params.Address, []string{"thread.kstack.limit = 'a85d800000'"}, nil, nil}, - ThreadUstackBase: {ThreadUstackBase, "base address of the thread's user space stack", params.Address, []string{"thread.ustack.base = '7ffe0000'"}, nil, nil}, - ThreadUstackLimit: {ThreadUstackLimit, "limit of the thread's user space stack", params.Address, []string{"thread.ustack.limit = '8ffe0000'"}, nil, nil}, - ThreadEntrypoint: {ThreadEntrypoint, "starting address of the function to be executed by the thread", params.Address, []string{"thread.entrypoint = '7efe0000'"}, &Deprecation{Since: "2.3.0", Fields: []Field{ThreadStartAddress}}, nil}, - ThreadStartAddress: {ThreadStartAddress, "thread start address", params.Address, []string{"thread.start_address = '7efe0000'"}, nil, nil}, - ThreadStartAddressSymbol: {ThreadStartAddressSymbol, "thread start address symbol", params.UnicodeString, []string{"thread.start_address.symbol = 'LoadModule'"}, nil, nil}, - ThreadStartAddressModule: {ThreadStartAddressModule, "thread start address module", params.UnicodeString, []string{"thread.start_address.module endswith 'kernel32.dll'"}, nil, nil}, - ThreadPID: {ThreadPID, "the process identifier where the thread is created", params.Uint32, []string{"evt.pid != thread.pid"}, nil, nil}, - ThreadTEB: {ThreadTEB, "the base address of the thread environment block", params.Address, []string{"thread.teb_address = '8f30893000'"}, nil, nil}, - ThreadAccessMask: {ThreadAccessMask, "thread desired access rights", params.AnsiString, []string{"thread.access.mask = '0x1fffff'"}, nil, nil}, - ThreadAccessMaskNames: {ThreadAccessMaskNames, "thread desired access rights as a string list", params.Slice, []string{"thread.access.mask.names in ('IMPERSONATE')"}, nil, nil}, - ThreadAccessStatus: {ThreadAccessStatus, "thread access status", params.UnicodeString, []string{"thread.access.status = 'success'"}, nil, nil}, - ThreadCallstackSummary: {ThreadCallstackSummary, "callstack summary", params.UnicodeString, []string{"thread.callstack.summary contains 'ntdll.dll|KERNELBASE.dll'"}, nil, nil}, - ThreadCallstackKernelSummary: {ThreadCallstackKernelSummary, "kernel thread callstack summary", params.UnicodeString, []string{"thread.callstack.kernel_summary contains 'fileinfo.sys|ntoskrnl.exe|FLTMGR.SYS|ntoskrnl.exe'"}, nil, nil}, - ThreadCallstackDetail: {ThreadCallstackDetail, "detailed information of each stack frame", params.UnicodeString, []string{"thread.callstack.detail contains 'KERNELBASE.dll!CreateProcessW'"}, nil, nil}, - ThreadCallstackModules: {ThreadCallstackModules, "list of modules comprising the callstack", params.Slice, []string{"thread.callstack.modules in ('C:\\WINDOWS\\System32\\KERNELBASE.dll')", "base(thread.callstack.modules[7]) = 'ntdll.dll'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, - ThreadCallstackSymbols: {ThreadCallstackSymbols, "list of symbols comprising the callstack", params.Slice, []string{"thread.callstack.symbols in ('ntdll.dll!NtCreateProcess')", "thread.callstack.symbols[3] = 'ntdll!NtCreateProcess'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, - ThreadCallstackAllocationSizes: {ThreadCallstackAllocationSizes, "allocation sizes of private pages", params.Slice, []string{"thread.callstack.allocation_sizes > 10000"}, nil, nil}, - ThreadCallstackProtections: {ThreadCallstackProtections, "page protections masks of each frame", params.Slice, []string{"thread.callstack.protections in ('RWX', 'WX')"}, nil, nil}, - ThreadCallstackCallsiteLeadingAssembly: {ThreadCallstackCallsiteLeadingAssembly, "callsite leading assembly instructions", params.Slice, []string{"thread.callstack.callsite_leading_assembly in ('mov r10,rcx', 'syscall')"}, nil, nil}, - ThreadCallstackCallsiteTrailingAssembly: {ThreadCallstackCallsiteTrailingAssembly, "callsite trailing assembly instructions", params.Slice, []string{"thread.callstack.callsite_trailing_assembly in ('add esp, 0xab')"}, nil, nil}, - ThreadCallstackIsUnbacked: {ThreadCallstackIsUnbacked, "indicates if the callstack contains unbacked regions", params.Bool, []string{"thread.callstack.is_unbacked"}, nil, nil}, - ThreadCallstackAddresses: {ThreadCallstackAddresses, "list of all stack return addresses", params.Slice, []string{"thread.callstack.addresses in ('7ffb5c1d0396')"}, nil, nil}, - ThreadCallstackFinalUserModuleName: {ThreadCallstackFinalUserModuleName, "final user space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_user_module.name != 'ntdll.dll'"}, nil, nil}, - ThreadCallstackFinalUserModulePath: {ThreadCallstackFinalUserModulePath, "final user space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_user_module.path imatches '?:\\Windows\\System32\\ntdll.dll'"}, nil, nil}, - ThreadCallstackFinalUserSymbolName: {ThreadCallstackFinalUserSymbolName, "final user space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_user_symbol.name imatches 'CreateProcess*'"}, nil, nil}, - ThreadCallstackFinalKernelModuleName: {ThreadCallstackFinalKernelModuleName, "final kernel space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_kernel_module.name = 'FLTMGR.SYS'"}, nil, nil}, - ThreadCallstackFinalKernelModulePath: {ThreadCallstackFinalKernelModulePath, "final kernel space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_kernel_module.path imatches '?:\\WINDOWS\\System32\\drivers\\FLTMGR.SYS'"}, nil, nil}, - ThreadCallstackFinalKernelSymbolName: {ThreadCallstackFinalKernelSymbolName, "final kernel space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_kernel_symbol.name = 'FltGetStreamContext'"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureExists: {ThreadCallstackFinalUserModuleSignatureExists, "signature status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.exists = true"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureTrusted: {ThreadCallstackFinalUserModuleSignatureTrusted, "signature trust status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.trusted = true"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureIssuer: {ThreadCallstackFinalUserModuleSignatureIssuer, "final user space stack frame module signature certificate issuer", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.issuer imatches '*Microsoft Corporation*'"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureSubject: {ThreadCallstackFinalUserModuleSignatureSubject, "final user space stack frame module signature certificate subject", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.subject imatches '*Microsoft Windows*'"}, nil, nil}, - ImagePath: {ImagePath, "full image path", params.UnicodeString, []string{"image.path = 'C:\\Windows\\System32\\advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePath}}, nil}, - ImageName: {ImageName, "image name", params.UnicodeString, []string{"image.name = 'advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleName}}, nil}, - ImageBase: {ImageBase, "the base address of process in which the image is loaded", params.Address, []string{"image.base.address = 'a65d800000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleBase}}, nil}, - ImageChecksum: {ImageChecksum, "image checksum", params.Uint32, []string{"image.checksum = 746424"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleChecksum}}, nil}, - ImageSize: {ImageSize, "image size", params.Uint32, []string{"image.size > 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSize}}, nil}, - ImageDefaultAddress: {ImageDefaultAddress, "default image address", params.Address, []string{"image.default.address = '7efe0000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleDefaultAddress}}, nil}, - ImagePID: {ImagePID, "target process identifier", params.Uint32, []string{"image.pid = 80"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePID}}, nil}, - ImageSignatureType: {ImageSignatureType, "image signature type", params.AnsiString, []string{"image.signature.type != 'NONE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureType}}, nil}, - ImageSignatureLevel: {ImageSignatureLevel, "image signature level", params.AnsiString, []string{"image.signature.level = 'AUTHENTICODE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureLevel}}, nil}, - ImageCertSerial: {ImageCertSerial, "image certificate serial number", params.UnicodeString, []string{"image.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSerial}}, nil}, - ImageCertSubject: {ImageCertSubject, "image certificate subject", params.UnicodeString, []string{"image.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSubject}}, nil}, - ImageCertIssuer: {ImageCertIssuer, "image certificate CA", params.UnicodeString, []string{"image.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureIssuer}}, nil}, - ImageCertAfter: {ImageCertAfter, "image certificate expiration date", params.Time, []string{"image.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureAfter}}, nil}, - ImageCertBefore: {ImageCertBefore, "image certificate enrollment date", params.Time, []string{"image.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureBefore}}, nil}, - ImageIsDLL: {ImageIsDLL, "indicates if the loaded image is a DLL", params.Bool, []string{"image.is_dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDLL}}, nil}, - ImageIsDriver: {ImageIsDriver, "indicates if the loaded image is a driver", params.Bool, []string{"image.is_driver'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDriver}}, nil}, - ImageIsExecutable: {ImageIsExecutable, "indicates if the loaded image is an executable", params.Bool, []string{"image.is_exec'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsExecutable}}, nil}, - ImageIsDotnet: {ImageIsDotnet, "indicates if the loaded image is a .NET assembly", params.Bool, []string{"image.is_dotnet'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDotnet}}, nil}, - ModulePath: {ModulePath, "full module path", params.UnicodeString, []string{"module.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, - ModulePathStem: {ModulePathStem, "module path stem", params.UnicodeString, []string{"module.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, - ModuleName: {ModuleName, "module name", params.UnicodeString, []string{"module.name = 'advapi32.dll'"}, nil, nil}, - ModuleBase: {ModuleBase, "the base address of process in which the module is loaded", params.Address, []string{"module.base.address = 'a65d800000'"}, nil, nil}, - ModuleChecksum: {ModuleChecksum, "module checksum", params.Uint32, []string{"module.checksum = 746424"}, nil, nil}, - ModuleSize: {ModuleSize, "module size", params.Uint32, []string{"module.size > 1024"}, nil, nil}, - ModuleDefaultAddress: {ModuleDefaultAddress, "default module address", params.Address, []string{"module.default_address = '7efe0000'"}, nil, nil}, - ModulePID: {ModulePID, "target process identifier", params.Uint32, []string{"module.pid = 80"}, nil, nil}, - ModuleSignatureType: {ModuleSignatureType, "module signature type", params.AnsiString, []string{"module.signature.type != 'NONE'"}, nil, nil}, - ModuleSignatureLevel: {ModuleSignatureLevel, "module signature level", params.AnsiString, []string{"module.signature.level = 'AUTHENTICODE'"}, nil, nil}, - ModuleSignatureExists: {ModuleSignatureExists, "indicates if the module is signed", params.Bool, []string{"module.signature.exists = true"}, nil, nil}, - ModuleSignatureTrusted: {ModuleSignatureTrusted, "indicates if the module signature is trusted", params.Bool, []string{"module.signature.trusted = false"}, nil, nil}, - ModuleSignatureSerial: {ModuleSignatureSerial, "module certificate serial number", params.UnicodeString, []string{"module.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, - ModuleSignatureSubject: {ModuleSignatureSubject, "module certificate subject", params.UnicodeString, []string{"module.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - ModuleSignatureIssuer: {ModuleSignatureIssuer, "module certificate CA", params.UnicodeString, []string{"module.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - ModuleSignatureAfter: {ModuleSignatureAfter, "module certificate expiration date", params.Time, []string{"module.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - ModuleSignatureBefore: {ModuleSignatureBefore, "module certificate enrollment date", params.Time, []string{"module.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - ModuleIsDLL: {ModuleIsDLL, "indicates if the loaded module is a DLL", params.Bool, []string{"module.is_dll'"}, nil, nil}, - ModuleIsDriver: {ModuleIsDriver, "indicates if the loaded module is a driver", params.Bool, []string{"module.is_driver'"}, nil, nil}, - ModuleIsExecutable: {ModuleIsExecutable, "indicates if the loaded module is an executable", params.Bool, []string{"module.is_exec'"}, nil, nil}, - ModuleIsDotnet: {ModuleIsDotnet, "indicates if the loaded module is a .NET assembly", params.Bool, []string{"module.pe.is_dotnet'"}, nil, nil}, - DllPath: {DllPath, "full dll path", params.UnicodeString, []string{"dll.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, - DllPathStem: {DllPathStem, "dll path stem", params.UnicodeString, []string{"dll.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, - DllName: {DllName, "module name", params.UnicodeString, []string{"dll.name = 'advapi32.dll'"}, nil, nil}, - DllBase: {DllBase, "the base address of process in which the DLL is loaded", params.Address, []string{"dll.base = 'a65d800000'"}, nil, nil}, - DllSize: {DllSize, "dll virtual mapped size", params.Uint32, []string{"dll.size > 1024"}, nil, nil}, - DllPID: {DllPID, "target process identifier", params.Uint32, []string{"dll.pid = 80"}, nil, nil}, - DllSignatureType: {DllSignatureType, "dll signature type", params.AnsiString, []string{"dll.signature.type != 'NONE'"}, nil, nil}, - DllSignatureLevel: {DllSignatureLevel, "dll signature level", params.AnsiString, []string{"dll.signature.level = 'AUTHENTICODE'"}, nil, nil}, - DllSignatureExists: {DllSignatureExists, "indicates if the dll is signed", params.Bool, []string{"dll.signature.exists = true"}, nil, nil}, - DllSignatureTrusted: {DllSignatureTrusted, "indicates if the dll signature is trusted", params.Bool, []string{"dll.signature.trusted = false"}, nil, nil}, - DllSignatureSerial: {DllSignatureSerial, "dll certificate serial number", params.UnicodeString, []string{"dll.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, - DllSignatureSubject: {DllSignatureSubject, "dll certificate subject", params.UnicodeString, []string{"dll.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - DllSignatureIssuer: {DllSignatureIssuer, "dll certificate CA", params.UnicodeString, []string{"dll.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - DllSignatureAfter: {DllSignatureAfter, "moddllule certificate expiration date", params.Time, []string{"dll.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - DllSignatureBefore: {DllSignatureBefore, "dll certificate enrollment date", params.Time, []string{"dll.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - DllIsDotnet: {DllIsDotnet, "indicates if the loaded dll is a .NET assembly", params.Bool, []string{"dll.pe.is_dotnet'"}, nil, nil}, - FileObject: {FileObject, "file object address", params.Uint64, []string{"file.object = 18446738026482168384"}, nil, nil}, - FilePath: {FilePath, "full file path", params.UnicodeString, []string{"file.path = 'C:\\Windows\\System32'"}, nil, nil}, - FilePathStem: {FilePathStem, "full file path without extension", params.UnicodeString, []string{"file.path.stem = 'C:\\Windows\\System32\\cmd'"}, nil, nil}, - FileName: {FileName, "full file name", params.UnicodeString, []string{"file.name contains 'mimikatz'"}, nil, nil}, - FileOperation: {FileOperation, "file operation", params.AnsiString, []string{"file.operation = 'open'"}, nil, nil}, - FileShareMask: {FileShareMask, "file share mask", params.AnsiString, []string{"file.share.mask = 'READ'"}, &Deprecation{Since: "3.1.0", Fields: []Field{FileShareMode}}, nil}, - FileShareMode: {FileShareMask, "file share mode", params.AnsiString, []string{"file.share_mode = 'DENY'"}, nil, nil}, - FileIOSize: {FileIOSize, "file I/O size", params.Uint32, []string{"file.io.size > 512"}, nil, nil}, - FileOffset: {FileOffset, "file offset", params.Uint64, []string{"file.offset = 1024"}, nil, nil}, - FileType: {FileType, "file type", params.AnsiString, []string{"file.type = 'directory'"}, nil, nil}, - FileExtension: {FileExtension, "file extension", params.AnsiString, []string{"file.extension = '.dll'"}, nil, nil}, - FileAttributes: {FileAttributes, "file attributes", params.Slice, []string{"file.attributes in ('archive', 'hidden')"}, nil, nil}, - FileStatus: {FileStatus, "file operation status message", params.UnicodeString, []string{"file.status != 'success'"}, nil, nil}, - FileViewBase: {FileViewBase, "view base address", params.Address, []string{"file.view.base = '25d42170000'"}, nil, nil}, - FileViewSize: {FileViewSize, "size of the mapped view", params.Uint64, []string{"file.view.size > 1024"}, nil, nil}, - FileViewType: {FileViewType, "type of the mapped view section", params.Enum, []string{"file.view.type = 'IMAGE'"}, nil, nil}, - FileViewProtection: {FileViewProtection, "protection rights of the section view", params.AnsiString, []string{"file.view.protection = 'READONLY'"}, nil, nil}, - FileIsDLL: {FileIsDLL, "indicates if the created file is a DLL", params.Bool, []string{"file.is_dll'"}, nil, nil}, - FileIsDriver: {FileIsDriver, "indicates if the created file is a driver", params.Bool, []string{"file.is_driver'"}, nil, nil}, - FileIsExecutable: {FileIsExecutable, "indicates if the created file is an executable", params.Bool, []string{"file.is_exec'"}, nil, nil}, - FilePID: {FilePID, "denotes the process id performing file operation", params.PID, []string{"file.pid = 4"}, nil, nil}, - FileKey: {FileKey, "uniquely identifies the file object", params.Uint64, []string{"file.key = 12446738026482168384"}, nil, nil}, - FileInfoClass: {FileInfoClass, "identifies the file information class", params.Enum, []string{"file.info_class = 'Allocation'"}, nil, nil}, - FileInfoAllocationSize: {FileInfoAllocationSize, "file allocation size", params.Uint64, []string{"file.info.allocation_size > 645400"}, nil, nil}, - FileInfoEOFSize: {FileInfoEOFSize, "file EOF size", params.Uint64, []string{"file.info.eof_size > 1000"}, nil, nil}, - FileInfoIsDispositionDeleteFile: {FileInfoIsDispositionDeleteFile, "indicates if the file is deleted when its handle is closed", params.Bool, []string{"file.info.is_disposition_file_delete = true"}, nil, nil}, - RegistryPath: {RegistryPath, "fully qualified registry path", params.UnicodeString, []string{"registry.path = 'HKEY_LOCAL_MACHINE\\SYSTEM'"}, nil, nil}, - RegistryKeyName: {RegistryKeyName, "registry key name", params.UnicodeString, []string{"registry.key.name = 'CurrentControlSet'"}, nil, nil}, - RegistryKCB: {RegistryKCB, "registry KCB address", params.Address, []string{"registry.kcb = 'FFFFB905D60C2268'"}, nil, nil}, - RegistryValue: {RegistryValue, "registry value name", params.UnicodeString, []string{"registry.value = 'Epoch'"}, nil, nil}, - RegistryValueType: {RegistryValueType, "type of registry value", params.UnicodeString, []string{"registry.value.type = 'REG_SZ'"}, nil, nil}, - RegistryData: {RegistryData, "registry value captured data", params.Object, []string{"registry.data = '%SystemRoot%'"}, nil, nil}, - RegistryStatus: {RegistryStatus, "status of registry operation", params.UnicodeString, []string{"registry.status != 'success'"}, nil, nil}, - NetDIP: {NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil}, - NetSIP: {NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil}, - NetDport: {NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil}, - NetSport: {NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil}, - NetDportName: {NetDportName, "destination port name", params.AnsiString, []string{"net.dport.name = 'dns'"}, nil, nil}, - NetSportName: {NetSportName, "source port name", params.AnsiString, []string{"net.sport.name = 'http'"}, nil, nil}, - NetL4Proto: {NetL4Proto, "layer 4 protocol name", params.AnsiString, []string{"net.l4.proto = 'TCP"}, nil, nil}, - NetPacketSize: {NetPacketSize, "packet size", params.Uint32, []string{"net.size > 512"}, nil, nil}, - NetSIPNames: {NetSIPNames, "source IP names", params.Slice, []string{"net.sip.names in ('github.com.')"}, nil, nil}, - NetDIPNames: {NetDIPNames, "destination IP names", params.Slice, []string{"net.dip.names in ('github.com.')"}, nil, nil}, - HandleID: {HandleID, "handle identifier", params.Uint16, []string{"handle.id = 24"}, nil, nil}, - HandleObject: {HandleObject, "handle object address", params.Address, []string{"handle.object = 'FFFFB905DBF61988'"}, nil, nil}, - HandleName: {HandleName, "handle name", params.UnicodeString, []string{"handle.name = '\\Device\\NamedPipe\\chrome.12644.28.105826381'"}, nil, nil}, - HandleType: {HandleType, "handle type", params.AnsiString, []string{"handle.type = 'Mutant'"}, nil, nil}, - PeNumSections: {PeNumSections, "number of sections", params.Uint16, []string{"pe.nsections < 5"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSections}}, nil}, - PeNumSymbols: {PeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"pe.nsymbols > 230"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSymbols}}, nil}, - PeBaseAddress: {PeBaseAddress, "image base address", params.Address, []string{"pe.address.base = '140000000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeBaseAddress}}, nil}, - PeEntrypoint: {PeEntrypoint, "address of the entrypoint function", params.Address, []string{"pe.address.entrypoint = '20110'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeEntrypoint}}, nil}, - PeSymbols: {PeSymbols, "imported symbols", params.Slice, []string{"pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeSymbols}}, nil}, - PeImports: {PeImports, "imported dynamic linked libraries", params.Slice, []string{"pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImports}}, nil}, - PeResources: {PeResources, "version resources", params.Map, []string{"pe.resources[FileDescription] = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeResources}}, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { + }}} + fields[PsPeCompany] = FieldInfo{PsPeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.company = 'Microsoft Corporation'"}, nil, nil} + fields[PsPeCopyright] = FieldInfo{PsPeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"ps.pe.copyright = '© Microsoft Corporation'"}, nil, nil} + fields[PsPeDescription] = FieldInfo{PsPeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.description = 'Notepad'"}, nil, nil} + fields[PsPeFileName] = FieldInfo{PsPeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.name = 'NOTEPAD.EXE'"}, nil, nil} + fields[PsPeFileVersion] = FieldInfo{PsPeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, nil, nil} + fields[PsPeProduct] = FieldInfo{PsPeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product = 'Microsoft® Windows® Operating System'"}, nil, nil} + fields[PsPeProductVersion] = FieldInfo{PsPeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product.version = '10.0.18362.693'"}, nil, nil} + fields[PsPeImphash] = FieldInfo{PsPeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, nil, nil} + fields[PsPeIsDotnet] = FieldInfo{PsPeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"ps.pe.is_dotnet"}, nil, nil} + fields[PsPeAnomalies] = FieldInfo{PsPeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"ps.pe.anomalies in ('number of sections is 0')"}, nil, nil} + fields[PsPeIsModified] = FieldInfo{PsPeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"ps.pe.is_modified"}, nil, nil} + fields[ThreadBasePrio] = FieldInfo{ThreadBasePrio, "scheduler priority of the thread", params.Int8, []string{"thread.prio = 5"}, nil, nil} + fields[ThreadIOPrio] = FieldInfo{ThreadIOPrio, "I/O priority hint for scheduling I/O operations", params.Int8, []string{"thread.io.prio = 4"}, nil, nil} + fields[ThreadPagePrio] = FieldInfo{ThreadPagePrio, "memory page priority hint for memory pages accessed by the thread", params.Int8, []string{"thread.page.prio = 12"}, nil, nil} + fields[ThreadKstackBase] = FieldInfo{ThreadKstackBase, "base address of the thread's kernel space stack", params.Address, []string{"thread.kstack.base = 'a65d800000'"}, nil, nil} + fields[ThreadKstackLimit] = FieldInfo{ThreadKstackLimit, "limit of the thread's kernel space stack", params.Address, []string{"thread.kstack.limit = 'a85d800000'"}, nil, nil} + fields[ThreadUstackBase] = FieldInfo{ThreadUstackBase, "base address of the thread's user space stack", params.Address, []string{"thread.ustack.base = '7ffe0000'"}, nil, nil} + fields[ThreadUstackLimit] = FieldInfo{ThreadUstackLimit, "limit of the thread's user space stack", params.Address, []string{"thread.ustack.limit = '8ffe0000'"}, nil, nil} + fields[ThreadEntrypoint] = FieldInfo{ThreadEntrypoint, "starting address of the function to be executed by the thread", params.Address, []string{"thread.entrypoint = '7efe0000'"}, &Deprecation{Since: "2.3.0", Fields: []Field{ThreadStartAddress}}, nil} + fields[ThreadStartAddress] = FieldInfo{ThreadStartAddress, "thread start address", params.Address, []string{"thread.start_address = '7efe0000'"}, nil, nil} + fields[ThreadStartAddressSymbol] = FieldInfo{ThreadStartAddressSymbol, "thread start address symbol", params.UnicodeString, []string{"thread.start_address.symbol = 'LoadModule'"}, nil, nil} + fields[ThreadStartAddressModule] = FieldInfo{ThreadStartAddressModule, "thread start address module", params.UnicodeString, []string{"thread.start_address.module endswith 'kernel32.dll'"}, nil, nil} + fields[ThreadPID] = FieldInfo{ThreadPID, "the process identifier where the thread is created", params.Uint32, []string{"evt.pid != thread.pid"}, nil, nil} + fields[ThreadTEB] = FieldInfo{ThreadTEB, "the base address of the thread environment block", params.Address, []string{"thread.teb_address = '8f30893000'"}, nil, nil} + fields[ThreadAccessMask] = FieldInfo{ThreadAccessMask, "thread desired access rights", params.AnsiString, []string{"thread.access.mask = '0x1fffff'"}, nil, nil} + fields[ThreadAccessMaskNames] = FieldInfo{ThreadAccessMaskNames, "thread desired access rights as a string list", params.Slice, []string{"thread.access.mask.names in ('IMPERSONATE')"}, nil, nil} + fields[ThreadAccessStatus] = FieldInfo{ThreadAccessStatus, "thread access status", params.UnicodeString, []string{"thread.access.status = 'success'"}, nil, nil} + fields[ThreadCallstackSummary] = FieldInfo{ThreadCallstackSummary, "callstack summary", params.UnicodeString, []string{"thread.callstack.summary contains 'ntdll.dll|KERNELBASE.dll'"}, nil, nil} + fields[ThreadCallstackKernelSummary] = FieldInfo{ThreadCallstackKernelSummary, "kernel thread callstack summary", params.UnicodeString, []string{"thread.callstack.kernel_summary contains 'fileinfo.sys|ntoskrnl.exe|FLTMGR.SYS|ntoskrnl.exe'"}, nil, nil} + fields[ThreadCallstackDetail] = FieldInfo{ThreadCallstackDetail, "detailed information of each stack frame", params.UnicodeString, []string{"thread.callstack.detail contains 'KERNELBASE.dll!CreateProcessW'"}, nil, nil} + fields[ThreadCallstackModules] = FieldInfo{ThreadCallstackModules, "list of modules comprising the callstack", params.Slice, []string{"thread.callstack.modules in ('C:\\WINDOWS\\System32\\KERNELBASE.dll')", "base(thread.callstack.modules[7]) = 'ntdll.dll'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}} + fields[ThreadCallstackSymbols] = FieldInfo{ThreadCallstackSymbols, "list of symbols comprising the callstack", params.Slice, []string{"thread.callstack.symbols in ('ntdll.dll!NtCreateProcess')", "thread.callstack.symbols[3] = 'ntdll!NtCreateProcess'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}} + fields[ThreadCallstackAllocationSizes] = FieldInfo{ThreadCallstackAllocationSizes, "allocation sizes of private pages", params.Slice, []string{"thread.callstack.allocation_sizes > 10000"}, nil, nil} + fields[ThreadCallstackProtections] = FieldInfo{ThreadCallstackProtections, "page protections masks of each frame", params.Slice, []string{"thread.callstack.protections in ('RWX', 'WX')"}, nil, nil} + fields[ThreadCallstackCallsiteLeadingAssembly] = FieldInfo{ThreadCallstackCallsiteLeadingAssembly, "callsite leading assembly instructions", params.Slice, []string{"thread.callstack.callsite_leading_assembly in ('mov r10,rcx', 'syscall')"}, nil, nil} + fields[ThreadCallstackCallsiteTrailingAssembly] = FieldInfo{ThreadCallstackCallsiteTrailingAssembly, "callsite trailing assembly instructions", params.Slice, []string{"thread.callstack.callsite_trailing_assembly in ('add esp, 0xab')"}, nil, nil} + fields[ThreadCallstackIsUnbacked] = FieldInfo{ThreadCallstackIsUnbacked, "indicates if the callstack contains unbacked regions", params.Bool, []string{"thread.callstack.is_unbacked"}, nil, nil} + fields[ThreadCallstackAddresses] = FieldInfo{ThreadCallstackAddresses, "list of all stack return addresses", params.Slice, []string{"thread.callstack.addresses in ('7ffb5c1d0396')"}, nil, nil} + fields[ThreadCallstackFinalUserModuleName] = FieldInfo{ThreadCallstackFinalUserModuleName, "final user space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_user_module.name != 'ntdll.dll'"}, nil, nil} + fields[ThreadCallstackFinalUserModulePath] = FieldInfo{ThreadCallstackFinalUserModulePath, "final user space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_user_module.path imatches '?:\\Windows\\System32\\ntdll.dll'"}, nil, nil} + fields[ThreadCallstackFinalUserSymbolName] = FieldInfo{ThreadCallstackFinalUserSymbolName, "final user space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_user_symbol.name imatches 'CreateProcess*'"}, nil, nil} + fields[ThreadCallstackFinalKernelModuleName] = FieldInfo{ThreadCallstackFinalKernelModuleName, "final kernel space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_kernel_module.name = 'FLTMGR.SYS'"}, nil, nil} + fields[ThreadCallstackFinalKernelModulePath] = FieldInfo{ThreadCallstackFinalKernelModulePath, "final kernel space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_kernel_module.path imatches '?:\\WINDOWS\\System32\\drivers\\FLTMGR.SYS'"}, nil, nil} + fields[ThreadCallstackFinalKernelSymbolName] = FieldInfo{ThreadCallstackFinalKernelSymbolName, "final kernel space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_kernel_symbol.name = 'FltGetStreamContext'"}, nil, nil} + fields[ThreadCallstackFinalUserModuleSignatureExists] = FieldInfo{ThreadCallstackFinalUserModuleSignatureExists, "signature status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.exists = true"}, nil, nil} + fields[ThreadCallstackFinalUserModuleSignatureTrusted] = FieldInfo{ThreadCallstackFinalUserModuleSignatureTrusted, "signature trust status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.trusted = true"}, nil, nil} + fields[ThreadCallstackFinalUserModuleSignatureIssuer] = FieldInfo{ThreadCallstackFinalUserModuleSignatureIssuer, "final user space stack frame module signature certificate issuer", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.issuer imatches '*Microsoft Corporation*'"}, nil, nil} + fields[ThreadCallstackFinalUserModuleSignatureSubject] = FieldInfo{ThreadCallstackFinalUserModuleSignatureSubject, "final user space stack frame module signature certificate subject", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.subject imatches '*Microsoft Windows*'"}, nil, nil} + fields[ImagePath] = FieldInfo{ImagePath, "full image path", params.UnicodeString, []string{"image.path = 'C:\\Windows\\System32\\advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePath}}, nil} + fields[ImageName] = FieldInfo{ImageName, "image name", params.UnicodeString, []string{"image.name = 'advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleName}}, nil} + fields[ImageBase] = FieldInfo{ImageBase, "the base address of process in which the image is loaded", params.Address, []string{"image.base.address = 'a65d800000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleBase}}, nil} + fields[ImageChecksum] = FieldInfo{ImageChecksum, "image checksum", params.Uint32, []string{"image.checksum = 746424"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleChecksum}}, nil} + fields[ImageSize] = FieldInfo{ImageSize, "image size", params.Uint32, []string{"image.size > 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSize}}, nil} + fields[ImageDefaultAddress] = FieldInfo{ImageDefaultAddress, "default image address", params.Address, []string{"image.default.address = '7efe0000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleDefaultAddress}}, nil} + fields[ImagePID] = FieldInfo{ImagePID, "target process identifier", params.Uint32, []string{"image.pid = 80"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePID}}, nil} + fields[ImageSignatureType] = FieldInfo{ImageSignatureType, "image signature type", params.AnsiString, []string{"image.signature.type != 'NONE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureType}}, nil} + fields[ImageSignatureLevel] = FieldInfo{ImageSignatureLevel, "image signature level", params.AnsiString, []string{"image.signature.level = 'AUTHENTICODE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureLevel}}, nil} + fields[ImageCertSerial] = FieldInfo{ImageCertSerial, "image certificate serial number", params.UnicodeString, []string{"image.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSerial}}, nil} + fields[ImageCertSubject] = FieldInfo{ImageCertSubject, "image certificate subject", params.UnicodeString, []string{"image.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSubject}}, nil} + fields[ImageCertIssuer] = FieldInfo{ImageCertIssuer, "image certificate CA", params.UnicodeString, []string{"image.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureIssuer}}, nil} + fields[ImageCertAfter] = FieldInfo{ImageCertAfter, "image certificate expiration date", params.Time, []string{"image.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureAfter}}, nil} + fields[ImageCertBefore] = FieldInfo{ImageCertBefore, "image certificate enrollment date", params.Time, []string{"image.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureBefore}}, nil} + fields[ImageIsDLL] = FieldInfo{ImageIsDLL, "indicates if the loaded image is a DLL", params.Bool, []string{"image.is_dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDLL}}, nil} + fields[ImageIsDriver] = FieldInfo{ImageIsDriver, "indicates if the loaded image is a driver", params.Bool, []string{"image.is_driver'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDriver}}, nil} + fields[ImageIsExecutable] = FieldInfo{ImageIsExecutable, "indicates if the loaded image is an executable", params.Bool, []string{"image.is_exec'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsExecutable}}, nil} + fields[ImageIsDotnet] = FieldInfo{ImageIsDotnet, "indicates if the loaded image is a .NET assembly", params.Bool, []string{"image.is_dotnet'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDotnet}}, nil} + fields[ModulePath] = FieldInfo{ModulePath, "full module path", params.UnicodeString, []string{"module.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil} + fields[ModulePathStem] = FieldInfo{ModulePathStem, "module path stem", params.UnicodeString, []string{"module.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil} + fields[ModuleName] = FieldInfo{ModuleName, "module name", params.UnicodeString, []string{"module.name = 'advapi32.dll'"}, nil, nil} + fields[ModuleBase] = FieldInfo{ModuleBase, "the base address of process in which the module is loaded", params.Address, []string{"module.base.address = 'a65d800000'"}, nil, nil} + fields[ModuleChecksum] = FieldInfo{ModuleChecksum, "module checksum", params.Uint32, []string{"module.checksum = 746424"}, nil, nil} + fields[ModuleSize] = FieldInfo{ModuleSize, "module size", params.Uint32, []string{"module.size > 1024"}, nil, nil} + fields[ModuleDefaultAddress] = FieldInfo{ModuleDefaultAddress, "default module address", params.Address, []string{"module.default_address = '7efe0000'"}, nil, nil} + fields[ModulePID] = FieldInfo{ModulePID, "target process identifier", params.Uint32, []string{"module.pid = 80"}, nil, nil} + fields[ModuleSignatureType] = FieldInfo{ModuleSignatureType, "module signature type", params.AnsiString, []string{"module.signature.type != 'NONE'"}, nil, nil} + fields[ModuleSignatureLevel] = FieldInfo{ModuleSignatureLevel, "module signature level", params.AnsiString, []string{"module.signature.level = 'AUTHENTICODE'"}, nil, nil} + fields[ModuleSignatureExists] = FieldInfo{ModuleSignatureExists, "indicates if the module is signed", params.Bool, []string{"module.signature.exists = true"}, nil, nil} + fields[ModuleSignatureTrusted] = FieldInfo{ModuleSignatureTrusted, "indicates if the module signature is trusted", params.Bool, []string{"module.signature.trusted = false"}, nil, nil} + fields[ModuleSignatureSerial] = FieldInfo{ModuleSignatureSerial, "module certificate serial number", params.UnicodeString, []string{"module.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil} + fields[ModuleSignatureSubject] = FieldInfo{ModuleSignatureSubject, "module certificate subject", params.UnicodeString, []string{"module.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil} + fields[ModuleSignatureIssuer] = FieldInfo{ModuleSignatureIssuer, "module certificate CA", params.UnicodeString, []string{"module.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil} + fields[ModuleSignatureAfter] = FieldInfo{ModuleSignatureAfter, "module certificate expiration date", params.Time, []string{"module.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil} + fields[ModuleSignatureBefore] = FieldInfo{ModuleSignatureBefore, "module certificate enrollment date", params.Time, []string{"module.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil} + fields[ModuleIsDLL] = FieldInfo{ModuleIsDLL, "indicates if the loaded module is a DLL", params.Bool, []string{"module.is_dll'"}, nil, nil} + fields[ModuleIsDriver] = FieldInfo{ModuleIsDriver, "indicates if the loaded module is a driver", params.Bool, []string{"module.is_driver'"}, nil, nil} + fields[ModuleIsExecutable] = FieldInfo{ModuleIsExecutable, "indicates if the loaded module is an executable", params.Bool, []string{"module.is_exec'"}, nil, nil} + fields[ModuleIsDotnet] = FieldInfo{ModuleIsDotnet, "indicates if the loaded module is a .NET assembly", params.Bool, []string{"module.pe.is_dotnet'"}, nil, nil} + fields[DllPath] = FieldInfo{DllPath, "full dll path", params.UnicodeString, []string{"dll.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil} + fields[DllPathStem] = FieldInfo{DllPathStem, "dll path stem", params.UnicodeString, []string{"dll.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil} + fields[DllName] = FieldInfo{DllName, "module name", params.UnicodeString, []string{"dll.name = 'advapi32.dll'"}, nil, nil} + fields[DllBase] = FieldInfo{DllBase, "the base address of process in which the DLL is loaded", params.Address, []string{"dll.base = 'a65d800000'"}, nil, nil} + fields[DllSize] = FieldInfo{DllSize, "dll virtual mapped size", params.Uint32, []string{"dll.size > 1024"}, nil, nil} + fields[DllPID] = FieldInfo{DllPID, "target process identifier", params.Uint32, []string{"dll.pid = 80"}, nil, nil} + fields[DllSignatureType] = FieldInfo{DllSignatureType, "dll signature type", params.AnsiString, []string{"dll.signature.type != 'NONE'"}, nil, nil} + fields[DllSignatureLevel] = FieldInfo{DllSignatureLevel, "dll signature level", params.AnsiString, []string{"dll.signature.level = 'AUTHENTICODE'"}, nil, nil} + fields[DllSignatureExists] = FieldInfo{DllSignatureExists, "indicates if the dll is signed", params.Bool, []string{"dll.signature.exists = true"}, nil, nil} + fields[DllSignatureTrusted] = FieldInfo{DllSignatureTrusted, "indicates if the dll signature is trusted", params.Bool, []string{"dll.signature.trusted = false"}, nil, nil} + fields[DllSignatureSerial] = FieldInfo{DllSignatureSerial, "dll certificate serial number", params.UnicodeString, []string{"dll.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil} + fields[DllSignatureSubject] = FieldInfo{DllSignatureSubject, "dll certificate subject", params.UnicodeString, []string{"dll.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil} + fields[DllSignatureIssuer] = FieldInfo{DllSignatureIssuer, "dll certificate CA", params.UnicodeString, []string{"dll.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil} + fields[DllSignatureAfter] = FieldInfo{DllSignatureAfter, "moddllule certificate expiration date", params.Time, []string{"dll.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil} + fields[DllSignatureBefore] = FieldInfo{DllSignatureBefore, "dll certificate enrollment date", params.Time, []string{"dll.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil} + fields[DllIsDotnet] = FieldInfo{DllIsDotnet, "indicates if the loaded dll is a .NET assembly", params.Bool, []string{"dll.pe.is_dotnet'"}, nil, nil} + fields[FileObject] = FieldInfo{FileObject, "file object address", params.Uint64, []string{"file.object = 18446738026482168384"}, nil, nil} + fields[FilePath] = FieldInfo{FilePath, "full file path", params.UnicodeString, []string{"file.path = 'C:\\Windows\\System32'"}, nil, nil} + fields[FilePathStem] = FieldInfo{FilePathStem, "full file path without extension", params.UnicodeString, []string{"file.path.stem = 'C:\\Windows\\System32\\cmd'"}, nil, nil} + fields[FileName] = FieldInfo{FileName, "full file name", params.UnicodeString, []string{"file.name contains 'mimikatz'"}, nil, nil} + fields[FileOperation] = FieldInfo{FileOperation, "file operation", params.AnsiString, []string{"file.operation = 'open'"}, nil, nil} + fields[FileShareMask] = FieldInfo{FileShareMask, "file share mask", params.AnsiString, []string{"file.share.mask = 'READ'"}, &Deprecation{Since: "3.1.0", Fields: []Field{FileShareMode}}, nil} + fields[FileShareMode] = FieldInfo{FileShareMask, "file share mode", params.AnsiString, []string{"file.share_mode = 'DENY'"}, nil, nil} + fields[FileIOSize] = FieldInfo{FileIOSize, "file I/O size", params.Uint32, []string{"file.io.size > 512"}, nil, nil} + fields[FileOffset] = FieldInfo{FileOffset, "file offset", params.Uint64, []string{"file.offset = 1024"}, nil, nil} + fields[FileType] = FieldInfo{FileType, "file type", params.AnsiString, []string{"file.type = 'directory'"}, nil, nil} + fields[FileExtension] = FieldInfo{FileExtension, "file extension", params.AnsiString, []string{"file.extension = '.dll'"}, nil, nil} + fields[FileAttributes] = FieldInfo{FileAttributes, "file attributes", params.Slice, []string{"file.attributes in ('archive', 'hidden')"}, nil, nil} + fields[FileStatus] = FieldInfo{FileStatus, "file operation status message", params.UnicodeString, []string{"file.status != 'success'"}, nil, nil} + fields[FileViewBase] = FieldInfo{FileViewBase, "view base address", params.Address, []string{"file.view.base = '25d42170000'"}, nil, nil} + fields[FileViewSize] = FieldInfo{FileViewSize, "size of the mapped view", params.Uint64, []string{"file.view.size > 1024"}, nil, nil} + fields[FileViewType] = FieldInfo{FileViewType, "type of the mapped view section", params.Enum, []string{"file.view.type = 'IMAGE'"}, nil, nil} + fields[FileViewProtection] = FieldInfo{FileViewProtection, "protection rights of the section view", params.AnsiString, []string{"file.view.protection = 'READONLY'"}, nil, nil} + fields[FileIsDLL] = FieldInfo{FileIsDLL, "indicates if the created file is a DLL", params.Bool, []string{"file.is_dll'"}, nil, nil} + fields[FileIsDriver] = FieldInfo{FileIsDriver, "indicates if the created file is a driver", params.Bool, []string{"file.is_driver'"}, nil, nil} + fields[FileIsExecutable] = FieldInfo{FileIsExecutable, "indicates if the created file is an executable", params.Bool, []string{"file.is_exec'"}, nil, nil} + fields[FilePID] = FieldInfo{FilePID, "denotes the process id performing file operation", params.PID, []string{"file.pid = 4"}, nil, nil} + fields[FileKey] = FieldInfo{FileKey, "uniquely identifies the file object", params.Uint64, []string{"file.key = 12446738026482168384"}, nil, nil} + fields[FileInfoClass] = FieldInfo{FileInfoClass, "identifies the file information class", params.Enum, []string{"file.info_class = 'Allocation'"}, nil, nil} + fields[FileInfoAllocationSize] = FieldInfo{FileInfoAllocationSize, "file allocation size", params.Uint64, []string{"file.info.allocation_size > 645400"}, nil, nil} + fields[FileInfoEOFSize] = FieldInfo{FileInfoEOFSize, "file EOF size", params.Uint64, []string{"file.info.eof_size > 1000"}, nil, nil} + fields[FileInfoIsDispositionDeleteFile] = FieldInfo{FileInfoIsDispositionDeleteFile, "indicates if the file is deleted when its handle is closed", params.Bool, []string{"file.info.is_disposition_file_delete = true"}, nil, nil} + fields[RegistryPath] = FieldInfo{RegistryPath, "fully qualified registry path", params.UnicodeString, []string{"registry.path = 'HKEY_LOCAL_MACHINE\\SYSTEM'"}, nil, nil} + fields[RegistryKeyName] = FieldInfo{RegistryKeyName, "registry key name", params.UnicodeString, []string{"registry.key.name = 'CurrentControlSet'"}, nil, nil} + fields[RegistryKCB] = FieldInfo{RegistryKCB, "registry KCB address", params.Address, []string{"registry.kcb = 'FFFFB905D60C2268'"}, nil, nil} + fields[RegistryValue] = FieldInfo{RegistryValue, "registry value name", params.UnicodeString, []string{"registry.value = 'Epoch'"}, nil, nil} + fields[RegistryValueType] = FieldInfo{RegistryValueType, "type of registry value", params.UnicodeString, []string{"registry.value.type = 'REG_SZ'"}, nil, nil} + fields[RegistryData] = FieldInfo{RegistryData, "registry value captured data", params.Object, []string{"registry.data = '%SystemRoot%'"}, nil, nil} + fields[RegistryStatus] = FieldInfo{RegistryStatus, "status of registry operation", params.UnicodeString, []string{"registry.status != 'success'"}, nil, nil} + fields[NetDIP] = FieldInfo{NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil} + fields[NetSIP] = FieldInfo{NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil} + fields[NetDport] = FieldInfo{NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil} + fields[NetSport] = FieldInfo{NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil} + fields[NetDportName] = FieldInfo{NetDportName, "destination port name", params.AnsiString, []string{"net.dport.name = 'dns'"}, nil, nil} + fields[NetSportName] = FieldInfo{NetSportName, "source port name", params.AnsiString, []string{"net.sport.name = 'http'"}, nil, nil} + fields[NetL4Proto] = FieldInfo{NetL4Proto, "layer 4 protocol name", params.AnsiString, []string{"net.l4.proto = 'TCP"}, nil, nil} + fields[NetPacketSize] = FieldInfo{NetPacketSize, "packet size", params.Uint32, []string{"net.size > 512"}, nil, nil} + fields[NetSIPNames] = FieldInfo{NetSIPNames, "source IP names", params.Slice, []string{"net.sip.names in ('github.com.')"}, nil, nil} + fields[NetDIPNames] = FieldInfo{NetDIPNames, "destination IP names", params.Slice, []string{"net.dip.names in ('github.com.')"}, nil, nil} + fields[PeNumSections] = FieldInfo{PeNumSections, "number of sections", params.Uint16, []string{"pe.nsections < 5"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSections}}, nil} + fields[PeNumSymbols] = FieldInfo{PeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"pe.nsymbols > 230"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSymbols}}, nil} + fields[PeBaseAddress] = FieldInfo{PeBaseAddress, "image base address", params.Address, []string{"pe.address.base = '140000000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeBaseAddress}}, nil} + fields[PeEntrypoint] = FieldInfo{PeEntrypoint, "address of the entrypoint function", params.Address, []string{"pe.address.entrypoint = '20110'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeEntrypoint}}, nil} + fields[PeSymbols] = FieldInfo{PeSymbols, "imported symbols", params.Slice, []string{"pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeSymbols}}, nil} + fields[PeImports] = FieldInfo{PeImports, "imported dynamic linked libraries", params.Slice, []string{"pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImports}}, nil} + fields[PeResources] = FieldInfo{PeResources, "version resources", params.Map, []string{"pe.resources[FileDescription] = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeResources}}, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { for _, c := range s { switch { case unicode.IsLower(c): @@ -312,53 +303,37 @@ var fields = platformFields(map[Field]FieldInfo{ } } return true - }}}, - PeCompany: {PeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"pe.company = 'Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCompany}}, nil}, - PeCopyright: {PeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"pe.copyright = '© Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCopyright}}, nil}, - PeDescription: {PeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"pe.description = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeDescription}}, nil}, - PeFileName: {PeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"pe.file.name = 'NOTEPAD.EXE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileName}}, nil}, - PeFileVersion: {PeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileVersion}}, nil}, - PeProduct: {PeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"pe.product = 'Microsoft® Windows® Operating System'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProduct}}, nil}, - PeProductVersion: {PeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"pe.product.version = '10.0.18362.693'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProductVersion}}, nil}, - PeIsDLL: {PeIsDLL, "indicates if the loaded image or created file is a DLL", params.Bool, []string{"pe.is_dll'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDLL, ImageIsDLL}}, nil}, - PeIsDriver: {PeIsDriver, "indicates if the loaded image or created file is a driver", params.Bool, []string{"pe.is_driver'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDriver, ImageIsDriver}}, nil}, - PeIsExecutable: {PeIsExecutable, "indicates if the loaded image or created file is an executable", params.Bool, []string{"pe.is_exec'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsExecutable, ImageIsExecutable}}, nil}, - PeImphash: {PeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImphash}}, nil}, - PeIsDotnet: {PeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"pe.is_dotnet"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsDotnet}}, nil}, - PeAnomalies: {PeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"pe.anomalies in ('number of sections is 0')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeAnomalies}}, nil}, - PeIsSigned: {PeIsSigned, "indicates if the PE has embedded or catalog signature", params.Bool, []string{"pe.is_signed"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureExists}}, nil}, - PeIsTrusted: {PeIsTrusted, "indicates if the PE certificate chain is trusted", params.Bool, []string{"pe.is_trusted"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureTrusted}}, nil}, - PeCertSerial: {PeCertSerial, "PE certificate serial number", params.UnicodeString, []string{"pe.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSerial}}, nil}, - PeCertSubject: {PeCertSubject, "PE certificate subject", params.UnicodeString, []string{"pe.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSubject}}, nil}, - PeCertIssuer: {PeCertIssuer, "PE certificate CA", params.UnicodeString, []string{"pe.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureIssuer}}, nil}, - PeCertAfter: {PeCertAfter, "PE certificate expiration date", params.Time, []string{"pe.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureAfter}}, nil}, - PeCertBefore: {PeCertBefore, "PE certificate enrollment date", params.Time, []string{"pe.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureBefore}}, nil}, - PeIsModified: {PeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"pe.is_modified"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsModified}}, nil}, - MemBaseAddress: {MemBaseAddress, "region base address", params.Address, []string{"mem.address = '211d13f2000'"}, nil, nil}, - MemRegionSize: {MemRegionSize, "region size", params.Uint64, []string{"mem.size > 438272"}, nil, nil}, - MemAllocType: {MemAllocType, "region allocation or release type", params.Flags, []string{"mem.alloc = 'COMMIT'"}, nil, nil}, - MemPageType: {MemPageType, "page type of the allocated region", params.Enum, []string{"mem.type = 'PRIVATE'"}, nil, nil}, - MemProtection: {MemProtection, "allocated region protection type", params.Enum, []string{"mem.protection = 'READWRITE'"}, nil, nil}, - MemProtectionMask: {MemProtectionMask, "allocated region protection in mask notation", params.Enum, []string{"mem.protection.mask = 'RWX'"}, nil, nil}, - DNSName: {DNSName, "dns query name", params.UnicodeString, []string{"dns.name = 'example.org'"}, nil, nil}, - DNSRR: {DNSRR, "dns resource record type", params.AnsiString, []string{"dns.rr = 'AA'"}, nil, nil}, - DNSOptions: {DNSOptions, "dns query options", params.Flags64, []string{"dns.options in ('ADDRCONFIG', 'DUAL_ADDR')"}, nil, nil}, - DNSRcode: {DNSRR, "dns response status", params.AnsiString, []string{"dns.rcode = 'NXDOMAIN'"}, nil, nil}, - DNSAnswers: {DNSAnswers, "dns response answers", params.Slice, []string{"dns.answers in ('o.lencr.edgesuite.net', 'a1887.dscq.akamai.net')"}, nil, nil}, - ThreadpoolPoolID: {ThreadpoolPoolID, "thread pool identifier", params.Address, []string{"threadpool.id = '20f5fc02440'"}, nil, nil}, - ThreadpoolTaskID: {ThreadpoolTaskID, "thread pool task identifier", params.Address, []string{"threadpool.task.id = '20f7ecd21f8'"}, nil, nil}, - ThreadpoolCallbackAddress: {ThreadpoolCallbackAddress, "thread pool callback address", params.Address, []string{"threadpool.callback.address = '7ff868739ed0'"}, nil, nil}, - ThreadpoolCallbackSymbol: {ThreadpoolCallbackSymbol, "thread pool callback symbol", params.UnicodeString, []string{"threadpool.callback.symbol = 'RtlDestroyQueryDebugBuffer'"}, nil, nil}, - ThreadpoolCallbackModule: {ThreadpoolCallbackModule, "thread pool module containing the callback symbol", params.UnicodeString, []string{"threadpool.callback.module contains 'ntdll.dll'"}, nil, nil}, - ThreadpoolCallbackContext: {ThreadpoolCallbackContext, "thread pool callback context address", params.Address, []string{"threadpool.callback.context = '1df41e07bd0'"}, nil, nil}, - ThreadpoolCallbackContextRip: {ThreadpoolCallbackContextRip, "thread pool callback thread context instruction pointer", params.Address, []string{"threadpool.callback.context.rip = '1df42ffc1f8'"}, nil, nil}, - ThreadpoolCallbackContextRipSymbol: {ThreadpoolCallbackContextRipSymbol, "thread pool callback thread context instruction pointer symbol", params.UnicodeString, []string{"threadpool.callback.context.rip.symbol = 'VirtualProtect'"}, nil, nil}, - ThreadpoolCallbackContextRipModule: {ThreadpoolCallbackContextRipModule, "thread pool callback thread context instruction pointer symbol module", params.UnicodeString, []string{"threadpool.callback.context.rip.module contains 'ntdll.dll'"}, nil, nil}, - ThreadpoolSubprocessTag: {ThreadpoolSubprocessTag, "thread pool service identifier", params.Address, []string{"threadpool.subprocess_tag = '10d'"}, nil, nil}, - ThreadpoolTimerDuetime: {ThreadpoolTimerDuetime, "thread pool timer due time", params.Uint64, []string{"threadpool.timer.duetime > 10"}, nil, nil}, - ThreadpoolTimerSubqueue: {ThreadpoolTimerSubqueue, "thread pool timer subqueue address", params.Address, []string{"threadpool.timer.subqueue = '1db401703e8'"}, nil, nil}, - ThreadpoolTimer: {ThreadpoolTimer, "thread pool timer address", params.Address, []string{"threadpool.timer.address = '3e8'"}, nil, nil}, - ThreadpoolTimerPeriod: {ThreadpoolTimerPeriod, "thread pool timer period", params.Uint32, []string{"threadpool.timer.period = 0'"}, nil, nil}, - ThreadpoolTimerWindow: {ThreadpoolTimerWindow, "thread pool timer tolerate period", params.Uint32, []string{"threadpool.timer.window = 0'"}, nil, nil}, - ThreadpoolTimerAbsolute: {ThreadpoolTimerAbsolute, "indicates if the thread pool timer is absolute or relative", params.Bool, []string{"threadpool.timer.is_absolute = true'"}, nil, nil}, -}) + }}} + fields[PeCompany] = FieldInfo{PeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"pe.company = 'Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCompany}}, nil} + fields[PeCopyright] = FieldInfo{PeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"pe.copyright = '© Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCopyright}}, nil} + fields[PeDescription] = FieldInfo{PeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"pe.description = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeDescription}}, nil} + fields[PeFileName] = FieldInfo{PeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"pe.file.name = 'NOTEPAD.EXE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileName}}, nil} + fields[PeFileVersion] = FieldInfo{PeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileVersion}}, nil} + fields[PeProduct] = FieldInfo{PeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"pe.product = 'Microsoft® Windows® Operating System'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProduct}}, nil} + fields[PeProductVersion] = FieldInfo{PeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"pe.product.version = '10.0.18362.693'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProductVersion}}, nil} + fields[PeIsDLL] = FieldInfo{PeIsDLL, "indicates if the loaded image or created file is a DLL", params.Bool, []string{"pe.is_dll'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDLL, ImageIsDLL}}, nil} + fields[PeIsDriver] = FieldInfo{PeIsDriver, "indicates if the loaded image or created file is a driver", params.Bool, []string{"pe.is_driver'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDriver, ImageIsDriver}}, nil} + fields[PeIsExecutable] = FieldInfo{PeIsExecutable, "indicates if the loaded image or created file is an executable", params.Bool, []string{"pe.is_exec'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsExecutable, ImageIsExecutable}}, nil} + fields[PeImphash] = FieldInfo{PeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImphash}}, nil} + fields[PeIsDotnet] = FieldInfo{PeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"pe.is_dotnet"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsDotnet}}, nil} + fields[PeAnomalies] = FieldInfo{PeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"pe.anomalies in ('number of sections is 0')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeAnomalies}}, nil} + fields[PeIsSigned] = FieldInfo{PeIsSigned, "indicates if the PE has embedded or catalog signature", params.Bool, []string{"pe.is_signed"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureExists}}, nil} + fields[PeIsTrusted] = FieldInfo{PeIsTrusted, "indicates if the PE certificate chain is trusted", params.Bool, []string{"pe.is_trusted"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureTrusted}}, nil} + fields[PeCertSerial] = FieldInfo{PeCertSerial, "PE certificate serial number", params.UnicodeString, []string{"pe.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSerial}}, nil} + fields[PeCertSubject] = FieldInfo{PeCertSubject, "PE certificate subject", params.UnicodeString, []string{"pe.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSubject}}, nil} + fields[PeCertIssuer] = FieldInfo{PeCertIssuer, "PE certificate CA", params.UnicodeString, []string{"pe.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureIssuer}}, nil} + fields[PeCertAfter] = FieldInfo{PeCertAfter, "PE certificate expiration date", params.Time, []string{"pe.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureAfter}}, nil} + fields[PeCertBefore] = FieldInfo{PeCertBefore, "PE certificate enrollment date", params.Time, []string{"pe.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureBefore}}, nil} + fields[PeIsModified] = FieldInfo{PeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"pe.is_modified"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsModified}}, nil} + fields[MemBaseAddress] = FieldInfo{MemBaseAddress, "region base address", params.Address, []string{"mem.address = '211d13f2000'"}, nil, nil} + fields[MemRegionSize] = FieldInfo{MemRegionSize, "region size", params.Uint64, []string{"mem.size > 438272"}, nil, nil} + fields[MemAllocType] = FieldInfo{MemAllocType, "region allocation or release type", params.Flags, []string{"mem.alloc = 'COMMIT'"}, nil, nil} + fields[MemPageType] = FieldInfo{MemPageType, "page type of the allocated region", params.Enum, []string{"mem.type = 'PRIVATE'"}, nil, nil} + fields[MemProtection] = FieldInfo{MemProtection, "allocated region protection type", params.Enum, []string{"mem.protection = 'READWRITE'"}, nil, nil} + fields[MemProtectionMask] = FieldInfo{MemProtectionMask, "allocated region protection in mask notation", params.Enum, []string{"mem.protection.mask = 'RWX'"}, nil, nil} + fields[DNSName] = FieldInfo{DNSName, "dns query name", params.UnicodeString, []string{"dns.name = 'example.org'"}, nil, nil} + fields[DNSRR] = FieldInfo{DNSRR, "dns resource record type", params.AnsiString, []string{"dns.rr = 'AA'"}, nil, nil} + fields[DNSOptions] = FieldInfo{DNSOptions, "dns query options", params.Flags64, []string{"dns.options in ('ADDRCONFIG', 'DUAL_ADDR')"}, nil, nil} + fields[DNSRcode] = FieldInfo{DNSRR, "dns response status", params.AnsiString, []string{"dns.rcode = 'NXDOMAIN'"}, nil, nil} + fields[DNSAnswers] = FieldInfo{DNSAnswers, "dns response answers", params.Slice, []string{"dns.answers in ('o.lencr.edgesuite.net', 'a1887.dscq.akamai.net')"}, nil, nil} +} diff --git a/pkg/filter/fields/fields_windows.go b/pkg/filter/fields/fields_windows.go deleted file mode 100644 index 155eaa2e9..000000000 --- a/pkg/filter/fields/fields_windows.go +++ /dev/null @@ -1,1238 +0,0 @@ -/* - * Copyright 2019-2020 by Nedim Sabic Sabic - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package fields - -import ( - "strings" - "unicode" - - "github.com/rabbitstack/fibratus/pkg/event/params" -) - -// Field represents the type alias for the field -type Field string - -const ( - // PsPid represents the process id field - PsPid Field = "ps.pid" - // PsPpid represents the parent process id field - PsPpid Field = "ps.ppid" - // PsName represents the process name field - PsName Field = "ps.name" - // PsComm represents the process command line field. Deprecated. - PsComm Field = "ps.comm" - // PsCmdline represents the process command line field - PsCmdline Field = "ps.cmdline" - // PsExe represents the process image path field - PsExe Field = "ps.exe" - // PsArgs represents the process command line arguments - PsArgs Field = "ps.args" - // PsCwd represents the process current working directory - PsCwd Field = "ps.cwd" - // PsSID represents the process security identifier - PsSID Field = "ps.sid" - // PsDomain represents the process domain field - PsDomain Field = "ps.domain" - // PsUsername represents the process username field - PsUsername Field = "ps.username" - // PsSessionID represents the session id bound to the process - PsSessionID Field = "ps.sessionid" - // PsEnvs represents the process environment variables - PsEnvs Field = "ps.envs" - // PsHandleNames represents the process handles - PsHandleNames Field = "ps.handles" - // PsHandleTypes represents the process handle types - PsHandleTypes Field = "ps.handle.types" - // PsDTB represents the process directory table base address - PsDTB Field = "ps.dtb" - // PsModuleNames represents the process module file names - PsModuleNames Field = "ps.modules" - // PsParentPid represents the parent process identifier field - PsParentPid Field = "ps.parent.pid" - // PsParentName represents the parent process name field - PsParentName Field = "ps.parent.name" - // PsParentComm represents the parent process command line field. Deprecated - PsParentComm Field = "ps.parent.comm" - // PsParentCmdline represents the parent process command line field - PsParentCmdline Field = "ps.parent.cmdline" - // PsParentExe represents the parent process image path field - PsParentExe Field = "ps.parent.exe" - // PsParentArgs represents the parent process command line arguments field - PsParentArgs Field = "ps.parent.args" - // PsParentCwd represents the parent process current working directory field - PsParentCwd Field = "ps.parent.cwd" - // PsParentSID represents the parent process security identifier field - PsParentSID Field = "ps.parent.sid" - // PsParentUsername represents the parent process username field - PsParentUsername Field = "ps.parent.username" - // PsParentDomain represents the parent process domain field - PsParentDomain Field = "ps.parent.domain" - // PsParentSessionID represents the session id field bound to the parent process - PsParentSessionID Field = "ps.parent.sessionid" - // PsParentEnvs represents the parent process environment variables field - PsParentEnvs Field = "ps.parent.envs" - // PsParentHandles represents the parent process handles field - PsParentHandles Field = "ps.parent.handles" - // PsParentHandleTypes represents the parent process handle types field - PsParentHandleTypes Field = "ps.parent.handle.types" - // PsParentDTB represents the parent process directory table base address field - PsParentDTB Field = "ps.parent.dtb" - // PsAncestor represents the process ancestor field - PsAncestor Field = "ps.ancestor" - // PsAccessMask represents the process access rights field - PsAccessMask Field = "ps.access.mask" - // PsAccessMaskNames represents the process access rights list field - PsAccessMaskNames Field = "ps.access.mask.names" - // PsAccessStatus represents the process access status field - PsAccessStatus Field = "ps.access.status" - // PsIsWOW64Field represents the field that indicates if the 32-bit process is created in 64-bit Windows system - PsIsWOW64Field Field = "ps.is_wow64" - // PsIsPackagedField represents the field that indicates if a process is packaged with the MSIX technology - PsIsPackagedField Field = "ps.is_packaged" - // PsIsProtectedField represents the field that indicates if the process is to be run as a protected process - PsIsProtectedField Field = "ps.is_protected" - // PsParentIsWOW64Field represents the field that indicates if the 32-bit process is created in 64-bit Windows system - PsParentIsWOW64Field Field = "ps.parent.is_wow64" - // PsParentIsPackagedField represents the field that indicates if a process is packaged with the MSIX technology - PsParentIsPackagedField Field = "ps.parent.is_packaged" - // PsParentIsProtectedField represents the field that indicates if the process is to be run as a protected process - PsParentIsProtectedField Field = "ps.parent.is_protected" - // PsUUID represents the unique process identifier - PsUUID Field = "ps.uuid" - // PsParentUUID represents the unique parent process identifier - PsParentUUID Field = "ps.parent.uuid" - // PsTokenIntegrityLevel represents the field that indicates the current process integrity level - PsTokenIntegrityLevel = "ps.token.integrity_level" - // PsTokenIsElevated represents the field that indicates if the current process token is elevated - PsTokenIsElevated = "ps.token.is_elevated" - // PsTokenElevationType represents the field that indicates if the current process token elevation type - PsTokenElevationType = "ps.token.elevation_type" - // PsParentTokenIntegrityLevel represents the field that indicates the parent process integrity level - PsParentTokenIntegrityLevel = "ps.parent.token.integrity_level" - // PsParentTokenIsElevated represents the field that indicates if the parent process token is elevated - PsParentTokenIsElevated = "ps.parent.token.is_elevated" - // PsTokenElevationType represents the field that indicates if the parent process token elevation type - PsParentTokenElevationType = "ps.parent.token.elevation_type" - // PsSignatureExists is the field which indicates if the binary is signed, either by embedded or catalog signature - PsSignatureExists Field = "ps.signature.exists" - // PsSignatureTrusted is the field which indicates if the binary signature is trusted - PsSignatureTrusted Field = "ps.signature.trusted" - // PsSignatureIssuer is the field which indicates the certificate issuer - PsSignatureIssuer Field = "ps.signature.issuer" - // PsSignatureSubject is the field which indicates the certificate subject - PsSignatureSubject Field = "ps.signature.subject" - // PsSignatureSerial is the field which indicates the certificate serial - PsSignatureSerial Field = "ps.signature.serial" - // PsSignatureAfter is the field which indicates the timestamp after certificate is no longer valid - PsSignatureAfter Field = "ps.signature.after" - // PsSignatureBefore is the field which indicates the timestamp of the certificate enrollment date - PsSignatureBefore Field = "ps.signature.before" - - // PsPeNumSections represents the number of sections - PsPeNumSections Field = "ps.pe.nsections" - // PsPeNumSymbols represents the number of exported symbols - PsPeNumSymbols Field = "ps.pe.nsymbols" - // PsPeSymbols represents imported symbols - PsPeSymbols Field = "ps.pe.symbols" - // PeImports represents imported libraries (e.g. kernel32.dll) - PsPeImports Field = "ps.pe.imports" - // PeTimestamp is the PE build timestamp - PsPeTimestamp Field = "ps.pe.timestamp" - // PeBaseAddress represents the base address when the binary is loaded - PsPeBaseAddress Field = "ps.pe.address.base" - // PeEntrypoint is the address of the entrypoint function - PsPeEntrypoint Field = "ps.pe.address.entrypoint" - // PeResources represents PE resources - PsPeResources Field = "ps.pe.resources" - // PeCompany represents the company name resource - PsPeCompany Field = "ps.pe.company" - // PeDescription represents the internal description of the file - PsPeDescription Field = "ps.pe.description" - // PeFileVersion represents the internal file version - PsPeFileVersion Field = "ps.pe.file.version" - // PeFileName represents the original file name provided at compile-time. - PsPeFileName Field = "ps.pe.file.name" - // PeCopyright represents the copyright notice emitted at compile-time - PsPeCopyright Field = "ps.pe.copyright" - // PeProduct represents the product name provided at compile-time - PsPeProduct Field = "ps.pe.product" - // PeProductVersion represents the internal product version provided at compile-time - PsPeProductVersion Field = "ps.pe.product.version" - // PeAnomalies represents the field that contains PE anomalies detected during parsing - PsPeAnomalies Field = "ps.pe.anomalies" - // PsPeImphash is the field that yields the PE import hash - PsPeImphash Field = "ps.pe.imphash" - // PsPeIsDotnet is the field which indicates if the binary contains the .NET assembly - PsPeIsDotnet Field = "ps.pe.is_dotnet" - // PsPeIsModified is the field that indicates whether disk and in-memory PE headers differ - PsPeIsModified Field = "ps.pe.is_modified" - - // ThreadBasePrio is the base thread priority - ThreadBasePrio Field = "thread.prio" - // ThreadIOPrio is the thread I/O priority - ThreadIOPrio Field = "thread.io.prio" - // ThreadPagePrio is the thread page priority - ThreadPagePrio Field = "thread.page.prio" - // ThreadKstackBase is the thread kernel stack start address - ThreadKstackBase Field = "thread.kstack.base" - // ThreadKstackLimit is the thread kernel stack end address - ThreadKstackLimit Field = "thread.kstack.limit" - // ThreadUstackBase is the thread user stack start address - ThreadUstackBase Field = "thread.ustack.base" - // ThreadUstackLimit is the thead user stack end address - ThreadUstackLimit Field = "thread.ustack.limit" - // ThreadEntrypoint is the thread entrypoint address - ThreadEntrypoint Field = "thread.entrypoint" - // ThreadStartAddress is the thread start address - ThreadStartAddress Field = "thread.start_address" - // ThreadPID is the process identifier where the thread is created - ThreadPID Field = "thread.pid" - // ThreadTEB is the thread environment block base address - ThreadTEB Field = "thread.teb_address" - // ThreadAccessMask represents the thread access rights field - ThreadAccessMask Field = "thread.access.mask" - // ThreadAccessMaskNames represents the thread access rights list field - ThreadAccessMaskNames Field = "thread.access.mask.names" - // ThreadAccessStatus represents the thread access status field - ThreadAccessStatus Field = "thread.access.status" - // ThreadCallstackSummary represents the thread callstack summary field - ThreadCallstackSummary Field = "thread.callstack.summary" - // ThreadCallstackKernelSummary represents the kernel thread callstack summary field - ThreadCallstackKernelSummary Field = "thread.callstack.kernel_summary" - // ThreadCallstackDetail represents the thread callstack detail field - ThreadCallstackDetail Field = "thread.callstack.detail" - // ThreadCallstackModules represents the callstack modules field - ThreadCallstackModules Field = "thread.callstack.modules" - // ThreadCallstackSymbols represents the callstack symbols field - ThreadCallstackSymbols Field = "thread.callstack.symbols" - // ThreadCallstackProtections represents the callstack region protections field - ThreadCallstackProtections Field = "thread.callstack.protections" - // ThreadCallstackAllocationSizes represents the private region page sizes field - ThreadCallstackAllocationSizes Field = "thread.callstack.allocation_sizes" - // ThreadCallstackCallsiteLeadingAssembly represents the callsite prelude opcodes field - ThreadCallstackCallsiteLeadingAssembly Field = "thread.callstack.callsite_leading_assembly" - // ThreadCallstackCallsiteTrailingAssembly represents the callsite postlude opcodes field - ThreadCallstackCallsiteTrailingAssembly Field = "thread.callstack.callsite_trailing_assembly" - // ThreadCallstackIsUnbacked represents the field that indicates if there is an unbacked stack frame - ThreadCallstackIsUnbacked Field = "thread.callstack.is_unbacked" - // ThreadStartAddressSymbol represents the symbol corresponding to the thread start address - ThreadStartAddressSymbol Field = "thread.start_address.symbol" - // ThreadStartAddressModule represents the module corresponding to the thread start address - ThreadStartAddressModule Field = "thread.start_address.module" - // ThreadCallstackAddresses represents the all callstack return addresses - ThreadCallstackAddresses Field = "thread.callstack.addresses" - // ThreadCallstackFinalUserModuleName represents the final user space stack frame module name - ThreadCallstackFinalUserModuleName Field = "thread.callstack.final_user_module.name" - // ThreadCallstackFinalUserModulePath represents the final user space stack frame module path - ThreadCallstackFinalUserModulePath Field = "thread.callstack.final_user_module.path" - // ThreadCallstackFinalUserSymbolName represents the final user space stack frame symbol name - ThreadCallstackFinalUserSymbolName Field = "thread.callstack.final_user_symbol.name" - // ThreadCallstackFinalKernelModuleName represents the final kernel space stack frame module name - ThreadCallstackFinalKernelModuleName Field = "thread.callstack.final_kernel_module.name" - // ThreadCallstackFinalKernelModulePath represents the final kernel space stack frame module name - ThreadCallstackFinalKernelModulePath Field = "thread.callstack.final_kernel_module.path" - // ThreadCallstackFinalKernelSymbolName represents the final kernel space stack frame symbol name - ThreadCallstackFinalKernelSymbolName Field = "thread.callstack.final_kernel_symbol.name" - // ThreadCallstackFinalUserModuleSignatureExists represents the signature status of the final user space stack frame module - ThreadCallstackFinalUserModuleSignatureExists Field = "thread.callstack.final_user_module.signature.exists" - // ThreadCallstackFinalUserModuleSignatureTrusted represents the trust status of the final user space stack frame module signature - ThreadCallstackFinalUserModuleSignatureTrusted Field = "thread.callstack.final_user_module.signature.trusted" - // ThreadCallstackFinalUserModuleSignatureIssuer represents the final user space stack frame module certificate issuer - ThreadCallstackFinalUserModuleSignatureIssuer Field = "thread.callstack.final_user_module.signature.issuer" - // ThreadCallstackFinalUserModuleSignatureSubject represents the final user space stack frame module certificate subject - ThreadCallstackFinalUserModuleSignatureSubject Field = "thread.callstack.final_user_module.signature.subject" - - // PeNumSections represents the number of sections - PeNumSections Field = "pe.nsections" - // PeNumSymbols represents the number of exported symbols - PeNumSymbols Field = "pe.nsymbols" - // PeSymbols represents imported symbols - PeSymbols Field = "pe.symbols" - // PeImports represents imported libraries (e.g. kernel32.dll) - PeImports Field = "pe.imports" - // PeTimestamp is the PE build timestamp - PeTimestamp Field = "pe.timestamp" - // PeBaseAddress represents the base address when the binary is loaded - PeBaseAddress Field = "pe.address.base" - // PeEntrypoint is the address of the entrypoint function - PeEntrypoint Field = "pe.address.entrypoint" - // PeResources represents PE resources - PeResources Field = "pe.resources" - // PeCompany represents the company name resource - PeCompany Field = "pe.company" - // PeDescription represents the internal description of the file - PeDescription Field = "pe.description" - // PeFileVersion represents the internal file version - PeFileVersion Field = "pe.file.version" - // PeFileName represents the original file name provided at compile-time. - PeFileName Field = "pe.file.name" - // PeCopyright represents the copyright notice emitted at compile-time - PeCopyright Field = "pe.copyright" - // PeProduct represents the product name provided at compile-time - PeProduct Field = "pe.product" - // PeProductVersion represents the internal product version provided at compile-time - PeProductVersion Field = "pe.product.version" - // PeIsDLL indicates if the file is a DLL - PeIsDLL Field = "pe.is_dll" - // PeIsDriver indicates if the file is a driver - PeIsDriver Field = "pe.is_driver" - // PeIsExecutable indicates if the file is an executable - PeIsExecutable Field = "pe.is_exec" - // PeAnomalies represents the field that contains PE anomalies detected during parsing - PeAnomalies Field = "pe.anomalies" - // PeImphash is the field that yields the PE import hash - PeImphash Field = "pe.imphash" - // PeIsDotnet is the field which indicates if the binary contains the .NET assembly - PeIsDotnet Field = "pe.is_dotnet" - // PeIsSigned is the field which indicates if the binary is signed, either by embedded or catalog signature - PeIsSigned Field = "pe.is_signed" - // PeIsTrusted is the field which indicates if the binary signature is trusted - PeIsTrusted Field = "pe.is_trusted" - // PeCertIssuer is the field which indicates the certificate issuer - PeCertIssuer Field = "pe.cert.issuer" - // PeCertSubject is the field which indicates the certificate subject - PeCertSubject Field = "pe.cert.subject" - // PeCertSerial is the field which indicates the certificate serial - PeCertSerial Field = "pe.cert.serial" - // PeCertAfter is the field which indicates the timestamp after certificate is no longer valid - PeCertAfter Field = "pe.cert.after" - // PeCertBefore is the field which indicates the timestamp of the certificate enrollment date - PeCertBefore Field = "pe.cert.before" - // PeIsModified is the field that indicates whether disk and in-memory PE headers differ - PeIsModified Field = "pe.is_modified" - - // EvtSeq is the event sequence number - EvtSeq Field = "evt.seq" - // EvtPID is the process identifier that generated the event - EvtPID Field = "evt.pid" - // EvtTID is the thread identifier that generated the event - EvtTID Field = "evt.tid" - // EvtCPU is the CPU core where the event was generated - EvtCPU Field = "evt.cpu" - // EvtDesc represents the event description - EvtDesc Field = "evt.desc" - // EvtHost represents the host where the event was produced - EvtHost Field = "evt.host" - // EvtTime is the event time - EvtTime Field = "evt.time" - // EvtTimeHour is the hour part of the event time - EvtTimeHour Field = "evt.time.h" - // EvtTimeMin is the minute part of the event time - EvtTimeMin Field = "evt.time.m" - // EvtTimeSec is the second part of the event time - EvtTimeSec Field = "evt.time.s" - // EvtTimeNs is the nanosecond part of the event time - EvtTimeNs Field = "evt.time.ns" - // EvtDate is the event date - EvtDate Field = "evt.date" - // EvtDateDay is the day of event date - EvtDateDay Field = "evt.date.d" - // EvtDateMonth is the month of event date - EvtDateMonth Field = "evt.date.m" - // EvtDateYear is the year of event date - EvtDateYear Field = "evt.date.y" - // EvtDateTz is the time zone of event timestamp - EvtDateTz Field = "evt.date.tz" - // EvtDateWeek is the event week number - EvtDateWeek Field = "evt.date.week" - // EvtDateWeekday is the event week day - EvtDateWeekday Field = "evt.date.weekday" - // EvtName is the event name - EvtName Field = "evt.name" - // EvtCategory is the event category - EvtCategory Field = "evt.category" - // EvtNparams is the number of event parameters - EvtNparams Field = "evt.nparams" - // EvtArg represents the field sequence for generic argument access - EvtArg Field = "evt.arg" - // EvtIsDirectSyscall represents the field that designates if this event is - // performing a direct syscall. - EvtIsDirectSyscall Field = "evt.is_direct_syscall" - // EvtIsIndirectSyscall represents the field that designates if this event is - // performing an indirect syscall. - EvtIsIndirectSyscall Field = "evt.is_indirect_syscall" - - // KevtSeq is the event sequence number - KevtSeq Field = "kevt.seq" - // KevtPID is the process identifier that generated the event - KevtPID Field = "kevt.pid" - // KevtTID is the thread identifier that generated the event - KevtTID Field = "kevt.tid" - // KevtCPU is the CPU core where the event was generated - KevtCPU Field = "kevt.cpu" - // KevtDesc represents the event description - KevtDesc Field = "kevt.desc" - // KevtHost represents the host where the event was produced - KevtHost Field = "kevt.host" - // KevtTime is the event time - KevtTime Field = "kevt.time" - // KevtTimeHour is the hour part of the event time - KevtTimeHour Field = "kevt.time.h" - // KevtTimeMin is the minute part of the event time - KevtTimeMin Field = "kevt.time.m" - // KevtTimeSec is the second part of the event time - KevtTimeSec Field = "kevt.time.s" - // KevtTimeNs is the nanosecond part of the event time - KevtTimeNs Field = "kevt.time.ns" - // KevtDate is the event date - KevtDate Field = "kevt.date" - // KevtDateDay is the day of event date - KevtDateDay Field = "kevt.date.d" - // KevtDateMonth is the month of event date - KevtDateMonth Field = "kevt.date.m" - // KevtDateYear is the year of event date - KevtDateYear Field = "kevt.date.y" - // KevtDateTz is the time zone of event timestamp - KevtDateTz Field = "kevt.date.tz" - // KevtDateWeek is the event week number - KevtDateWeek Field = "kevt.date.week" - // KevtDateWeekday is the event week day - KevtDateWeekday Field = "kevt.date.weekday" - // KevtName is the event name - KevtName Field = "kevt.name" - // KevtCategory is the event category - KevtCategory Field = "kevt.category" - // KevtNparams is the number of event parameters - KevtNparams Field = "kevt.nparams" - // KevtArg represents the field sequence for generic argument access - KevtArg Field = "kevt.arg" - - // NetDIP represents network destination IP address - NetDIP Field = "net.dip" - // NetSIP represents the source IP address - NetSIP Field = "net.sip" - // NetDport represents the destination port - NetDport Field = "net.dport" - // NetSport represents the source port - NetSport Field = "net.sport" - // NetDportName represents the destination port IANA name - NetDportName Field = "net.dport.name" - // NetSportName represents the source port IANA name - NetSportName Field = "net.sport.name" - // NetL4Proto represents the Layer4 protocol name (e.g. TCP) - NetL4Proto Field = "net.l4.proto" - // NetPacketSize represents the packet size - NetPacketSize Field = "net.size" - // NetSIPNames represents the source IP names - NetSIPNames Field = "net.sip.names" - // NetDIPNames represents the destination IP names - NetDIPNames Field = "net.dip.names" - - // FileObject represents the address of the file object - FileObject Field = "file.object" - // FileName represents the file base name (e.g. cmd.exe) - FileName Field = "file.name" - // FilePath represents the file full path (e.g. C:\Windows\System32\cmd.exe) - FilePath Field = "file.path" - // FilePathStem represents the full file path without extension (e.g. C:\Windows\System32\cmd) - FilePathStem Field = "file.path.stem" - // FileExtension represents the file extension (e.g. .exe or .dll) - FileExtension Field = "file.extension" - // FileOperation represents the file operation (e.g. create) - FileOperation Field = "file.operation" - // FileShareMask represents the file share mask - FileShareMask Field = "file.share.mask" - // FileShareMode represents the file share mode field - FileShareMode Field = "file.share_mode" - // FileIOSize represents the number of read/written bytes - FileIOSize Field = "file.io.size" - // FileOffset represents the read/write offset - FileOffset Field = "file.offset" - // FileType represents the file type - FileType Field = "file.type" - // FileAttributes represents a slice of file attributes - FileAttributes Field = "file.attributes" - // FileStatus represents the status message of the file operation - FileStatus Field = "file.status" - // FileViewBase represents the base address of the mapped view - FileViewBase Field = "file.view.base" - // FileViewSize represents the size of the mapped view - FileViewSize Field = "file.view.size" - // FileViewType represents the type of the mapped view section - FileViewType Field = "file.view.type" - // FileViewProtection represents the protection attributes of the section view - FileViewProtection Field = "file.view.protection" - // FileIsDLL indicates if the created file is a DLL - FileIsDLL Field = "file.is_dll" - // FileIsDriver indicates if the created file is a driver - FileIsDriver Field = "file.is_driver" - // FileIsExecutable indicates if the created file is an executable - FileIsExecutable Field = "file.is_exec" - // FilePID represents the field that denotes the process id performing file operations - FilePID Field = "file.pid" - // FileKey represents the field that uniquely identifies the file object. - FileKey Field = "file.key" - // FileInfoClass represents the field that identifies the file information class - FileInfoClass Field = "file.info_class" - // FileInfoAllocationSize represents the field that contains the file allocation size - FileInfoAllocationSize Field = "file.info.allocation_size" - // FileInfoEOFSize represents the field that contains the EOF size - FileInfoEOFSize Field = "file.info.eof_size" - // FileInfoIsDispositionDeleteFile represents the field that indicates if the file is deleted when its handle is closed - FileInfoIsDispositionDeleteFile Field = "file.info.is_disposition_delete_file" - - // RegistryPath represents the full registry path - RegistryPath Field = "registry.path" - // RegistryKeyName represents the registry key name - RegistryKeyName Field = "registry.key.name" - // RegistryKCB represents the registry KCB address - RegistryKCB Field = "registry.kcb" - // RegistryValue represents the registry value name field - RegistryValue Field = "registry.value" - // RegistryValueType represents the registry value type field - RegistryValueType Field = "registry.value.type" - // RegistryData represents the captured registry data field - RegistryData Field = "registry.data" - // RegistryStatus represent the registry operation status - RegistryStatus Field = "registry.status" - - // ImageBase is the module base address - ImageBase Field = "image.base.address" - // ImageSize is the module size - ImageSize Field = "image.size" - // ImageChecksum represents the module checksum hash - ImageChecksum Field = "image.checksum" - // ImageDefaultAddress represents the module address - ImageDefaultAddress Field = "image.default.address" - // ImagePath is the module full path - ImagePath Field = "image.path" - // ImageName is the module name - ImageName Field = "image.name" - // ImagePID is the pid of the process where the image was loaded - ImagePID Field = "image.pid" - // ImageSignatureType represents the image signature type - ImageSignatureType Field = "image.signature.type" - // ImageSignatureLevel represents the image signature level - ImageSignatureLevel Field = "image.signature.level" - // ImageCertSubject is the field that indicates the subject of the certificate is the entity its public key is associated with. - ImageCertSubject = "image.cert.subject" - // ImageCertIssuer is the field that represents the certificate authority (CA). - ImageCertIssuer = "image.cert.issuer" - // ImageCertSerial is the field that represents the serial number MUST be a positive integer assigned - // by the CA to each certificate. - ImageCertSerial = "image.cert.serial" - // ImageCertBefore is the field that specifies the certificate won't be valid before this timestamp. - ImageCertBefore = "image.cert.before" - // ImageCertAfter is the field that specifies the certificate won't be valid after this timestamp. - ImageCertAfter = "image.cert.after" - // ImageIsDLL indicates if the loaded image is a DLL - ImageIsDLL Field = "image.is_dll" - // ImageIsDriver indicates if the loaded image is a driver - ImageIsDriver Field = "image.is_driver" - // ImageIsExecutable indicates if the loaded image is an executable - ImageIsExecutable Field = "image.is_exec" - // ImageIsDotnet indicates if the loaded image is a .NET assembly - ImageIsDotnet Field = "image.is_dotnet" - - // DllBase is the DLL base address - DllBase Field = "dll.base" - // DllSize is the DLL virtual mapped space size - DllSize Field = "dll.size" - // DllPath is the DLL full path - DllPath Field = "dll.path" - // DllPath is the DLL path stem field - DllPathStem Field = "dll.path.stem" - // DllName is the DLL name - DllName Field = "dll.name" - // DllPID is the pid of the process where the DLL was loaded - DllPID Field = "dll.pid" - // DllSignatureType represents the DLL signature type - DllSignatureType Field = "dll.signature.type" - // DllSignatureLevel represents the DLL signature level - DllSignatureLevel Field = "dll.signature.level" - // DllSignatureExists is the field that determines if the DLL signature exists - DllSignatureExists Field = "dll.signature.exists" - // DllSignatureTrusted is the filed that determines if the DLL signature is trusted - DllSignatureTrusted Field = "dll.signature.trusted" - // DllSignatureSubject is the field that indicates the subject of the certificate is the entity its public key is associated with. - DllSignatureSubject = "dll.signature.subject" - // DllSignatureIssuer is the field that represents the certificate authority (CA). - DllSignatureIssuer = "dll.signature.issuer" - // DllSignatureSerial is the field that represents the serial number MUST be a positive integer assigned - // by the CA to each certificate. - DllSignatureSerial = "dll.signature.serial" - // DllSignatureBefore is the field that specifies the certificate won't be valid before this timestamp. - DllSignatureBefore = "dll.signature.before" - // DllSignatureAfter is the field that specifies the certificate won't be valid after this timestamp. - DllSignatureAfter = "dll.signature.after" - // DllIsDotnet indicates if the DLL is a .NET assembly. - DllIsDotnet Field = "dll.pe.is_dotnet" - - // ModuleBase is the module base address - ModuleBase Field = "module.base" - // ModuleSize is the module size - ModuleSize Field = "module.size" - // ModuleChecksum represents the module checksum hash - ModuleChecksum Field = "module.checksum" - // ModuleDefaultAddress represents the module address - ModuleDefaultAddress Field = "module.default_address" - // ModulePath is the module full path - ModulePath Field = "module.path" - // ModulePathStem is the module path stem field - ModulePathStem Field = "module.path.stem" - // ModuleName is the module name - ModuleName Field = "module.name" - // ModulePID is the pid of the process where the module was loaded - ModulePID Field = "module.pid" - // ModuleSignatureType represents the module signature type - ModuleSignatureType Field = "module.signature.type" - // ModuleSignatureLevel represents the module signature level - ModuleSignatureLevel Field = "module.signature.level" - // ModuleSignatureExists is the field that determines if the module signature exists - ModuleSignatureExists Field = "module.signature.exists" - // ModuleSignatureTrusted is the filed that determines if the module signature is trusted - ModuleSignatureTrusted Field = "module.signature.trusted" - // ModuleSignatureSubject is the field that indicates the subject of the certificate is the entity its public key is associated with. - ModuleSignatureSubject = "module.signature.subject" - // ModuleSignatureIssuer is the field that represents the certificate authority (CA). - ModuleSignatureIssuer = "module.signature.issuer" - // ModuleSignatureSerial is the field that represents the serial number MUST be a positive integer assigned - // by the CA to each certificate. - ModuleSignatureSerial = "module.signature.serial" - // ModuleSignatureBefore is the field that specifies the certificate won't be valid before this timestamp. - ModuleSignatureBefore = "module.signature.before" - // ModuleSignatureAfter is the field that specifies the certificate won't be valid after this timestamp. - ModuleSignatureAfter = "module.signature.after" - // ModuleIsDLL indicates if the loaded module is a DLL - ModuleIsDLL Field = "module.is_dll" - // ModuleIsDriver indicates if the loaded module is a driver - ModuleIsDriver Field = "module.is_driver" - // ModuleIsExecutable indicates if the loaded module is an executable - ModuleIsExecutable Field = "module.is_exec" - // ModuleIsDotnet indicates if the loaded module is a .NET assembly - ModuleIsDotnet Field = "module.pe.is_dotnet" - - // MemBaseAddress identifies the field that denotes the allocation base address - MemBaseAddress Field = "mem.address" - // MemRegionSize Field identifies the field that represents the allocated region size - MemRegionSize Field = "mem.size" - // MemAllocType identifies the field that represents region allocation type - MemAllocType Field = "mem.alloc" - // MemPageType identifies the parameter that represents the allocated region type - MemPageType Field = "mem.type" - // MemProtection identifies the field that represents the memory protection for the range of pages - MemProtection Field = "mem.protection" - // MemProtectionMask identifies the field that represents the memory protection in mask notation - MemProtectionMask Field = "mem.protection.mask" - - // DNSName identifies the field that represents the DNS name - DNSName Field = "dns.name" - // DNSRR identifies the field that represents the DNS record type - DNSRR Field = "dns.rr" - // DNSOptions identifies the field that represents the DNS options - DNSOptions Field = "dns.options" - // DNSAnswers identifies the field that represents the DNS answers - DNSAnswers Field = "dns.answers" - // DNSRcode identifies the field that represents the DNS response code - DNSRcode Field = "dns.rcode" -) - -// String casts the field type to string. -func (f Field) String() string { return string(f) } - -// Type returns the data type that this field contains. -func (f Field) Type() params.Type { return fields[f].Type } - -func (f Field) IsPsField() bool { return strings.HasPrefix(string(f), "ps.") } -func (f Field) IsKevtField() bool { return strings.HasPrefix(string(f), "kevt.") } -func (f Field) IsEvtField() bool { return strings.HasPrefix(string(f), "evt.") } -func (f Field) IsThreadField() bool { return strings.HasPrefix(string(f), "thread.") } -func (f Field) IsImageField() bool { return strings.HasPrefix(string(f), "image.") } -func (f Field) IsFileField() bool { return strings.HasPrefix(string(f), "file.") } -func (f Field) IsRegistryField() bool { return strings.HasPrefix(string(f), "registry.") } -func (f Field) IsNetworkField() bool { return strings.HasPrefix(string(f), "net.") } -func (f Field) IsPeField() bool { - return strings.HasPrefix(string(f), "pe.") || strings.HasPrefix(string(f), "ps.pe.") || strings.HasPrefix(string(f), "ps.signature.") -} -func (f Field) IsModuleField() bool { - return strings.HasPrefix(string(f), "module.") || strings.HasPrefix(string(f), "dll.") -} -func (f Field) IsMemField() bool { return strings.HasPrefix(string(f), "mem.") } -func (f Field) IsDNSField() bool { return strings.HasPrefix(string(f), "dns.") } - -func (f Field) IsPeSection() bool { return f == PeNumSections || f == PsPeNumSections } -func (f Field) IsPeSymbol() bool { - return f == PeSymbols || f == PeNumSymbols || f == PeImports || f == PsPeSymbols || f == PsPeNumSymbols || f == PsPeImports -} -func (f Field) IsPeVersionResource() bool { - return f == PeCompany || f == PeCopyright || f == PeDescription || f == PeFileName || f == PeFileVersion || f == PeProduct || f == PeProductVersion || - f == PsPeCompany || f == PsPeCopyright || f == PsPeDescription || f == PsPeFileName || f == PsPeFileVersion || f == PsPeProduct || f == PsPeProductVersion -} -func (f Field) IsPeVersionResources() bool { return f == PeResources || f == PsPeResources } -func (f Field) IsPeImphash() bool { return f == PeImphash || f == PsPeImphash } -func (f Field) IsPeDotnet() bool { return f == PeIsDotnet || f == PsPeIsDotnet } -func (f Field) IsPeAnomalies() bool { return f == PeAnomalies || f == PsPeAnomalies } -func (f Field) IsPeSignature() bool { - return f == PeIsTrusted || f == PeIsSigned || f == PeCertIssuer || f == PeCertSerial || f == PeCertSubject || f == PeCertBefore || f == PeCertAfter || strings.HasPrefix(string(f), "ps.signature.") -} -func (f Field) IsPeIsTrusted() bool { return f == PeIsTrusted || f == PsSignatureTrusted } -func (f Field) IsPeIsSigned() bool { return f == PeIsSigned || f == PsSignatureExists } - -func (f Field) IsPeCert() bool { - return strings.HasPrefix(string(f), "pe.cert.") || f == PsSignatureIssuer || f == PsSignatureSubject || f == PsSignatureSerial || f == PsSignatureAfter || f == PsSignatureBefore -} -func (f Field) IsImageCert() bool { return strings.HasPrefix(string(f), "image.cert.") } -func (f Field) IsModuleCert() bool { - return f == ModuleSignatureSubject || f == ModuleSignatureIssuer || f == ModuleSignatureSerial || f == ModuleSignatureAfter || f == ModuleSignatureBefore || - f == DllSignatureSubject || f == DllSignatureIssuer || f == DllSignatureSerial || f == DllSignatureAfter || f == DllSignatureBefore -} -func (f Field) IsModuleSignature() bool { - return strings.HasPrefix(string(f), "module.signature.") || strings.HasPrefix(string(f), "dll.signature.") -} - -func (f Field) IsPeModified() bool { return f == PeIsModified || f == PsPeIsModified } - -// Segment represents the type alias for the segment. Segment -// denotes the property anchored to the bound field reference. -// Let's look through an example. $module.name is the literal -// composed of bound field ($module) and the segment (name). -// Segments are most commonly used in the context of bound -// variables in foreach function. -type Segment string - -const ( - PathSegment Segment = "path" - NameSegment Segment = "name" - TypeSegment Segment = "type" - SizeSegment Segment = "size" - ChecksumSegment Segment = "checksum" - AddressSegment Segment = "address" - OffsetSegment Segment = "offset" - EntropySegment Segment = "entropy" - MD5Segment Segment = "md5" - - PIDSegment Segment = "pid" - CmdlineSegment Segment = "cmdline" - ExeSegment Segment = "exe" - ArgsSegment Segment = "args" - CwdSegment Segment = "cwd" - SIDSegment Segment = "sid" - SessionIDSegment Segment = "sessionid" - UsernameSegment Segment = "username" - DomainSegment Segment = "domain" - TokenIntegrityLevelSegment Segment = "token.integrity_level" - TokenIsElevatedSegment Segment = "token.is_elevated" - TokenElevationTypeSegment Segment = "token.elevation_type" - - TidSegment Segment = "tid" - StartAddressSegment Segment = "start_address" - UserStackBaseSegment Segment = "user_stack_base" - UserStackLimitSegment Segment = "user_stack_limit" - KernelStackBaseSegment Segment = "kernel_stack_base" - KernelStackLimitSegment Segment = "kernel_stack_limit" - - SymbolSegment Segment = "symbol" - ModuleSegment Segment = "module" - AllocationSizeSegment Segment = "allocation_size" - ProtectionSegment Segment = "protection" - IsUnbackedSegment Segment = "is_unbacked" - CallsiteLeadingAssemblySegment Segment = "callsite_leading_assembly" - CallsiteTrailingAssemblySegment Segment = "callsite_trailing_assembly" - - ModuleSignatureExistsSegment Segment = "module.signature.exists" - ModuleSignatureTrustedSegment Segment = "module.signature.trusted" - ModuleSignatureIssuerSegment Segment = "module.signature.issuer" - ModuleSignatureSubjectSegment Segment = "module.signature.subject" -) - -var segments = map[Segment]bool{ - NameSegment: true, - PathSegment: true, - TypeSegment: true, - EntropySegment: true, - SizeSegment: true, - MD5Segment: true, - AddressSegment: true, - ChecksumSegment: true, - PIDSegment: true, - CmdlineSegment: true, - ExeSegment: true, - ArgsSegment: true, - CwdSegment: true, - SIDSegment: true, - SessionIDSegment: true, - UsernameSegment: true, - DomainSegment: true, - TokenIntegrityLevelSegment: true, - TokenIsElevatedSegment: true, - TokenElevationTypeSegment: true, - TidSegment: true, - StartAddressSegment: true, - UserStackBaseSegment: true, - UserStackLimitSegment: true, - KernelStackBaseSegment: true, - KernelStackLimitSegment: true, - OffsetSegment: true, - SymbolSegment: true, - ModuleSegment: true, - AllocationSizeSegment: true, - ProtectionSegment: true, - IsUnbackedSegment: true, - CallsiteLeadingAssemblySegment: true, - CallsiteTrailingAssemblySegment: true, - ModuleSignatureExistsSegment: true, - ModuleSignatureTrustedSegment: true, - ModuleSignatureIssuerSegment: true, - ModuleSignatureSubjectSegment: true, -} - -var allowedSegments = map[Field][]Segment{ - PsAncestors: {NameSegment, PIDSegment, CmdlineSegment, ExeSegment, ArgsSegment, CwdSegment, SIDSegment, SessionIDSegment, UsernameSegment, DomainSegment, TokenIntegrityLevelSegment, TokenIsElevatedSegment, TokenElevationTypeSegment}, - PsThreads: {TidSegment, StartAddressSegment, UserStackBaseSegment, UserStackLimitSegment, KernelStackBaseSegment, KernelStackLimitSegment}, - PsModules: {PathSegment, NameSegment, AddressSegment, SizeSegment, ChecksumSegment}, - PsMmaps: {AddressSegment, TypeSegment, SizeSegment, ProtectionSegment, PathSegment}, - PeSections: {NameSegment, SizeSegment, EntropySegment, MD5Segment}, - PsPeSections: {NameSegment, SizeSegment, EntropySegment, MD5Segment}, - ThreadCallstack: {AddressSegment, OffsetSegment, SymbolSegment, ModuleSegment, AllocationSizeSegment, ProtectionSegment, IsUnbackedSegment, CallsiteLeadingAssemblySegment, CallsiteTrailingAssemblySegment, ModuleSignatureExistsSegment, ModuleSignatureTrustedSegment, ModuleSignatureIssuerSegment, ModuleSignatureSubjectSegment}, -} - -func (s Segment) IsEntropy() bool { return s == EntropySegment } - -// IsSegmentAllowed determines if the segment is valid for the pseudo field. -func IsSegmentAllowed(f Field, s Segment) bool { - segs := allowedSegments[f] - if len(segs) == 0 { - return false - } - - for _, seg := range segs { - if seg == s { - return true - } - } - - return false -} - -// SegmentsHint returns the sequence of available segments for the pseudo field. -func SegmentsHint(f Field) string { - segs := allowedSegments[f] - if len(segs) == 0 { - return "" - } - - s := make([]string, len(segs)) - for i, seg := range segs { - s[i] = string(seg) - } - - return strings.Join(s, ", ") -} - -// IsSegment indicates if the given string is recognized as a known segment. -func IsSegment(s string) bool { - return segments[Segment(s)] -} - -// Pseudo fields provide access to the process/event internal state. They -// are typically used in conjunction with the foreach function as its -// first argument. - -var ( - PsModules Field = "ps._modules" - PsThreads Field = "ps._threads" - PsMmaps Field = "ps._mmaps" - PsAncestors Field = "ps._ancestors" - PsPeSections Field = "ps.pe._sections" - ThreadCallstack Field = "thread._callstack" - PeSections Field = "pe._sections" -) - -func IsPseudoField(f Field) bool { - return f == PsAncestors || f == PsModules || f == PsThreads || f == PsMmaps || f == ThreadCallstack || f == PeSections || f == PsPeSections -} - -func (f Field) IsPeSectionsPseudo() bool { return f == PeSections || f == PsPeSections } - -var fields = map[Field]FieldInfo{ - EvtSeq: {EvtSeq, "event sequence number", params.Uint64, []string{"evt.seq > 666"}, nil, nil}, - EvtPID: {EvtPID, "process identifier generating the event", params.Uint32, []string{"evt.pid = 6"}, nil, nil}, - EvtTID: {EvtTID, "thread identifier generating the event", params.Uint32, []string{"evt.tid = 1024"}, nil, nil}, - EvtCPU: {EvtCPU, "logical processor core where the event was generated", params.Uint8, []string{"evt.cpu = 2"}, nil, nil}, - EvtName: {EvtName, "symbolical event name", params.AnsiString, []string{"evt.name = 'CreateThread'"}, nil, nil}, - EvtCategory: {EvtCategory, "event category", params.AnsiString, []string{"evt.category = 'registry'"}, nil, nil}, - EvtDesc: {EvtDesc, "event description", params.AnsiString, []string{"evt.desc contains 'Creates a new process'"}, nil, nil}, - EvtHost: {EvtHost, "host name on which the event was produced", params.UnicodeString, []string{"evt.host contains 'kitty'"}, nil, nil}, - EvtTime: {EvtTime, "event timestamp as a time string", params.Time, []string{"evt.time = '17:05:32'"}, nil, nil}, - EvtTimeHour: {EvtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"evt.time.h = 23"}, nil, nil}, - EvtTimeMin: {EvtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"evt.time.m = 54"}, nil, nil}, - EvtTimeSec: {EvtTimeSec, "second offset within the minute on which the event occurred", params.Time, []string{"evt.time.s = 0"}, nil, nil}, - EvtTimeNs: {EvtTimeNs, "nanoseconds specified by event timestamp", params.Int64, []string{"evt.time.ns > 1591191629102337000"}, nil, nil}, - EvtDate: {EvtDate, "event timestamp as a date string", params.Time, []string{"evt.date = '2018-03-03'"}, nil, nil}, - EvtDateDay: {EvtDateDay, "day of the month on which the event occurred", params.Time, []string{"evt.date.d = 12"}, nil, nil}, - EvtDateMonth: {EvtDateMonth, "month of the year on which the event occurred", params.Time, []string{"evt.date.m = 11"}, nil, nil}, - EvtDateYear: {EvtDateYear, "year on which the event occurred", params.Uint32, []string{"evt.date.y = 2020"}, nil, nil}, - EvtDateTz: {EvtDateTz, "time zone associated with the event timestamp", params.AnsiString, []string{"evt.date.tz = 'UTC'"}, nil, nil}, - EvtDateWeek: {EvtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"evt.date.week = 2"}, nil, nil}, - EvtDateWeekday: {EvtDateWeekday, "week day on which the event occurred", params.AnsiString, []string{"evt.date.weekday = 'Monday'"}, nil, nil}, - EvtNparams: {EvtNparams, "number of parameters", params.Int8, []string{"evt.nparams > 2"}, nil, nil}, - EvtArg: {EvtArg, "event parameter", params.Object, []string{"evt.arg[cmdline] istartswith 'C:\\Windows'"}, nil, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { - for _, c := range s { - switch { - case unicode.IsLower(c): - case unicode.IsNumber(c): - case c == '_': - default: - return false - } - } - return true - }}}, - EvtIsDirectSyscall: {EvtIsDirectSyscall, "indicates if the event is performing a direct syscall", params.Bool, []string{"evt.is_direct_syscall = true"}, nil, nil}, - EvtIsIndirectSyscall: {EvtIsIndirectSyscall, "indicates if the event is performing an indirect syscall", params.Bool, []string{"evt.is_indirect_syscall = true"}, nil, nil}, - - KevtSeq: {KevtSeq, "event sequence number", params.Uint64, []string{"kevt.seq > 666"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtSeq}}, nil}, - KevtPID: {KevtPID, "process identifier generating the event", params.Uint32, []string{"kevt.pid = 6"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtPID}}, nil}, - KevtTID: {KevtTID, "thread identifier generating the event", params.Uint32, []string{"kevt.tid = 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTID}}, nil}, - KevtCPU: {KevtCPU, "logical processor core where the event was generated", params.Uint8, []string{"kevt.cpu = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCPU}}, nil}, - KevtName: {KevtName, "symbolical event name", params.AnsiString, []string{"kevt.name = 'CreateThread'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtName}}, nil}, - KevtCategory: {KevtCategory, "event category", params.AnsiString, []string{"kevt.category = 'registry'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtCategory}}, nil}, - KevtDesc: {KevtDesc, "event description", params.AnsiString, []string{"kevt.desc contains 'Creates a new process'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDesc}}, nil}, - KevtHost: {KevtHost, "host name on which the event was produced", params.UnicodeString, []string{"kevt.host contains 'kitty'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtHost}}, nil}, - KevtTime: {KevtTime, "event timestamp as a time string", params.Time, []string{"kevt.time = '17:05:32'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTime}}, nil}, - KevtTimeHour: {KevtTimeHour, "hour within the day on which the event occurred", params.Time, []string{"kevt.time.h = 23"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeHour}}, nil}, - KevtTimeMin: {KevtTimeMin, "minute offset within the hour on which the event occurred", params.Time, []string{"kevt.time.m = 54"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeMin}}, nil}, - KevtTimeSec: {KevtTimeSec, "second offset within the minute on which the event occurred", params.Time, []string{"kevt.time.s = 0"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeSec}}, nil}, - KevtTimeNs: {KevtTimeNs, "nanoseconds specified by event timestamp", params.Int64, []string{"kevt.time.ns > 1591191629102337000"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtTimeNs}}, nil}, - KevtDate: {KevtDate, "event timestamp as a date string", params.Time, []string{"kevt.date = '2018-03-03'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDate}}, nil}, - KevtDateDay: {KevtDateDay, "day of the month on which the event occurred", params.Time, []string{"kevt.date.d = 12"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateDay}}, nil}, - KevtDateMonth: {KevtDateMonth, "month of the year on which the event occurred", params.Time, []string{"kevt.date.m = 11"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateMonth}}, nil}, - KevtDateYear: {KevtDateYear, "year on which the event occurred", params.Uint32, []string{"kevt.date.y = 2020"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateYear}}, nil}, - KevtDateTz: {KevtDateTz, "time zone associated with the event timestamp", params.AnsiString, []string{"kevt.date.tz = 'UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateTz}}, nil}, - KevtDateWeek: {KevtDateWeek, "week number within the year on which the event occurred", params.Uint8, []string{"kevt.date.week = 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeek}}, nil}, - KevtDateWeekday: {KevtDateWeekday, "week day on which the event occurred", params.AnsiString, []string{"kevt.date.weekday = 'Monday'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtDateWeekday}}, nil}, - KevtNparams: {KevtNparams, "number of parameters", params.Int8, []string{"kevt.nparams > 2"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtNparams}}, nil}, - KevtArg: {KevtArg, "event parameter", params.Object, []string{"kevt.arg[cmdline] istartswith 'C:\\Windows'"}, &Deprecation{Since: "3.0.0", Fields: []Field{EvtArg}}, &Argument{Optional: false, Pattern: "[a-z0-9_]+", ValidationFunc: func(s string) bool { - for _, c := range s { - switch { - case unicode.IsLower(c): - case unicode.IsNumber(c): - case c == '_': - default: - return false - } - } - return true - }}}, - - PsPid: {PsPid, "process identifier", params.PID, []string{"ps.pid = 1024"}, nil, nil}, - PsPpid: {PsPpid, "parent process identifier", params.PID, []string{"ps.ppid = 45"}, nil, nil}, - PsName: {PsName, "process image name including the file extension", params.UnicodeString, []string{"ps.name contains 'firefox'"}, nil, nil}, - PsComm: {PsComm, "process command line", params.UnicodeString, []string{"ps.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsCmdline}}, nil}, - PsCmdline: {PsCmdline, "process command line", params.UnicodeString, []string{"ps.cmdline contains 'java'"}, nil, nil}, - PsExe: {PsExe, "full name of the process' executable", params.UnicodeString, []string{"ps.exe = 'C:\\Windows\\system32\\cmd.exe'"}, nil, nil}, - PsArgs: {PsArgs, "process command line arguments", params.Slice, []string{"ps.args in ('/cdir', '/-C')"}, nil, nil}, - PsCwd: {PsCwd, "process current working directory", params.UnicodeString, []string{"ps.cwd = 'C:\\Users\\Default'"}, nil, nil}, - PsSID: {PsSID, "security identifier under which this process is run", params.UnicodeString, []string{"ps.sid contains 'SYSTEM'"}, nil, nil}, - PsSessionID: {PsSessionID, "unique identifier for the current session", params.Int16, []string{"ps.sessionid = 1"}, nil, nil}, - PsDomain: {PsDomain, "process domain", params.UnicodeString, []string{"ps.domain contains 'SERVICE'"}, nil, nil}, - PsUsername: {PsUsername, "process username", params.UnicodeString, []string{"ps.username contains 'system'"}, nil, nil}, - PsEnvs: {PsEnvs, "process environment variables", params.Slice, []string{"ps.envs in ('SystemRoot:C:\\WINDOWS')", "ps.envs[windir] = 'C:\\WINDOWS'"}, nil, &Argument{Optional: true, ValidationFunc: func(arg string) bool { return true }}}, - PsHandleNames: {PsHandleNames, "allocated process handle names", params.Slice, []string{"ps.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, - PsHandleTypes: {PsHandleTypes, "allocated process handle types", params.Slice, []string{"ps.handle.types in ('Key', 'Mutant', 'Section')"}, nil, nil}, - PsDTB: {PsDTB, "process directory table base address", params.Address, []string{"ps.dtb = '7ffe0000'"}, nil, nil}, - PsModuleNames: {PsModuleNames, "modules loaded by the process", params.Slice, []string{"ps.modules in ('crypt32.dll', 'xul.dll')"}, nil, nil}, - PsParentName: {PsParentName, "parent process image name including the file extension", params.UnicodeString, []string{"ps.parent.name contains 'cmd.exe'"}, nil, nil}, - PsParentPid: {PsParentPid, "parent process id", params.Uint32, []string{"ps.parent.pid = 4"}, nil, nil}, - PsParentComm: {PsParentComm, "parent process command line", params.UnicodeString, []string{"ps.parent.comm contains 'java'"}, &Deprecation{Since: "1.10.0", Fields: []Field{PsParentCmdline}}, nil}, - PsParentCmdline: {PsParentCmdline, "parent process command line", params.UnicodeString, []string{"ps.parent.cmdline contains 'java'"}, nil, nil}, - PsParentExe: {PsParentExe, "full name of the parent process' executable", params.UnicodeString, []string{"ps.parent.exe = 'C:\\Windows\\system32\\explorer.exe'"}, nil, nil}, - PsParentArgs: {PsParentArgs, "parent process command line arguments", params.Slice, []string{"ps.parent.args in ('/cdir', '/-C')"}, nil, nil}, - PsParentCwd: {PsParentCwd, "parent process current working directory", params.UnicodeString, []string{"ps.parent.cwd = 'C:\\Temp'"}, nil, nil}, - PsParentSID: {PsParentSID, "security identifier under which the parent process is run", params.UnicodeString, []string{"ps.parent.sid contains 'SYSTEM'"}, nil, nil}, - PsParentDomain: {PsParentDomain, "parent process domain", params.UnicodeString, []string{"ps.parent.domain contains 'SERVICE'"}, nil, nil}, - PsParentUsername: {PsParentUsername, "parent process username", params.UnicodeString, []string{"ps.parent.username contains 'system'"}, nil, nil}, - PsParentSessionID: {PsParentSessionID, "unique identifier for the current session of parent process", params.Int16, []string{"ps.parent.sessionid = 1"}, nil, nil}, - PsParentEnvs: {PsParentEnvs, "parent process environment variables", params.Slice, []string{"ps.parent.envs in ('MOZ_CRASHREPORTER_DATA_DIRECTORY')"}, nil, nil}, - PsParentHandles: {PsParentHandles, "allocated parent process handle names", params.Slice, []string{"ps.parent.handles in ('\\BaseNamedObjects\\__ComCatalogCache__')"}, nil, nil}, - PsParentHandleTypes: {PsParentHandleTypes, "allocated parent process handle types", params.Slice, []string{"ps.parent.handle.types in ('File', 'SymbolicLink')"}, nil, nil}, - PsParentDTB: {PsParentDTB, "parent process directory table base address", params.Address, []string{"ps.parent.dtb = '7ffe0000'"}, nil, nil}, - PsAccessMask: {PsAccessMask, "process desired access rights", params.AnsiString, []string{"ps.access.mask = '0x1400'"}, nil, nil}, - PsAccessMaskNames: {PsAccessMaskNames, "process desired access rights as a string list", params.Slice, []string{"ps.access.mask.names in ('SUSPEND_RESUME')"}, nil, nil}, - PsAccessStatus: {PsAccessStatus, "process access status", params.UnicodeString, []string{"ps.access.status = 'access is denied.'"}, nil, nil}, - PsUUID: {PsUUID, "unique process identifier", params.Uint64, []string{"ps.uuid > 6000054355"}, nil, nil}, - PsParentUUID: {PsParentUUID, "unique parent process identifier", params.Uint64, []string{"ps.parent.uuid > 6000054355"}, nil, nil}, - PsIsWOW64Field: {PsIsWOW64Field, "indicates if the process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.is_wow64"}, nil, nil}, - PsIsPackagedField: {PsIsPackagedField, "indicates if the process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.is_packaged"}, nil, nil}, - PsIsProtectedField: {PsIsProtectedField, "indicates if the process generating the event is a protected process", params.Bool, []string{"ps.is_protected"}, nil, nil}, - PsParentIsWOW64Field: {PsParentIsWOW64Field, "indicates if the parent process generating the event is a 32-bit process created in 64-bit Windows system", params.Bool, []string{"ps.parent.is_wow64"}, nil, nil}, - PsParentIsPackagedField: {PsParentIsPackagedField, "indicates if the parent process generating the event is packaged with the MSIX technology", params.Bool, []string{"ps.parent.is_packaged"}, nil, nil}, - PsParentIsProtectedField: {PsParentIsProtectedField, "indicates if the the parent process generating the event is a protected process", params.Bool, []string{"ps.parent.is_protected"}, nil, nil}, - PsAncestor: {PsAncestor, "the process ancestor name", params.UnicodeString, []string{"ps.ancestor[1] = 'svchost.exe'", "ps.ancestor in ('winword.exe')"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, - PsTokenIntegrityLevel: {PsTokenIntegrityLevel, "process token integrity level", params.UnicodeString, []string{"ps.token.integrity_level = 'SYSTEM'"}, nil, nil}, - PsTokenIsElevated: {PsTokenIsElevated, "indicates if the process token is elevated", params.Bool, []string{"ps.token.is_elevated = true"}, nil, nil}, - PsTokenElevationType: {PsTokenElevationType, "process token elevation type", params.AnsiString, []string{"ps.token.elevation_type = 'LIMITED'"}, nil, nil}, - PsParentTokenIntegrityLevel: {PsParentTokenIntegrityLevel, "parent process token integrity level", params.UnicodeString, []string{"ps.parent.token.integrity_level = 'HIGH'"}, nil, nil}, - PsParentTokenIsElevated: {PsParentTokenIsElevated, "indicates if the parent process token is elevated", params.Bool, []string{"ps.parent.token.is_elevated = true"}, nil, nil}, - PsParentTokenElevationType: {PsParentTokenElevationType, "parent process token elevation type", params.AnsiString, []string{"ps.parent.token.elevation_type = 'LIMITED'"}, nil, nil}, - PsSignatureExists: {PsSignatureExists, "indicates if the process executable has a valid signature", params.Bool, []string{"ps.signature.exists"}, nil, nil}, - PsSignatureTrusted: {PsSignatureTrusted, "indicates if the process executable signature certificate chain is trusted", params.Bool, []string{"ps.signature.trusted"}, nil, nil}, - PsSignatureSerial: {PsSignatureSerial, "represents signature serial number", params.UnicodeString, []string{"ps.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, - PsSignatureSubject: {PsSignatureSubject, "represents signature subject", params.UnicodeString, []string{"ps.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - PsSignatureIssuer: {PsSignatureIssuer, "represents signature CA", params.UnicodeString, []string{"ps.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - PsSignatureAfter: {PsSignatureAfter, "represents certificate expiration date", params.Time, []string{"ps.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - PsSignatureBefore: {PsSignatureBefore, "represents certificate enrollment date", params.Time, []string{"ps.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - - PsPeNumSections: {PsPeNumSections, "number of PE sections", params.Uint16, []string{"ps.pe.nsections < 5"}, nil, nil}, - PsPeNumSymbols: {PsPeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"ps.pe.nsymbols > 230"}, nil, nil}, - PsPeBaseAddress: {PsPeBaseAddress, "executable base address", params.Address, []string{"ps.pe.address.base = '140000000'"}, nil, nil}, - PsPeEntrypoint: {PsPeEntrypoint, "address of the entrypoint function", params.Address, []string{"ps.pe.address.entrypoint = '20110'"}, nil, nil}, - PsPeSymbols: {PsPeSymbols, "imported symbols", params.Slice, []string{"ps.pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, nil, nil}, - PsPeImports: {PsPeImports, "imported dynamic linked libraries", params.Slice, []string{"ps.pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, nil, nil}, - PsPeResources: {PsPeResources, "version resources", params.Map, []string{"ps.pe.resources[FileDescription] = 'Notepad'"}, nil, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { - for _, c := range s { - switch { - case unicode.IsLower(c): - case unicode.IsUpper(c): - case unicode.IsNumber(c): - case c == '_': - default: - return false - } - } - return true - }}}, - PsPeCompany: {PsPeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.company = 'Microsoft Corporation'"}, nil, nil}, - PsPeCopyright: {PsPeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"ps.pe.copyright = '© Microsoft Corporation'"}, nil, nil}, - PsPeDescription: {PsPeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.description = 'Notepad'"}, nil, nil}, - PsPeFileName: {PsPeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.name = 'NOTEPAD.EXE'"}, nil, nil}, - PsPeFileVersion: {PsPeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"ps.pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, nil, nil}, - PsPeProduct: {PsPeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product = 'Microsoft® Windows® Operating System'"}, nil, nil}, - PsPeProductVersion: {PsPeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"ps.pe.product.version = '10.0.18362.693'"}, nil, nil}, - PsPeImphash: {PsPeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, nil, nil}, - PsPeIsDotnet: {PsPeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"ps.pe.is_dotnet"}, nil, nil}, - PsPeAnomalies: {PsPeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"ps.pe.anomalies in ('number of sections is 0')"}, nil, nil}, - PsPeIsModified: {PsPeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"ps.pe.is_modified"}, nil, nil}, - - ThreadBasePrio: {ThreadBasePrio, "scheduler priority of the thread", params.Int8, []string{"thread.prio = 5"}, nil, nil}, - ThreadIOPrio: {ThreadIOPrio, "I/O priority hint for scheduling I/O operations", params.Int8, []string{"thread.io.prio = 4"}, nil, nil}, - ThreadPagePrio: {ThreadPagePrio, "memory page priority hint for memory pages accessed by the thread", params.Int8, []string{"thread.page.prio = 12"}, nil, nil}, - ThreadKstackBase: {ThreadKstackBase, "base address of the thread's kernel space stack", params.Address, []string{"thread.kstack.base = 'a65d800000'"}, nil, nil}, - ThreadKstackLimit: {ThreadKstackLimit, "limit of the thread's kernel space stack", params.Address, []string{"thread.kstack.limit = 'a85d800000'"}, nil, nil}, - ThreadUstackBase: {ThreadUstackBase, "base address of the thread's user space stack", params.Address, []string{"thread.ustack.base = '7ffe0000'"}, nil, nil}, - ThreadUstackLimit: {ThreadUstackLimit, "limit of the thread's user space stack", params.Address, []string{"thread.ustack.limit = '8ffe0000'"}, nil, nil}, - ThreadEntrypoint: {ThreadEntrypoint, "starting address of the function to be executed by the thread", params.Address, []string{"thread.entrypoint = '7efe0000'"}, &Deprecation{Since: "2.3.0", Fields: []Field{ThreadStartAddress}}, nil}, - ThreadStartAddress: {ThreadStartAddress, "thread start address", params.Address, []string{"thread.start_address = '7efe0000'"}, nil, nil}, - ThreadStartAddressSymbol: {ThreadStartAddressSymbol, "thread start address symbol", params.UnicodeString, []string{"thread.start_address.symbol = 'LoadModule'"}, nil, nil}, - ThreadStartAddressModule: {ThreadStartAddressModule, "thread start address module", params.UnicodeString, []string{"thread.start_address.module endswith 'kernel32.dll'"}, nil, nil}, - ThreadPID: {ThreadPID, "the process identifier where the thread is created", params.Uint32, []string{"evt.pid != thread.pid"}, nil, nil}, - ThreadTEB: {ThreadTEB, "the base address of the thread environment block", params.Address, []string{"thread.teb_address = '8f30893000'"}, nil, nil}, - ThreadAccessMask: {ThreadAccessMask, "thread desired access rights", params.AnsiString, []string{"thread.access.mask = '0x1fffff'"}, nil, nil}, - ThreadAccessMaskNames: {ThreadAccessMaskNames, "thread desired access rights as a string list", params.Slice, []string{"thread.access.mask.names in ('IMPERSONATE')"}, nil, nil}, - ThreadAccessStatus: {ThreadAccessStatus, "thread access status", params.UnicodeString, []string{"thread.access.status = 'success'"}, nil, nil}, - ThreadCallstackSummary: {ThreadCallstackSummary, "callstack summary", params.UnicodeString, []string{"thread.callstack.summary contains 'ntdll.dll|KERNELBASE.dll'"}, nil, nil}, - ThreadCallstackKernelSummary: {ThreadCallstackKernelSummary, "kernel thread callstack summary", params.UnicodeString, []string{"thread.callstack.kernel_summary contains 'fileinfo.sys|ntoskrnl.exe|FLTMGR.SYS|ntoskrnl.exe'"}, nil, nil}, - ThreadCallstackDetail: {ThreadCallstackDetail, "detailed information of each stack frame", params.UnicodeString, []string{"thread.callstack.detail contains 'KERNELBASE.dll!CreateProcessW'"}, nil, nil}, - ThreadCallstackModules: {ThreadCallstackModules, "list of modules comprising the callstack", params.Slice, []string{"thread.callstack.modules in ('C:\\WINDOWS\\System32\\KERNELBASE.dll')", "base(thread.callstack.modules[7]) = 'ntdll.dll'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, - ThreadCallstackSymbols: {ThreadCallstackSymbols, "list of symbols comprising the callstack", params.Slice, []string{"thread.callstack.symbols in ('ntdll.dll!NtCreateProcess')", "thread.callstack.symbols[3] = 'ntdll!NtCreateProcess'"}, nil, &Argument{Optional: true, Pattern: "[0-9]+", ValidationFunc: isNumber}}, - ThreadCallstackAllocationSizes: {ThreadCallstackAllocationSizes, "allocation sizes of private pages", params.Slice, []string{"thread.callstack.allocation_sizes > 10000"}, nil, nil}, - ThreadCallstackProtections: {ThreadCallstackProtections, "page protections masks of each frame", params.Slice, []string{"thread.callstack.protections in ('RWX', 'WX')"}, nil, nil}, - ThreadCallstackCallsiteLeadingAssembly: {ThreadCallstackCallsiteLeadingAssembly, "callsite leading assembly instructions", params.Slice, []string{"thread.callstack.callsite_leading_assembly in ('mov r10,rcx', 'syscall')"}, nil, nil}, - ThreadCallstackCallsiteTrailingAssembly: {ThreadCallstackCallsiteTrailingAssembly, "callsite trailing assembly instructions", params.Slice, []string{"thread.callstack.callsite_trailing_assembly in ('add esp, 0xab')"}, nil, nil}, - ThreadCallstackIsUnbacked: {ThreadCallstackIsUnbacked, "indicates if the callstack contains unbacked regions", params.Bool, []string{"thread.callstack.is_unbacked"}, nil, nil}, - ThreadCallstackAddresses: {ThreadCallstackAddresses, "list of all stack return addresses", params.Slice, []string{"thread.callstack.addresses in ('7ffb5c1d0396')"}, nil, nil}, - ThreadCallstackFinalUserModuleName: {ThreadCallstackFinalUserModuleName, "final user space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_user_module.name != 'ntdll.dll'"}, nil, nil}, - ThreadCallstackFinalUserModulePath: {ThreadCallstackFinalUserModulePath, "final user space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_user_module.path imatches '?:\\Windows\\System32\\ntdll.dll'"}, nil, nil}, - ThreadCallstackFinalUserSymbolName: {ThreadCallstackFinalUserSymbolName, "final user space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_user_symbol.name imatches 'CreateProcess*'"}, nil, nil}, - ThreadCallstackFinalKernelModuleName: {ThreadCallstackFinalKernelModuleName, "final kernel space stack frame module name", params.UnicodeString, []string{"thread.callstack.final_kernel_module.name = 'FLTMGR.SYS'"}, nil, nil}, - ThreadCallstackFinalKernelModulePath: {ThreadCallstackFinalKernelModulePath, "final kernel space stack frame module path", params.UnicodeString, []string{"thread.callstack.final_kernel_module.path imatches '?:\\WINDOWS\\System32\\drivers\\FLTMGR.SYS'"}, nil, nil}, - ThreadCallstackFinalKernelSymbolName: {ThreadCallstackFinalKernelSymbolName, "final kernel space stack symbol name", params.UnicodeString, []string{"thread.callstack.final_kernel_symbol.name = 'FltGetStreamContext'"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureExists: {ThreadCallstackFinalUserModuleSignatureExists, "signature status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.exists = true"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureTrusted: {ThreadCallstackFinalUserModuleSignatureTrusted, "signature trust status of the final user space stack frame module", params.Bool, []string{"thread.callstack.final_user_module.signature.trusted = true"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureIssuer: {ThreadCallstackFinalUserModuleSignatureIssuer, "final user space stack frame module signature certificate issuer", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.issuer imatches '*Microsoft Corporation*'"}, nil, nil}, - ThreadCallstackFinalUserModuleSignatureSubject: {ThreadCallstackFinalUserModuleSignatureSubject, "final user space stack frame module signature certificate subject", params.UnicodeString, []string{"thread.callstack.final_user_module.signature.subject imatches '*Microsoft Windows*'"}, nil, nil}, - - ImagePath: {ImagePath, "full image path", params.UnicodeString, []string{"image.path = 'C:\\Windows\\System32\\advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePath}}, nil}, - ImageName: {ImageName, "image name", params.UnicodeString, []string{"image.name = 'advapi32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleName}}, nil}, - ImageBase: {ImageBase, "the base address of process in which the image is loaded", params.Address, []string{"image.base.address = 'a65d800000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleBase}}, nil}, - ImageChecksum: {ImageChecksum, "image checksum", params.Uint32, []string{"image.checksum = 746424"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleChecksum}}, nil}, - ImageSize: {ImageSize, "image size", params.Uint32, []string{"image.size > 1024"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSize}}, nil}, - ImageDefaultAddress: {ImageDefaultAddress, "default image address", params.Address, []string{"image.default.address = '7efe0000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleDefaultAddress}}, nil}, - ImagePID: {ImagePID, "target process identifier", params.Uint32, []string{"image.pid = 80"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModulePID}}, nil}, - ImageSignatureType: {ImageSignatureType, "image signature type", params.AnsiString, []string{"image.signature.type != 'NONE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureType}}, nil}, - ImageSignatureLevel: {ImageSignatureLevel, "image signature level", params.AnsiString, []string{"image.signature.level = 'AUTHENTICODE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureLevel}}, nil}, - ImageCertSerial: {ImageCertSerial, "image certificate serial number", params.UnicodeString, []string{"image.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSerial}}, nil}, - ImageCertSubject: {ImageCertSubject, "image certificate subject", params.UnicodeString, []string{"image.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureSubject}}, nil}, - ImageCertIssuer: {ImageCertIssuer, "image certificate CA", params.UnicodeString, []string{"image.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureIssuer}}, nil}, - ImageCertAfter: {ImageCertAfter, "image certificate expiration date", params.Time, []string{"image.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureAfter}}, nil}, - ImageCertBefore: {ImageCertBefore, "image certificate enrollment date", params.Time, []string{"image.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleSignatureBefore}}, nil}, - ImageIsDLL: {ImageIsDLL, "indicates if the loaded image is a DLL", params.Bool, []string{"image.is_dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDLL}}, nil}, - ImageIsDriver: {ImageIsDriver, "indicates if the loaded image is a driver", params.Bool, []string{"image.is_driver'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDriver}}, nil}, - ImageIsExecutable: {ImageIsExecutable, "indicates if the loaded image is an executable", params.Bool, []string{"image.is_exec'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsExecutable}}, nil}, - ImageIsDotnet: {ImageIsDotnet, "indicates if the loaded image is a .NET assembly", params.Bool, []string{"image.is_dotnet'"}, &Deprecation{Since: "3.0.0", Fields: []Field{ModuleIsDotnet}}, nil}, - ModulePath: {ModulePath, "full module path", params.UnicodeString, []string{"module.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, - ModulePathStem: {ModulePathStem, "module path stem", params.UnicodeString, []string{"module.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, - ModuleName: {ModuleName, "module name", params.UnicodeString, []string{"module.name = 'advapi32.dll'"}, nil, nil}, - ModuleBase: {ModuleBase, "the base address of process in which the module is loaded", params.Address, []string{"module.base.address = 'a65d800000'"}, nil, nil}, - ModuleChecksum: {ModuleChecksum, "module checksum", params.Uint32, []string{"module.checksum = 746424"}, nil, nil}, - ModuleSize: {ModuleSize, "module size", params.Uint32, []string{"module.size > 1024"}, nil, nil}, - ModuleDefaultAddress: {ModuleDefaultAddress, "default module address", params.Address, []string{"module.default_address = '7efe0000'"}, nil, nil}, - ModulePID: {ModulePID, "target process identifier", params.Uint32, []string{"module.pid = 80"}, nil, nil}, - ModuleSignatureType: {ModuleSignatureType, "module signature type", params.AnsiString, []string{"module.signature.type != 'NONE'"}, nil, nil}, - ModuleSignatureLevel: {ModuleSignatureLevel, "module signature level", params.AnsiString, []string{"module.signature.level = 'AUTHENTICODE'"}, nil, nil}, - ModuleSignatureExists: {ModuleSignatureExists, "indicates if the module is signed", params.Bool, []string{"module.signature.exists = true"}, nil, nil}, - ModuleSignatureTrusted: {ModuleSignatureTrusted, "indicates if the module signature is trusted", params.Bool, []string{"module.signature.trusted = false"}, nil, nil}, - ModuleSignatureSerial: {ModuleSignatureSerial, "module certificate serial number", params.UnicodeString, []string{"module.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, - ModuleSignatureSubject: {ModuleSignatureSubject, "module certificate subject", params.UnicodeString, []string{"module.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - ModuleSignatureIssuer: {ModuleSignatureIssuer, "module certificate CA", params.UnicodeString, []string{"module.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - ModuleSignatureAfter: {ModuleSignatureAfter, "module certificate expiration date", params.Time, []string{"module.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - ModuleSignatureBefore: {ModuleSignatureBefore, "module certificate enrollment date", params.Time, []string{"module.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - ModuleIsDLL: {ModuleIsDLL, "indicates if the loaded module is a DLL", params.Bool, []string{"module.is_dll'"}, nil, nil}, - ModuleIsDriver: {ModuleIsDriver, "indicates if the loaded module is a driver", params.Bool, []string{"module.is_driver'"}, nil, nil}, - ModuleIsExecutable: {ModuleIsExecutable, "indicates if the loaded module is an executable", params.Bool, []string{"module.is_exec'"}, nil, nil}, - ModuleIsDotnet: {ModuleIsDotnet, "indicates if the loaded module is a .NET assembly", params.Bool, []string{"module.pe.is_dotnet'"}, nil, nil}, - DllPath: {DllPath, "full dll path", params.UnicodeString, []string{"dll.path = 'C:\\Windows\\System32\\advapi32.dll'"}, nil, nil}, - DllPathStem: {DllPathStem, "dll path stem", params.UnicodeString, []string{"dll.path.stem = 'C:\\Windows\\System32\\advapi32'"}, nil, nil}, - DllName: {DllName, "module name", params.UnicodeString, []string{"dll.name = 'advapi32.dll'"}, nil, nil}, - DllBase: {DllBase, "the base address of process in which the DLL is loaded", params.Address, []string{"dll.base = 'a65d800000'"}, nil, nil}, - DllSize: {DllSize, "dll virtual mapped size", params.Uint32, []string{"dll.size > 1024"}, nil, nil}, - DllPID: {DllPID, "target process identifier", params.Uint32, []string{"dll.pid = 80"}, nil, nil}, - DllSignatureType: {DllSignatureType, "dll signature type", params.AnsiString, []string{"dll.signature.type != 'NONE'"}, nil, nil}, - DllSignatureLevel: {DllSignatureLevel, "dll signature level", params.AnsiString, []string{"dll.signature.level = 'AUTHENTICODE'"}, nil, nil}, - DllSignatureExists: {DllSignatureExists, "indicates if the dll is signed", params.Bool, []string{"dll.signature.exists = true"}, nil, nil}, - DllSignatureTrusted: {DllSignatureTrusted, "indicates if the dll signature is trusted", params.Bool, []string{"dll.signature.trusted = false"}, nil, nil}, - DllSignatureSerial: {DllSignatureSerial, "dll certificate serial number", params.UnicodeString, []string{"dll.signature.serial = '330000023241fb59996dcc4dff000000000232'"}, nil, nil}, - DllSignatureSubject: {DllSignatureSubject, "dll certificate subject", params.UnicodeString, []string{"dll.signature.subject contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - DllSignatureIssuer: {DllSignatureIssuer, "dll certificate CA", params.UnicodeString, []string{"dll.signature.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, nil, nil}, - DllSignatureAfter: {DllSignatureAfter, "moddllule certificate expiration date", params.Time, []string{"dll.signature.after contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - DllSignatureBefore: {DllSignatureBefore, "dll certificate enrollment date", params.Time, []string{"dll.signature.before contains '2024-02-01 00:05:42 +0000 UTC'"}, nil, nil}, - DllIsDotnet: {DllIsDotnet, "indicates if the loaded dll is a .NET assembly", params.Bool, []string{"dll.pe.is_dotnet'"}, nil, nil}, - - FileObject: {FileObject, "file object address", params.Uint64, []string{"file.object = 18446738026482168384"}, nil, nil}, - FilePath: {FilePath, "full file path", params.UnicodeString, []string{"file.path = 'C:\\Windows\\System32'"}, nil, nil}, - FilePathStem: {FilePathStem, "full file path without extension", params.UnicodeString, []string{"file.path.stem = 'C:\\Windows\\System32\\cmd'"}, nil, nil}, - FileName: {FileName, "full file name", params.UnicodeString, []string{"file.name contains 'mimikatz'"}, nil, nil}, - FileOperation: {FileOperation, "file operation", params.AnsiString, []string{"file.operation = 'open'"}, nil, nil}, - FileShareMask: {FileShareMask, "file share mask", params.AnsiString, []string{"file.share.mask = 'READ'"}, &Deprecation{Since: "3.1.0", Fields: []Field{FileShareMode}}, nil}, - FileShareMode: {FileShareMask, "file share mode", params.AnsiString, []string{"file.share_mode = 'DENY'"}, nil, nil}, - FileIOSize: {FileIOSize, "file I/O size", params.Uint32, []string{"file.io.size > 512"}, nil, nil}, - FileOffset: {FileOffset, "file offset", params.Uint64, []string{"file.offset = 1024"}, nil, nil}, - FileType: {FileType, "file type", params.AnsiString, []string{"file.type = 'directory'"}, nil, nil}, - FileExtension: {FileExtension, "file extension", params.AnsiString, []string{"file.extension = '.dll'"}, nil, nil}, - FileAttributes: {FileAttributes, "file attributes", params.Slice, []string{"file.attributes in ('archive', 'hidden')"}, nil, nil}, - FileStatus: {FileStatus, "file operation status message", params.UnicodeString, []string{"file.status != 'success'"}, nil, nil}, - FileViewBase: {FileViewBase, "view base address", params.Address, []string{"file.view.base = '25d42170000'"}, nil, nil}, - FileViewSize: {FileViewSize, "size of the mapped view", params.Uint64, []string{"file.view.size > 1024"}, nil, nil}, - FileViewType: {FileViewType, "type of the mapped view section", params.Enum, []string{"file.view.type = 'IMAGE'"}, nil, nil}, - FileViewProtection: {FileViewProtection, "protection rights of the section view", params.AnsiString, []string{"file.view.protection = 'READONLY'"}, nil, nil}, - FileIsDLL: {FileIsDLL, "indicates if the created file is a DLL", params.Bool, []string{"file.is_dll'"}, nil, nil}, - FileIsDriver: {FileIsDriver, "indicates if the created file is a driver", params.Bool, []string{"file.is_driver'"}, nil, nil}, - FileIsExecutable: {FileIsExecutable, "indicates if the created file is an executable", params.Bool, []string{"file.is_exec'"}, nil, nil}, - FilePID: {FilePID, "denotes the process id performing file operation", params.PID, []string{"file.pid = 4"}, nil, nil}, - FileKey: {FileKey, "uniquely identifies the file object", params.Uint64, []string{"file.key = 12446738026482168384"}, nil, nil}, - FileInfoClass: {FileInfoClass, "identifies the file information class", params.Enum, []string{"file.info_class = 'Allocation'"}, nil, nil}, - FileInfoAllocationSize: {FileInfoAllocationSize, "file allocation size", params.Uint64, []string{"file.info.allocation_size > 645400"}, nil, nil}, - FileInfoEOFSize: {FileInfoEOFSize, "file EOF size", params.Uint64, []string{"file.info.eof_size > 1000"}, nil, nil}, - FileInfoIsDispositionDeleteFile: {FileInfoIsDispositionDeleteFile, "indicates if the file is deleted when its handle is closed", params.Bool, []string{"file.info.is_disposition_file_delete = true"}, nil, nil}, - - RegistryPath: {RegistryPath, "fully qualified registry path", params.UnicodeString, []string{"registry.path = 'HKEY_LOCAL_MACHINE\\SYSTEM'"}, nil, nil}, - RegistryKeyName: {RegistryKeyName, "registry key name", params.UnicodeString, []string{"registry.key.name = 'CurrentControlSet'"}, nil, nil}, - RegistryKCB: {RegistryKCB, "registry KCB address", params.Address, []string{"registry.kcb = 'FFFFB905D60C2268'"}, nil, nil}, - RegistryValue: {RegistryValue, "registry value name", params.UnicodeString, []string{"registry.value = 'Epoch'"}, nil, nil}, - RegistryValueType: {RegistryValueType, "type of registry value", params.UnicodeString, []string{"registry.value.type = 'REG_SZ'"}, nil, nil}, - RegistryData: {RegistryData, "registry value captured data", params.Object, []string{"registry.data = '%SystemRoot%'"}, nil, nil}, - RegistryStatus: {RegistryStatus, "status of registry operation", params.UnicodeString, []string{"registry.status != 'success'"}, nil, nil}, - - NetDIP: {NetDIP, "destination IP address", params.IP, []string{"net.dip = 172.17.0.3"}, nil, nil}, - NetSIP: {NetSIP, "source IP address", params.IP, []string{"net.sip = 127.0.0.1"}, nil, nil}, - NetDport: {NetDport, "destination port", params.Uint16, []string{"net.dport in (80, 443, 8080)"}, nil, nil}, - NetSport: {NetSport, "source port", params.Uint16, []string{"net.sport != 3306"}, nil, nil}, - NetDportName: {NetDportName, "destination port name", params.AnsiString, []string{"net.dport.name = 'dns'"}, nil, nil}, - NetSportName: {NetSportName, "source port name", params.AnsiString, []string{"net.sport.name = 'http'"}, nil, nil}, - NetL4Proto: {NetL4Proto, "layer 4 protocol name", params.AnsiString, []string{"net.l4.proto = 'TCP"}, nil, nil}, - NetPacketSize: {NetPacketSize, "packet size", params.Uint32, []string{"net.size > 512"}, nil, nil}, - NetSIPNames: {NetSIPNames, "source IP names", params.Slice, []string{"net.sip.names in ('github.com.')"}, nil, nil}, - NetDIPNames: {NetDIPNames, "destination IP names", params.Slice, []string{"net.dip.names in ('github.com.')"}, nil, nil}, - - PeNumSections: {PeNumSections, "number of sections", params.Uint16, []string{"pe.nsections < 5"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSections}}, nil}, - PeNumSymbols: {PeNumSymbols, "number of entries in the symbol table", params.Uint32, []string{"pe.nsymbols > 230"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeNumSymbols}}, nil}, - PeBaseAddress: {PeBaseAddress, "image base address", params.Address, []string{"pe.address.base = '140000000'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeBaseAddress}}, nil}, - PeEntrypoint: {PeEntrypoint, "address of the entrypoint function", params.Address, []string{"pe.address.entrypoint = '20110'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeEntrypoint}}, nil}, - PeSymbols: {PeSymbols, "imported symbols", params.Slice, []string{"pe.symbols in ('GetTextFaceW', 'GetProcessHeap')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeSymbols}}, nil}, - PeImports: {PeImports, "imported dynamic linked libraries", params.Slice, []string{"pe.imports in ('msvcrt.dll', 'GDI32.dll'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImports}}, nil}, - - PeResources: {PeResources, "version resources", params.Map, []string{"pe.resources[FileDescription] = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeResources}}, &Argument{Optional: true, Pattern: "[a-zA-Z0-9_]+", ValidationFunc: func(s string) bool { - for _, c := range s { - switch { - case unicode.IsLower(c): - case unicode.IsUpper(c): - case unicode.IsNumber(c): - case c == '_': - default: - return false - } - } - return true - }}}, - - PeCompany: {PeCompany, "internal company name of the file provided at compile-time", params.UnicodeString, []string{"pe.company = 'Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCompany}}, nil}, - PeCopyright: {PeCopyright, "copyright notice for the file emitted at compile-time", params.UnicodeString, []string{"pe.copyright = '© Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeCopyright}}, nil}, - PeDescription: {PeDescription, "internal description of the file provided at compile-time", params.UnicodeString, []string{"pe.description = 'Notepad'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeDescription}}, nil}, - PeFileName: {PeFileName, "original file name supplied at compile-time", params.UnicodeString, []string{"pe.file.name = 'NOTEPAD.EXE'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileName}}, nil}, - PeFileVersion: {PeFileVersion, "file version supplied at compile-time", params.UnicodeString, []string{"pe.file.version = '10.0.18362.693 (WinBuild.160101.0800)'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeFileVersion}}, nil}, - PeProduct: {PeProduct, "internal product name of the file provided at compile-time", params.UnicodeString, []string{"pe.product = 'Microsoft® Windows® Operating System'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProduct}}, nil}, - PeProductVersion: {PeProductVersion, "internal product version of the file provided at compile-time", params.UnicodeString, []string{"pe.product.version = '10.0.18362.693'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeProductVersion}}, nil}, - PeIsDLL: {PeIsDLL, "indicates if the loaded image or created file is a DLL", params.Bool, []string{"pe.is_dll'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDLL, ImageIsDLL}}, nil}, - PeIsDriver: {PeIsDriver, "indicates if the loaded image or created file is a driver", params.Bool, []string{"pe.is_driver'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsDriver, ImageIsDriver}}, nil}, - PeIsExecutable: {PeIsExecutable, "indicates if the loaded image or created file is an executable", params.Bool, []string{"pe.is_exec'"}, &Deprecation{Since: "2.0.0", Fields: []Field{FileIsExecutable, ImageIsExecutable}}, nil}, - PeImphash: {PeImphash, "import hash", params.AnsiString, []string{"pe.impash = '5d3861c5c547f8a34e471ba273a732b2'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeImphash}}, nil}, - PeIsDotnet: {PeIsDotnet, "indicates if PE contains CLR data", params.Bool, []string{"pe.is_dotnet"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsDotnet}}, nil}, - PeAnomalies: {PeAnomalies, "contains PE anomalies detected during parsing", params.Slice, []string{"pe.anomalies in ('number of sections is 0')"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeAnomalies}}, nil}, - PeIsSigned: {PeIsSigned, "indicates if the PE has embedded or catalog signature", params.Bool, []string{"pe.is_signed"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureExists}}, nil}, - PeIsTrusted: {PeIsTrusted, "indicates if the PE certificate chain is trusted", params.Bool, []string{"pe.is_trusted"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureTrusted}}, nil}, - PeCertSerial: {PeCertSerial, "PE certificate serial number", params.UnicodeString, []string{"pe.cert.serial = '330000023241fb59996dcc4dff000000000232'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSerial}}, nil}, - PeCertSubject: {PeCertSubject, "PE certificate subject", params.UnicodeString, []string{"pe.cert.subject contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureSubject}}, nil}, - PeCertIssuer: {PeCertIssuer, "PE certificate CA", params.UnicodeString, []string{"pe.cert.issuer contains 'Washington, Redmond, Microsoft Corporation'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureIssuer}}, nil}, - PeCertAfter: {PeCertAfter, "PE certificate expiration date", params.Time, []string{"pe.cert.after contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureAfter}}, nil}, - PeCertBefore: {PeCertBefore, "PE certificate enrollment date", params.Time, []string{"pe.cert.before contains '2024-02-01 00:05:42 +0000 UTC'"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsSignatureBefore}}, nil}, - PeIsModified: {PeIsModified, "indicates if disk and in-memory PE headers differ", params.Bool, []string{"pe.is_modified"}, &Deprecation{Since: "3.0.0", Fields: []Field{PsPeIsModified}}, nil}, - - MemBaseAddress: {MemBaseAddress, "region base address", params.Address, []string{"mem.address = '211d13f2000'"}, nil, nil}, - MemRegionSize: {MemRegionSize, "region size", params.Uint64, []string{"mem.size > 438272"}, nil, nil}, - MemAllocType: {MemAllocType, "region allocation or release type", params.Flags, []string{"mem.alloc = 'COMMIT'"}, nil, nil}, - MemPageType: {MemPageType, "page type of the allocated region", params.Enum, []string{"mem.type = 'PRIVATE'"}, nil, nil}, - MemProtection: {MemProtection, "allocated region protection type", params.Enum, []string{"mem.protection = 'READWRITE'"}, nil, nil}, - MemProtectionMask: {MemProtectionMask, "allocated region protection in mask notation", params.Enum, []string{"mem.protection.mask = 'RWX'"}, nil, nil}, - - DNSName: {DNSName, "dns query name", params.UnicodeString, []string{"dns.name = 'example.org'"}, nil, nil}, - DNSRR: {DNSRR, "dns resource record type", params.AnsiString, []string{"dns.rr = 'AA'"}, nil, nil}, - DNSOptions: {DNSOptions, "dns query options", params.Flags64, []string{"dns.options in ('ADDRCONFIG', 'DUAL_ADDR')"}, nil, nil}, - DNSRcode: {DNSRR, "dns response status", params.AnsiString, []string{"dns.rcode = 'NXDOMAIN'"}, nil, nil}, - DNSAnswers: {DNSAnswers, "dns response answers", params.Slice, []string{"dns.answers in ('o.lencr.edgesuite.net', 'a1887.dscq.akamai.net')"}, nil, nil}, -} - -// ArgumentOf returns argument data for the specified field. -func ArgumentOf(name string) *Argument { - f, ok := fields[Field(name)] - if !ok { - // this can happen for pseudo fields - return nil - } - return f.Argument -} - -// IsField returns true if the provided string is a -// recognized field or pseudo field. Otherwise, it -// returns false. -func IsField(name string) bool { - if _, ok := fields[Field(name)]; ok || IsPseudoField(Field(name)) { - return true - } - return false -} diff --git a/pkg/filter/filter.go b/pkg/filter/filter.go index 95add0fd4..5c33d628e 100644 --- a/pkg/filter/filter.go +++ b/pkg/filter/filter.go @@ -22,7 +22,6 @@ import ( "errors" "expvar" "fmt" - "reflect" "regexp" "strconv" "strings" @@ -101,44 +100,6 @@ type BoundField struct { accessor Accessor } -// Accessor finds exactly one accessor that can serve the bound field. -func (b *BoundField) Accessor(f *filter) Accessor { - if b.accessor != nil { - return b.accessor - } - switch { - case b.Field.Name.IsKevtField(), b.Field.Name.IsEvtField(): - b.accessor = newEventAccessor() - case b.Field.Name.IsPsField(): - for _, accessor := range f.accessors { - if reflect.TypeOf(accessor) == reflect.TypeOf(&psAccessor{}) { - b.accessor = accessor - break - } - } - if b.accessor == nil { - b.accessor = newPSAccessor(nil) - } - case b.Field.Name.IsThreadField(): - b.accessor = newThreadAccessor() - case b.Field.Name.IsImageField(): - b.accessor = newModuleAccessor() - case b.Field.Name.IsFileField(): - b.accessor = newFileAccessor() - case b.Field.Name.IsRegistryField(): - b.accessor = newRegistryAccessor() - case b.Field.Name.IsNetworkField(): - b.accessor = newNetworkAccessor() - case b.Field.Name.IsPeField(): - b.accessor = newPEAccessor() - case b.Field.Name.IsMemField(): - b.accessor = newMemAccessor() - case b.Field.Name.IsDNSField(): - b.accessor = newDNSAccessor() - } - return b.accessor -} - type filter struct { expr ql.Expr seq *ql.Sequence diff --git a/pkg/filter/filter_linux.go b/pkg/filter/filter_linux.go index 652d3d1fc..dee4a5943 100644 --- a/pkg/filter/filter_linux.go +++ b/pkg/filter/filter_linux.go @@ -22,6 +22,7 @@ package filter import ( "fmt" + "reflect" "strings" "github.com/rabbitstack/fibratus/pkg/config" @@ -119,3 +120,33 @@ func NewFromCLIWithAllAccessors(args []string) (Filter, error) { } return filter, nil } + +// Accessor finds exactly one accessor that can serve the bound field. +func (b *BoundField) Accessor(f *filter) Accessor { + if b.accessor != nil { + return b.accessor + } + switch { + case b.Field.Name.IsKevtField(), b.Field.Name.IsEvtField(): + b.accessor = newEventAccessor() + case b.Field.Name.IsPsField(): + for _, accessor := range f.accessors { + if reflect.TypeOf(accessor) == reflect.TypeOf(&psAccessor{}) { + b.accessor = accessor + break + } + } + if b.accessor == nil { + b.accessor = newPSAccessor(nil) + } + case b.Field.Name.IsThreadField(): + b.accessor = newThreadAccessor() + case b.Field.Name.IsFileField(): + b.accessor = newFileAccessor() + case b.Field.Name.IsNetworkField(): + b.accessor = newNetworkAccessor() + case b.Field.Name.IsMemField(): + b.accessor = newMemAccessor() + } + return b.accessor +} diff --git a/pkg/filter/filter_windows.go b/pkg/filter/filter_windows.go index 3f4fadf52..4cbafd5ca 100644 --- a/pkg/filter/filter_windows.go +++ b/pkg/filter/filter_windows.go @@ -20,6 +20,7 @@ package filter import ( "fmt" + "reflect" "strings" "github.com/rabbitstack/fibratus/pkg/config" @@ -134,3 +135,41 @@ func NewFromCLIWithAllAccessors(args []string) (Filter, error) { } return filter, nil } + +// Accessor finds exactly one accessor that can serve the bound field. +func (b *BoundField) Accessor(f *filter) Accessor { + if b.accessor != nil { + return b.accessor + } + switch { + case b.Field.Name.IsKevtField(), b.Field.Name.IsEvtField(): + b.accessor = newEventAccessor() + case b.Field.Name.IsPsField(): + for _, accessor := range f.accessors { + if reflect.TypeOf(accessor) == reflect.TypeOf(&psAccessor{}) { + b.accessor = accessor + break + } + } + if b.accessor == nil { + b.accessor = newPSAccessor(nil) + } + case b.Field.Name.IsThreadField(): + b.accessor = newThreadAccessor() + case b.Field.Name.IsImageField(): + b.accessor = newModuleAccessor() + case b.Field.Name.IsFileField(): + b.accessor = newFileAccessor() + case b.Field.Name.IsRegistryField(): + b.accessor = newRegistryAccessor() + case b.Field.Name.IsNetworkField(): + b.accessor = newNetworkAccessor() + case b.Field.Name.IsPeField(): + b.accessor = newPEAccessor() + case b.Field.Name.IsMemField(): + b.accessor = newMemAccessor() + case b.Field.Name.IsDNSField(): + b.accessor = newDNSAccessor() + } + return b.accessor +} diff --git a/pkg/filter/util_windows.go b/pkg/filter/util_windows.go index 2983997c5..69990d7db 100644 --- a/pkg/filter/util_windows.go +++ b/pkg/filter/util_windows.go @@ -24,9 +24,9 @@ package filter import "github.com/rabbitstack/fibratus/pkg/event" // framePID returns the process identifier associated with the stack frame. -func framePID(e *event.Event) event.PID { +func framePID(e *event.Event) uint32 { if !e.Callstack.IsEmpty() && e.Callstack.FrameAt(0).PID != 0 { - return event.PID(e.Callstack.FrameAt(0).PID) + return e.Callstack.FrameAt(0).PID } return e.PID } diff --git a/pkg/outputs/config.go b/pkg/outputs/config.go index 41850daa6..117bc5c64 100644 --- a/pkg/outputs/config.go +++ b/pkg/outputs/config.go @@ -20,13 +20,40 @@ package outputs import ( "fmt" + + "github.com/rabbitstack/fibratus/pkg/util/mapdecoder" "github.com/spf13/pflag" ) +// ConfigLoader decodes raw config for a single output type when the output is enabled. +type ConfigLoader func(any) (Config, error) + +// ConfigLoaders is the registry of configured outputs. +type ConfigLoaders map[Type]ConfigLoader + // Config contains the output configuration. type Config struct { Type Type - Output interface{} + Output any +} + +// Register registers a new output config loader. +func (loaders ConfigLoaders) Register(typ Type, loader ConfigLoader) { + if _, ok := loaders[typ]; ok { + panic(fmt.Sprintf("output loader %q is already registered", typ)) + } + loaders[typ] = loader +} + +// LoadFromConfig builds an output loader for a config type T, decoding raw into it. +func LoadFromConfig[T any](typ Type) ConfigLoader { + return func(raw any) (Config, error) { + var cfg T + if err := mapdecoder.Decode(raw, &cfg); err != nil { + return Config{}, err + } + return Config{Type: typ, Output: cfg}, nil + } } // TLSConfig stores the client TLS parameters. diff --git a/pkg/ps/snapshotter_impl_windows.go b/pkg/ps/snapshotter_impl_windows.go deleted file mode 100644 index b17179ad4..000000000 --- a/pkg/ps/snapshotter_impl_windows.go +++ /dev/null @@ -1,756 +0,0 @@ -/* - * Copyright 2019-2020 by Nedim Sabic Sabic - * https://www.fibratus.io - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ps - -import ( - "expvar" - "path/filepath" - "strconv" - "strings" - "sync" - "time" - - "github.com/rabbitstack/fibratus/pkg/sys" - "github.com/rabbitstack/fibratus/pkg/util/va" - "golang.org/x/sys/windows" - - "github.com/rabbitstack/fibratus/pkg/config" - "github.com/rabbitstack/fibratus/pkg/event" - "github.com/rabbitstack/fibratus/pkg/event/params" - "github.com/rabbitstack/fibratus/pkg/handle" - htypes "github.com/rabbitstack/fibratus/pkg/handle/types" - "github.com/rabbitstack/fibratus/pkg/pe" - pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" - log "github.com/sirupsen/logrus" -) - -// SystemPID designates the pid of the system process that acts as the container for system threads -const SystemPID uint32 = 4 - -var ( - // reapPeriod specifies the interval for triggering the housekeeping of dead processes - reapPeriod = time.Minute * 2 - - processLookupFailureCount = expvar.NewMap("process.lookup.failure.count") - reapedProcesses = expvar.NewInt("process.reaped") - processCount = expvar.NewInt("process.count") - threadCount = expvar.NewInt("process.thread.count") - moduleCount = expvar.NewInt("process.module.count") - mmapCount = expvar.NewInt("process.mmap.count") - pebReadErrors = expvar.NewInt("process.peb.read.errors") - processEnrichments = expvar.NewInt("process.enrichments") -) - -type snapshotter struct { - mu sync.RWMutex - procs map[uint32]*pstypes.PS - dirty map[uint32]*pstypes.PS - dmu sync.RWMutex - quit chan struct{} - config *config.Config - hsnap handle.Snapshotter - capture bool -} - -// NewSnapshotter returns a new instance of the process snapshotter. -func NewSnapshotter(hsnap handle.Snapshotter, config *config.Config) Snapshotter { - s := &snapshotter{ - procs: make(map[uint32]*pstypes.PS), - dirty: make(map[uint32]*pstypes.PS), - quit: make(chan struct{}, 1), - config: config, - hsnap: hsnap, - } - - s.mu.Lock() - defer s.mu.Unlock() - - s.hsnap.RegisterCreateCallback(s.onHandleCreated) - s.hsnap.RegisterDestroyCallback(s.onHandleDestroyed) - - go s.gcDeadProcesses() - - return s -} - -// NewSnapshotterFromCapture restores the snapshotter state from the cap file. -func NewSnapshotterFromCapture(hsnap handle.Snapshotter, config *config.Config) Snapshotter { - s := &snapshotter{ - procs: make(map[uint32]*pstypes.PS), - dirty: make(map[uint32]*pstypes.PS), - quit: make(chan struct{}, 1), - config: config, - hsnap: hsnap, - capture: true, - } - - s.hsnap.RegisterCreateCallback(s.onHandleCreated) - s.hsnap.RegisterDestroyCallback(s.onHandleDestroyed) - - return s -} - -func (s *snapshotter) WriteFromCapture(e *event.Event) error { - switch e.Type { - case event.CreateProcess, event.ProcessRundown: - s.mu.Lock() - defer s.mu.Unlock() - proc := e.PS - if proc == nil { - return nil - } - pid, err := e.Params.GetPid() - if err != nil { - return err - } - ppid, err := e.Params.GetPpid() - if err != nil { - return err - } - if proc.PID == proc.Ppid || - (e.IsProcessRundown() && pid == sys.InvalidProcessID) { - return nil - } - if e.IsProcessRundown() { - proc.Parent = s.procs[ppid] - } else { - proc, err = s.newProcState(pid, ppid, e) - if err != nil { - return err - } - } - s.procs[pid] = proc - case event.CreateThread, event.ThreadRundown: - return s.AddThread(e) - case event.LoadModule, event.ModuleRundown: - return s.AddModule(e) - } - return nil -} - -func (s *snapshotter) Write(e *event.Event) error { - s.mu.Lock() - defer s.mu.Unlock() - processCount.Add(1) - - pid, err := e.Params.GetPid() - if err != nil { - return err - } - ppid, err := e.Params.GetPpid() - if err != nil { - return err - } - - proc, err := s.newProcState(pid, ppid, e) - if ps := s.procs[pid]; ps == nil && (e.IsCreateProcessInternal() || e.IsProcessRundownInternal()) { - // only modify the state if there is no process derived from the NT kernel logger process events - s.procs[pid] = proc - } else if ps, ok := s.procs[pid]; ok && (e.IsCreateProcessInternal() || e.IsProcessRundownInternal()) && ps.IsCreatedFromSystemLogger { - // process state derived from the core kernel events exists - enrich it - ps.TokenIntegrityLevel = proc.TokenIntegrityLevel - ps.TokenElevationType = proc.TokenElevationType - ps.IsTokenElevated = proc.IsTokenElevated - if strings.EqualFold(ps.Name, filepath.Base(proc.Exe)) && len(proc.Exe) > len(ps.Exe) { - // prefer full executable path - ps.Exe = proc.Exe - } - s.procs[pid] = ps - } else if ps, ok := s.procs[pid]; ok && (e.IsCreateProcess() || e.IsProcessRundown()) && !ps.IsCreatedFromSystemLogger { - // enrich the existing process state with the newly arrived NT kernel logger process events - // but obtain the integrity level and executable path from the previous proc state - processEnrichments.Add(1) - proc.TokenIntegrityLevel = ps.TokenIntegrityLevel - proc.TokenElevationType = ps.TokenElevationType - proc.IsTokenElevated = ps.IsTokenElevated - - if strings.EqualFold(proc.Name, filepath.Base(ps.Exe)) && len(ps.Exe) > len(proc.Exe) { - // prefer full executable path - proc.Exe = ps.Exe - e.AppendParam(params.Exe, params.Path, ps.Exe) - } - - // if the process UUID has been initialized when - // the internal event arrived, reassign it to the - // current process state - proc.AssignUUID(ps) - - e.AppendParam(params.ProcessTokenIntegrityLevel, params.AnsiString, ps.TokenIntegrityLevel) - e.AppendParam(params.ProcessTokenElevationType, params.AnsiString, ps.TokenElevationType) - e.AppendParam(params.ProcessTokenIsElevated, params.Bool, ps.IsTokenElevated) - - s.procs[pid] = proc - } else { - // in all other cases append the process state - s.procs[pid] = proc - } - - // assign process state to the event - e.PS = proc - - return err -} - -func (s *snapshotter) AddThread(e *event.Event) error { - pid, err := e.Params.GetPid() - if err != nil { - return err - } - threadCount.Add(1) - - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[pid] - if !ok { - return nil - } - - thread := pstypes.Thread{} - thread.Tid, _ = e.Params.GetTid() - thread.UstackBase = e.Params.TryGetAddress(params.UstackBase) - thread.UstackLimit = e.Params.TryGetAddress(params.UstackLimit) - thread.KstackBase = e.Params.TryGetAddress(params.KstackBase) - thread.KstackLimit = e.Params.TryGetAddress(params.KstackLimit) - thread.IOPrio, _ = e.Params.GetUint8(params.IOPrio) - thread.BasePrio, _ = e.Params.GetUint8(params.BasePrio) - thread.PagePrio, _ = e.Params.GetUint8(params.PagePrio) - thread.StartAddress = e.Params.TryGetAddress(params.StartAddress) - - proc.AddThread(thread) - - return nil -} - -func (s *snapshotter) AddModule(e *event.Event) error { - pid, err := e.Params.GetPid() - if err != nil { - return err - } - s.mu.Lock() - defer s.mu.Unlock() - - if pid == 0 && e.IsModuleRundown() { - // assume system process if pid is zero - pid = SystemPID - } - proc, ok := s.procs[pid] - if !ok { - return nil - } - - module := pstypes.Module{} - module.Size, _ = e.Params.GetUint64(params.ModuleSize) - module.Checksum, _ = e.Params.GetUint32(params.ModuleCheckSum) - module.TimedateStamp, _ = e.Params.GetUint32(params.ModuleTimeDateStamp) - module.Name = e.GetParamAsString(params.ModulePath) - module.BaseAddress = e.Params.TryGetAddress(params.ModuleBase) - module.DefaultBaseAddress = e.Params.TryGetAddress(params.ModuleDefaultBase) - - if e.IsLoadModuleInternal() { - proc.AddModule(module) - return nil - } - - moduleCount.Add(1) - - module.SignatureLevel, _ = e.Params.GetUint32(params.ModuleSignatureLevel) - module.SignatureType, _ = e.Params.GetUint32(params.ModuleSignatureType) - - if strings.EqualFold(proc.Name, filepath.Base(module.Name)) && len(proc.Exe) < len(module.Name) { - // if the module is loaded for the process executable, and - // we don't have the full executable path, override with - // the one from the Module path - proc.Exe = module.Name - } - - proc.AddModule(module) - - return nil -} - -func (s *snapshotter) RemoveThread(pid uint32, tid uint32) error { - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[pid] - if !ok { - return nil - } - proc.RemoveThread(tid) - threadCount.Add(-1) - return nil -} - -func (s *snapshotter) RemoveModule(pid uint32, addr va.Address) error { - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[pid] - if !ok { - return nil - } - proc.RemoveModule(addr) - moduleCount.Add(-1) - return nil -} - -func (s *snapshotter) FindModule(addr va.Address) (bool, *pstypes.Module) { - s.mu.RLock() - defer s.mu.RUnlock() - for _, proc := range s.procs { - for _, mod := range proc.Modules { - if mod.BaseAddress == addr { - return true, &mod - } - } - } - return false, nil -} - -func (s *snapshotter) FindAllModules() map[string]pstypes.Module { - s.mu.RLock() - defer s.mu.RUnlock() - mods := make(map[string]pstypes.Module) - for _, proc := range s.procs { - for _, mod := range proc.Modules { - if _, ok := mods[mod.Name]; ok { - continue - } - mods[mod.Name] = mod - } - } - return mods -} - -func (s *snapshotter) AddMmap(e *event.Event) error { - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[e.PID] - if !ok { - return nil - } - - mmapCount.Add(1) - - mmap := pstypes.Mmap{} - mmap.File = e.GetParamAsString(params.FilePath) - mmap.BaseAddress = e.Params.TryGetAddress(params.FileViewBase) - mmap.Size, _ = e.Params.GetUint64(params.FileViewSize) - mmap.Protection, _ = e.Params.GetUint32(params.MemProtect) - mmap.Type = e.GetParamAsString(params.FileViewSectionType) - - proc.AddMmap(mmap) - - return nil -} - -func (s *snapshotter) RemoveMmap(pid uint32, addr va.Address) error { - s.mu.Lock() - defer s.mu.Unlock() - proc, ok := s.procs[pid] - if !ok { - return nil - } - mmapCount.Add(-1) - proc.RemoveMmap(addr) - return nil -} - -func (s *snapshotter) Close() error { - s.quit <- struct{}{} - return nil -} - -func (s *snapshotter) newProcState(pid, ppid uint32, e *event.Event) (*pstypes.PS, error) { - if e.IsCreateProcessInternal() || e.IsProcessRundownInternal() { - proc := &pstypes.PS{ - PID: pid, - Ppid: ppid, - Exe: e.GetParamAsString(params.Exe), - Name: filepath.Base(e.GetParamAsString(params.Exe)), - TokenIntegrityLevel: e.GetParamAsString(params.ProcessTokenIntegrityLevel), - TokenElevationType: e.GetParamAsString(params.ProcessTokenElevationType), - IsTokenElevated: e.Params.TryGetBool(params.ProcessTokenIsElevated), - Threads: make(map[uint32]pstypes.Thread), - Modules: make([]pstypes.Module, 0), - Handles: make([]htypes.Handle, 0), - Mmaps: make([]pstypes.Mmap, 0), - } - - return proc, nil - } - - proc := pstypes.New( - pid, - ppid, - e.GetParamAsString(params.ProcessName), - e.GetParamAsString(params.Cmdline), - e.GetParamAsString(params.Exe), - e.Params.MustGetSID(), - e.Params.MustGetUint32(params.SessionID), - ) - - proc.Parent = s.procs[ppid] - proc.StartTime, _ = e.Params.GetTime(params.StartTime) - proc.IsWOW64 = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsWOW64) != 0 - proc.IsPackaged = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsPackaged) != 0 - proc.IsProtected = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsProtected) != 0 - proc.IsCreatedFromSystemLogger = true - - if !s.capture { - if proc.Username != "" { - e.AppendParam(params.Username, params.UnicodeString, proc.Username) - } - if proc.Domain != "" { - e.AppendParam(params.Domain, params.UnicodeString, proc.Domain) - } - // retrieve process handles - var err error - proc.Handles, err = s.hsnap.FindHandles(pid) - if err != nil { - return proc, err - } - } - - // return early if we're reading from the capture file - if s.capture { - // reset username/domain from captured event parameters - proc.Domain = e.GetParamAsString(params.Domain) - proc.Username = e.GetParamAsString(params.Username) - return proc, nil - } - - // retrieve Portable Executable data - var err error - proc.PE, err = pe.ParseFileWithConfig(proc.Exe, s.config.PE) - if err != nil { - return proc, err - } - - // try to read the PEB (Process Environment Block) - // to access environment variables and the process - // current working directory - access := uint32(windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ) - process, err := windows.OpenProcess(access, false, pid) - if err != nil { - process, err = windows.OpenProcess(windows.PROCESS_QUERY_INFORMATION, false, pid) - if err != nil { - return proc, nil - } - } - //nolint:errcheck - defer windows.CloseHandle(process) - - // query token attributes if not enriched by internal event - if s.procs[pid] == nil { - var token windows.Token - err = windows.OpenProcessToken(process, windows.TOKEN_QUERY, &token) - if err != nil { - goto readPEB - } - defer token.Close() - - // get process token integrity level - tokenMandatoryLabel, err := sys.GetProcessTokenInformation[windows.Tokenmandatorylabel](token, windows.TokenIntegrityLevel) - if err != nil { - goto readPEB - } - - proc.TokenIntegrityLevel = sys.RidToString(tokenMandatoryLabel.Label.Sid) - proc.IsTokenElevated = token.IsElevated() - - e.AppendParam(params.ProcessTokenIntegrityLevel, params.AnsiString, proc.TokenIntegrityLevel) - e.AppendParam(params.ProcessTokenIsElevated, params.Bool, proc.IsTokenElevated) - } - -readPEB: - // read PEB (Process Environment Block) - peb, err := ReadPEB(process) - if err != nil { - pebReadErrors.Add(1) - return proc, err - } - proc.Envs = peb.GetEnvs() - proc.Cwd = peb.GetCurrentWorkingDirectory() - - return proc, nil -} - -func (s *snapshotter) Remove(e *event.Event) error { - s.mu.Lock() - defer s.mu.Unlock() - pid, err := e.Params.GetPid() - if err != nil { - return err - } - // remove process from primary map and - // move to dirty map. This is required - // to prevent dropping process state from - // events when TerminateProcess event is - // emitted before subsequent events - if proc := s.procs[pid]; proc != nil { - s.dmu.Lock() - defer s.dmu.Unlock() - s.dirty[pid] = proc - // schedule removal - remove := func(pid uint32) func() { - return func() { - s.dmu.Lock() - defer s.dmu.Unlock() - if ps, ok := s.dirty[pid]; ok { - delete(s.dirty, pid) - log.Debugf("dirty process removed: %s. Dirty procs: %d", ps.Name, len(s.dirty)) - } - } - } - time.AfterFunc(time.Second*5, remove(pid)) - } - delete(s.procs, pid) - processCount.Add(-1) - // reset parent if it died after spawning a process - for procID, proc := range s.procs { - if proc.Ppid == pid { - s.procs[procID].Parent = nil - } - } - return nil -} - -func (s *snapshotter) Put(proc *pstypes.PS) { - if proc != nil { - s.mu.Lock() - defer s.mu.Unlock() - s.procs[proc.PID] = proc - } -} - -func (s *snapshotter) FindAndPut(pid uint32) *pstypes.PS { - ok, proc := s.Find(pid) - if !ok { - s.Put(proc) - } - return proc -} - -func (s *snapshotter) Find(pid uint32) (bool, *pstypes.PS) { - s.mu.RLock() - defer s.mu.RUnlock() - ps, ok := s.procs[pid] - if ok { - return true, ps - } - if s.capture || pid == sys.InvalidProcessID { - return false, nil - } - - // check if the process is in dirty map - s.dmu.RLock() - defer s.dmu.RUnlock() - if ps := s.dirty[pid]; ps != nil { - return true, ps - } - - processLookupFailureCount.Add(strconv.Itoa(int(pid)), 1) - - proc := &pstypes.PS{ - PID: pid, - Ppid: sys.InvalidProcessID, - Threads: make(map[uint32]pstypes.Thread), - Modules: make([]pstypes.Module, 0), - Handles: make([]htypes.Handle, 0), - } - - getProcExecutable := func(process windows.Handle) (string, string) { - var size uint32 = windows.MAX_PATH - n := make([]uint16, size) - err := windows.QueryFullProcessImageName(process, 0, &n[0], &size) - if err != nil { - return "", "" - } - return windows.UTF16ToString(n), filepath.Base(windows.UTF16ToString(n)) - } - - access := uint32(windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ) - process, err := windows.OpenProcess(access, false, pid) - if err != nil { - // the access to protected / system process can't be achieved - // through `PROCESS_VM_READ` or `PROCESS_QUERY_INFORMATION` flags. - // Try to acquire the process handle again but with restricted access - // rights to be able to obtain other attributes such as the full process's - // Module executable path or process times - process, err = windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, pid) - if err != nil { - return false, nil - } - } - //nolint:errcheck - defer windows.CloseHandle(process) - - // get process executable full path and name - proc.Exe, proc.Name = getProcExecutable(process) - - // consult process parent id - info, err := sys.QueryInformationProcess[windows.PROCESS_BASIC_INFORMATION](process, windows.ProcessBasicInformation) - if err != nil { - return false, proc - } - proc.Ppid = uint32(info.InheritedFromUniqueProcessId) - - // retrieve Portable Executable data - proc.PE, err = pe.ParseFileWithConfig(proc.Exe, s.config.PE) - if err != nil { - return false, proc - } - - // get process times - var ( - ct windows.Filetime - xt windows.Filetime - kt windows.Filetime - ut windows.Filetime - ) - err = windows.GetProcessTimes(process, &ct, &xt, &kt, &ut) - if err != nil { - return false, proc - } - proc.StartTime = time.Unix(0, ct.Nanoseconds()) - - // get process creation attributes - var isWOW64 bool - if err := windows.IsWow64Process(process, &isWOW64); err == nil && isWOW64 { - proc.IsWOW64 = true - } - if isPackaged, err := sys.IsProcessPackaged(process); err == nil && isPackaged { - proc.IsPackaged = true - } - if prot, err := sys.QueryInformationProcess[sys.PsProtection](process, sys.ProcessProtectionInformation); err == nil && prot != nil { - proc.IsProtected = prot.IsProtected() - } - - // get process token attributes - var ( - token windows.Token - tokenUser *windows.Tokenuser - tokenMandatoryLabel *windows.Tokenmandatorylabel - ) - - err = windows.OpenProcessToken(process, windows.TOKEN_QUERY, &token) - if err != nil { - goto readPEB - } - defer token.Close() - tokenUser, err = token.GetTokenUser() - if err != nil { - goto readPEB - } - proc.SID = tokenUser.User.Sid.String() - proc.Username, proc.Domain, _, _ = tokenUser.User.Sid.LookupAccount("") - - // get process token integrity level - tokenMandatoryLabel, err = sys.GetProcessTokenInformation[windows.Tokenmandatorylabel](token, windows.TokenIntegrityLevel) - if err != nil { - goto readPEB - } - - proc.TokenIntegrityLevel = sys.RidToString(tokenMandatoryLabel.Label.Sid) - proc.IsTokenElevated = token.IsElevated() - - // retrieve process handles - proc.Handles, err = s.hsnap.FindHandles(pid) - if err != nil { - goto readPEB - } - -readPEB: - // read PEB (Process Environment Block) - peb, err := ReadPEB(process) - if err != nil { - pebReadErrors.Add(1) - return false, proc - } - proc.Envs = peb.GetEnvs() - proc.Cmdline = peb.GetCommandLine() - proc.SessionID = peb.GetSessionID() - proc.Cwd = peb.GetCurrentWorkingDirectory() - - return false, proc -} - -func (s *snapshotter) Size() uint32 { - s.mu.RLock() - defer s.mu.RUnlock() - return uint32(len(s.procs)) -} - -// gcDeadProcesses periodically scans the map of the snapshot's processes and removes -// any terminated processes from it. This guarantees that any leftovers are cleaned-up -// in case we miss process' terminate events. -func (s *snapshotter) gcDeadProcesses() { - tick := time.NewTicker(reapPeriod) - for { - select { - case <-tick.C: - s.mu.Lock() - ss := len(s.procs) - log.Debugf("scanning for dead processes on the snapshot of %d items", ss) - - for pid := range s.procs { - proc, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, pid) - if err != nil { - continue - } - if !sys.IsProcessRunning(proc) { - delete(s.procs, pid) - } - _ = windows.CloseHandle(proc) - } - - if ss > len(s.procs) { - reaped := ss - len(s.procs) - reapedProcesses.Add(int64(reaped)) - log.Debugf("%d dead process(es) reaped", reaped) - } - s.mu.Unlock() - case <-s.quit: - tick.Stop() - } - } -} - -func (s *snapshotter) onHandleCreated(pid uint32, handle htypes.Handle) { - s.mu.RLock() - ps, ok := s.procs[pid] - s.mu.RUnlock() - if ok { - s.mu.Lock() - defer s.mu.Unlock() - ps.AddHandle(handle) - s.procs[pid] = ps - } -} - -func (s *snapshotter) onHandleDestroyed(pid uint32, rawHandle windows.Handle) { - s.mu.RLock() - ps, ok := s.procs[pid] - s.mu.RUnlock() - if ok { - s.mu.Lock() - defer s.mu.Unlock() - ps.RemoveHandle(rawHandle) - s.procs[pid] = ps - } -} diff --git a/pkg/ps/snapshotter_linux.go b/pkg/ps/snapshotter_linux.go index d1f49bcb7..2f872399c 100644 --- a/pkg/ps/snapshotter_linux.go +++ b/pkg/ps/snapshotter_linux.go @@ -35,10 +35,10 @@ type Snapshotter interface { // Remove deletes process state for the event process identifier. Remove(*event.Event) error // Find attempts to retrieve process state for the specified process identifier. - Find(pid uint64) (bool, *pstypes.PS) + Find(pid uint32) (bool, *pstypes.PS) // FindAndPut retrieves process state. Procfs fallback enrichment will be added // when Linux capture is wired. - FindAndPut(pid uint64) *pstypes.PS + FindAndPut(pid uint32) *pstypes.PS // Put inserts the process state into the snapshotter. Put(*pstypes.PS) // Size returns the total number of process state items. @@ -48,31 +48,31 @@ type Snapshotter interface { // AddThread builds thread state from the event representation. AddThread(*event.Event) error // RemoveThread removes the thread from the given process. - RemoveThread(pid uint64, tid uint64) error + RemoveThread(pid uint32, tid uint32) error // AddMmap adds a memory mapping to the process state. AddMmap(*event.Event) error // RemoveMmap removes a memory mapping at the given base address. - RemoveMmap(pid uint64, addr va.Address) error + RemoveMmap(pid uint32, addr va.Address) error } type snapshotter struct { mu sync.RWMutex - procs map[uint64]*pstypes.PS + procs map[uint32]*pstypes.PS } // NewSnapshotter builds an in-memory Linux process snapshotter. func NewSnapshotter() Snapshotter { - return &snapshotter{procs: make(map[uint64]*pstypes.PS)} + return &snapshotter{procs: make(map[uint32]*pstypes.PS)} } -func (s *snapshotter) Find(pid uint64) (bool, *pstypes.PS) { +func (s *snapshotter) Find(pid uint32) (bool, *pstypes.PS) { s.mu.RLock() defer s.mu.RUnlock() ps, ok := s.procs[pid] return ok, ps } -func (s *snapshotter) FindAndPut(pid uint64) *pstypes.PS { +func (s *snapshotter) FindAndPut(pid uint32) *pstypes.PS { ok, ps := s.Find(pid) if !ok { return nil @@ -116,7 +116,7 @@ func (s *snapshotter) Size() uint32 { func (s *snapshotter) Close() error { s.mu.Lock() defer s.mu.Unlock() - s.procs = make(map[uint64]*pstypes.PS) + s.procs = make(map[uint32]*pstypes.PS) return nil } @@ -133,7 +133,7 @@ func (s *snapshotter) AddThread(evt *event.Event) error { return nil } -func (s *snapshotter) RemoveThread(pid uint64, tid uint64) error { +func (s *snapshotter) RemoveThread(pid uint32, tid uint32) error { ok, ps := s.Find(pid) if !ok || ps == nil { return nil @@ -157,7 +157,7 @@ func (s *snapshotter) AddMmap(evt *event.Event) error { return nil } -func (s *snapshotter) RemoveMmap(pid uint64, addr va.Address) error { +func (s *snapshotter) RemoveMmap(pid uint32, addr va.Address) error { ok, ps := s.Find(pid) if !ok || ps == nil { return nil diff --git a/pkg/ps/snapshotter_windows.go b/pkg/ps/snapshotter_windows.go index 34f7997fa..ac5cb65d2 100644 --- a/pkg/ps/snapshotter_windows.go +++ b/pkg/ps/snapshotter_windows.go @@ -1,7 +1,5 @@ -//go:build windows - /* - * Copyright 2020-2021 by Nedim Sabic Sabic + * Copyright 2019-2020 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -21,9 +19,42 @@ package ps import ( + "expvar" + "path/filepath" + "strconv" + "strings" + "sync" + "time" + + "github.com/rabbitstack/fibratus/pkg/sys" + "github.com/rabbitstack/fibratus/pkg/util/va" + "golang.org/x/sys/windows" + + "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/event" + "github.com/rabbitstack/fibratus/pkg/event/params" + "github.com/rabbitstack/fibratus/pkg/handle" + htypes "github.com/rabbitstack/fibratus/pkg/handle/types" + "github.com/rabbitstack/fibratus/pkg/pe" pstypes "github.com/rabbitstack/fibratus/pkg/ps/types" - "github.com/rabbitstack/fibratus/pkg/util/va" + log "github.com/sirupsen/logrus" +) + +// SystemPID designates the pid of the system process that acts as the container for system threads +const SystemPID uint32 = 4 + +var ( + // reapPeriod specifies the interval for triggering the housekeeping of dead processes + reapPeriod = time.Minute * 2 + + processLookupFailureCount = expvar.NewMap("process.lookup.failure.count") + reapedProcesses = expvar.NewInt("process.reaped") + processCount = expvar.NewInt("process.count") + threadCount = expvar.NewInt("process.thread.count") + moduleCount = expvar.NewInt("process.module.count") + mmapCount = expvar.NewInt("process.mmap.count") + pebReadErrors = expvar.NewInt("process.peb.read.errors") + processEnrichments = expvar.NewInt("process.enrichments") ) // Snapshotter is the interface that exposes a set of methods all process snapshotters have to satisfy. It stores the state @@ -69,3 +100,701 @@ type Snapshotter interface { // Close closes process snapshotter and disposes all allocated resources. Close() error } + +type snapshotter struct { + mu sync.RWMutex + procs map[uint32]*pstypes.PS + dirty map[uint32]*pstypes.PS + dmu sync.RWMutex + quit chan struct{} + config *config.Config + hsnap handle.Snapshotter + capture bool +} + +// NewSnapshotter returns a new instance of the process snapshotter. +func NewSnapshotter(hsnap handle.Snapshotter, config *config.Config) Snapshotter { + s := &snapshotter{ + procs: make(map[uint32]*pstypes.PS), + dirty: make(map[uint32]*pstypes.PS), + quit: make(chan struct{}, 1), + config: config, + hsnap: hsnap, + } + + s.mu.Lock() + defer s.mu.Unlock() + + s.hsnap.RegisterCreateCallback(s.onHandleCreated) + s.hsnap.RegisterDestroyCallback(s.onHandleDestroyed) + + go s.gcDeadProcesses() + + return s +} + +// NewSnapshotterFromCapture restores the snapshotter state from the cap file. +func NewSnapshotterFromCapture(hsnap handle.Snapshotter, config *config.Config) Snapshotter { + s := &snapshotter{ + procs: make(map[uint32]*pstypes.PS), + dirty: make(map[uint32]*pstypes.PS), + quit: make(chan struct{}, 1), + config: config, + hsnap: hsnap, + capture: true, + } + + s.hsnap.RegisterCreateCallback(s.onHandleCreated) + s.hsnap.RegisterDestroyCallback(s.onHandleDestroyed) + + return s +} + +func (s *snapshotter) WriteFromCapture(e *event.Event) error { + switch e.Type { + case event.CreateProcess, event.ProcessRundown: + s.mu.Lock() + defer s.mu.Unlock() + proc := e.PS + if proc == nil { + return nil + } + pid, err := e.Params.GetPid() + if err != nil { + return err + } + ppid, err := e.Params.GetPpid() + if err != nil { + return err + } + if proc.PID == proc.Ppid || + (e.IsProcessRundown() && pid == sys.InvalidProcessID) { + return nil + } + if e.IsProcessRundown() { + proc.Parent = s.procs[ppid] + } else { + proc, err = s.newProcState(pid, ppid, e) + if err != nil { + return err + } + } + s.procs[pid] = proc + case event.CreateThread, event.ThreadRundown: + return s.AddThread(e) + case event.LoadModule, event.ModuleRundown: + return s.AddModule(e) + } + return nil +} + +func (s *snapshotter) Write(e *event.Event) error { + s.mu.Lock() + defer s.mu.Unlock() + processCount.Add(1) + + pid, err := e.Params.GetPid() + if err != nil { + return err + } + ppid, err := e.Params.GetPpid() + if err != nil { + return err + } + + proc, err := s.newProcState(pid, ppid, e) + if ps := s.procs[pid]; ps == nil && (e.IsCreateProcessInternal() || e.IsProcessRundownInternal()) { + // only modify the state if there is no process derived from the NT kernel logger process events + s.procs[pid] = proc + } else if ps, ok := s.procs[pid]; ok && (e.IsCreateProcessInternal() || e.IsProcessRundownInternal()) && ps.IsCreatedFromSystemLogger { + // process state derived from the core kernel events exists - enrich it + ps.TokenIntegrityLevel = proc.TokenIntegrityLevel + ps.TokenElevationType = proc.TokenElevationType + ps.IsTokenElevated = proc.IsTokenElevated + if strings.EqualFold(ps.Name, filepath.Base(proc.Exe)) && len(proc.Exe) > len(ps.Exe) { + // prefer full executable path + ps.Exe = proc.Exe + } + s.procs[pid] = ps + } else if ps, ok := s.procs[pid]; ok && (e.IsCreateProcess() || e.IsProcessRundown()) && !ps.IsCreatedFromSystemLogger { + // enrich the existing process state with the newly arrived NT kernel logger process events + // but obtain the integrity level and executable path from the previous proc state + processEnrichments.Add(1) + proc.TokenIntegrityLevel = ps.TokenIntegrityLevel + proc.TokenElevationType = ps.TokenElevationType + proc.IsTokenElevated = ps.IsTokenElevated + + if strings.EqualFold(proc.Name, filepath.Base(ps.Exe)) && len(ps.Exe) > len(proc.Exe) { + // prefer full executable path + proc.Exe = ps.Exe + e.AppendParam(params.Exe, params.Path, ps.Exe) + } + + // if the process UUID has been initialized when + // the internal event arrived, reassign it to the + // current process state + proc.AssignUUID(ps) + + e.AppendParam(params.ProcessTokenIntegrityLevel, params.AnsiString, ps.TokenIntegrityLevel) + e.AppendParam(params.ProcessTokenElevationType, params.AnsiString, ps.TokenElevationType) + e.AppendParam(params.ProcessTokenIsElevated, params.Bool, ps.IsTokenElevated) + + s.procs[pid] = proc + } else { + // in all other cases append the process state + s.procs[pid] = proc + } + + // assign process state to the event + e.PS = proc + + return err +} + +func (s *snapshotter) AddThread(e *event.Event) error { + pid, err := e.Params.GetPid() + if err != nil { + return err + } + threadCount.Add(1) + + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[pid] + if !ok { + return nil + } + + thread := pstypes.Thread{} + thread.Tid, _ = e.Params.GetTid() + thread.UstackBase = e.Params.TryGetAddress(params.UstackBase) + thread.UstackLimit = e.Params.TryGetAddress(params.UstackLimit) + thread.KstackBase = e.Params.TryGetAddress(params.KstackBase) + thread.KstackLimit = e.Params.TryGetAddress(params.KstackLimit) + thread.IOPrio, _ = e.Params.GetUint8(params.IOPrio) + thread.BasePrio, _ = e.Params.GetUint8(params.BasePrio) + thread.PagePrio, _ = e.Params.GetUint8(params.PagePrio) + thread.StartAddress = e.Params.TryGetAddress(params.StartAddress) + + proc.AddThread(thread) + + return nil +} + +func (s *snapshotter) AddModule(e *event.Event) error { + pid, err := e.Params.GetPid() + if err != nil { + return err + } + s.mu.Lock() + defer s.mu.Unlock() + + if pid == 0 && e.IsModuleRundown() { + // assume system process if pid is zero + pid = SystemPID + } + proc, ok := s.procs[pid] + if !ok { + return nil + } + + module := pstypes.Module{} + module.Size, _ = e.Params.GetUint64(params.ModuleSize) + module.Checksum, _ = e.Params.GetUint32(params.ModuleCheckSum) + module.TimedateStamp, _ = e.Params.GetUint32(params.ModuleTimeDateStamp) + module.Name = e.GetParamAsString(params.ModulePath) + module.BaseAddress = e.Params.TryGetAddress(params.ModuleBase) + module.DefaultBaseAddress = e.Params.TryGetAddress(params.ModuleDefaultBase) + + if e.IsLoadModuleInternal() { + proc.AddModule(module) + return nil + } + + moduleCount.Add(1) + + module.SignatureLevel, _ = e.Params.GetUint32(params.ModuleSignatureLevel) + module.SignatureType, _ = e.Params.GetUint32(params.ModuleSignatureType) + + if strings.EqualFold(proc.Name, filepath.Base(module.Name)) && len(proc.Exe) < len(module.Name) { + // if the module is loaded for the process executable, and + // we don't have the full executable path, override with + // the one from the Module path + proc.Exe = module.Name + } + + proc.AddModule(module) + + return nil +} + +func (s *snapshotter) RemoveThread(pid uint32, tid uint32) error { + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[pid] + if !ok { + return nil + } + proc.RemoveThread(tid) + threadCount.Add(-1) + return nil +} + +func (s *snapshotter) RemoveModule(pid uint32, addr va.Address) error { + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[pid] + if !ok { + return nil + } + proc.RemoveModule(addr) + moduleCount.Add(-1) + return nil +} + +func (s *snapshotter) FindModule(addr va.Address) (bool, *pstypes.Module) { + s.mu.RLock() + defer s.mu.RUnlock() + for _, proc := range s.procs { + for _, mod := range proc.Modules { + if mod.BaseAddress == addr { + return true, &mod + } + } + } + return false, nil +} + +func (s *snapshotter) FindAllModules() map[string]pstypes.Module { + s.mu.RLock() + defer s.mu.RUnlock() + mods := make(map[string]pstypes.Module) + for _, proc := range s.procs { + for _, mod := range proc.Modules { + if _, ok := mods[mod.Name]; ok { + continue + } + mods[mod.Name] = mod + } + } + return mods +} + +func (s *snapshotter) AddMmap(e *event.Event) error { + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[e.PID] + if !ok { + return nil + } + + mmapCount.Add(1) + + mmap := pstypes.Mmap{} + mmap.File = e.GetParamAsString(params.FilePath) + mmap.BaseAddress = e.Params.TryGetAddress(params.FileViewBase) + mmap.Size, _ = e.Params.GetUint64(params.FileViewSize) + mmap.Protection, _ = e.Params.GetUint32(params.MemProtect) + mmap.Type = e.GetParamAsString(params.FileViewSectionType) + + proc.AddMmap(mmap) + + return nil +} + +func (s *snapshotter) RemoveMmap(pid uint32, addr va.Address) error { + s.mu.Lock() + defer s.mu.Unlock() + proc, ok := s.procs[pid] + if !ok { + return nil + } + mmapCount.Add(-1) + proc.RemoveMmap(addr) + return nil +} + +func (s *snapshotter) Close() error { + s.quit <- struct{}{} + return nil +} + +func (s *snapshotter) newProcState(pid, ppid uint32, e *event.Event) (*pstypes.PS, error) { + if e.IsCreateProcessInternal() || e.IsProcessRundownInternal() { + proc := &pstypes.PS{ + PID: pid, + Ppid: ppid, + Exe: e.GetParamAsString(params.Exe), + Name: filepath.Base(e.GetParamAsString(params.Exe)), + TokenIntegrityLevel: e.GetParamAsString(params.ProcessTokenIntegrityLevel), + TokenElevationType: e.GetParamAsString(params.ProcessTokenElevationType), + IsTokenElevated: e.Params.TryGetBool(params.ProcessTokenIsElevated), + Threads: make(map[uint32]pstypes.Thread), + Modules: make([]pstypes.Module, 0), + Handles: make([]htypes.Handle, 0), + Mmaps: make([]pstypes.Mmap, 0), + } + + return proc, nil + } + + proc := pstypes.New( + pid, + ppid, + e.GetParamAsString(params.ProcessName), + e.GetParamAsString(params.Cmdline), + e.GetParamAsString(params.Exe), + e.Params.MustGetSID(), + e.Params.MustGetUint32(params.SessionID), + ) + + proc.Parent = s.procs[ppid] + proc.StartTime, _ = e.Params.GetTime(params.StartTime) + proc.IsWOW64 = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsWOW64) != 0 + proc.IsPackaged = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsPackaged) != 0 + proc.IsProtected = (e.Params.MustGetUint32(params.ProcessFlags) & event.PsProtected) != 0 + proc.IsCreatedFromSystemLogger = true + + if !s.capture { + if proc.Username != "" { + e.AppendParam(params.Username, params.UnicodeString, proc.Username) + } + if proc.Domain != "" { + e.AppendParam(params.Domain, params.UnicodeString, proc.Domain) + } + // retrieve process handles + var err error + proc.Handles, err = s.hsnap.FindHandles(pid) + if err != nil { + return proc, err + } + } + + // return early if we're reading from the capture file + if s.capture { + // reset username/domain from captured event parameters + proc.Domain = e.GetParamAsString(params.Domain) + proc.Username = e.GetParamAsString(params.Username) + return proc, nil + } + + // retrieve Portable Executable data + var err error + proc.PE, err = pe.ParseFileWithConfig(proc.Exe, s.config.PE) + if err != nil { + return proc, err + } + + // try to read the PEB (Process Environment Block) + // to access environment variables and the process + // current working directory + access := uint32(windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ) + process, err := windows.OpenProcess(access, false, pid) + if err != nil { + process, err = windows.OpenProcess(windows.PROCESS_QUERY_INFORMATION, false, pid) + if err != nil { + return proc, nil + } + } + //nolint:errcheck + defer windows.CloseHandle(process) + + // query token attributes if not enriched by internal event + if s.procs[pid] == nil { + var token windows.Token + err = windows.OpenProcessToken(process, windows.TOKEN_QUERY, &token) + if err != nil { + goto readPEB + } + defer token.Close() + + // get process token integrity level + tokenMandatoryLabel, err := sys.GetProcessTokenInformation[windows.Tokenmandatorylabel](token, windows.TokenIntegrityLevel) + if err != nil { + goto readPEB + } + + proc.TokenIntegrityLevel = sys.RidToString(tokenMandatoryLabel.Label.Sid) + proc.IsTokenElevated = token.IsElevated() + + e.AppendParam(params.ProcessTokenIntegrityLevel, params.AnsiString, proc.TokenIntegrityLevel) + e.AppendParam(params.ProcessTokenIsElevated, params.Bool, proc.IsTokenElevated) + } + +readPEB: + // read PEB (Process Environment Block) + peb, err := ReadPEB(process) + if err != nil { + pebReadErrors.Add(1) + return proc, err + } + proc.Envs = peb.GetEnvs() + proc.Cwd = peb.GetCurrentWorkingDirectory() + + return proc, nil +} + +func (s *snapshotter) Remove(e *event.Event) error { + s.mu.Lock() + defer s.mu.Unlock() + pid, err := e.Params.GetPid() + if err != nil { + return err + } + // remove process from primary map and + // move to dirty map. This is required + // to prevent dropping process state from + // events when TerminateProcess event is + // emitted before subsequent events + if proc := s.procs[pid]; proc != nil { + s.dmu.Lock() + defer s.dmu.Unlock() + s.dirty[pid] = proc + // schedule removal + remove := func(pid uint32) func() { + return func() { + s.dmu.Lock() + defer s.dmu.Unlock() + if ps, ok := s.dirty[pid]; ok { + delete(s.dirty, pid) + log.Debugf("dirty process removed: %s. Dirty procs: %d", ps.Name, len(s.dirty)) + } + } + } + time.AfterFunc(time.Second*5, remove(pid)) + } + delete(s.procs, pid) + processCount.Add(-1) + // reset parent if it died after spawning a process + for procID, proc := range s.procs { + if proc.Ppid == pid { + s.procs[procID].Parent = nil + } + } + return nil +} + +func (s *snapshotter) Put(proc *pstypes.PS) { + if proc != nil { + s.mu.Lock() + defer s.mu.Unlock() + s.procs[proc.PID] = proc + } +} + +func (s *snapshotter) FindAndPut(pid uint32) *pstypes.PS { + ok, proc := s.Find(pid) + if !ok { + s.Put(proc) + } + return proc +} + +func (s *snapshotter) Find(pid uint32) (bool, *pstypes.PS) { + s.mu.RLock() + defer s.mu.RUnlock() + ps, ok := s.procs[pid] + if ok { + return true, ps + } + if s.capture || pid == sys.InvalidProcessID { + return false, nil + } + + // check if the process is in dirty map + s.dmu.RLock() + defer s.dmu.RUnlock() + if ps := s.dirty[pid]; ps != nil { + return true, ps + } + + processLookupFailureCount.Add(strconv.Itoa(int(pid)), 1) + + proc := &pstypes.PS{ + PID: pid, + Ppid: sys.InvalidProcessID, + Threads: make(map[uint32]pstypes.Thread), + Modules: make([]pstypes.Module, 0), + Handles: make([]htypes.Handle, 0), + } + + getProcExecutable := func(process windows.Handle) (string, string) { + var size uint32 = windows.MAX_PATH + n := make([]uint16, size) + err := windows.QueryFullProcessImageName(process, 0, &n[0], &size) + if err != nil { + return "", "" + } + return windows.UTF16ToString(n), filepath.Base(windows.UTF16ToString(n)) + } + + access := uint32(windows.PROCESS_QUERY_INFORMATION | windows.PROCESS_VM_READ) + process, err := windows.OpenProcess(access, false, pid) + if err != nil { + // the access to protected / system process can't be achieved + // through `PROCESS_VM_READ` or `PROCESS_QUERY_INFORMATION` flags. + // Try to acquire the process handle again but with restricted access + // rights to be able to obtain other attributes such as the full process's + // Module executable path or process times + process, err = windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, pid) + if err != nil { + return false, nil + } + } + //nolint:errcheck + defer windows.CloseHandle(process) + + // get process executable full path and name + proc.Exe, proc.Name = getProcExecutable(process) + + // consult process parent id + info, err := sys.QueryInformationProcess[windows.PROCESS_BASIC_INFORMATION](process, windows.ProcessBasicInformation) + if err != nil { + return false, proc + } + proc.Ppid = uint32(info.InheritedFromUniqueProcessId) + + // retrieve Portable Executable data + proc.PE, err = pe.ParseFileWithConfig(proc.Exe, s.config.PE) + if err != nil { + return false, proc + } + + // get process times + var ( + ct windows.Filetime + xt windows.Filetime + kt windows.Filetime + ut windows.Filetime + ) + err = windows.GetProcessTimes(process, &ct, &xt, &kt, &ut) + if err != nil { + return false, proc + } + proc.StartTime = time.Unix(0, ct.Nanoseconds()) + + // get process creation attributes + var isWOW64 bool + if err := windows.IsWow64Process(process, &isWOW64); err == nil && isWOW64 { + proc.IsWOW64 = true + } + if isPackaged, err := sys.IsProcessPackaged(process); err == nil && isPackaged { + proc.IsPackaged = true + } + if prot, err := sys.QueryInformationProcess[sys.PsProtection](process, sys.ProcessProtectionInformation); err == nil && prot != nil { + proc.IsProtected = prot.IsProtected() + } + + // get process token attributes + var ( + token windows.Token + tokenUser *windows.Tokenuser + tokenMandatoryLabel *windows.Tokenmandatorylabel + ) + + err = windows.OpenProcessToken(process, windows.TOKEN_QUERY, &token) + if err != nil { + goto readPEB + } + defer token.Close() + tokenUser, err = token.GetTokenUser() + if err != nil { + goto readPEB + } + proc.SID = tokenUser.User.Sid.String() + proc.Username, proc.Domain, _, _ = tokenUser.User.Sid.LookupAccount("") + + // get process token integrity level + tokenMandatoryLabel, err = sys.GetProcessTokenInformation[windows.Tokenmandatorylabel](token, windows.TokenIntegrityLevel) + if err != nil { + goto readPEB + } + + proc.TokenIntegrityLevel = sys.RidToString(tokenMandatoryLabel.Label.Sid) + proc.IsTokenElevated = token.IsElevated() + + // retrieve process handles + proc.Handles, err = s.hsnap.FindHandles(pid) + if err != nil { + goto readPEB + } + +readPEB: + // read PEB (Process Environment Block) + peb, err := ReadPEB(process) + if err != nil { + pebReadErrors.Add(1) + return false, proc + } + proc.Envs = peb.GetEnvs() + proc.Cmdline = peb.GetCommandLine() + proc.SessionID = peb.GetSessionID() + proc.Cwd = peb.GetCurrentWorkingDirectory() + + return false, proc +} + +func (s *snapshotter) Size() uint32 { + s.mu.RLock() + defer s.mu.RUnlock() + return uint32(len(s.procs)) +} + +// gcDeadProcesses periodically scans the map of the snapshot's processes and removes +// any terminated processes from it. This guarantees that any leftovers are cleaned-up +// in case we miss process' terminate events. +func (s *snapshotter) gcDeadProcesses() { + tick := time.NewTicker(reapPeriod) + for { + select { + case <-tick.C: + s.mu.Lock() + ss := len(s.procs) + log.Debugf("scanning for dead processes on the snapshot of %d items", ss) + + for pid := range s.procs { + proc, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, pid) + if err != nil { + continue + } + if !sys.IsProcessRunning(proc) { + delete(s.procs, pid) + } + _ = windows.CloseHandle(proc) + } + + if ss > len(s.procs) { + reaped := ss - len(s.procs) + reapedProcesses.Add(int64(reaped)) + log.Debugf("%d dead process(es) reaped", reaped) + } + s.mu.Unlock() + case <-s.quit: + tick.Stop() + } + } +} + +func (s *snapshotter) onHandleCreated(pid uint32, handle htypes.Handle) { + s.mu.RLock() + ps, ok := s.procs[pid] + s.mu.RUnlock() + if ok { + s.mu.Lock() + defer s.mu.Unlock() + ps.AddHandle(handle) + s.procs[pid] = ps + } +} + +func (s *snapshotter) onHandleDestroyed(pid uint32, rawHandle windows.Handle) { + s.mu.RLock() + ps, ok := s.procs[pid] + s.mu.RUnlock() + if ok { + s.mu.Lock() + defer s.mu.Unlock() + ps.RemoveHandle(rawHandle) + s.procs[pid] = ps + } +} diff --git a/pkg/ps/types/types_linux.go b/pkg/ps/types/types_linux.go index 290c4e92f..da1d56826 100644 --- a/pkg/ps/types/types_linux.go +++ b/pkg/ps/types/types_linux.go @@ -34,13 +34,13 @@ import ( type PS struct { sync.RWMutex // PID is the thread group identifier. It is also the thread identifier of the main thread. - PID uint64 `json:"pid"` + PID uint32 `json:"pid"` // Ppid is the thread group identifier of the parent process. - Ppid uint64 `json:"ppid"` + Ppid uint32 `json:"ppid"` // Name is the process name. Name string `json:"name"` // Cmdline is the full process command line. - Cmdline string `json:"comm"` + Cmdline string `json:"cmdline"` // Exe is the full path to the process executable. Exe string `json:"exe"` // Cwd is the current working directory of the process. @@ -62,16 +62,16 @@ type PS struct { // Parent references the parent process state when it is available. Parent *PS `json:"parent"` // Threads contains the threads that belong to this process. - Threads map[uint64]Thread `json:"-"` + Threads map[uint32]Thread `json:"-"` // Mmaps contains the process memory mappings, including shared objects. Mmaps []Mmap `json:"mmaps"` } // UUID returns a stable identifier for this process instance. func (ps *PS) UUID() uint64 { - var key [16]byte - binary.LittleEndian.PutUint64(key[:8], ps.PID) - binary.LittleEndian.PutUint64(key[8:], ps.StartBootTime) + var key [12]byte + binary.LittleEndian.PutUint32(key[:4], ps.PID) + binary.LittleEndian.PutUint64(key[4:], ps.StartBootTime) h := fnv.New64a() _, _ = h.Write(key[:]) return h.Sum64() @@ -99,9 +99,9 @@ func (ps *PS) Ancestors() []string { // Thread stores identifiers for a Linux thread. type Thread struct { // Tid is the thread identifier. - Tid uint64 + Tid uint32 // Pid is the thread group identifier to which the thread belongs. - Pid uint64 + Pid uint32 } // Mmap stores information about a process memory mapping. @@ -128,13 +128,13 @@ func (ps *PS) AddThread(thread Thread) { ps.Lock() defer ps.Unlock() if ps.Threads == nil { - ps.Threads = make(map[uint64]Thread) + ps.Threads = make(map[uint32]Thread) } ps.Threads[thread.Tid] = thread } // RemoveThread removes a thread from the process state. -func (ps *PS) RemoveThread(tid uint64) { +func (ps *PS) RemoveThread(tid uint32) { ps.Lock() defer ps.Unlock() delete(ps.Threads, tid) diff --git a/pkg/rules/action/kill_linux.go b/pkg/rules/action/kill_linux.go index 8f993476c..59973e686 100644 --- a/pkg/rules/action/kill_linux.go +++ b/pkg/rules/action/kill_linux.go @@ -30,7 +30,6 @@ import ( "strconv" "github.com/rabbitstack/fibratus/pkg/config" - "github.com/rabbitstack/fibratus/pkg/event" "github.com/rabbitstack/fibratus/pkg/event/params" "github.com/rabbitstack/fibratus/pkg/util/multierror" log "github.com/sirupsen/logrus" @@ -46,13 +45,13 @@ const userHZ = uint64(100) const nsecPerTick = uint64(1_000_000_000) / userHZ type processInstance struct { - pid event.PID + pid uint32 startBootTime uint64 } type killer struct { - open func(pid event.PID) (int, error) - readStartTicks func(pid event.PID) (uint64, error) + open func(pid uint32) (int, error) + readStartTicks func(pid uint32) (uint64, error) signal func(fd int, sig unix.Signal) error closeFD func(fd int) error } @@ -132,7 +131,7 @@ func (k killer) killInstance(inst processInstance) error { // Clone events already carry the child identity, so the event process // identifier always designates the process the rule fired for. func processInstances(ctx *config.ActionContext) []processInstance { - seen := make(map[event.PID]processInstance, len(ctx.Events)) + seen := make(map[uint32]processInstance, len(ctx.Events)) for _, e := range ctx.Events { if e == nil { continue @@ -153,16 +152,16 @@ func processInstances(ctx *config.ActionContext) []processInstance { return instances } -func pids(instances []processInstance) []event.PID { - p := make([]event.PID, 0, len(instances)) +func pids(instances []processInstance) []uint32 { + p := make([]uint32, 0, len(instances)) for _, inst := range instances { p = append(p, inst.pid) } return p } -func openPidfd(pid event.PID) (int, error) { - if pid > uint64(^uint32(0)>>1) { +func openPidfd(pid uint32) (int, error) { + if pid > (^uint32(0) >> 1) { return 0, fmt.Errorf("pid %d is out of range", pid) } return unix.PidfdOpen(int(pid), 0) @@ -172,7 +171,7 @@ func sendSignal(fd int, sig unix.Signal) error { return unix.PidfdSendSignal(fd, sig, nil, 0) } -func readProcStartTicks(pid event.PID) (uint64, error) { +func readProcStartTicks(pid uint32) (uint64, error) { data, err := os.ReadFile(fmt.Sprintf("/proc/%d/stat", pid)) if err != nil { return 0, err diff --git a/pkg/rules/action/kill_linux_test.go b/pkg/rules/action/kill_linux_test.go index b0bcd1c5a..41ba5e9dd 100644 --- a/pkg/rules/action/kill_linux_test.go +++ b/pkg/rules/action/kill_linux_test.go @@ -39,7 +39,7 @@ import ( ) const ( - testPID = event.PID(4242) + testPID = 4242 testStartNs = uint64(1_234_500_000_000) testStartTicks = testStartNs / nsecPerTick testPidfd = 7 @@ -47,15 +47,15 @@ const ( // recorder captures what a killer attempted so tests never signal a real process. type recorder struct { - opened []event.PID + opened []uint32 signaled []int signals []unix.Signal closed []int } -func (r *recorder) killer(ticks func(pid event.PID) (uint64, error)) killer { +func (r *recorder) killer(ticks func(pid uint32) (uint64, error)) killer { return killer{ - open: func(pid event.PID) (int, error) { + open: func(pid uint32) (int, error) { r.opened = append(r.opened, pid) return testPidfd, nil }, @@ -72,16 +72,14 @@ func (r *recorder) killer(ticks func(pid event.PID) (uint64, error)) killer { } } -func constTicks(ticks uint64) func(event.PID) (uint64, error) { - return func(event.PID) (uint64, error) { return ticks, nil } +func constTicks(ticks uint64) func(uint32) (uint64, error) { + return func(uint32) (uint64, error) { return ticks, nil } } -func killEvent(pid event.PID, startNs uint64) *event.Event { +func killEvent(pid uint32, startNs uint64) *event.Event { return &event.Event{ - Type: event.Execve, - Name: "execve", - Category: event.Process, - PID: pid, + Type: event.Execve, + PID: pid, PS: &pstypes.PS{ PID: pid, Name: "malware", @@ -117,11 +115,11 @@ func TestParseProcStatStartTicks(t *testing.T) { } func TestReadProcStartTicks(t *testing.T) { - ticks, err := readProcStartTicks(event.PID(os.Getpid())) + ticks, err := readProcStartTicks(uint32(os.Getpid())) require.NoError(t, err) assert.Greater(t, ticks, uint64(0)) - _, err = readProcStartTicks(event.PID(1 << 30)) + _, err = readProcStartTicks(uint32(1 << 30)) require.Error(t, err) assert.True(t, isGone(err)) } @@ -131,7 +129,7 @@ func TestKillSignalsMatchingInstance(t *testing.T) { k := r.killer(constTicks(testStartTicks)) require.NoError(t, k.kill(killContext(killEvent(testPID, testStartNs)))) - assert.Equal(t, []event.PID{testPID}, r.opened) + assert.Equal(t, []uint32{testPID}, r.opened) assert.Equal(t, []int{testPidfd}, r.signaled) assert.Equal(t, []unix.Signal{unix.SIGKILL}, r.signals) assert.Equal(t, []int{testPidfd}, r.closed) @@ -140,7 +138,7 @@ func TestKillSignalsMatchingInstance(t *testing.T) { func TestKillPinsProcessBeforeRevalidating(t *testing.T) { r := &recorder{} var openedBeforeRead bool - k := r.killer(func(event.PID) (uint64, error) { + k := r.killer(func(uint32) (uint64, error) { openedBeforeRead = len(r.opened) == 1 return testStartTicks, nil }) @@ -163,7 +161,7 @@ func TestKillRefusesReusedPID(t *testing.T) { func TestKillMissingProcessIsSuccess(t *testing.T) { r := &recorder{} k := r.killer(constTicks(testStartTicks)) - k.open = func(event.PID) (int, error) { return 0, unix.ESRCH } + k.open = func(uint32) (int, error) { return 0, unix.ESRCH } require.NoError(t, k.kill(killContext(killEvent(testPID, testStartNs)))) assert.Empty(t, r.signaled) @@ -171,7 +169,7 @@ func TestKillMissingProcessIsSuccess(t *testing.T) { func TestKillProcessExitingDuringRevalidationIsSuccess(t *testing.T) { r := &recorder{} - k := r.killer(func(event.PID) (uint64, error) { return 0, os.ErrNotExist }) + k := r.killer(func(uint32) (uint64, error) { return 0, os.ErrNotExist }) require.NoError(t, k.kill(killContext(killEvent(testPID, testStartNs)))) assert.Empty(t, r.signaled) @@ -208,7 +206,7 @@ func TestKillUsesEventStartBootTimeWhenPSMissing(t *testing.T) { evt := killEvent(testPID, testStartNs) evt.PS = nil require.NoError(t, k.kill(killContext(evt))) - assert.Equal(t, []event.PID{testPID}, r.opened) + assert.Equal(t, []uint32{testPID}, r.opened) } // Clone events carry the child identity, so the event pid designates the @@ -219,12 +217,11 @@ func TestKillResolvesCloneChildPid(t *testing.T) { clone := killEvent(testPID, testStartNs) clone.Type = event.Clone - clone.Name = "clone" clone.Params.Append(params.CloneFlags, params.Uint64, uint64(0)) require.True(t, clone.IsCreateProcess()) require.NoError(t, k.kill(killContext(clone))) - assert.Equal(t, []event.PID{testPID}, r.opened) + assert.Equal(t, []uint32{testPID}, r.opened) } func TestKillDeduplicatesAndOrdersPids(t *testing.T) { @@ -237,7 +234,7 @@ func TestKillDeduplicatesAndOrdersPids(t *testing.T) { killEvent(90, testStartNs), )) require.NoError(t, err) - assert.Equal(t, []event.PID{12, 90}, r.opened) + assert.Equal(t, []uint32{12, 90}, r.opened) } func TestKillNilContext(t *testing.T) { @@ -247,7 +244,7 @@ func TestKillNilContext(t *testing.T) { // TestKillTerminatesLiveProcess exercises the real pidfd and procfs path end to // end, including the refusal branch when the captured start time disagrees. func TestKillTerminatesLiveProcess(t *testing.T) { - start := func(t *testing.T) (event.PID, *exec.Cmd, uint64) { + start := func(t *testing.T) (uint32, *exec.Cmd, uint64) { t.Helper() cmd := exec.Command("sleep", "300") require.NoError(t, cmd.Start()) @@ -255,7 +252,7 @@ func TestKillTerminatesLiveProcess(t *testing.T) { _ = cmd.Process.Kill() _, _ = cmd.Process.Wait() }) - pid := event.PID(cmd.Process.Pid) + pid := uint32(cmd.Process.Pid) ticks, err := readProcStartTicks(pid) require.NoError(t, err) return pid, cmd, ticks * nsecPerTick @@ -285,7 +282,7 @@ func TestKillTerminatesLiveProcess(t *testing.T) { } func TestOpenPidfdRejectsOutOfRangePid(t *testing.T) { - _, err := openPidfd(event.PID(1) << 40) + _, err := openPidfd(uint32(1) << 30) require.Error(t, err) assert.Contains(t, err.Error(), "out of range") } @@ -293,7 +290,7 @@ func TestOpenPidfdRejectsOutOfRangePid(t *testing.T) { func TestKillReportsUnexpectedOpenError(t *testing.T) { r := &recorder{} k := r.killer(constTicks(testStartTicks)) - k.open = func(event.PID) (int, error) { return 0, fmt.Errorf("boom") } + k.open = func(uint32) (int, error) { return 0, fmt.Errorf("boom") } err := k.kill(killContext(killEvent(testPID, testStartNs))) require.Error(t, err) diff --git a/pkg/rules/compiler.go b/pkg/rules/compiler.go index 494119cae..f4fe6ae4b 100644 --- a/pkg/rules/compiler.go +++ b/pkg/rules/compiler.go @@ -245,6 +245,8 @@ func (c *compiler) visitApproverPredicates(node ql.Node) { ql.WalkFunc(node, walk) } +// isNegated walks up the AST to check if the given node +// is a direct child of a NOT unary expression. func (c *compiler) isNegated(root ql.Node, node ql.Node) bool { negated := false ql.WalkFunc(root, func(n ql.Node) { @@ -296,13 +298,6 @@ func (c *compiler) buildCompileResult(filters map[*config.FilterConfig]filter.Fi if info.Subcategory == event.DNS { rs.HasDNSEvents = true } - if typ == event.MapViewOfSection || typ == event.UnmapViewOfSection { - rs.HasVAMapEvents = true - } - if typ == event.OpenProcess || typ == event.OpenThread || typ == event.SetThreadContext || - typ == event.CreateSymbolicLinkObject { - rs.HasAuditAPIEvents = true - } if m[typ] { continue @@ -312,7 +307,6 @@ func (c *compiler) buildCompileResult(filters map[*config.FilterConfig]filter.Fi m[typ] = true updatePlatformCompileResult(rs, typ) - } } } diff --git a/pkg/rules/compiler_windows.go b/pkg/rules/compiler_windows.go index 6a0affa08..bf19b5f41 100644 --- a/pkg/rules/compiler_windows.go +++ b/pkg/rules/compiler_windows.go @@ -56,7 +56,7 @@ func (c *compiler) referencesApproverEvents(root ql.Node) bool { } func updatePlatformCompileResult(rs *config.RulesCompileResult, typ event.Type) { - if typ == event.MapViewFile || typ == event.UnmapViewFile { + if typ == event.MapViewOfSection || typ == event.UnmapViewOfSection { rs.HasVAMapEvents = true } if typ == event.OpenProcess || typ == event.OpenThread || typ == event.SetThreadContext || @@ -84,7 +84,11 @@ func (c *compiler) containsEventTypes(root ql.Node, types ...event.Type) bool { evts := make([]event.Type, 0, len(vals)) for _, v := range vals { - evts = append(evts, event.NameToType(v)) + typ, ok := event.ParseType(v) + if !ok { + continue + } + evts = append(evts, typ) } for _, typ := range types { @@ -127,6 +131,3 @@ func (c *compiler) containsFieldMatch(root ql.Node, field fields.Field, op ql.To }) return contains } - -// isNegated walks up the AST to check if the given node -// is a direct child of a NOT unary expression. diff --git a/pkg/rules/engine_windows_test.go b/pkg/rules/engine_windows_test.go index 52bde3447..8e4b1a3ca 100644 --- a/pkg/rules/engine_windows_test.go +++ b/pkg/rules/engine_windows_test.go @@ -182,17 +182,13 @@ func TestSharedSemanticRuleFixtures(t *testing.T) { proc := &event.Event{ Type: event.CreateProcess, - Name: "CreateProcess", - Category: event.Process, PID: 859, Params: event.Params{}, Metadata: make(map[event.MetadataKey]any), } netevt := &event.Event{ - Type: event.RecvTCPv4, - Name: "Recv", - Category: event.Net, - PID: 859, + Type: event.Recv, + PID: 859, Params: event.Params{ params.NetDport: {Name: params.NetDport, Type: params.Uint16, Value: uint16(443)}, }, diff --git a/pkg/config/decoder.go b/pkg/util/mapdecoder/decoder.go similarity index 85% rename from pkg/config/decoder.go rename to pkg/util/mapdecoder/decoder.go index c63bad2cb..e5bfd9c1c 100644 --- a/pkg/config/decoder.go +++ b/pkg/util/mapdecoder/decoder.go @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 by Nedim Sabic Sabic + * Copyright 2019-2026 by Nedim Sabic Sabic * https://www.fibratus.io * All Rights Reserved. * @@ -16,15 +16,17 @@ * limitations under the License. */ -package config +package mapdecoder import ( - "github.com/mitchellh/mapstructure" "net" "reflect" + + "github.com/mitchellh/mapstructure" ) -func decode(input, output interface{}) error { +// Decode decodes the input type to output type. +func Decode(input, output any) error { var decoderConfig = &mapstructure.DecoderConfig{ Metadata: nil, Result: output, @@ -43,10 +45,10 @@ func decode(input, output interface{}) error { } func ipSliceDecodeHook() mapstructure.DecodeHookFunc { - return func(from reflect.Type, to reflect.Type, data interface{}) (interface{}, error) { + return func(from reflect.Type, to reflect.Type, data any) (any, error) { if to.Kind() == reflect.Slice && to.Elem() == reflect.TypeOf(net.IP(nil)) { switch v := data.(type) { - case []interface{}: + case []any: var ips []net.IP for _, s := range v { ip, ok := s.(string) diff --git a/pkg/util/rest/rest_windows_test.go b/pkg/util/rest/rest_windows_test.go index d7d4a0182..5a5140835 100644 --- a/pkg/util/rest/rest_windows_test.go +++ b/pkg/util/rest/rest_windows_test.go @@ -23,7 +23,6 @@ package rest import ( "net/http" "net/http/httptest" - "os/user" "testing" "github.com/rabbitstack/fibratus/pkg/api" @@ -32,10 +31,7 @@ import ( ) func TestGetPipe(t *testing.T) { - usr, err := user.Current() - require.NoError(t, err) - descriptor := "D:P(A;;GA;;;" + usr.Uid + ")" - listener, err := api.MakePipeListener(`npipe:///fibratus`, descriptor) + listener, err := api.MakeListener(`npipe:///fibratus`) require.NoError(t, err) mux := http.NewServeMux()