Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e48a97b
feat: Improve installer to add RHELD support
yllada Apr 16, 2025
91977d8
fix: Update windows ARM collector
yllada Apr 16, 2025
435cfca
wip
osmontero Apr 16, 2025
756066c
feat: Add SELinux configuration for RedHat systems
yllada Apr 16, 2025
c1ac489
Merge branch 'bugfix/10.7.2/rhel_support' into bugfix/10.8.0/macos
Kbayero Apr 18, 2025
4e50527
fix interface agent problem
Kbayero Apr 18, 2025
7b909e9
add bad gateway page
Kbayero Apr 18, 2025
1173856
complete macos agent
Kbayero Apr 19, 2025
c8e3f40
feat(module-integration): add SOC AI model selection field
mjabascal10 Apr 18, 2025
589da78
feat(module-integration): add SOC AI model selection field
mjabascal10 Apr 18, 2025
aa82e65
feat(module-integration): add SOC AI model selection field
mjabascal10 Apr 18, 2025
88def5d
feat(module-integration): update MacOS guide
mjabascal10 Apr 21, 2025
a479f61
fix custom bad gateway page creation
Kbayero Apr 22, 2025
4e56cb0
not contains operator grammar(Jose Angel)
Kbayero Apr 22, 2025
98779e7
fix(agent-details): show correct agent version and format OS version
mjabascal10 Apr 22, 2025
353ce8a
Merge remote-tracking branch 'origin/bugfix/10.8.0/macos' into bugfix…
mjabascal10 Apr 22, 2025
87a9282
Update and publish SOC-AI models
Kbayero Apr 22, 2025
4a7c819
Update UTMStack Version
Kbayero Apr 22, 2025
a87e8d6
update service agent problem
Kbayero Apr 22, 2025
e83843e
Merge branch 'main' into bugfix/10.8.0/macos
Kbayero Apr 22, 2025
8881f8e
Merge branch 'main' into bugfix/10.8.0/macos
Kbayero Apr 22, 2025
6d84c77
fix nil pointer
Kbayero Apr 22, 2025
52d5c99
Merge branch 'main' into bugfix/10.8.0/macos
Kbayero Apr 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions soc-ai/configurations/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package configurations

import (
"sync"
"time"

UTMStackConfigurationClient "github.com/utmstack/config-client-go"
Expand All @@ -9,7 +10,8 @@ import (
)

var (
gptConfig GPTConfig
gptConfig GPTConfig
gptConfigOnce sync.Once
)

type GPTConfig struct {
Expand All @@ -21,10 +23,14 @@ type GPTConfig struct {
}

func GetGPTConfig() *GPTConfig {
gptConfigOnce.Do(func() {
gptConfig = GPTConfig{}
})

return &gptConfig
}

func UpdateGPTConfigurations() {
func (c *GPTConfig) UpdateGPTConfigurations() {
intKey := GetInternalKey()
panelServ := GetPanelServiceName()
client := UTMStackConfigurationClient.NewUTMClient(intKey, panelServ)
Expand All @@ -41,26 +47,26 @@ func UpdateGPTConfigurations() {
continue
}

gptConfig.ModuleActive = tempModuleConfig.ModuleActive
c.ModuleActive = tempModuleConfig.ModuleActive

if gptConfig.ModuleActive && tempModuleConfig != nil && len(tempModuleConfig.ConfigurationGroups) > 0 {
if c.ModuleActive && tempModuleConfig != nil && len(tempModuleConfig.ConfigurationGroups) > 0 {
for _, config := range tempModuleConfig.ConfigurationGroups[0].Configurations {
switch config.ConfKey {
case "utmstack.socai.key":
if config.ConfValue != "" && config.ConfValue != " " {
gptConfig.APIKey = config.ConfValue
c.APIKey = config.ConfValue
}
case "utmstack.socai.incidentCreation":
if config.ConfValue != "" && config.ConfValue != " " {
gptConfig.AutomaticIncidentCreation = config.ConfValue == "true"
c.AutomaticIncidentCreation = config.ConfValue == "true"
}
case "utmstack.socai.changeAlertStatus":
if config.ConfValue != "" && config.ConfValue != " " {
gptConfig.ChangeAlertStatus = config.ConfValue == "true"
c.ChangeAlertStatus = config.ConfValue == "true"
}
case "utmstack.socai.model":
if config.ConfValue != "" && config.ConfValue != " " {
gptConfig.Model = config.ConfValue
c.Model = config.ConfValue
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion soc-ai/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewProcessor() *Processor {
func (p *Processor) ProcessData() {
utils.Logger.Info("Starting SOC-AI Processor...")

go configurations.UpdateGPTConfigurations()
go configurations.GetGPTConfig().UpdateGPTConfigurations()
go p.restRouter()
go p.processAlertsInfo()

Expand Down
Loading