-
Notifications
You must be signed in to change notification settings - Fork 18
Description
With go 1.18 introducing generics, we should investigate if they could be used to clean up some type switches that were needed to deal with arbitrary types defined in Sigma rules and potential type mismatches when dealing with actual logs.
See: https://github.com/markuskont/go-sigma-rule-engine/blob/master/pkg/sigma/v2/ident.go#L150
Also, Selection
object currently defines separate matchers for numeric and string types, which was also a hack around the Go type system colliding with arbitrary rule content.
https://github.com/markuskont/go-sigma-rule-engine/blob/master/pkg/sigma/v2/ident.go#L142
Perhaps the latter could also be cleaned up with new generics for a cleaner implementation. While the latter could also be handled with regular interfaces, I'd rather maintain compile time type safety there.
Marking issue as enhancement / question as I have not personally used the new generics yet and am thus unsure if using them would actually be an improvement. Some research is needed.