Skip to content

fix[agent-manager](agent/agent_grpc): fixed sql tenant injection erro… - #2502

Merged
AlexSanchez-bit merged 1 commit into
release/v12.0.0from
backlog/v12_agents_list
Aug 21, 2026
Merged

fix[agent-manager](agent/agent_grpc): fixed sql tenant injection erro…#2502
AlexSanchez-bit merged 1 commit into
release/v12.0.0from
backlog/v12_agents_list

Conversation

@AlexSanchez-bit

Copy link
Copy Markdown
Contributor

sue that this pull request addresses.

@github-actions

Copy link
Copy Markdown

🛑 AI review — High/critical findings

One or more high/critical issues were found. Please review and fix before merging if they're real.

⚠️ architecture (gemini-3-flash-lite) — minor findings

Summary: Refactored ListAgents filter logic to use structured utils.Filter instead of manual SQL string formatting.

  • medium agent-manager/agent/agent_imp.go:252 — Direct database query handling inside gRPC service implementation. Consider moving database access logic to a dedicated repository or data access layer to maintain separation of concerns.

🛑 bugs (gemini-3-flash-lite) — high/critical — please review

Summary: Undefined variable 'filter' used in ListAgents pagination query builder.

  • high agent-manager/agent/agent_imp.go:255 — Use of undefined variable 'filter' on line 255 (append) when it is not declared before being used, which will cause a compilation error. Declare 'filter := []utils.Filter{}' earlier in the function.

security (gemini-3-flash-lite) — clean

Summary: Replaced vulnerable string-formatted SQL WHERE clause with parameterized/filtered query builder for tenant IDs.

No findings.

🔴 go-deps — pending updates

🔍 Discovered 30 Go projects

📦 Dependencies with updates available:

  📁 ./plugins/crowdstrike:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/azure:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/soc-ai:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/events:
     - github.com/threatwinds/go-sdk: v1.1.27-0.20260811073440-251cb9d842cd → v1.1.31

  📁 ./plugins/gcp:
     - cloud.google.com/go/pubsub: v1.51.0 → v1.51.1
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/bitdefender:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/o365:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/rule-flood-guard:
     - github.com/threatwinds/go-sdk: v1.1.27-0.20260811073440-251cb9d842cd → v1.1.31

  📁 ./plugins/stats:
     - github.com/threatwinds/go-sdk: v1.1.27-0.20260811073440-251cb9d842cd → v1.1.31

  📁 ./plugins/feeds:
     - github.com/threatwinds/go-sdk: v1.1.27-0.20260811073440-251cb9d842cd → v1.1.31

  📁 ./plugins/geolocation:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/playground:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/soar:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/sophos:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./plugins/alerts:
     - github.com/threatwinds/go-sdk: v1.1.27-0.20260811073440-251cb9d842cd → v1.1.31

  📁 ./plugins/aws:
     - github.com/aws/aws-sdk-go-v2: v1.43.6 → v1.43.7
     - github.com/aws/aws-sdk-go-v2/config: v1.32.37 → v1.32.38
     - github.com/aws/aws-sdk-go-v2/credentials: v1.19.36 → v1.19.37
     - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs: v1.82.2 → v1.82.3
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./log-input:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31
     - google.golang.org/grpc: v1.83.0 → v1.83.1

  📁 ./backend:
     - cloud.google.com/go/pubsub: v1.51.0 → v1.51.1
     - github.com/aws/aws-sdk-go-v2/config: v1.32.36 → v1.32.38
     - github.com/aws/aws-sdk-go-v2/credentials: v1.19.35 → v1.19.37
     - github.com/aws/aws-sdk-go-v2/service/sts: v1.45.5 → v1.45.7
     - google.golang.org/grpc: v1.83.0 → v1.83.1

  📁 ./collectors/collector:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31
     - google.golang.org/grpc: v1.83.0 → v1.83.1

  📁 ./collectors/forwarder:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31
     - google.golang.org/grpc: v1.83.0 → v1.83.1

  📁 ./collectors/as400:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31
     - google.golang.org/grpc: v1.83.0 → v1.83.1

  📁 ./collectors/utmstack:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31
     - google.golang.org/grpc: v1.83.0 → v1.83.1

  📁 ./tools/rulecheck:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31

  📁 ./agent-manager:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31
     - google.golang.org/grpc: v1.83.0 → v1.83.1

  📁 ./agent:
     - github.com/threatwinds/go-sdk: v1.1.28 → v1.1.31
     - google.golang.org/grpc: v1.83.0 → v1.83.1

❌ Please update dependencies before merging.

@AlexSanchez-bit

Copy link
Copy Markdown
Contributor Author

filter is created right before its use, sql queries are handled on the repository component using the utils.Filter array, thats exactly the change, before sql queries were being created with string interpolation, this way the filter implementation will be responsable on the quey creation step instead of raw sql strings being injected

@AlexSanchez-bit
AlexSanchez-bit merged commit f4462c5 into release/v12.0.0 Aug 21, 2026
1 check passed
@AlexSanchez-bit
AlexSanchez-bit deleted the backlog/v12_agents_list branch August 21, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant