processing start for PE and ELF files
This commit is contained in:
parent
d58533db05
commit
5385bfeb6e
1 changed files with 21 additions and 6 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"git.jmbit.de/jmb/scanfile/server/internal/database"
|
||||
"git.jmbit.de/jmb/scanfile/server/internal/processing/basic"
|
||||
"git.jmbit.de/jmb/scanfile/server/internal/processing/capa"
|
||||
"git.jmbit.de/jmb/scanfile/server/internal/processing/msoffice"
|
||||
"git.jmbit.de/jmb/scanfile/server/internal/processing/yara"
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
|
@ -32,12 +33,12 @@ 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)
|
||||
//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 {
|
||||
|
@ -52,6 +53,20 @@ func Submit(ctx context.Context, file pgtype.UUID) error {
|
|||
return err
|
||||
}
|
||||
go msoffice.MSOfficeProcessing(officeJob)
|
||||
case TypeELF:
|
||||
capaJob, err := database.NewProcessingJob(ctx, file, TypeELF)
|
||||
if err != nil {
|
||||
slog.Error("Could not submit processing job", "error", err, "file-uuid", file, "type", TypeCAPA)
|
||||
return err
|
||||
}
|
||||
go capa.CapaProcessing(capaJob)
|
||||
case TypePE:
|
||||
capaJob, err := database.NewProcessingJob(ctx, file, TypeELF)
|
||||
if err != nil {
|
||||
slog.Error("Could not submit processing job", "error", err, "file-uuid", file, "type", TypeCAPA)
|
||||
return err
|
||||
}
|
||||
go capa.CapaProcessing(capaJob)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue