Skip to content

Commit 9219cc8

Browse files
authored
feat: Stack enrichment (#217)
1 parent 74ba252 commit 9219cc8

60 files changed

Lines changed: 2721 additions & 211 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

configs/fibratus.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ kstream:
192192
# Determines whether DNS client events are collected
193193
#enable-dns: true
194194

195+
# Indicates if stack enrichment is enabled for eligible events
196+
#stack-enrichment: true
197+
195198
# Determines which events are dropped either by the event name or the process' image
196199
# name that triggered the event.
197200
blacklist:
@@ -463,6 +466,13 @@ pe:
463466
# consulted for computing section hashes, calculating the entropy, and so on
464467
#read-sections: false
465468

469+
# Designates the path or a series of paths separated by a semicolon that is used to search
470+
# for symbols files
471+
# symbol-paths: srv*c:\\SymCache*https://msdl.microsoft.com/download/symbols
472+
473+
# Determines if kernel stack addresses are symbolized
474+
# symbolize-kernel-addresses: false
475+
466476
# =============================== Transformers =========================================
467477

468478
# Transformers are responsible for augmenting, parsing or enriching kernel events.

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ require (
66
github.com/antchfx/htmlquery v1.2.5
77
github.com/briandowns/spinner v1.12.0
88
github.com/dustin/go-humanize v1.0.0
9+
github.com/enescakir/emoji v1.0.0
10+
github.com/gammazero/deque v0.2.1
911
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
1012
github.com/hashicorp/go-version v1.2.1
1113
github.com/hillu/go-yara/v4 v4.2.4
@@ -39,7 +41,6 @@ require (
3941
)
4042

4143
require (
42-
github.com/enescakir/emoji v1.0.0 // indirect
4344
github.com/rivo/uniseg v0.4.2 // indirect
4445
github.com/rogpeppe/go-internal v1.11.0 // indirect
4546
)

go.sum

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+q
1111
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
1212
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
1313
github.com/alecthomas/assert v1.0.0 h1:3XmGh/PSuLzDbK3W2gUbRXwgW5lqPkuqvRgeQ30FI5o=
14+
github.com/alecthomas/assert v1.0.0/go.mod h1:va/d2JC+M7F6s+80kl/R3G7FUiW6JzUO+hPhLyJ36ZY=
1415
github.com/alecthomas/colour v0.1.0 h1:nOE9rJm6dsZ66RGWYSFrXw461ZIt9A6+nHgL7FRrDUk=
16+
github.com/alecthomas/colour v0.1.0/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0=
1517
github.com/alecthomas/repr v0.1.1 h1:87P60cSmareLAxMc4Hro0r2RBY4ROm0dYwkJNpS4pPs=
18+
github.com/alecthomas/repr v0.1.1/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
1619
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
1720
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
1821
github.com/antchfx/htmlquery v1.2.5 h1:1lXnx46/1wtv1E/kzmH8vrfMuUKYgkdDBA9pIdMJnk4=
@@ -51,6 +54,8 @@ github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHqu
5154
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
5255
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
5356
github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASxc7x3E=
57+
github.com/gammazero/deque v0.2.1 h1:qSdsbG6pgp6nL7A0+K/B7s12mcCY/5l5SIUpMOl+dC0=
58+
github.com/gammazero/deque v0.2.1/go.mod h1:LFroj8x4cMYCukHJDbxFCkT+r9AndaJnFMuZDV34tuU=
5459
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
5560
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
5661
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
@@ -108,6 +113,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
108113
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
109114
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
110115
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
116+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
111117
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
112118
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
113119
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
@@ -171,7 +177,9 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
171177
github.com/saferwall/pe v1.4.4 h1:Ml++7/2/Z1iKwV4zCsd1nIqTEAdUQKAetwbbcCarhOg=
172178
github.com/saferwall/pe v1.4.4/go.mod h1:SNzv3cdgk8SBI0UwHfyTcdjawfdnN+nbydnEL7GZ25s=
173179
github.com/sebdah/goldie v1.0.0 h1:9GNhIat69MSlz/ndaBg48vl9dF5fI+NBB6kfOxgfkMc=
180+
github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4=
174181
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
182+
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
175183
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
176184
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
177185
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
@@ -328,6 +336,7 @@ gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod
328336
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
329337
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
330338
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
339+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
331340
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
332341
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
333342
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=

internal/bootstrap/bootstrap.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"github.com/rabbitstack/fibratus/pkg/kcap"
3232
"github.com/rabbitstack/fibratus/pkg/kstream"
3333
"github.com/rabbitstack/fibratus/pkg/ps"
34+
"github.com/rabbitstack/fibratus/pkg/symbolize"
3435
"github.com/rabbitstack/fibratus/pkg/sys"
3536
"github.com/rabbitstack/fibratus/pkg/util/multierror"
3637
"github.com/rabbitstack/fibratus/pkg/util/signals"
@@ -49,6 +50,7 @@ var ErrAlreadyRunning = errors.New("an instance of Fibratus process is already r
4950
type App struct {
5051
config *config.Config
5152
controller *kstream.Controller
53+
symbolizer *symbolize.Symbolizer
5254
hsnap handle.Snapshotter
5355
psnap ps.Snapshotter
5456
consumer kstream.Consumer
@@ -220,8 +222,14 @@ func (f *App) Run(args []string) error {
220222
}
221223
}()
222224
} else {
223-
// register event listeners
225+
// register stack symbolizer
226+
if cfg.Kstream.StackEnrichment {
227+
f.symbolizer = symbolize.NewSymbolizer(symbolize.NewDebugHelpResolver(cfg), cfg, false)
228+
f.consumer.RegisterEventListener(f.symbolizer)
229+
}
230+
// register rule engine
224231
f.consumer.RegisterEventListener(rules)
232+
// register YARA scanner
225233
if cfg.Yara.Enabled {
226234
scanner, err := yara.NewScanner(f.psnap, cfg.Yara)
227235
if err != nil {
@@ -364,6 +372,9 @@ func (f *App) Shutdown() error {
364372
errs = append(errs, err)
365373
}
366374
}
375+
if f.symbolizer != nil {
376+
f.symbolizer.Close()
377+
}
367378
if f.consumer != nil {
368379
if err := f.consumer.Close(); err != nil {
369380
errs = append(errs, err)

pkg/alertsender/renderer/renderer_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/rabbitstack/fibratus/pkg/kevent/ktypes"
2929
pex "github.com/rabbitstack/fibratus/pkg/pe"
3030
pstypes "github.com/rabbitstack/fibratus/pkg/ps/types"
31+
"github.com/rabbitstack/fibratus/pkg/util/va"
3132
"github.com/stretchr/testify/assert"
3233
"github.com/stretchr/testify/require"
3334
"golang.org/x/sys/windows"
@@ -91,8 +92,8 @@ func TestHTMLFormatterRuleAlert(t *testing.T) {
9192
SessionID: 4,
9293
Envs: map[string]string{"ProgramData": "C:\\ProgramData", "COMPUTRENAME": "archrabbit", "Path": "C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Git\\cmd;C:\\msys64\\mingw64\\bin;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;C:\\Program Files\\nodejs\\;C:\\rubyinstaller-2.5.7-1-x64\\bin;C:\\Program Files (x86)\\WiX Toolset v3.11\\bin;C:\\Program Files (x86)\\Windows Kits\\10\\App Certification Kit;C:\\Program Files (x86)\\Graphviz2.38\\bin;C:\\Program Files (x86)\\NSIS\\Bin;C:\\Program Files\\Jdk11\\bin;C:\\Python310;C:\\msys64\\usr\\bin;C:\\Program Files\\dotnet\\;C:\\Program Files\\Go\\bin;C:\\Program Files\\Fibratus\\Bin;C:\\Program Files\\AutoFirma\\AutoFirma;C:\\Users\\nedo\\AppData\\Local\\Programs\\Python\\Launcher\\;C:\\Scripts\\;C:\\;C:\\Users\\nedo\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\nedo\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\nedo\\AppData\\Roaming\\npm;C:\\Users\\nedo\\AppData\\Local\\Programs\\oh-my-posh\\bin;C:\\Users\\nedo\\go\\bin"},
9394
Threads: map[uint32]pstypes.Thread{
94-
3453: {Tid: 3453, Entrypoint: kparams.Addr(140729524944768), IOPrio: 2, PagePrio: 5, KstackBase: kparams.Addr(18446677035730165760), KstackLimit: kparams.Addr(18446677035730137088), UstackLimit: kparams.Addr(86376448), UstackBase: kparams.Addr(86372352)},
95-
3455: {Tid: 3455, Entrypoint: kparams.Addr(140729524944768), IOPrio: 3, PagePrio: 5, KstackBase: kparams.Addr(18446677035730165760), KstackLimit: kparams.Addr(18446677035730137088), UstackLimit: kparams.Addr(86376448), UstackBase: kparams.Addr(86372352)},
95+
3453: {Tid: 3453, Entrypoint: va.Address(140729524944768), IOPrio: 2, PagePrio: 5, KstackBase: va.Address(18446677035730165760), KstackLimit: va.Address(18446677035730137088), UstackLimit: va.Address(86376448), UstackBase: va.Address(86372352)},
96+
3455: {Tid: 3455, Entrypoint: va.Address(140729524944768), IOPrio: 3, PagePrio: 5, KstackBase: va.Address(18446677035730165760), KstackLimit: va.Address(18446677035730137088), UstackLimit: va.Address(86376448), UstackBase: va.Address(86372352)},
9697
},
9798
Modules: []pstypes.Module{
9899
{Name: "C:\\Windows\\System32\\kernel32.dll", Size: 1233405456},
@@ -185,8 +186,8 @@ func TestHTMLFormatterRuleAlert(t *testing.T) {
185186
SessionID: 4,
186187
Envs: map[string]string{"ProgramData": "C:\\ProgramData", "COMPUTRENAME": "archrabbit"},
187188
Threads: map[uint32]pstypes.Thread{
188-
3453: {Tid: 3453, Entrypoint: kparams.Addr(140729524944768), IOPrio: 2, PagePrio: 5, KstackBase: kparams.Addr(18446677035730165760), KstackLimit: kparams.Addr(18446677035730137088), UstackLimit: kparams.Addr(86376448), UstackBase: kparams.Addr(86372352)},
189-
3455: {Tid: 3455, Entrypoint: kparams.Addr(140729524944768), IOPrio: 3, PagePrio: 5, KstackBase: kparams.Addr(18446677035730165760), KstackLimit: kparams.Addr(18446677035730137088), UstackLimit: kparams.Addr(86376448), UstackBase: kparams.Addr(86372352)},
189+
3453: {Tid: 3453, Entrypoint: va.Address(140729524944768), IOPrio: 2, PagePrio: 5, KstackBase: va.Address(18446677035730165760), KstackLimit: va.Address(18446677035730137088), UstackLimit: va.Address(86376448), UstackBase: va.Address(86372352)},
190+
3455: {Tid: 3455, Entrypoint: va.Address(140729524944768), IOPrio: 3, PagePrio: 5, KstackBase: va.Address(18446677035730165760), KstackLimit: va.Address(18446677035730137088), UstackLimit: va.Address(86376448), UstackBase: va.Address(86372352)},
190191
},
191192
Modules: []pstypes.Module{
192193
{Name: "C:\\Windows\\System32\\kernel32.dll", Size: 1233405456},

pkg/config/config_windows.go

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package config
2121
import (
2222
"encoding/json"
2323
"fmt"
24+
"golang.org/x/sys/windows"
2425
"time"
2526

2627
"github.com/rabbitstack/fibratus/pkg/outputs/eventlog"
@@ -59,11 +60,13 @@ import (
5960
)
6061

6162
const (
62-
kcapFile = "kcap.file"
63-
configFile = "config-file"
64-
debugPrivilege = "debug-privilege"
65-
initHandleSnapshot = "handle.init-snapshot"
66-
enumerateHandles = "handle.enumerate-handles"
63+
kcapFile = "kcap.file"
64+
configFile = "config-file"
65+
debugPrivilege = "debug-privilege"
66+
initHandleSnapshot = "handle.init-snapshot"
67+
enumerateHandles = "handle.enumerate-handles"
68+
symbolPaths = "symbol-paths"
69+
symbolizeKernelAddresses = "symbolize-kernel-addresses"
6770

6871
serializeThreads = "kevent.serialize-threads"
6972
serializeImages = "kevent.serialize-images"
@@ -72,9 +75,9 @@ const (
7275
serializeEnvs = "kevent.serialize-envs"
7376
)
7477

75-
// Config stores configuration options for fine tuning the behaviour of Fibratus.
78+
// Config stores configuration options for fine-tuning the behaviour of Fibratus.
7679
type Config struct {
77-
// Kstream stores different configuration options for fine tuning kstream consumer/controller settings.
80+
// Kstream stores different configuration options for fine-tuning kstream consumer/controller settings.
7881
Kstream KstreamConfig `json:"kstream" yaml:"kstream"`
7982
// Filament contains filament settings
8083
Filament FilamentConfig `json:"filament" yaml:"filament"`
@@ -87,9 +90,18 @@ type Config struct {
8790
// EnumerateHandles indicates if process handles are collected during startup or
8891
// when a new process is spawn
8992
EnumerateHandles bool `json:"enumerate-handles" yaml:"enumerate-handles"`
90-
93+
// SymbolPaths designates the path or a series of paths separated by a semicolon
94+
// that is used to search for symbols files.
95+
SymbolPaths string `json:"symbol-paths" yaml:"symbols-paths"`
96+
// SymbolizeKernelAddresses determines if kernel stack addresses are symbolized.
97+
SymbolizeKernelAddresses bool `json:"symbolize-kernel-addresses" yaml:"symbolize-kernel-addresses"`
98+
99+
// DebugPrivilege dictates if the SeDebugPrivilege is injected into
100+
// Fibratus process' access token.
91101
DebugPrivilege bool `json:"debug-privilege" yaml:"debug-privilege"`
92-
KcapFile string
102+
103+
// KcapFile represents the name of the capture file.
104+
KcapFile string
93105

94106
// API stores global HTTP API preferences
95107
API APIConfig `json:"api" yaml:"api"`
@@ -261,6 +273,8 @@ func (c *Config) Init() error {
261273

262274
c.InitHandleSnapshot = c.viper.GetBool(initHandleSnapshot)
263275
c.EnumerateHandles = c.viper.GetBool(enumerateHandles)
276+
c.SymbolPaths = c.viper.GetString(symbolPaths)
277+
c.SymbolizeKernelAddresses = c.viper.GetBool(symbolizeKernelAddresses)
264278
c.DebugPrivilege = c.viper.GetBool(debugPrivilege)
265279
c.KcapFile = c.viper.GetString(kcapFile)
266280

@@ -327,6 +341,13 @@ func (c *Config) Validate() error {
327341
// File returns the config file path.
328342
func (c *Config) File() string { return c.viper.GetString(configFile) }
329343

344+
// SymbolPathsUTF16 returns the symbol paths as UTF16 string
345+
// suitable for use in the Debug Helper API functions.
346+
func (c *Config) SymbolPathsUTF16() *uint16 {
347+
paths, _ := windows.UTF16PtrFromString(c.SymbolPaths)
348+
return paths
349+
}
350+
330351
func (c *Config) addFlags() {
331352
c.flags.String(configFile, filepath.Join(os.Getenv("PROGRAMFILES"), "fibratus", "config", "fibratus.yml"), "Indicates the location of the configuration file")
332353
if c.opts.run || c.opts.replay || c.opts.validate {
@@ -360,6 +381,8 @@ func (c *Config) addFlags() {
360381
if c.opts.run || c.opts.capture {
361382
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")
362383
c.flags.Bool(enumerateHandles, false, "Indicates if process handles are collected during startup or when a new process is spawn")
384+
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")
385+
c.flags.Bool(symbolizeKernelAddresses, false, "Determines if kernel stack addresses are symbolized")
363386

364387
c.flags.Bool(enableThreadKevents, true, "Determines whether thread kernel events are collected by Kernel Logger provider")
365388
c.flags.Bool(enableRegistryKevents, true, "Determines whether registry kernel events are collected by Kernel Logger provider")
@@ -370,6 +393,7 @@ func (c *Config) addFlags() {
370393
c.flags.Bool(enableMemKevents, true, "Determines whether memory manager kernel events are collected by Kernel Logger provider")
371394
c.flags.Bool(enableAuditAPIEvents, true, "Determines whether kernel audit API calls events are published")
372395
c.flags.Bool(enableDNSEvents, true, "Determines whether DNS client events are enabled")
396+
c.flags.Bool(stackEnrichment, true, "Indicates if stack enrichment is enabled for eligible events")
373397
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)")
374398
c.flags.Int(minBuffers, int(defaultMinBuffers), "Determines the minimum number of buffers allocated for the event tracing session's buffer pool")
375399
c.flags.Int(maxBuffers, int(defaultMaxBuffers), "Determines the maximum number of buffers allocated for the event tracing session's buffer pool")

pkg/config/kstream.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const (
4040
enableMemKevents = "kstream.enable-mem"
4141
enableAuditAPIEvents = "kstream.enable-audit-api"
4242
enableDNSEvents = "kstream.enable-dns"
43+
stackEnrichment = "kstream.stack-enrichment"
4344
bufferSize = "kstream.buffer-size"
4445
minBuffers = "kstream.min-buffers"
4546
maxBuffers = "kstream.max-buffers"
@@ -77,6 +78,8 @@ type KstreamConfig struct {
7778
EnableAuditAPIEvents bool `json:"enable-audit-api" yaml:"enable-audit-api"`
7879
// EnableDNSEvents indicates if DNS client events are enabled
7980
EnableDNSEvents bool `json:"enable-dns" yaml:"enable-dns"`
81+
// StackEnrichment indicates if stack enrichment is enabled for eligible events.
82+
StackEnrichment bool `json:"stack-enrichment" yaml:"stack-enrichment"`
8083
// BufferSize represents the amount of memory allocated for each event tracing session buffer, in kilobytes.
8184
// The buffer size affects the rate at which buffers fill and must be flushed (small buffer size requires
8285
// less memory, but it increases the rate at which buffers must be flushed).
@@ -106,6 +109,7 @@ func (c *KstreamConfig) initFromViper(v *viper.Viper) {
106109
c.EnableMemKevents = v.GetBool(enableMemKevents)
107110
c.EnableAuditAPIEvents = v.GetBool(enableAuditAPIEvents)
108111
c.EnableDNSEvents = v.GetBool(enableDNSEvents)
112+
c.StackEnrichment = v.GetBool(stackEnrichment)
109113
c.BufferSize = uint32(v.GetInt(bufferSize))
110114
c.MinBuffers = uint32(v.GetInt(minBuffers))
111115
c.MaxBuffers = uint32(v.GetInt(maxBuffers))

pkg/config/schema_windows.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ var schema = `
9595
},
9696
"additionalProperties": false
9797
},
98-
"config-file": {"type": "string"},
99-
"debug-privilege": {"type": "boolean"},
98+
"config-file": {"type": "string"},
99+
"debug-privilege": {"type": "boolean"},
100+
"symbol-paths": {"type": "string"},
101+
"symbolize-kernel-addresses": {"type": "boolean"},
100102
"handle": {
101103
"type": "object",
102104
"properties": {
@@ -165,6 +167,7 @@ var schema = `
165167
"enable-mem": {"type": "boolean"},
166168
"enable-audit-api": {"type": "boolean"},
167169
"enable-dns": {"type": "boolean"},
170+
"stack-enrichment": {"type": "boolean"},
168171
"min-buffers": {"type": "integer", "minimum": 1, "maximum": {{ .MinBuffers }}},
169172
"max-buffers": {"type": "integer", "minimum": 2, "maximum": {{ .MaxBuffers }}},
170173
"buffer-size": {"type": "integer", "maximum": {{ .MaxBufferSize }}},

pkg/filament/filament.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ func (f *filament) onInterval(fn *cpython.PyObject) {
569569
}
570570
f.gil.Unlock()
571571
case <-f.close:
572+
return
572573
}
573574
}
574575
}

0 commit comments

Comments
 (0)