@@ -13,60 +13,67 @@ import (
13
13
"github.com/evilsocket/opensnitch/daemon/statistics"
14
14
)
15
15
16
- type serverTLSOptions struct {
17
- CACert string `json:"CACert"`
18
- ServerCert string `json:"ServerCert"`
19
- ServerKey string `json:"ServerKey"`
20
- ClientCert string `json:"ClientCert"`
21
- ClientKey string `json:"ClientKey"`
22
- // https://pkg.go.dev/crypto/tls#Config
23
- SkipVerify bool `json:"SkipVerify"`
24
- //https://pkg.go.dev/crypto/tls#ClientAuthType
25
- ClientAuthType string `json:"ClientAuthType"`
16
+ type (
17
+ serverTLSOptions struct {
18
+ CACert string `json:"CACert"`
19
+ ServerCert string `json:"ServerCert"`
20
+ ServerKey string `json:"ServerKey"`
21
+ ClientCert string `json:"ClientCert"`
22
+ ClientKey string `json:"ClientKey"`
23
+ // https://pkg.go.dev/crypto/tls#Config
24
+ SkipVerify bool `json:"SkipVerify"`
25
+ // https://pkg.go.dev/crypto/tls#ClientAuthType
26
+ ClientAuthType string `json:"ClientAuthType"`
26
27
27
- // https://pkg.go.dev/crypto/tls#Conn.VerifyHostname
28
- // VerifyHostname bool
29
- // https://pkg.go.dev/crypto/tls#example-Config-VerifyConnection
30
- // VerifyConnection bool
31
- // VerifyPeerCertificate bool
32
- }
28
+ // https://pkg.go.dev/crypto/tls#Conn.VerifyHostname
29
+ // VerifyHostname bool
30
+ // https://pkg.go.dev/crypto/tls#example-Config-VerifyConnection
31
+ // VerifyConnection bool
32
+ // VerifyPeerCertificate bool
33
+ }
33
34
34
- type serverAuth struct {
35
- // token?, google?, simple-tls, mutual-tls
36
- Type string `json:"Type"`
37
- TLSOptions serverTLSOptions `json:"TLSOptions"`
38
- }
35
+ serverAuth struct {
36
+ // token?, google?, simple-tls, mutual-tls
37
+ Type string `json:"Type"`
38
+ TLSOptions serverTLSOptions `json:"TLSOptions"`
39
+ }
39
40
40
- type serverConfig struct {
41
- Address string `json:"Address"`
42
- Authentication serverAuth `json:"Authentication"`
43
- LogFile string `json:"LogFile"`
44
- Loggers []loggers.LoggerConfig `json:"Loggers"`
45
- }
41
+ serverConfig struct {
42
+ Address string `json:"Address"`
43
+ Authentication serverAuth `json:"Authentication"`
44
+ LogFile string `json:"LogFile"`
45
+ Loggers []loggers.LoggerConfig `json:"Loggers"`
46
+ }
46
47
47
- type rulesOptions struct {
48
- Path string `json:"Path"`
49
- EnableChecksums bool `json:"EnableChecksums"`
50
- }
48
+ rulesOptions struct {
49
+ Path string `json:"Path"`
50
+ EnableChecksums bool `json:"EnableChecksums"`
51
+ }
51
52
52
- type fwOptions struct {
53
- Firewall string `json:"Firewall"`
54
- ConfigPath string `json:"ConfigPath"`
55
- ActionOnOverflow string `json:"ActionOnOverflow"`
56
- MonitorInterval string `json:"MonitorInterval"`
57
- }
53
+ fwOptions struct {
54
+ Firewall string `json:"Firewall"`
55
+ ConfigPath string `json:"ConfigPath"`
56
+ BypassQueue string `json:"BypassQueue"`
57
+ MonitorInterval string `json:"MonitorInterval"`
58
+ }
59
+
60
+ ebpfOptions struct {
61
+ ModulesPath string `json:"ModulesPath"`
62
+ }
63
+ )
58
64
59
65
// Config holds the values loaded from configFile
60
66
type Config struct {
61
67
sync.RWMutex
62
68
Server serverConfig `json:"Server"`
63
69
Stats statistics.StatsConfig `json:"Stats"`
70
+ Rules rulesOptions `json:"Rules"`
71
+ Ebpf ebpfOptions `json:"Ebpf"`
72
+ FwOptions fwOptions `json:"FwOptions"`
64
73
DefaultAction string `json:"DefaultAction"`
65
74
DefaultDuration string `json:"DefaultDuration"`
66
75
ProcMonitorMethod string `json:"ProcMonitorMethod"`
67
- Rules rulesOptions `json:"Rules"`
68
76
Firewall string `json:"Firewall"`
69
- FwOptions fwOptions `json:"FwOptions"`
70
77
LogLevel * int32 `json:"LogLevel"`
71
78
InterceptUnknown bool `json:"InterceptUnknown"`
72
79
LogUTC bool `json:"LogUTC"`
0 commit comments