Skip to content

Refactor for prod#4

Open
ginaxu1 wants to merge 4 commits intomainfrom
refactor-for-prod
Open

Refactor for prod#4
ginaxu1 wants to merge 4 commits intomainfrom
refactor-for-prod

Conversation

@ginaxu1
Copy link
Copy Markdown
Collaborator

@ginaxu1 ginaxu1 commented Apr 29, 2026

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly hardens the Argus service by introducing a pluggable pipeline architecture with concurrent fan-out to multiple sinks, cryptographic non-repudiation through signature verification, and tamper-evident hash chaining. It also adds Prometheus metrics, Bearer token authentication, and high-performance batching capabilities to both the client and server. Feedback focuses on critical security and performance improvements: specifically, using constant-time comparisons for authentication tokens to prevent timing attacks, addressing race conditions and incorrect ordering in the Postgres hash-chaining logic, and optimizing the synchronous pipeline dispatch to avoid blocking the ingestion API.

Comment thread internal/middleware/auth.go
Comment thread internal/middleware/auth.go Outdated
Comment thread internal/pipeline/sinks/postgres.go Outdated
Comment thread internal/api/v1/services/audit_service.go Outdated
Comment thread internal/middleware/auth.go
Comment thread internal/pipeline/manager.go Outdated
Comment thread internal/pipeline/sinks/postgres.go Outdated
@ginaxu1 ginaxu1 force-pushed the refactor-for-prod branch from 43b1661 to 7ec30b7 Compare April 29, 2026 06:02
@ginaxu1
Copy link
Copy Markdown
Collaborator Author

ginaxu1 commented Apr 29, 2026

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a hardened architecture for Argus, introducing a pipeline-based sink system for concurrent log fan-out, cryptographic signature verification, and tamper-evident hash chaining. It also adds a bulk ingestion endpoint, Prometheus metrics, and Bearer token authentication. Technical feedback highlights a security vulnerability where the hash calculation omits several log fields, a performance bottleneck caused by write serialization in the database, and potential reliability issues including goroutine leaks and premature context cancellation in asynchronous tasks. There is also a recommendation to improve error handling to prevent silent data loss when the primary storage sink fails.

Comment thread internal/pipeline/sinks/postgres.go
Comment thread internal/api/v1/services/audit_service.go Outdated
Comment thread internal/pipeline/sinks/postgres.go
Comment thread internal/pipeline/manager.go Outdated
Comment thread internal/pipeline/manager.go
@ginaxu1 ginaxu1 force-pushed the refactor-for-prod branch from 00b8150 to 916f58e Compare April 29, 2026 23:00
sthanikan2000
sthanikan2000 previously approved these changes May 1, 2026
Copy link
Copy Markdown

@sthanikan2000 sthanikan2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

2 participants