more yara stuff

This commit is contained in:
Johannes Bülow 2025-07-24 20:12:01 +02:00
parent b46f1074dd
commit ad4f9576d0
Signed by: jmb
GPG key ID: B56971CF7B8F83A6
2 changed files with 12 additions and 1 deletions

View file

@ -18,7 +18,7 @@ var startup time.Time
func Setup(wg *sync.WaitGroup) {
startup = time.Now()
yara.InitYara()
go yara.InitYara()
}
// Submit() starts the analysis process for a file.
@ -31,6 +31,14 @@ func Submit(ctx context.Context, file pgtype.UUID) error {
}
go basic.BasicProcessing(job)
yaraJob, err := database.NewProcessingJob(ctx, file, TypeYARA)
if err != nil {
slog.Error("Could not submit processing job", "error", err, "file-uuid", file, "type", TypeBasic)
return err
}
go yara.YaraProcessing(yaraJob)
mimeType, err := database.GetFileMime(file)
if err != nil {
slog.Error("Could not retrieve MimeType", "error", err, "file-uuid", file)

View file

@ -25,6 +25,9 @@ const TypeArchive = "Archive"
// Anything not implemented (yet)
const TypeOther = "Other"
// Yara Scan (can be done for all filetypes)
const TypeYARA = "Yara"
var MSOfficeMime = []string{
"application/msword",
"application/vnd.ms-excel",