Skip to content

Commit 312164a

Browse files
committed
fix[dependencies]: updated golang dependencies
1 parent 942c7e4 commit 312164a

File tree

48 files changed

+2993
-2715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2993
-2715
lines changed

.github/dependabot.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@
66
version: 2
77
updates:
88
- package-ecosystem: "gomod" # See documentation for possible values
9-
directory: "/agent/installer" # Location of package manifests
9+
directory: "/agent" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
1212
- package-ecosystem: "gomod" # See documentation for possible values
13-
directory: "/agent/self" # Location of package manifests
14-
schedule:
15-
interval: "weekly"
16-
- package-ecosystem: "gomod" # See documentation for possible values
17-
directory: "/agent/service" # Location of package manifests
13+
directory: "/agent/updater" # Location of package manifests
1814
schedule:
1915
interval: "weekly"
2016
- package-ecosystem: "gomod" # See documentation for possible values
@@ -52,6 +48,10 @@ updates:
5248
directory: "/plugins/config" # Location of package manifests
5349
schedule:
5450
interval: "weekly"
51+
- package-ecosystem: "gomod" # See documentation for possible values
52+
directory: "/plugins/crowdStrike" # Location of package manifests
53+
schedule:
54+
interval: "weekly"
5555
- package-ecosystem: "gomod" # See documentation for possible values
5656
directory: "/plugins/events" # Location of package manifests
5757
schedule:
@@ -68,10 +68,18 @@ updates:
6868
directory: "/plugins/inputs" # Location of package manifests
6969
schedule:
7070
interval: "weekly"
71+
- package-ecosystem: "gomod" # See documentation for possible values
72+
directory: "/plugins/modules-config" # Location of package manifests
73+
schedule:
74+
interval: "weekly"
7175
- package-ecosystem: "gomod" # See documentation for possible values
7276
directory: "/plugins/o365" # Location of package manifests
7377
schedule:
7478
interval: "weekly"
79+
- package-ecosystem: "gomod" # See documentation for possible values
80+
directory: "/plugins/soc-ai" # Location of package manifests
81+
schedule:
82+
interval: "weekly"
7583
- package-ecosystem: "gomod" # See documentation for possible values
7684
directory: "/plugins/sophos" # Location of package manifests
7785
schedule:
@@ -80,4 +88,12 @@ updates:
8088
directory: "/plugins/stats" # Location of package manifests
8189
schedule:
8290
interval: "weekly"
91+
- package-ecosystem: "gomod" # See documentation for possible values
92+
directory: "/plugins/threat-intelligence" # Location of package manifests
93+
schedule:
94+
interval: "weekly"
95+
- package-ecosystem: "gomod" # See documentation for possible values
96+
directory: "/utmstack-collector" # Location of package manifests
97+
schedule:
98+
interval: "weekly"
8399

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module golang-updater
2+
3+
go 1.24.2
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
package main
2+
3+
import (
4+
"bufio"
5+
"bytes"
6+
"encoding/json"
7+
"fmt"
8+
"os"
9+
"os/exec"
10+
"strings"
11+
)
12+
13+
type Module struct {
14+
Path string
15+
Version string
16+
Update *ModuleUpdate
17+
}
18+
19+
type ModuleUpdate struct {
20+
Version string
21+
}
22+
23+
func main() {
24+
modFile, err := os.Open("go.mod")
25+
if err != nil {
26+
fmt.Fprintf(os.Stderr, "Error opening go.mod: %v\n", err)
27+
os.Exit(1)
28+
}
29+
defer modFile.Close()
30+
31+
explicitModules := make(map[string]bool)
32+
scanner := bufio.NewScanner(modFile)
33+
for scanner.Scan() {
34+
line := strings.TrimSpace(scanner.Text())
35+
if strings.HasPrefix(line, "require") || strings.HasPrefix(line, ")") {
36+
continue
37+
}
38+
fields := strings.Fields(line)
39+
if len(fields) >= 1 && !strings.HasPrefix(fields[0], "//") {
40+
explicitModules[fields[0]] = true
41+
}
42+
}
43+
if err := scanner.Err(); err != nil {
44+
fmt.Fprintf(os.Stderr, "Error reading go.mod: %v\n", err)
45+
os.Exit(1)
46+
}
47+
48+
cmd := exec.Command("go", "list", "-u", "-m", "-json", "all")
49+
output, err := cmd.Output()
50+
if err != nil {
51+
fmt.Fprintf(os.Stderr, "Error executing go list: %v\n", err)
52+
os.Exit(1)
53+
}
54+
55+
decoder := json.NewDecoder(bytes.NewReader(output))
56+
var toUpdate []string
57+
58+
for decoder.More() {
59+
var mod Module
60+
if err := decoder.Decode(&mod); err != nil {
61+
fmt.Fprintf(os.Stderr, "Error parsing JSON output: %v\n", err)
62+
os.Exit(1)
63+
}
64+
if mod.Update != nil && explicitModules[mod.Path] {
65+
toUpdate = append(toUpdate, fmt.Sprintf("%s@%s", mod.Path, mod.Update.Version))
66+
}
67+
}
68+
69+
if len(toUpdate) == 0 {
70+
fmt.Println("✅ There are no updates available for the explicitly required modules.")
71+
return
72+
}
73+
74+
for _, mod := range toUpdate {
75+
fmt.Printf("🔄 Updating %s\n", mod)
76+
cmd := exec.Command("go", "get", mod)
77+
cmd.Stdout = os.Stdout
78+
cmd.Stderr = os.Stderr
79+
if err := cmd.Run(); err != nil {
80+
fmt.Fprintf(os.Stderr, "❌ Error updating %s: %v\n", mod, err)
81+
}
82+
}
83+
84+
fmt.Println("🧹 Executing go mod tidy...")
85+
cmd = exec.Command("go", "mod", "tidy")
86+
cmd.Stdout = os.Stdout
87+
cmd.Stderr = os.Stderr
88+
if err := cmd.Run(); err != nil {
89+
fmt.Fprintf(os.Stderr, "Error executing go mod tidy: %v\n", err)
90+
os.Exit(1)
91+
}
92+
93+
fmt.Println("✅ Dependencies updated successfully.")
94+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ installer/installer
99
**/.vscode
1010
**/*.plugin
1111
installer/public_key.crt
12+
.github/scripts/golang-updater/golang-updater

agent-manager/go.mod

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
module github.com/utmstack/UTMStack/agent-manager
22

3-
go 1.24.2
3+
go 1.25.5
44

55
require (
66
github.com/AtlasInsideCorp/AtlasInsideAES v1.0.0
7-
github.com/gin-contrib/gzip v1.2.3
8-
github.com/gin-gonic/gin v1.10.1
7+
github.com/gin-contrib/gzip v1.2.5
8+
github.com/gin-gonic/gin v1.11.0
99
github.com/google/uuid v1.6.0
1010
github.com/utmstack/config-client-go v1.2.7
11-
google.golang.org/grpc v1.74.2
12-
google.golang.org/protobuf v1.36.6
11+
google.golang.org/grpc v1.78.0
12+
google.golang.org/protobuf v1.36.11
1313
gorm.io/driver/postgres v1.6.0
14-
gorm.io/gorm v1.30.0
14+
gorm.io/gorm v1.31.1
1515
)
1616

17-
require github.com/kr/text v0.2.0 // indirect
17+
require (
18+
github.com/bytedance/gopkg v0.1.3 // indirect
19+
github.com/goccy/go-yaml v1.19.2 // indirect
20+
github.com/quic-go/qpack v0.6.0 // indirect
21+
github.com/quic-go/quic-go v0.58.0 // indirect
22+
)
1823

1924
require (
20-
github.com/bytedance/sonic v1.14.0 // indirect
21-
github.com/bytedance/sonic/loader v0.3.0 // indirect
22-
github.com/cloudwego/base64x v0.1.5 // indirect
23-
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
25+
github.com/bytedance/sonic v1.14.2 // indirect
26+
github.com/bytedance/sonic/loader v0.4.0 // indirect
27+
github.com/cloudwego/base64x v0.1.6 // indirect
28+
github.com/gabriel-vasile/mimetype v1.4.12 // indirect
2429
github.com/gin-contrib/sse v1.1.0 // indirect
2530
github.com/go-playground/locales v0.14.1 // indirect
2631
github.com/go-playground/universal-translator v0.18.1 // indirect
27-
github.com/go-playground/validator/v10 v10.27.0 // indirect
32+
github.com/go-playground/validator/v10 v10.30.1 // indirect
2833
github.com/goccy/go-json v0.10.5 // indirect
2934
github.com/jackc/pgpassfile v1.0.0 // indirect
3035
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
31-
github.com/jackc/pgx/v5 v5.7.5 // indirect
36+
github.com/jackc/pgx/v5 v5.8.0 // indirect
3237
github.com/jackc/puddle/v2 v2.2.2 // indirect
3338
github.com/jinzhu/inflection v1.0.0 // indirect
3439
github.com/jinzhu/now v1.1.5 // indirect
@@ -39,15 +44,14 @@ require (
3944
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4045
github.com/modern-go/reflect2 v1.0.2 // indirect
4146
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
42-
github.com/threatwinds/go-sdk v1.0.45
47+
github.com/threatwinds/go-sdk v1.0.51
4348
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
44-
github.com/ugorji/go/codec v1.3.0 // indirect
45-
golang.org/x/arch v0.19.0 // indirect
46-
golang.org/x/crypto v0.40.0 // indirect
47-
golang.org/x/net v0.42.0 // indirect
48-
golang.org/x/sync v0.16.0 // indirect
49-
golang.org/x/sys v0.34.0 // indirect
50-
golang.org/x/text v0.27.0 // indirect
51-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250721164621-a45f3dfb1074 // indirect
52-
gopkg.in/yaml.v3 v3.0.1 // indirect
49+
github.com/ugorji/go/codec v1.3.1 // indirect
50+
golang.org/x/arch v0.23.0 // indirect
51+
golang.org/x/crypto v0.47.0 // indirect
52+
golang.org/x/net v0.49.0 // indirect
53+
golang.org/x/sync v0.19.0 // indirect
54+
golang.org/x/sys v0.40.0 // indirect
55+
golang.org/x/text v0.33.0 // indirect
56+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 // indirect
5357
)

0 commit comments

Comments
 (0)