Skip to content

Missing audit log entries for failed authentication attempts #899

Description

@hman38705

Labels: security, observability, api

Priority: Medium

Description

src/audit_middleware.rs captures audit events for admin operations but does not log failed authentication attempts. Without this, brute-force attacks against the API are invisible in the audit trail.

Acceptance Criteria

  • Add audit log entries for authentication failures (invalid API key, expired token, missing credentials)
  • Include the attempted key prefix (first 4 chars, masked), client IP, and user agent in the failure record
  • Add a Prometheus counter auth_failures_total with labels for failure reason
  • Add a test that verifies a 401 response produces an audit log entry

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programapiAPI handlers and routingobservabilityTracing, logging, and visibilitysecuritySecurity vulnerabilities and hardening

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions