Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
c511374
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 14, 2026
6f53a4f
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 15, 2026
09af2ef
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 15, 2026
a8e8522
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 16, 2026
3442ae3
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 16, 2026
a38261a
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 16, 2026
bab848a
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 17, 2026
f8d98c7
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 17, 2026
1f96401
feat: Add new ControlConfig creation component for SQL‑based complian…
elmilan06 Jan 19, 2026
d5a4c55
feat: Add new ControlConfig creation component for SQL‑based complian…
elmilan06 Jan 21, 2026
4cfd735
feat: Add new ControlConfig creation component for SQL‑based complian…
elmilan06 Jan 24, 2026
a2d07e2
feat: Add new ControlConfig creation component for SQL‑based complian…
elmilan06 Jan 25, 2026
6536646
feat: Add new ControlConfig creation component for SQL‑based complian…
elmilan06 Jan 25, 2026
6bad168
feat: Add new ControlConfig creation component for SQL‑based complian…
elmilan06 Jan 27, 2026
d154335
Merge remote-tracking branch 'origin/release/v11.2.2' into backlog/co…
elmilan06 Jan 27, 2026
6f93bfd
feat: Add new ControlConfig creation component for SQL‑based complian…
elmilan06 Jan 27, 2026
49ff25c
feat: Add new ControlConfig creation component for SQL‑based complian…
elmilan06 Jan 27, 2026
ab0d4c3
Merge remote-tracking branch 'origin/release/v11.2.2' into backlog/co…
elmilan06 Jan 27, 2026
7f7d0ea
Merge remote-tracking branch 'origin/backlog/compliance-evaluation' i…
elmilan06 Jan 27, 2026
f36a597
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 17, 2026
3a27ff1
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 17, 2026
c2ca1ad
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 27, 2026
bde728f
feat: add compliance control and query configuration tables with rela…
elmilan06 Jan 27, 2026
44a56ae
feat: enhance compliance control configuration with section mapping a…
elmilan06 Jan 27, 2026
2d31b90
feat: Revert unnecessary changes
elmilan06 Jan 27, 2026
8d5cf6c
feat: enhance compliance control configuration with section mapping a…
elmilan06 Jan 28, 2026
e14c2a6
Merge remote-tracking branch 'origin/backlog/compliance-evaluation' i…
elmilan06 Jan 28, 2026
bde1081
feat: refactor compliance query form and related components for impro…
elmilan06 Jan 28, 2026
b8a60d6
feat: implement compliance orchestrator backend client and evaluation…
elmilan06 Jan 28, 2026
610552f
feat: implement compliance orchestrator backend client and evaluation…
elmilan06 Feb 4, 2026
94a84f5
feat: implement compliance orchestrator backend client and evaluation…
elmilan06 Feb 15, 2026
2c44b06
feat: provide endpoint for OpenSearch evaluations including latest ev…
elmilan06 Feb 25, 2026
07cc80a
feat: implement compliance orchestrator backend client and evaluation…
elmilan06 Mar 10, 2026
3b39ba3
feat: provide endpoint for OpenSearch evaluations including latest ev…
elmilan06 Mar 12, 2026
dc67353
feat: refactor compliance evaluation classes and update related mappings
elmilan06 Mar 13, 2026
004eaac
feat: implement compliance orchestrator backend client and evaluation…
elmilan06 Mar 13, 2026
16ab4b4
feat: refactor compliance evaluation classes and update related mappings
elmilan06 Mar 13, 2026
1467cff
feat: implement timeline visualization for compliance evaluations wit…
elmilan06 Feb 25, 2026
1e4b6d6
feat: implement timeline visualization for compliance evaluations wit…
elmilan06 Feb 26, 2026
75842a8
feat: implement timeline visualization for compliance evaluations
elmilan06 Mar 5, 2026
331849d
feat: implement timeline visualization for compliance evaluations
elmilan06 Mar 9, 2026
b31b8c6
feat: implement timeline visualization for compliance evaluations
elmilan06 Mar 13, 2026
2a3489f
feat: implement timeline visualization for compliance evaluations
elmilan06 Mar 16, 2026
4266061
feat: implement timeline visualization for compliance evaluations
elmilan06 Mar 17, 2026
a3d3d20
feat: enrich compliance evaluation details with rule, rule value, and…
elmilan06 Mar 19, 2026
475bd96
feat: enhance compliance control evaluation with pagination support
elmilan06 Mar 17, 2026
467ebdf
feat: extend control evaluation status with additional states and ref…
elmilan06 Mar 19, 2026
2d0baf9
feat: add evaluation rule and rule value to compliance evaluation DTO…
elmilan06 Mar 19, 2026
6102281
feat: include evaluation rule and rule value in query evaluation mode…
elmilan06 Mar 19, 2026
a904030
feat: enhance compliance control evaluation with search functionality
elmilan06 Mar 23, 2026
01e597a
feat: update application version file path for consistency
elmilan06 Mar 23, 2026
8ecf6b4
fix: implement sorting logic for compliance evaluations
elmilan06 Mar 24, 2026
88d0d7d
feat(agent): add native auditd collector for Linux
yllada Mar 27, 2026
527d744
feat(filters): add auditd support to linux filter v5.0.0
yllada Mar 27, 2026
f77ef28
refactor(filters): remove deprecated system_linux_module.yml
yllada Mar 27, 2026
c2aba9e
fix(filters): adjust auditd event severity handling in linux filter
yllada Mar 27, 2026
83eed3e
chore(agent): update version to 11.1.5
yllada Mar 27, 2026
7dbdce3
changeset[backend](linux): update linux filter
AlexSanchez-bit Mar 27, 2026
5b7cc19
fix(agent): prevent auditd buffer overflow with backpressure mitigation
yllada Mar 27, 2026
6cb6c41
fix(agent): reduce auditd log noise with threshold and execve filter
yllada Mar 30, 2026
272d2fa
fix(agent): filter false events lost from go-libaudit sequence rollover
yllada Mar 30, 2026
fbbb1af
feat(agent): expand auditd rules with log tampering and identity files
yllada Mar 30, 2026
2cf64e0
feat[backend](agent): added shell parameter to agent connection
AlexSanchez-bit Mar 30, 2026
ce1b932
feat[frontend](agent-console): added shell switch for windows agents …
AlexSanchez-bit Mar 30, 2026
8b9dc72
fix[backend](elastic-service): added space verification before removi…
AlexSanchez-bit Mar 31, 2026
5afe131
fix[backend](index-removal): added index verification before removal
AlexSanchez-bit Mar 31, 2026
95f9557
fix[backend](index-removal): fixed index state field obtention
AlexSanchez-bit Mar 31, 2026
fe5dde4
fix[backend](index-removal): fixed compilation errors on index removal
AlexSanchez-bit Mar 31, 2026
b62f094
changeset[backend](o365_visualization): updated o365 file upload visu…
AlexSanchez-bit Mar 31, 2026
c9a728e
changeset[backend](o365_visualization): updated o365 file sync downlo…
AlexSanchez-bit Mar 31, 2026
d56444b
changeset[backend](o365_visualization): updated o365 visualizations
AlexSanchez-bit Mar 31, 2026
71d2014
update windows-events filter
JocLRojas Apr 1, 2026
d1f96c6
feat[backend](dependencies): updated apache-tika to avoid vulnerable …
AlexSanchez-bit Apr 1, 2026
7eacc76
feat[backend](dependencies): updated flying-saucer-pdf dependency and…
AlexSanchez-bit Apr 1, 2026
109664b
fix(installer): enhance post-installation error handling and Docker s…
osmontero Apr 1, 2026
3ecb0c0
changeset[backend](windows_filter): updated windows filters
AlexSanchez-bit Apr 1, 2026
9bcca5a
changeset[backend](windows_rules): updated windows rules
AlexSanchez-bit Apr 1, 2026
f4936ec
feat[frotend](dependencies): updated dependencies for security improves
AlexSanchez-bit Apr 1, 2026
cca333e
changeset[backend](windows_rules): updated windows rules data types
AlexSanchez-bit Apr 1, 2026
a1a0342
fix(installer): security improvements and code cleanup
Kbayero Apr 2, 2026
cd79a09
feat(security): add OpenSearch SSL and authentication support
Kbayero Apr 2, 2026
909508e
feat[backend](updated filters and rules): added a initial process to …
AlexSanchez-bit Apr 2, 2026
3af0ef3
feat: add endpoint to retrieve latest evaluation by control ID
elmilan06 Apr 3, 2026
0c8f193
feat: enhance compliance evaluation mappers to load full Standard object
elmilan06 Apr 3, 2026
0baab17
feat(soc-ai): add multi-provider LLM support and HTTP API for manual …
Kbayero Apr 3, 2026
1f7443f
Merge branch 'release/v11.2.6' of https://github.com/utmstack/UTMStac…
Kbayero Apr 3, 2026
2145c70
feat(backend): add filters and rules to backend docker image
Kbayero Apr 3, 2026
ea7d894
fix(backend): update OpenSearch connection to use HTTPS with authenti…
Kbayero Apr 3, 2026
c779bd5
feat(panel): add manual alert analysis endpoint with SSL support
Kbayero Apr 3, 2026
f72e468
fix(backend): use analyzeAlert method in UtmAlertServiceImpl
Kbayero Apr 3, 2026
8f55081
feat[backend](updated filters and rules): added initial load service
AlexSanchez-bit Apr 3, 2026
8b96a58
feat[backend](updated filters and rules): added initial load service
AlexSanchez-bit Apr 3, 2026
820a1c7
feat[backend](updated filters and rules): forced systemOwnedMode on r…
AlexSanchez-bit Apr 3, 2026
bf78f42
feat[backend](updated filters and rules): added removed rules and fil…
AlexSanchez-bit Apr 3, 2026
c6d098f
feat[backend](updated filters and rules): forced filters adn rules to…
AlexSanchez-bit Apr 3, 2026
5fb23e0
feat[backend](updated filters and rules): set null to invalid module …
AlexSanchez-bit Apr 3, 2026
47acd6f
changeset[backend](socai): updated socai integration guide configuration
AlexSanchez-bit Apr 3, 2026
11fc5da
fix[frontend](integration-guide): fixed cisco asa and firepower commands
AlexSanchez-bit Apr 7, 2026
113d002
fix[backend](cypherUtil): make key|iv derivation be local instead of …
AlexSanchez-bit Apr 7, 2026
72e22d3
Merge remote-tracking branch 'origin/v11' into backlog/compliance-eva…
elmilan06 Apr 7, 2026
3ee3cd7
fix: correct query parameter for search
elmilan06 Mar 23, 2026
28656f5
fix: Corrected incorrect behavior in filtering
elmilan06 Mar 23, 2026
3a1988d
fix: update sorting direction for compliance evaluations
elmilan06 Mar 24, 2026
ab3ab54
feat: add print view for compliance evaluations with detailed report
elmilan06 Apr 3, 2026
3c4e2e0
feat: add print view for compliance evaluations with detailed report
elmilan06 Apr 3, 2026
282371e
feat: add print view for compliance evaluations with detailed report
elmilan06 Apr 3, 2026
f215e24
feat: add print view for compliance evaluations with detailed report
elmilan06 Apr 3, 2026
b2e9010
feat: add print view for compliance evaluations with detailed report
elmilan06 Apr 3, 2026
c53d170
feat: add print view for compliance evaluations with detailed report
elmilan06 Apr 3, 2026
8b63422
feat: add print view for compliance evaluations with detailed report
elmilan06 Apr 3, 2026
06e9990
feat: add print view for compliance evaluations with detailed report
elmilan06 Apr 3, 2026
e36994b
fix[backend](healthcheck): removed springboot healthcheck to allow cu…
AlexSanchez-bit Apr 7, 2026
d1f417d
Merge branch 'release/v11.2.6' of https://github.com/utmstack/UTMStac…
Kbayero Apr 8, 2026
0260a7f
Merge branch 'release/v11.2.6' of https://github.com/utmstack/UTMStac…
Kbayero Apr 8, 2026
031f1c1
Merge remote-tracking branch 'origin/release/v11.2.6' into backlog/co…
elmilan06 Apr 8, 2026
7c9a9c7
fix[backend](initial-setup): improved filter insertion on system load
AlexSanchez-bit Apr 8, 2026
941c847
fix[backend](initial-setup): improved filter deletion on initial setup
AlexSanchez-bit Apr 8, 2026
717bcc4
changeset[backend](data-types,modules): seeded data type - module rel…
AlexSanchez-bit Apr 8, 2026
a8bb858
fix[backend](initial-setup): improved error handling on failed to ins…
AlexSanchez-bit Apr 8, 2026
cd28b0e
fix[backend](initial-setup): fixed filter index error
AlexSanchez-bit Apr 8, 2026
5f41514
fix[backend](initial-setup):added RuleYml to parse rules yml
AlexSanchez-bit Apr 8, 2026
ca9e075
fix[backend](rules): fixed rules definitions
AlexSanchez-bit Apr 8, 2026
d05f323
feat[backend](log_events): added logs on every system admin operation
AlexSanchez-bit Apr 8, 2026
5ae77a1
Merge branch 'release/v11.2.6' of https://github.com/utmstack/UTMStac…
Kbayero Apr 9, 2026
c196ac7
fix[rules]: remove unused rules
Kbayero Apr 9, 2026
e7725e2
fix[baclend]: solve sintax problems in rules
Kbayero Apr 9, 2026
29fe2af
fix[backend]: solved problem with merge
Kbayero Apr 9, 2026
fe359c8
fix[backend](serialization): add @JsonIgnore to UtmModule lazy collec…
Kbayero Apr 9, 2026
9073eec
fix[agent-manager](security): prevent SQL injection in filters, add c…
Kbayero Apr 9, 2026
ce283c0
feat[backend,frontend](incident-response): add shell selection for Wi…
Kbayero Apr 9, 2026
dffce38
fix[frontend](soar): remove legacy automation route and update audit …
Kbayero Apr 9, 2026
23e8b9d
refactor(plugins): replace config polling with channel-based configur…
JocLRojas Apr 9, 2026
03d4e86
feat[soc-ai]: improve soc-ai integration
Kbayero Apr 9, 2026
84f038f
fix[backend,frontend,plugins](integrations): mask sensitive config va…
Kbayero Apr 9, 2026
edadfb6
fix[frontend](integrations): only clear saved tenant changes instead …
Kbayero Apr 9, 2026
9904393
Merge branch 'release/v11.2.6' of https://github.com/utmstack/UTMStac…
Kbayero Apr 9, 2026
13030a0
fix(modules-config): prevent single plugin failure from blocking all …
JocLRojas Apr 9, 2026
d5bee2c
Merge branch 'release/v11.2.6' of https://github.com/utmstack/UTMStac…
JocLRojas Apr 9, 2026
5dfc003
fix[backend,frontend]: add missing Constants import and remove duplic…
Kbayero Apr 9, 2026
19d04b0
Merge branch 'release/v11.2.6' of https://github.com/utmstack/UTMStac…
Kbayero Apr 9, 2026
c7611c5
feat: refactor OpenSearch integration with new connection model
elmilan06 Apr 10, 2026
8436126
feat: rename compliance configuration changelogs
elmilan06 Apr 10, 2026
db38d2c
Merge remote-tracking branch 'origin/release/v11.2.6' into backlog/co…
elmilan06 Apr 10, 2026
e5c05e2
Merge remote-tracking branch 'origin/backlog/compliance-evaluation' i…
elmilan06 Apr 10, 2026
2a6d876
fix: correct standardId binding in compliance control create component
elmilan06 Apr 10, 2026
9bda781
fix[frontend](alert-selection): improved selection/remove alert condi…
AlexSanchez-bit Apr 9, 2026
54b99d0
fix[modules-config](socai): fixed providers configuration
AlexSanchez-bit Apr 10, 2026
f9bd402
fix[frontend](socai_module_config): fixed saving state handling
AlexSanchez-bit Apr 10, 2026
60f108b
feat[modules-config](socai): generalized socai connection check and v…
AlexSanchez-bit Apr 10, 2026
58bd6b2
feat: trigger initial scheduler dispatch when backend configs are pre…
elmilan06 Apr 10, 2026
f020478
fix[frontend](alert-selection): improved selection/remove alert condi…
AlexSanchez-bit Apr 9, 2026
7c356b4
fix[modules-config](socai): fixed providers configuration
AlexSanchez-bit Apr 10, 2026
807fb6a
fix[frontend](socai_module_config): fixed saving state handling
AlexSanchez-bit Apr 10, 2026
b6787fb
feat[modules-config](socai): generalized socai connection check and v…
AlexSanchez-bit Apr 10, 2026
827d946
Merge remote-tracking branch 'origin/release/v11.2.6' into release/v1…
elmilan06 Apr 10, 2026
41666c5
Merge remote-tracking branch 'origin/backlog/compliance-evaluation' i…
elmilan06 Apr 10, 2026
8b4743e
fix[frontend](socai_alert_analyze): updated loading status inmediatel…
AlexSanchez-bit Apr 10, 2026
e5a326f
refactor(modules-config): improve resilience and code organization
JocLRojas Apr 10, 2026
147e2ef
feat: rename compliance configuration changelogs
elmilan06 Apr 10, 2026
5c8e80c
Merge remote-tracking branch 'origin/release/v11.2.6' into backlog/co…
elmilan06 Apr 10, 2026
304e956
Merge pull request #2024 from utmstack/backlog/compliance-evaluation
AlexSanchez-bit Apr 10, 2026
4d26712
fix[modules-config](socai): trimmend config values to avoid false pos…
AlexSanchez-bit Apr 13, 2026
96345fa
fix[modules-config](socai): send model on test request to avoid wrong…
AlexSanchez-bit Apr 13, 2026
86f10b6
fix[modules-config](socai): add little message on model test to manag…
AlexSanchez-bit Apr 13, 2026
9b94cd1
fix[modules-config](socai): manage gemini test response correctly
AlexSanchez-bit Apr 13, 2026
df6940a
fix[frontend](tooltips): moved tooltip position to body so they can b…
AlexSanchez-bit Apr 13, 2026
318b1b3
fix[frontend](alert-popup): fixed alert popup position
AlexSanchez-bit Apr 13, 2026
d725cc1
fix[backend](socai_model): removed model invalidation on custom provider
AlexSanchez-bit Apr 13, 2026
56a9733
fix[frontend](socai-analysis): fixed wait status on socai alert analysis
AlexSanchez-bit Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .github/workflows/reusable-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ on:
type: string
default: "clean install"
description: "Maven goals to execute"
copy_filters_and_rules:
required: false
type: boolean
default: false
description: "Copy filters and rules folders to build context"

jobs:
build:
Expand Down Expand Up @@ -99,6 +104,13 @@ jobs:
username: utmstack
password: ${{ secrets.GITHUB_TOKEN }}

- name: Copy filters and rules to build context
if: ${{ inputs.copy_filters_and_rules }}
run: |
cp -r filters ./${{ inputs.image_name }}/
cp -r rules ./${{ inputs.image_name }}/
echo "✅ Copied filters and rules to ./${{ inputs.image_name }}/"

- name: Build and Push the Image
uses: docker/build-push-action@v6
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/v11-deployment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ jobs:
use_tag_as_version: true
maven_profile: 'prod'
maven_goals: 'clean package'
copy_filters_and_rules: true

build_frontend:
name: Build Frontend Microservice
Expand Down
50 changes: 36 additions & 14 deletions agent-manager/agent/agent_imp.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,20 @@ type AgentService struct {
AgentStreamMap map[uint]AgentService_AgentStreamServer
AgentStreamMutex sync.Mutex
CacheAgentKey map[uint]string
CacheAgentKeyMutex sync.Mutex
CacheAgentKeyMutex sync.RWMutex
CommandResultChannel map[string]chan *CommandResult
CommandResultChannelM sync.Mutex

DBConnection *database.DB
}

func (s *AgentService) ValidateAgentKey(key string, id uint) bool {
s.CacheAgentKeyMutex.RLock()
defer s.CacheAgentKeyMutex.RUnlock()
_, valid := utils.IsKeyPairValid(key, id, s.CacheAgentKey)
return valid
}

func InitAgentService() error {
var err error
agentServOnce.Do(func() {
Expand Down Expand Up @@ -338,20 +345,35 @@ func (s *AgentService) ProcessCommand(stream PanelService_ProcessCommandServer)
return status.Errorf(codes.Internal, "failed to send command to agent: %v", err)
}

result := <-s.CommandResultChannel[cmdID]
err = s.DBConnection.Upsert(
&models.AgentCommand{},
"agent_id = ? AND cmd_id = ?",
map[string]interface{}{"command_status": models.Executed, "result": result.Result},
cmd.AgentId, cmdID,
)
if err != nil {
catcher.Error("failed to update command status", err, map[string]any{"process": "agent-manager"})
}
select {
case result := <-s.CommandResultChannel[cmdID]:
err = s.DBConnection.Upsert(
&models.AgentCommand{},
"agent_id = ? AND cmd_id = ?",
map[string]interface{}{"command_status": models.Executed, "result": result.Result},
cmd.AgentId, cmdID,
)
if err != nil {
catcher.Error("failed to update command status", err, map[string]any{"process": "agent-manager"})
}

err = stream.Send(result)
if err != nil {
return err
err = stream.Send(result)
if err != nil {
return err
}
case <-time.After(5 * time.Minute):
s.CommandResultChannelM.Lock()
delete(s.CommandResultChannel, cmdID)
s.CommandResultChannelM.Unlock()

_ = s.DBConnection.Upsert(
&models.AgentCommand{},
"agent_id = ? AND cmd_id = ?",
map[string]interface{}{"command_status": models.Error, "result": "command timed out after 5 minutes"},
cmd.AgentId, cmdID,
)

return status.Errorf(codes.DeadlineExceeded, "agent did not respond within 5 minutes")
}

s.CommandResultChannelM.Lock()
Expand Down
9 changes: 8 additions & 1 deletion agent-manager/agent/collector_imp.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,20 @@ type CollectorService struct {
CollectorConfigsCache map[uint][]*CollectorConfigGroup
CollectorConfigsCacheM sync.Mutex
CacheCollectorKey map[uint]string
CacheCollectorKeyMutex sync.Mutex
CacheCollectorKeyMutex sync.RWMutex
CollectorPendigConfigChan chan *CollectorConfig
CollectorTypes []enum.UTMModule

DBConnection *database.DB
}

func (s *CollectorService) ValidateCollectorKey(key string, id uint) bool {
s.CacheCollectorKeyMutex.RLock()
defer s.CacheCollectorKeyMutex.RUnlock()
_, valid := utils.IsKeyPairValid(key, id, s.CacheCollectorKey)
return valid
}

func InitCollectorService() {
collectorServOnce.Do(func() {
CollectorServ = &CollectorService{
Expand Down
8 changes: 4 additions & 4 deletions agent-manager/agent/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package agent

import (
"context"
_ "errors"
"crypto/subtle"
"fmt"
"strconv"
"strings"
Expand Down Expand Up @@ -79,11 +79,11 @@ func authHeaders(md metadata.MD, fullMethod string) error {
typ := strings.ToLower(connectorType[0])
switch typ {
case "agent":
if _, isValid := utils.IsKeyPairValid(key, uint(id), AgentServ.CacheAgentKey); !isValid {
if !AgentServ.ValidateAgentKey(key, uint(id)) {
return status.Error(codes.PermissionDenied, "invalid key")
}
case "collector":
if _, isValid := utils.IsKeyPairValid(key, uint(id), CollectorServ.CacheCollectorKey); !isValid {
if !CollectorServ.ValidateCollectorKey(key, uint(id)) {
return status.Error(codes.PermissionDenied, "invalid key")
}
default:
Expand All @@ -102,7 +102,7 @@ func authHeaders(md metadata.MD, fullMethod string) error {
}

func isInternalKeyValid(token string) bool {
return token == config.InternalKey
return subtle.ConstantTimeCompare([]byte(token), []byte(config.InternalKey)) == 1
}

func isInRoute(route string, list []string) bool {
Expand Down
6 changes: 5 additions & 1 deletion agent-manager/agent/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ func replaceSecretValues(input string) string {
return match
}
encryptedValue := matches[2]
decryptedValue, _ := utils.DecryptValue(config.EncryptionKey, encryptedValue)
decryptedValue, err := utils.DecryptValue(config.EncryptionKey, encryptedValue)
if err != nil {
catcher.Error("failed to decrypt secret value in command", err, map[string]any{"process": "agent-manager"})
return match
}
return decryptedValue
})
}
Expand Down
11 changes: 7 additions & 4 deletions agent-manager/utils/auth.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package utils

import (
"crypto/subtle"
"crypto/tls"
"net/http"
"strings"
Expand All @@ -19,10 +20,12 @@ func IsConnectionKeyValid(panelUrl string, token string) bool {
}

func IsKeyPairValid(key string, id uint, cache map[uint]string) (string, bool) {
for agentId, agentKey := range cache {
if key == agentKey && id == agentId {
return agentKey, true
}
agentKey, ok := cache[id]
if !ok {
return "", false
}
if subtle.ConstantTimeCompare([]byte(key), []byte(agentKey)) == 1 {
return agentKey, true
}
return "", false
}
37 changes: 27 additions & 10 deletions agent-manager/utils/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package utils

import (
"fmt"
"regexp"
"strings"

"gorm.io/gorm"
Expand All @@ -24,14 +25,14 @@ type Filter struct {
Value interface{}
}

func NewFilter(searchQuery string) []Filter {
defer func() {
if r := recover(); r != nil {
// Handle the panic here
fmt.Println("Panic occurred:", r)
}
}()
// validFieldName ensures the field name only contains safe characters (letters, digits, underscores)
var validFieldName = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`)

func IsValidFieldName(field string) bool {
return validFieldName.MatchString(field)
}

func NewFilter(searchQuery string) []Filter {
filters := make([]Filter, 0)
if searchQuery == "" {
return filters
Expand All @@ -42,11 +43,27 @@ func NewFilter(searchQuery string) []Filter {
}
for _, v := range query {
filter := strings.Split(v, "=")
if len(filter) != 2 {
continue
}
filerQuery := strings.Split(filter[0], ".")
if len(filerQuery) != 2 {
continue
}
field := filerQuery[0]
if !IsValidFieldName(field) {
fmt.Printf("Rejected invalid filter field: %s\n", field)
continue
}
op := resolveOperator(filerQuery[1])
if op == "" {
continue
}
filters = append(filters, Filter{
Field: filerQuery[0],
Op: resolveOperator(filerQuery[1]),
Value: filter[1]})
Field: field,
Op: op,
Value: filter[1],
})
}
return filters
}
Expand Down
14 changes: 13 additions & 1 deletion agent-manager/utils/paginator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@ func NewPaginator(limit int, page int, sort string) Pagination {
if len(sort) > 0 {
srt := make([]string, 0)
for _, s := range strings.Split(sort, "&") {
srt = append(srt, strings.Replace(s, ",", " ", 1))
parts := strings.SplitN(s, ",", 2)
field := parts[0]
if !IsValidFieldName(field) {
continue
}
direction := "asc"
if len(parts) == 2 {
d := strings.ToLower(strings.TrimSpace(parts[1]))
if d == "desc" {
direction = "desc"
}
}
srt = append(srt, field+" "+direction)
}
p.Sort = strings.Join(srt, ",")
}
Expand Down
9 changes: 9 additions & 0 deletions agent/cmd/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ var uninstallCmd = &cobra.Command{
if err = pb.DeleteAgent(cnf); err != nil {
utils.Logger.ErrorF("error deleting agent: %v", err)
}

// Uninstall dependencies (cleanup auditd rules, etc.)
fmt.Print("Cleaning up dependencies... ")
if err = dependency.UninstallAll(); err != nil {
fmt.Printf("Warning: %v\n", err)
} else {
fmt.Println("[OK]")
}

if err = collector.UninstallAll(); err != nil {
fmt.Printf("error uninstalling collectors: %v\n", err)
os.Exit(1)
Expand Down
24 changes: 24 additions & 0 deletions agent/collector/auditd/auditd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Package auditd provides a native collector for Linux Audit Framework events.
// It uses go-libaudit to receive events via netlink multicast and reassembles
// them before sending to the log queue.
package auditd

import "time"

const (
// auditdRestartDelay is the initial delay between reconnection attempts
auditdRestartDelay = 5 * time.Second

// auditdMaxRestartDelay is the maximum backoff delay for reconnection
auditdMaxRestartDelay = 5 * time.Minute

// reassemblerMaxInFlight is the maximum number of events held for reassembly
// Increased from 50 to 2048 to prevent buffer overflow under high event load
reassemblerMaxInFlight = 2048

// reassemblerTimeout is how long to wait for related messages before flushing
reassemblerTimeout = 2 * time.Second

// maintainInterval is how often to run Reassembler.Maintain() to flush stale events
maintainInterval = 500 * time.Millisecond
)
Loading
Loading