-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfiguration.go
69 lines (63 loc) · 1.97 KB
/
configuration.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package main
import (
"io/ioutil"
"log"
"gopkg.in/yaml.v3"
)
type Configuration struct {
Yara struct {
Path string `yaml:"path"`
Rulesrc4key string `yaml:"rulesRC4Key"`
}
Yarascan struct {
Memory bool `yaml:"memory"`
Registry bool `yaml:"registry"`
Startmenu bool `yaml:"startmenu"`
Taskscheduler bool `yaml:"taskscheduler"`
SystemDrive bool `yaml:"systemdrive"`
Userfilesystem bool `yaml:"userfilesystem"`
AbsolutePaths []string `yaml:"absolutePaths"`
InfiniteScan bool `yaml:"infinitescan"`
AbsolutePathsRecursive bool `yaml:"absolutePathsRecursive"`
}
Response struct {
DumpDirectory string `yaml:"dumpDirectory"`
QuarantineDirectory string `yaml:"Directory"`
QuarantineRC4Key string `yaml:"quarantineRC4Key"`
Kill bool `yaml:"kill"`
}
Network struct {
Capture bool `yaml:"capture"`
Bpffilter string `yaml:"bpffilter"`
Pcapfile string `yaml:"pcapfile"`
}
Output struct {
Notifications bool `yaml:"notifications"`
Verbose bool `yaml:"verbose"`
}
Sfx struct {
Autoexec bool `yaml:"autoexec"`
SilentMode bool `yaml:"silentmode"`
ExtractDirectory string `yaml:"extractDirectory"`
LogFile string `yaml:"logfile"`
}
Others struct {
FakeProcesses bool `yaml:"fakeProcesses"`
}
Advancedparameters struct {
MaxScanFilesize int `yaml:"maxScanFilesize"`
CleanMemoryIfFileGreaterThanSize int `yaml:"cleanMemoryIfFileGreaterThanSize"`
Extensions []string `yaml:"extensions"`
}
}
func (c *Configuration) getConfiguration(configFile string) *Configuration {
yamlFile, err := ioutil.ReadFile(configFile)
if err != nil {
log.Fatalf("Configuration file reading error #%v ", err)
}
err = yaml.Unmarshal(yamlFile, c)
if err != nil {
log.Fatalf("Configuration file parsing error: %v", err)
}
return c
}