Skip to content

Comments

feature: SeaWatch module foundation#534

Merged
NathaelB merged 13 commits intomainfrom
feature/seawatch-module-foundation
Nov 21, 2025
Merged

feature: SeaWatch module foundation#534
NathaelB merged 13 commits intomainfrom
feature/seawatch-module-foundation

Conversation

@NathaelB
Copy link
Member

No description provided.

brogouh and others added 8 commits November 9, 2025 01:45
  - Add SecurityEvent struct with realm_id, metadata, ip tracking
  - Fix syntax errors in Display implementation
  - Support for multi-tenant security event logging #317
  - Add SecurityEventRepository trait with store_event, get_events, count_events methods
  - Add SecurityEventPolicy trait for permission checks
  - Add SecurityEventFilter value object for flexible event filtering
  - Add EventExportRequest and ExportFormat for future export functionality
…_by_id, count_events

- Add SecurityEventPolicy trait with can_view_events, can_export_events
- Add SecurityEventFilter value object for flexible filtering with pagination
- Add EventExportRequest and ExportFormat for future export features
- Add public re-exports in mod.rs for cleaner imports
- Add ActorType enum (user, service_account, admin, system)
- Add EventStatus enum (success, failure)
- Add new event types: PasswordReset, UserCreated, UserDeleted, ClientCreated, ClientDeleted
- Restructure SecurityEvent: actor_id/actor_type, status, target_type/target_id, resource, trace_id
- Rename metadata to details for consistency
- Add builder pattern methods (with_actor, with_target, with_context, with_details)

Replace async_trait with native impl Future in repository traits
Add SeaWatch domain, entities, repository and DB migration. Introduce
SecurityEventId wrapper, SeaORM entity and mapper, convert Postgres
repository to async fns and adjust ports/value objects. Add frontend
SeaWatch pages, nav, routes and UI components plus a React Query toggle.
Add SecurityEventRepository (SE) as a generic to service types and
implementations across domains. Wire PostgresSecurityEventRepository
into application setup. Update SecurityEvent::new to accept actor_id and
record security events (e.g. role create/delete, client create). Add
mocking and test plumbing for the security event repository.
@NathaelB NathaelB self-assigned this Nov 19, 2025
@NathaelB NathaelB changed the title Feature/seawatch module foundation feature: SeaWatch module foundation Nov 19, 2025
Extract SecurityMetrics, StrangeEventsAnalysis and FlaggedUsers into
separate components and update PageOverview to use them Add a
prop-driven FlaggedUsers component and move inline widgets into new
files
Implement HTTP handler, router and OpenAPI docs. Add core seawatch
modules: policies, services, ports and value objects (FetchEventsInput),
derive PartialEq for SecurityEvent, and wire the service into the HTTP
server and API docgen.
@NathaelB NathaelB requested a review from LeadcodeDev November 21, 2025 15:29
@NathaelB NathaelB merged commit af01b91 into main Nov 21, 2025
8 checks passed
@NathaelB NathaelB deleted the feature/seawatch-module-foundation branch November 21, 2025 16:15
NolwennD pushed a commit to NolwennD/ferriskey that referenced this pull request Nov 22, 2025
* - Add SecurityEventType enum with login, role, realm, client events
  - Add SecurityEvent struct with realm_id, metadata, ip tracking
  - Fix syntax errors in Display implementation
  - Support for multi-tenant security event logging ferriskey#317

* add ports and value objects for security events

  - Add SecurityEventRepository trait with store_event, get_events, count_events methods
  - Add SecurityEventPolicy trait for permission checks
  - Add SecurityEventFilter value object for flexible event filtering
  - Add EventExportRequest and ExportFormat for future export functionality

* - Add SecurityEventRepository trait with store_event, get_events, get_by_id, count_events
- Add SecurityEventPolicy trait with can_view_events, can_export_events
- Add SecurityEventFilter value object for flexible filtering with pagination
- Add EventExportRequest and ExportFormat for future export features
- Add public re-exports in mod.rs for cleaner imports

* Restructure domain layer to match specification from discussion ferriskey#273:
- Add ActorType enum (user, service_account, admin, system)
- Add EventStatus enum (success, failure)
- Add new event types: PasswordReset, UserCreated, UserDeleted, ClientCreated, ClientDeleted
- Restructure SecurityEvent: actor_id/actor_type, status, target_type/target_id, resource, trace_id
- Rename metadata to details for consistency
- Add builder pattern methods (with_actor, with_target, with_context, with_details)

Replace async_trait with native impl Future in repository traits

* add database migration for security_events table

* add infrastructure layer with mapper and repository

* feat: add SeaWatch security events feature

Add SeaWatch domain, entities, repository and DB migration. Introduce
SecurityEventId wrapper, SeaORM entity and mapper, convert Postgres
repository to async fns and adjust ports/value objects. Add frontend
SeaWatch pages, nav, routes and UI components plus a React Query toggle.

* feat: integrate SecurityEventRepository across services

Add SecurityEventRepository (SE) as a generic to service types and
implementations across domains. Wire PostgresSecurityEventRepository
into application setup. Update SecurityEvent::new to accept actor_id and
record security events (e.g. role create/delete, client create). Add
mocking and test plumbing for the security event repository.

* fix: remove unused Settings import from nav-security

* fix: refactor SeaWatch overview into UI components

Extract SecurityMetrics, StrangeEventsAnalysis and FlaggedUsers into
separate components and update PageOverview to use them Add a
prop-driven FlaggedUsers component and move inline widgets into new
files

* feat: add Seawatch HTTP module and handler stub

* feat: add Seawatch security-events endpoint

Implement HTTP handler, router and OpenAPI docs. Add core seawatch
modules: policies, services, ports and value objects (FetchEventsInput),
derive PartialEq for SecurityEvent, and wire the service into the HTTP
server and API docgen.

* fix: eslint rules

---------

Co-authored-by: brogouh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants