Skip to content

Commit cc39996

Browse files
c3s4rfredmjabascal10Kbayerojavjodar
authored
Feature/10.4/2 add integrations (#628)
* Improvement integrations component * Refactor guides generation process . * Refactor guides generation process . * Refactor guides generation process . * Add fortiweb filter * Added new integrations(). * Update pfsense_fw.conf Updating pfsense filter * Update ibm_aix.conf Updating aix filter * Update fortiweb.conf Updating fortiweb filter * Update netflow.conf Updating netflow filter * Added pfsense changeset * Add pfsense changeset * Add pfsense changeset * Added confirmation for disabling the log collector action. * Added pfsense changeset * Added netflow changeset * Added netflow changeset * Added netflow changeset * Added aix changeset * Refactor changesets * Disabled modules UFW and LINUX_LOGS * Fixed integration bugs * Disabled modules UFW and LINUX_LOGS * Adding modules to log-firewall-* index-pattern * Update README.md * Migrate agent configurations * Update UTMStack Version * Update UTMStack Agent Version * Fixed the Enable Integration button for Syslog * Added theadWinds menu * Added theadWinds menu * Added theadWinds menu * Added theadWinds menu * Added theadWinds menu * Added theadWinds menu * Fixed menu url validation * Added theadWinds logo * Set timeout to mailSender bean * Set timeout to mailSender bean * Added shm-size param to selenium * Added shm-size param to selenium * Fixing selenium service * Trigger web-pdf workflow * Updating installer shm volume * fix vlan render issue #495 * Updating dockerfile comment * Set timeout to mailSender bean * Remove tls syslog servers * Validate UTF8 messages and create buffer for syslog messages * Close syslog connections * fix vlan render issue #495 * memory distribution * Accept multiple connections in syslog servers * Refactor threat intelligence component * Removed SSL protocol * Fixed Data Parsing processed events is not matching between outside and inside component (#622) * Set threat winds changeset * Fix ibm aix id * set default renderer to networkd * Hide license-info component * Fixed pipeline name for IBM-AIX integration * Updated pfsense filter * increase high demand containers memory * initial stack reserved memory as service minimum * reduce system reserved memory and low consumption services resources * Updating opensearch memory --------- Co-authored-by: Manuel Abascal <[email protected]> Co-authored-by: Yorjander Hernandez Vergara <[email protected]> Co-authored-by: Jose Sanchez <[email protected]>
1 parent 9222c12 commit cc39996

File tree

37 files changed

+432
-1056
lines changed

37 files changed

+432
-1056
lines changed

agent/agent/beats/filebeat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (f Filebeat) SendSystemLogs(h *logger.Logger) {
127127

128128
go utils.WatchFolder("modulescollector", filebLogPath, logLinesChan, configuration.BatchCapacity, h)
129129
for logLine := range logLinesChan {
130-
beatsData, err := parser.ProcessData(logLine)
130+
beatsData, err := parser.ProcessData(logLine, h)
131131
if err != nil {
132132
h.ErrorF("error processing beats data: %v", err)
133133
continue

agent/agent/beats/winlogbeat.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"path/filepath"
66

77
"github.com/threatwinds/logger"
8+
"github.com/threatwinds/validations"
89
"github.com/utmstack/UTMStack/agent/agent/configuration"
910
"github.com/utmstack/UTMStack/agent/agent/logservice"
1011
"github.com/utmstack/UTMStack/agent/agent/utils"
@@ -72,9 +73,18 @@ func (w Winlogbeat) SendSystemLogs(h *logger.Logger) {
7273

7374
go utils.WatchFolder("windowscollector", winbLogPath, logLinesChan, configuration.BatchCapacity, h)
7475
for logLine := range logLinesChan {
76+
validatedLogs := []string{}
77+
for _, log := range logLine {
78+
validatedLog, _, err := validations.ValidateString(log, false)
79+
if err != nil {
80+
h.ErrorF("error validating log: %s: %v", log, err)
81+
continue
82+
}
83+
validatedLogs = append(validatedLogs, validatedLog)
84+
}
7585
logservice.LogQueue <- logservice.LogPipe{
7686
Src: string(configuration.LogTypeWindowsAgent),
77-
Logs: logLine,
87+
Logs: validatedLogs,
7888
}
7989
}
8090
}

agent/agent/configuration/const.go

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,36 +75,35 @@ const (
7575
LogTypeMacOs LogType = "macos_logs"
7676
LogTypeGeneric LogType = "generic"
7777
LogTypeNetflow LogType = "netflow"
78-
LogTypeAix LogType = "aix"
78+
LogTypeAix LogType = "ibm_aix"
7979
LogTypePfsense LogType = "firewall_pfsense"
8080
LogTypeFortiweb LogType = "firewall_fortiweb"
8181
)
8282

8383
type ProtoPort struct {
8484
UDP string
8585
TCP string
86-
TLS string
8786
}
8887

8988
var (
9089
ProtoPorts = map[LogType]ProtoPort{
91-
LogTypeSyslog: {UDP: "7014", TCP: "7014", TLS: "2056"},
92-
LogTypeVmware: {UDP: "7002", TCP: "7002", TLS: "7052"},
93-
LogTypeEset: {UDP: "7003", TCP: "7003", TLS: "7053"},
94-
LogTypeKaspersky: {UDP: "7004", TCP: "7004", TLS: "7054"},
95-
LogTypeCiscoGeneric: {UDP: "514", TCP: "1470", TLS: ""},
96-
LogTypeFortinet: {UDP: "7005", TCP: "7005", TLS: "7055"},
97-
LogTypePaloalto: {UDP: "7006", TCP: "7006", TLS: "7056"},
98-
LogTypeMikrotik: {UDP: "7007", TCP: "7007", TLS: "7057"},
99-
LogTypeSophosXG: {UDP: "7008", TCP: "7008", TLS: "7058"},
100-
LogTypeSonicwall: {UDP: "7009", TCP: "7009", TLS: "7059"},
101-
LogTypeDeceptivebytes: {UDP: "7010", TCP: "7010", TLS: "7060"},
102-
LogTypeSentinelOne: {UDP: "7012", TCP: "7012", TLS: "7062"},
103-
LogTypeMacOs: {UDP: "7015", TCP: "7015", TLS: "7065"},
104-
LogTypeAix: {UDP: "7016", TCP: "7016", TLS: "7066"},
105-
LogTypePfsense: {UDP: "7017", TCP: "7017", TLS: "7067"},
106-
LogTypeFortiweb: {UDP: "7018", TCP: "7018", TLS: "7068"},
107-
LogTypeNetflow: {UDP: "2055", TCP: "", TLS: ""},
90+
LogTypeSyslog: {UDP: "7014", TCP: "7014"},
91+
LogTypeVmware: {UDP: "7002", TCP: "7002"},
92+
LogTypeEset: {UDP: "7003", TCP: "7003"},
93+
LogTypeKaspersky: {UDP: "7004", TCP: "7004"},
94+
LogTypeCiscoGeneric: {UDP: "514", TCP: "1470"},
95+
LogTypeFortinet: {UDP: "7005", TCP: "7005"},
96+
LogTypePaloalto: {UDP: "7006", TCP: "7006"},
97+
LogTypeMikrotik: {UDP: "7007", TCP: "7007"},
98+
LogTypeSophosXG: {UDP: "7008", TCP: "7008"},
99+
LogTypeSonicwall: {UDP: "7009", TCP: "7009"},
100+
LogTypeDeceptivebytes: {UDP: "7010", TCP: "7010"},
101+
LogTypeSentinelOne: {UDP: "7012", TCP: "7012"},
102+
LogTypeMacOs: {UDP: "7015", TCP: "7015"},
103+
LogTypeAix: {UDP: "7016", TCP: "7016"},
104+
LogTypePfsense: {UDP: "7017", TCP: "7017"},
105+
LogTypeFortiweb: {UDP: "7018", TCP: "7018"},
106+
LogTypeNetflow: {UDP: "2055", TCP: ""},
108107
}
109108

110109
ProhibitedPortsChange = []LogType{LogTypeCiscoGeneric, LogTypeNetflow}

agent/agent/go.mod

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ go 1.21.1
55
require (
66
github.com/AtlasInsideCorp/AtlasInsideAES v1.0.0
77
github.com/elastic/go-sysinfo v1.11.1
8-
github.com/google/uuid v1.4.0
8+
github.com/google/uuid v1.6.0
99
github.com/kardianos/service v1.2.2
1010
github.com/tehmaze/netflow v0.0.0-20240303214733-8c13bb004068
1111
github.com/threatwinds/logger v1.1.8
12+
github.com/threatwinds/validations v1.0.5
1213
google.golang.org/grpc v1.59.0
1314
google.golang.org/protobuf v1.33.0
1415
gopkg.in/yaml.v2 v2.4.0
@@ -39,10 +40,10 @@ require (
3940
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
4041
github.com/ugorji/go/codec v1.2.11 // indirect
4142
golang.org/x/arch v0.3.0 // indirect
42-
golang.org/x/crypto v0.14.0 // indirect
43-
golang.org/x/net v0.17.0 // indirect
44-
golang.org/x/sys v0.13.0 // indirect
45-
golang.org/x/text v0.13.0 // indirect
43+
golang.org/x/crypto v0.22.0 // indirect
44+
golang.org/x/net v0.21.0 // indirect
45+
golang.org/x/sys v0.19.0 // indirect
46+
golang.org/x/text v0.14.0 // indirect
4647
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
4748
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
4849
gopkg.in/yaml.v3 v3.0.1 // indirect

agent/agent/go.sum

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
4848
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
4949
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
5050
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
51-
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
52-
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
51+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
52+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
5353
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
5454
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 h1:rp+c0RAYOWj8l6qbCUTSiRLG/iKnW3K3/QfPPuSsBt4=
5555
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak=
@@ -102,26 +102,28 @@ github.com/tehmaze/netflow v0.0.0-20240303214733-8c13bb004068 h1:1B+EAUqxEyPByCf
102102
github.com/tehmaze/netflow v0.0.0-20240303214733-8c13bb004068/go.mod h1:QRP5wJOf7gGMGL2fCAfmh/5CMZQspRxT5DqghaPRrjM=
103103
github.com/threatwinds/logger v1.1.8 h1:sDw1rMuKc41rnV67ybaDGx/9AmVQe6zUf1XTWRPkrgY=
104104
github.com/threatwinds/logger v1.1.8/go.mod h1:IUQGBaFrEuJ7U32OLQh6uWB+e49CJUQX4shZozUItD4=
105+
github.com/threatwinds/validations v1.0.5 h1:kY/Y1g3urTqTNAL/80wWkxPrCHhcbISGduBuVz99d00=
106+
github.com/threatwinds/validations v1.0.5/go.mod h1:vedgpo8crNfHtCMoTlimBlbsFMalXpoTSuSfQh4gU48=
105107
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
106108
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
107109
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
108110
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
109111
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
110112
golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
111113
golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
112-
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
113-
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
114+
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
115+
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
114116
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
115117
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
116-
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
117-
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
118+
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
119+
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
118120
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
119121
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
120122
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
121-
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
122-
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
123-
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
124-
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
123+
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
124+
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
125+
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
126+
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
125127
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
126128
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
127129
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

agent/agent/log-collector-config-sample.json

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,85 +2,70 @@
22
"integrations": {
33
"syslog": {
44
"tcp_port": { "enabled": false, "value": "7014" },
5-
"udp_port": { "enabled": false, "value": "7014" },
6-
"tls_port": { "enabled": false, "value": "2056" }
5+
"udp_port": { "enabled": false, "value": "7014" }
76
},
87
"antivirus_deceptivebytes": {
98
"tcp_port": { "enabled": false, "value": "7010" },
10-
"udp_port": { "enabled": false, "value": "7010" },
11-
"tls_port": { "enabled": false, "value": "7060" }
9+
"udp_port": { "enabled": false, "value": "7010" }
1210
},
1311
"antivirus_eset": {
1412
"tcp_port": { "enabled": false, "value": "7003" },
15-
"udp_port": { "enabled": false, "value": "7003" },
16-
"tls_port": { "enabled": false, "value": "7053" }
13+
"udp_port": { "enabled": false, "value": "7003" }
1714
},
1815
"antivirus_kaspersky": {
1916
"tcp_port": { "enabled": false, "value": "7004" },
20-
"udp_port": { "enabled": false, "value": "7004" },
21-
"tls_port": { "enabled": false, "value": "7054" }
17+
"udp_port": { "enabled": false, "value": "7004" }
2218
},
2319
"antivirus_sentinel_one": {
2420
"tcp_port": { "enabled": false, "value": "7012" },
25-
"udp_port": { "enabled": false, "value": "7012" },
26-
"tls_port": { "enabled": false, "value": "7062" }
21+
"udp_port": { "enabled": false, "value": "7012" }
2722
},
2823
"cisco": {
2924
"tcp_port": { "enabled": false, "value": "1470" },
3025
"udp_port": { "enabled": false, "value": "514" }
3126
},
3227
"firewall_fortinet": {
3328
"tcp_port": { "enabled": false, "value": "7005" },
34-
"udp_port": { "enabled": false, "value": "7005" },
35-
"tls_port": { "enabled": false, "value": "7055" }
29+
"udp_port": { "enabled": false, "value": "7005" }
3630
},
3731
"firewall_mikrotik": {
3832
"tcp_port": { "enabled": false, "value": "7007" },
39-
"udp_port": { "enabled": false, "value": "7007" },
40-
"tls_port": { "enabled": false, "value": "7057" }
33+
"udp_port": { "enabled": false, "value": "7007" }
4134
},
4235
"firewall_paloalto": {
4336
"tcp_port": { "enabled": false, "value": "7006" },
44-
"udp_port": { "enabled": false, "value": "7006" },
45-
"tls_port": { "enabled": false, "value": "7056" }
37+
"udp_port": { "enabled": false, "value": "7006" }
4638
},
4739
"firewall_sonicwall": {
4840
"tcp_port": { "enabled": false, "value": "7009" },
49-
"udp_port": { "enabled": false, "value": "7009" },
50-
"tls_port": { "enabled": false, "value": "7059" }
41+
"udp_port": { "enabled": false, "value": "7009" }
5142
},
5243
"firewall_sophos": {
5344
"tcp_port": { "enabled": false, "value": "7008" },
54-
"udp_port": { "enabled": false, "value": "7008" },
55-
"tls_port": { "enabled": false, "value": "7058" }
45+
"udp_port": { "enabled": false, "value": "7008" }
5646
},
5747
"macos": {
5848
"tcp_port": { "enabled": false, "value": "7015" },
59-
"udp_port": { "enabled": false, "value": "7015" },
60-
"tls_port": { "enabled": false, "value": "7065" }
49+
"udp_port": { "enabled": false, "value": "7015" }
6150
},
6251
"vmware": {
6352
"tcp_port": { "enabled": false, "value": "7002" },
64-
"udp_port": { "enabled": false, "value": "7002" },
65-
"tls_port": { "enabled": false, "value": "7052" }
53+
"udp_port": { "enabled": false, "value": "7002" }
6654
},
6755
"netflow": {
6856
"udp_port": { "enabled": false, "value": "2055" }
6957
},
7058
"aix": {
7159
"tcp_port": { "enabled": false, "value": "7016" },
72-
"udp_port": { "enabled": false, "value": "7016" },
73-
"tls_port": { "enabled": false, "value": "7066" }
60+
"udp_port": { "enabled": false, "value": "7016" }
7461
},
7562
"firewall_pfsense": {
7663
"tcp_port": { "enabled": false, "value": "7017" },
77-
"udp_port": { "enabled": false, "value": "7017" },
78-
"tls_port": { "enabled": false, "value": "7067" }
64+
"udp_port": { "enabled": false, "value": "7017" }
7965
},
8066
"firewall_fortiweb": {
8167
"tcp_port": { "enabled": false, "value": "7018" },
82-
"udp_port": { "enabled": false, "value": "7018" },
83-
"tls_port": { "enabled": false, "value": "7068" }
68+
"udp_port": { "enabled": false, "value": "7018" }
8469
}
8570
}
8671
}

agent/agent/logservice/processor.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ func (l *LogProcessor) ProcessLogs(client LogServiceClient, ctx context.Context,
6464
rcv, err := client.ProcessLogs(ctx, &LogMessage{LogType: newLog.Src, Data: newLog.Logs})
6565
if err != nil {
6666
h.ErrorF("Error sending logs to Log Auth Proxy: %v", err)
67-
h.Info("logs with errors: ")
6867
for _, log := range newLog.Logs {
69-
h.Info("log: %s", log)
68+
h.ErrorF("log with errors: %s", log)
7069
}
7170
if strings.Contains(err.Error(), "invalid agent key") {
7271
invalidKeyCounter++

agent/agent/modules/configuration.go

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ type Port struct {
1717
type Integration struct {
1818
TCP Port `json:"tcp_port,omitempty"`
1919
UDP Port `json:"udp_port,omitempty"`
20-
TLS Port `json:"tls_port,omitempty"`
2120
}
2221

2322
type CollectorConfiguration struct {
@@ -68,8 +67,6 @@ func ConfigureCollectorFirstTime() error {
6867
newIntegration.TCP.Port = ports.TCP
6968
newIntegration.UDP.IsListen = false
7069
newIntegration.UDP.Port = ports.UDP
71-
newIntegration.TLS.IsListen = false
72-
newIntegration.TLS.Port = ports.TLS
7370
integrations[string(logTyp)] = newIntegration
7471
}
7572
return WriteCollectorConfig(integrations, configuration.GetCollectorConfigPath())
@@ -82,7 +79,7 @@ func ChangeIntegrationStatus(logTyp string, proto string, isEnabled bool) (strin
8279
return "", fmt.Errorf("error reading collector config: %v", err)
8380
}
8481

85-
if proto != "tcp" && proto != "udp" && proto != "tls" {
82+
if proto != "tcp" && proto != "udp" {
8683
return "", fmt.Errorf("invalid protocol: %s", proto)
8784
}
8885
if valid := configuration.ValidateModuleType(configuration.LogType(logTyp)); valid == "nil" {
@@ -97,9 +94,6 @@ func ChangeIntegrationStatus(logTyp string, proto string, isEnabled bool) (strin
9794
case "udp":
9895
integration.UDP.IsListen = isEnabled
9996
port = integration.UDP.Port
100-
case "tls":
101-
integration.TLS.IsListen = isEnabled
102-
port = integration.TLS.Port
10397
}
10498

10599
cnf.Integrations[logTyp] = integration
@@ -113,7 +107,7 @@ func ChangePort(logTyp string, proto string, port string) (string, error) {
113107
return "", fmt.Errorf("error reading collector config: %v", err)
114108
}
115109

116-
if proto != "tcp" && proto != "udp" && proto != "tls" {
110+
if proto != "tcp" && proto != "udp" {
117111
return "", fmt.Errorf("invalid protocol: %s", proto)
118112
}
119113
if valid := configuration.ValidateModuleType(configuration.LogType(logTyp)); valid == "nil" {
@@ -134,23 +128,16 @@ func ChangePort(logTyp string, proto string, port string) (string, error) {
134128
case "udp":
135129
old = integration.UDP.Port
136130
integration.UDP.Port = port
137-
case "tls":
138-
old = integration.TLS.Port
139-
integration.TLS.Port = port
140131
}
141132

142133
cnf.Integrations[logTyp] = integration
143134
return old, WriteCollectorConfig(cnf.Integrations, configuration.GetCollectorConfigPath())
144135
}
145136

146137
func IsPortAvailable(port string, proto string, cnf *CollectorConfiguration, currentIntegration string) bool {
147-
if proto == "tls" {
148-
proto = "tcp"
149-
}
150-
151138
for integration, config := range cnf.Integrations {
152139
if integration != currentIntegration {
153-
if config.TCP.Port == port || config.UDP.Port == port || config.TLS.Port == port {
140+
if config.TCP.Port == port || config.UDP.Port == port {
154141
return false
155142
}
156143
}
@@ -177,8 +164,6 @@ func MigrateOldConfig(old CollectorConfigurationOld) CollectorConfiguration {
177164
newIntegration.TCP.Port = ports.TCP
178165
newIntegration.UDP.IsListen = false
179166
newIntegration.UDP.Port = ports.UDP
180-
newIntegration.TLS.IsListen = false
181-
newIntegration.TLS.Port = ports.TLS
182167
integrations[string(logTyp)] = newIntegration
183168
}
184169

@@ -188,7 +173,6 @@ func MigrateOldConfig(old CollectorConfigurationOld) CollectorConfiguration {
188173
integration := integrations[logTyp]
189174
integration.TCP.IsListen = true
190175
integration.UDP.IsListen = false
191-
integration.TLS.IsListen = false
192176
integrations[logTyp] = integration
193177
}
194178
}

agent/agent/modules/modules.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ func ModulesUp(h *logger.Logger) {
7373
port = config.TCP.Port
7474
case "udp":
7575
port = config.UDP.Port
76-
case "tls":
77-
port = config.TLS.Port
7876
}
7977

8078
if port != "" && moCache[index].GetPort(proto) != port {
@@ -104,7 +102,7 @@ func ModulesUp(h *logger.Logger) {
104102
func processConfigs(mod Module, cnf Integration) (map[string][]bool, error) {
105103
configs := make(map[string][]bool) // first bool is if is necessary kill the port, second bool is if is necessary start the port
106104

107-
protos := []string{"tcp", "udp", "tls"}
105+
protos := []string{"tcp", "udp"}
108106
for _, proto := range protos {
109107
var isEnabled bool
110108
var port string
@@ -116,9 +114,6 @@ func processConfigs(mod Module, cnf Integration) (map[string][]bool, error) {
116114
case "udp":
117115
isEnabled = cnf.UDP.IsListen
118116
port = cnf.UDP.Port
119-
case "tls":
120-
isEnabled = cnf.TLS.IsListen
121-
port = cnf.TLS.Port
122117
}
123118

124119
if mod.IsPortListen(proto) && !isEnabled {

0 commit comments

Comments
 (0)