Conversation
…ization Security fixes: - Fix IDOR: add GetByTenantAndID to 15 tenant-scoped repositories - Fix OAuth open redirect: validate redirect_uri against allowed origins - Fix command injection: validate ExtraArgs in scan executors (vulnscan + recon) - Fix SSRF: validate webhook/integration/template source URLs - Fix X-Forwarded header injection: validate Proto and Host values - Fix password reset token race condition: clear token before password update - Fix encryption key crash: handle missing APP_ENCRYPTION_KEY gracefully Performance: - Fix GetStats: use SQL aggregation instead of loading 1000 assets in memory - Fix HasFindings filter: use EXISTS subquery (finding_count is computed, not a column) - Fix BulkUpdateAssetStatus: use atomic single-query UPDATE instead of N+1 loop - Add compound index (tenant_id, asset_type, criticality, status) - Add FindingSeverityCounts to asset API response Testing: - Add 70+ security tests (SSRF, ExtraArgs, OAuth redirect, header validation) - Update 13 mock repos for new GetByTenantAndID interface - Fix auth test for 2-step password reset flow Database: - Fix migration numbering conflict (000096 duplicate) - Add migration 000099 for performance indexes
Replace per-finding loop (N SELECT + N UPDATE queries) with: - Batch fetch via GetByIDs (1 SELECT with ANY clause) - In-memory workflow transition validation - Batch update via UpdateStatusBatch (1 UPDATE) Total: 2 queries instead of 2N queries. Also: - Add FindingRepository.GetByIDs interface + postgres implementation - Add GetByIDs stubs to 6 test mock files - Fix staticcheck: remove unused stubContext, fix nil context
Add properties field to AssetResponse so CTIS properties (OS, version, enabled status, DNS hostname, etc.) collected by the asset-inventory agent are returned in the API response alongside metadata.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
injection, token race condition)
Test plan
go build ./cmd/server/passesgo test ./tests/unit/...passes (12.5s)go vet ./...clean